From 763e92a88c4f5fd266090d3ac6da38ca8758ef1c Mon Sep 17 00:00:00 2001 From: zbx1425 Date: Sun, 21 Jan 2024 22:59:54 +0800 Subject: [PATCH] Add bridge_creator_1 item model --- .../java/cn/zbx1425/mtrsteamloco/MainClient.java | 4 ++-- .../mtrsteamloco/mixin/RailActionsMixin.java | 8 ++++---- .../models/item/bridge_creator_1.json | 14 ++++++++++++++ .../models/item/bridge_creator_1_selected.json | 7 +++++++ .../textures/item/bridge_creator_1.png | Bin 0 -> 1576 bytes 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1.json create mode 100644 common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1_selected.json create mode 100644 common/src/main/resources/assets/mtrsteamloco/textures/item/bridge_creator_1.png diff --git a/common/src/main/java/cn/zbx1425/mtrsteamloco/MainClient.java b/common/src/main/java/cn/zbx1425/mtrsteamloco/MainClient.java index 3c896484..ec24c7f3 100644 --- a/common/src/main/java/cn/zbx1425/mtrsteamloco/MainClient.java +++ b/common/src/main/java/cn/zbx1425/mtrsteamloco/MainClient.java @@ -10,6 +10,7 @@ import cn.zbx1425.sowcerext.reuse.DrawScheduler; import cn.zbx1425.sowcerext.reuse.ModelManager; import mtr.RegistryClient; +import mtr.item.ItemBlockClickingBase; public class MainClient { @@ -32,9 +33,8 @@ public static void init() { RegistryClient.registerNetworkReceiver(PacketVersionCheck.PACKET_VERSION_CHECK, PacketVersionCheck::receiveVersionCheckS2C); RegistryClient.registerNetworkReceiver(PacketScreen.PACKET_SHOW_SCREEN, PacketScreen::receiveScreenS2C); - // RegistryClient.registerBlockRenderType(RenderType.cutout(), Main.BLOCK_EYE_CANDY.get()); - // RegistryClient.registerBlockRenderType(RenderType.cutout(), Main.BLOCK_STATISTIC_TURNSTILE.get()); + RegistryClient.registerItemModelPredicate("mtr:selected", Main.BRIDGE_CREATOR_1.get(), ItemBlockClickingBase.TAG_POS); } RegistryClient.registerPlayerJoinEvent(localPlayer -> { diff --git a/common/src/main/java/cn/zbx1425/mtrsteamloco/mixin/RailActionsMixin.java b/common/src/main/java/cn/zbx1425/mtrsteamloco/mixin/RailActionsMixin.java index e7d7bff4..e12377e2 100644 --- a/common/src/main/java/cn/zbx1425/mtrsteamloco/mixin/RailActionsMixin.java +++ b/common/src/main/java/cn/zbx1425/mtrsteamloco/mixin/RailActionsMixin.java @@ -21,11 +21,11 @@ @Mixin(Rail.RailActions.class) public abstract class RailActionsMixin { - @Shadow protected abstract boolean create(boolean includeMiddle, Consumer consumer); + @Shadow(remap = false) protected abstract boolean create(boolean includeMiddle, Consumer consumer); @Shadow @Final private Set blacklistedPos; - @Shadow @Final private boolean isSlab; + @Shadow(remap = false) @Final private boolean isSlab; @Shadow @Final private BlockState state; @@ -33,9 +33,9 @@ public abstract class RailActionsMixin { @Shadow private static BlockPos getHalfPos(BlockPos pos, boolean isTopHalf) { throw new AssertionError(); } - @Shadow private static boolean canPlace(Level world, BlockPos pos) { throw new AssertionError(); } + @Shadow(remap = false) private static boolean canPlace(Level world, BlockPos pos) { throw new AssertionError(); } - @Shadow @Final private int radius; + @Shadow(remap = false) @Final private int radius; /** * @author Zbx1425 diff --git a/common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1.json b/common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1.json new file mode 100644 index 00000000..bb724bc3 --- /dev/null +++ b/common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1.json @@ -0,0 +1,14 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "mtrsteamloco:item/bridge_creator_1" + }, + "overrides": [ + { + "predicate": { + "mtr:selected": 1 + }, + "model": "mtrsteamloco:item/bridge_creator_1_selected" + } + ] +} \ No newline at end of file diff --git a/common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1_selected.json b/common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1_selected.json new file mode 100644 index 00000000..e580235a --- /dev/null +++ b/common/src/main/resources/assets/mtrsteamloco/models/item/bridge_creator_1_selected.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "mtr:item/rail_action_selected", + "layer1": "mtrsteamloco:item/bridge_creator_1" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/mtrsteamloco/textures/item/bridge_creator_1.png b/common/src/main/resources/assets/mtrsteamloco/textures/item/bridge_creator_1.png new file mode 100644 index 0000000000000000000000000000000000000000..1445e60830f732b6d221943000bfbadabe6ae8b9 GIT binary patch literal 1576 zcmV+@2G{wCP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGdumAuFumO%E)inSB1-(f`K~#8N?VD?C z6jc<*&z*g=Q0dePF{Ts+1&TZbB1*((BF0xjLUh3(C=f!TATinxgou6=Bhoe^qUE8D zrU7D%iU}rwRTGVrXQ7R>h$3x~Lb_#lOFOeW*Z-Zl+wE?*Y)isU)S>BdW3a0&6e2TsDR#*3F;0n$*I# zg#kzJijpxG`XmD4i*f@|XQVL3qMV0kb?oUh_q2)r1F*B@ATi}p;>HJOXBl2@p`764H!hS+jxqYh+JmUuL+jSBX4~7;z#ninU)T)dpG^zydfD7y2$Hr0 z*r#V_!}&*u!40MiqnzQ4ZEYG0=L4oqQNG{{OM-BIz1&5t^j}-@ni2o$F zvz4SK$SUe?CUxX7I6H=7dJ}nk@)S*f4z*t_Z6-+b@8obu(^CSh^6v-9pZl{piE1xUcjqA*uGS+1{L=O& zUsk*k>Hj-svxEtIep9xF=GEmte}E~fhyaX$O(*Tr#L~!=TXjainmd57mlnOXiv8B11{&dP z--g-`IOC-V*YBL&@zoV+vW>(=Go=uJFQRvU&0n3=Mp{=GmwFVo7U;cv#gwyf{&CEk zA%8+nRp!&d5Iryx&SM*D8le1x{_y=!a9)tefU1i*SZM{_U*}6lo6QT4!#T(bg^Z}q zU%D;2rrgM7NC~lqoS0F*hIJn+T;TT_W|~_E$_&$Sz!|~ax}4iezwZT{!hq}c|BB-S zkd+chysx@GZsaw(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