From 7f5288dea6e013547380c6a0ae619ecca8d1102b Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Tue, 13 Nov 2012 16:23:19 +0100 Subject: [PATCH] Add getIntegers(), getLongs(), ect. to PacketContainer. --- .../protocol/events/PacketContainer.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java index e9ce9714..5d62e953 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java @@ -123,6 +123,61 @@ public class PacketContainer implements Serializable { return structureModifier.withType(primitiveType); } + /** + * Retrieves a read/write structure for every byte field. + * @return A modifier for every byte field. + */ + public StructureModifier getBytes() { + return structureModifier.withType(byte.class); + } + + /** + * Retrieves a read/write structure for every short field. + * @return A modifier for every short field. + */ + public StructureModifier getShorts() { + return structureModifier.withType(short.class); + } + + /** + * Retrieves a read/write structure for every integer field. + * @return A modifier for every integer field. + */ + public StructureModifier getIntegers() { + return structureModifier.withType(int.class); + } + /** + * Retrieves a read/write structure for every long field. + * @return A modifier for every long field. + */ + public StructureModifier getLongs() { + return structureModifier.withType(long.class); + } + + /** + * Retrieves a read/write structure for every float field. + * @return A modifier for every float field. + */ + public StructureModifier getFloat() { + return structureModifier.withType(float.class); + } + + /** + * Retrieves a read/write structure for every double field. + * @return A modifier for every double field. + */ + public StructureModifier getDoubles() { + return structureModifier.withType(double.class); + } + + /** + * Retrieves a read/write structure for every String field. + * @return A modifier for every String field. + */ + public StructureModifier getStrings() { + return structureModifier.withType(String.class); + } + /** * Retrieves a read/write structure for ItemStack. *