diff options
author | md_5 <git@md-5.net> | 2018-07-15 10:00:00 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-07-15 10:00:00 +1000 |
commit | 421c1728c81e2f729dff88da2ac96535d2b8e5e8 (patch) | |
tree | 6c51d93e811d1eb86b68461a42fc5cf03b168b0c /nms-patches/EntityEnderman.patch | |
parent | 57ab4cfc6f4ff526d44319d9b8c79f6848db2de7 (diff) | |
download | craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar.gz craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar.lz craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar.xz craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.zip |
Update to Minecraft 1.13-pre7
Diffstat (limited to 'nms-patches/EntityEnderman.patch')
-rw-r--r-- | nms-patches/EntityEnderman.patch | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/nms-patches/EntityEnderman.patch b/nms-patches/EntityEnderman.patch index dc6ad778..fdfcc0f5 100644 --- a/nms-patches/EntityEnderman.patch +++ b/nms-patches/EntityEnderman.patch @@ -1,21 +1,28 @@ --- a/net/minecraft/server/EntityEnderman.java +++ b/net/minecraft/server/EntityEnderman.java -@@ -4,6 +4,8 @@ - import com.google.common.base.Optional; - import com.google.common.base.Predicate; - import com.google.common.collect.Sets; -+import org.bukkit.event.entity.EntityTargetEvent; -+ - import java.util.Random; - import java.util.Set; - import java.util.UUID; -@@ -56,7 +58,17 @@ +@@ -33,7 +33,14 @@ + this.goalSelector.a(11, new EntityEnderman.PathfinderGoalEndermanPickupBlock(this)); + this.targetSelector.a(1, new EntityEnderman.PathfinderGoalPlayerWhoLookedAtTarget(this)); + this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false, new Class[0])); +- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityEndermite.class, 10, true, false, EntityEndermite::l)); ++ // CraftBukkit - decompile error ++ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>() { ++ @Override ++ public boolean test(EntityEndermite entityendermite) { ++ return entityendermite.l(); ++ } ++ })); ++ // CraftBukkit end + } + + protected void initAttributes() { +@@ -45,7 +52,17 @@ } public void setGoalTarget(@Nullable EntityLiving entityliving) { - super.setGoalTarget(entityliving); + // CraftBukkit start - fire event -+ setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); ++ setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true); + } + + @Override @@ -28,7 +35,7 @@ AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); if (entityliving == null) { -@@ -70,6 +82,7 @@ +@@ -59,6 +76,7 @@ attributeinstance.b(EntityEnderman.b); } } @@ -36,14 +43,14 @@ } -@@ -317,8 +330,12 @@ +@@ -277,8 +295,12 @@ boolean flag = movingobjectposition != null && movingobjectposition.a().equals(blockposition); - if (EntityEnderman.c.contains(block) && flag) { + if (block.a(TagsBlock.G) && flag) { - this.enderman.setCarried(iblockdata); - world.setAir(blockposition); + // CraftBukkit start - Pickup event -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, this.enderman.world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), org.bukkit.Material.AIR).isCancelled()) { ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { + this.enderman.setCarried(iblockdata); + world.setAir(blockposition); + } @@ -51,12 +58,12 @@ } } -@@ -348,8 +365,12 @@ +@@ -308,8 +330,12 @@ IBlockData iblockdata2 = this.a.getCarried(); - if (iblockdata2 != null && this.a(world, blockposition, iblockdata2.getBlock(), iblockdata, iblockdata1)) { + if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1)) { + // CraftBukkit start - Place event -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, this.a.getCarried().getBlock(), this.a.getCarried().getBlock().toLegacyData(this.a.getCarried())).isCancelled()) { ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, iblockdata2).isCancelled()) { world.setTypeAndData(blockposition, iblockdata2, 3); this.a.setCarried((IBlockData) null); + } |