--- ../src_base/minecraft_server/net/minecraft/src/EntityMooshroom.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/EntityMooshroom.java 0000-00-00 00:00:00.000000000 -0000 @@ -1,6 +1,10 @@ package net.minecraft.src; -public class EntityMooshroom extends EntityCow +import java.util.ArrayList; + +import net.minecraft.src.forge.IShearable; + +public class EntityMooshroom extends EntityCow implements IShearable { public EntityMooshroom(World par1World) { @@ -21,31 +25,7 @@ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bowlSoup)); return true; } - else if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.func_48351_J() >= 0) - { - this.setEntityDead(); - this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); - - if (!this.worldObj.isRemote) - { - EntityCow var3 = new EntityCow(this.worldObj); - var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - var3.setEntityHealth(this.getEntityHealth()); - var3.renderYawOffset = this.renderYawOffset; - this.worldObj.spawnEntityInWorld(var3); - - for (int var4 = 0; var4 < 5; ++var4) - { - this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Block.mushroomRed))); - } - } - - return true; - } - else - { - return super.interact(par1EntityPlayer); - } + return super.interact(par1EntityPlayer); } /** @@ -55,4 +35,29 @@ { return new EntityMooshroom(this.worldObj); } + + @Override + public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) + { + return func_48351_J() >= 0; + } + + @Override + public ArrayList onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) + { + setEntityDead(); + EntityCow entitycow = new EntityCow(worldObj); + entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + entitycow.setEntityHealth(getEntityHealth()); + entitycow.renderYawOffset = renderYawOffset; + worldObj.spawnEntityInWorld(entitycow); + worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D); + + ArrayList ret = new ArrayList(); + for (int x = 0; x < 5; x++) + { + ret.add(new ItemStack(Block.mushroomRed)); + } + return ret; + } }