mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
40076782ed
By: md_5 <git@md-5.net>
35 lines
1.9 KiB
Diff
35 lines
1.9 KiB
Diff
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
|
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
|
@@ -46,6 +46,10 @@
|
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
|
import net.minecraft.world.phys.shapes.VoxelShapes;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.craftbukkit.block.CraftBlock;
|
|
+// CraftBukkit end
|
|
+
|
|
public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged {
|
|
|
|
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
|
@@ -90,7 +94,9 @@
|
|
@Override
|
|
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
|
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit
|
|
entity.hurt(world.damageSources().inFire(), (float) this.fireDamage);
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
|
|
}
|
|
|
|
super.entityInside(iblockdata, world, blockposition, entity);
|
|
@@ -200,6 +206,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);
|
|
}
|
|
|