diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index ce2b9fe..91613ce 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index e7c19da..e634252 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -3323,8 +3323,8 @@ public class GenericFunctions { ItemUtils.DeleteAllLoreLinesAtAndAfterLineContainingSubstring(item, ChatColor.WHITE+"Contents ("); ItemUtils.DeleteAllLoreLinesAtAndAfterLineContainingSubstring(item, ChatColor.AQUA+" "); ItemUtils.addLore(item, ChatColor.WHITE+"Contents ("+GetItemCubeSpace(id)+"):"); - for (ItemStack it : TwosideKeeper.itemcube_updates.get(id)) { - ItemUtils.addLore(item, ChatColor.GRAY+" - "+GenericFunctions.UserFriendlyMaterialName(it)+(it.getAmount()>1?ChatColor.YELLOW+" x"+it.getAmount():"")); + for (ItemContainer it : TwosideKeeper.itemcube_updates.get(id)) { + ItemUtils.addLore(item, ChatColor.GRAY+" - "+GenericFunctions.UserFriendlyMaterialName(it.getItem())+(it.getAmount()>1?ChatColor.YELLOW+" x"+it.getAmount():"")); } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/ItemContainer.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/ItemContainer.java new file mode 100644 index 0000000..da92c27 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/ItemContainer.java @@ -0,0 +1,27 @@ +package sig.plugin.TwosideKeeper.HelperStructures.Common; + +import org.bukkit.inventory.ItemStack; + +//An Itemstack not bound by the limitation of 128 or more items in a stack. +public class ItemContainer { + ItemStack item; + int amt; + + public ItemContainer(ItemStack item) { + this.item=item.clone(); + this.amt=this.item.getAmount(); + this.item.setAmount(1); + } + + public void setAmount(int amt) { + this.amt = amt; + } + + public int getAmount() { + return this.amt; + } + + public ItemStack getItem() { + return this.item; + } +} diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java index 7f8d882..321e023 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java @@ -15,6 +15,7 @@ import sig.plugin.TwosideKeeper.TwosideKeeper; import sig.plugin.TwosideKeeper.HelperStructures.CubeType; import sig.plugin.TwosideKeeper.HelperStructures.CustomItem; import sig.plugin.TwosideKeeper.HelperStructures.ItemCube; +import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; import sig.plugin.TwosideKeeper.HolidayEvents.Christmas; public class InventoryUtils { @@ -53,6 +54,7 @@ public class InventoryUtils { }*/ remaining = remainingitems.values().toArray(new ItemStack[0]); //TwosideKeeper.log("Remaining items: "+ArrayUtils.toString(remaining), 0); + GenericFunctions.UpdateItemLore(itemStacks); } } return remaining; @@ -82,6 +84,7 @@ public class InventoryUtils { HashMap remainingitems = ItemCubeUtils.AttemptingToAddItemToFilterCube(id,virtualinventory,remaining); remaining = remainingitems.values().toArray(new ItemStack[0]); + GenericFunctions.UpdateItemLore(itemStacks); } } return remaining; diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index f674fa8..7009cc8 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -223,6 +223,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch; import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue; import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; import sig.plugin.TwosideKeeper.HelperStructures.Common.Habitation; +import sig.plugin.TwosideKeeper.HelperStructures.Common.ItemContainer; import sig.plugin.TwosideKeeper.HelperStructures.Common.JobRecipe; import sig.plugin.TwosideKeeper.HelperStructures.Common.RecipeCategory; import sig.plugin.TwosideKeeper.HelperStructures.Common.RecipeLinker; @@ -447,7 +448,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { public static File filesave; public static HashMap playerdata; public static HashMap livingentitydata; - public static HashMap> itemcube_updates; + public static HashMap> itemcube_updates; public static SpleefManager TwosideSpleefGames; public static WorldShopManager TwosideShops; public static MysteriousEssenceLogger EssenceLogger; //The logger for Essences. @@ -964,7 +965,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { playerdata = new HashMap(); banksessions = new HashMap(); livingentitydata = new HashMap(); - itemcube_updates = new HashMap>(); + itemcube_updates = new HashMap>(); validsetitems.add(Material.LEATHER_BOOTS); validsetitems.add(Material.LEATHER_CHESTPLATE); @@ -3621,21 +3622,19 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //Save the Item Cube. itemCube_saveConfig(itemcube_id,save_items,cub); - List itemcube_list = new ArrayList(); + List itemcube_list = new ArrayList(); for (ItemStack item : save_items) { if (ItemUtils.isValidItem(item)) { boolean found=false; for (int j=0;j remaining = virtualinventory.addItem(items); List savelist = new ArrayList(); - List itemlist = new ArrayList(); + List itemlist = new ArrayList(); for (ItemStack it : virtualinventory.getContents()) { if (ItemUtils.isValidItem(it)) { savelist.add(it); boolean found=false; for (int j=0;j itemcube_contents = new ArrayList(); - List itemcube_list = new ArrayList(); + List itemcube_list = new ArrayList(); for (int i=0;i itemcube_list = new ArrayList(); + List itemcube_list = new ArrayList(); for (int i=0;i itemslist = new ArrayList(); - List itemcube_list = new ArrayList(); + List itemcube_list = new ArrayList(); for (int i=0;i itemslist = new ArrayList(); - List itemcube_list = new ArrayList(); + List itemcube_list = new ArrayList(); for (int i=0;i