mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
Prevent TRAP while loading Fireballs
This commit is contained in:
parent
d23e71b03a
commit
c16a21caee
3 changed files with 34 additions and 0 deletions
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
From 0000000000000000000000000000000000000000 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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
}));
|
||||
}
|
||||
|
||||
--
|
|
@ -93,6 +93,7 @@ done
|
|||
# we do not need any lines added to this file for NMS
|
||||
|
||||
# import FileName
|
||||
import EntityFireballFireball
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue