diff options
| author | SHsuperCM <shsupercm@gmail.com> | 2022-02-15 12:21:57 +0200 |
|---|---|---|
| committer | SHsuperCM <shsupercm@gmail.com> | 2022-02-15 12:28:36 +0200 |
| commit | 972e6c330d03f205ab738ed28c4e47496f30e92d (patch) | |
| tree | c90360cb169cdb53b608ede798020ae2ac20d85e /src/main/java/shcm/shsupercm/fabric/citresewn/cit | |
| parent | 32caf009812501e9e9a8f9d835726f12723c4a17 (diff) | |
| download | CITResewn-972e6c330d03f205ab738ed28c4e47496f30e92d.tar.gz CITResewn-972e6c330d03f205ab738ed28c4e47496f30e92d.tar.bz2 CITResewn-972e6c330d03f205ab738ed28c4e47496f30e92d.zip | |
Ported item type (missing asset resolution)
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/cit')
3 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITContext.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITContext.java index 99cdbf0..b2dd2cd 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITContext.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITContext.java @@ -1,5 +1,6 @@ package shcm.shsupercm.fabric.citresewn.cit; +import net.minecraft.client.MinecraftClient; import net.minecraft.entity.LivingEntity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -13,7 +14,7 @@ public class CITContext { public CITContext(ItemStack stack, World world, LivingEntity entity) { this.stack = stack; - this.world = world; + this.world = world == null ? MinecraftClient.getInstance().world : world; this.entity = entity; } diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java index 33f6367..fb0f793 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java @@ -55,7 +55,7 @@ public class CITRegistry { public static CITType parseType(PropertyGroup properties) throws CITParsingException { Identifier type = new Identifier("citresewn", "item"); - PropertyValue propertiesType = properties.getLast("citresewn", "type"); + PropertyValue propertiesType = properties.getLastWithoutMetadata("citresewn", "type"); if (propertiesType != null) { String value = propertiesType.value(); if (!value.contains(":")) diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java index abbe755..b618dde 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java @@ -1,10 +1,16 @@ package shcm.shsupercm.fabric.citresewn.cit; +import shcm.shsupercm.fabric.citresewn.CITResewn; import shcm.shsupercm.fabric.citresewn.ex.CITParsingException; import shcm.shsupercm.fabric.citresewn.pack.format.PropertyGroup; +import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue; import java.util.List; public abstract class CITType { public abstract void load(List<? extends CITCondition> conditions, PropertyGroup properties) throws CITParsingException; + + protected void warn(String message, PropertyValue value, PropertyGroup properties) { + CITResewn.logWarnLoading("Warning: " + CITParsingException.descriptionOf(message, properties, value.position())); + } } |
