@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntitySheep.java
|
||||
+++ b/net/minecraft/server/EntitySheep.java
|
||||
@@ -9,10 +9,16 @@
|
||||
@@ -8,10 +8,16 @@
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -10,38 +10,37 @@
|
||||
+import org.bukkit.inventory.InventoryView;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EntitySheep extends EntityAnimal {
|
||||
public class EntitySheep extends EntityAnimal implements IShearable {
|
||||
|
||||
private static final DataWatcherObject<Byte> bw = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
|
||||
- private static final Map<EnumColor, IMaterial> bx = (Map) SystemUtils.a((Object) Maps.newEnumMap(EnumColor.class), (enummap) -> {
|
||||
+ private static final Map<EnumColor, IMaterial> bx = (Map) SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error
|
||||
private static final DataWatcherObject<Byte> bv = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
|
||||
- private static final Map<EnumColor, IMaterial> bw = (Map) SystemUtils.a((Object) Maps.newEnumMap(EnumColor.class), (enummap) -> {
|
||||
+ private static final Map<EnumColor, IMaterial> bw = (Map) SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error
|
||||
enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL);
|
||||
enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL);
|
||||
enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL);
|
||||
@@ -141,6 +147,12 @@
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
@@ -138,6 +144,11 @@
|
||||
|
||||
if (itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!CraftEventFactory.handlePlayerShearEntityEvent(entityhuman, this, itemstack, enumhand)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.shear();
|
||||
if (!this.world.isClientSide) {
|
||||
if (itemstack.getItem() == Items.SHEARS) {
|
||||
if (!this.world.isClientSide && this.canShear()) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!CraftEventFactory.handlePlayerShearEntityEvent(entityhuman, this, itemstack, enumhand)) {
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.shear(SoundCategory.PLAYERS);
|
||||
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
@@ -160,7 +172,9 @@
|
||||
int i = 1 + this.random.nextInt(3);
|
||||
entityhuman1.broadcastItemBreak(enumhand);
|
||||
@@ -158,7 +169,9 @@
|
||||
int i = 1 + this.random.nextInt(3);
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
+ this.forceDrops = true; // CraftBukkit
|
||||
EntityItem entityitem = this.a((IMaterial) EntitySheep.bx.get(this.getColor()), 1);
|
||||
+ this.forceDrops = false; // CraftBukkit
|
||||
for (int j = 0; j < i; ++j) {
|
||||
+ this.forceDrops = true; // CraftBukkit
|
||||
EntityItem entityitem = this.a((IMaterial) EntitySheep.bw.get(this.getColor()), 1);
|
||||
+ this.forceDrops = false; // CraftBukkit
|
||||
|
||||
if (entityitem != null) {
|
||||
entityitem.setMot(entityitem.getMot().add((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (this.random.nextFloat() * 0.05F), (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F)));
|
||||
@@ -247,6 +261,12 @@
|
||||
if (entityitem != null) {
|
||||
entityitem.setMot(entityitem.getMot().add((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (this.random.nextFloat() * 0.05F), (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F)));
|
||||
@@ -248,6 +261,12 @@
|
||||
|
||||
@Override
|
||||
public void blockEaten() {
|
||||
@@ -54,7 +53,7 @@
|
||||
this.setSheared(false);
|
||||
if (this.isBaby()) {
|
||||
this.setAge(60);
|
||||
@@ -265,7 +285,7 @@
|
||||
@@ -266,7 +285,7 @@
|
||||
EnumColor enumcolor = ((EntitySheep) entityanimal).getColor();
|
||||
EnumColor enumcolor1 = ((EntitySheep) entityanimal1).getColor();
|
||||
InventoryCrafting inventorycrafting = a(enumcolor, enumcolor1);
|
||||
@@ -63,7 +62,7 @@
|
||||
return recipecrafting.a(inventorycrafting);
|
||||
}).map(ItemStack::getItem);
|
||||
|
||||
@@ -283,10 +303,18 @@
|
||||
@@ -284,10 +303,18 @@
|
||||
public boolean canUse(EntityHuman entityhuman) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user