diff --git a/dependencies.gradle b/dependencies.gradle index 140679d1a..60e303570 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -67,5 +67,7 @@ dependencies { implementation rfg.deobf("curse.maven:athenaeum-284350:4633750") implementation rfg.deobf("curse.maven:dropt-284973:5405050") + compileOnly rfg.deobf("curse.maven:yungs-better-mineshafts-forge-389665:3247154") + api("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700") } diff --git a/src/main/java/supersymmetry/mixins/SuSyLateMixinLoader.java b/src/main/java/supersymmetry/mixins/SuSyLateMixinLoader.java index e40989be8..e8c6fc137 100644 --- a/src/main/java/supersymmetry/mixins/SuSyLateMixinLoader.java +++ b/src/main/java/supersymmetry/mixins/SuSyLateMixinLoader.java @@ -9,7 +9,7 @@ public class SuSyLateMixinLoader implements ILateMixinLoader { - public static final List modMixins = ImmutableList.of("bdsandm", "gregtech", "mcjtylib_ng", "xnet", "travelersbackpack"); + public static final List modMixins = ImmutableList.of("bdsandm", "gregtech", "mcjtylib_ng", "xnet", "travelersbackpack", "yungs"); @Override public List getMixinConfigs() { diff --git a/src/main/java/supersymmetry/mixins/yungs/MixinSideRoom.java b/src/main/java/supersymmetry/mixins/yungs/MixinSideRoom.java new file mode 100644 index 000000000..4966cb403 --- /dev/null +++ b/src/main/java/supersymmetry/mixins/yungs/MixinSideRoom.java @@ -0,0 +1,23 @@ +package supersymmetry.mixins.yungs; + +import com.yungnickyoung.minecraft.bettermineshafts.world.generator.pieces.MineshaftPiece; +import com.yungnickyoung.minecraft.bettermineshafts.world.generator.pieces.SideRoom; +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.state.IBlockState; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(SideRoom.class) +public abstract class MixinSideRoom extends MineshaftPiece { + + @Redirect(method = "addComponentParts", at = @At(value = "INVOKE", target = "Lcom/yungnickyoung/minecraft/bettermineshafts/world/generator/pieces/SideRoom;setBlockState(Lnet/minecraft/world/World;Lnet/minecraft/block/state/IBlockState;IIILnet/minecraft/world/gen/structure/StructureBoundingBox;)V")) + private void susycore$removeFurnace(SideRoom instance, World world, IBlockState iBlockState, int i1, int i2, int i3, StructureBoundingBox structureBoundingBox) { + if (iBlockState.getBlock() instanceof BlockFurnace) { + setBlockState(world, AIR, i1, i2, i3, structureBoundingBox); + } + } + +} diff --git a/src/main/java/supersymmetry/mixins/yungs/MixinZombieVillagerRoom.java b/src/main/java/supersymmetry/mixins/yungs/MixinZombieVillagerRoom.java new file mode 100644 index 000000000..638c90f86 --- /dev/null +++ b/src/main/java/supersymmetry/mixins/yungs/MixinZombieVillagerRoom.java @@ -0,0 +1,23 @@ +package supersymmetry.mixins.yungs; + +import com.yungnickyoung.minecraft.bettermineshafts.world.generator.pieces.MineshaftPiece; +import com.yungnickyoung.minecraft.bettermineshafts.world.generator.pieces.ZombieVillagerRoom; +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.state.IBlockState; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(ZombieVillagerRoom.class) +public abstract class MixinZombieVillagerRoom extends MineshaftPiece { + + @Redirect(method = "addComponentParts", at = @At(value = "INVOKE", target = "Lcom/yungnickyoung/minecraft/bettermineshafts/world/generator/pieces/ZombieVillagerRoom;setBlockState(Lnet/minecraft/world/World;Lnet/minecraft/block/state/IBlockState;IIILnet/minecraft/world/gen/structure/StructureBoundingBox;)V")) + private void susycore$removeFurnace(ZombieVillagerRoom instance, World world, IBlockState iBlockState, int i1, int i2, int i3, StructureBoundingBox structureBoundingBox) { + if (iBlockState.getBlock() instanceof BlockFurnace) { + setBlockState(world, AIR, i1, i2, i3, structureBoundingBox); + } + } + +} diff --git a/src/main/resources/mixins.susy.yungs.json b/src/main/resources/mixins.susy.yungs.json new file mode 100644 index 000000000..1445a1779 --- /dev/null +++ b/src/main/resources/mixins.susy.yungs.json @@ -0,0 +1,11 @@ +{ + "package" : "supersymmetry.mixins.yungs", + "refmap" : "mixins.susy.refmap.json", + "target" : "@env(DEFAULT)", + "minVersion" : "0.8", + "compatibilityLevel" : "JAVA_8", + "mixins" : [ + "MixinSideRoom", + "MixinZombieVillagerRoom" + ] +}