Compare commits

...
3 Commits
Author SHA1 Message Date
boubou19 9b7b10e5c3 Cache enum .values() (#146) 2026-08-10 20:58:12 +02:00
__felix__andgithub-actions[bot] fc58f5346c fix loader check (#144)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-29 11:52:12 -04:00
koolkrafter5 aec32b9149 Make blood orb stacks in NEI size 0 (#142) 2026-07-26 22:59:16 +00:00
7 changed files with 14 additions and 10 deletions

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")) {
@@ -43,7 +43,7 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
ArrayList<ItemStack> orbs = new ArrayList<>();
for (Item item : getBloodOrbs()) {
if (((IBloodOrb) item).getOrbLevel() >= i) {
orbs.add(new ItemStack(item));
orbs.add(new ItemStack(item, 0));
}
}
PositionedStack stack = new PositionedStack(orbs, 25 + x * 18, 6 + y * 18, false);
@@ -42,7 +42,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
ArrayList<ItemStack> orbs = new ArrayList<>();
for (Item item : NEIConfig.getBloodOrbs()) {
if (((IBloodOrb) item).getOrbLevel() >= i) {
orbs.add(new ItemStack(item));
orbs.add(new ItemStack(item, 0));
}
}
@@ -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);
@@ -205,6 +205,8 @@ public class ItemIncense extends Item implements IIncense {
GREEN(1500, 2400, 4.0f, 2000, 0, 1.0f, 0),
PURPLE(2400, 3500, 5.0f, 2000, 1.0f, 0, 1.0f);
public static final EnumIncense[] VALUES = values();
public final int minValue;
public final int maxValue;
public final float tickRate;
@@ -226,10 +228,10 @@ public class ItemIncense extends Item implements IIncense {
}
public static EnumIncense getEnumForIndex(int index) {
if (index > EnumIncense.values().length || index < 0) {
if (index > EnumIncense.VALUES.length || index < 0) {
return WOODASH;
} else {
return EnumIncense.values()[index];
return EnumIncense.VALUES[index];
}
}
}
@@ -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;