fix loader check (#144)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
__felix__andgithub-actions[bot] authored and GitHub committed 2026-07-29 11:52:12 -04:00
1 parent aec32b9149
commit fc58f5346c
4 files changed
+8 -6

No files matched your search

@@ -479,7 +479,7 @@ public class AlchemicalWizardry {
public static int ritualWeakCostThunderstorm;
public static int ritualWeakCostZombie;
public static boolean isGregTechLoaded;
public static boolean isGregTech5UnofficialNewHorizonsLoaded;
public static boolean isThaumcraftLoaded;
public static boolean isForestryLoaded;
public static boolean isBotaniaLoaded;
@@ -3246,7 +3246,7 @@ public class AlchemicalWizardry {
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
proxy.registerPostSideObjects();
isGregTechLoaded = Loader.isModLoaded("gregtech");
isGregTech5UnofficialNewHorizonsLoaded = Loader.isModLoaded("gregtech_nh");
isEndlessIdsLoaded = Loader.isModLoaded("endlessids");
// TODO Thaumcraft Integration
if (Loader.isModLoaded("Thaumcraft")) {
@@ -125,7 +125,8 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
dropMultiset.add(new ItemType(block, meta));
} else {
ArrayList<ItemStack> itemDropList;
if (AlchemicalWizardry.isGregTechLoaded && block instanceof GTBlockOre ore) {
if (AlchemicalWizardry.isGregTech5UnofficialNewHorizonsLoaded
&& block instanceof GTBlockOre ore) {
itemDropList = ore.getDropsForPlayer(world, x, y, z, meta, fortuneLvl, player);
} else {
itemDropList = block.getDrops(world, x, y, z, meta, fortuneLvl);
@@ -36,7 +36,7 @@ public class RitualEffectMagnetic extends RitualEffect {
public static boolean isBlockOre(Block block, int meta) {
// Special case for lit redstone ore
if (block instanceof BlockOre || block instanceof BlockRedstoneOre
|| (AlchemicalWizardry.isGregTechLoaded && block instanceof GTBlockOre)) {
|| (AlchemicalWizardry.isGregTech5UnofficialNewHorizonsLoaded && block instanceof GTBlockOre)) {
return true;
}
@@ -160,7 +160,8 @@ public class Meteor {
if (blockStack != null && blockStack.getItem() instanceof ItemBlock) {
((ItemBlock) blockStack.getItem())
.placeBlockAt(blockStack, null, world, x, y, z, 0, 0, 0, 0, blockStack.getItemDamage());
if (AlchemicalWizardry.isGregTechLoaded) setGTOresNaturalIfNeeded(world, x, y, z);
if (AlchemicalWizardry.isGregTech5UnofficialNewHorizonsLoaded)
setGTOresNaturalIfNeeded(world, x, y, z);
world.markBlockForUpdate(x, y, z);
break;
}
@@ -230,7 +231,7 @@ public class Meteor {
this.fillerChance = Math.max(0f, Math.min(100f * (1 - ((float) getTotalListWeight(ores) / maxWeight)), 100.0f));
}
@Optional.Method(modid = "gregtech")
@Optional.Method(modid = "gregtech_nh")
private static void setGTOresNaturalIfNeeded(World world, int x, int y, int z) {
try (OreInfo<?> info = OreManager.getOreInfo(world, x, y, z)) {
if (info == null) return;