diff --git a/src/main/java/com/comphenix/protocol/events/PacketContainer.java b/src/main/java/com/comphenix/protocol/events/PacketContainer.java index 51e2a38b..465e0e90 100644 --- a/src/main/java/com/comphenix/protocol/events/PacketContainer.java +++ b/src/main/java/com/comphenix/protocol/events/PacketContainer.java @@ -926,7 +926,7 @@ public class PacketContainer implements Serializable { */ public StructureModifier getDimensions() { if (NEW_DIMENSIONS) { - return structureModifier.withType( + return structureModifier.withParamType( MinecraftReflection.getMinecraftClass("ResourceKey"), BukkitConverters.getDimensionIDConverter(), MinecraftReflection.getMinecraftClass("DimensionManager") @@ -977,7 +977,7 @@ public class PacketContainer implements Serializable { * @return The Structure Modifier */ public StructureModifier getWorldKeys() { - return structureModifier.withType( + return structureModifier.withParamType( MinecraftReflection.getMinecraftClass("ResourceKey"), BukkitConverters.getWorldKeyConverter(), MinecraftReflection.getNmsWorldClass() diff --git a/src/main/java/com/comphenix/protocol/reflect/StructureModifier.java b/src/main/java/com/comphenix/protocol/reflect/StructureModifier.java index e9eadd15..1577570f 100644 --- a/src/main/java/com/comphenix/protocol/reflect/StructureModifier.java +++ b/src/main/java/com/comphenix/protocol/reflect/StructureModifier.java @@ -477,8 +477,20 @@ public class StructureModifier { * @param converter - converts objects into the given type. * @return A structure modifier for fields of this type. */ + public StructureModifier withType(Class fieldType, EquivalentConverter converter) { + return withParamType(fieldType, converter); + } + + /** + * Retrieves a structure modifier that only reads and writes fields of a given type. + * @param Type + * @param fieldType - the type, or supertype, of every field to modify. + * @param converter - converts objects into the given type. + * @param paramTypes - field type parameters + * @return A structure modifier for fields of this type. + */ @SuppressWarnings("unchecked") - public StructureModifier withType(Class fieldType, EquivalentConverter converter, Class... paramTypes) { + public StructureModifier withParamType(Class fieldType, EquivalentConverter converter, Class... paramTypes) { if (fieldType == null) { // It's not supported in this version, so return an empty modifier return new StructureModifier() {