SPIGOT-1831: Chicken / sheep not dropping items correctly.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-03-08 17:58:52 +11:00
parent ced78d5d27
commit 1fec65442b
4 changed files with 42 additions and 24 deletions

View File

@@ -35,7 +35,7 @@
}
protected void r() {
@@ -123,6 +137,15 @@
@@ -123,11 +137,22 @@
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) {
if (!this.world.isClientSide) {
@@ -51,7 +51,14 @@
this.setSheared(true);
int i = 1 + this.random.nextInt(3);
@@ -210,6 +233,12 @@
for (int j = 0; j < i; ++j) {
+ this.forceDrops = true; // CraftBukkit
EntityItem entityitem = this.a(new ItemStack(Item.getItemOf(Blocks.WOOL), 1, this.getColor().getColorIndex()), 1.0F);
+ this.forceDrops = false; // CraftBukkit
entityitem.motY += (double) (this.random.nextFloat() * 0.05F);
entityitem.motX += (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F);
@@ -210,6 +235,12 @@
}
public void B() {