fix: return ok instead of error dumbass
This commit is contained in:
parent
deb76e0150
commit
03a8eb9b7d
3 changed files with 6 additions and 4 deletions
|
@ -37,7 +37,7 @@ public class AppearanceManager {
|
||||||
profile.setSkin(null);
|
profile.setSkin(null);
|
||||||
dataStore.getCache().cache(player.getUniqueId(), profile);
|
dataStore.getCache().cache(player.getUniqueId(), profile);
|
||||||
|
|
||||||
return ActionResult.error();
|
return ActionResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult update(boolean skinChange) {
|
public ActionResult update(boolean skinChange) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import xyz.ineanto.nicko.appearance.ActionResult;
|
||||||
import xyz.ineanto.nicko.appearance.AppearanceManager;
|
import xyz.ineanto.nicko.appearance.AppearanceManager;
|
||||||
import xyz.ineanto.nicko.language.PlayerLanguage;
|
import xyz.ineanto.nicko.language.PlayerLanguage;
|
||||||
import xyz.ineanto.nicko.language.LanguageKey;
|
import xyz.ineanto.nicko.language.LanguageKey;
|
||||||
|
@ -37,10 +38,11 @@ public class ResetItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
final AppearanceManager appearanceManager = new AppearanceManager(player);
|
final AppearanceManager appearanceManager = new AppearanceManager(player);
|
||||||
if (!appearanceManager.reset().isError()) {
|
final ActionResult reset = appearanceManager.reset();
|
||||||
|
if (!reset.isError()) {
|
||||||
player.sendMessage(playerLanguage.translateWithWhoosh(LanguageKey.Event.Appearance.Remove.OK));
|
player.sendMessage(playerLanguage.translateWithWhoosh(LanguageKey.Event.Appearance.Remove.OK));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(playerLanguage.translateWithOops(LanguageKey.Event.Appearance.Remove.ERROR));
|
player.sendMessage(playerLanguage.translateWithOops(LanguageKey.Event.Appearance.Remove.ERROR, reset.getErrorKey()));
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 1f);
|
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 1f);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,7 +26,7 @@ event:
|
||||||
error: "<gray>Impossible d''appliquer le précédent déguisement ! ({0})</gray>"
|
error: "<gray>Impossible d''appliquer le précédent déguisement ! ({0})</gray>"
|
||||||
ok: "<gray>Votre précédent déguisement a été appliqué.<gray>"
|
ok: "<gray>Votre précédent déguisement a été appliqué.<gray>"
|
||||||
remove:
|
remove:
|
||||||
error: "<gray>Impossible de retirer votre déguisement.</gray>"
|
error: "<gray>Impossible de retirer votre déguisement ({0}).</gray>"
|
||||||
missing: "<gray>Vous n''avez pas de déguisement.</gray>"
|
missing: "<gray>Vous n''avez pas de déguisement.</gray>"
|
||||||
ok: "<gray>Déguisement retiré.</gray>"
|
ok: "<gray>Déguisement retiré.</gray>"
|
||||||
admin:
|
admin:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue