Update FaWe #7

Zusammengeführt
Lixfel hat 467 Commits von update nach main 2024-11-28 22:27:32 +01:00 zusammengeführt
2 geänderte Dateien mit 24 neuen und 4 gelöschten Zeilen
Nur Änderungen aus Commit f44b1b48c7 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -178,9 +178,18 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
String name = property.getName();
charSequence.setSubstring(propStrStart + name.length() + 2, state.length() - 1);
int index = charSequence.length() <= 0 ? -1 : property.getIndexFor(charSequence);
if (index != -1) {
return type.withPropertyId(index);
try {
int index = charSequence.length() <= 0 ? -1 : property.getIndexFor(charSequence);
if (index != -1) {
return type.withPropertyId(index);
}
} catch (Exception e) {
throw new InputParseException(Caption.of(
"fawe.error.invalid-block-state-property",
TextComponent.of(charSequence.toString()),
TextComponent.of(name),
TextComponent.of(state)
), e);
}
}
int stateId;
@ -200,7 +209,17 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
case ',': {
charSequence.setSubstring(last, i);
if (property != null) {
int index = property.getIndexFor(charSequence);
int index;
try {
index = property.getIndexFor(charSequence);
} catch (Exception e) {
throw new InputParseException(Caption.of(
"fawe.error.invalid-block-state-property",
TextComponent.of(charSequence.toString()),
TextComponent.of(property.getName()),
TextComponent.of(state)
), e);
}
if (index == -1) {
throw SuggestInputParseException.of(charSequence.toString(), (List<Object>) property.getValues());
}

Datei anzeigen

@ -92,6 +92,7 @@
"fawe.error.parser.invalid-data": "Invalid data: {0}",
"fawe.error.unsupported": "Unsupported!",
"fawe.error.invalid-block-type": "Does not match a valid block type: {0}",
"fawe.error.invalid-block-state-property": "Cannot parse value `{0}` for property `{1}`, block state: `{2}`",
"fawe.error.nbt.forbidden": "You are not allowed to use nbt. Lacking permission: {0}",
"fawe.error.invalid-arguments": "Invalid amount of arguments. Expected: {0}",
"fawe.error.unrecognised-tag": "Unrecognised tag: {0} {1}",