mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Cut down jar size, adjust shadings, fix message formatting, adjust home pattern matching
This commit is contained in:
1 parent
ff2465ac85
commit
979d57e7b2
22 files changed
+160
-107
No files matched your search
@@ -68,12 +68,6 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes {
|
||||
@Nullable
|
||||
private Server server;
|
||||
|
||||
private static BukkitHuskHomes instance;
|
||||
|
||||
public static BukkitHuskHomes getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link Server} the plugin is on
|
||||
*
|
||||
@@ -96,6 +90,13 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes {
|
||||
});
|
||||
}
|
||||
|
||||
// Instance of the plugin
|
||||
private static BukkitHuskHomes instance;
|
||||
|
||||
public static BukkitHuskHomes getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Set the instance
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* Bukkit executor that implements and executes {@link CommandBase}s
|
||||
@@ -36,10 +37,15 @@ public class BukkitCommand implements CommandExecutor, TabExecutor {
|
||||
* @param pluginCommand {@link PluginCommand} to register
|
||||
*/
|
||||
public void register(@NotNull PluginCommand pluginCommand) {
|
||||
pluginCommand.setExecutor(this);
|
||||
pluginCommand.setTabCompleter(this);
|
||||
pluginCommand.setPermission(command.permission);
|
||||
pluginCommand.setDescription(command.getDescription());
|
||||
try {
|
||||
plugin.getLoggingAdapter().log(Level.INFO, "Registering executor for command " + pluginCommand.getName() + "...");
|
||||
pluginCommand.setExecutor(this);
|
||||
pluginCommand.setTabCompleter(this);
|
||||
pluginCommand.setPermission(command.permission);
|
||||
pluginCommand.setDescription(command.getDescription());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.william278.huskhomes.listener;
|
||||
|
||||
import net.william278.huskhomes.BukkitHuskHomes;
|
||||
import net.william278.huskhomes.HuskHomes;
|
||||
import net.william278.huskhomes.player.BukkitPlayer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
@@ -162,7 +162,7 @@ public class PluginMessenger extends NetworkMessenger implements PluginMessageLi
|
||||
final Message message = Message.fromJson(messageReader.readUTF());
|
||||
|
||||
// Ignore plugin messages to other clusters
|
||||
if (message.clusterId != clusterId) {
|
||||
if (!message.clusterId.equals(clusterId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class RedisMessenger extends PluginMessenger {
|
||||
return;
|
||||
}
|
||||
final Message message = Message.fromJson(encodedMessage);
|
||||
if (message.clusterId != clusterId) {
|
||||
if (!message.clusterId.equals(clusterId)) {
|
||||
return;
|
||||
}
|
||||
final Optional<BukkitPlayer> receiver = BukkitPlayer.get(message.targetPlayer);
|
||||
|
||||
@@ -24,11 +24,13 @@ public class BukkitTeleportManager extends TeleportManager {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("teleport warmup tick");
|
||||
// Display countdown action bar message
|
||||
plugin.getLocales().getLocale("teleporting_action_bar_countdown", Integer.toString(teleport.timeLeft))
|
||||
.ifPresent(message -> teleport.getPlayer().sendActionBar(message));
|
||||
|
||||
// Tick (decrement) the timed teleport timer
|
||||
final Optional<TimedTeleport> result = tickTimedTeleport(teleport);
|
||||
if (result.isPresent()) {
|
||||
System.out.println("task cancelled... ");
|
||||
teleportCompletableFuture.complete(teleport);
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user