mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-02-22 07:22:06 +01:00
Don't take fieldIndex into account when checking for nonexistent fields
This commit is contained in:
parent
704fe60bd1
commit
bfb0683b1f
@ -193,7 +193,7 @@ public class StructureModifier<TField> {
|
||||
if (fieldIndex < 0)
|
||||
throw new FieldAccessException(String.format("Field index (%s) cannot be negative.", fieldIndex));
|
||||
|
||||
if (fieldIndex == 0 && data.size() == 0)
|
||||
if (data.size() == 0)
|
||||
throw new FieldAccessException(String.format("No field with type %s exists in class %s.", targetType.getName(),
|
||||
target.getClass().getName()));
|
||||
|
||||
@ -294,8 +294,9 @@ public class StructureModifier<TField> {
|
||||
if (fieldIndex < 0)
|
||||
throw new FieldAccessException(String.format("Field index (%s) cannot be negative.", fieldIndex));
|
||||
|
||||
if (fieldIndex == 0 && data.size() == 0)
|
||||
throw new FieldAccessException(String.format("No field with type %s exists in class %s.", targetType.getName(), target.getClass().getName()));
|
||||
if (data.size() == 0)
|
||||
throw new FieldAccessException(String.format("No field with type %s exists in class %s.", targetType.getName(),
|
||||
target.getClass().getName()));
|
||||
|
||||
if (fieldIndex >= data.size())
|
||||
throw new FieldAccessException(String.format("Field index out of bounds. (Index: %s, Size: %s)", fieldIndex, data.size()));
|
||||
|
Loading…
Reference in New Issue
Block a user