refactor: missed some more actionresults
This commit is contained in:
parent
a91d039dd2
commit
f419f62f6c
5 changed files with 7 additions and 7 deletions
BIN
logs/2023-07-01-1.log.gz
Normal file
BIN
logs/2023-07-01-1.log.gz
Normal file
Binary file not shown.
|
@ -67,7 +67,7 @@ public class AnvilManager {
|
|||
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
|
||||
} else {
|
||||
appearanceManager.setName(snapshot.getText());
|
||||
final ActionResult<Void> actionResult = appearanceManager.updatePlayer(false);
|
||||
final ActionResult actionResult = appearanceManager.updatePlayer(false, false);
|
||||
return sendResultAndClose(actionResult);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class AnvilManager {
|
|||
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
|
||||
} else {
|
||||
appearanceManager.setSkin(snapshot.getText());
|
||||
final ActionResult<Void> actionResult = appearanceManager.updatePlayer(true);
|
||||
final ActionResult actionResult = appearanceManager.updatePlayer(true, false);
|
||||
return sendResultAndClose(actionResult);
|
||||
}
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class AnvilManager {
|
|||
.text("New skin...");
|
||||
}
|
||||
|
||||
private List<AnvilGUI.ResponseAction> sendResultAndClose(ActionResult<Void> actionResult) {
|
||||
private List<AnvilGUI.ResponseAction> sendResultAndClose(ActionResult actionResult) {
|
||||
final I18N i18n = new I18N(player);
|
||||
if (!actionResult.isError()) {
|
||||
player.sendMessage(i18n.translate(I18NDict.Event.Disguise.SUCCESS));
|
||||
|
|
|
@ -25,7 +25,7 @@ public class PlayerJoinListener implements Listener {
|
|||
Bukkit.getScheduler().runTaskLater(instance, () -> {
|
||||
final AppearanceManager appearanceManager = AppearanceManager.get(player);
|
||||
if (appearanceManager.hasData()) {
|
||||
final ActionResult actionResult = appearanceManager.updatePlayer(appearanceManager.needsASkinChange(), true);
|
||||
final ActionResult actionResult = appearanceManager.updatePlayer(appearanceManager.needsASkinChange(), false);
|
||||
if (!actionResult.isError()) {
|
||||
player.sendMessage(i18n.translate(I18NDict.Event.PreviousSkin.SUCCESS));
|
||||
} else {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class BrokenSQLTest {
|
|||
public void storePlayer() {
|
||||
final Optional<NickoProfile> optionalProfile = plugin.getDataStore().getData(player.getUniqueId());
|
||||
assertFalse(optionalProfile.isPresent());
|
||||
ActionResult<Void> result = plugin.getDataStore().saveData(player);
|
||||
ActionResult result = plugin.getDataStore().saveData(player);
|
||||
assertTrue(result.isError());
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class SQLStorageTest {
|
|||
profile.setLocale(Locale.FRENCH);
|
||||
profile.setBungeecordTransfer(false);
|
||||
|
||||
final ActionResult<Void> result = plugin.getDataStore().saveData(player);
|
||||
final ActionResult result = plugin.getDataStore().saveData(player);
|
||||
assertFalse(result.isError());
|
||||
|
||||
final Optional<NickoProfile> optionalUpdatedProfile = plugin.getDataStore().getData(player.getUniqueId());
|
||||
|
@ -99,7 +99,7 @@ public class SQLStorageTest {
|
|||
profile.setName(null);
|
||||
profile.setSkin(null);
|
||||
|
||||
final ActionResult<Void> result = plugin.getDataStore().saveData(player);
|
||||
final ActionResult result = plugin.getDataStore().saveData(player);
|
||||
assertFalse(result.isError());
|
||||
|
||||
final Optional<NickoProfile> optionalUpdatedProfile = plugin.getDataStore().getData(player.getUniqueId());
|
||||
|
|
Loading…
Reference in a new issue