mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-08 11:41:28 +01:00
Fix background glass method in 1.12-
This commit is contained in:
parent
0977b4faae
commit
5c9a8c3e8f
@ -83,7 +83,7 @@ public class CrateAnimateTask extends BukkitRunnable {
|
||||
num = slow ? 1 : 0;
|
||||
|
||||
for (int i = 0; i < 27; i++) {
|
||||
inventory.setItem(i, Methods.toGlass(true, 0));
|
||||
inventory.setItem(i, Methods.getGlass(true, 0));
|
||||
}
|
||||
|
||||
for (int i = 9; i < 18; i++) {
|
||||
|
@ -37,7 +37,14 @@ public class Methods {
|
||||
return getGlass(false, instance.getConfig().getInt("Interfaces.Glass Type 3"));
|
||||
}
|
||||
|
||||
private static ItemStack getGlass(Boolean rainbow, int type) {
|
||||
/**
|
||||
* Creates a glass itemstack
|
||||
*
|
||||
* @param rainbow Whether or not to assign a random color to the glass.
|
||||
* @param type If rainbow is false, the glass color.
|
||||
* @return A glass itemstack conforming to the params.
|
||||
*/
|
||||
public static ItemStack getGlass(boolean rainbow, int type) {
|
||||
int randomNum = 1 + (int) (Math.random() * 6);
|
||||
ItemStack glass;
|
||||
if (rainbow) {
|
||||
@ -53,7 +60,6 @@ public class Methods {
|
||||
return glass;
|
||||
}
|
||||
|
||||
|
||||
public static boolean canGiveKit(Player player) {
|
||||
try {
|
||||
if (player.hasPermission("ultimatekits.cangive")) return true;
|
||||
@ -303,25 +309,5 @@ public class Methods {
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
/**
|
||||
* Creates a glass itemstack
|
||||
*
|
||||
* @param rainbow Whether or not to assign a random color to the glass.
|
||||
* @param type If rainbow is false, the glass color.
|
||||
* @return A glass itemstack conforming to the params.
|
||||
*/
|
||||
public static ItemStack toGlass(Boolean rainbow, int type) {
|
||||
int randomNum = 1 + (int) (Math.random() * 6);
|
||||
ItemStack glass;
|
||||
if (rainbow) {
|
||||
glass = new ItemStack(Material.LEGACY_STAINED_GLASS_PANE, 1, (short) randomNum);
|
||||
} else {
|
||||
glass = new ItemStack(Material.LEGACY_STAINED_GLASS_PANE, 1, (short) type);
|
||||
}
|
||||
ItemMeta glassMeta = glass.getItemMeta();
|
||||
glassMeta.setDisplayName("§l");
|
||||
glass.setItemMeta(glassMeta);
|
||||
return glass;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user