Skip to content

Commit

Permalink
More detailed error messages in NBTTranslator#setInternal
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeregorix committed Feb 15, 2025
1 parent 59728b9 commit ed1ea15
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ private static DataContainer getViewFromCompound(CompoundTag compound) {

@SuppressWarnings({"unchecked", "rawtypes"})
private static void setInternal(Tag base, byte type, DataView view, String key) {
Objects.requireNonNull(base);
Objects.requireNonNull(view);
Objects.requireNonNull(key);
Preconditions.checkArgument(!key.isEmpty());
Preconditions.checkArgument(type > Constants.NBT.TAG_END && type <= Constants.NBT.TAG_LONG_ARRAY);
Objects.requireNonNull(base, "base");
Objects.requireNonNull(view, "view");
Objects.requireNonNull(key, "key");
Preconditions.checkArgument(!key.isEmpty(), "key is empty");
switch (type) {
case Constants.NBT.TAG_BYTE:
if (key.contains(NBTTranslator.BOOLEAN_IDENTIFIER)) {
Expand Down

0 comments on commit ed1ea15

Please sign in to comment.