Refactors grid connections (#3219)
Extracted all checks and subsequent updates to a factory method from the constructor. Reordered checks to check for nulls before anything else. Also existing connections before security breaks. Fixes TileController#checkController() using the wrong position. Added debug logging for failed connections. Improved logging. Inversed boolean so false no longer means security check passed. Only issue a security break on SecurityConnectionException.
This commit is contained in:
@@ -209,8 +209,7 @@ public class TileController extends AENetworkPowerTile
|
||||
*/
|
||||
private boolean checkController( final BlockPos pos )
|
||||
{
|
||||
final BlockPos ownPos = this.getPos();
|
||||
if( this.world.getChunkProvider().getLoadedChunk( ownPos.getX() >> 4, ownPos.getZ() >> 4 ) != null )
|
||||
if( this.world.getChunkProvider().getLoadedChunk( pos.getX() >> 4, pos.getZ() >> 4 ) != null )
|
||||
{
|
||||
return this.world.getTileEntity( pos ) instanceof TileController;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user