13
0
geforkt von Mirrors/Paper
Paper/nms-patches/EntitySilverfish.patch

36 Zeilen
2.0 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntitySilverfish.java
+++ b/net/minecraft/server/EntitySilverfish.java
2019-04-23 04:00:00 +02:00
@@ -19,7 +19,7 @@
this.goalSelector.a(3, this.c);
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));
}
@@ -167,6 +167,11 @@
2015-02-26 23:41:06 +01:00
IBlockData iblockdata = world.getType(blockposition);
2019-04-23 04:00:00 +02:00
if (BlockMonsterEggs.j(iblockdata)) {
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2019-04-23 04:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, BlockMonsterEggs.e(iblockdata.getBlock())).isCancelled()) {
2015-02-26 23:41:06 +01:00
+ return;
+ }
+ // CraftBukkit end
2019-04-23 04:00:00 +02:00
world.setTypeAndData(blockposition, BlockMonsterEggs.e(iblockdata.getBlock()), 3);
2016-11-17 02:41:03 +01:00
this.a.doSpawnEffect();
this.a.die();
2019-04-23 04:00:00 +02:00
@@ -213,6 +218,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
if (world.getGameRules().getBoolean("mobGriefing")) {
2019-04-23 04:00:00 +02:00
world.b(blockposition1, true);
2015-02-26 23:41:06 +01:00
} else {