3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 04:50:05 +01:00
Paper/nms-patches/ItemFireball.patch

18 Zeilen
1.1 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/ItemFireball.java
+++ b/net/minecraft/server/ItemFireball.java
2016-11-17 02:41:03 +01:00
@@ -17,6 +17,14 @@
2016-02-29 22:32:46 +01:00
return EnumInteractionResult.FAIL;
} else {
2016-02-29 22:32:46 +01:00
if (world.getType(blockposition).getMaterial() == Material.AIR) {
+ // CraftBukkit start - fire BlockIgniteEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, entityhuman).isCancelled()) {
+ if (!entityhuman.abilities.canInstantlyBuild) {
2016-11-17 02:41:03 +01:00
+ itemstack.subtract(1);
+ }
2016-02-29 22:32:46 +01:00
+ return EnumInteractionResult.PASS;
+ }
+ // CraftBukkit end
2016-11-17 02:41:03 +01:00
world.a((EntityHuman) null, blockposition, SoundEffects.bx, SoundCategory.BLOCKS, 1.0F, (ItemFireball.j.nextFloat() - ItemFireball.j.nextFloat()) * 0.2F + 1.0F);
world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
}