mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:06:11 +03:00
27 lines
1.7 KiB
Diff
27 lines
1.7 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/monster/EntitySilverfish.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySilverfish.java
|
|
@@ -221,6 +221,11 @@
|
|
|
|
if (BlockSilverfish.canContainSilverfish(iblockstate))
|
|
{
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockpos, Blocks.MONSTER_EGG, Block.getIdFromBlock(BlockSilverfish.getBlockById(iblockstate.getBlock().getMetaFromState(iblockstate)))).isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
world.setBlockState(blockpos, Blocks.MONSTER_EGG.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3);
|
|
this.silverfish.spawnExplosionParticle();
|
|
this.silverfish.setDead();
|
|
@@ -273,6 +278,11 @@
|
|
|
|
if (iblockstate.getBlock() == Blocks.MONSTER_EGG)
|
|
{
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockpos1, Blocks.AIR, 0).isCancelled()) {
|
|
+ continue;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
if (world.getGameRules().getBoolean("mobGriefing"))
|
|
{
|
|
world.destroyBlock(blockpos1, true);
|