diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch new file mode 100644 index 0000000000..344040376e --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch @@ -0,0 +1,60 @@ +--- a/net/minecraft/world/entity/animal/SnowGolem.java ++++ b/net/minecraft/world/entity/animal/SnowGolem.java +@@ -40,6 +40,9 @@ + import net.minecraft.world.level.block.state.BlockState; + import net.minecraft.world.level.gameevent.GameEvent; + import net.minecraft.world.phys.Vec3; ++// CraftBukkit start ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++// CraftBukkit end + + public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackMob { + +@@ -103,7 +100,7 @@ + super.aiStep(); + if (!this.level().isClientSide) { + if (this.level().getBiome(this.blockPosition()).is(BiomeTags.SNOW_GOLEM_MELTS)) { +- this.hurt(this.damageSources().onFire(), 1.0F); ++ this.hurt(this.damageSources().melting, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING + } + + if (!this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { +@@ -118,9 +115,13 @@ + int l = Mth.floor(this.getZ() + (double) ((float) (i / 2 % 2 * 2 - 1) * 0.25F)); + BlockPos blockpos = new BlockPos(j, k, l); + +- if (this.level().getBlockState(blockpos).isAir() && blockstate.canSurvive(this.level(), blockpos)) { +- this.level().setBlockAndUpdate(blockpos, blockstate); +- this.level().gameEvent(GameEvent.BLOCK_PLACE, blockpos, GameEvent.Context.of(this, blockstate)); ++ if (this.level().getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level(), blockposition)) { ++ // CraftBukkit start ++ if (!CraftEventFactory.handleBlockFormEvent(this.level(), blockposition, iblockdata, this)) { ++ continue; ++ } ++ // CraftBukkit end ++ this.level().gameEvent(GameEvent.BLOCK_PLACE, blockposition, GameEvent.Context.of(this, iblockdata)); + } + } + } +@@ -154,6 +152,11 @@ + ItemStack itemstack = player.getItemInHand(interactionhand); + + if (itemstack.is(Items.SHEARS) && this.readyForShearing()) { ++ // CraftBukkit start ++ if (!CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand)) { ++ return InteractionResult.PASS; ++ } ++ // CraftBukkit end + this.shear(SoundSource.PLAYERS); + this.gameEvent(GameEvent.SHEAR, player); + if (!this.level().isClientSide) { +@@ -174,7 +176,9 @@ + this.level().playSound((Player) null, (Entity) this, SoundEvents.SNOW_GOLEM_SHEAR, soundsource, 1.0F, 1.0F); + if (!this.level().isClientSide()) { + this.setPumpkin(false); ++ this.forceDrops = true; // CraftBukkit + this.spawnAtLocation(new ItemStack(Items.CARVED_PUMPKIN), 1.7F); ++ this.forceDrops = false; // CraftBukkit + } + + } |