Use given variables to condense code
This commit is contained in:
parent
e8c86a8c92
commit
578051b530
13 changed files with 27 additions and 74 deletions
|
|
@ -41,13 +41,8 @@ public class ItemOrbEarth extends ItemOrb {
|
|||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
if (!world.isRemote) {
|
||||
if (currentItem != null) {
|
||||
if (currentItem.itemID == itemStack.itemID) {
|
||||
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
if (!world.isRemote && par5) {
|
||||
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue