Compare commits

..

No commits in common. "814d7adea7e850de47ec516f9b4938593d41f7da" and "1dbb199258b6e920e1f843638aa891c93bccc14b" have entirely different histories.

8 changed files with 1 additions and 100 deletions

View file

@ -2,9 +2,6 @@
[FEATURES]
- Players are now able to mark disguises as favorites.
[FIXES]
- Added a missing sound when players undisguised.
1.2.0-RC1: Update n°12 (XX/XX/25)
[FEATURES]
- Updated to support Minecraft 1.21.5.

View file

@ -1,44 +0,0 @@
package xyz.ineanto.nicko.gui;
import org.bukkit.entity.Player;
import xyz.ineanto.nicko.gui.items.common.GoBackItem;
import xyz.ineanto.nicko.language.LanguageKey;
import xyz.ineanto.nicko.language.PlayerLanguage;
import xyz.xenondevs.invui.gui.Gui;
import xyz.xenondevs.invui.window.Window;
public class FavoritesGUI {
private final Player player;
private final Gui gui;
private final String title;
public FavoritesGUI(Player player) {
final PlayerLanguage playerLanguage = new PlayerLanguage(player);
this.title = playerLanguage.translate(LanguageKey.GUI.Titles.FAVORITES, false);
final HomeGUI parent = new HomeGUI(player);
final GoBackItem backItem = new GoBackItem(player);
this.gui = Gui.normal()
.setStructure(
"# # # # # # # # #",
"# # # S C E # # #",
"B # # # # # # # #"
)
.addIngredient('B', backItem.get(parent.getGUI(), parent.getTitle()))
.build();
this.player = player;
}
public Gui getGUI() {
return gui;
}
public String getTitle() {
return title;
}
public void open() {
Window.single().setGui(gui).setTitle(title).open(player);
}
}

View file

@ -19,7 +19,7 @@ public class HomeGUI {
final String[] dynamicStructure = new String[]{
"# # # # D # # # #",
"A # # N B S # # #",
"E P # # F # # # R"};
"E P # # # # # # R"};
if (!player.isOp() || !player.hasPermission("nicko.admin")) {
dynamicStructure[2] = dynamicStructure[2].replace("A", "#");
@ -36,7 +36,6 @@ public class HomeGUI {
final SettingsAccessItem settingsAccessItem = new SettingsAccessItem(player);
final AdminAccessItem adminAccessItem = new AdminAccessItem(player);
final RandomSkinItem randomSkinItem = new RandomSkinItem(player);
final FavoritesItem favoritesItem = new FavoritesItem(player);
this.gui = Gui.normal()
.setStructure(dynamicStructure)
@ -48,7 +47,6 @@ public class HomeGUI {
.addIngredient('P', settingsAccessItem.get())
.addIngredient('A', adminAccessItem.get())
.addIngredient('D', randomSkinItem.get())
.addIngredient('F', favoritesItem.get())
.build();
this.player = player;
}

View file

@ -1,36 +0,0 @@
package xyz.ineanto.nicko.gui.items.home;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import xyz.ineanto.nicko.gui.FavoritesGUI;
import xyz.ineanto.nicko.language.LanguageKey;
import xyz.ineanto.nicko.language.PlayerLanguage;
import xyz.xenondevs.invui.item.builder.ItemBuilder;
import xyz.xenondevs.invui.item.impl.SuppliedItem;
public class FavoritesItem {
private final PlayerLanguage playerLanguage;
public FavoritesItem(Player player) {
this.playerLanguage = new PlayerLanguage(player);
}
public SuppliedItem get() {
return new SuppliedItem(() -> {
final ItemBuilder builder = new ItemBuilder(Material.CHEST);
return playerLanguage.translateItem(builder, LanguageKey.GUI.Home.FAVORITES);
}, click -> {
final Player player = click.getPlayer();
final ClickType clickType = click.getClickType();
if (clickType.isLeftClick() || clickType.isRightClick()) {
click.getEvent().getView().close();
new FavoritesGUI(click.getPlayer()).open();
player.playSound(player.getLocation(), Sound.BLOCK_CHEST_OPEN, 1, 1f);
return true;
}
return false;
});
}
}

View file

@ -1,7 +1,6 @@
package xyz.ineanto.nicko.gui.items.home;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import xyz.ineanto.nicko.appearance.AppearanceManager;
@ -41,7 +40,6 @@ public class ResetItem {
player.sendMessage(playerLanguage.translateWithWhoosh(LanguageKey.Event.Appearance.Remove.OK));
} else {
player.sendMessage(playerLanguage.translateWithOops(LanguageKey.Event.Appearance.Remove.ERROR));
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 1f);
}
});
return true;

View file

@ -92,7 +92,6 @@ public class LanguageKey {
public static final String CONFIRM = TITLE_KEY + "confirm";
public static final String CACHE = TITLE_KEY + "cache";
public static final String INVALIDATE_SKIN = TITLE_KEY + "invalidate_skin";
public static final String FAVORITES = TITLE_KEY + "favorites";
}
public static class Choice {
@ -113,7 +112,6 @@ public class LanguageKey {
public static final String RESET = HOME_KEY + "reset";
public static final String RANDOM_SKIN = HOME_KEY + "random_skin";
public static final String SETTINGS = HOME_KEY + "settings";
public static final String FAVORITES = HOME_KEY + "favorites";
}
public static class Settings {

View file

@ -45,7 +45,6 @@ gui:
confirm: "Are you sure?"
cache: "Cache Management"
invalidate_skin: "Purge cache..."
favorites: "Favorites"
exit:
name: "Exit"
@ -101,10 +100,6 @@ gui:
name: "Reset appearance"
lore:
- "<gray>Completely remove your disguise.</gray>"
favorites:
name: "Favorites"
lore:
- "<gray>List all your favorites appearances.</gray>"
admin:
manage_cache:
name: "Manage the skin cache..."

View file

@ -45,7 +45,6 @@ gui:
confirm: "Êtes-vous sûr ?"
cache: "Gestion du Cache"
invalidate_skin: "Purge du cache..."
favorites: "Favoris"
exit:
name: "Quitter"
@ -102,10 +101,6 @@ gui:
name: "Réinitialiser l'apparence"
lore:
- "<gray>Supprime complètement votre déguisement.</gray>"
favorites:
name: "Favoris"
lore:
- "<gray>Listez toutes vos apparences favorites.</gray>"
admin:
manage_cache:
name: "Gérer le cache de skin..."