2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/animal/EntitySnowman.java
|
|
|
|
+++ b/net/minecraft/world/entity/animal/EntitySnowman.java
|
|
|
|
@@ -38,6 +38,10 @@
|
|
|
|
import net.minecraft.world.level.block.Blocks;
|
|
|
|
import net.minecraft.world.level.block.state.IBlockData;
|
2021-03-08 22:47:33 +01:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
|
|
+// CraftBukkit end
|
2021-03-08 22:47:33 +01:00
|
|
|
+
|
2020-06-25 02:00:00 +02:00
|
|
|
public class EntitySnowman extends EntityGolem implements IShearable, IRangedEntity {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2021-03-08 22:47:33 +01:00
|
|
|
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
|
2021-03-15 23:00:00 +01:00
|
|
|
@@ -96,7 +100,7 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
int k = MathHelper.floor(this.locZ());
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2018-12-25 22:00:00 +01:00
|
|
|
if (this.world.getBiome(new BlockPosition(i, 0, k)).getAdjustedTemperature(new BlockPosition(i, j, k)) > 1.0F) {
|
2014-11-25 22:32:16 +01:00
|
|
|
- this.damageEntity(DamageSource.BURN, 1.0F);
|
|
|
|
+ this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING
|
|
|
|
}
|
|
|
|
|
2019-06-21 12:00:00 +02:00
|
|
|
if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
2021-03-15 23:00:00 +01:00
|
|
|
@@ -112,7 +116,7 @@
|
2015-02-26 23:41:06 +01:00
|
|
|
BlockPosition blockposition = new BlockPosition(i, j, k);
|
|
|
|
|
2018-12-25 22:00:00 +01:00
|
|
|
if (this.world.getType(blockposition).isAir() && this.world.getBiome(blockposition).getAdjustedTemperature(blockposition) < 0.8F && iblockdata.canPlace(this.world, blockposition)) {
|
2018-07-15 02:00:00 +02:00
|
|
|
- this.world.setTypeUpdate(blockposition, iblockdata);
|
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this.world, blockposition, iblockdata, this); // CraftBukkit
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-03-15 23:00:00 +01:00
|
|
|
@@ -143,6 +147,11 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
ItemStack itemstack = entityhuman.b(enumhand);
|
2017-07-15 01:53:22 +02:00
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
if (itemstack.getItem() == Items.SHEARS && this.canShear()) {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (!CraftEventFactory.handlePlayerShearEntityEvent(entityhuman, this, itemstack, enumhand)) {
|
|
|
|
+ return EnumInteractionResult.PASS;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.shear(SoundCategory.PLAYERS);
|
2019-12-10 23:00:00 +01:00
|
|
|
if (!this.world.isClientSide) {
|
|
|
|
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|