2013-03-22 23:31:28 +01:00
|
|
|
From af7cc23dd2d34c8d0c4a26d860dbf7b4110eb331 Mon Sep 17 00:00:00 2001
|
2013-01-15 02:18:40 +01:00
|
|
|
From: md_5 <md_5@bigpond.com>
|
|
|
|
Date: Sun, 23 Dec 2012 17:51:07 +1100
|
2013-01-19 09:22:25 +01:00
|
|
|
Subject: [PATCH] Update item merge logic
|
2013-01-15 02:18:40 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
src/main/java/net/minecraft/server/World.java | 15 +++++++--------
|
|
|
|
1 file changed, 7 insertions(+), 8 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2013-03-20 22:54:12 +01:00
|
|
|
index 134ab73..d78d948 100644
|
2013-01-15 02:18:40 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2013-03-15 22:35:56 +01:00
|
|
|
@@ -948,6 +948,7 @@ public abstract class World implements IBlockAccess {
|
2013-01-15 02:18:40 +01:00
|
|
|
event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity);
|
|
|
|
// Spigot start
|
|
|
|
ItemStack item = ((EntityItem) entity).getItemStack();
|
|
|
|
+ org.bukkit.craftbukkit.inventory.CraftItemStack craft = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(item);
|
|
|
|
int maxSize = item.getMaxStackSize();
|
|
|
|
if (item.count < maxSize) {
|
|
|
|
double radius = this.getWorld().itemMergeRadius;
|
2013-03-15 22:35:56 +01:00
|
|
|
@@ -957,14 +958,12 @@ public abstract class World implements IBlockAccess {
|
2013-01-15 02:18:40 +01:00
|
|
|
if (e instanceof EntityItem) {
|
|
|
|
EntityItem loopItem = (EntityItem) e;
|
|
|
|
ItemStack loopStack = loopItem.getItemStack();
|
|
|
|
- if (!loopItem.dead && loopStack.id == item.id && loopStack.getData() == item.getData()) {
|
|
|
|
- if (loopStack.tag == null || item.tag == null || !loopStack.tag.equals(item.tag)) {
|
|
|
|
- int toAdd = Math.min(loopStack.count, maxSize - item.count);
|
|
|
|
- item.count += toAdd;
|
|
|
|
- loopStack.count -= toAdd;
|
|
|
|
- if (loopStack.count <= 0) {
|
|
|
|
- loopItem.die();
|
|
|
|
- }
|
|
|
|
+ if (!loopItem.dead && craft.isSimilar(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(loopStack))) {
|
|
|
|
+ int toAdd = Math.min(loopStack.count, maxSize - item.count);
|
|
|
|
+ item.count += toAdd;
|
|
|
|
+ loopStack.count -= toAdd;
|
|
|
|
+ if (loopStack.count <= 0) {
|
|
|
|
+ loopItem.die();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
2013-03-22 23:31:28 +01:00
|
|
|
1.8.1-rc2
|
2013-01-15 02:18:40 +01:00
|
|
|
|