This commit is contained in:
gnembon committed 2022-10-20 14:33:36 +02:00
1 parent ffa4fcf2a6
commit 9f776167e3
23 files changed
+179 -136

No files matched your search

@@ -38,6 +38,7 @@ import carpet.script.value.Value;
import carpet.script.value.ValueConversions;
import carpet.utils.Messenger;
import com.google.common.collect.Lists;
import com.mojang.bridge.game.PackType;
import net.minecraft.SharedConstants;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.BlockPos;
@@ -1050,7 +1051,7 @@ public class Auxiliary {
Path zipRoot = zipfs.getPath("/");
zipValueToJson(zipRoot.resolve("pack.mcmeta"), MapValue.wrap(
Map.of(StringValue.of("pack"), MapValue.wrap(Map.of(
StringValue.of("pack_format"), new NumericValue(SharedConstants.getCurrentVersion().getPackVersion()),
StringValue.of("pack_format"), new NumericValue(SharedConstants.getCurrentVersion().getPackVersion(PackType.DATA)),
StringValue.of("description"), StringValue.of(name),
StringValue.of("source"), StringValue.of("scarpet")
)))
@@ -59,11 +59,10 @@ public class Inventories {
expression.addUnaryFunction("stack_limit", v ->
new NumericValue(NBTSerializableValue.parseItem(v.getString()).getItem().getMaxStackSize()));
expression.addUnaryFunction("item_category", v ->
{
ItemInput item = NBTSerializableValue.parseItem(v.getString());
CreativeModeTab ig = item.getItem().getItemCategory();
return (ig==null)?Value.NULL:new StringValue(ig.getRecipeFolderName());
expression.addContextFunction("item_category", -1, (c, t, lv) -> {
CarpetContext cc = (CarpetContext)c;
cc.host.issueDeprecation("item_category in 1.19.3+");
return Value.NULL;
});
expression.addContextFunction("item_list", -1, (c, t, lv) ->