2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
2022-02-28 16:00:00 +01:00
|
|
|
@@ -47,6 +47,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);
|
2022-02-28 16:00:00 +01:00
|
|
|
@@ -91,7 +95,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) {
|
|
|
|
if (!entity.fireImmune() && (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
|
2021-11-21 23:00:00 +01:00
|
|
|
entity.hurt(DamageSource.IN_FIRE, (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);
|
2022-02-28 16:00:00 +01:00
|
|
|
@@ -201,6 +207,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
|
|
|
|