78 lines
2.7 KiB
Diff
78 lines
2.7 KiB
Diff
--- ../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)
|
|
{
|
|
@@ -30,32 +34,7 @@
|
|
return true;
|
|
}
|
|
}
|
|
-
|
|
- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0)
|
|
- {
|
|
- this.setDead();
|
|
- 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.getHealth());
|
|
- 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);
|
|
}
|
|
|
|
/**
|
|
@@ -65,4 +44,29 @@
|
|
{
|
|
return new EntityMooshroom(this.worldObj);
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
|
|
+ {
|
|
+ return getGrowingAge() >= 0;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune)
|
|
+ {
|
|
+ setDead();
|
|
+ EntityCow entitycow = new EntityCow(worldObj);
|
|
+ entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
|
|
+ entitycow.setEntityHealth(getHealth());
|
|
+ entitycow.renderYawOffset = renderYawOffset;
|
|
+ worldObj.spawnEntityInWorld(entitycow);
|
|
+ worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D);
|
|
+
|
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
|
+ for (int x = 0; x < 5; x++)
|
|
+ {
|
|
+ ret.add(new ItemStack(Block.mushroomRed));
|
|
+ }
|
|
+ return ret;
|
|
+ }
|
|
}
|