2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
2023-12-06 03:40:00 +11:00
|
|
|
@@ -50,6 +50,10 @@
|
2021-08-11 19:05:08 +10: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 {
|
|
|
|
|
2023-12-06 03:40:00 +11:00
|
|
|
public static final MapCodec<BlockCampfire> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
|
|
|
@@ -106,7 +110,9 @@
|
2021-08-11 19:05:08 +10:00
|
|
|
@Override
|
2021-11-22 09:00:00 +11:00
|
|
|
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
2022-06-08 02:00:00 +10:00
|
|
|
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
2021-08-11 19:05:08 +10:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit
|
2023-03-15 03:30:00 +11:00
|
|
|
entity.hurt(world.damageSources().inFire(), (float) this.fireDamage);
|
2021-08-11 19:05:08 +10:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
super.entityInside(iblockdata, world, blockposition, entity);
|
2023-12-06 03:40:00 +11:00
|
|
|
@@ -216,6 +222,11 @@
|
2021-11-22 09:00:00 +11:00
|
|
|
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
2019-09-02 13:14:13 +10:00
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
if (!world.isClientSide && iprojectile.isOnFire() && iprojectile.mayInteract(world, blockposition) && !(Boolean) iblockdata.getValue(BlockCampfire.LIT) && !(Boolean) iblockdata.getValue(BlockCampfire.WATERLOGGED)) {
|
2021-06-11 15:00:00 +10:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, iprojectile).isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-22 09:00:00 +11:00
|
|
|
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true), 11);
|
2020-06-25 10:00:00 +10:00
|
|
|
}
|
2021-06-11 15:00:00 +10:00
|
|
|
|