ForgePatch/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch
2016-11-13 17:09:55 -05:00

40 lines
2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/passive/EntitySheep.java
+++ ../src-work/minecraft/net/minecraft/entity/passive/EntitySheep.java
@@ -45,7 +45,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class EntitySheep extends EntityAnimal
+public class EntitySheep extends EntityAnimal implements net.minecraftforge.common.IShearable
{
private static final DataParameter<Byte> field_184774_bv = EntityDataManager.<Byte>func_187226_a(EntitySheep.class, DataSerializers.field_187191_a);
private final InventoryCrafting field_90016_e = new InventoryCrafting(new Container()
@@ -180,7 +180,7 @@
{
ItemStack itemstack = p_184645_1_.func_184586_b(p_184645_2_);
- if (itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_())
+ if (false && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) //Forge: Moved to onSheared
{
if (!this.field_70170_p.field_72995_K)
{
@@ -369,4 +369,19 @@
field_175514_bm.put(EnumDyeColor.RED, new float[] {0.6F, 0.2F, 0.2F});
field_175514_bm.put(EnumDyeColor.BLACK, new float[] {0.1F, 0.1F, 0.1F});
}
+
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return !this.func_70892_o() && !this.func_70631_g_(); }
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ this.func_70893_e(true);
+ int i = 1 + this.field_70146_Z.nextInt(3);
+
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ for (int j = 0; j < i; ++j)
+ ret.add(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, this.func_175509_cj().func_176765_a()));
+
+ this.func_184185_a(SoundEvents.field_187763_eJ, 1.0F, 1.0F);
+ return ret;
+ }
}