Fixed wading boots

This commit is contained in:
Adubbz 2013-09-14 11:21:44 +10:00
parent 98ca75c400
commit 18f0722c96

View file

@ -8,13 +8,9 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@ -87,34 +83,20 @@ public class BlockMud extends Block
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
{ {
if (world.getBlockMetadata(x, y, z) == 0) if (world.getBlockMetadata(x, y, z) == 0)
{
if (!world.isRemote)
{
if (entity instanceof EntityLivingBase)
{ {
if (entity instanceof EntityPlayer) if (entity instanceof EntityPlayer)
{ {
InventoryPlayer inventory = ((EntityPlayer)entity).inventory; InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].itemID != Items.wadingBoots.get().itemID) if (inventory.armorInventory[0] != null && inventory.armorInventory[0].itemID == Items.wadingBoots.get().itemID)
{ {
return;
}
}
entity.motionX *= 0.1D; entity.motionX *= 0.1D;
entity.motionZ *= 0.1D; entity.motionZ *= 0.1D;
} }
}
else
{
entity.motionX *= 0.1D;
entity.motionZ *= 0.1D;
}
}
else
{
entity.motionX *= 0.1D;
entity.motionZ *= 0.1D;
}
}
}
else else
{ {
entity.setInWeb(); entity.setInWeb();