Skip to content

Commit

Permalink
Fix NBT.from_tag_list not working on Any lists, Closes #1315
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Nov 27, 2023
1 parent b3375b1 commit 06ccb96
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ public static CompoundTag minus(CompoundTag a, CompoundTag b) {
public static ListTag getListNbtTag(ValueTypeList.ValueList<?, ?> value, Component operatorName) {
ListTag list = new ListTag();
for (IValue valueNbt : value.getRawValue()) {
if (value.getRawValue().getValueType() != ValueTypes.NBT) {
if (!(value.getRawValue().getValueType() == ValueTypes.NBT ||
(value.getRawValue().getValueType() == ValueTypes.CATEGORY_ANY && valueNbt.getType() == ValueTypes.NBT))) {
MutableComponent error = new TranslatableComponent(
L10NValues.OPERATOR_ERROR_WRONGTYPE,
operatorName,
new TranslatableComponent(value.getType().getTranslationKey()),
new TranslatableComponent(value.getRawValue().getValueType().getTranslationKey()),
1,
new TranslatableComponent(ValueTypes.NBT.getTranslationKey()));
Helpers.sneakyThrow(new EvaluationException(error));
Expand Down

0 comments on commit 06ccb96

Please sign in to comment.