-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mixin to disable Vertical Slab Compat from making vertical slabs …
…of copycat slabs. Fixes #178
- Loading branch information
1 parent
67fed1c
commit 6ac3a15
Showing
7 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
.../com/copycatsplus/copycats/mixin/compat/verticalslabcompat/CutBlockTypeRegistryMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.copycatsplus.copycats.mixin.compat.verticalslabcompat; | ||
|
||
import com.copycatsplus.copycats.Copycats; | ||
import com.copycatsplus.copycats.compat.Mods; | ||
import com.copycatsplus.copycats.foundation.annotation.ModMixin; | ||
import net.mehvahdjukaar.moonlight.api.set.BlockTypeRegistry; | ||
import net.mehvahdjukaar.vsc.CutBlockType; | ||
import net.mehvahdjukaar.vsc.CutBlockTypeRegistry; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.level.block.Block; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
import java.util.Optional; | ||
|
||
@ModMixin(requiredMods = Mods.VERTICAL_SLAB_COMPAT) | ||
@Mixin(value = CutBlockTypeRegistry.class, remap = false) | ||
public class CutBlockTypeRegistryMixin { | ||
|
||
@Inject(method = "detectTypeFromBlock", at = @At("HEAD"), cancellable = true) | ||
private void copycats$disableVerticalCompat(Block block, ResourceLocation baseRes, CallbackInfoReturnable<Optional<CutBlockType>> cir) { | ||
if (baseRes.getNamespace().equals(Copycats.MODID)) cir.setReturnValue(Optional.empty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters