File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
src/main/java/com/comphenix/protocol Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -926,7 +926,7 @@ public StructureModifier<MinecraftKey> getMinecraftKeys() {
926
926
*/
927
927
public StructureModifier <Integer > getDimensions () {
928
928
if (NEW_DIMENSIONS ) {
929
- return structureModifier .withType (
929
+ return structureModifier .withParamType (
930
930
MinecraftReflection .getMinecraftClass ("ResourceKey" ),
931
931
BukkitConverters .getDimensionIDConverter (),
932
932
MinecraftReflection .getMinecraftClass ("DimensionManager" )
@@ -977,7 +977,7 @@ public StructureModifier<MovingObjectPositionBlock> getMovingBlockPositions() {
977
977
* @return The Structure Modifier
978
978
*/
979
979
public StructureModifier <World > getWorldKeys () {
980
- return structureModifier .withType (
980
+ return structureModifier .withParamType (
981
981
MinecraftReflection .getMinecraftClass ("ResourceKey" ),
982
982
BukkitConverters .getWorldKeyConverter (),
983
983
MinecraftReflection .getNmsWorldClass ()
Original file line number Diff line number Diff line change @@ -477,8 +477,20 @@ private static Type[] getParamTypes(Field field) {
477
477
* @param converter - converts objects into the given type.
478
478
* @return A structure modifier for fields of this type.
479
479
*/
480
+ public <T > StructureModifier <T > withType (Class fieldType , EquivalentConverter <T > converter ) {
481
+ return withParamType (fieldType , converter );
482
+ }
483
+
484
+ /**
485
+ * Retrieves a structure modifier that only reads and writes fields of a given type.
486
+ * @param <T> Type
487
+ * @param fieldType - the type, or supertype, of every field to modify.
488
+ * @param converter - converts objects into the given type.
489
+ * @param paramTypes - field type parameters
490
+ * @return A structure modifier for fields of this type.
491
+ */
480
492
@ SuppressWarnings ("unchecked" )
481
- public <T > StructureModifier <T > withType (Class fieldType , EquivalentConverter <T > converter , Class ... paramTypes ) {
493
+ public <T > StructureModifier <T > withParamType (Class fieldType , EquivalentConverter <T > converter , Class ... paramTypes ) {
482
494
if (fieldType == null ) {
483
495
// It's not supported in this version, so return an empty modifier
484
496
return new StructureModifier <T >() {
You can’t perform that action at this time.
0 commit comments