diff options
author | Noah van der Aa <[email protected]> | 2024-11-08 12:29:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-11-08 11:29:40 +0000 |
commit | 99f4bb29ba77964304a37e51b7f1824a4a6032af (patch) | |
tree | a5570f16d774518b1328aedb32370b75b0779611 | |
parent | fcb6c72bc95ff62b9cd78dec457f485dafcc70a4 (diff) | |
download | Paper-99f4bb29ba77964304a37e51b7f1824a4a6032af.tar.gz Paper-99f4bb29ba77964304a37e51b7f1824a4a6032af.zip |
Fix infinite fireworks (#11592) (#11594)
-rw-r--r-- | patches/server/0212-PlayerLaunchProjectileEvent.patch | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/patches/server/0212-PlayerLaunchProjectileEvent.patch b/patches/server/0212-PlayerLaunchProjectileEvent.patch index b41463a06a..de1f0193b6 100644 --- a/patches/server/0212-PlayerLaunchProjectileEvent.patch +++ b/patches/server/0212-PlayerLaunchProjectileEvent.patch @@ -151,7 +151,7 @@ index b255e40277585928a767e5efd4b61708e13dab50..dfa3f9534159400e539ee61debedffb5 } diff --git a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java -index 400ad0fa1d07c8b120e3c3b5488dfa315aa2d23f..7e308b364227dedc2d05496f5e0c90573f4a53f7 100644 +index 400ad0fa1d07c8b120e3c3b5488dfa315aa2d23f..29a048a9b09166838616ac7ba1d31625d56b0bca 100644 --- a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java +++ b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java @@ -33,7 +33,7 @@ public class FireworkRocketItem extends Item implements ProjectileItem { @@ -170,7 +170,7 @@ index 400ad0fa1d07c8b120e3c3b5488dfa315aa2d23f..7e308b364227dedc2d05496f5e0c9057 - itemStack.shrink(1); + // Paper start - PlayerLaunchProjectileEvent + com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Firework) fireworkRocketEntity.projectile().getBukkitEntity()); -+ if (!event.callEvent() || fireworkRocketEntity.attemptSpawn()) return InteractionResult.PASS; ++ if (!event.callEvent() || !fireworkRocketEntity.attemptSpawn()) return InteractionResult.PASS; + if (event.shouldConsume() && !context.getPlayer().hasInfiniteMaterials()) itemStack.shrink(1); + else if (context.getPlayer() instanceof net.minecraft.server.level.ServerPlayer) ((net.minecraft.server.level.ServerPlayer) context.getPlayer()).getBukkitEntity().updateInventory(); + // Paper end - PlayerLaunchProjectileEvent |