aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch
new file mode 100644
index 0000000000..d6c54722b1
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/SnowGolem.java.patch
@@ -0,0 +1,78 @@
+--- a/net/minecraft/world/entity/animal/SnowGolem.java
++++ b/net/minecraft/world/entity/animal/SnowGolem.java
+@@ -39,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 {
+ private static final EntityDataAccessor<Byte> DATA_PUMPKIN_ID = SynchedEntityData.defineId(SnowGolem.class, EntityDataSerializers.BYTE);
+@@ -92,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)) {
+@@ -101,14 +109,19 @@
+
+ BlockState blockState = Blocks.SNOW.defaultBlockState();
+
+- for (int i = 0; i < 4; i++) {
+- int floor = Mth.floor(this.getX() + (double)((float)(i % 2 * 2 - 1) * 0.25F));
+- int floor1 = Mth.floor(this.getY());
+- int floor2 = Mth.floor(this.getZ() + (double)((float)(i / 2 % 2 * 2 - 1) * 0.25F));
+- BlockPos blockPos = new BlockPos(floor, floor1, floor2);
+- 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));
++ for (int i = 0; i < 4; ++i) {
++ int j = Mth.floor(this.getX() + (double) ((float) (i % 2 * 2 - 1) * 0.25F));
++ int k = Mth.floor(this.getY());
++ int l = Mth.floor(this.getZ() + (double) ((float) (i / 2 % 2 * 2 - 1) * 0.25F));
++ BlockPos blockposition = new BlockPos(j, k, l);
++
++ 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));
+ }
+ }
+ }
+@@ -133,9 +148,15 @@
+ }
+
+ @Override
+- protected InteractionResult mobInteract(Player player, InteractionHand hand) {
+- ItemStack itemInHand = player.getItemInHand(hand);
+- if (itemInHand.is(Items.SHEARS) && this.readyForShearing()) {
++ protected InteractionResult mobInteract(Player player, EnumHand hand) {
++ ItemStack itemstack = player.getItemInHand(hand);
++
++ 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) {
+@@ -153,7 +176,9 @@
+ this.level().playSound(null, this, SoundEvents.SNOW_GOLEM_SHEAR, category, 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
+ }
+ }
+