Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Data
- @AllArgsConstructor
- public class ItemCase {
- public static final NamespacedKey CHEST_TYPE_KEY = new NamespacedKey(CashCases.getCashCases(), "chestType");
- private static final List<Pair<CaseType, ItemCase>> caseList = new ArrayList<>();
- static {
- Collection<Pair<ItemStack, Double>> bigCaseItems = new HashSet<>();
- bigCaseItems.add(new Pair<>(new ItemStack(Material.PAPER), 5D));
- ItemCase bigItemCase = new ItemCase(CaseType.BIG, 3, ChatColor.translateAlternateColorCodes('&', "&6Duża Skrzynia"), new ArrayList<>(), bigCaseItems);
- caseList.add(new Pair<>(CaseType.BIG, bigItemCase));
- }
- private CaseType caseType;
- private int rollRows;
- private String displayName;
- private List<String> lore;
- private Collection<Pair<ItemStack, Double>> rewards;
- public ItemStack toItemStack() {
- ItemStack result = new ItemStack(Material.CHEST, 1);
- ItemMeta resultItemMeta = result.getItemMeta();
- resultItemMeta.setDisplayName(this.getDisplayName());
- this.getLore().add(0, ChatColor.translateAlternateColorCodes('&', "&6Z tej skrzyni możesz wylosować:"));
- resultItemMeta.setLore(this.getLore());
- result.getItemMeta().getPersistentDataContainer().set(CHEST_TYPE_KEY, PersistentDataType.STRING, getCaseType().toString());
- result.setItemMeta(resultItemMeta);
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement