diff --git a/src/main/java/crazypants/enderio/EnderIO.java b/src/main/java/crazypants/enderio/EnderIO.java index e95be426..2e8d1283 100644 --- a/src/main/java/crazypants/enderio/EnderIO.java +++ b/src/main/java/crazypants/enderio/EnderIO.java @@ -465,10 +465,9 @@ public class EnderIO { FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.FIRE_WATER_NAME + "@" + (Config.fireWaterPowerPerCycleRF / 10 * Config.fireWaterPowerTotalBurnTime)); - fluidXpJuice = FluidRegistry.getFluid("xpjuice"); if(!Loader.isModLoaded("OpenBlocks")) { Log.info("XP Juice registered by Ender IO."); - fluidXpJuice = new Fluid("xpjuice").setLuminosity(10).setDensity(800).setViscosity(1500).setUnlocalizedName("eio.xpjuice"); + fluidXpJuice = new Fluid(Config.xpJuiceName).setLuminosity(10).setDensity(800).setViscosity(1500).setUnlocalizedName("eio.xpjuice"); FluidRegistry.registerFluid(fluidXpJuice); itemBucketXpJuice = ItemBucketEio.create(fluidXpJuice); } else { @@ -600,9 +599,9 @@ public class EnderIO { PaintSourceValidator.instance.loadConfig(); if(fluidXpJuice == null) { //should have been registered by open blocks - fluidXpJuice = FluidRegistry.getFluid("xpjuice"); + fluidXpJuice = FluidRegistry.getFluid(getXPJuiceName()); if(fluidXpJuice == null) { - Log.error("Liquid XP registration left to open blocks but could not be found."); + Log.error("Liquid XP Juice registration left to open blocks but could not be found."); } } @@ -627,6 +626,23 @@ public class EnderIO { addModIntegration(); } + private static String getXPJuiceName() { + String openBlocksXPJuiceName = null; + + try { + Field getField = Class.forName("openblocks.Config").getField("xpFluidId"); + openBlocksXPJuiceName = (String) getField.get(null); + }catch(Exception e) { + } + + if(openBlocksXPJuiceName != null && !Config.xpJuiceName.equals(openBlocksXPJuiceName)) { + Log.info("Overwriting XP Juice name with '" + openBlocksXPJuiceName + "' taken from OpenBlocks' config"); + return openBlocksXPJuiceName; + } + + return Config.xpJuiceName; + } + private void addModIntegration() { if(Loader.isModLoaded("TConstruct")) { diff --git a/src/main/java/crazypants/enderio/config/Config.java b/src/main/java/crazypants/enderio/config/Config.java index 3a4bd005..c1395f60 100644 --- a/src/main/java/crazypants/enderio/config/Config.java +++ b/src/main/java/crazypants/enderio/config/Config.java @@ -411,6 +411,7 @@ public final class Config { public static boolean enderRailTeleportPlayers = false; public static int xpObeliskMaxXpLevel = Integer.MAX_VALUE; + public static String xpJuiceName = "xpjuice"; public static boolean clearGlassSameTexture = false; public static boolean clearGlassConnectToFusedQuartz = false; @@ -1117,6 +1118,7 @@ public final class Config { "When set to true a list of all registered mobs will be dumped to config/enderio/mobTypes.txt The names are in the format required by EIOs mob blacklists."); xpObeliskMaxXpLevel = config.get(sectionMisc.name, "xpObeliskMaxXpLevel", xpObeliskMaxXpLevel, "Maximum level of XP the xp obelisk can contain.").getInt(); + xpJuiceName = config.getString("xpJuiceName", sectionMisc.name, xpJuiceName, "Id of liquid XP fluid (WARNING: only for users who know what they are doing - changing this id can break worlds) - this should match the with OpenBlocks when installed"); clearGlassSameTexture = config.getBoolean("clearGlassSameTexture", sectionMisc.name, clearGlassSameTexture, "If true, quite clear glass will use the fused quartz border texture for the block instead of the white border."); clearGlassConnectToFusedQuartz = config.getBoolean("clearGlassConnectToFusedQuartz", sectionMisc.name, clearGlassConnectToFusedQuartz, "If true, quite clear glass will connect textures with fused quartz.");