net.minecraft.world.item

This commit is contained in:
Jake Potrebic
2024-12-14 12:50:20 -08:00
parent 718d970f97
commit 31913c0b0a
64 changed files with 1134 additions and 2053 deletions

View File

@@ -0,0 +1,31 @@
--- a/net/minecraft/world/item/FireChargeItem.java
+++ b/net/minecraft/world/item/FireChargeItem.java
@@ -35,12 +_,28 @@
if (!CampfireBlock.canLight(blockState) && !CandleBlock.canLight(blockState) && !CandleCakeBlock.canLight(blockState)) {
clickedPos = clickedPos.relative(context.getClickedFace());
if (BaseFireBlock.canBePlacedAt(level, clickedPos, context.getHorizontalDirection())) {
+ // CraftBukkit start - fire BlockIgniteEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(level, clickedPos, 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(level, clickedPos);
level.setBlockAndUpdate(clickedPos, BaseFireBlock.getState(level, clickedPos));
level.gameEvent(context.getPlayer(), GameEvent.BLOCK_PLACE, clickedPos);
flag = true;
}
} else {
+ // CraftBukkit start - fire BlockIgniteEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(level, clickedPos, 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(level, clickedPos);
level.setBlockAndUpdate(clickedPos, blockState.setValue(BlockStateProperties.LIT, Boolean.valueOf(true)));
level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, clickedPos);