mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 19:12:22 +01:00
30e4583dbe
By: Initial Source <noreply+automated@papermc.io>
31 lines
2 KiB
Diff
31 lines
2 KiB
Diff
--- a/net/minecraft/world/item/FireChargeItem.java
|
|
+++ b/net/minecraft/world/item/FireChargeItem.java
|
|
@@ -40,12 +40,28 @@
|
|
if (!CampfireBlock.canLight(iblockdata) && !CandleBlock.canLight(iblockdata) && !CandleCakeBlock.canLight(iblockdata)) {
|
|
blockposition = blockposition.relative(context.getClickedFace());
|
|
if (BaseFireBlock.canBePlacedAt(world, blockposition, context.getHorizontalDirection())) {
|
|
+ // CraftBukkit start - fire BlockIgniteEvent
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, context.getPlayer()).isCancelled()) {
|
|
+ if (!context.getPlayer().getAbilities().instabuild) {
|
|
+ context.getItemInHand().shrink(1);
|
|
+ }
|
|
+ return InteractionResult.PASS;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.playSound(world, blockposition);
|
|
world.setBlockAndUpdate(blockposition, BaseFireBlock.getState(world, blockposition));
|
|
world.gameEvent((Entity) context.getPlayer(), (Holder) GameEvent.BLOCK_PLACE, blockposition);
|
|
flag = true;
|
|
}
|
|
} else {
|
|
+ // CraftBukkit start - fire BlockIgniteEvent
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, context.getPlayer()).isCancelled()) {
|
|
+ if (!context.getPlayer().getAbilities().instabuild) {
|
|
+ context.getItemInHand().shrink(1);
|
|
+ }
|
|
+ return InteractionResult.PASS;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.playSound(world, blockposition);
|
|
world.setBlockAndUpdate(blockposition, (BlockState) iblockdata.setValue(BlockStateProperties.LIT, true));
|
|
world.gameEvent((Entity) context.getPlayer(), (Holder) GameEvent.BLOCK_CHANGE, blockposition);
|