Change infinity armor and block Optional decorators to work with gt6 (#50)

Co-authored-by: __felix__ <134875831+48a3efa65c881ef567345b17f3910e06@users.noreply.github.com>
This commit is contained in:
__felix__and__felix__ authored and GitHub committed 2025-04-24 22:21:32 +00:00
1 parent cfc8366b5b
commit e475ce69e7
3 files changed
+8 -4

No files matched your search

@@ -69,7 +69,7 @@ public class BlockResource extends Block {
}
@Override
@Optional.Method(modid = "gregtech")
@Optional.Method(modid = "gregtech_nh")
public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
if (GregTechAPI.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ);
@@ -77,7 +77,7 @@ public class BlockResource extends Block {
}
@Override
@Optional.Method(modid = "gregtech")
@Optional.Method(modid = "gregtech_nh")
public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
if (GregTechAPI.isMachineBlock(this, aMetaData)) {
GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ);
@@ -51,6 +51,10 @@ public class Compat {
ae2 = Loader.isModLoaded("appliedenergistics2") && Config.ae2;
exu = Loader.isModLoaded("ExtraUtilities") && Config.exu;
ic2 = Loader.isModLoaded("IC2") && Config.ic2;
// NOTE: This will only work with gt5 unless you add ` && !Loader.isModLoaded("gregapi")`.
// This doesn't cause errors with gt6 now, but it might if anyone plans on using it specifically as a *gt5*
// check
// Also if you want a GTNH *specific* feature to have compat, use new modid gregtech_nh.
gt = Loader.isModLoaded("gregtech") && Config.gt;
botan = Loader.isModLoaded("Botania") && Config.botan;
blood = Loader.isModLoaded("AWWayofTime") && Config.blood;
@@ -55,7 +55,7 @@ import vazkii.botania.api.mana.IManaDiscountArmor;
@Optional.Interface(iface = "vazkii.botania.api.item.IPhantomInkable", modid = "Botania"),
@Optional.Interface(iface = "vazkii.botania.api.mana.IManaDiscountArmor", modid = "Botania"),
@Optional.Interface(iface = "vazkii.botania.api.item.IManaProficiencyArmor", modid = "Botania"),
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech") })
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh") })
public class ItemArmorInfinity extends ItemArmor implements ICosmicRenderItem, IGoggles, IRevealer, IVisDiscountGear,
IPhantomInkable, IManaDiscountArmor, IManaProficiencyArmor, IHazardProtector {
@@ -367,7 +367,7 @@ public class ItemArmorInfinity extends ItemArmor implements ICosmicRenderItem, I
}
/// GT5 Hazmat protection
@Optional.Method(modid = "gregtech")
@Optional.Method(modid = "gregtech_nh")
@Override
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
return true;