Fixes #675 No disabled feature should log spam or crash anymore.
Deprecates the old usage of the AEItemDefinitions via the direct method access of * blocks() * parts() * items() * materials() and thus use the new re-direct via definitions(). All definitions are now initialized, no matter what. But SubItems, Items and Blocks are not registered, if by chance are disabled.
This commit is contained in:
@@ -18,16 +18,19 @@
|
||||
|
||||
package appeng.me.cluster.implementations;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.me.cluster.IAECluster;
|
||||
import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.MBCalculator;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class QuantumCalculator extends MBCalculator
|
||||
{
|
||||
@@ -75,7 +78,7 @@ public class QuantumCalculator extends MBCalculator
|
||||
{
|
||||
TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z );
|
||||
|
||||
byte flags = 0;
|
||||
byte flags;
|
||||
|
||||
num++;
|
||||
if ( num == 5 )
|
||||
@@ -130,21 +133,34 @@ public class QuantumCalculator extends MBCalculator
|
||||
return false;
|
||||
|
||||
num++;
|
||||
final IBlocks blocks = AEApi.instance().definitions().blocks();
|
||||
if ( num == 5 )
|
||||
{
|
||||
if ( !Platform.blockAtLocationIs( w, x, y, z, AEApi.instance().blocks().blockQuantumLink ) )
|
||||
if ( !this.isBlockAtLocation( w, x, y, z, blocks.quantumLink() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !Platform.blockAtLocationIs( w, x, y, z, AEApi.instance().blocks().blockQuantumRing ) )
|
||||
if ( !this.isBlockAtLocation( w, x, y, z, blocks.quantumRing() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isBlockAtLocation( IBlockAccess w, int x, int y, int z, IBlockDefinition def )
|
||||
{
|
||||
for ( Block block : def.maybeBlock().asSet() )
|
||||
{
|
||||
return block == w.getBlock( x, y, z );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,16 +63,19 @@ public class SecurityInventory implements IMEInventoryHandler<IAEItemStack>
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src)
|
||||
{
|
||||
if ( this.hasPermission( src ) && AEApi.instance().items().itemBiometricCard.sameAsStack( input.getItemStack() ) )
|
||||
if ( this.hasPermission( src ) )
|
||||
{
|
||||
if ( this.canAccept( input ) )
|
||||
if ( AEApi.instance().definitions().items().biometricCard().isSameAs( input.getItemStack() ) )
|
||||
{
|
||||
if ( type == Actionable.SIMULATE )
|
||||
return null;
|
||||
if ( this.canAccept( input ) )
|
||||
{
|
||||
if ( type == Actionable.SIMULATE )
|
||||
return null;
|
||||
|
||||
this.storedItems.add( input );
|
||||
this.securityTile.inventoryChanged();
|
||||
return null;
|
||||
this.storedItems.add( input );
|
||||
this.securityTile.inventoryChanged();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return input;
|
||||
|
||||
Reference in New Issue
Block a user