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];