diff options
author | SHsuperCM <shsupercm@gmail.com> | 2022-12-20 17:11:42 +0200 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2022-12-20 18:31:12 +0200 |
commit | 81212be85afae09bc578980e0676e5ba31ac9ece (patch) | |
tree | 61865355876055ef98ad3c05eed0fe4da83a0bc6 | |
parent | a75d755df8e0c551cd40701017018719667ff6eb (diff) | |
download | CITResewn-81212be85afae09bc578980e0676e5ba31ac9ece.tar.gz CITResewn-81212be85afae09bc578980e0676e5ba31ac9ece.tar.bz2 CITResewn-81212be85afae09bc578980e0676e5ba31ac9ece.zip |
1.19.3 Bandage
11 files changed, 40 insertions, 39 deletions
diff --git a/build.gradle b/build.gradle index 72c85f8..510e698 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ allprojects { mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - fletchingTable.fungible project.fungible + //fletchingTable.fungible project.fungible modCompileOnly fabricApi.module("fabric-api-base", "${project.fabric_api}") modCompileOnly fabricApi.module("fabric-resource-loader-v0", "${project.fabric_api}") diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionEnchantments.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionEnchantments.java index 079c288..0dfc6f0 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionEnchantments.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionEnchantments.java @@ -1,8 +1,8 @@ package shcm.shsupercm.fabric.citresewn.defaults.cit.conditions; import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import shcm.shsupercm.fabric.citresewn.api.CITConditionContainer; import shcm.shsupercm.fabric.citresewn.cit.CITCondition; import shcm.shsupercm.fabric.citresewn.cit.CITContext; @@ -42,7 +42,7 @@ public class ConditionEnchantments extends ListCondition<ConditionEnchantments.E public void load(PropertyValue value, PropertyGroup properties) throws CITParsingException { super.load(value, properties); - if (!Registry.ENCHANTMENT.containsId(this.value)) + if (!Registries.ENCHANTMENT.containsId(this.value)) warn(this.value + " is not in the enchantment registry", value, properties); } diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionItems.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionItems.java index 08986fc..cb82678 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionItems.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionItems.java @@ -2,8 +2,8 @@ package shcm.shsupercm.fabric.citresewn.defaults.cit.conditions; import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint; import net.minecraft.item.Item; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import shcm.shsupercm.fabric.citresewn.api.CITConditionContainer; import shcm.shsupercm.fabric.citresewn.cit.CITContext; import shcm.shsupercm.fabric.citresewn.cit.builtin.conditions.IdentifierCondition; @@ -59,8 +59,8 @@ public class ConditionItems extends ListCondition<ConditionItems.ItemCondition> public void load(PropertyValue value, PropertyGroup properties) throws CITParsingException { super.load(value, properties); - if (Registry.ITEM.containsId(this.value)) - this.item = Registry.ITEM.get(this.value); + if (Registries.ITEM.containsId(this.value)) + this.item = Registries.ITEM.get(this.value); else { this.item = null; warn(this.value + " is not in the item registry", value, properties); diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeArmor.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeArmor.java index ae757a4..b1abbd4 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeArmor.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeArmor.java @@ -6,9 +6,9 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.item.ArmorItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; import net.minecraft.resource.ResourceManager; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import shcm.shsupercm.fabric.citresewn.api.CITTypeContainer; import shcm.shsupercm.fabric.citresewn.cit.*; import shcm.shsupercm.fabric.citresewn.defaults.cit.conditions.ConditionItems; @@ -45,9 +45,9 @@ public class TypeArmor extends CITType { if (!itemsConditionPresent) try { Identifier propertiesName = new Identifier(properties.stripName()); - if (!Registry.ITEM.containsId(propertiesName)) + if (!Registries.ITEM.containsId(propertiesName)) throw new Exception(); - Item item = Registry.ITEM.get(propertiesName); + Item item = Registries.ITEM.get(propertiesName); if (!(item instanceof ArmorItem)) throw new Exception(); conditions.add(new ConditionItems(item)); diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java index 692d55b..8b49e6a 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java @@ -241,41 +241,41 @@ public class TypeEnchantment extends CITType { public enum GlintRenderLayer { ARMOR_GLINT("armor_glint", 8f, layer -> layer - .shader(RenderPhaseAccessor.ARMOR_GLINT_SHADER()) + .program(RenderPhaseAccessor.ARMOR_GLINT_SHADER()) .writeMaskState(RenderPhaseAccessor.COLOR_MASK()) .cull(RenderPhaseAccessor.DISABLE_CULLING()) .depthTest(RenderPhaseAccessor.EQUAL_DEPTH_TEST()) .layering(RenderPhaseAccessor.VIEW_OFFSET_Z_LAYERING())), ARMOR_ENTITY_GLINT("armor_entity_glint", 0.16f, layer -> layer - .shader(RenderPhaseAccessor.ARMOR_ENTITY_GLINT_SHADER()) + .program(RenderPhaseAccessor.ARMOR_ENTITY_GLINT_SHADER()) .writeMaskState(RenderPhaseAccessor.COLOR_MASK()) .cull(RenderPhaseAccessor.DISABLE_CULLING()) .depthTest(RenderPhaseAccessor.EQUAL_DEPTH_TEST()) .layering(RenderPhaseAccessor.VIEW_OFFSET_Z_LAYERING())), GLINT_TRANSLUCENT("glint_translucent", 8f, layer -> layer - .shader(RenderPhaseAccessor.TRANSLUCENT_GLINT_SHADER()) + .program(RenderPhaseAccessor.TRANSLUCENT_GLINT_SHADER()) .writeMaskState(RenderPhaseAccessor.COLOR_MASK()) .cull(RenderPhaseAccessor.DISABLE_CULLING()) .depthTest(RenderPhaseAccessor.EQUAL_DEPTH_TEST()) .target(RenderPhaseAccessor.ITEM_TARGET())), GLINT("glint", 8f, layer -> layer - .shader(RenderPhaseAccessor.GLINT_SHADER()) + .program(RenderPhaseAccessor.GLINT_SHADER()) .writeMaskState(RenderPhaseAccessor.COLOR_MASK()) .cull(RenderPhaseAccessor.DISABLE_CULLING()) .depthTest(RenderPhaseAccessor.EQUAL_DEPTH_TEST())), DIRECT_GLINT("glint_direct", 8f, layer -> layer - .shader(RenderPhaseAccessor.DIRECT_GLINT_SHADER()) + .program(RenderPhaseAccessor.DIRECT_GLINT_SHADER()) .writeMaskState(RenderPhaseAccessor.COLOR_MASK()) .cull(RenderPhaseAccessor.DISABLE_CULLING()) .depthTest(RenderPhaseAccessor.EQUAL_DEPTH_TEST())), ENTITY_GLINT("entity_glint", 0.16f, layer -> layer - .shader(RenderPhaseAccessor.ENTITY_GLINT_SHADER()) + .program(RenderPhaseAccessor.ENTITY_GLINT_SHADER()) .writeMaskState(RenderPhaseAccessor.COLOR_MASK()) .cull(RenderPhaseAccessor.DISABLE_CULLING()) .depthTest(RenderPhaseAccessor.EQUAL_DEPTH_TEST()) .target(RenderPhaseAccessor.ITEM_TARGET())), DIRECT_ENTITY_GLINT("entity_glint_direct", 0.16f, layer -> layer - .shader(RenderPhaseAccessor.DIRECT_ENTITY_GLINT_SHADER()) + .program(RenderPhaseAccessor.DIRECT_ENTITY_GLINT_SHADER()) .writeMaskState(RenderPhaseAccessor.COLOR_MASK()) .cull(RenderPhaseAccessor.DISABLE_CULLING()) .depthTest(RenderPhaseAccessor.EQUAL_DEPTH_TEST())); diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java index 2eed0f7..4608a11 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java @@ -15,9 +15,9 @@ import net.minecraft.client.util.SpriteIdentifier; import net.minecraft.client.world.ClientWorld; import net.minecraft.item.Item; import net.minecraft.item.Items; +import net.minecraft.registry.Registries; import net.minecraft.resource.ResourceManager; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import org.apache.commons.io.IOUtils; import shcm.shsupercm.fabric.citresewn.CITResewn; import shcm.shsupercm.fabric.citresewn.api.CITTypeContainer; @@ -75,9 +75,9 @@ public class TypeItem extends CITType { if (this.items.size() == 0) try { Identifier propertiesName = new Identifier(properties.stripName()); - if (!Registry.ITEM.containsId(propertiesName)) + if (!Registries.ITEM.containsId(propertiesName)) throw new Exception(); - Item item = Registry.ITEM.get(propertiesName); + Item item = Registries.ITEM.get(propertiesName); conditions.add(new ConditionItems(item)); this.items.add(item); } catch (Exception ignored) { @@ -185,7 +185,7 @@ public class TypeItem extends CITType { if (!assetIdentifiers.isEmpty()) { // contains sub models LinkedHashMap<Identifier, List<ModelOverride.Condition>> overrideConditions = new LinkedHashMap<>(); for (Item item : this.items) { - Identifier itemIdentifier = Registry.ITEM.getId(item); + Identifier itemIdentifier = Registries.ITEM.getId(item); overrideConditions.put(new Identifier(itemIdentifier.getNamespace(), "item/" + itemIdentifier.getPath()), Collections.emptyList()); Identifier itemModelIdentifier = new Identifier(itemIdentifier.getNamespace(), "models/item/" + itemIdentifier.getPath() + ".json"); @@ -269,7 +269,7 @@ public class TypeItem extends CITType { if (!assetIdentifiers.isEmpty()) { // contains sub models LinkedHashMap<Identifier, List<ModelOverride.Condition>> overrideConditions = new LinkedHashMap<>(); for (Item item : this.items) { - Identifier itemIdentifier = Registry.ITEM.getId(item); + Identifier itemIdentifier = Registries.ITEM.getId(item); overrideConditions.put(new Identifier(itemIdentifier.getNamespace(), "item/" + itemIdentifier.getPath()), Collections.emptyList()); Identifier itemModelIdentifier = new Identifier(itemIdentifier.getNamespace(), "models/item/" + itemIdentifier.getPath() + ".json"); @@ -424,7 +424,7 @@ public class TypeItem extends CITType { } private JsonUnbakedModel getModelForFirstItemType(ResourceManager resourceManager) { - Identifier firstItemIdentifier = Registry.ITEM.getId(this.items.iterator().next()), firstItemModelIdentifier = new Identifier(firstItemIdentifier.getNamespace(), "models/item/" + firstItemIdentifier.getPath() + ".json"); + Identifier firstItemIdentifier = Registries.ITEM.getId(this.items.iterator().next()), firstItemModelIdentifier = new Identifier(firstItemIdentifier.getNamespace(), "models/item/" + firstItemIdentifier.getPath() + ".json"); try (InputStream is = resourceManager.getResource(firstItemModelIdentifier).orElseThrow().getInputStream()) { JsonUnbakedModel json = JsonUnbakedModel.deserialize(IOUtils.toString(is, StandardCharsets.UTF_8)); diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/ItemRendererMixin.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/ItemRendererMixin.java index b4bd37d..1d27326 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/ItemRendererMixin.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/ItemRendererMixin.java @@ -54,7 +54,7 @@ public class ItemRendererMixin { return; VertexConsumer vertexConsumer = TypeEnchantment.GlintRenderLayer.GLINT.tryApply(null, layer, provider); if (vertexConsumer != null) - cir.setReturnValue(VertexConsumers.union(new OverlayVertexConsumer(vertexConsumer, entry.getPositionMatrix(), entry.getNormalMatrix()), cir.getReturnValue())); + cir.setReturnValue(VertexConsumers.union(new OverlayVertexConsumer(vertexConsumer, entry.getPositionMatrix(), entry.getNormalMatrix(), 1f), cir.getReturnValue())); } @Inject(method = "getDirectCompassGlintConsumer", cancellable = true, at = @At("RETURN")) @@ -63,7 +63,7 @@ public class ItemRendererMixin { return; VertexConsumer vertexConsumer = TypeEnchantment.GlintRenderLayer.DIRECT_GLINT.tryApply(null, layer, provider); if (vertexConsumer != null) - cir.setReturnValue(VertexConsumers.union(new OverlayVertexConsumer(vertexConsumer, entry.getPositionMatrix(), entry.getNormalMatrix()), cir.getReturnValue())); + cir.setReturnValue(VertexConsumers.union(new OverlayVertexConsumer(vertexConsumer, entry.getPositionMatrix(), entry.getNormalMatrix(), 1f), cir.getReturnValue())); } @Inject(method = "getItemGlintConsumer", cancellable = true, at = @At("RETURN")) diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/RenderPhaseAccessor.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/RenderPhaseAccessor.java index b2a59b4..216248d 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/RenderPhaseAccessor.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/enchantment/RenderPhaseAccessor.java @@ -6,13 +6,13 @@ import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(RenderPhase.class) public interface RenderPhaseAccessor { - @Accessor("ARMOR_GLINT_SHADER") static RenderPhase.Shader ARMOR_GLINT_SHADER() { throw new RuntimeException(); } - @Accessor("ARMOR_ENTITY_GLINT_SHADER") static RenderPhase.Shader ARMOR_ENTITY_GLINT_SHADER() { throw new RuntimeException(); } - @Accessor("TRANSLUCENT_GLINT_SHADER") static RenderPhase.Shader TRANSLUCENT_GLINT_SHADER() { throw new RuntimeException(); } - @Accessor("GLINT_SHADER") static RenderPhase.Shader GLINT_SHADER() { throw new RuntimeException(); } - @Accessor("DIRECT_GLINT_SHADER") static RenderPhase.Shader DIRECT_GLINT_SHADER() { throw new RuntimeException(); } - @Accessor("ENTITY_GLINT_SHADER") static RenderPhase.Shader ENTITY_GLINT_SHADER() { throw new RuntimeException(); } - @Accessor("DIRECT_ENTITY_GLINT_SHADER") static RenderPhase.Shader DIRECT_ENTITY_GLINT_SHADER() { throw new RuntimeException(); } + @Accessor("ARMOR_GLINT_PROGRAM") static RenderPhase.ShaderProgram ARMOR_GLINT_SHADER() { throw new RuntimeException(); } + @Accessor("ARMOR_ENTITY_GLINT_PROGRAM") static RenderPhase.ShaderProgram ARMOR_ENTITY_GLINT_SHADER() { throw new RuntimeException(); } + @Accessor("TRANSLUCENT_GLINT_PROGRAM") static RenderPhase.ShaderProgram TRANSLUCENT_GLINT_SHADER() { throw new RuntimeException(); } + @Accessor("GLINT_PROGRAM") static RenderPhase.ShaderProgram GLINT_SHADER() { throw new RuntimeException(); } + @Accessor("DIRECT_GLINT_PROGRAM") static RenderPhase.ShaderProgram DIRECT_GLINT_SHADER() { throw new RuntimeException(); } + @Accessor("ENTITY_GLINT_PROGRAM") static RenderPhase.ShaderProgram ENTITY_GLINT_SHADER() { throw new RuntimeException(); } + @Accessor("DIRECT_ENTITY_GLINT_PROGRAM") static RenderPhase.ShaderProgram DIRECT_ENTITY_GLINT_SHADER() { throw new RuntimeException(); } @Accessor("DISABLE_CULLING") static RenderPhase.Cull DISABLE_CULLING() { throw new RuntimeException(); } @Accessor("EQUAL_DEPTH_TEST") static RenderPhase.DepthTest EQUAL_DEPTH_TEST() { throw new RuntimeException(); } @Accessor("COLOR_MASK") static RenderPhase.WriteMaskState COLOR_MASK() { throw new RuntimeException(); } diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java index 4385f96..9c4d1dd 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java @@ -1,5 +1,6 @@ package shcm.shsupercm.fabric.citresewn.defaults.mixin.types.item; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.color.block.BlockColors; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.ModelLoader; @@ -45,7 +46,7 @@ public class ModelLoaderMixin { info("Loading item CIT models..."); for (CIT<TypeItem> cit : CONTAINER.loaded) try { - //cit.type.loadUnbakedAssets(resourceManager); + cit.type.loadUnbakedAssets(MinecraftClient.getInstance().getResourceManager()); for (JsonUnbakedModel unbakedModel : cit.type.unbakedAssets.values()) { ResewnItemModelIdentifier id = new ResewnItemModelIdentifier(unbakedModel.id); diff --git a/defaults/src/main/resources/citresewn-defaults.accesswidener b/defaults/src/main/resources/citresewn-defaults.accesswidener index 739fc5e..fbf3f4d 100644 --- a/defaults/src/main/resources/citresewn-defaults.accesswidener +++ b/defaults/src/main/resources/citresewn-defaults.accesswidener @@ -17,7 +17,7 @@ mutable field net/minecraft/client/render/model/json/ModelOverrideList co # TypeEnchantment accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;ILnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase; -accessible class net/minecraft/client/render/RenderPhase$Shader +accessible class net/minecraft/client/render/RenderPhase$ShaderProgram accessible class net/minecraft/client/render/RenderPhase$Texturing accessible class net/minecraft/client/render/RenderPhase$Transparency accessible class net/minecraft/client/render/RenderPhase$Texture diff --git a/gradle.properties b/gradle.properties index 9a7be84..e397383 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=22w43a +minecraft_version=1.19.3 publish_minecraft_versions=1.19.3 -yarn_mappings=22w43a+build.3 -loader_version=0.14.10 +yarn_mappings=1.19.3+build.4 +loader_version=0.14.12 fungible=1.2+mc1.19.2 -fabric_api=0.65.1+1.19.3 -modmenu=4.0.6 -cloth=8.0.75 +fabric_api=0.69.1+1.19.3 +modmenu=5.0.2 +cloth=9.0.94 # Mod Properties mod_version=1.1.2 |