Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use translatable over direct translation in BaseCommand #6172

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/com/palmergames/bukkit/towny/command/BaseCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Town;
import com.palmergames.bukkit.towny.object.Translatable;
import com.palmergames.bukkit.towny.object.Translation;
import com.palmergames.bukkit.towny.utils.NameUtil;
import com.palmergames.bukkit.util.BukkitTools;

Expand Down Expand Up @@ -269,7 +268,7 @@ protected static Resident getResidentOrThrow(UUID playerUUID) throws NotRegister
Resident res = TownyUniverse.getInstance().getResident(playerUUID);

if (res == null) {
throw new NotRegisteredException(Translation.of("msg_err_not_registered"));
throw new NotRegisteredException(Translatable.of("msg_err_not_registered"));
}

return res;
Expand All @@ -280,7 +279,7 @@ protected static Resident getResidentOrThrow(String residentName) throws NotRegi
Resident res = TownyUniverse.getInstance().getResident(residentName);

if (res == null) {
throw new NotRegisteredException(Translation.of("msg_err_not_registered_1", residentName));
throw new NotRegisteredException(Translatable.of("msg_err_not_registered_1", residentName));
}

return res;
Expand All @@ -291,7 +290,7 @@ protected static Town getTownOrThrow(String townName) throws NotRegisteredExcept
Town town = TownyUniverse.getInstance().getTown(townName);

if (town == null) {
throw new NotRegisteredException(Translation.of("msg_err_not_registered_1", townName));
throw new NotRegisteredException(Translatable.of("msg_err_not_registered_1", townName));
}

return town;
Expand All @@ -302,7 +301,7 @@ protected static Nation getNationOrThrow(String nationName) throws NotRegistered
Nation nation = TownyUniverse.getInstance().getNation(nationName);

if (nation == null)
throw new NotRegisteredException(Translation.of("msg_err_not_registered_1", nationName));
throw new NotRegisteredException(Translatable.of("msg_err_not_registered_1", nationName));

return nation;
}
Expand Down