diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/PlayerListEntry.java b/src/main/java/org/spacehq/mc/protocol/data/game/PlayerListEntry.java index 2f353ab1..904341d1 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/PlayerListEntry.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/PlayerListEntry.java @@ -3,6 +3,7 @@ package org.spacehq.mc.protocol.data.game; import org.spacehq.mc.auth.data.GameProfile; import org.spacehq.mc.protocol.data.game.entity.player.GameMode; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; public class PlayerListEntry { private GameProfile profile; @@ -66,4 +67,9 @@ public class PlayerListEntry { result = 31 * result + (this.displayName != null ? this.displayName.hashCode() : 0); return result; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/Attribute.java b/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/Attribute.java index 34e92d66..ab635947 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/Attribute.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/Attribute.java @@ -1,5 +1,7 @@ package org.spacehq.mc.protocol.data.game.entity.attribute; +import org.spacehq.mc.protocol.util.ReflectionToString; + import java.util.ArrayList; import java.util.List; @@ -58,4 +60,8 @@ public class Attribute { return result; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/EntityMetadata.java b/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/EntityMetadata.java index d26fe5cc..23913e5e 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/EntityMetadata.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/EntityMetadata.java @@ -1,5 +1,7 @@ package org.spacehq.mc.protocol.data.game.entity.metadata; +import org.spacehq.mc.protocol.util.ReflectionToString; + public class EntityMetadata { private int id; private MetadataType type; @@ -35,4 +37,9 @@ public class EntityMetadata { result = 31 * result + this.value.hashCode(); return result; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/Position.java b/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/Position.java index 6a31650a..a22962e1 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/Position.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/entity/metadata/Position.java @@ -1,5 +1,7 @@ package org.spacehq.mc.protocol.data.game.entity.metadata; +import org.spacehq.mc.protocol.util.ReflectionToString; + public class Position { private int x; private int y; @@ -35,4 +37,9 @@ public class Position { result = 31 * result + this.z; return result; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/handshake/client/HandshakePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/handshake/client/HandshakePacket.java index 9d746039..69391786 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/handshake/client/HandshakePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/handshake/client/HandshakePacket.java @@ -1,7 +1,8 @@ package org.spacehq.mc.protocol.packet.handshake.client; -import org.spacehq.mc.protocol.data.handshake.HandshakeIntent; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.handshake.HandshakeIntent; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -63,4 +64,8 @@ public class HandshakePacket implements Packet { return true; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientChatPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientChatPacket.java index 09e698e3..cf396856 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientChatPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientChatPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ClientChatPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientKeepAlivePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientKeepAlivePacket.java index 2cc2cedd..cb27acf4 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientKeepAlivePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientKeepAlivePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ClientKeepAlivePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientPluginMessagePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientPluginMessagePacket.java index 58566bf3..a67c793a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientPluginMessagePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientPluginMessagePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ClientPluginMessagePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientRequestPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientRequestPacket.java index 71f716a4..63eaf793 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientRequestPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientRequestPacket.java @@ -1,7 +1,8 @@ package org.spacehq.mc.protocol.packet.ingame.client; -import org.spacehq.mc.protocol.data.game.ClientRequest; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.ClientRequest; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -39,4 +40,8 @@ public class ClientRequestPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java index 7f410651..62cf6a71 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.client; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.ResourcePackStatus; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,9 @@ public class ClientResourcePackStatusPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientSettingsPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientSettingsPacket.java index a96f90dc..0c19d47b 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientSettingsPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientSettingsPacket.java @@ -1,9 +1,10 @@ package org.spacehq.mc.protocol.packet.ingame.client; -import org.spacehq.mc.protocol.data.game.entity.player.Hand; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.player.Hand; import org.spacehq.mc.protocol.data.game.setting.ChatVisibility; import org.spacehq.mc.protocol.data.game.setting.SkinPart; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -100,4 +101,8 @@ public class ClientSettingsPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientTabCompletePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientTabCompletePacket.java index ce70b4e3..f959d9ff 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientTabCompletePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientTabCompletePacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.client; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -62,4 +63,8 @@ public class ClientTabCompletePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerAbilitiesPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerAbilitiesPacket.java index 0a915012..6004cb45 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerAbilitiesPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerAbilitiesPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -92,4 +93,8 @@ public class ClientPlayerAbilitiesPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerActionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerActionPacket.java index 3a91f883..ac8cbc2e 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerActionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerActionPacket.java @@ -5,6 +5,7 @@ import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.game.entity.player.PlayerAction; import org.spacehq.mc.protocol.data.game.world.block.BlockFace; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -58,4 +59,8 @@ public class ClientPlayerActionPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerChangeHeldItemPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerChangeHeldItemPacket.java index 9fed7522..c814dace 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerChangeHeldItemPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerChangeHeldItemPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ClientPlayerChangeHeldItemPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerInteractEntityPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerInteractEntityPacket.java index 14f65882..8081a6db 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerInteractEntityPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerInteractEntityPacket.java @@ -1,8 +1,9 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; -import org.spacehq.mc.protocol.data.game.entity.player.Hand; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.player.Hand; import org.spacehq.mc.protocol.data.game.entity.player.InteractAction; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -99,4 +100,8 @@ public class ClientPlayerInteractEntityPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerMovementPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerMovementPacket.java index 57f63b15..b7703a37 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerMovementPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerMovementPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -86,4 +87,8 @@ public class ClientPlayerMovementPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerPlaceBlockPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerPlaceBlockPacket.java index 19685f69..10df7d5c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerPlaceBlockPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerPlaceBlockPacket.java @@ -1,10 +1,11 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; +import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.game.entity.player.Hand; -import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.world.block.BlockFace; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -82,4 +83,8 @@ public class ClientPlayerPlaceBlockPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerRotationPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerRotationPacket.java index f38e8419..61ca4d1d 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerRotationPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerRotationPacket.java @@ -12,5 +12,4 @@ public class ClientPlayerRotationPacket extends ClientPlayerMovementPacket { this.yaw = yaw; this.pitch = pitch; } - } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerStatePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerStatePacket.java index fc8c8aae..3b6b0c5f 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerStatePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerStatePacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.player.PlayerState; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -59,4 +60,8 @@ public class ClientPlayerStatePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerSwingArmPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerSwingArmPacket.java index 081535fa..f233f2dd 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerSwingArmPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerSwingArmPacket.java @@ -1,7 +1,8 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; -import org.spacehq.mc.protocol.data.game.entity.player.Hand; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.player.Hand; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,9 @@ public class ClientPlayerSwingArmPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerUseItemPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerUseItemPacket.java index 8eb3ebe6..47b18922 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerUseItemPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/player/ClientPlayerUseItemPacket.java @@ -1,7 +1,8 @@ package org.spacehq.mc.protocol.packet.ingame.client.player; -import org.spacehq.mc.protocol.data.game.entity.player.Hand; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.player.Hand; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,9 @@ public class ClientPlayerUseItemPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCloseWindowPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCloseWindowPacket.java index ee450ef5..53bde6ab 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCloseWindowPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCloseWindowPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.window; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ClientCloseWindowPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientConfirmTransactionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientConfirmTransactionPacket.java index dce1782f..5f958ae9 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientConfirmTransactionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientConfirmTransactionPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.window; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -53,4 +54,8 @@ public class ClientConfirmTransactionPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCreativeInventoryActionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCreativeInventoryActionPacket.java index 90c14be5..98ae7555 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCreativeInventoryActionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientCreativeInventoryActionPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.client.window; import org.spacehq.mc.protocol.data.game.entity.metadata.ItemStack; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -47,4 +48,8 @@ public class ClientCreativeInventoryActionPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientEnchantItemPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientEnchantItemPacket.java index eae70399..8b02b0f0 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientEnchantItemPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientEnchantItemPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.window; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ClientEnchantItemPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientWindowActionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientWindowActionPacket.java index 85a12e8b..dd0f332a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientWindowActionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/window/ClientWindowActionPacket.java @@ -1,7 +1,7 @@ package org.spacehq.mc.protocol.packet.ingame.client.window; -import org.spacehq.mc.protocol.data.game.entity.metadata.ItemStack; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.metadata.ItemStack; import org.spacehq.mc.protocol.data.game.window.ClickItemParam; import org.spacehq.mc.protocol.data.game.window.CreativeGrabParam; import org.spacehq.mc.protocol.data.game.window.DropItemParam; @@ -12,6 +12,7 @@ import org.spacehq.mc.protocol.data.game.window.SpreadItemParam; import org.spacehq.mc.protocol.data.game.window.WindowAction; import org.spacehq.mc.protocol.data.game.window.WindowActionParam; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -121,4 +122,8 @@ public class ClientWindowActionPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSpectatePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSpectatePacket.java index 6e3285a5..54db0208 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSpectatePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSpectatePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.world; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -36,4 +37,9 @@ public class ClientSpectatePacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerBoatPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerBoatPacket.java index a343631c..5d52628e 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerBoatPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerBoatPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.world; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ClientSteerBoatPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerVehiclePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerVehiclePacket.java index f8ea639a..5cb77cbe 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerVehiclePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientSteerVehiclePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.world; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -70,4 +71,8 @@ public class ClientSteerVehiclePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientTeleportConfirmPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientTeleportConfirmPacket.java index 6b936b19..22a04b57 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientTeleportConfirmPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientTeleportConfirmPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.world; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -35,4 +36,9 @@ public class ClientTeleportConfirmPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientUpdateSignPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientUpdateSignPacket.java index abc658b3..c9c32e8a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientUpdateSignPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientUpdateSignPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.client.world; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -56,4 +57,8 @@ public class ClientUpdateSignPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientVehicleMovePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientVehicleMovePacket.java index 5984556f..cdbc6bcb 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientVehicleMovePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/world/ClientVehicleMovePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.client.world; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -67,4 +68,9 @@ public class ClientVehicleMovePacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerBossBarPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerBossBarPacket.java index fcac6783..ce26fed6 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerBossBarPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerBossBarPacket.java @@ -1,10 +1,11 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.BossBarAction; import org.spacehq.mc.protocol.data.game.BossBarColor; import org.spacehq.mc.protocol.data.game.BossBarDivision; -import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -167,4 +168,9 @@ public class ServerBossBarPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerChatPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerChatPacket.java index a4461e4c..0cbb1d87 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerChatPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerChatPacket.java @@ -3,6 +3,7 @@ package org.spacehq.mc.protocol.packet.ingame.server; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.MessageType; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -60,4 +61,8 @@ public class ServerChatPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerCombatPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerCombatPacket.java index b191ecce..9a885dfa 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerCombatPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerCombatPacket.java @@ -3,6 +3,7 @@ package org.spacehq.mc.protocol.packet.ingame.server; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.player.CombatState; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -85,4 +86,8 @@ public class ServerCombatPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDifficultyPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDifficultyPacket.java index 89e075cf..4d63767b 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDifficultyPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDifficultyPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.setting.Difficulty; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -39,4 +40,8 @@ public class ServerDifficultyPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDisconnectPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDisconnectPacket.java index 88bafb58..481fbaa9 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDisconnectPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerDisconnectPacket.java @@ -1,6 +1,7 @@ package org.spacehq.mc.protocol.packet.ingame.server; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -42,4 +43,8 @@ public class ServerDisconnectPacket implements Packet { return true; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java index 8bbf0d3a..c8e4093c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java @@ -4,6 +4,7 @@ import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.player.GameMode; import org.spacehq.mc.protocol.data.game.setting.Difficulty; import org.spacehq.mc.protocol.data.game.world.WorldType; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -103,4 +104,8 @@ public class ServerJoinGamePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerKeepAlivePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerKeepAlivePacket.java index 67b6c293..55b175fd 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerKeepAlivePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerKeepAlivePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ServerKeepAlivePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListDataPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListDataPacket.java index 44c255e2..0e482ed7 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListDataPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListDataPacket.java @@ -1,6 +1,7 @@ package org.spacehq.mc.protocol.packet.ingame.server; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -44,4 +45,9 @@ public class ServerPlayerListDataPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListEntryPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListEntryPacket.java index c01a9933..8955474c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListEntryPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPlayerListEntryPacket.java @@ -6,6 +6,7 @@ import org.spacehq.mc.protocol.data.game.PlayerListEntry; import org.spacehq.mc.protocol.data.game.PlayerListEntryAction; import org.spacehq.mc.protocol.data.game.entity.player.GameMode; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -145,4 +146,9 @@ public class ServerPlayerListEntryPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPluginMessagePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPluginMessagePacket.java index 68d87012..3c095a5e 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPluginMessagePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerPluginMessagePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ServerPluginMessagePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerResourcePackSendPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerResourcePackSendPacket.java index 544ef13f..c199f8aa 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerResourcePackSendPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerResourcePackSendPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -43,4 +44,9 @@ public class ServerResourcePackSendPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerRespawnPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerRespawnPacket.java index 8ed4fbbb..0db39826 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerRespawnPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerRespawnPacket.java @@ -4,6 +4,7 @@ import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.player.GameMode; import org.spacehq.mc.protocol.data.game.setting.Difficulty; import org.spacehq.mc.protocol.data.game.world.WorldType; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -65,4 +66,8 @@ public class ServerRespawnPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCompressionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCompressionPacket.java index 18b69883..274c0d31 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCompressionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCompressionPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -35,4 +36,9 @@ public class ServerSetCompressionPacket implements Packet { public boolean isPriority() { return true; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCooldownPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCooldownPacket.java index 81c9ff31..beb67c8f 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCooldownPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSetCooldownPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ServerSetCooldownPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerStatisticsPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerStatisticsPacket.java index 3902d395..2f3adaef 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerStatisticsPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerStatisticsPacket.java @@ -8,6 +8,7 @@ import org.spacehq.mc.protocol.data.game.statistic.CraftItemStatistic; import org.spacehq.mc.protocol.data.game.statistic.GenericStatistic; import org.spacehq.mc.protocol.data.game.statistic.Statistic; import org.spacehq.mc.protocol.data.game.statistic.UseItemStatistic; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -90,4 +91,8 @@ public class ServerStatisticsPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSwitchCameraPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSwitchCameraPacket.java index 9c89ecbc..5cff6380 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSwitchCameraPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerSwitchCameraPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ServerSwitchCameraPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTabCompletePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTabCompletePacket.java index c4dee06c..37fc7ccf 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTabCompletePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTabCompletePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -43,4 +44,8 @@ public class ServerTabCompletePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTitlePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTitlePacket.java index 014156e1..503b6710 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTitlePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerTitlePacket.java @@ -3,6 +3,7 @@ package org.spacehq.mc.protocol.packet.ingame.server; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.TitleAction; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -125,4 +126,9 @@ public class ServerTitlePacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAnimationPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAnimationPacket.java index f59c6d11..4dae7e42 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAnimationPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAnimationPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.player.Animation; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -47,4 +48,8 @@ public class ServerEntityAnimationPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAttachPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAttachPacket.java index af9b6b0e..4413a4dc 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAttachPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityAttachPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ServerEntityAttachPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityCollectItemPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityCollectItemPacket.java index 187777fd..7b5a8845 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityCollectItemPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityCollectItemPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ServerEntityCollectItemPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityDestroyPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityDestroyPacket.java index ef1098c9..a58a7990 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityDestroyPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityDestroyPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -43,4 +44,8 @@ public class ServerEntityDestroyPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEffectPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEffectPacket.java index 418acb73..13f990f4 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEffectPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEffectPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.Effect; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -90,4 +91,8 @@ public class ServerEntityEffectPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEquipmentPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEquipmentPacket.java index 5f7700cb..b41d475b 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEquipmentPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityEquipmentPacket.java @@ -1,9 +1,10 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; -import org.spacehq.mc.protocol.data.game.entity.metadata.ItemStack; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.EquipmentSlot; +import org.spacehq.mc.protocol.data.game.entity.metadata.ItemStack; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -57,4 +58,8 @@ public class ServerEntityEquipmentPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityHeadLookPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityHeadLookPacket.java index c89868d8..f2c7f1d3 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityHeadLookPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityHeadLookPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ServerEntityHeadLookPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMetadataPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMetadataPacket.java index dfc0fe6d..eba653d4 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMetadataPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMetadataPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; import org.spacehq.mc.protocol.data.game.entity.metadata.EntityMetadata; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -47,4 +48,8 @@ public class ServerEntityMetadataPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMovementPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMovementPacket.java index de38d9cb..0755289b 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMovementPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityMovementPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -98,4 +99,8 @@ public class ServerEntityMovementPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java index 9fe251e8..d5137415 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java @@ -1,10 +1,11 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.attribute.Attribute; import org.spacehq.mc.protocol.data.game.entity.attribute.AttributeModifier; -import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.attribute.AttributeType; import org.spacehq.mc.protocol.data.game.entity.attribute.ModifierOperation; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -74,4 +75,8 @@ public class ServerEntityPropertiesPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRemoveEffectPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRemoveEffectPacket.java index c105108d..3c01568e 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRemoveEffectPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRemoveEffectPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.Effect; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -47,4 +48,8 @@ public class ServerEntityRemoveEffectPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRotationPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRotationPacket.java index 37e471fd..b5e0e7dd 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRotationPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityRotationPacket.java @@ -1,5 +1,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; + public class ServerEntityRotationPacket extends ServerEntityMovementPacket { protected ServerEntityRotationPacket() { @@ -13,4 +15,8 @@ public class ServerEntityRotationPacket extends ServerEntityMovementPacket { this.pitch = pitch; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java index 517a8347..fa16f992 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -51,4 +52,8 @@ public class ServerEntitySetPassengersPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityStatusPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityStatusPacket.java index 652508fb..28a318ad 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityStatusPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityStatusPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.EntityStatus; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -47,4 +48,8 @@ public class ServerEntityStatusPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityTeleportPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityTeleportPacket.java index 3a00fe01..ed7f6d09 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityTeleportPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityTeleportPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -85,4 +86,8 @@ public class ServerEntityTeleportPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityVelocityPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityVelocityPacket.java index e5ee8ebd..6fa82406 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityVelocityPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntityVelocityPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -61,4 +62,8 @@ public class ServerEntityVelocityPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerVehicleMovePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerVehicleMovePacket.java index 6ec0a588..960db2dc 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerVehicleMovePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerVehicleMovePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -67,4 +68,9 @@ public class ServerVehicleMovePacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerAbilitiesPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerAbilitiesPacket.java index ea0f64e7..f8822c1a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerAbilitiesPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerAbilitiesPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.player; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -92,4 +93,8 @@ public class ServerPlayerAbilitiesPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerChangeHeldItemPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerChangeHeldItemPacket.java index 9e9fe0c9..5800566b 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerChangeHeldItemPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerChangeHeldItemPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.player; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ServerPlayerChangeHeldItemPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerHealthPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerHealthPacket.java index dfa4de6a..f008dec7 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerHealthPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerHealthPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.player; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -53,4 +54,8 @@ public class ServerPlayerHealthPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerPositionRotationPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerPositionRotationPacket.java index 6e898bb9..9e76ad6f 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerPositionRotationPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerPositionRotationPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.player; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.player.PositionElement; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -103,4 +104,8 @@ public class ServerPlayerPositionRotationPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerSetExperiencePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerSetExperiencePacket.java index 3efaaac6..6164152c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerSetExperiencePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerSetExperiencePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.player; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -53,4 +54,8 @@ public class ServerPlayerSetExperiencePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerUseBedPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerUseBedPacket.java index afcbe002..bf60ce46 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerUseBedPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/player/ServerPlayerUseBedPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.player; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -47,4 +48,8 @@ public class ServerPlayerUseBedPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnExpOrbPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnExpOrbPacket.java index ea6f5cee..9cdceab6 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnExpOrbPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnExpOrbPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.spawn; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -69,4 +70,8 @@ public class ServerSpawnExpOrbPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnGlobalEntityPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnGlobalEntityPacket.java index 73cd6e37..79e3e164 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnGlobalEntityPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnGlobalEntityPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.spawn; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.entity.type.GlobalEntityType; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -71,4 +72,8 @@ public class ServerSpawnGlobalEntityPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnMobPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnMobPacket.java index 0c407bea..1e7b009a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnMobPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnMobPacket.java @@ -1,9 +1,10 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.spawn; -import org.spacehq.mc.protocol.data.game.entity.metadata.EntityMetadata; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.metadata.EntityMetadata; import org.spacehq.mc.protocol.data.game.entity.type.MobType; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -138,4 +139,8 @@ public class ServerSpawnMobPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnObjectPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnObjectPacket.java index 0f6378e9..c6f97fd0 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnObjectPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnObjectPacket.java @@ -8,6 +8,7 @@ import org.spacehq.mc.protocol.data.game.entity.type.object.ObjectData; import org.spacehq.mc.protocol.data.game.entity.type.object.ObjectType; import org.spacehq.mc.protocol.data.game.entity.type.object.ProjectileData; import org.spacehq.mc.protocol.data.game.entity.type.object.SplashPotionData; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -183,4 +184,8 @@ public class ServerSpawnObjectPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPaintingPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPaintingPacket.java index 994699c5..a00b931f 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPaintingPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPaintingPacket.java @@ -5,6 +5,7 @@ import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.game.entity.type.PaintingType; import org.spacehq.mc.protocol.data.game.entity.type.object.HangingDirection; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -75,4 +76,8 @@ public class ServerSpawnPaintingPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPlayerPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPlayerPacket.java index 709b58eb..dc6f9f22 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPlayerPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/spawn/ServerSpawnPlayerPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.entity.spawn; import org.spacehq.mc.protocol.data.game.entity.metadata.EntityMetadata; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -96,4 +97,8 @@ public class ServerSpawnPlayerPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerDisplayScoreboardPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerDisplayScoreboardPacket.java index 9d3ba547..402183ee 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerDisplayScoreboardPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerDisplayScoreboardPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.scoreboard; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.scoreboard.ScoreboardPosition; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -47,4 +48,8 @@ public class ServerDisplayScoreboardPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerScoreboardObjectivePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerScoreboardObjectivePacket.java index c6287164..ee50175c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerScoreboardObjectivePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerScoreboardObjectivePacket.java @@ -3,6 +3,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.scoreboard; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.scoreboard.ObjectiveAction; import org.spacehq.mc.protocol.data.game.scoreboard.ScoreType; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -77,4 +78,8 @@ public class ServerScoreboardObjectivePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerTeamPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerTeamPacket.java index f8363a3e..a1e290c9 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerTeamPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerTeamPacket.java @@ -5,6 +5,7 @@ import org.spacehq.mc.protocol.data.game.scoreboard.CollisionRule; import org.spacehq.mc.protocol.data.game.scoreboard.NameTagVisibility; import org.spacehq.mc.protocol.data.game.scoreboard.TeamAction; import org.spacehq.mc.protocol.data.game.scoreboard.TeamColor; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -168,4 +169,8 @@ public class ServerTeamPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerUpdateScorePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerUpdateScorePacket.java index 27716e85..ad91bb0d 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerUpdateScorePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/scoreboard/ServerUpdateScorePacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.scoreboard; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.scoreboard.ScoreboardAction; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -73,4 +74,8 @@ public class ServerUpdateScorePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerCloseWindowPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerCloseWindowPacket.java index 3471936c..7492f8a4 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerCloseWindowPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerCloseWindowPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.window; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class ServerCloseWindowPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerConfirmTransactionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerConfirmTransactionPacket.java index 4e4c33f8..ee53b0c1 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerConfirmTransactionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerConfirmTransactionPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.window; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -53,4 +54,8 @@ public class ServerConfirmTransactionPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerOpenWindowPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerOpenWindowPacket.java index 780683d4..20be7e11 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerOpenWindowPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerOpenWindowPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.window; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.window.WindowType; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -79,4 +80,8 @@ public class ServerOpenWindowPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerSetSlotPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerSetSlotPacket.java index c48339b4..a1a011ec 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerSetSlotPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerSetSlotPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.window; import org.spacehq.mc.protocol.data.game.entity.metadata.ItemStack; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -55,4 +56,8 @@ public class ServerSetSlotPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowItemsPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowItemsPacket.java index 8325d760..740dcb51 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowItemsPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowItemsPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.window; import org.spacehq.mc.protocol.data.game.entity.metadata.ItemStack; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -53,4 +54,8 @@ public class ServerWindowItemsPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowPropertyPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowPropertyPacket.java index 2cff3a67..9676cc61 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowPropertyPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/window/ServerWindowPropertyPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.window; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.window.property.WindowProperty; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -65,4 +66,8 @@ public class ServerWindowPropertyPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockBreakAnimPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockBreakAnimPacket.java index efedce99..1913390d 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockBreakAnimPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockBreakAnimPacket.java @@ -1,9 +1,10 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; -import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.game.entity.player.BlockBreakStage; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -61,4 +62,8 @@ public class ServerBlockBreakAnimPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockChangePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockChangePacket.java index 88ca2443..9dc5df51 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockChangePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockChangePacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.game.world.block.BlockChangeRecord; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -40,4 +41,8 @@ public class ServerBlockChangePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockValuePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockValuePacket.java index 4e7c94ce..914d0fdd 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockValuePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerBlockValuePacket.java @@ -1,7 +1,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; -import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.game.world.block.value.BlockValue; import org.spacehq.mc.protocol.data.game.world.block.value.BlockValueType; import org.spacehq.mc.protocol.data.game.world.block.value.ChestValue; @@ -15,6 +15,7 @@ import org.spacehq.mc.protocol.data.game.world.block.value.NoteBlockValueType; import org.spacehq.mc.protocol.data.game.world.block.value.PistonValue; import org.spacehq.mc.protocol.data.game.world.block.value.PistonValueType; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -134,4 +135,8 @@ public class ServerBlockValuePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerChunkDataPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerChunkDataPacket.java index 2088f367..a67ad4a6 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerChunkDataPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerChunkDataPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.game.chunk.Column; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.io.stream.StreamNetOutput; @@ -54,4 +55,9 @@ public class ServerChunkDataPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerExplosionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerExplosionPacket.java index 1890d581..673c59be 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerExplosionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerExplosionPacket.java @@ -1,6 +1,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.game.world.block.ExplodedBlockRecord; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -107,4 +108,8 @@ public class ServerExplosionPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMapDataPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMapDataPacket.java index 3b228343..04c64f5a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMapDataPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMapDataPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.game.world.map.MapData; import org.spacehq.mc.protocol.data.game.world.map.MapPlayer; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -108,4 +109,8 @@ public class ServerMapDataPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMultiBlockChangePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMultiBlockChangePacket.java index 0cc1be09..70d4c26a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMultiBlockChangePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerMultiBlockChangePacket.java @@ -1,9 +1,10 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; -import org.spacehq.mc.protocol.data.game.world.block.BlockState; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.game.world.block.BlockChangeRecord; +import org.spacehq.mc.protocol.data.game.world.block.BlockState; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -63,4 +64,8 @@ public class ServerMultiBlockChangePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerNotifyClientPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerNotifyClientPacket.java index 81ce0403..e44dc4d2 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerNotifyClientPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerNotifyClientPacket.java @@ -8,6 +8,7 @@ import org.spacehq.mc.protocol.data.game.world.notify.DemoMessageValue; import org.spacehq.mc.protocol.data.game.world.notify.EnterCreditsValue; import org.spacehq.mc.protocol.data.game.world.notify.RainStrengthValue; import org.spacehq.mc.protocol.data.game.world.notify.ThunderStrengthValue; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -73,4 +74,8 @@ public class ServerNotifyClientPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerOpenTileEntityEditorPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerOpenTileEntityEditorPacket.java index d2dcc235..c8cc3c8b 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerOpenTileEntityEditorPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerOpenTileEntityEditorPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -39,4 +40,8 @@ public class ServerOpenTileEntityEditorPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java index 74a53fd1..f6c5509c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java @@ -1,8 +1,9 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.MagicValues; -import org.spacehq.mc.protocol.data.game.world.sound.SoundCategory; import org.spacehq.mc.protocol.data.game.world.sound.BuiltinSound; +import org.spacehq.mc.protocol.data.game.world.sound.SoundCategory; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -97,4 +98,8 @@ public class ServerPlayBuiltinSoundPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayEffectPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayEffectPacket.java index 4ac24ce2..2bfdfd16 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayEffectPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayEffectPacket.java @@ -13,6 +13,7 @@ import org.spacehq.mc.protocol.data.game.world.effect.SoundEffect; import org.spacehq.mc.protocol.data.game.world.effect.WorldEffect; import org.spacehq.mc.protocol.data.game.world.effect.WorldEffectData; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -103,4 +104,8 @@ public class ServerPlayEffectPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java index 05864e07..1768043b 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java @@ -5,6 +5,7 @@ import org.spacehq.mc.protocol.data.game.world.sound.BuiltinSound; import org.spacehq.mc.protocol.data.game.world.sound.CustomSound; import org.spacehq.mc.protocol.data.game.world.sound.Sound; import org.spacehq.mc.protocol.data.game.world.sound.SoundCategory; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -112,4 +113,8 @@ public class ServerPlaySoundPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnParticlePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnParticlePacket.java index 49424860..aaca065e 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnParticlePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnParticlePacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.world.Particle; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -125,4 +126,9 @@ public class ServerSpawnParticlePacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnPositionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnPositionPacket.java index ee7ee256..0b02d048 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnPositionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerSpawnPositionPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -39,4 +40,8 @@ public class ServerSpawnPositionPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUnloadChunkPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUnloadChunkPacket.java index 7ca7a14b..0b7f0ad7 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUnloadChunkPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUnloadChunkPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -43,4 +44,9 @@ public class ServerUnloadChunkPacket implements Packet { public boolean isPriority() { return false; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateSignPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateSignPacket.java index 4e0f38b2..6944d17f 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateSignPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateSignPacket.java @@ -3,6 +3,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.message.Message; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -68,4 +69,9 @@ public class ServerUpdateSignPacket implements Packet { return messages; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTileEntityPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTileEntityPacket.java index 15f0d40e..035636d2 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTileEntityPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTileEntityPacket.java @@ -1,9 +1,10 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; -import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.MagicValues; +import org.spacehq.mc.protocol.data.game.entity.metadata.Position; import org.spacehq.mc.protocol.data.game.world.block.UpdatedTileType; import org.spacehq.mc.protocol.util.NetUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.opennbt.tag.builtin.CompoundTag; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; @@ -58,4 +59,8 @@ public class ServerUpdateTileEntityPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTimePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTimePacket.java index 1b791751..5a0addd2 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTimePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerUpdateTimePacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -45,4 +46,8 @@ public class ServerUpdateTimePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerWorldBorderPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerWorldBorderPacket.java index 75361a6f..1f627b3d 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerWorldBorderPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerWorldBorderPacket.java @@ -2,6 +2,7 @@ package org.spacehq.mc.protocol.packet.ingame.server.world; import org.spacehq.mc.protocol.data.MagicValues; import org.spacehq.mc.protocol.data.game.world.WorldBorderAction; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -172,4 +173,8 @@ public class ServerWorldBorderPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/login/client/EncryptionResponsePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/login/client/EncryptionResponsePacket.java index 26655a42..d2d4eef9 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/login/client/EncryptionResponsePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/login/client/EncryptionResponsePacket.java @@ -1,11 +1,12 @@ package org.spacehq.mc.protocol.packet.login.client; +import javax.crypto.SecretKey; import org.spacehq.mc.protocol.util.CryptUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; -import javax.crypto.SecretKey; import java.io.IOException; import java.security.PrivateKey; import java.security.PublicKey; @@ -51,4 +52,8 @@ public class EncryptionResponsePacket implements Packet { return true; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/login/client/LoginStartPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/login/client/LoginStartPacket.java index acc992a2..8de4600c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/login/client/LoginStartPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/login/client/LoginStartPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.login.client; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class LoginStartPacket implements Packet { return true; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/login/server/EncryptionRequestPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/login/server/EncryptionRequestPacket.java index fa017b71..20187c62 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/login/server/EncryptionRequestPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/login/server/EncryptionRequestPacket.java @@ -1,6 +1,7 @@ package org.spacehq.mc.protocol.packet.login.server; import org.spacehq.mc.protocol.util.CryptUtil; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -58,4 +59,8 @@ public class EncryptionRequestPacket implements Packet { return true; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginDisconnectPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginDisconnectPacket.java index 1c0e25f2..0b17c884 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginDisconnectPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginDisconnectPacket.java @@ -1,6 +1,7 @@ package org.spacehq.mc.protocol.packet.login.server; import org.spacehq.mc.protocol.data.message.Message; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -42,4 +43,8 @@ public class LoginDisconnectPacket implements Packet { return true; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSetCompressionPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSetCompressionPacket.java index dc277ab9..569afbdf 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSetCompressionPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSetCompressionPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.login.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -35,4 +36,9 @@ public class LoginSetCompressionPacket implements Packet { public boolean isPriority() { return true; } + + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSuccessPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSuccessPacket.java index fb23ffe8..c58db018 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSuccessPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/login/server/LoginSuccessPacket.java @@ -1,6 +1,7 @@ package org.spacehq.mc.protocol.packet.login.server; import org.spacehq.mc.auth.data.GameProfile; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -39,4 +40,8 @@ public class LoginSuccessPacket implements Packet { return true; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusPingPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusPingPacket.java index 0165d542..cfc6ba0c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusPingPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusPingPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.status.client; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class StatusPingPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusQueryPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusQueryPacket.java index b3610b60..256c72f0 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusQueryPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/status/client/StatusQueryPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.status.client; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -24,4 +25,8 @@ public class StatusQueryPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusPongPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusPongPacket.java index c00d6140..ecfa5190 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusPongPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusPongPacket.java @@ -1,5 +1,6 @@ package org.spacehq.mc.protocol.packet.status.server; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; @@ -37,4 +38,8 @@ public class StatusPongPacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusResponsePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusResponsePacket.java index 23cdb5ba..d4b48160 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusResponsePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/status/server/StatusResponsePacket.java @@ -4,17 +4,18 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import javax.imageio.ImageIO; import org.spacehq.mc.auth.data.GameProfile; import org.spacehq.mc.auth.util.Base64; import org.spacehq.mc.protocol.data.message.Message; import org.spacehq.mc.protocol.data.status.PlayerInfo; import org.spacehq.mc.protocol.data.status.ServerStatusInfo; import org.spacehq.mc.protocol.data.status.VersionInfo; +import org.spacehq.mc.protocol.util.ReflectionToString; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; import org.spacehq.packetlib.packet.Packet; -import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -129,4 +130,8 @@ public class StatusResponsePacket implements Packet { return false; } + @Override + public String toString() { + return ReflectionToString.toString(this); + } } diff --git a/src/main/java/org/spacehq/mc/protocol/util/ReflectionToString.java b/src/main/java/org/spacehq/mc/protocol/util/ReflectionToString.java new file mode 100644 index 00000000..3fdfbf77 --- /dev/null +++ b/src/main/java/org/spacehq/mc/protocol/util/ReflectionToString.java @@ -0,0 +1,72 @@ +package org.spacehq.mc.protocol.util; + +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.List; + +/** + * @author yawkat + */ +public class ReflectionToString { + private ReflectionToString() { + } + + private static String memberToString(Object o) { + if (o == null) { return "null"; } + + if (o.getClass().isArray()) { + int length = Array.getLength(o); + if (length > 20) { + return o.getClass().getSimpleName() + "(length=" + length + ')'; + } else { + StringBuilder builder = new StringBuilder("["); + for (int i = 0; i < length; i++) { + if (i > 0) { builder.append(", "); } + builder.append(memberToString(Array.get(o, i))); + } + return builder.append(']').toString(); + } + } + + return o.toString(); + } + + public static String toString(Object o) { + if (o == null) { return "null"; } + + try { + StringBuilder builder = new StringBuilder(o.getClass().getSimpleName()).append('('); + + // this is somewhat expensive to do every time but who cares, it's just a toString + List allDeclaredFields = getAllDeclaredFields(o.getClass()); + + for (int i = 0; i < allDeclaredFields.size(); i++) { + if (i > 0) { builder.append(", "); } + + Field field = allDeclaredFields.get(i); + field.setAccessible(true); + builder.append(field.getName()) + .append('=') + .append(memberToString(field.get(o))); + } + return builder.append(')').toString(); + } catch (Throwable e) { + return o.getClass().getSimpleName() + '@' + Integer.toHexString(o.hashCode()) + '(' + e.toString() + ')'; + } + } + + private static List getAllDeclaredFields(Class clazz) { + List fields = new ArrayList(); + while (clazz != null) { + for (Field field : clazz.getDeclaredFields()) { + if (!Modifier.isStatic(field.getModifiers())) { + fields.add(field); + } + } + clazz = clazz.getSuperclass(); + } + return fields; + } +} diff --git a/src/test/java/org/spacehq/mc/protocol/util/ReflectionToStringTest.java b/src/test/java/org/spacehq/mc/protocol/util/ReflectionToStringTest.java new file mode 100644 index 00000000..d5f7e150 --- /dev/null +++ b/src/test/java/org/spacehq/mc/protocol/util/ReflectionToStringTest.java @@ -0,0 +1,50 @@ +package org.spacehq.mc.protocol.util; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * @author yawkat + */ +public class ReflectionToStringTest { + @Test + public void testSimple() { + assertEquals( + "Test1(field1=abc)", + ReflectionToString.toString(new Test1()) + ); + } + + private static class Test1 { + String field1 = "abc"; + } + + @Test + public void testInherit() { + assertEquals( + "Test2(field1=abc, field2=def)", + ReflectionToString.toString(new Test2()) + ); + } + + private static class Test2 extends Test3 { + String field1 = "abc"; + } + + private static class Test3 { + String field2 = "def"; + } + + @Test + public void testArray() { + assertEquals( + "Test4(field1=[1, 2, 3])", + ReflectionToString.toString(new Test4()) + ); + } + + private static class Test4 { + int[] field1 = new int[]{ 1, 2, 3 }; + } +} \ No newline at end of file