2525import org .bukkit .event .block .BlockExplodeEvent ;
2626import org .bukkit .event .block .BlockFromToEvent ;
2727import org .bukkit .event .player .PlayerChangedWorldEvent ;
28+ import org .bukkit .event .player .PlayerJoinEvent ;
2829
2930import java .util .concurrent .*;
3031import java .io .*;
@@ -170,7 +171,7 @@ private void hip(Player p, Location l, String a) {
170171 }
171172
172173 switch (a .toLowerCase ()) {
173- case "ready " :
174+ case "ready2 " :
174175 ld ("Player " + p .getName () + " is READY." );
175176 aib .add (p .getUniqueId ());
176177 if (ew .contains (p .getWorld ().getName ())) {
@@ -191,6 +192,8 @@ public void run() {
191192 }
192193 }.runTask (this );
193194 break ;
195+ case "ready" :
196+ p .kickPlayer ("§cYour client is not compatible with the version of §6TuffX §cthe server has installed!\n §7Please update your client." );
194197 }
195198 }
196199
@@ -217,7 +220,7 @@ public void resendChunksInView(Player p) {
217220
218221 private byte [] cby0sp (boolean s ) {
219222 try (ByteArrayOutputStream b = new ByteArrayOutputStream (); DataOutputStream o = new DataOutputStream (b )) {
220- o .writeUTF ("belowy0_status " );
223+ o .writeUTF ("y0_status " );
221224 o .writeBoolean (s );
222225 return b .toByteArray ();
223226 } catch (IOException e ) { return null ; }
@@ -241,6 +244,14 @@ public void onPlayerChangeWorld(PlayerChangedWorldEvent e) {
241244 }
242245 }
243246
247+ @ EventHandler (priority = EventPriority .MONITOR )
248+ public void onPlayerJoin (PlayerJoinEvent e ) {
249+ Player p = e .getPlayer ();
250+ p .sendPluginMessage (this , CH , cdp ());
251+ boolean isEnabledWorld = ew .contains (p .getWorld ().getName ());
252+ p .sendPluginMessage (this , CH , cby0sp (isEnabledWorld ));
253+ }
254+
244255 public void processAndSendChunk (final Player p , final Chunk c ) {
245256 if (c == null || p == null || !p .isOnline () || cp == null || cp .isShutdown ()) {
246257 return ;
0 commit comments