Fixed the accidental deletion of ID setting for Item Cubes. Added a

function to get the ID of the viewing item cube.
master_event
sigonasr2 11 years ago
parent e00f04bf30
commit c0efc8e9c8
  1. 12
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 1
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -4739,6 +4739,18 @@ public void payDay(int time)
return false;
}
public int get_ItemCubeID(ItemStack item_cube) {
if (item_cube.hasItemMeta() && item_cube.getItemMeta().hasLore()) {
//Check to see if the Lore contains anything.
for (int i=0;i<item_cube.getItemMeta().getLore().size();i++) {
if (item_cube.getItemMeta().getLore().get(i).contains("ID#")) {
return Integer.valueOf(item_cube.getItemMeta().getLore().get(i).replace("ID#", ""));
}
}
}
return -1;
}
public boolean is_PermanentProperty(String property) {
//This function determines if the certain lore property is supposed to be kept on the item.
//Useful for checking what to remove and not remove from lore.

@ -11847,6 +11847,7 @@ implements Listener
Cube cube_type = null;
int identifier=-1;
if (isItemCube(item_cube)) {
identifier = this.plugin.get_ItemCubeID(item_cube);
if (identifier==-1) {
//This doesn't have an identifier yet. Create a new one.
identifier=this.plugin.getConfig().getInt("item-cube-numb");

Loading…
Cancel
Save