Generic cleanup/reformat.

This commit is contained in:
Erik Broes
2011-02-02 00:32:18 +01:00
parent 001a45804e
commit 04be2b9b31
32 changed files with 83 additions and 99 deletions

View File

@@ -159,7 +159,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
public int firstPartial(ItemStack item) {
return firstPartial(item.getTypeId());
}
public HashMap<Integer, ItemStack> addItem(ItemStack... items) {
HashMap<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@@ -202,13 +202,13 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
int amount = item.getAmount();
int partialAmount = partialItem.getAmount();
int maxAmount = partialItem.getMaxStackSize();
// Check if it fully fits
if (amount + partialAmount <= maxAmount) {
partialItem.setAmount( amount + partialAmount );
break;
}
// It fits partially
partialItem.setAmount( maxAmount );
item.setAmount( amount + partialAmount - maxAmount );

View File

@@ -9,7 +9,7 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent
public CraftInventoryPlayer(net.minecraft.server.InventoryPlayer inventory) {
super(inventory);
}
public InventoryPlayer getInventory() {
return (InventoryPlayer) inventory;
}

View File

@@ -106,7 +106,7 @@ public class CraftItemStack extends ItemStack {
if (item != null) {
super.setDurability(durability);
item.damage = durability;
}
}
}
@Override