use of org.spongepowered.api.item.inventory.ItemStack in project HuskyCrates-Sponge by codeHusky.
the class SpinnerCrateView method confettiBorder.
private ItemStack confettiBorder() {
DyeColor[] colors = { DyeColors.BLUE, DyeColors.CYAN, DyeColors.GREEN, DyeColors.LIGHT_BLUE, DyeColors.LIME, DyeColors.MAGENTA, DyeColors.ORANGE, DyeColors.PINK, DyeColors.PURPLE, DyeColors.RED, DyeColors.YELLOW };
ItemStack g = ItemStack.builder().itemType(ItemTypes.STAINED_GLASS_PANE).add(Keys.DYE_COLOR, colors[(int) Math.floor(Math.random() * colors.length)]).build();
g.offer(Keys.DISPLAY_NAME, Text.of(TextStyles.RESET, "You won an item!"));
return g;
}
Aggregations