Refactor
This commit is contained in:
@@ -134,8 +134,8 @@ public class Bot extends EntityPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void renderAll() {
|
private void renderAll() {
|
||||||
Packet<?>[] packets = getRenderPacketsNoTab();
|
Packet<?>[] packets = getRenderPacketsNoInfo();
|
||||||
Bukkit.getOnlinePlayers().forEach(p -> renderNoTab(((CraftPlayer) p).getHandle().playerConnection, packets, false));
|
Bukkit.getOnlinePlayers().forEach(p -> renderNoInfo(((CraftPlayer) p).getHandle().playerConnection, packets, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void render(PlayerConnection connection, Packet<?>[] packets, boolean login) {
|
private void render(PlayerConnection connection, Packet<?>[] packets, boolean login) {
|
||||||
@@ -150,7 +150,7 @@ public class Bot extends EntityPlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderNoTab(PlayerConnection connection, Packet<?>[] packets, boolean login) {
|
private void renderNoInfo(PlayerConnection connection, Packet<?>[] packets, boolean login) {
|
||||||
connection.sendPacket(packets[0]);
|
connection.sendPacket(packets[0]);
|
||||||
connection.sendPacket(packets[1]);
|
connection.sendPacket(packets[1]);
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ public class Bot extends EntityPlayer {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Packet<?>[] getRenderPacketsNoTab() {
|
private Packet<?>[] getRenderPacketsNoInfo() {
|
||||||
return new Packet[] {
|
return new Packet[] {
|
||||||
new PacketPlayOutNamedEntitySpawn(this),
|
new PacketPlayOutNamedEntitySpawn(this),
|
||||||
new PacketPlayOutEntityMetadata(this.getId(), this.getDataWatcher(), true),
|
new PacketPlayOutEntityMetadata(this.getId(), this.getDataWatcher(), true),
|
||||||
|
|||||||
Reference in New Issue
Block a user