mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-21 00:17:56 +01:00
SPIGOT-4898: Call EntityChangeBlockEvent / EntityPickupItemEvent for foxes
This commit is contained in:
parent
eb99127a36
commit
f498aabe45
61
nms-patches/EntityFox.patch
Normal file
61
nms-patches/EntityFox.patch
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
--- a/net/minecraft/server/EntityFox.java
|
||||||
|
+++ b/net/minecraft/server/EntityFox.java
|
||||||
|
@@ -267,8 +267,8 @@
|
||||||
|
private List<UUID> ek() {
|
||||||
|
List<UUID> list = Lists.newArrayList();
|
||||||
|
|
||||||
|
- list.add(((Optional) this.datawatcher.get(EntityFox.bB)).orElse((Object) null));
|
||||||
|
- list.add(((Optional) this.datawatcher.get(EntityFox.bD)).orElse((Object) null));
|
||||||
|
+ list.add(((Optional<UUID>) this.datawatcher.get(EntityFox.bB)).orElse(null)); // CraftBukkit - decompile error
|
||||||
|
+ list.add(((Optional<UUID>) this.datawatcher.get(EntityFox.bD)).orElse(null)); // CraftBukkit - decompile error
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -401,7 +401,7 @@
|
||||||
|
protected void a(EntityItem entityitem) {
|
||||||
|
ItemStack itemstack = entityitem.getItemStack();
|
||||||
|
|
||||||
|
- if (this.g(itemstack)) {
|
||||||
|
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, itemstack.getCount() - 1, !this.g(itemstack)).isCancelled()) { // CraftBukkit - call EntityPickupItemEvent
|
||||||
|
int i = itemstack.getCount();
|
||||||
|
|
||||||
|
if (i > 1) {
|
||||||
|
@@ -944,6 +944,11 @@
|
||||||
|
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
|
||||||
|
|
||||||
|
iblockdata.set(BlockSweetBerryBush.a, 1);
|
||||||
|
+ // CraftBukkit start - call EntityChangeBlockEvent
|
||||||
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityFox.this, this.e, iblockdata.set(BlockSweetBerryBush.a, 1)).isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
int j = 1 + EntityFox.this.world.random.nextInt(2) + (i == 3 ? 1 : 0);
|
||||||
|
ItemStack itemstack = EntityFox.this.getEquipment(EnumItemSlot.MAINHAND);
|
||||||
|
|
||||||
|
@@ -983,7 +988,7 @@
|
||||||
|
private int f;
|
||||||
|
|
||||||
|
public r() {
|
||||||
|
- super(null);
|
||||||
|
+ super(); // CraftBukkit - decompile error
|
||||||
|
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1035,7 +1040,7 @@
|
||||||
|
private int c;
|
||||||
|
|
||||||
|
public t() {
|
||||||
|
- super(null);
|
||||||
|
+ super(); // CraftBukkit - decompile error
|
||||||
|
this.c = EntityFox.this.random.nextInt(140);
|
||||||
|
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK, PathfinderGoal.Type.JUMP));
|
||||||
|
}
|
||||||
|
@@ -1146,7 +1151,7 @@
|
||||||
|
private EntityLiving k;
|
||||||
|
private int l;
|
||||||
|
|
||||||
|
- public a(Class oclass, boolean flag, boolean flag1, Predicate predicate) {
|
||||||
|
+ public a(Class oclass, boolean flag, boolean flag1, Predicate<EntityLiving> predicate) { // CraftBukkit - decompile error
|
||||||
|
super(EntityFox.this, oclass, 10, flag, flag1, predicate);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user