Paper/nms-patches/EntitySilverfish.patch

36 lines
2.0 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntitySilverfish.java
+++ b/net/minecraft/server/EntitySilverfish.java
2019-07-20 01:00:00 +02:00
@@ -18,7 +18,7 @@
this.goalSelector.a(3, this.b);
2019-04-23 04:00:00 +02:00
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false));
this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this));
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a());
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
}
2019-07-20 01:00:00 +02:00
@@ -160,6 +160,11 @@
2015-02-26 23:41:06 +01:00
IBlockData iblockdata = world.getType(blockposition);
2019-12-10 23:00:00 +01:00
if (BlockMonsterEggs.h(iblockdata)) {
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2019-12-10 23:00:00 +01:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, BlockMonsterEggs.d(iblockdata.getBlock())).isCancelled()) {
2015-02-26 23:41:06 +01:00
+ return;
+ }
+ // CraftBukkit end
2019-12-10 23:00:00 +01:00
world.setTypeAndData(blockposition, BlockMonsterEggs.d(iblockdata.getBlock()), 3);
2016-11-17 02:41:03 +01:00
this.a.doSpawnEffect();
this.a.die();
2019-07-20 01:00:00 +02:00
@@ -206,6 +211,11 @@
2018-07-15 02:00:00 +02:00
Block block = iblockdata.getBlock();
2015-02-26 23:41:06 +01:00
2018-07-15 02:00:00 +02:00
if (block instanceof BlockMonsterEggs) {
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2018-07-15 02:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, Blocks.AIR.getBlockData()).isCancelled()) {
2015-02-26 23:41:06 +01:00
+ continue;
+ }
+ // CraftBukkit end
2019-06-21 12:00:00 +02:00
if (world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
2019-12-10 23:00:00 +01:00
world.a(blockposition1, true, this.silverfish);
2015-02-26 23:41:06 +01:00
} else {