mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
PlayerDeathEvent#getItemsToKeep
Exposes a mutable array on items a player should keep on death. This allows a cleaner method to implement "Keep certain items on death" than how plugins currently do it in that it never removes them in first place, so its safe if the player logs out/server is shutdown before respawn. Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
This commit is contained in:
parent
8f25112b93
commit
be067fea11
11 changed files with 238 additions and 66 deletions
|
@ -0,0 +1,39 @@
|
|||
From 9552cb45732ed2d11f179cdf766996d3c0843001 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 11 Mar 2013 20:04:34 -0400
|
||||
Subject: [PATCH] PlayerDeathEvent#getItemsToKeep
|
||||
|
||||
Exposes a mutable array on items a player should keep on death
|
||||
|
||||
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||
index 5b0ef1eb1..b30818177 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||
@@ -18,6 +18,22 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
private boolean keepLevel = false;
|
||||
private boolean keepInventory = false;
|
||||
|
||||
+ // Paper start
|
||||
+ private List<ItemStack> itemsToKeep = new java.util.ArrayList<>();
|
||||
+
|
||||
+ /**
|
||||
+ * A mutable collection to add items that the player should keep on death (Similar to KeepInventory game rule)
|
||||
+ *
|
||||
+ * You <b>MUST</b> remove the item from the .getDrops() collection too or it will duplicate!
|
||||
+ *
|
||||
+ * @return The list to hold items to keep
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public List<ItemStack> getItemsToKeep() {
|
||||
+ return itemsToKeep;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, @Nullable final String deathMessage) {
|
||||
this(player, drops, droppedExp, 0, deathMessage);
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
From b3a5b4a4f7bc25a94dd49ab96ac2072b087cf59e Mon Sep 17 00:00:00 2001
|
||||
From 15820719793e4d4aee4726cfde7d15541dfc4764 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 28 Mar 2016 20:55:47 -0400
|
||||
Subject: [PATCH] MC Utils
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java
|
||||
index be179ba213..c53bc8230a 100644
|
||||
index be179ba21..c53bc8230 100644
|
||||
--- a/src/main/java/net/minecraft/server/AttributeInstance.java
|
||||
+++ b/src/main/java/net/minecraft/server/AttributeInstance.java
|
||||
@@ -21,8 +21,10 @@ public interface AttributeInstance {
|
||||
|
@ -20,7 +20,7 @@ index be179ba213..c53bc8230a 100644
|
|||
|
||||
void b(UUID uuid);
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 13dc7abc50..9bb7c9c652 100644
|
||||
index 13dc7abc5..9bb7c9c65 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -45,6 +45,7 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
|
@ -56,7 +56,7 @@ index 13dc7abc50..9bb7c9c652 100644
|
|||
return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 1ff78eed40..417c015e56 100644
|
||||
index 1ff78eed4..417c015e5 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -31,7 +31,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
|
@ -77,7 +77,7 @@ index 1ff78eed40..417c015e56 100644
|
|||
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
||||
index 34586bca65..b0c004b1f2 100644
|
||||
index 34586bca6..b0c004b1f 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
||||
@@ -24,6 +24,8 @@ public class ChunkCoordIntPair {
|
||||
|
@ -90,7 +90,7 @@ index 34586bca65..b0c004b1f2 100644
|
|||
return (long) i & 4294967295L | ((long) j & 4294967295L) << 32;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||
index cc9604749b..70a95c2636 100644
|
||||
index cc9604749..70a95c263 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||
@@ -13,7 +13,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
@ -103,7 +103,7 @@ index cc9604749b..70a95c2636 100644
|
|||
private final IChunkLoader e;
|
||||
private final IAsyncTaskHandler f;
|
||||
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
|
||||
index d24ec3d53c..9e83610f1a 100644
|
||||
index d24ec3d53..9e83610f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataBits.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataBits.java
|
||||
@@ -60,6 +60,7 @@ public class DataBits {
|
||||
|
@ -115,7 +115,7 @@ index d24ec3d53c..9e83610f1a 100644
|
|||
return this.a;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
|
||||
index dae40b9cde..2ee8791963 100644
|
||||
index dae40b9cd..2ee879196 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataPalette.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataPalette.java
|
||||
@@ -4,8 +4,10 @@ import javax.annotation.Nullable;
|
||||
|
@ -130,7 +130,7 @@ index dae40b9cde..2ee8791963 100644
|
|||
T a(int i);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
index 59cbbdcb3d..6fcfc5ef72 100644
|
||||
index 59cbbdcb3..6fcfc5ef7 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
@@ -8,7 +8,7 @@ import java.util.stream.Collectors;
|
||||
|
@ -172,7 +172,7 @@ index 59cbbdcb3d..6fcfc5ef72 100644
|
|||
this.b();
|
||||
packetdataserializer.writeByte(this.i);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
|
||||
index 372afbe94e..20b7c2c6dc 100644
|
||||
index 372afbe94..20b7c2c6d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.event.entity.EntityUnleashEvent;
|
||||
|
@ -184,7 +184,7 @@ index 372afbe94e..20b7c2c6dc 100644
|
|||
private float b;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 8b2000f683..1a3517aeed 100644
|
||||
index 8b2000f68..1a3517aee 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -125,6 +125,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
@ -196,7 +196,7 @@ index 8b2000f683..1a3517aeed 100644
|
|||
// CraftBukkit start - fire event
|
||||
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index d4fe0ab6bf..011c7af218 100644
|
||||
index d4fe0ab6b..011c7af21 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -122,6 +122,7 @@ public abstract class EntityLiving extends Entity {
|
||||
|
@ -208,7 +208,7 @@ index d4fe0ab6bf..011c7af218 100644
|
|||
@Override
|
||||
public float getBukkitYaw() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
|
||||
index 5f9255df14..5ea5170436 100644
|
||||
index 5f9255df1..5ea517043 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMonster.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
|
||||
@@ -2,11 +2,13 @@ package net.minecraft.server;
|
||||
|
@ -226,7 +226,7 @@ index 5f9255df14..5ea5170436 100644
|
|||
return SoundCategory.HOSTILE;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index b8abd6363f..a07ee150c2 100644
|
||||
index b8abd6363..a07ee150c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.server;
|
||||
|
@ -277,10 +277,31 @@ index b8abd6363f..a07ee150c2 100644
|
|||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 132fe8e880..3fe2aa2313 100644
|
||||
index 132fe8e88..1fe7c0b01 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -584,6 +584,17 @@ public final class ItemStack {
|
||||
@@ -36,10 +36,19 @@ import org.bukkit.event.world.StructureGrowEvent;
|
||||
public final class ItemStack {
|
||||
|
||||
private static final Logger c = LogManager.getLogger();
|
||||
- public static final ItemStack a = new ItemStack((Item) null);
|
||||
+ public static final ItemStack a = new ItemStack((Item) null);public static final ItemStack NULL_ITEM = a; // Paper - OBFHELPER
|
||||
public static final DecimalFormat b = D();
|
||||
private int count;
|
||||
private int e;
|
||||
+ // Paper start
|
||||
+ private org.bukkit.craftbukkit.inventory.CraftItemStack bukkitStack;
|
||||
+ public org.bukkit.inventory.ItemStack getBukkitStack() {
|
||||
+ if (bukkitStack == null || bukkitStack.getHandle() != this) {
|
||||
+ bukkitStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this);
|
||||
+ }
|
||||
+ return bukkitStack;
|
||||
+ }
|
||||
+ // Paper end
|
||||
@Deprecated
|
||||
private Item item;
|
||||
private NBTTagCompound tag;
|
||||
@@ -584,6 +593,17 @@ public final class ItemStack {
|
||||
return this.tag != null ? this.tag.getList("Enchantments", 10) : new NBTTagList();
|
||||
}
|
||||
|
||||
|
@ -298,7 +319,7 @@ index 132fe8e880..3fe2aa2313 100644
|
|||
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
|
||||
this.tag = nbttagcompound;
|
||||
}
|
||||
@@ -668,6 +679,7 @@ public final class ItemStack {
|
||||
@@ -668,6 +688,7 @@ public final class ItemStack {
|
||||
return this.tag != null && this.tag.hasKeyOfType("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false;
|
||||
}
|
||||
|
||||
|
@ -306,9 +327,17 @@ index 132fe8e880..3fe2aa2313 100644
|
|||
public void a(String s, NBTBase nbtbase) {
|
||||
this.getOrCreateTag().set(s, nbtbase);
|
||||
}
|
||||
@@ -743,6 +764,7 @@ public final class ItemStack {
|
||||
// CraftBukkit start
|
||||
@Deprecated
|
||||
public void setItem(Item item) {
|
||||
+ this.bukkitStack = null; // Paper
|
||||
this.item = item;
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
new file mode 100644
|
||||
index 0000000000..c97e116aaf
|
||||
index 000000000..c97e116aa
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@@ -0,0 +1,316 @@
|
||||
|
@ -629,7 +658,7 @@ index 0000000000..c97e116aaf
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
||||
index 434471215d..8c5d6c1d38 100644
|
||||
index 434471215..8c5d6c1d3 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
||||
@@ -23,7 +23,7 @@ public class NBTTagCompound implements NBTBase {
|
||||
|
@ -656,7 +685,7 @@ index 434471215d..8c5d6c1d38 100644
|
|||
public UUID a(String s) {
|
||||
return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least"));
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index d85bc522c3..e2fc41d6d1 100644
|
||||
index d85bc522c..e2fc41d6d 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -43,7 +43,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
@ -697,7 +726,7 @@ index d85bc522c3..e2fc41d6d1 100644
|
|||
public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
||||
this.a = packet;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
index 7582151ae4..d05f1e02cf 100644
|
||||
index 7582151ae..d05f1e02c 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
@@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf {
|
||||
|
@ -709,7 +738,7 @@ index 7582151ae4..d05f1e02cf 100644
|
|||
for (int j = 1; j < 5; ++j) {
|
||||
if ((i & -1 << j * 7) == 0) {
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||
index d54177bdcc..2aa805eef1 100644
|
||||
index d54177bdc..2aa805eef 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||
@@ -42,6 +42,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
|
@ -721,7 +750,7 @@ index d54177bdcc..2aa805eef1 100644
|
|||
throw new SkipEncodeException(throwable);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
index 395215bbdd..f2159bc2dd 100644
|
||||
index 395215bbd..f2159bc2d 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
@@ -13,7 +13,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
|
@ -742,7 +771,7 @@ index 395215bbdd..f2159bc2dd 100644
|
|||
int j = 0;
|
||||
ChunkSection[] achunksection = chunk.getSections();
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 330e74bb91..d97cc4f727 100644
|
||||
index 330e74bb9..d97cc4f72 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
|
@ -758,8 +787,21 @@ index 330e74bb91..d97cc4f727 100644
|
|||
// CraftBukkit start - multithreaded fields
|
||||
private volatile int chatThrottle;
|
||||
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java
|
||||
index 997fdc499..988a36119 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInventory.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInventory.java
|
||||
@@ -20,7 +20,7 @@ public class PlayerInventory implements IInventory {
|
||||
public final NonNullList<ItemStack> items;
|
||||
public final NonNullList<ItemStack> armor;
|
||||
public final NonNullList<ItemStack> extraSlots;
|
||||
- private final List<NonNullList<ItemStack>> f;
|
||||
+ private final List<NonNullList<ItemStack>> f;List<NonNullList<ItemStack>> getComponents() { return f; } // Paper - OBFHELPER
|
||||
public int itemInHandIndex;
|
||||
public EntityHuman player;
|
||||
private ItemStack carried;
|
||||
diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java
|
||||
index 6740b396a1..ea08c5a1c8 100644
|
||||
index 6740b396a..ea08c5a1c 100644
|
||||
--- a/src/main/java/net/minecraft/server/PotionUtil.java
|
||||
+++ b/src/main/java/net/minecraft/server/PotionUtil.java
|
||||
@@ -110,6 +110,7 @@ public class PotionUtil {
|
||||
|
@ -771,7 +813,7 @@ index 6740b396a1..ea08c5a1c8 100644
|
|||
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||
index a894f7886d..93935e7c77 100644
|
||||
index a894f7886..93935e7c7 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||
@@ -56,6 +56,7 @@ public class RegistryBlockID<T> implements Registry<T> {
|
||||
|
@ -783,7 +825,7 @@ index a894f7886d..93935e7c77 100644
|
|||
return this.b.size();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
index 8cb97b894a..5e71d2ac27 100644
|
||||
index 8cb97b894..5e71d2ac2 100644
|
||||
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
@@ -35,8 +35,8 @@ public class SystemUtils {
|
||||
|
@ -835,6 +877,18 @@ index 8cb97b894a..5e71d2ac27 100644
|
|||
}
|
||||
|
||||
static enum IdentityHashingStrategy implements Strategy<Object> {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 2ef4ac64b..f907d4f3b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -94,6 +94,7 @@ public final class CraftItemStack extends ItemStack {
|
||||
}
|
||||
|
||||
net.minecraft.server.ItemStack handle;
|
||||
+ public net.minecraft.server.ItemStack getHandle() { return handle; } // Paper
|
||||
|
||||
/**
|
||||
* Mirror
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 118143d945356e7487b7759c96bf8fe042f6beb0 Mon Sep 17 00:00:00 2001
|
||||
From ee2d92df4b299fe51ad0ff6a50b52829403e1d2c Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 28 May 2015 23:00:19 -0400
|
||||
Subject: [PATCH] Handle Item Meta Inconsistencies
|
||||
|
@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the
|
|||
ItemMeta API equivalents, and should deprecate the old API's.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 3fe2aa2313..0422d6e047 100644
|
||||
index 1fe7c0b01..e0f782acc 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader;
|
||||
|
@ -30,7 +30,7 @@ index 3fe2aa2313..0422d6e047 100644
|
|||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
@@ -56,6 +58,22 @@ public final class ItemStack {
|
||||
@@ -65,6 +67,22 @@ public final class ItemStack {
|
||||
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
|
||||
return decimalformat;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ index 3fe2aa2313..0422d6e047 100644
|
|||
|
||||
public ItemStack(IMaterial imaterial) {
|
||||
this(imaterial, 1);
|
||||
@@ -98,6 +116,7 @@ public final class ItemStack {
|
||||
@@ -107,6 +125,7 @@ public final class ItemStack {
|
||||
if (nbttagcompound.hasKeyOfType("tag", 10)) {
|
||||
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
|
||||
this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone();
|
||||
|
@ -61,7 +61,7 @@ index 3fe2aa2313..0422d6e047 100644
|
|||
this.getItem().a(this.tag);
|
||||
// CraftBukkit end
|
||||
}
|
||||
@@ -597,6 +616,7 @@ public final class ItemStack {
|
||||
@@ -606,6 +625,7 @@ public final class ItemStack {
|
||||
// Paper end
|
||||
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
|
||||
this.tag = nbttagcompound;
|
||||
|
@ -69,7 +69,7 @@ index 3fe2aa2313..0422d6e047 100644
|
|||
}
|
||||
|
||||
public IChatBaseComponent getName() {
|
||||
@@ -673,6 +693,7 @@ public final class ItemStack {
|
||||
@@ -682,6 +702,7 @@ public final class ItemStack {
|
||||
nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment)));
|
||||
nbttagcompound.setShort("lvl", (short) ((byte) i));
|
||||
nbttaglist.add((NBTBase) nbttagcompound);
|
||||
|
@ -78,7 +78,7 @@ index 3fe2aa2313..0422d6e047 100644
|
|||
|
||||
public boolean hasEnchantments() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 2ef4ac64b2..d1a546c8f0 100644
|
||||
index f907d4f3b..eeb2c5689 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -4,6 +4,7 @@ import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS;
|
||||
|
@ -89,7 +89,7 @@ index 2ef4ac64b2..d1a546c8f0 100644
|
|||
import java.util.Map;
|
||||
|
||||
import net.minecraft.server.EnchantmentManager;
|
||||
@@ -186,28 +187,11 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -187,28 +188,11 @@ public final class CraftItemStack extends ItemStack {
|
||||
public void addUnsafeEnchantment(Enchantment ench, int level) {
|
||||
Validate.notNull(ench, "Cannot add null enchantment");
|
||||
|
||||
|
@ -123,7 +123,7 @@ index 2ef4ac64b2..d1a546c8f0 100644
|
|||
}
|
||||
|
||||
static boolean makeTag(net.minecraft.server.ItemStack item) {
|
||||
@@ -224,66 +208,32 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -225,66 +209,32 @@ public final class CraftItemStack extends ItemStack {
|
||||
|
||||
@Override
|
||||
public boolean containsEnchantment(Enchantment ench) {
|
||||
|
@ -201,7 +201,7 @@ index 2ef4ac64b2..d1a546c8f0 100644
|
|||
|
||||
static Map<Enchantment, Integer> getEnchantments(net.minecraft.server.ItemStack item) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 99a2c8c8b1..5e823e1b1a 100644
|
||||
index 99a2c8c8b..5e823e1b1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -8,6 +8,7 @@ import java.lang.reflect.Constructor;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 79703f23ddc633e8427f70dd84304f17a1af2387 Mon Sep 17 00:00:00 2001
|
||||
From 127e1e338fa2acd16ab6a7ca19ae1e504dd65bac Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 21 Dec 2016 03:48:29 -0500
|
||||
Subject: [PATCH] Optimize ItemStack.isEmpty()
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Optimize ItemStack.isEmpty()
|
|||
Remove hashMap lookup every check, simplify code to remove ternary
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 56787ed25c..f71d9ee578 100644
|
||||
index e0f782acc..865ff2ee1 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -142,7 +142,7 @@ public final class ItemStack {
|
||||
@@ -151,7 +151,7 @@ public final class ItemStack {
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
|
@ -19,5 +19,5 @@ index 56787ed25c..f71d9ee578 100644
|
|||
|
||||
public ItemStack cloneAndSubtract(int i) {
|
||||
--
|
||||
2.19.0
|
||||
2.21.0
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From d906a8427aca8749380cfd56bf4e91d343ab6cf3 Mon Sep 17 00:00:00 2001
|
||||
From c6493182e686f8709c559c049d181ef5660fb1a4 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Sat, 27 Jan 2018 17:04:14 -0500
|
||||
Subject: [PATCH] Add ArmorStand Item Meta
|
||||
|
@ -26,10 +26,10 @@ index 3a6e6f687..6a86cb7eb 100644
|
|||
case CHEST:
|
||||
case TRAPPED_CHEST:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index d1a546c8f..284630f74 100644
|
||||
index eeb2c5689..69faeb9c0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -403,6 +403,8 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -404,6 +404,8 @@ public final class CraftItemStack extends ItemStack {
|
||||
return new CraftMetaSpawnEgg(item.getTag());
|
||||
case KNOWLEDGE_BOOK:
|
||||
return new CraftMetaKnowledgeBook(item.getTag());
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From bedaa9f8ea67d7a73e1bfcb46d013931abc193f0 Mon Sep 17 00:00:00 2001
|
||||
From 97d696eb8fc7eaf1149bcdf0a955c01b250c5185 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 5 Jun 2018 23:00:29 -0400
|
||||
Subject: [PATCH] ItemStack#getMaxItemUseDuration
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
|
|||
Allows you to determine how long it takes to use a usable/consumable item
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 886ec71866..ecab15b45a 100644
|
||||
index 865ff2ee1..ba021bc40 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -533,6 +533,7 @@ public final class ItemStack {
|
||||
@@ -542,6 +542,7 @@ public final class ItemStack {
|
||||
this.getItem().b(this, world, entityhuman);
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,10 @@ index 886ec71866..ecab15b45a 100644
|
|||
return this.getItem().c(this);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 284630f74e..1282ee3995 100644
|
||||
index 69faeb9c0..bc8fb2816 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -183,6 +183,13 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -184,6 +184,13 @@ public final class CraftItemStack extends ItemStack {
|
||||
return (handle == null) ? Material.AIR.getMaxStackSize() : handle.getItem().getMaxStackSize();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 0d5c6c41c263d5d58abdf24833a1498562ddeba4 Mon Sep 17 00:00:00 2001
|
||||
From 97c3f604582d177fde7d6f05e32f7158ef9d3e3b Mon Sep 17 00:00:00 2001
|
||||
From: Hugo Manrique <hugmanrique@gmail.com>
|
||||
Date: Thu, 26 Jul 2018 14:10:23 +0200
|
||||
Subject: [PATCH] Don't call getItemMeta on hasItemMeta
|
||||
|
@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set.
|
|||
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 1282ee399..f41ccba79 100644
|
||||
index bc8fb2816..ca9399bdb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -524,7 +524,7 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -525,7 +525,7 @@ public final class CraftItemStack extends ItemStack {
|
||||
|
||||
@Override
|
||||
public boolean hasItemMeta() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 6bf0f56317073c410ca0a168e77a084f55cf066d Mon Sep 17 00:00:00 2001
|
||||
From c51c553bbfcc0af8aa47d3da1d397636f883faaa Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 22 Nov 2016 00:40:42 -0500
|
||||
Subject: [PATCH] Fix client rendering skulls from same user
|
||||
|
@ -12,11 +12,11 @@ This allows the client to render multiple skull textures from the same user,
|
|||
for when different skins were used when skull was made.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 713977e3c..91a9f1bbb 100644
|
||||
index ba021bc40..76e0f6417 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -44,7 +44,7 @@ public final class ItemStack {
|
||||
private int e;
|
||||
@@ -53,7 +53,7 @@ public final class ItemStack {
|
||||
// Paper end
|
||||
@Deprecated
|
||||
private Item item;
|
||||
- private NBTTagCompound tag;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From b7cc5833617773b0957b9f7dd8d0c6785275f828 Mon Sep 17 00:00:00 2001
|
||||
From 8bc8f28b66ce5f9a6f903c800d2a3f18bc753ae4 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 27 Apr 2016 22:09:52 -0400
|
||||
Subject: [PATCH] Optimize Hoppers
|
||||
|
@ -11,7 +11,7 @@ Subject: [PATCH] Optimize Hoppers
|
|||
* Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 10efe6b3d9..6feea98b6b 100644
|
||||
index 10efe6b3d..6feea98b6 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -420,6 +420,15 @@ public class PaperWorldConfig {
|
||||
|
@ -31,10 +31,10 @@ index 10efe6b3d9..6feea98b6b 100644
|
|||
private void disableSprintInterruptionOnAttack() {
|
||||
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 4c2705b731..e4a8ab8591 100644
|
||||
index 76e0f6417..f34ac392e 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -470,8 +470,9 @@ public final class ItemStack {
|
||||
@@ -479,8 +479,9 @@ public final class ItemStack {
|
||||
return this.getItem().a(this, entityhuman, entityliving, enumhand);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ index 4c2705b731..e4a8ab8591 100644
|
|||
itemstack.d(this.B());
|
||||
if (this.tag != null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 4565a56b3f..38c0201acb 100644
|
||||
index 4565a56b3..38c0201ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1048,6 +1048,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
|
@ -59,7 +59,7 @@ index 4565a56b3f..38c0201acb 100644
|
|||
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
|
||||
this.methodProfiler.a(() -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 29fe031d85..d67fd92d9d 100644
|
||||
index 29fe031d8..d67fd92d9 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -52,6 +52,7 @@ public abstract class TileEntity implements KeyedObject { // Paper
|
||||
|
@ -79,7 +79,7 @@ index 29fe031d85..d67fd92d9d 100644
|
|||
this.world.b(this.position, this);
|
||||
if (!this.f.isAir()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
index 559eedfa66..7303a6fdda 100644
|
||||
index 559eedfa6..7303a6fdd 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
@@ -189,6 +189,154 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From 354126d95e7f5100281067ddde4845dfad3dbb43 Mon Sep 17 00:00:00 2001
|
||||
From 5137342b191814dba8b79fd8c1286a5dacfd191f Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 8 Sep 2018 18:43:31 -0500
|
||||
Subject: [PATCH] Allow chests to be placed with NBT data
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 914da48a2..7827f692a 100644
|
||||
index f34ac392e..d8ebcf0a3 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -232,6 +232,15 @@ public final class ItemStack {
|
||||
@@ -241,6 +241,15 @@ public final class ItemStack {
|
||||
enuminteractionresult = EnumInteractionResult.FAIL; // cancel placement
|
||||
// PAIL: Remove this when MC-99075 fixed
|
||||
placeEvent.getPlayer().updateInventory();
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
From c2d817326641fd28090ef59ea0da9e6877796bb4 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 27 Mar 2019 23:01:33 -0400
|
||||
Subject: [PATCH] PlayerDeathEvent#getItemsToKeep
|
||||
|
||||
Exposes a mutable array on items a player should keep on death
|
||||
|
||||
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 1d3730083..b9d0c0f74 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -490,6 +490,46 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Paper start - process inventory
|
||||
+ private static void processKeep(org.bukkit.event.entity.PlayerDeathEvent event, NonNullList<ItemStack> inv) {
|
||||
+ List<org.bukkit.inventory.ItemStack> itemsToKeep = event.getItemsToKeep();
|
||||
+ if (inv == null) {
|
||||
+ // remainder of items left in toKeep - plugin added stuff on death that wasn't in the initial loot?
|
||||
+ if (!itemsToKeep.isEmpty()) {
|
||||
+ for (org.bukkit.inventory.ItemStack itemStack : itemsToKeep) {
|
||||
+ event.getEntity().getInventory().addItem(itemStack);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ for (int i = 0; i < inv.size(); ++i) {
|
||||
+ ItemStack item = inv.get(i);
|
||||
+ if (EnchantmentManager.shouldNotDrop(item) || itemsToKeep.isEmpty() || item.isEmpty()) {
|
||||
+ inv.set(i, ItemStack.NULL_ITEM);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ final org.bukkit.inventory.ItemStack bukkitStack = item.getBukkitStack();
|
||||
+ boolean keep = false;
|
||||
+ final Iterator<org.bukkit.inventory.ItemStack> iterator = itemsToKeep.iterator();
|
||||
+ while (iterator.hasNext()) {
|
||||
+ final org.bukkit.inventory.ItemStack itemStack = iterator.next();
|
||||
+ if (bukkitStack.equals(itemStack)) {
|
||||
+ iterator.remove();
|
||||
+ keep = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!keep) {
|
||||
+ inv.set(i, ItemStack.NULL_ITEM);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public void die(DamageSource damagesource) {
|
||||
boolean flag = this.world.getGameRules().getBoolean("showDeathMessages");
|
||||
// CraftBukkit start - fire PlayerDeathEvent
|
||||
@@ -567,8 +607,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.releaseShoulderEntities();
|
||||
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
||||
if (!event.getKeepInventory()) {
|
||||
- this.inventory.clear();
|
||||
+ // Paper start - replace logic
|
||||
+ for (NonNullList<ItemStack> inv : this.inventory.getComponents()) {
|
||||
+ processKeep(event, inv);
|
||||
+ }
|
||||
+ processKeep(event, null);
|
||||
+ // Paper end
|
||||
}
|
||||
+
|
||||
this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DEATH); // Paper
|
||||
this.setSpectatorTarget(this); // Remove spectated target
|
||||
// CraftBukkit end
|
||||
--
|
||||
2.21.0
|
||||
|
Loading…
Reference in a new issue