PaperMC/paper-server/nms-patches/net/minecraft/world/entity/monster/EntitySilverfish.patch

36 lines
2.1 KiB
Diff
Raw Normal View History

2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
+++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
@@ -46,7 +46,7 @@
this.goalSelector.a(3, this.friendsGoal);
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));
}
@@ -171,6 +171,11 @@
Block block = iblockdata.getBlock();
if (block instanceof BlockMonsterEggs) {
+ // CraftBukkit start
2021-03-15 23:00:00 +01:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, net.minecraft.world.level.block.Blocks.AIR.getBlockData()).isCancelled()) {
+ continue;
+ }
+ // CraftBukkit end
if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
world.a(blockposition1, true, this.silverfish);
} else {
@@ -239,6 +244,11 @@
IBlockData iblockdata = world.getType(blockposition);
if (BlockMonsterEggs.h(iblockdata)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, BlockMonsterEggs.n(iblockdata)).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, BlockMonsterEggs.n(iblockdata), 3);
this.mob.doSpawnEffect();
this.mob.die();