From 444a98ffcef0cbb7498c3da39c0024dabf499bf1 Mon Sep 17 00:00:00 2001 From: PTOM76 <58260965+PTOM76@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:38:32 +0900 Subject: [PATCH] fix model --- .../pitan76/itemalchemy/block/EMCCable.java | 16 ++++++++++++++++ .../itemalchemy/blockstates/emc_cable.json | 18 +++++++++--------- ...mc_cable_plus.json => emc_cable_cross.json} | 0 .../{emc_cable_t.json => emc_cable_tchar.json} | 0 4 files changed, 25 insertions(+), 9 deletions(-) rename src/main/resources/assets/itemalchemy/models/block/{emc_cable_plus.json => emc_cable_cross.json} (100%) rename src/main/resources/assets/itemalchemy/models/block/{emc_cable_t.json => emc_cable_tchar.json} (100%) diff --git a/src/main/java/net/pitan76/itemalchemy/block/EMCCable.java b/src/main/java/net/pitan76/itemalchemy/block/EMCCable.java index 4ff4f07..7b6f936 100644 --- a/src/main/java/net/pitan76/itemalchemy/block/EMCCable.java +++ b/src/main/java/net/pitan76/itemalchemy/block/EMCCable.java @@ -146,10 +146,14 @@ public BlockState getStateForNeighborUpdate(StateForNeighborUpdateArgs args) { if (both_ns && both_ew || both_ns && both_ud || both_ew && both_ud) { return state.with(CROSS, true); + } else { + state = state.with(CROSS, false); } if (both_ns && east_only || both_ns && west_only || both_ew && north_only || both_ew && south_only || both_ud && east_only || both_ud && west_only) { return state.with(T_CHAR, true); + } else { + state = state.with(T_CHAR, false); } if (both_ns || both_ew || both_ud) { @@ -217,6 +221,18 @@ public VoxelShape getOutlineShape(OutlineShapeEvent e) { } else if (direction == Direction.WEST) { return WEST_CONNER_CONNECT; } + } else if (e.getState().get(T_CHAR)) { + if (direction == Direction.NORTH) { + return NORTH_CONNER_CONNECT; + } else if (direction == Direction.SOUTH) { + return SOUTH_CONNER_CONNECT; + } else if (direction == Direction.EAST) { + return EAST_CONNER_CONNECT; + } else if (direction == Direction.WEST) { + return WEST_CONNER_CONNECT; + } + } else if (e.getState().get(CROSS)) { + return VoxelShapeUtil.union(NS_BOTH_CONNECT, EW_BOTH_CONNECT); } return NONE; } diff --git a/src/main/resources/assets/itemalchemy/blockstates/emc_cable.json b/src/main/resources/assets/itemalchemy/blockstates/emc_cable.json index ec5cc02..c56b6d4 100644 --- a/src/main/resources/assets/itemalchemy/blockstates/emc_cable.json +++ b/src/main/resources/assets/itemalchemy/blockstates/emc_cable.json @@ -1,6 +1,6 @@ { "variants": { - "side1=false,side2=false,conner=false": { + "side1=false,side2=false,conner=false,cross=false,tchar=false": { "model": "itemalchemy:block/emc_cable" }, "side1=true,side2=false,conner=false,facing=north": { @@ -39,33 +39,33 @@ "model": "itemalchemy:block/emc_cable_conner", "y": 270 }, - "cross=true,facing=north": { + "side1=false,side2=false,conner=false,tchar=false,cross=true,facing=north": { "model": "itemalchemy:block/emc_cable_cross" }, - "cross=true,facing=east": { + "side1=false,side2=false,conner=false,tchar=false,cross=true,facing=east": { "model": "itemalchemy:block/emc_cable_cross", "y": 90 }, - "cross=true,facing=south": { + "side1=false,side2=false,conner=false,tchar=false,cross=true,facing=south": { "model": "itemalchemy:block/emc_cable_cross", "y": 180 }, - "cross=true,facing=west": { + "side1=false,side2=false,conner=false,tchar=false,cross=true,facing=west": { "model": "itemalchemy:block/emc_cable_cross", "y": 270 }, - "tchar=true,facing=north": { + "side1=false,side2=false,conner=false,tchar=true,cross=false,facing=north": { "model": "itemalchemy:block/emc_cable_tchar" }, - "tchar=true,facing=east": { + "side1=false,side2=false,conner=false,tchar=true,cross=false,facing=east": { "model": "itemalchemy:block/emc_cable_tchar", "y": 90 }, - "tchar=true,facing=south": { + "side1=false,side2=false,conner=false,tchar=true,cross=false,facing=south": { "model": "itemalchemy:block/emc_cable_tchar", "y": 180 }, - "tchar=true,facing=west": { + "side1=false,side2=false,conner=false,tchar=true,cross=false,facing=west": { "model": "itemalchemy:block/emc_cable_tchar", "y": 270 } diff --git a/src/main/resources/assets/itemalchemy/models/block/emc_cable_plus.json b/src/main/resources/assets/itemalchemy/models/block/emc_cable_cross.json similarity index 100% rename from src/main/resources/assets/itemalchemy/models/block/emc_cable_plus.json rename to src/main/resources/assets/itemalchemy/models/block/emc_cable_cross.json diff --git a/src/main/resources/assets/itemalchemy/models/block/emc_cable_t.json b/src/main/resources/assets/itemalchemy/models/block/emc_cable_tchar.json similarity index 100% rename from src/main/resources/assets/itemalchemy/models/block/emc_cable_t.json rename to src/main/resources/assets/itemalchemy/models/block/emc_cable_tchar.json