mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-25 02:47:39 +00:00
Some sanity checks for get{Direction,Orientation}
Silly bodge, but should fix #600.
This commit is contained in:
@@ -218,7 +218,10 @@ public class TileMonitor extends TileGeneric implements IPeripheralTile {
|
||||
|
||||
// region Sizing and placement stuff
|
||||
public Direction getDirection() {
|
||||
return this.getCachedState().get(BlockMonitor.FACING);
|
||||
// Ensure we're actually a monitor block. This _should_ always be the case, but sometimes there's
|
||||
// fun problems with the block being missing on the client.
|
||||
BlockState state = getCachedState();
|
||||
return state.contains( BlockMonitor.FACING ) ? state.get( BlockMonitor.FACING ) : Direction.NORTH;
|
||||
}
|
||||
|
||||
public Direction getOrientation() {
|
||||
|
||||
Reference in New Issue
Block a user