fix(gui/admin): player info item name
This commit is contained in:
parent
e8ac7619de
commit
c6f37579a0
2 changed files with 5 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
- Players are now able to mark disguises as favorites.
|
- Players are now able to mark disguises as favorites.
|
||||||
|
|
||||||
[FIXES]
|
[FIXES]
|
||||||
|
- Fixed a bug where a player was improperly named when inspecting it in the admin panel.
|
||||||
- Added a missing sound when players undisguised.
|
- Added a missing sound when players undisguised.
|
||||||
|
|
||||||
1.2.0-RC1: Update n°12 (XX/XX/25)
|
1.2.0-RC1: Update n°12 (XX/XX/25)
|
||||||
|
|
|
@ -16,6 +16,7 @@ import xyz.ineanto.nicko.gui.items.common.choice.ChoiceCallback;
|
||||||
import xyz.ineanto.nicko.language.LanguageKey;
|
import xyz.ineanto.nicko.language.LanguageKey;
|
||||||
import xyz.ineanto.nicko.language.PlayerLanguage;
|
import xyz.ineanto.nicko.language.PlayerLanguage;
|
||||||
import xyz.ineanto.nicko.profile.NickoProfile;
|
import xyz.ineanto.nicko.profile.NickoProfile;
|
||||||
|
import xyz.ineanto.nicko.storage.name.PlayerNameStore;
|
||||||
import xyz.xenondevs.invui.item.builder.AbstractItemBuilder;
|
import xyz.xenondevs.invui.item.builder.AbstractItemBuilder;
|
||||||
import xyz.xenondevs.invui.item.builder.ItemBuilder;
|
import xyz.xenondevs.invui.item.builder.ItemBuilder;
|
||||||
import xyz.xenondevs.invui.item.builder.SkullBuilder;
|
import xyz.xenondevs.invui.item.builder.SkullBuilder;
|
||||||
|
@ -35,15 +36,16 @@ public class PlayerInformationItem extends AsyncItem {
|
||||||
super(new SuppliedItem(() -> {
|
super(new SuppliedItem(() -> {
|
||||||
final ItemBuilder builder = new ItemBuilder(Material.PAINTING);
|
final ItemBuilder builder = new ItemBuilder(Material.PAINTING);
|
||||||
return playerLanguage.translateItem(builder, LanguageKey.GUI.LOADING);
|
return playerLanguage.translateItem(builder, LanguageKey.GUI.LOADING);
|
||||||
}, (click -> true)).getItemProvider(), () -> {
|
}, (_ -> true)).getItemProvider(), () -> {
|
||||||
try {
|
try {
|
||||||
final SkullBuilder skull = new SkullBuilder(target.getUniqueId());
|
final SkullBuilder skull = new SkullBuilder(target.getUniqueId());
|
||||||
final Optional<NickoProfile> optionalProfile = Nicko.getInstance().getDataStore().getData(target.getUniqueId());
|
final Optional<NickoProfile> optionalProfile = Nicko.getInstance().getDataStore().getData(target.getUniqueId());
|
||||||
|
final PlayerNameStore playerNameStore = Nicko.getInstance().getNameStore();
|
||||||
|
|
||||||
if (optionalProfile.isPresent()) {
|
if (optionalProfile.isPresent()) {
|
||||||
final NickoProfile profile = optionalProfile.get();
|
final NickoProfile profile = optionalProfile.get();
|
||||||
final AbstractItemBuilder<?> headItem = playerLanguage.translateItem(skull, LanguageKey.GUI.Admin.CHECK,
|
final AbstractItemBuilder<?> headItem = playerLanguage.translateItem(skull, LanguageKey.GUI.Admin.CHECK,
|
||||||
target.getName(),
|
playerNameStore.getStoredName(target),
|
||||||
(profile.hasData() ? "<green>✔</green>" : "<red>❌</red>"),
|
(profile.hasData() ? "<green>✔</green>" : "<red>❌</red>"),
|
||||||
(profile.getName() == null ? "<grey>N/A<grey>" : profile.getName()),
|
(profile.getName() == null ? "<grey>N/A<grey>" : profile.getName()),
|
||||||
(profile.getSkin() == null ? "<grey>N/A</grey>" : profile.getSkin()));
|
(profile.getSkin() == null ? "<grey>N/A</grey>" : profile.getSkin()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue