1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-29 00:23:23 +00:00

Ensure the origin monitor is valid too

Blurh, still not sure if this is Correct or anything, but have no clue
what's causing this. Fixes #985. Hopefully.
This commit is contained in:
Jonathan Coates 2021-12-10 13:13:31 +00:00
parent 0e4b7a5a75
commit 1f6e0f287d
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06

View File

@ -95,7 +95,10 @@ private boolean expandIn( boolean useXAxis, boolean isPositive )
if( !isPositive )
{
TileEntity otherOrigin = level.getBlockEntity( otherMonitor.toWorldPos( 0, 0 ) );
if( otherOrigin == null || !origin.isCompatible( (TileMonitor) otherOrigin ) ) return false;
if( !(otherOrigin instanceof TileMonitor) || !origin.isCompatible( (TileMonitor) otherOrigin ) )
{
return false;
}
origin = (TileMonitor) otherOrigin;
}