diff --git a/dependencies.gradle b/dependencies.gradle index a75aada..e25955b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -37,6 +37,7 @@ dependencies { // api("com.github.GTNewHorizons:GT5-Unofficial:5.09.48.66:dev") compileOnly ('org.jetbrains:annotations:24.1.0') api("com.github.GTNewHorizons:Draconic-Evolution:1.3.5-GTNH:dev") - implementation('com.github.GTNewHorizons:Baubles:1.0.4:dev') + implementation("com.github.GTNewHorizons:Botania:1.11.3-GTNH:dev") + implementation("com.github.GTNewHorizons:Baubles:1.0.4:dev") implementation("com.github.GTNewHorizons:ae2stuff:0.8.2-GTNH:dev") } diff --git a/src/main/java/com/xir/NHUtilities/common/CommonProxy.java b/src/main/java/com/xir/NHUtilities/common/CommonProxy.java index e8e705c..b3166b5 100644 --- a/src/main/java/com/xir/NHUtilities/common/CommonProxy.java +++ b/src/main/java/com/xir/NHUtilities/common/CommonProxy.java @@ -3,6 +3,7 @@ import net.minecraftforge.common.MinecraftForge; import com.xir.NHUtilities.common.nhutilies.events.GluttonyRingEvent; +import com.xir.NHUtilities.config.Config; import com.xir.NHUtilities.loader.ItemLoader; import com.xir.NHUtilities.loader.NHUtilitiesRecipe; @@ -14,8 +15,10 @@ public class CommonProxy { public void preInit(FMLPreInitializationEvent event) { - ItemLoader.registerNHUtilitiesItems(); - MinecraftForge.EVENT_BUS.register(new GluttonyRingEvent()); + if (Config.enableGluttonyRingAndHungerRing) { + ItemLoader.registerNHUtilitiesItems(); + MinecraftForge.EVENT_BUS.register(new GluttonyRingEvent()); + } } public void init(FMLInitializationEvent event) { diff --git a/src/main/java/com/xir/NHUtilities/common/nhutilies/events/GluttonyRingEvent.java b/src/main/java/com/xir/NHUtilities/common/nhutilies/events/GluttonyRingEvent.java index 2e0c042..08e7762 100644 --- a/src/main/java/com/xir/NHUtilities/common/nhutilies/events/GluttonyRingEvent.java +++ b/src/main/java/com/xir/NHUtilities/common/nhutilies/events/GluttonyRingEvent.java @@ -11,13 +11,15 @@ import com.xir.NHUtilities.common.nhutilies.items.GluttonyRing; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import vazkii.botania.common.item.ModItems; public class GluttonyRingEvent { @SubscribeEvent public void onGluttonyRingEating(PlayerUseItemEvent.Start event) { EntityPlayer entityPlayer = event.entityPlayer; - if (entityPlayer.getHeldItem() == null) return; + if (entityPlayer.getHeldItem() == null || entityPlayer.getHeldItem() + .getItem() == ModItems.infiniteFruit) return; Optional baublesItem = InventoryUtils .getItemInPlayerBaublesInventory(entityPlayer, GluttonyRing.class); if (baublesItem.isPresent() && (event.item.getItemUseAction() == EnumAction.eat)) { diff --git a/src/main/java/com/xir/NHUtilities/config/Config.java b/src/main/java/com/xir/NHUtilities/config/Config.java index 57ea733..16fef9e 100644 --- a/src/main/java/com/xir/NHUtilities/config/Config.java +++ b/src/main/java/com/xir/NHUtilities/config/Config.java @@ -18,6 +18,10 @@ public class Config { static final Logger ConfigLog = LogManager.getLogger(NHUtilities.MODID + "_Config"); + // region register massItems key !!! + public static boolean enableGluttonyRingAndHungerRing = true; + // endregion + // region register mixinModule key region public static boolean enableEnhancedTeleporterMKII = true; public static String[] listeningMods = new String[] { "NHUtilities", "TwistSpaceTechnology", "boxplusplus", @@ -27,6 +31,7 @@ public class Config { // region category private static final String CATEGORY_MIXIN_CONFIG = "Mixin_Config"; private static final String CATEGORY_Manager = "Lang_Manger"; + private static final String CATEGORY_MASS = "Mass_Config"; // endregion // region cfgFile @@ -52,6 +57,11 @@ public class Config { CATEGORY_Manager, listeningMods, "List the mod IDs here to manage your GTNH language files"); + enableGluttonyRingAndHungerRing = configuration.getBoolean( + "enableGluttonyRingAndHungerRing", + CATEGORY_MASS, + enableGluttonyRingAndHungerRing, + "enable GluttonyRing & AndHungerRing"); } try { @@ -71,5 +81,6 @@ private static void categoryInit() { configuration.addCustomCategoryComment( CATEGORY_Manager, "List the mod IDs here to manage your GTNH language files.\nIf you don't know the mod ID, please write a different name instead."); + configuration.addCustomCategoryComment(CATEGORY_MASS, "A config region to Mass!./I need!!"); } }