3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/nms-patches/ItemFireball.patch

32 Zeilen
1.8 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/ItemFireball.java
+++ b/net/minecraft/server/ItemFireball.java
2020-06-25 02:00:00 +02:00
@@ -14,12 +14,28 @@
boolean flag = false;
2018-07-15 02:00:00 +02:00
2020-06-25 02:00:00 +02:00
if (BlockCampfire.h(iblockdata)) {
+ // CraftBukkit start - fire BlockIgniteEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getEntity()).isCancelled()) {
+ if (!itemactioncontext.getEntity().abilities.canInstantlyBuild) {
+ itemactioncontext.getItemStack().subtract(1);
2019-12-10 23:00:00 +01:00
+ }
2020-06-25 02:00:00 +02:00
+ return EnumInteractionResult.PASS;
+ }
+ // CraftBukkit end
this.a(world, blockposition);
world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.b, true));
flag = true;
2019-12-10 23:00:00 +01:00
} else {
blockposition = blockposition.shift(itemactioncontext.getClickedFace());
2020-06-25 02:00:00 +02:00
if (BlockFireAbstract.a((GeneratorAccess) world, blockposition)) {
2019-12-10 23:00:00 +01:00
+ // CraftBukkit start - fire BlockIgniteEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getEntity()).isCancelled()) {
+ if (!itemactioncontext.getEntity().abilities.canInstantlyBuild) {
+ itemactioncontext.getItemStack().subtract(1);
2019-04-23 04:00:00 +02:00
+ }
2019-12-10 23:00:00 +01:00
+ return EnumInteractionResult.PASS;
+ }
+ // CraftBukkit end
this.a(world, blockposition);
2020-06-25 02:00:00 +02:00
world.setTypeUpdate(blockposition, BlockFireAbstract.a((IBlockAccess) world, blockposition));
2019-12-10 23:00:00 +01:00
flag = true;