Skip to content

Commit

Permalink
Add final where possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Sep 28, 2024
1 parent dfd6715 commit 1ea5ec1
Show file tree
Hide file tree
Showing 238 changed files with 1,049 additions and 1,049 deletions.
6 changes: 3 additions & 3 deletions Bukkit/src/net/tnemc/bukkit/BukkitCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class BukkitCore extends TNECore {

private BukkitConfig bukkitConfig;

public BukkitCore(JavaPlugin plugin) {
public BukkitCore(final JavaPlugin plugin) {

this.plugin = plugin;
}
Expand All @@ -66,7 +66,7 @@ public void registerCommandHandler() {
}

@Override
public String commandHelpWriter(ExecutableCommand executableCommand, CommandActor commandActor) {
public String commandHelpWriter(final ExecutableCommand executableCommand, final CommandActor commandActor) {

return "";
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public void registerCommands() {
}

@Override
public void registerCallbacks(CallbackManager callbackManager) {
public void registerCallbacks(final CallbackManager callbackManager) {

super.registerCallbacks(callbackManager);
callbackManager.addConsumer(TNECallbacks.ACCOUNT_TYPES.toString(), (callback->{
Expand Down
4 changes: 2 additions & 2 deletions Bukkit/src/net/tnemc/bukkit/BukkitPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class BukkitPlugin {
* Called when the plugin is loaded by the Bukkit plugin manager. This method should be used to
* initialize any necessary resources or data.
*/
public void load(final JavaPlugin plugin, ServerConnector server) {
public void load(final JavaPlugin plugin, final ServerConnector server) {

//Initialize our TNE Core Class
this.core = new BukkitCore(plugin);
Expand Down Expand Up @@ -132,7 +132,7 @@ public boolean isPapiHooked() {
return papiHooked;
}

public void setPapiHooked(boolean papiHooked) {
public void setPapiHooked(final boolean papiHooked) {

this.papiHooked = papiHooked;
}
Expand Down
10 changes: 5 additions & 5 deletions Bukkit/src/net/tnemc/bukkit/ModifiedBukkitLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public record ModifiedBukkitLogger(Logger logger) implements LogProvider {
* @param level The {@link DebugLevel} to log this message at.
*/
@Override
public void inform(String message, DebugLevel level) {
public void inform(final String message, final DebugLevel level) {

if(level.compare(PluginCore.instance().getLevel())) {
logger.info(message);
Expand All @@ -53,7 +53,7 @@ public void inform(String message, DebugLevel level) {
* @param level The {@link DebugLevel} to log this message at.
*/
@Override
public void debug(String message, DebugLevel level) {
public void debug(final String message, final DebugLevel level) {

if(level.compare(PluginCore.instance().getLevel())) {
logger.warning("[DEBUG]: " + message);
Expand All @@ -67,7 +67,7 @@ public void debug(String message, DebugLevel level) {
* @param level The {@link DebugLevel} to log this message at.
*/
@Override
public void warning(String message, DebugLevel level) {
public void warning(final String message, final DebugLevel level) {

if(level.compare(PluginCore.instance().getLevel())) {
logger.warning(message);
Expand All @@ -81,7 +81,7 @@ public void warning(String message, DebugLevel level) {
* @param level The {@link DebugLevel} to log this message at.
*/
@Override
public void error(String message, DebugLevel level) {
public void error(final String message, final DebugLevel level) {

if(level.compare(PluginCore.instance().getLevel())) {
logger.warning(message);
Expand All @@ -96,7 +96,7 @@ public void error(String message, DebugLevel level) {
* @param level The {@link DebugLevel} to log this message at.
*/
@Override
public void error(String message, Exception exception, DebugLevel level) {
public void error(final String message, final Exception exception, final DebugLevel level) {

if(level.compare(PluginCore.instance().getLevel())) {
logger.warning("====== Exception Occurred ======");
Expand Down
2 changes: 1 addition & 1 deletion Bukkit/src/net/tnemc/bukkit/ModifiedBukkitPluginCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
public class ModifiedBukkitPluginCore extends BukkitPluginCore {

public ModifiedBukkitPluginCore(JavaPlugin plugin, PluginEngine engine, ServerConnector connector, TranslationProvider provider, CallbackProvider callbackProvider) {
public ModifiedBukkitPluginCore(final JavaPlugin plugin, final PluginEngine engine, final ServerConnector connector, final TranslationProvider provider, final CallbackProvider callbackProvider) {

super(plugin, engine, connector, provider, callbackProvider);

Expand Down
40 changes: 20 additions & 20 deletions Bukkit/src/net/tnemc/bukkit/command/AdminCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public class AdminCommand {
@Usage("Admin.MyEco.Arguments")
@Description("Admin.MyEco.Description")
@CommandPermission("tne.admin.menu")
public void onMyEco(BukkitCommandActor sender) {
public void onMyEco(final BukkitCommandActor sender) {

net.tnemc.core.command.AdminCommand.onMyEco(new BukkitCMDSource(sender));
}

@Subcommand({ "help", "?" })
@Usage("Help.Arguments")
@Description("Help.Description")
public void help(BukkitCommandActor actor, CommandHelp<String> helpEntries, @Default("1") int page) {
public void help(final BukkitCommandActor actor, final CommandHelp<String> helpEntries, @Default("1") final int page) {

BaseCommand.help(new BukkitCMDSource(actor), helpEntries, page);
}
Expand All @@ -85,7 +85,7 @@ public void help(BukkitCommandActor actor, CommandHelp<String> helpEntries, @Def
@Usage("Admin.Backup.Arguments")
@Description("Admin.Backup.Description")
@CommandPermission("tne.admin.backup")
public void backup(BukkitCommandActor sender) {
public void backup(final BukkitCommandActor sender) {

net.tnemc.core.command.AdminCommand.onBackup(new BukkitCMDSource(sender));
}
Expand All @@ -94,7 +94,7 @@ public void backup(BukkitCommandActor sender) {
@Usage("Admin.Create.Arguments")
@Description("Admin.Create.Description")
@CommandPermission("tne.admin.create")
public void create(BukkitCommandActor sender, String name) {
public void create(final BukkitCommandActor sender, final String name) {

net.tnemc.core.command.AdminCommand.onCreate(new BukkitCMDSource(sender), name);
}
Expand All @@ -103,7 +103,7 @@ public void create(BukkitCommandActor sender, String name) {
@Usage("Admin.Debug.Arguments")
@Description("Admin.Debug.Description")
@CommandPermission("tne.admin.debug")
public void debug(BukkitCommandActor sender, DebugLevel level) {
public void debug(final BukkitCommandActor sender, final DebugLevel level) {

net.tnemc.core.command.AdminCommand.onDebug(new BukkitCMDSource(sender), level);
}
Expand All @@ -112,7 +112,7 @@ public void debug(BukkitCommandActor sender, DebugLevel level) {
@Usage("Admin.Delete.Arguments")
@Description("Admin.Delete.Description")
@CommandPermission("tne.admin.delete")
public void delete(BukkitCommandActor sender, String name) {
public void delete(final BukkitCommandActor sender, final String name) {

net.tnemc.core.command.AdminCommand.onDelete(new BukkitCMDSource(sender), name);
}
Expand All @@ -121,7 +121,7 @@ public void delete(BukkitCommandActor sender, String name) {
@Usage("Admin.Extract.Arguments")
@Description("Admin.Extract.Description")
@CommandPermission("tne.admin.extract")
public void extract(BukkitCommandActor sender) {
public void extract(final BukkitCommandActor sender) {

net.tnemc.core.command.AdminCommand.onExtract(new BukkitCMDSource(sender));
}
Expand All @@ -130,7 +130,7 @@ public void extract(BukkitCommandActor sender) {
@Usage("Admin.Purge.Arguments")
@Description("Admin.Purge.Description")
@CommandPermission("tne.admin.purge")
public void purge(BukkitCommandActor sender) {
public void purge(final BukkitCommandActor sender) {

net.tnemc.core.command.AdminCommand.onPurge(new BukkitCMDSource(sender));
}
Expand All @@ -139,7 +139,7 @@ public void purge(BukkitCommandActor sender) {
@Usage("Admin.Reload.Arguments")
@Description("Admin.Reload.Description")
@CommandPermission("tne.admin.reload")
public void reload(BukkitCommandActor sender, @Default("all") String type) {
public void reload(final BukkitCommandActor sender, @Default("all") final String type) {

net.tnemc.core.command.AdminCommand.onReload(new BukkitCMDSource(sender), type);
}
Expand All @@ -148,7 +148,7 @@ public void reload(BukkitCommandActor sender, @Default("all") String type) {
@Usage("Admin.Reset.Arguments")
@Description("Admin.Reset.Description")
@CommandPermission("tne.admin.reset")
public void reset(BukkitCommandActor sender) {
public void reset(final BukkitCommandActor sender) {

net.tnemc.core.command.AdminCommand.onReset(new BukkitCMDSource(sender));
}
Expand All @@ -157,7 +157,7 @@ public void reset(BukkitCommandActor sender) {
@Usage("Admin.Restore.Arguments")
@Description("Admin.Restore.Description")
@CommandPermission("tne.admin.restore")
public void restore(BukkitCommandActor sender, @Default("0") int extraction) {
public void restore(final BukkitCommandActor sender, @Default("0") final int extraction) {

net.tnemc.core.command.AdminCommand.onRestore(new BukkitCMDSource(sender), extraction);
}
Expand All @@ -166,7 +166,7 @@ public void restore(BukkitCommandActor sender, @Default("0") int extraction) {
@Usage("Admin.Restore.Arguments")
@Description("Admin.Restore.Description")
@CommandPermission("tne.admin.old")
public void old(BukkitCommandActor sender, @Default("0") int extraction) {
public void old(final BukkitCommandActor sender, @Default("0") final int extraction) {

PluginCore.server().scheduler().createDelayedTask(()->restoreOld(extraction), new ChoreTime(0), ChoreExecution.SECONDARY);
new BukkitCMDSource(sender).message(new MessageData("Messages.Admin.Restoration"));
Expand All @@ -176,7 +176,7 @@ public void old(BukkitCommandActor sender, @Default("0") int extraction) {
@Usage("Admin.Save.Arguments")
@Description("Admin.Save.Description")
@CommandPermission("tne.admin.save")
public void save(BukkitCommandActor sender) {
public void save(final BukkitCommandActor sender) {

net.tnemc.core.command.AdminCommand.onSave(new BukkitCMDSource(sender));
}
Expand All @@ -185,7 +185,7 @@ public void save(BukkitCommandActor sender) {
@Usage("Admin.Status.Arguments")
@Description("Admin.Status.Description")
@CommandPermission("tne.admin.status")
public void status(BukkitCommandActor sender, Account account, @Default("normal") AccountStatus status) {
public void status(final BukkitCommandActor sender, final Account account, @Default("normal") final AccountStatus status) {

net.tnemc.core.command.AdminCommand.onStatus(new BukkitCMDSource(sender), account, status);
}
Expand All @@ -194,7 +194,7 @@ public void status(BukkitCommandActor sender, Account account, @Default("normal"
@Usage("Admin.Version.Arguments")
@Description("Admin.Version.Description")
@CommandPermission("tne.admin.version")
public void version(BukkitCommandActor sender) {
public void version(final BukkitCommandActor sender) {

net.tnemc.core.command.AdminCommand.onVersion(new BukkitCMDSource(sender));
}
Expand Down Expand Up @@ -229,7 +229,7 @@ public static boolean restoreOld(@Nullable final Integer extraction) {

final boolean recode = extracted.contains("Version");

for(Object nameObj : accounts) {
for(final Object nameObj : accounts) {

final String name = (String)nameObj;
final String username = name.replaceAll("\\!", "\\.").replaceAll("\\@", "-").replaceAll("\\%", "_");
Expand All @@ -248,11 +248,11 @@ public static boolean restoreOld(@Nullable final Integer extraction) {
}

final Set<Object> regions = extracted.getSection("Accounts." + name + ".Balances").getKeys();
for(Object regionObj : regions) {
for(final Object regionObj : regions) {

final String region = (String)regionObj;
final Set<Object> currencies = extracted.getSection("Accounts." + name + ".Balances." + region).getKeys();
for(Object currencyNameObj : currencies) {
for(final Object currencyNameObj : currencies) {

final String currency = (String)currencyNameObj;
if(!recode) {
Expand All @@ -268,7 +268,7 @@ public static boolean restoreOld(@Nullable final Integer extraction) {
} else {

final Set<Object> types = extracted.getSection("Accounts." + name + ".Balances." + region + "." + currency).getKeys();
for(Object typeObj : types) {
for(final Object typeObj : types) {

final String type = (String)typeObj;
final BigDecimal amount = new BigDecimal(extracted.getString("Accounts." + name
Expand Down Expand Up @@ -300,7 +300,7 @@ public static boolean restoreOld(@Nullable final Integer extraction) {

protected static UUID get(final String name) {

for(OfflinePlayer player : Bukkit.getServer().getOfflinePlayers()) {
for(final OfflinePlayer player : Bukkit.getServer().getOfflinePlayers()) {
if(player.getName() == null) continue;
if(player.getName().equalsIgnoreCase(name)) {
return player.getUniqueId();
Expand Down
12 changes: 6 additions & 6 deletions Bukkit/src/net/tnemc/bukkit/command/ModuleCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ModuleCommand {
@Subcommand({ "help", "?" })
@Usage("Help.Arguments")
@Description("Help.Description")
public void help(BukkitCommandActor actor, CommandHelp<String> helpEntries, @Default("1") int page) {
public void help(final BukkitCommandActor actor, final CommandHelp<String> helpEntries, @Default("1") final int page) {

BaseCommand.help(new BukkitCMDSource(actor), helpEntries, page);
}
Expand All @@ -52,7 +52,7 @@ public void help(BukkitCommandActor actor, CommandHelp<String> helpEntries, @Def
@Usage("Module.Available.Arguments")
@Description("Module.Available.Description")
@CommandPermission("tne.module.available")
public void onAvailable(BukkitCommandActor sender, @Default(TNECore.coreURL) String url) {
public void onAvailable(final BukkitCommandActor sender, @Default(TNECore.coreURL) final String url) {

net.tnemc.core.command.ModuleCommand.onAvailable(new BukkitCMDSource(sender), url);
}
Expand All @@ -61,7 +61,7 @@ public void onAvailable(BukkitCommandActor sender, @Default(TNECore.coreURL) Str
@Usage("Module.Download.Arguments")
@Description("Module.Download.Description")
@CommandPermission("tne.module.download")
public void onDownload(BukkitCommandActor sender, String moduleName, @Default(TNECore.coreURL) String url) {
public void onDownload(final BukkitCommandActor sender, final String moduleName, @Default(TNECore.coreURL) final String url) {

net.tnemc.core.command.ModuleCommand.onDownload(new BukkitCMDSource(sender), moduleName, url);
}
Expand All @@ -70,7 +70,7 @@ public void onDownload(BukkitCommandActor sender, String moduleName, @Default(TN
@Usage("Module.Info.Arguments")
@Description("Module.Info.Description")
@CommandPermission("tne.module.info")
public void onInfo(BukkitCommandActor sender, String moduleName) {
public void onInfo(final BukkitCommandActor sender, final String moduleName) {

net.tnemc.core.command.ModuleCommand.onInfo(new BukkitCMDSource(sender), moduleName);
}
Expand All @@ -80,7 +80,7 @@ public void onInfo(BukkitCommandActor sender, String moduleName) {
@DefaultFor({ "module", "mod" })
@Description("Module.List.Description")
@CommandPermission("tne.list.available")
public void onList(BukkitCommandActor sender) {
public void onList(final BukkitCommandActor sender) {

net.tnemc.core.command.ModuleCommand.onList(new BukkitCMDSource(sender));
}
Expand All @@ -89,7 +89,7 @@ public void onList(BukkitCommandActor sender) {
@Usage("Module.Load.Arguments")
@Description("Module.Load.Description")
@CommandPermission("tne.module.load")
public void onLoad(BukkitCommandActor sender, String moduleName) {
public void onLoad(final BukkitCommandActor sender, final String moduleName) {

net.tnemc.core.command.ModuleCommand.onLoad(new BukkitCMDSource(sender), moduleName);
}
Expand Down
Loading

0 comments on commit 1ea5ec1

Please sign in to comment.