diff options
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 29 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/WorldServer.java | 5 |
2 files changed, 20 insertions, 14 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 923e0813..2ceeac08 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -230,16 +230,19 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + boolean keepInventory = this.world.getGameRules().getBoolean("keepInventory"); - for (int i = 0; i < this.inventory.items.length; ++i) { - if (this.inventory.items[i] != null) { - loot.add(new CraftItemStack(this.inventory.items[i])); + if (!keepInventory) { + for (int i = 0; i < this.inventory.items.length; ++i) { + if (this.inventory.items[i] != null) { + loot.add(new CraftItemStack(this.inventory.items[i])); + } } - } - for (int i = 0; i < this.inventory.armor.length; ++i) { - if (this.inventory.armor[i] != null) { - loot.add(new CraftItemStack(this.inventory.armor[i])); + for (int i = 0; i < this.inventory.armor.length; ++i) { + if (this.inventory.armor[i] != null) { + loot.add(new CraftItemStack(this.inventory.armor[i])); + } } } @@ -252,12 +255,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. - for (int i = 0; i < this.inventory.items.length; ++i) { - this.inventory.items[i] = null; - } + if (!keepInventory) { + for (int i = 0; i < this.inventory.items.length; ++i) { + this.inventory.items[i] = null; + } - for (int i = 0; i < this.inventory.armor.length; ++i) { - this.inventory.armor[i] = null; + for (int i = 0; i < this.inventory.armor.length; ++i) { + this.inventory.armor[i] = null; + } } this.closeInventory(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index bb17c7e1..f9e246c7 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -767,11 +767,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate explosion.b = flag1; explosion.a(); explosion.a(false); + */ + // CraftBukkit end - TODO: Check if explosions are still properly implemented + if (!flag1) { explosion.blocks.clear(); } - */ - // CraftBukkit end - TODO: Check if explosions are still properly implemented Iterator iterator = this.players.iterator(); |