diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java index 4c473dc..61808bf 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java @@ -134,6 +134,8 @@ public class CorePlugin extends PositionPlugin.PositionListener { } public void refill () { + if (!ready) return; + final String command = String.format( "minecraft:fill %s %s %s %s %s %s minecraft:command_block{CustomName:'%s'}", diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java index 2b154db..105404d 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java @@ -85,7 +85,8 @@ public class PlayersPlugin extends SessionAdapter { list.add(target); - for (PlayerListener listener : listeners) { listener.playerJoined(target); } + if (duplicate == null) for (PlayerListener listener : listeners) { listener.playerJoined(target); } + else for (PlayerListener listener : listeners) { listener.playerUnVanished(target); } } private void updateGamemode (PlayerListEntry newEntry) { @@ -132,6 +133,7 @@ public class PlayersPlugin extends SessionAdapter { for (int i = 0; i < matches.length; i++) { if (tooltips[i] != null || !matches[i].equals(username)) continue; + for (PlayerListener listener : listeners) { listener.playerVanished(target); } return packet; } @@ -147,9 +149,11 @@ public class PlayersPlugin extends SessionAdapter { public static class PlayerListener { public void playerJoined (MutablePlayerListEntry target) {} + public void playerUnVanished (MutablePlayerListEntry target) {} public void playerGameModeUpdated (MutablePlayerListEntry target, GameMode gameMode) {} public void playerLatencyUpdated (MutablePlayerListEntry target, int ping) {} public void playerDisplayNameUpdated (MutablePlayerListEntry target, Component displayName) {} public void playerLeft (MutablePlayerListEntry target) {} + public void playerVanished (MutablePlayerListEntry target) {} } } diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java index ab7791c..ecc80a3 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java @@ -44,7 +44,8 @@ public class TrustedPlugin extends PlayersPlugin.PlayerListener { Component.empty() .append(Component.text("Hello, ").color(NamedTextColor.GREEN)) .append(Component.text(target.profile().getName()).color(NamedTextColor.GOLD)) - .append(Component.text("!").color(NamedTextColor.GREEN)) + .append(Component.text("!").color(NamedTextColor.GREEN)), + target.profile().getId() ); broadcast(