@@ -8,15 +8,15 @@
|
||||
+import java.util.List;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.craftbukkit.entity.CraftVillager;
|
||||
+import org.bukkit.craftbukkit.entity.CraftAbstractVillager;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+// CraftBukkit end
|
||||
|
||||
public class InventoryMerchant implements IInventory {
|
||||
|
||||
@@ -11,6 +18,40 @@
|
||||
private MerchantRecipe recipe;
|
||||
@@ -12,6 +19,45 @@
|
||||
public int selectedIndex;
|
||||
private int e;
|
||||
|
||||
+ // CraftBukkit start - add fields and methods
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
@@ -38,12 +38,17 @@
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getMaxStackSize() {
|
||||
+ return maxStack;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int i) {
|
||||
+ maxStack = i;
|
||||
+ }
|
||||
+
|
||||
+ public org.bukkit.inventory.InventoryHolder getOwner() {
|
||||
+ return (merchant instanceof EntityVillager) ? (CraftVillager) ((EntityVillager) this.merchant).getBukkitEntity() : null;
|
||||
+ return (merchant instanceof EntityVillager) ? (CraftAbstractVillager) ((EntityVillager) this.merchant).getBukkitEntity() : null;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -52,24 +57,6 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public InventoryMerchant(EntityHuman entityhuman, IMerchant imerchant) {
|
||||
public InventoryMerchant(IMerchant imerchant) {
|
||||
this.itemsInSlots = NonNullList.a(3, ItemStack.a);
|
||||
this.player = entityhuman;
|
||||
@@ -78,7 +119,7 @@
|
||||
}
|
||||
|
||||
public IChatBaseComponent getDisplayName() {
|
||||
- return new ChatMessage("mob.villager", new Object[0]);
|
||||
+ return merchant.getScoreboardDisplayName(); // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean hasCustomName() {
|
||||
@@ -91,7 +132,7 @@
|
||||
}
|
||||
|
||||
public int getMaxStackSize() {
|
||||
- return 64;
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
this.merchant = imerchant;
|
||||
|
||||
Reference in New Issue
Block a user