mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-08 06:43:51 +00:00
Fix peripheral direction not being set
We moved the direction call within the if block, but never actally updated the condition! I'm on a roll of stupid bug fixes today, which really isn't a good sign.
This commit is contained in:
parent
f450c0156b
commit
86ad43c3ab
@ -376,17 +376,9 @@ public class BlockPeripheral extends BlockGeneric
|
|||||||
{
|
{
|
||||||
case DiskDrive:
|
case DiskDrive:
|
||||||
default:
|
default:
|
||||||
{
|
return getDefaultState()
|
||||||
IBlockState state = getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.DiskDriveEmpty );
|
.withProperty( Properties.VARIANT, BlockPeripheralVariant.DiskDriveEmpty )
|
||||||
if( placedSide.getAxis() != EnumFacing.Axis.Y )
|
.withProperty( Properties.FACING, placedSide.getAxis() == EnumFacing.Axis.Y ? EnumFacing.NORTH : placedSide );
|
||||||
{
|
|
||||||
return state.withProperty( Properties.FACING, placedSide );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return state.withProperty( Properties.FACING, EnumFacing.NORTH );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case WirelessModem:
|
case WirelessModem:
|
||||||
{
|
{
|
||||||
EnumFacing dir = placedSide.getOpposite();
|
EnumFacing dir = placedSide.getOpposite();
|
||||||
@ -410,23 +402,15 @@ public class BlockPeripheral extends BlockGeneric
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case Monitor:
|
case Monitor:
|
||||||
{
|
|
||||||
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.Monitor );
|
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.Monitor );
|
||||||
}
|
|
||||||
case Printer:
|
case Printer:
|
||||||
{
|
|
||||||
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.PrinterEmpty );
|
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.PrinterEmpty );
|
||||||
}
|
|
||||||
case AdvancedMonitor:
|
case AdvancedMonitor:
|
||||||
{
|
|
||||||
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.AdvancedMonitor );
|
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.AdvancedMonitor );
|
||||||
}
|
|
||||||
case Speaker:
|
case Speaker:
|
||||||
{
|
|
||||||
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.Speaker );
|
return getDefaultState().withProperty( Properties.VARIANT, BlockPeripheralVariant.Speaker );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public PeripheralType getPeripheralType( int damage )
|
public PeripheralType getPeripheralType( int damage )
|
||||||
{
|
{
|
||||||
@ -466,19 +450,15 @@ public class BlockPeripheral extends BlockGeneric
|
|||||||
case Speaker:
|
case Speaker:
|
||||||
case DiskDrive:
|
case DiskDrive:
|
||||||
case Printer:
|
case Printer:
|
||||||
{
|
if( tile instanceof TilePeripheralBase )
|
||||||
EnumFacing dir = DirectionUtil.fromEntityRot( player );
|
|
||||||
if( stack.hasDisplayName() && tile instanceof TilePeripheralBase )
|
|
||||||
{
|
{
|
||||||
TilePeripheralBase peripheral = (TilePeripheralBase) tile;
|
TilePeripheralBase peripheral = (TilePeripheralBase) tile;
|
||||||
peripheral.setLabel( stack.getDisplayName() );
|
peripheral.setDirection( DirectionUtil.fromEntityRot( player ) );
|
||||||
peripheral.setDirection( dir );
|
if( stack.hasDisplayName() ) peripheral.setLabel( stack.getDisplayName() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case Monitor:
|
case Monitor:
|
||||||
case AdvancedMonitor:
|
case AdvancedMonitor:
|
||||||
{
|
|
||||||
if( tile instanceof TileMonitor )
|
if( tile instanceof TileMonitor )
|
||||||
{
|
{
|
||||||
int direction = DirectionUtil.fromEntityRot( player ).getIndex();
|
int direction = DirectionUtil.fromEntityRot( player ).getIndex();
|
||||||
@ -507,7 +487,6 @@ public class BlockPeripheral extends BlockGeneric
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user