Fix nonexistent field messages
Dieser Commit ist enthalten in:
Ursprung
bfb0683b1f
Commit
391970b185
@ -2,16 +2,16 @@
|
||||
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
|
||||
* Copyright (C) 2012 Kristian S. Stangeland
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with this program;
|
||||
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* You should have received a copy of the GNU General Public License along with this program;
|
||||
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*/
|
||||
|
||||
@ -48,4 +48,10 @@ public class FieldAccessException extends RuntimeException {
|
||||
public static FieldAccessException fromFormat(String message, Object... params) {
|
||||
return new FieldAccessException(String.format(message, params));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String message = getMessage();
|
||||
return "FieldAccessException" + (message != null ? ": " + message : "");
|
||||
}
|
||||
}
|
||||
|
@ -194,8 +194,8 @@ public class StructureModifier<TField> {
|
||||
throw new FieldAccessException(String.format("Field index (%s) cannot be negative.", fieldIndex));
|
||||
|
||||
if (data.size() == 0)
|
||||
throw new FieldAccessException(String.format("No field with type %s exists in class %s.", targetType.getName(),
|
||||
target.getClass().getName()));
|
||||
throw new FieldAccessException(String.format("No field with type %s exists in class %s.", fieldType.getName(),
|
||||
target.getClass().getSimpleName()));
|
||||
|
||||
if (fieldIndex >= data.size())
|
||||
throw new FieldAccessException(String.format("Field index out of bounds. (Index: %s, Size: %s)", fieldIndex, data.size()));
|
||||
@ -295,8 +295,8 @@ public class StructureModifier<TField> {
|
||||
throw new FieldAccessException(String.format("Field index (%s) cannot be negative.", fieldIndex));
|
||||
|
||||
if (data.size() == 0)
|
||||
throw new FieldAccessException(String.format("No field with type %s exists in class %s.", targetType.getName(),
|
||||
target.getClass().getName()));
|
||||
throw new FieldAccessException(String.format("No field with type %s exists in class %s.", fieldType.getName(),
|
||||
target.getClass().getSimpleName()));
|
||||
|
||||
if (fieldIndex >= data.size())
|
||||
throw new FieldAccessException(String.format("Field index out of bounds. (Index: %s, Size: %s)", fieldIndex, data.size()));
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren