From 209fed5f81d563b794e465080aaac5c024b9cb8f Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Thu, 28 Apr 2022 21:45:37 +0800 Subject: [PATCH] Add suport of using the GT miners to mine the ores from the BloodMagic ritual "Mark of the Falling Tower" (#23) * Add suport of using the GT miners to mine the ores from the BloodMagic ritual "Mark of the Falling Tower" * Optional GT --- dependencies.gradle | 5 +++++ .../alchemicalWizardry/AlchemicalWizardry.java | 2 ++ .../common/summoning/meteor/MeteorParadigm.java | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index f302dfea..5dae3fe1 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,6 +1,11 @@ // Add your dependencies here dependencies { + + compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.31:dev") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:Botania:master-SNAPSHOT:api") { transitive = false } diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 3b08f1ff..8dd8d8d0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -278,6 +278,7 @@ public class AlchemicalWizardry public static int ritualWeakCostThunderstorm; public static int ritualWeakCostZombie; + public static boolean isGregTechLoaded; public static boolean isThaumcraftLoaded; public static boolean isForestryLoaded; public static boolean isBotaniaLoaded; @@ -1061,6 +1062,7 @@ public class AlchemicalWizardry public void postInit(FMLPostInitializationEvent event) { proxy.registerPostSideObjects(); + isGregTechLoaded = Loader.isModLoaded("gregtech"); //TODO Thaumcraft Integration if (Loader.isModLoaded("Thaumcraft")) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java index 3e51f5e4..d8dfd1b9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java @@ -4,9 +4,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import cpw.mods.fml.common.Optional; +import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; @@ -123,7 +126,9 @@ public class MeteorParadigm ItemStack blockStack = mpc.getValidBlockParadigm(); if(blockStack != null && blockStack.getItem() instanceof ItemBlock) { - ((ItemBlock)blockStack.getItem()).placeBlockAt(blockStack, null, world, x + i, y + j, z + k, 0, 0, 0, 0, blockStack.getItemDamage()); + ((ItemBlock)blockStack.getItem()).placeBlockAt(blockStack, null, world, x + i, y + j, z + k, 0, 0, 0, 0, blockStack.getItemDamage()); + if (AlchemicalWizardry.isGregTechLoaded) + setGTOresNaturalIfNeeded(world, x + i, y + j, z + k); world.markBlockForUpdate(x + i, y + j, z + k); hasPlacedBlock = true; break; @@ -179,4 +184,12 @@ public class MeteorParadigm } } } + + @Optional.Method(modid = "gregtech") + private static void setGTOresNaturalIfNeeded(World world, int x, int y, int z) { + final TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof GT_TileEntity_Ores) { + ((GT_TileEntity_Ores) tileEntity).mNatural = true; + } + } }