Custom Model Loader
This commit is contained in:
@@ -221,12 +221,12 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
this.isCached = true;
|
||||
ICellHandler cellHandler = AEApi.instance().registries().cell().getHandler( is );
|
||||
ICellHandler cellHandler = Api.INSTANCE.registries().cell().getHandler( is );
|
||||
if( cellHandler != null )
|
||||
{
|
||||
double power = 1.0;
|
||||
|
||||
for( IStorageChannel channel : AEApi.instance().storage().storageChannels() )
|
||||
for( IStorageChannel channel : Api.INSTANCE.storage().storageChannels() )
|
||||
{
|
||||
final ICellInventoryHandler<IAEItemStack> newCell = cellHandler.getCellInventory( is, this, channel );
|
||||
if( newCell != null )
|
||||
@@ -241,7 +241,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.accessor = new Accessor();
|
||||
|
||||
if( this.cellHandler != null && this.cellHandler
|
||||
.getChannel() == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
.getChannel() == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
{
|
||||
this.fluidHandler = new FluidHandler();
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.updateHandler();
|
||||
|
||||
final ItemStack cell = this.getCell();
|
||||
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||
final ICellHandler ch = Api.INSTANCE.registries().cell().getHandler( cell );
|
||||
|
||||
if( this.cellHandler != null && ch != null )
|
||||
{
|
||||
@@ -534,7 +534,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
{
|
||||
this.updateHandler();
|
||||
|
||||
if( this.cellHandler != null && this.cellHandler.getChannel() == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
if( this.cellHandler != null && this.cellHandler.getChannel() == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
{
|
||||
final IAEItemStack returns = Platform.poweredInsert( this, this.cellHandler,
|
||||
AEItemStack.fromItemStack( this.inputInventory.getStackInSlot( 0 ) ), this.mySrc );
|
||||
@@ -621,11 +621,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.updateHandler();
|
||||
if( this.cellHandler != null )
|
||||
{
|
||||
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( this.getCell() );
|
||||
final ICellHandler ch = Api.INSTANCE.registries().cell().getHandler( this.getCell() );
|
||||
|
||||
if( ch != null )
|
||||
{
|
||||
final ICellGuiHandler chg = AEApi.instance().registries().cell().getGuiHandler( this.cellHandler.getChannel(), this.getCell() );
|
||||
final ICellGuiHandler chg = Api.INSTANCE.registries().cell().getGuiHandler( this.cellHandler.getChannel(), this.getCell() );
|
||||
if( chg != null )
|
||||
{
|
||||
chg.openChestGui( p, this, ch, this.cellHandler, this.getCell(), this.cellHandler.getChannel() );
|
||||
@@ -844,7 +844,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
{
|
||||
TileChest.this.updateHandler();
|
||||
if( TileChest.this.cellHandler != null && TileChest.this.cellHandler
|
||||
.getChannel() == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
.getChannel() == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
{
|
||||
final IAEFluidStack results = Platform.poweredInsert( TileChest.this, TileChest.this.cellHandler, AEFluidStack.fromFluidStack( resource ),
|
||||
TileChest.this.mySrc, doFill ? Actionable.MODULATE : Actionable.SIMULATE );
|
||||
@@ -876,7 +876,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
TileChest.this.updateHandler();
|
||||
|
||||
if( TileChest.this.cellHandler != null && TileChest.this.cellHandler
|
||||
.getChannel() == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
.getChannel() == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
{
|
||||
return this.TANK_PROPS;
|
||||
}
|
||||
@@ -899,7 +899,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
{
|
||||
TileChest.this.updateHandler();
|
||||
return TileChest.this.cellHandler != null && TileChest.this.cellHandler
|
||||
.getChannel() == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
|
||||
.getChannel() == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -917,7 +917,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
@Override
|
||||
public boolean allowInsert( IItemHandler inv, int slot, ItemStack stack )
|
||||
{
|
||||
return AEApi.instance().registries().cell().getHandler( stack ) != null;
|
||||
return Api.INSTANCE.registries().cell().getHandler( stack ) != null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -925,7 +925,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation()
|
||||
{
|
||||
return AEApi.instance().definitions().blocks().chest().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
return Api.INSTANCE.definitions().blocks().chest().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -934,11 +934,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.updateHandler();
|
||||
if( this.cellHandler != null )
|
||||
{
|
||||
if( this.cellHandler.getChannel() == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
if( this.cellHandler.getChannel() == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
{
|
||||
return GuiBridge.GUI_ME;
|
||||
}
|
||||
if( this.cellHandler.getChannel() == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
if( this.cellHandler.getChannel() == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
{
|
||||
return GuiBridge.GUI_FLUID_TERMINAL;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
{
|
||||
if( !this.isCached )
|
||||
{
|
||||
final Collection<IStorageChannel<? extends IAEStack<?>>> storageChannels = AEApi.instance().storage().storageChannels();
|
||||
final Collection<IStorageChannel<? extends IAEStack<?>>> storageChannels = Api.INSTANCE.storage().storageChannels();
|
||||
storageChannels.forEach( channel -> this.inventoryHandlers.put( channel, new ArrayList<>( 10 ) ) );
|
||||
|
||||
double power = 2.0;
|
||||
@@ -292,7 +292,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
this.handlersBySlot[x] = AEApi.instance().registries().cell().getHandler( is );
|
||||
this.handlersBySlot[x] = Api.INSTANCE.registries().cell().getHandler( is );
|
||||
|
||||
if( this.handlersBySlot[x] != null )
|
||||
{
|
||||
@@ -394,7 +394,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
@Override
|
||||
public boolean allowInsert( IItemHandler inv, int slot, ItemStack stack )
|
||||
{
|
||||
return !stack.isEmpty() && AEApi.instance().registries().cell().isCellHandled( stack );
|
||||
return !stack.isEmpty() && Api.INSTANCE.registries().cell().isCellHandled( stack );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -402,7 +402,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation()
|
||||
{
|
||||
return AEApi.instance().definitions().blocks().drive().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
return Api.INSTANCE.definitions().blocks().drive().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -105,7 +105,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
this.mySrc = new MachineSource( this );
|
||||
this.lastRedstoneState = YesNo.UNDECIDED;
|
||||
|
||||
final Block ioPortBlock = AEApi.instance().definitions().blocks().iOPort().maybeBlock().get();
|
||||
final Block ioPortBlock = Api.INSTANCE.definitions().blocks().iOPort().maybeBlock().get();
|
||||
this.upgrades = new BlockUpgradeInventory( ioPortBlock, this, NUMBER_OF_UPGRADE_SLOTS );
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
{
|
||||
boolean shouldMove = true;
|
||||
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : AEApi.instance().storage().storageChannels() )
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : Api.INSTANCE.storage().storageChannels() )
|
||||
{
|
||||
if( itemsToMove > 0 )
|
||||
{
|
||||
@@ -370,9 +370,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
this.currentCell = is;
|
||||
this.cachedInventories = new IdentityHashMap<>();
|
||||
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : AEApi.instance().storage().storageChannels() )
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : Api.INSTANCE.storage().storageChannels() )
|
||||
{
|
||||
this.cachedInventories.put( c, AEApi.instance().registries().cell().getCellInventory( is, null, c ) );
|
||||
this.cachedInventories.put( c, Api.INSTANCE.registries().cell().getCellInventory( is, null, c ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user