Made the enderporter only work in the overworld
This commit is contained in:
parent
7bea89c24f
commit
ae0e250891
1 changed files with 17 additions and 7 deletions
|
@ -38,6 +38,8 @@ public class ItemEnderporter extends Item
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (par3EntityPlayer.dimension == 0)
|
||||||
{
|
{
|
||||||
par1ItemStack.damageItem(1, par3EntityPlayer);
|
par1ItemStack.damageItem(1, par3EntityPlayer);
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 999));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 999));
|
||||||
|
@ -46,6 +48,14 @@ public class ItemEnderporter extends Item
|
||||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 3));
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 3));
|
||||||
par3EntityPlayer.setPosition(par2World.getSpawnPoint().posX, 256, par2World.getSpawnPoint().posZ);
|
par3EntityPlayer.setPosition(par2World.getSpawnPoint().posX, 256, par2World.getSpawnPoint().posZ);
|
||||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.levelup", 1.0F, 5.0F);
|
par2World.playSoundAtEntity(par3EntityPlayer, "random.levelup", 1.0F, 5.0F);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!par3EntityPlayer.worldObj.isRemote)
|
||||||
|
{
|
||||||
|
par3EntityPlayer.addChatMessage("\u00a75A mystical energy is preventing you from using this in the current world.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue