PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockCampfire.patch

24 lines
1.3 KiB
Diff
Raw Normal View History

2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/level/block/BlockCampfire.java
+++ b/net/minecraft/world/level/block/BlockCampfire.java
@@ -105,7 +105,7 @@
@Override
protected void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving) {
- entity.hurt(world.damageSources().campfire(), (float) this.fireDamage);
+ entity.hurt(world.damageSources().campfire().directBlock(world, blockposition), (float) this.fireDamage); // CraftBukkit
}
super.entityInside(iblockdata, world, blockposition, entity);
@@ -215,6 +215,11 @@
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
if (!world.isClientSide && iprojectile.isOnFire() && iprojectile.mayInteract(world, blockposition) && !(Boolean) iblockdata.getValue(BlockCampfire.LIT) && !(Boolean) iblockdata.getValue(BlockCampfire.WATERLOGGED)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, iprojectile).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true), 11);
}