3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 19:40:07 +01:00
Paper/Spigot-Server-Patches/0413-Prevent-TRAP-while-loading-Fireballs.patch

23 Zeilen
1.0 KiB
Diff

From a8eee874aed5c9b5fde29bbb0ad160be44953d10 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 14 Dec 2019 01:10:45 +0000
Subject: [PATCH] Prevent TRAP while loading Fireballs
diff --git a/src/main/java/net/minecraft/server/EntityFireballFireball.java b/src/main/java/net/minecraft/server/EntityFireballFireball.java
index 3988e68d4f..a16b756a05 100644
--- a/src/main/java/net/minecraft/server/EntityFireballFireball.java
+++ b/src/main/java/net/minecraft/server/EntityFireballFireball.java
@@ -19,7 +19,7 @@ public abstract class EntityFireballFireball extends EntityFireball {
public void b(ItemStack itemstack) {
if (itemstack.getItem() != Items.FIRE_CHARGE || itemstack.hasTag()) {
this.getDataWatcher().set(EntityFireballFireball.f, SystemUtils.a(itemstack.cloneItemStack(), (itemstack1) -> { // Paper - decompile fix
- itemstack1.setCount(1);
+ if(!itemstack1.isEmpty()) itemstack1.setCount(1); // Paper
}));
}
--
2.24.1