fix: item names

This commit is contained in:
ineanto 2023-07-10 17:51:12 +02:00
parent 00168c03a7
commit cbc4c748ca
15 changed files with 20 additions and 16 deletions

View file

@ -13,11 +13,11 @@ import org.jetbrains.annotations.NotNull;
public class ManageCacheItem extends AsyncItem { public class ManageCacheItem extends AsyncItem {
public ManageCacheItem() { public ManageCacheItem() {
super(new ItemBuilder(Material.PAINTING) super(new ItemBuilder(Material.PAINTING)
.setDisplayName("§fManage skin cache...") .setDisplayName("Manage §6skin §fcache...")
.addLoreLines("§7Access the skin cache management panel."), .addLoreLines("§7Access the skin cache management panel."),
() -> { () -> {
final SkullBuilder builder = new SkullBuilder("Notch"); final SkullBuilder builder = new SkullBuilder("Notch");
builder.setDisplayName("§fManage §6skin §fcache..."); builder.setDisplayName("Manage §6skin §fcache...");
builder.addLoreLines("§7Access the skin cache management panel."); builder.addLoreLines("§7Access the skin cache management panel.");
return builder; return builder;
}); });

View file

@ -16,7 +16,7 @@ public class CacheStatisticsItem extends SuppliedItem {
final ItemBuilder builder = new ItemBuilder(Material.BOOK); final ItemBuilder builder = new ItemBuilder(Material.BOOK);
final LoadingCache<String, Optional<MojangSkin>> cache = NickoBukkit.getInstance().getMojangAPI().getSkinCache(); final LoadingCache<String, Optional<MojangSkin>> cache = NickoBukkit.getInstance().getMojangAPI().getSkinCache();
final CacheStats stats = cache.stats(); final CacheStats stats = cache.stats();
builder.setDisplayName("§fStatistics"); builder.setDisplayName("Statistics");
builder.addLoreLines( builder.addLoreLines(
"Request Count: §b" + stats.requestCount(), "Request Count: §b" + stats.requestCount(),
"Skin Cached: §b" + Math.round(cache.size()), "Skin Cached: §b" + Math.round(cache.size()),

View file

@ -13,7 +13,7 @@ public class InvalidateCacheItem extends SuppliedItem {
public InvalidateCacheItem() { public InvalidateCacheItem() {
super(() -> { super(() -> {
final ItemBuilder builder = new ItemBuilder(Material.TNT); final ItemBuilder builder = new ItemBuilder(Material.TNT);
builder.setDisplayName("§fInvalidate cache"); builder.setDisplayName("Invalidate cache");
builder.addLoreLines( builder.addLoreLines(
"§c§oNOT RECOMMENDED", "§c§oNOT RECOMMENDED",
"§7Invalidates every skin entry present in the cache.", "§7Invalidates every skin entry present in the cache.",

View file

@ -10,7 +10,7 @@ public class InvalidateEntryItem extends SuppliedItem {
public InvalidateEntryItem() { public InvalidateEntryItem() {
super(() -> { super(() -> {
final ItemBuilder builder = new ItemBuilder(Material.PAPER); final ItemBuilder builder = new ItemBuilder(Material.PAPER);
builder.setDisplayName("§fInvalidate specific entry"); builder.setDisplayName("Invalidate specific entry");
builder.addLoreLines("§7Select a specific skin to invalidate.", builder.addLoreLines("§7Select a specific skin to invalidate.",
"§7Useful if a skin has been updated", "§7Useful if a skin has been updated",
"§7recently and the cache no longer up-to-date."); "§7recently and the cache no longer up-to-date.");

View file

@ -10,7 +10,7 @@ public class ChangeNameItem extends SuppliedItem {
public ChangeNameItem() { public ChangeNameItem() {
super(() -> { super(() -> {
final ItemBuilder builder = new ItemBuilder(Material.NAME_TAG); final ItemBuilder builder = new ItemBuilder(Material.NAME_TAG);
builder.setDisplayName("§fChange §6name"); builder.setDisplayName("Change §6name");
builder.addLoreLines("§7Will open a GUI to change your name only."); builder.addLoreLines("§7Will open a GUI to change your name only.");
return builder; return builder;
}, click -> { }, click -> {

View file

@ -10,7 +10,7 @@ public class ChangeSkinItem extends SuppliedItem {
public ChangeSkinItem(Player player) { public ChangeSkinItem(Player player) {
super(() -> { super(() -> {
final SkullBuilder builder = new SkullBuilder(player.getName()); final SkullBuilder builder = new SkullBuilder(player.getName());
builder.setDisplayName("§fChange §6skin"); builder.setDisplayName("Change §6skin");
builder.addLoreLines("§7Will open a GUI to change your skin only."); builder.addLoreLines("§7Will open a GUI to change your skin only.");
return builder; return builder;
}, click -> { }, click -> {

View file

@ -10,7 +10,7 @@ public class GoBackItem extends SuppliedItem {
public GoBackItem(Gui gui, String parentTitle) { public GoBackItem(Gui gui, String parentTitle) {
super(() -> { super(() -> {
final ItemBuilder builder = new ItemBuilder(Material.ARROW); final ItemBuilder builder = new ItemBuilder(Material.ARROW);
builder.setDisplayName("§fGo back"); builder.setDisplayName("Go back");
builder.addLoreLines("§7Return to the previous window."); builder.addLoreLines("§7Return to the previous window.");
return builder; return builder;
}, click -> { }, click -> {

View file

@ -15,7 +15,7 @@ public class ScrollDownItem extends ScrollItem {
@Override @Override
public ItemProvider getItemProvider(ScrollGui gui) { public ItemProvider getItemProvider(ScrollGui gui) {
ItemBuilder builder = new ItemBuilder(Material.GREEN_STAINED_GLASS_PANE); ItemBuilder builder = new ItemBuilder(Material.GREEN_STAINED_GLASS_PANE);
builder.setDisplayName("§fScroll down"); builder.setDisplayName("Scroll down");
if (!gui.canScroll(1)) if (!gui.canScroll(1))
builder.addLoreLines("§7§o(You can't scroll further down.)"); builder.addLoreLines("§7§o(You can't scroll further down.)");

View file

@ -15,7 +15,7 @@ public class ScrollUpItem extends ScrollItem {
@Override @Override
public ItemProvider getItemProvider(ScrollGui gui) { public ItemProvider getItemProvider(ScrollGui gui) {
ItemBuilder builder = new ItemBuilder(Material.RED_STAINED_GLASS_PANE); ItemBuilder builder = new ItemBuilder(Material.RED_STAINED_GLASS_PANE);
builder.setDisplayName("§fScroll up"); builder.setDisplayName("Scroll up");
if (!gui.canScroll(-1)) if (!gui.canScroll(-1))
builder.addLoreLines("§7§o(You've reached the top.)"); builder.addLoreLines("§7§o(You've reached the top.)");

View file

@ -8,7 +8,7 @@ public class UnavailableItem extends SuppliedItem {
public UnavailableItem() { public UnavailableItem() {
super(() -> { super(() -> {
final ItemBuilder builder = new ItemBuilder(Material.RED_TERRACOTTA); final ItemBuilder builder = new ItemBuilder(Material.RED_TERRACOTTA);
builder.setDisplayName("§fUnavailable"); builder.setDisplayName("Unavailable");
builder.addLoreLines("§7§oThis button is disabled."); builder.addLoreLines("§7§oThis button is disabled.");
return builder; return builder;
}, click -> true); }, click -> true);

View file

@ -1,5 +1,6 @@
package xyz.atnrch.nicko.gui.items.home; package xyz.atnrch.nicko.gui.items.home;
import com.comphenix.protocol.utility.MinecraftVersion;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.ClickType;
import xyz.xenondevs.invui.item.builder.ItemBuilder; import xyz.xenondevs.invui.item.builder.ItemBuilder;
@ -7,7 +8,10 @@ import xyz.xenondevs.invui.item.impl.SimpleItem;
public class ExitItem extends SimpleItem { public class ExitItem extends SimpleItem {
public ExitItem() { public ExitItem() {
super(new ItemBuilder(Material.OAK_DOOR).setDisplayName("§fExit"), click -> { super(new ItemBuilder(Material.OAK_DOOR).setDisplayName("Exit"), click -> {
if(MinecraftVersion.BEE_UPDATE.atOrAbove()) {
}
final ClickType clickType = click.getClickType(); final ClickType clickType = click.getClickType();
if (clickType.isLeftClick() || clickType.isRightClick()) { if (clickType.isLeftClick() || clickType.isRightClick()) {
click.getEvent().getView().close(); click.getEvent().getView().close();

View file

@ -13,7 +13,7 @@ public class ResetItem extends SuppliedItem {
public ResetItem() { public ResetItem() {
super(() -> { super(() -> {
final ItemBuilder builder = new ItemBuilder(Material.TNT); final ItemBuilder builder = new ItemBuilder(Material.TNT);
builder.setDisplayName("§fReset appearance"); builder.setDisplayName("Reset appearance");
builder.addLoreLines("§7Completely remove your disguise."); builder.addLoreLines("§7Completely remove your disguise.");
return builder; return builder;
}, (event) -> { }, (event) -> {

View file

@ -10,7 +10,7 @@ public class SettingsAccessItem extends SuppliedItem {
public SettingsAccessItem() { public SettingsAccessItem() {
super(() -> { super(() -> {
final ItemBuilder builder = new ItemBuilder(Material.COMPARATOR); final ItemBuilder builder = new ItemBuilder(Material.COMPARATOR);
builder.setDisplayName("§fSettings"); builder.setDisplayName("Settings");
builder.addLoreLines("§7Configure your experience."); builder.addLoreLines("§7Configure your experience.");
return builder; return builder;
}, click -> { }, click -> {

View file

@ -35,7 +35,7 @@ public class BungeeCordCyclingItem {
private ItemProvider getItemProviderForValue(boolean enabled) { private ItemProvider getItemProviderForValue(boolean enabled) {
final ItemBuilder builder = new ItemBuilder(Material.COMPASS); final ItemBuilder builder = new ItemBuilder(Material.COMPASS);
builder.setDisplayName("§fBungeeCord transfer"); builder.setDisplayName("BungeeCord transfer");
if (enabled) { if (enabled) {
builder.addLoreLines("§7> §cDisabled"); builder.addLoreLines("§7> §cDisabled");
builder.addLoreLines("§6§l> §a§lEnabled"); builder.addLoreLines("§6§l> §a§lEnabled");

View file

@ -36,7 +36,7 @@ public class LanguageCyclingItem {
private ItemProvider generateItem(Locale locale, List<Locale> locales) { private ItemProvider generateItem(Locale locale, List<Locale> locales) {
final ItemBuilder builder = new ItemBuilder(Material.OAK_SIGN); final ItemBuilder builder = new ItemBuilder(Material.OAK_SIGN);
builder.setDisplayName("§fLanguage"); builder.setDisplayName("Language");
for (Locale value : locales) { for (Locale value : locales) {
if (locale != value) { if (locale != value) {
builder.addLoreLines("§7> " + value.getName()); builder.addLoreLines("§7> " + value.getName());