Prevent TRAP while loading Fireballs

This commit is contained in:
Shane Freeder 2019-12-14 01:11:59 +00:00
parent 12051feb76
commit 0585f99b05
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C
3 changed files with 38 additions and 2 deletions

View file

@ -1,4 +1,4 @@
From cabe477c5c143734d6b8242e4ab82203ca85a2b6 Mon Sep 17 00:00:00 2001
From 499a94be3e76d1a2ed87c18bad399d0543c5ded7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes
@ -156,6 +156,19 @@ index f2c0e06ba..909d13c42 100644
}
private EntityEnderDragon o() {
diff --git a/src/main/java/net/minecraft/server/EntityFireballFireball.java b/src/main/java/net/minecraft/server/EntityFireballFireball.java
index 8e28c4725..3988e68d4 100644
--- a/src/main/java/net/minecraft/server/EntityFireballFireball.java
+++ b/src/main/java/net/minecraft/server/EntityFireballFireball.java
@@ -18,7 +18,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((Object) itemstack.cloneItemStack(), (itemstack1) -> {
+ this.getDataWatcher().set(EntityFireballFireball.f, SystemUtils.a(itemstack.cloneItemStack(), (itemstack1) -> { // Paper - decompile fix
itemstack1.setCount(1);
}));
}
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 7d44348c7..73ecdd22e 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
@ -622,5 +635,5 @@ index 55fe7625a..19e68a783 100644
t0.a(nbttagcompound.getCompound("data"));
--
2.24.0
2.24.1

View file

@ -0,0 +1,22 @@
From 2515940c05e1f56035eb8ffd09f9848faf312900 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 3988e68d4..a16b756a0 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

View file

@ -93,6 +93,7 @@ done
# we do not need any lines added to this file for NMS
# import FileName
import EntityFireballFireball