fixed named results, and added loaded_status

This commit is contained in:
gnembon committed 2019-10-29 00:46:44 -03:00
1 parent 9315bc09dd
commit 6c2ddd68db
5 files changed
+35 -8

No files matched your search

@@ -4,10 +4,15 @@ import carpet.script.exception.InternalExpressionException;
import net.minecraft.item.ItemStack;
import net.minecraft.util.registry.Registry;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import static carpet.script.value.NBTSerializableValue.nameFromRegistryId;
import static java.lang.Math.abs;
public class ListValue extends AbstractListValue implements ContainerValueInterface
@@ -49,7 +54,7 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
if (itemstack == null || itemstack.isEmpty())
return Value.NULL;
return ListValue.of(
new StringValue(Registry.ITEM.getId(itemstack.getItem()).getPath()),
new StringValue(nameFromRegistryId(Registry.ITEM.getId(itemstack.getItem()))),
new NumericValue(itemstack.getCount()),
NBTSerializableValue.fromStack(itemstack)
);