aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CampfireBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CampfireBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CampfireBlock.java.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CampfireBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CampfireBlock.java.patch
new file mode 100644
index 0000000000..af0c8b6a1c
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CampfireBlock.java.patch
@@ -0,0 +1,48 @@
+--- a/net/minecraft/world/level/block/CampfireBlock.java
++++ b/net/minecraft/world/level/block/CampfireBlock.java
+@@ -49,6 +49,9 @@
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.Shapes;
+ import net.minecraft.world.phys.shapes.VoxelShape;
++// CraftBukkit start
++import org.bukkit.craftbukkit.block.CraftBlock;
++// CraftBukkit end
+
+ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedBlock {
+ public static final MapCodec<CampfireBlock> CODEC = RecordCodecBuilder.mapCodec(
+@@ -110,9 +107,11 @@
+ }
+
+ @Override
+- public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
+- if (state.getValue(LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity)entity)) {
+- entity.hurt(level.damageSources().inFire(), (float)this.fireDamage);
++ public void entityInside(IBlockData state, Level level, BlockPos pos, Entity entity) {
++ if ((Boolean) state.getValue(CampfireBlock.LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) {
++ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(level, pos); // CraftBukkit
++ entity.hurt(level.damageSources().inFire(), (float) this.fireDamage);
++ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
+ }
+
+ super.entityInside(state, level, pos, entity);
+@@ -236,10 +217,16 @@
+ }
+
+ @Override
+- public void onProjectileHit(Level level, BlockState state, BlockHitResult hit, Projectile projectile) {
+- BlockPos blockPos = hit.getBlockPos();
+- if (!level.isClientSide && projectile.isOnFire() && projectile.mayInteract(level, blockPos) && !state.getValue(LIT) && !state.getValue(WATERLOGGED)) {
+- level.setBlock(blockPos, state.setValue(BlockStateProperties.LIT, Boolean.valueOf(true)), 11);
++ public void onProjectileHit(Level level, IBlockData state, BlockHitResult hit, Projectile projectile) {
++ BlockPos blockposition = hit.getBlockPos();
++
++ if (!level.isClientSide && projectile.isOnFire() && projectile.mayInteract(level, blockposition) && !(Boolean) state.getValue(CampfireBlock.LIT) && !(Boolean) state.getValue(CampfireBlock.WATERLOGGED)) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(level, blockposition, projectile).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
++ level.setBlock(blockposition, (IBlockData) state.setValue(BlockStateProperties.LIT, true), 11);
+ }
+ }
+