fix core more

This commit is contained in:
ChomeNS 2023-03-27 18:40:17 +07:00
parent cbccbf2780
commit 539ca22a3b
3 changed files with 9 additions and 2 deletions

View file

@ -134,6 +134,8 @@ public class CorePlugin extends PositionPlugin.PositionListener {
} }
public void refill () { public void refill () {
if (!ready) return;
final String command = String.format( final String command = String.format(
"minecraft:fill %s %s %s %s %s %s minecraft:command_block{CustomName:'%s'}", "minecraft:fill %s %s %s %s %s %s minecraft:command_block{CustomName:'%s'}",

View file

@ -85,7 +85,8 @@ public class PlayersPlugin extends SessionAdapter {
list.add(target); 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) { private void updateGamemode (PlayerListEntry newEntry) {
@ -132,6 +133,7 @@ public class PlayersPlugin extends SessionAdapter {
for (int i = 0; i < matches.length; i++) { for (int i = 0; i < matches.length; i++) {
if (tooltips[i] != null || !matches[i].equals(username)) continue; if (tooltips[i] != null || !matches[i].equals(username)) continue;
for (PlayerListener listener : listeners) { listener.playerVanished(target); }
return packet; return packet;
} }
@ -147,9 +149,11 @@ public class PlayersPlugin extends SessionAdapter {
public static class PlayerListener { public static class PlayerListener {
public void playerJoined (MutablePlayerListEntry target) {} public void playerJoined (MutablePlayerListEntry target) {}
public void playerUnVanished (MutablePlayerListEntry target) {}
public void playerGameModeUpdated (MutablePlayerListEntry target, GameMode gameMode) {} public void playerGameModeUpdated (MutablePlayerListEntry target, GameMode gameMode) {}
public void playerLatencyUpdated (MutablePlayerListEntry target, int ping) {} public void playerLatencyUpdated (MutablePlayerListEntry target, int ping) {}
public void playerDisplayNameUpdated (MutablePlayerListEntry target, Component displayName) {} public void playerDisplayNameUpdated (MutablePlayerListEntry target, Component displayName) {}
public void playerLeft (MutablePlayerListEntry target) {} public void playerLeft (MutablePlayerListEntry target) {}
public void playerVanished (MutablePlayerListEntry target) {}
} }
} }

View file

@ -44,7 +44,8 @@ public class TrustedPlugin extends PlayersPlugin.PlayerListener {
Component.empty() Component.empty()
.append(Component.text("Hello, ").color(NamedTextColor.GREEN)) .append(Component.text("Hello, ").color(NamedTextColor.GREEN))
.append(Component.text(target.profile().getName()).color(NamedTextColor.GOLD)) .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( broadcast(