1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-06-09 01:54:11 +00:00

Replace "cable variant" with a block model

- Replace BlockCableCableVariant with a boolean, removing any custom
   logic around it.
 - Replace our previous cable Forge-blockstate with a vanilla one, which
   handles cable connections in the model logic.
This commit is contained in:
SquidDev 2018-12-27 10:21:57 +00:00
parent 364d31465e
commit f61f7df2d8
4 changed files with 216 additions and 279 deletions

View File

@ -43,7 +43,7 @@ public class BlockCable extends BlockPeripheralBase
public static class Properties public static class Properties
{ {
public static final PropertyEnum<BlockCableModemVariant> MODEM = PropertyEnum.create( "modem", BlockCableModemVariant.class ); public static final PropertyEnum<BlockCableModemVariant> MODEM = PropertyEnum.create( "modem", BlockCableModemVariant.class );
public static final PropertyEnum<BlockCableCableVariant> CABLE = PropertyEnum.create( "cable", BlockCableCableVariant.class ); public static final PropertyBool CABLE = PropertyBool.create( "cable" );
public static final PropertyBool NORTH = PropertyBool.create( "north" ); public static final PropertyBool NORTH = PropertyBool.create( "north" );
public static final PropertyBool SOUTH = PropertyBool.create( "south" ); public static final PropertyBool SOUTH = PropertyBool.create( "south" );
public static final PropertyBool EAST = PropertyBool.create( "east" ); public static final PropertyBool EAST = PropertyBool.create( "east" );
@ -61,7 +61,7 @@ public class BlockCable extends BlockPeripheralBase
setCreativeTab( ComputerCraft.mainCreativeTab ); setCreativeTab( ComputerCraft.mainCreativeTab );
setDefaultState( this.blockState.getBaseState() setDefaultState( this.blockState.getBaseState()
.withProperty( Properties.MODEM, BlockCableModemVariant.None ) .withProperty( Properties.MODEM, BlockCableModemVariant.None )
.withProperty( Properties.CABLE, BlockCableCableVariant.NONE ) .withProperty( Properties.CABLE, false )
.withProperty( Properties.NORTH, false ) .withProperty( Properties.NORTH, false )
.withProperty( Properties.SOUTH, false ) .withProperty( Properties.SOUTH, false )
.withProperty( Properties.EAST, false ) .withProperty( Properties.EAST, false )
@ -95,17 +95,17 @@ public class BlockCable extends BlockPeripheralBase
IBlockState state = getDefaultState(); IBlockState state = getDefaultState();
if( meta < 6 ) if( meta < 6 )
{ {
state = state.withProperty( Properties.CABLE, BlockCableCableVariant.NONE ); state = state.withProperty( Properties.CABLE, false );
state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.byIndex( meta ) ) ); state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.byIndex( meta ) ) );
} }
else if( meta < 12 ) else if( meta < 12 )
{ {
state = state.withProperty( Properties.CABLE, BlockCableCableVariant.ANY ); state = state.withProperty( Properties.CABLE, true );
state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.byIndex( meta - 6 ) ) ); state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.byIndex( meta - 6 ) ) );
} }
else if( meta == 13 ) else if( meta == 13 )
{ {
state = state.withProperty( Properties.CABLE, BlockCableCableVariant.ANY ); state = state.withProperty( Properties.CABLE, true );
state = state.withProperty( Properties.MODEM, BlockCableModemVariant.None ); state = state.withProperty( Properties.MODEM, BlockCableModemVariant.None );
} }
return state; return state;
@ -115,7 +115,7 @@ public class BlockCable extends BlockPeripheralBase
public int getMetaFromState( IBlockState state ) public int getMetaFromState( IBlockState state )
{ {
int meta = 0; int meta = 0;
boolean cable = state.getValue( Properties.CABLE ) != BlockCableCableVariant.NONE; boolean cable = state.getValue( Properties.CABLE );
BlockCableModemVariant modem = state.getValue( Properties.MODEM ); BlockCableModemVariant modem = state.getValue( Properties.MODEM );
if( cable && modem != BlockCableModemVariant.None ) if( cable && modem != BlockCableModemVariant.None )
{ {
@ -138,36 +138,30 @@ public class BlockCable extends BlockPeripheralBase
switch( type ) switch( type )
{ {
case Cable: case Cable:
{
return getDefaultState() return getDefaultState()
.withProperty( Properties.CABLE, BlockCableCableVariant.ANY ) .withProperty( Properties.CABLE, true )
.withProperty( Properties.MODEM, BlockCableModemVariant.None ); .withProperty( Properties.MODEM, BlockCableModemVariant.None );
}
case WiredModem:
default: default:
{ case WiredModem:
return getDefaultState() return getDefaultState()
.withProperty( Properties.CABLE, BlockCableCableVariant.NONE ) .withProperty( Properties.CABLE, false )
.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( placedSide.getOpposite() ) ); .withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( placedSide.getOpposite() ) );
}
case WiredModemWithCable: case WiredModemWithCable:
{
return getDefaultState() return getDefaultState()
.withProperty( Properties.CABLE, BlockCableCableVariant.ANY ) .withProperty( Properties.CABLE, true )
.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( placedSide.getOpposite() ) ); .withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( placedSide.getOpposite() ) );
}
} }
} }
public static boolean canConnectIn( IBlockState state, EnumFacing direction ) public static boolean canConnectIn( IBlockState state, EnumFacing direction )
{ {
return state.getValue( BlockCable.Properties.CABLE ) != BlockCableCableVariant.NONE return state.getValue( BlockCable.Properties.CABLE )
&& state.getValue( BlockCable.Properties.MODEM ).getFacing() != direction; && state.getValue( BlockCable.Properties.MODEM ).getFacing() != direction;
} }
public static boolean doesConnectVisually( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction ) public static boolean doesConnectVisually( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction )
{ {
if( state.getValue( Properties.CABLE ) == BlockCableCableVariant.NONE ) return false; if( !state.getValue( Properties.CABLE ) ) return false;
if( state.getValue( Properties.MODEM ).getFacing() == direction ) return true; if( state.getValue( Properties.MODEM ).getFacing() == direction ) return true;
return ComputerCraft.getWiredElementAt( world, pos.offset( direction ), direction.getOpposite() ) != null; return ComputerCraft.getWiredElementAt( world, pos.offset( direction ), direction.getOpposite() ) != null;
} }
@ -177,50 +171,21 @@ public class BlockCable extends BlockPeripheralBase
@Deprecated @Deprecated
public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos )
{ {
state = state.withProperty( Properties.NORTH, doesConnectVisually( state, world, pos, EnumFacing.NORTH ) ); state = state
state = state.withProperty( Properties.SOUTH, doesConnectVisually( state, world, pos, EnumFacing.SOUTH ) ); .withProperty( Properties.NORTH, doesConnectVisually( state, world, pos, EnumFacing.NORTH ) )
state = state.withProperty( Properties.EAST, doesConnectVisually( state, world, pos, EnumFacing.EAST ) ); .withProperty( Properties.SOUTH, doesConnectVisually( state, world, pos, EnumFacing.SOUTH ) )
state = state.withProperty( Properties.WEST, doesConnectVisually( state, world, pos, EnumFacing.WEST ) ); .withProperty( Properties.EAST, doesConnectVisually( state, world, pos, EnumFacing.EAST ) )
state = state.withProperty( Properties.UP, doesConnectVisually( state, world, pos, EnumFacing.UP ) ); .withProperty( Properties.WEST, doesConnectVisually( state, world, pos, EnumFacing.WEST ) )
state = state.withProperty( Properties.DOWN, doesConnectVisually( state, world, pos, EnumFacing.DOWN ) ); .withProperty( Properties.UP, doesConnectVisually( state, world, pos, EnumFacing.UP ) )
.withProperty( Properties.DOWN, doesConnectVisually( state, world, pos, EnumFacing.DOWN ) );
if( state.getValue( Properties.CABLE ) != BlockCableCableVariant.NONE )
{
BlockCableCableVariant direction = null;
if( state.getValue( Properties.WEST ) || state.getValue( Properties.EAST ) )
{
direction = direction == null ? BlockCableCableVariant.X_AXIS : BlockCableCableVariant.ANY;
}
if( state.getValue( Properties.DOWN ) || state.getValue( Properties.UP ) )
{
direction = direction == null ? BlockCableCableVariant.Y_AXIS : BlockCableCableVariant.ANY;
}
if( state.getValue( Properties.NORTH ) || state.getValue( Properties.SOUTH ) )
{
direction = direction == null ? BlockCableCableVariant.Z_AXIS : BlockCableCableVariant.ANY;
}
state = state.withProperty( Properties.CABLE, direction == null ? BlockCableCableVariant.Z_AXIS : direction );
}
int anim;
TileEntity tile = world.getTileEntity( pos ); TileEntity tile = world.getTileEntity( pos );
if( tile != null && tile instanceof TilePeripheralBase ) int anim = tile instanceof TilePeripheralBase ? ((TilePeripheralBase) tile).getAnim() : 0;
{
TilePeripheralBase peripheral = (TilePeripheralBase) tile;
anim = peripheral.getAnim();
}
else
{
anim = 0;
}
BlockCableModemVariant modem = state.getValue( Properties.MODEM ); BlockCableModemVariant modem = state.getValue( Properties.MODEM );
if( modem != BlockCableModemVariant.None ) if( modem != BlockCableModemVariant.None )
{ {
modem = BlockCableModemVariant.values()[ modem = BlockCableModemVariant.values()[1 + 6 * anim + modem.getFacing().getIndex()];
1 + 6 * anim + modem.getFacing().getIndex()
];
} }
state = state.withProperty( Properties.MODEM, modem ); state = state.withProperty( Properties.MODEM, modem );
@ -243,7 +208,7 @@ public class BlockCable extends BlockPeripheralBase
@Override @Override
public PeripheralType getPeripheralType( IBlockState state ) public PeripheralType getPeripheralType( IBlockState state )
{ {
boolean cable = state.getValue( Properties.CABLE ) != BlockCableCableVariant.NONE; boolean cable = state.getValue( Properties.CABLE );
BlockCableModemVariant modem = state.getValue( Properties.MODEM ); BlockCableModemVariant modem = state.getValue( Properties.MODEM );
if( cable && modem != BlockCableModemVariant.None ) if( cable && modem != BlockCableModemVariant.None )
{ {
@ -271,7 +236,7 @@ public class BlockCable extends BlockPeripheralBase
public RayTraceResult collisionRayTrace( IBlockState blockState, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Vec3d start, @Nonnull Vec3d end ) public RayTraceResult collisionRayTrace( IBlockState blockState, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Vec3d start, @Nonnull Vec3d end )
{ {
TileEntity tile = world.getTileEntity( pos ); TileEntity tile = world.getTileEntity( pos );
if( tile != null && tile instanceof TileGeneric && tile.hasWorld() ) if( tile instanceof TileGeneric && tile.hasWorld() )
{ {
TileGeneric generic = (TileGeneric) tile; TileGeneric generic = (TileGeneric) tile;
@ -316,7 +281,7 @@ public class BlockCable extends BlockPeripheralBase
if( hit != null ) if( hit != null )
{ {
TileEntity tile = world.getTileEntity( pos ); TileEntity tile = world.getTileEntity( pos );
if( tile != null && tile instanceof TileCable && tile.hasWorld() ) if( tile instanceof TileCable && tile.hasWorld() )
{ {
TileCable cable = (TileCable) tile; TileCable cable = (TileCable) tile;
@ -330,7 +295,7 @@ public class BlockCable extends BlockPeripheralBase
} }
else else
{ {
world.setBlockState( pos, state.withProperty( Properties.CABLE, BlockCableCableVariant.NONE ), 3 ); world.setBlockState( pos, state.withProperty( Properties.CABLE, false ), 3 );
item = PeripheralItemFactory.create( PeripheralType.Cable, null, 1 ); item = PeripheralItemFactory.create( PeripheralType.Cable, null, 1 );
} }
@ -351,7 +316,7 @@ public class BlockCable extends BlockPeripheralBase
public ItemStack getPickBlock( @Nonnull IBlockState state, RayTraceResult hit, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player ) public ItemStack getPickBlock( @Nonnull IBlockState state, RayTraceResult hit, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player )
{ {
TileEntity tile = world.getTileEntity( pos ); TileEntity tile = world.getTileEntity( pos );
if( tile != null && tile instanceof TileCable && tile.hasWorld() ) if( tile instanceof TileCable && tile.hasWorld() )
{ {
TileCable cable = (TileCable) tile; TileCable cable = (TileCable) tile;
PeripheralType type = getPeripheralType( state ); PeripheralType type = getPeripheralType( state );
@ -380,7 +345,7 @@ public class BlockCable extends BlockPeripheralBase
public void onBlockPlacedBy( World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack ) public void onBlockPlacedBy( World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack )
{ {
TileEntity tile = world.getTileEntity( pos ); TileEntity tile = world.getTileEntity( pos );
if( tile != null && tile instanceof TileCable ) if( tile instanceof TileCable )
{ {
TileCable cable = (TileCable) tile; TileCable cable = (TileCable) tile;
if( cable.getPeripheralType() != PeripheralType.WiredModem ) if( cable.getPeripheralType() != PeripheralType.WiredModem )

View File

@ -1,35 +0,0 @@
/*
* This file is part of ComputerCraft - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2018. Do not distribute without permission.
* Send enquiries to dratcliffe@gmail.com
*/
package dan200.computercraft.shared.peripheral.modem.wired;
import net.minecraft.util.IStringSerializable;
import javax.annotation.Nonnull;
public enum BlockCableCableVariant implements IStringSerializable
{
NONE( "none" ),
ANY( "any" ),
X_AXIS( "x" ),
Y_AXIS( "y" ),
Z_AXIS( "z" ),
;
private final String m_name;
BlockCableCableVariant( String name )
{
m_name = name;
}
@Override
@Nonnull
public String getName()
{
return m_name;
}
}

View File

@ -90,14 +90,14 @@ public class ItemCable extends ItemPeripheralBase
{ {
if( !stack.isEmpty() ) if( !stack.isEmpty() )
{ {
IBlockState newState = existingState.withProperty( BlockCable.Properties.CABLE, BlockCableCableVariant.ANY ); IBlockState newState = existingState.withProperty( BlockCable.Properties.CABLE, true );
world.setBlockState( pos, newState, 3 ); world.setBlockState( pos, newState, 3 );
SoundType soundType = newState.getBlock().getSoundType( newState, world, pos, player ); SoundType soundType = newState.getBlock().getSoundType( newState, world, pos, player );
world.playSound( null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F ); world.playSound( null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F );
stack.shrink( 1 ); stack.shrink( 1 );
TileEntity tile = world.getTileEntity( pos ); TileEntity tile = world.getTileEntity( pos );
if( tile != null && tile instanceof TileCable ) if( tile instanceof TileCable )
{ {
TileCable cable = (TileCable) tile; TileCable cable = (TileCable) tile;
cable.connectionsChanged(); cable.connectionsChanged();
@ -129,7 +129,7 @@ public class ItemCable extends ItemPeripheralBase
stack.shrink( 1 ); stack.shrink( 1 );
TileEntity tile = world.getTileEntity( offset ); TileEntity tile = world.getTileEntity( offset );
if( tile != null && tile instanceof TileCable ) if( tile instanceof TileCable )
{ {
TileCable cable = (TileCable) tile; TileCable cable = (TileCable) tile;
cable.modemChanged(); cable.modemChanged();
@ -145,14 +145,14 @@ public class ItemCable extends ItemPeripheralBase
{ {
if( !stack.isEmpty() ) if( !stack.isEmpty() )
{ {
IBlockState newState = offsetExistingState.withProperty( BlockCable.Properties.CABLE, BlockCableCableVariant.ANY ); IBlockState newState = offsetExistingState.withProperty( BlockCable.Properties.CABLE, true );
world.setBlockState( offset, newState, 3 ); world.setBlockState( offset, newState, 3 );
SoundType soundType = newState.getBlock().getSoundType( newState, world, offset, player ); SoundType soundType = newState.getBlock().getSoundType( newState, world, offset, player );
world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F ); world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F );
stack.shrink( 1 ); stack.shrink( 1 );
TileEntity tile = world.getTileEntity( offset ); TileEntity tile = world.getTileEntity( offset );
if( tile != null && tile instanceof TileCable ) if( tile instanceof TileCable )
{ {
TileCable cable = (TileCable) tile; TileCable cable = (TileCable) tile;
cable.modemChanged(); cable.modemChanged();

View File

@ -1,190 +1,197 @@
{ {
"forge_marker": 1, "multipart": [
"variants": { {
"cable": { "when": {
"none": { }, "OR": [
"any": { "submodel": { "cable": { "model": "computercraft:cable_core_any" } } }, {
"x": { "submodel": { "cable": { "model": "computercraft:cable_core_facing", "y": 90 } } }, "cable": "true", "up": "true",
"y": { "submodel": { "cable": { "model": "computercraft:cable_core_facing", "x": 90 } } }, "north": "false", "south": "false", "west": "false", "east": "false"
"z": { "submodel": { "cable": { "model": "computercraft:cable_core_facing", "y": 0 } } } },
{
"cable": "true", "down": "true",
"north": "false", "south": "false", "west": "false", "east": "false"
}
]
},
"apply": { "model": "computercraft:cable_core_facing", "x": 90 }
}, },
"up": {
"true": { {
"submodel": { "when": {
"up": { "model": "computercraft:cable_arm", "x": 90 } "OR": [
} {
"cable": "true", "up": "false", "down": "false",
"north": "false", "south": "false", "west": "false", "east": "false"
},
{
"cable": "true", "north": "true",
"up": "false", "down": "false", "west": "false", "east": "false"
},
{
"cable": "true", "south": "true",
"up": "false", "down": "false", "west": "false", "east": "false"
}
]
}, },
"false": { "apply": { "model": "computercraft:cable_core_facing", "y": 0 }
}
}, },
"down": {
"true": { {
"submodel": { "when": {
"down": { "model": "computercraft:cable_arm", "x": 270 } "OR": [
} {
"cable": "true", "west": "true",
"up": "false", "down": "false", "north": "false", "south": "false"
},
{
"cable": "true", "east": "true",
"up": "false", "down": "false", "north": "false", "south": "false"
}
]
}, },
"false": { "apply": { "model": "computercraft:cable_core_facing", "y": 90 }
}
}, },
"north": {
"true": { {
"submodel": { "when": {
"north": { "model": "computercraft:cable_arm", "y": 180 } "OR": [
} { "cable": "true", "down": "true", "north": "true" },
{ "cable": "true", "down": "true", "south": "true" },
{ "cable": "true", "down": "true", "east": "true" },
{ "cable": "true", "down": "true", "west": "true" },
{ "cable": "true", "up": "true", "north": "true" },
{ "cable": "true", "up": "true", "south": "true" },
{ "cable": "true", "up": "true", "east": "true" },
{ "cable": "true", "up": "true", "west": "true" },
{ "cable": "true", "north": "true", "west": "true" },
{ "cable": "true", "north": "true", "east": "true" },
{ "cable": "true", "south": "true", "west": "true" },
{ "cable": "true", "south": "true", "east": "true" }
]
}, },
"false": { "apply": { "model": "computercraft:cable_core_any" }
}
}, },
"south": {
"true": { {
"submodel": { "when": { "up": true },
"south": { "model": "computercraft:cable_arm" } "apply": { "model": "computercraft:cable_arm", "x": 90 }
}
},
"false": {
}
}, },
"west": { {
"true": { "when": { "down": true },
"submodel": { "apply": { "model": "computercraft:cable_arm", "x": 270 }
"west": { "model": "computercraft:cable_arm", "y": 90 }
}
},
"false": {
}
}, },
"east": { {
"true": { "when": { "north": true },
"submodel": { "apply": { "model": "computercraft:cable_arm", "y": 180 }
"east": { "model": "computercraft:cable_arm", "y": 270 }
}
},
"false": {
}
}, },
"modem": { {
"none": { "when": { "south": true },
}, "apply": { "model": "computercraft:cable_arm" }
"up_off": { },
"submodel": { {
"modem": { "model": "computercraft:wired_modem_off", "x": 270 } "when": { "west": true },
} "apply": { "model": "computercraft:cable_arm", "y": 90 }
}, },
"down_off": { {
"submodel": { "when": { "east": true },
"modem": { "model": "computercraft:wired_modem_off", "x": 90 } "apply": { "model": "computercraft:cable_arm", "y": 270 }
} },
},
"north_off": { {
"submodel": { "when": { "modem": "up_off" },
"modem": { "model": "computercraft:wired_modem_off" } "apply": { "model": "computercraft:wired_modem_off", "x": 270 }
} },
}, {
"south_off": { "when": { "modem": "down_off" },
"submodel": { "apply": { "model": "computercraft:wired_modem_off", "x": 90 }
"modem": { "model": "computercraft:wired_modem_off", "y": 180 } },
} {
}, "when": { "modem": "north_off" },
"west_off": { "apply": { "model": "computercraft:wired_modem_off" }
"submodel": { },
"modem": { "model": "computercraft:wired_modem_off", "y": 270 } {
} "when": { "modem": "south_off" },
}, "apply": { "model": "computercraft:wired_modem_off", "y": 180 }
"east_off": { },
"submodel": { {
"modem": { "model": "computercraft:wired_modem_off", "y": 90 } "when": { "modem": "west_off" },
} "apply": { "model": "computercraft:wired_modem_off", "y": 270 }
}, },
"up_on": { {
"submodel": { "when": { "modem": "east_off" },
"modem": { "model": "computercraft:wired_modem_on", "x": 270 } "apply": { "model": "computercraft:wired_modem_off", "y": 90 }
} },
}, {
"down_on": { "when": { "modem": "up_on" },
"submodel": { "apply": { "model": "computercraft:wired_modem_on", "x": 270 }
"modem": { "model": "computercraft:wired_modem_on", "x": 90 } },
} {
}, "when": { "modem": "down_on" },
"north_on": { "apply": { "model": "computercraft:wired_modem_on", "x": 90 }
"submodel": { },
"modem": { "model": "computercraft:wired_modem_on" } {
} "when": { "modem": "north_on" },
}, "apply": { "model": "computercraft:wired_modem_on" }
"south_on": { },
"submodel": { {
"modem": { "model": "computercraft:wired_modem_on", "y": 180 } "when": { "modem": "south_on" },
} "apply": { "model": "computercraft:wired_modem_on", "y": 180 }
}, },
"west_on": { {
"submodel": { "when": { "modem": "west_on" },
"modem": { "model": "computercraft:wired_modem_on", "y": 270 } "apply": { "model": "computercraft:wired_modem_on", "y": 270 }
} },
}, {
"east_on": { "when": { "modem": "east_on" },
"submodel": { "apply": { "model": "computercraft:wired_modem_on", "y": 90 }
"modem": { "model": "computercraft:wired_modem_on", "y": 90 } },
} {
}, "when": { "modem": "up_off_peripheral" },
"up_off_peripheral": { "apply": { "model": "computercraft:wired_modem_off_peripheral", "x": 270 }
"submodel": { },
"modem": { "model": "computercraft:wired_modem_off_peripheral", "x": 270 } {
} "when": { "modem": "down_off_peripheral" },
}, "apply": { "model": "computercraft:wired_modem_off_peripheral", "x": 90 }
"down_off_peripheral": { },
"submodel": { {
"modem": { "model": "computercraft:wired_modem_off_peripheral", "x": 90 } "when": { "modem": "north_off_peripheral" },
} "apply": { "model": "computercraft:wired_modem_off_peripheral" }
}, },
"north_off_peripheral": { {
"submodel": { "when": { "modem": "south_off_peripheral" },
"modem": { "model": "computercraft:wired_modem_off_peripheral" } "apply": { "model": "computercraft:wired_modem_off_peripheral", "y": 180 }
} },
}, {
"south_off_peripheral": { "when": { "modem": "west_off_peripheral" },
"submodel": { "apply": { "model": "computercraft:wired_modem_off_peripheral", "y": 270 }
"modem": { "model": "computercraft:wired_modem_off_peripheral", "y": 180 } },
} {
}, "when": { "modem": "east_off_peripheral" },
"west_off_peripheral": { "apply": { "model": "computercraft:wired_modem_off_peripheral", "y": 90 }
"submodel": { },
"modem": { "model": "computercraft:wired_modem_off_peripheral", "y": 270 } {
} "when": { "modem": "up_on_peripheral" },
}, "apply": { "model": "computercraft:wired_modem_on_peripheral", "x": 270 }
"east_off_peripheral": { },
"submodel": { {
"modem": { "model": "computercraft:wired_modem_off_peripheral", "y": 90 } "when": { "modem": "down_on_peripheral" },
} "apply": { "model": "computercraft:wired_modem_on_peripheral", "x": 90 }
}, },
"up_on_peripheral": { {
"submodel": { "when": { "modem": "north_on_peripheral" },
"modem": { "model": "computercraft:wired_modem_on_peripheral", "x": 270 } "apply": { "model": "computercraft:wired_modem_on_peripheral" }
} },
}, {
"down_on_peripheral": { "when": { "modem": "south_on_peripheral" },
"submodel": { "apply": { "model": "computercraft:wired_modem_on_peripheral", "y": 180 }
"modem": { "model": "computercraft:wired_modem_on_peripheral", "x": 90 } },
} {
}, "when": { "modem": "west_on_peripheral" },
"north_on_peripheral": { "apply": { "model": "computercraft:wired_modem_on_peripheral", "y": 270 }
"submodel": { },
"modem": { "model": "computercraft:wired_modem_on_peripheral" } {
} "when": { "modem": "east_on_peripheral" },
}, "apply": { "model": "computercraft:wired_modem_on_peripheral", "y": 90 }
"south_on_peripheral": {
"submodel": {
"modem": { "model": "computercraft:wired_modem_on_peripheral", "y": 180 }
}
},
"west_on_peripheral": {
"submodel": {
"modem": { "model": "computercraft:wired_modem_on_peripheral", "y": 270 }
}
},
"east_on_peripheral": {
"submodel": {
"modem": { "model": "computercraft:wired_modem_on_peripheral", "y": 90 }
}
}
} }
} ]
} }