refactor: instance not necessary and final vars

This commit is contained in:
aro 2023-03-14 09:53:29 +01:00
parent 875dcebe0b
commit 6f1ce8d5d9
2 changed files with 2 additions and 3 deletions

View file

@ -20,7 +20,7 @@ public class BungeeCordCycling {
};
public BaseItem get(Player player) {
Optional<NickoProfile> profile = NickoBukkit.getInstance().getDataStore().getData(player.getUniqueId());
final Optional<NickoProfile> profile = NickoBukkit.getInstance().getDataStore().getData(player.getUniqueId());
if (profile.isPresent()) {
final NickoProfile nickoProfile = profile.get();
int startingState = nickoProfile.isBungeecordTransfer() ? 0 : 1;

View file

@ -18,8 +18,7 @@ public class LanguageCycling {
private final ItemProvider[] providers = getItems();
public BaseItem get(Player player) {
final NickoBukkit instance = NickoBukkit.getInstance();
Optional<NickoProfile> profile = instance.getDataStore().getData(player.getUniqueId());
final Optional<NickoProfile> profile = NickoBukkit.getInstance().getDataStore().getData(player.getUniqueId());
if (profile.isPresent()) {
final NickoProfile nickoProfile = profile.get();
int localeOrdinal = nickoProfile.getLocale().ordinal();