1
0
mirror of https://github.com/LOOHP/Limbo.git synced 2026-06-08 14:11:44 +00:00

Improved kick command logic & player class internal code

This commit is contained in:
LOOHP
2021-11-24 19:00:37 +00:00
parent 6847f46a3b
commit 9eb2060457
2 changed files with 23 additions and 24 deletions
@@ -190,9 +190,7 @@ public class Player extends LivingEntity implements CommandSender {
}
PacketPlayOutPositionAndLook positionLook = new PacketPlayOutPositionAndLook(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch(), 1, false);
clientConnection.sendPacket(positionLook);
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {}
}
}
@@ -201,7 +199,7 @@ public class Player extends LivingEntity implements CommandSender {
}
public void sendMessage(String message, UUID uuid) {
sendMessage(TextComponent.fromLegacyText(message), uuid);
sendMessage(new TextComponent(message), uuid);
}
public void sendMessage(BaseComponent component, UUID uuid) {
@@ -213,13 +211,11 @@ public class Player extends LivingEntity implements CommandSender {
try {
PacketPlayOutChat chat = new PacketPlayOutChat(component, 0, uuid);
clientConnection.sendPacket(chat);
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {}
}
public void sendMessage(String message) {
sendMessage(TextComponent.fromLegacyText(message));
sendMessage(new TextComponent(message));
}
public void sendMessage(BaseComponent component) {
@@ -231,9 +227,7 @@ public class Player extends LivingEntity implements CommandSender {
try {
PacketPlayOutChat chat = new PacketPlayOutChat(component, 0, new UUID(0, 0));
clientConnection.sendPacket(chat);
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {}
}
public void disconnect() {
@@ -241,7 +235,7 @@ public class Player extends LivingEntity implements CommandSender {
}
public void disconnect(String reason) {
disconnect(TextComponent.fromLegacyText(reason));
disconnect(new TextComponent(reason));
}
public void disconnect(BaseComponent reason) {