forked from ChomeNS/chomens-bot-java
fix core more
This commit is contained in:
parent
cbccbf2780
commit
539ca22a3b
3 changed files with 9 additions and 2 deletions
|
@ -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'}",
|
||||
|
||||
|
|
|
@ -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) {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue