Fix for multi-stack adds
Dieser Commit ist enthalten in:
Ursprung
be10e54235
Commit
2c798a9e9b
@ -209,7 +209,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
|
|||||||
} else {
|
} else {
|
||||||
// More than a single stack!
|
// More than a single stack!
|
||||||
if (item.getAmount() > getMaxItemStack()) {
|
if (item.getAmount() > getMaxItemStack()) {
|
||||||
setItem( firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack()));
|
setItem( firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack(), item.getDamage()));
|
||||||
item.setAmount(item.getAmount() - getMaxItemStack());
|
item.setAmount(item.getAmount() - getMaxItemStack());
|
||||||
} else {
|
} else {
|
||||||
// Just store it
|
// Just store it
|
||||||
|
@ -32,19 +32,19 @@ public class CraftItemStack extends ItemStack {
|
|||||||
this(type.getId(), amount);
|
this(type.getId(), amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CraftItemStack(final int type, final int amount, final byte damage) {
|
public CraftItemStack(final int type, final int amount, final short damage) {
|
||||||
this(type, amount, damage, null);
|
this(type, amount, damage, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CraftItemStack(final Material type, final int amount, final byte damage) {
|
public CraftItemStack(final Material type, final int amount, final short damage) {
|
||||||
this(type.getId(), amount, damage);
|
this(type.getId(), amount, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CraftItemStack(final Material type, final int amount, final byte damage, final Byte data) {
|
public CraftItemStack(final Material type, final int amount, final short damage, final Byte data) {
|
||||||
this(type.getId(), amount, damage, data);
|
this(type.getId(), amount, damage, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CraftItemStack(int type, int amount, byte damage, Byte data) {
|
public CraftItemStack(int type, int amount, short damage, Byte data) {
|
||||||
this(new net.minecraft.server.ItemStack(type, amount, data != null ? data : damage));
|
this(new net.minecraft.server.ItemStack(type, amount, data != null ? data : damage));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren