Fixed the accidental deletion of getting cube type. Added a function to
return the cube type of a viewing Item Cube.
This commit is contained in:
parent
c0efc8e9c8
commit
5623d4995d
@ -4739,6 +4739,24 @@ public void payDay(int time)
|
||||
return false;
|
||||
}
|
||||
|
||||
public PlayerListener.Cube get_ItemCubeType(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).equalsIgnoreCase(ChatColor.AQUA+"Contains 9 item slots.")) {
|
||||
return PlayerListener.Cube.SMALL;
|
||||
}
|
||||
if (item_cube.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.AQUA+"Contains 54 item slots.")) {
|
||||
return PlayerListener.Cube.LARGE;
|
||||
}
|
||||
if (item_cube.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.AQUA+"Contains 27 item slots.")) {
|
||||
return PlayerListener.Cube.ENDER;
|
||||
}
|
||||
}
|
||||
}
|
||||
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.
|
||||
|
||||
@ -11848,6 +11848,7 @@ implements Listener
|
||||
int identifier=-1;
|
||||
if (isItemCube(item_cube)) {
|
||||
identifier = this.plugin.get_ItemCubeID(item_cube);
|
||||
cube_type = this.plugin.get_ItemCubeType(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…
x
Reference in New Issue
Block a user