Added forbidden dimension config

This commit is contained in:
Ugachaga committed 2017-02-08 17:05:04 +07:00
1 parent ea676774aa
commit 0f08fd1112
2 files changed
+14

No files matched your search

@@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import net.minecraft.potion.*;
import tconstruct.armor.player.*;
import tconstruct.util.config.PHConstruct;
public class PlayerAbilityHelper
{
@@ -24,8 +25,19 @@ public class PlayerAbilityHelper
}
}
public static boolean isDimensionAllowed (EntityPlayer player) {
int currentDimID = player.worldObj.provider.dimensionId;
for (int id : PHConstruct.cfgForbiddenDim)
{
if (id == currentDimID)
return false;
}
return true;
}
public static void swapBelt (EntityPlayer player, ArmorExtended armor)
{
if (!isDimensionAllowed(player)) return;
NBTTagList slots = new NBTTagList();
InventoryPlayer hotbar = player.inventory;
ItemStack belt = armor.inventory[3];
@@ -199,6 +199,7 @@ public class PHConstruct
connectedTexturesMode = conTexMode.getInt(2);
// dimension blacklist
cfgForbiddenDim = config.get("DimBlackList", "ForbiddenDim", new int[] {}, "Disallow Traveller's Belt ability to swap inventories for certain dimension ID's").getIntList();
cfgDimBlackList = config.get("DimBlackList", "SlimeIslandDimBlacklist", new int[] {}, "Add dimension ID's to prevent slime islands from generating in them").getIntList();
slimeIslGenDim0Only = config.get("DimBlackList", "GenerateSlimeIslandInDim0Only", false, "True: slime islands wont generate in any ages other than overworld(if enabled); False: will generate in all non-blackisted ages").getBoolean(false);
slimeIslGenDim0 = config.get("DimBlackList", "slimeIslGenDim0", true, "True: slime islands generate in overworld; False they do not generate").getBoolean(true);
@@ -382,6 +383,7 @@ public class PHConstruct
// dimensionblacklist
public static boolean slimeIslGenDim0Only;
public static int[] cfgForbiddenDim;
public static int[] cfgDimBlackList;
public static boolean slimeIslGenDim0;
public static boolean genIslandsFlat;