Skip to content

Commit

Permalink
fix model
Browse files Browse the repository at this point in the history
  • Loading branch information
PTOM76 committed Sep 19, 2024
1 parent ed75804 commit 444a98f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
16 changes: 16 additions & 0 deletions src/main/java/net/pitan76/itemalchemy/block/EMCCable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/assets/itemalchemy/blockstates/emc_cable.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 444a98f

Please sign in to comment.