mirror of
https://github.com/darksaid98/Builders-Utilities.git
synced 2026-12-03 06:28:53 +00:00
Do style from 8bd43aa1eb properly
This commit is contained in:
55 files changed
+1499
-188
No files matched your search
+28
-14
@@ -26,21 +26,15 @@ package net.arcaniax.buildersutilities.menus.bannermenus;
|
||||
|
||||
import net.arcaniax.buildersutilities.menus.Menus;
|
||||
import net.arcaniax.buildersutilities.menus.inv.ClickableItem;
|
||||
import net.arcaniax.buildersutilities.menus.inv.SmartInventory;
|
||||
import net.arcaniax.buildersutilities.menus.inv.content.InventoryContents;
|
||||
import net.arcaniax.buildersutilities.menus.inv.content.InventoryProvider;
|
||||
import net.arcaniax.buildersutilities.menus.inv.content.SlotPos;
|
||||
import net.arcaniax.buildersutilities.utils.BannerUtil;
|
||||
import net.arcaniax.buildersutilities.utils.Items;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BannerMenuProvider implements InventoryProvider {
|
||||
|
||||
@@ -48,7 +42,10 @@ public class BannerMenuProvider implements InventoryProvider {
|
||||
.create(Material.GRAY_STAINED_GLASS_PANE, (short) 0, 1, "&7", "");
|
||||
private static final ItemStack randomizeHead = Items.createHead(
|
||||
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzk3OTU1NDYyZTRlNTc2NjY0NDk5YWM0YTFjNTcyZjYxNDNmMTlhZDJkNjE5NDc3NjE5OGY4ZDEzNmZkYjIifX19",
|
||||
1, "&7Click to randomise", "");
|
||||
1,
|
||||
"&7Click to randomise",
|
||||
""
|
||||
);
|
||||
// private static final ItemStack currentColor = BannerUtil.createBanner("&a", 1, DyeColor.WHITE, "");
|
||||
private static final ItemStack closeButton = Items
|
||||
.create(Material.BARRIER, (short) 0, 1, "&cClick to close", "");
|
||||
@@ -64,10 +61,20 @@ public class BannerMenuProvider implements InventoryProvider {
|
||||
|
||||
int row = 2;
|
||||
int column = 1;
|
||||
for (DyeColor color : BannerUtil.allColors){
|
||||
contents.set(row, column, ClickableItem.of(BannerUtil.createBanner("&3" + StringUtils.capitalize(color.toString().toLowerCase().replace("_", " ")), color, "&7__&7Click to select"),inventoryClickEvent -> selectColor(player, color)));
|
||||
for (DyeColor color : BannerUtil.allColors) {
|
||||
contents.set(
|
||||
row,
|
||||
column,
|
||||
ClickableItem.of(
|
||||
BannerUtil.createBanner("&3" + StringUtils.capitalize(color
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.replace("_", " ")), color, "&7__&7Click to select"),
|
||||
inventoryClickEvent -> selectColor(player, color)
|
||||
)
|
||||
);
|
||||
column++;
|
||||
if (column==9){
|
||||
if (column == 9) {
|
||||
column = 1;
|
||||
row++;
|
||||
}
|
||||
@@ -86,14 +93,21 @@ public class BannerMenuProvider implements InventoryProvider {
|
||||
// }
|
||||
}
|
||||
|
||||
private void selectRandomColor(Player player){
|
||||
private void selectRandomColor(Player player) {
|
||||
DyeColor dyeColor = BannerUtil.getRandomDye();
|
||||
BannerUtil.currentBanner.put(player.getUniqueId(), BannerUtil.createBanner("&6Banner", dyeColor, "&7__&7Click to get banner"));
|
||||
BannerUtil.currentBanner.put(
|
||||
player.getUniqueId(),
|
||||
BannerUtil.createBanner("&6Banner", dyeColor, "&7__&7Click to get banner")
|
||||
);
|
||||
Menus.BANNER_MENU_COLOR.open(player);
|
||||
}
|
||||
|
||||
private void selectColor(Player player, DyeColor dyeColor){
|
||||
BannerUtil.currentBanner.put(player.getUniqueId(), BannerUtil.createBanner("&6Banner", dyeColor, "&7__&7Click to get banner"));
|
||||
private void selectColor(Player player, DyeColor dyeColor) {
|
||||
BannerUtil.currentBanner.put(
|
||||
player.getUniqueId(),
|
||||
BannerUtil.createBanner("&6Banner", dyeColor, "&7__&7Click to get banner")
|
||||
);
|
||||
Menus.BANNER_MENU_COLOR.open(player);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user