summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorXor Boole <mcyoung@mit.edu>2016-11-30 16:40:40 +1100
committermd_5 <git@md-5.net>2016-11-30 16:40:40 +1100
commiteb6c1bf31a29bf3880f6e496f5e4ea52e1bdf291 (patch)
tree20a85d30e2ac91246d43a62a0c696549279d143b /src/main
parent6d5a66f00fc87ebeb7b6560ed66ca11ccf35f635 (diff)
downloadcraftbukkit-eb6c1bf31a29bf3880f6e496f5e4ea52e1bdf291.tar
craftbukkit-eb6c1bf31a29bf3880f6e496f5e4ea52e1bdf291.tar.gz
craftbukkit-eb6c1bf31a29bf3880f6e496f5e4ea52e1bdf291.tar.lz
craftbukkit-eb6c1bf31a29bf3880f6e496f5e4ea52e1bdf291.tar.xz
craftbukkit-eb6c1bf31a29bf3880f6e496f5e4ea52e1bdf291.zip
Add some expansions to Anvil Inventory API
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
index 6b415f23..6647b167 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
@@ -1,19 +1,22 @@
package org.bukkit.craftbukkit.inventory;
+import net.minecraft.server.ContainerAnvil;
import net.minecraft.server.IInventory;
import org.bukkit.Location;
-
import org.bukkit.inventory.AnvilInventory;
import org.bukkit.inventory.ItemStack;
public class CraftInventoryAnvil extends CraftInventory implements AnvilInventory {
+
private final Location location;
private final IInventory resultInventory;
+ private final ContainerAnvil container;
- public CraftInventoryAnvil(Location location, IInventory inventory, IInventory resultInventory) {
+ public CraftInventoryAnvil(Location location, IInventory inventory, IInventory resultInventory, ContainerAnvil container) {
super(inventory);
this.location = location;
this.resultInventory = resultInventory;
+ this.container = container;
}
public IInventory getResultInventory() {
@@ -53,4 +56,19 @@ public class CraftInventoryAnvil extends CraftInventory implements AnvilInventor
public Location getLocation() {
return location;
}
+
+ @Override
+ public String getRenameText() {
+ return container.l; // PAIL: renameText
+ }
+
+ @Override
+ public int getRepairCost() {
+ return container.a; // PAIL: levelCost
+ }
+
+ @Override
+ public void setRepairCost(int i) {
+ container.a = i; // PAIL:levelCost
+ }
}