mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-10-25 20:32:29 +00:00
Merge pull request #2 from Ugachaga/patch-1
Forbidden dimensions config
This commit is contained in:
commit
dfec103fcf
2 files changed
+16
No files matched your search
@@ -44,6 +44,8 @@ public final class ConfigHandler {
|
||||
public static int netherDimensionID = -1;
|
||||
public static int endDimensionID = 1;
|
||||
public static int bedrockDimensionID = 19;
|
||||
public static String[] forbiddenDimensions;
|
||||
|
||||
public static boolean enableCake = true;
|
||||
public static boolean enableFire = true;
|
||||
public static boolean enableFireMechanics = true;
|
||||
@@ -55,6 +57,7 @@ public final class ConfigHandler {
|
||||
public static int potionAirId = 90;
|
||||
private static Configuration config;
|
||||
|
||||
|
||||
public static void loadConfig(File configFile) {
|
||||
config = new Configuration(configFile);
|
||||
|
||||
@@ -71,6 +74,8 @@ public final class ConfigHandler {
|
||||
|
||||
config.load();
|
||||
|
||||
forbiddenDimensions = config.getStringList("Forbidden Dimensions", Configuration.CATEGORY_GENERAL, new String[]{""}, "Disallow Bottomless Pouch inventory for certain dimension ID's");
|
||||
|
||||
Property propEnableKami = config.get(Configuration.CATEGORY_GENERAL, "kami.forceenabled", true);
|
||||
propEnableKami.comment = "Set to true to enable all kami stuff (note, either this OR the kami mod file will work)";
|
||||
enableKami = Loader.isModLoaded("ThaumicTinkererKami") || propEnableKami.getBoolean(true);
|
||||
|
||||
@@ -31,6 +31,7 @@ import thaumic.tinkerer.common.block.tile.container.kami.ContainerIchorPouch;
|
||||
import thaumic.tinkerer.common.block.tile.container.kami.ContainerWarpGate;
|
||||
import thaumic.tinkerer.common.block.tile.kami.TileWarpGate;
|
||||
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.lib.LibGuiIDs;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
@@ -52,6 +53,7 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new ContainerAspectAnalyzer((TileAspectAnalyzer) tile, player.inventory);
|
||||
|
||||
case LibGuiIDs.GUI_ID_ICHOR_POUCH:
|
||||
if (!isDimensionAllowed(player)) return null;
|
||||
return new ContainerIchorPouch(player);
|
||||
|
||||
case LibGuiIDs.GUI_ID_WARP_GATE:
|
||||
@@ -79,6 +81,7 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new GuiAspectAnalyzer((TileAspectAnalyzer) tile, player.inventory);
|
||||
|
||||
case LibGuiIDs.GUI_ID_ICHOR_POUCH:
|
||||
if (!isDimensionAllowed(player)) return null;
|
||||
return new GuiIchorPouch(new ContainerIchorPouch(player));
|
||||
|
||||
case LibGuiIDs.GUI_ID_WARP_GATE:
|
||||
@@ -92,4 +95,12 @@ public class GuiHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isDimensionAllowed (EntityPlayer player) {
|
||||
Integer currentDimID = (player.worldObj.provider.dimensionId);
|
||||
for (String id : ConfigHandler.forbiddenDimensions) {
|
||||
if (id.equals(currentDimID.toString())) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user