2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -46,6 +46,10 @@
|
2021-08-11 11:05:08 +02:00
|
|
|
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 {
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -90,7 +94,9 @@
|
2021-08-11 11:05:08 +02:00
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
2022-06-07 18:00:00 +02:00
|
|
|
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
2021-08-11 11:05:08 +02:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit
|
2023-03-14 17:30:00 +01:00
|
|
|
entity.hurt(world.damageSources().inFire(), (float) this.fireDamage);
|
2021-08-11 11:05:08 +02:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
super.entityInside(iblockdata, world, blockposition, entity);
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -200,6 +206,11 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
2019-09-02 05:14:13 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
if (!world.isClientSide && iprojectile.isOnFire() && iprojectile.mayInteract(world, blockposition) && !(Boolean) iblockdata.getValue(BlockCampfire.LIT) && !(Boolean) iblockdata.getValue(BlockCampfire.WATERLOGGED)) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, iprojectile).isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true), 11);
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
2021-06-11 07:00:00 +02:00
|
|
|
|