3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/nms-patches/EntitySnowman.patch

43 Zeilen
1.9 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntitySnowman.java
+++ b/net/minecraft/server/EntitySnowman.java
@@ -1,6 +1,9 @@
package net.minecraft.server;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
2016-05-10 13:47:39 +02:00
public class EntitySnowman extends EntityGolem implements IRangedEntity {
@@ -62,7 +65,7 @@
}
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) {
- 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)) {
@@ -78,7 +81,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
}
}
}
@@ -110,6 +113,11 @@
2019-12-10 23:00:00 +01:00
if (itemstack.getItem() == Items.SHEARS && this.hasPumpkin()) {
if (!this.world.isClientSide) {
+ // CraftBukkit start
+ if (!CraftEventFactory.handlePlayerShearEntityEvent(entityhuman, this, itemstack, enumhand)) {
2019-12-10 23:00:00 +01:00
+ return false;
+ }
+ // CraftBukkit end
this.setHasPumpkin(false);
itemstack.damage(1, entityhuman, (entityhuman1) -> {
2020-01-21 22:00:00 +01:00
entityhuman1.broadcastItemBreak(enumhand);