Custom Model Loader

This commit is contained in:
Sebastian Hartte
2020-06-01 04:02:37 +02:00
parent 077ff17078
commit 5cdeff01be
202 changed files with 942 additions and 1017 deletions
@@ -164,7 +164,7 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable
if( cellInv != null )
{
final IItemList<IAEFluidStack> list = cellInv
.getAvailableItems( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList() );
.getAvailableItems( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList() );
i = list.iterator();
}
@@ -81,7 +81,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
{
private final IConfigManager clientCM;
private final IMEMonitor<IAEFluidStack> monitor;
private final IItemList<IAEFluidStack> fluids = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
private final IItemList<IAEFluidStack> fluids = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
@GuiSync( 99 )
public boolean hasPower = false;
private ITerminalHost terminal;
@@ -103,7 +103,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
if( Platform.isServer() )
{
this.serverCM = terminal.getConfigManager();
this.monitor = terminal.getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
this.monitor = terminal.getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
if( this.monitor != null )
{
@@ -266,7 +266,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
{
if( Platform.isServer() )
{
if( this.monitor != this.terminal.getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) ) )
if( this.monitor != this.terminal.getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) ) )
{
this.setValidContainer( false );
}
@@ -90,10 +90,10 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
private int isWorking = -1;
private int priority;
private final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<>( new NullInventory<IAEItemStack>(), AEApi.instance()
private final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<>( new NullInventory<IAEItemStack>(), Api.INSTANCE
.storage()
.getStorageChannel( IItemStorageChannel.class ) );
private final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<>( new NullInventory<IAEFluidStack>(), AEApi.instance()
private final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<>( new NullInventory<IAEFluidStack>(), Api.INSTANCE
.storage()
.getStorageChannel( IFluidStorageChannel.class ) );
@@ -132,7 +132,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
@Override
public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel )
{
if( channel == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
if( channel == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
{
if( this.hasConfig() )
{
@@ -141,7 +141,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
return (IMEMonitor<T>) this.items;
}
else if( channel == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
else if( channel == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
{
if( this.hasConfig() )
{
@@ -207,8 +207,8 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
{
try
{
this.items.setInternal( this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ) );
this.fluids.setInternal( this.gridProxy.getStorage().getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) ) );
this.items.setInternal( this.gridProxy.getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) ) );
this.fluids.setInternal( this.gridProxy.getStorage().getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) ) );
}
catch( final GridAccessException gae )
{
@@ -372,7 +372,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
try
{
final IMEInventory<IAEFluidStack> dest = this.gridProxy.getStorage()
.getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
.getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
final IEnergySource src = this.gridProxy.getEnergy();
if( work.getStackSize() > 0 )
@@ -87,7 +87,7 @@ public final class BasicFluidStorageCell extends AbstractStorageCell<IAEFluidSta
@Override
public IStorageChannel<IAEFluidStack> getChannel()
{
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
@@ -105,7 +105,7 @@ public final class BasicFluidStorageCell extends AbstractStorageCell<IAEFluidSta
@Override
protected void dropEmptyStorageCellCase( final InventoryAdaptor ia, final PlayerEntity player )
{
AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).ifPresent( is ->
Api.INSTANCE.definitions().materials().emptyStorageCell().maybeStack( 1 ).ifPresent( is ->
{
final ItemStack extraA = ia.addItems( is );
if( !extraA.isEmpty() )
@@ -152,7 +152,7 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
@Override
public IStorageChannel<IAEFluidStack> getChannel()
{
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
@@ -288,7 +288,7 @@ public class PartFluidAnnihilationPlane extends PartBasicState implements IGridT
try
{
final IStorageGrid storage = this.getProxy().getStorage();
final IMEInventory<IAEFluidStack> inv = storage.getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
final IMEInventory<IAEFluidStack> inv = storage.getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
if( modulate )
{
@@ -63,7 +63,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
return MODELS.getModels();
}
private final MEInventoryHandler<IAEFluidStack> myHandler = new MEInventoryHandler<>( this, AEApi.instance()
private final MEInventoryHandler<IAEFluidStack> myHandler = new MEInventoryHandler<>( this, Api.INSTANCE
.storage()
.getStorageChannel( IFluidStorageChannel.class ) );
private final AEFluidInventory config = new AEFluidInventory( this, 63 );
@@ -81,7 +81,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.myHandler.setPriority( this.getPriority() );
final IItemList<IAEFluidStack> priorityList = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final IItemList<IAEFluidStack> priorityList = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for( int x = 0; x < this.config.getSlots() && x < slotsToUse; x++ )
@@ -196,13 +196,13 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
@Override
public IStorageChannel<IAEFluidStack> getChannel()
{
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
public List<IMEInventoryHandler> getCellArray( final IStorageChannel channel )
{
if( this.getProxy().isActive() && channel == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
if( this.getProxy().isActive() && channel == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
{
final List<IMEInventoryHandler> handler = new ArrayList<>( 1 );
handler.add( this.myHandler );
@@ -225,7 +225,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
@Override
public ItemStack getItemStackRepresentation()
{
return AEApi.instance().definitions().parts().fluidFormationnPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return Api.INSTANCE.definitions().parts().fluidFormationnPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -236,7 +236,7 @@ public class PartFluidInterface extends PartBasicState implements IGridTickable,
@Override
public ItemStack getItemStackRepresentation()
{
return AEApi.instance().definitions().parts().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return Api.INSTANCE.definitions().parts().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -112,7 +112,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
@Override
public void onStackChange( IItemList<?> o, IAEStack<?> fullStack, IAEStack<?> diffStack, IActionSource src, IStorageChannel<?> chan )
{
if( chan == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) && fullStack.equals( this.config.getFluidInSlot( 0 ) ) )
if( chan == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) && fullStack.equals( this.config.getFluidInSlot( 0 ) ) )
{
this.lastReportedValue = fullStack.getStackSize();
this.updateState();
@@ -179,7 +179,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
{
try
{
final IStorageChannel<IAEFluidStack> channel = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
final IStorageChannel<IAEFluidStack> channel = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
final IMEMonitor<IAEFluidStack> inventory = this.getProxy().getStorage().getInventory( channel );
this.updateReportingValue( inventory );
@@ -205,7 +205,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
private void configureWatchers()
{
final IFluidStorageChannel channel = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
final IFluidStorageChannel channel = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
if( this.stackWatcher != null )
{
@@ -124,7 +124,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
IStorageMonitorable inventory = accessor.getInventory( this.source );
if( inventory != null )
{
return inventory.getInventory( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
return inventory.getInventory( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
}
// So this could / can be a design decision. If the tile does support our custom capability,
@@ -167,7 +167,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
this.resetCacheLogic = 0;
final IMEInventory<IAEFluidStack> in = this.getInternalHandler();
IItemList<IAEFluidStack> before = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
IItemList<IAEFluidStack> before = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
if( in != null )
{
before = in.getAvailableItems( before );
@@ -183,7 +183,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
if( in != out )
{
IItemList<IAEFluidStack> after = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
IItemList<IAEFluidStack> after = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
if( out != null )
{
after = out.getAvailableItems( after );
@@ -269,7 +269,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
{
this.getProxy()
.getStorage()
.postAlterationOfStoredItems( AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ), change, this.source );
.postAlterationOfStoredItems( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ), change, this.source );
}
}
catch( final GridAccessException e )
@@ -313,13 +313,13 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
{
this.checkInterfaceVsStorageBus( target, this.getSide().getOpposite() );
this.handler = new MEInventoryHandler<>( inv, AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) );
this.handler = new MEInventoryHandler<>( inv, Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) );
this.handler.setBaseAccess( (AccessRestriction) this.getConfigManager().getSetting( Settings.ACCESS ) );
this.handler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.handler.setPriority( this.getPriority() );
final IItemList<IAEFluidStack> priorityList = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final IItemList<IAEFluidStack> priorityList = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
for( int x = 0; x < this.config.getSlots() && x < slotsToUse; x++ )
@@ -461,7 +461,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
@Override
public IStorageChannel getStorageChannel()
{
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
public IAEFluidTank getConfig()
@@ -490,7 +490,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
@Override
public ItemStack getItemStackRepresentation()
{
return AEApi.instance().definitions().parts().fluidStorageBus().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return Api.INSTANCE.definitions().parts().fluidStorageBus().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -178,7 +178,7 @@ public abstract class PartSharedFluidBus extends PartUpgradeable implements IGri
protected IFluidStorageChannel getChannel()
{
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
@@ -42,7 +42,7 @@ public class BasicFluidCellGuiHandler implements ICellGuiHandler
@Override
public <T extends IAEStack<T>> boolean isHandlerFor( final IStorageChannel<T> channel )
{
return channel == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return channel == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
@@ -179,7 +179,7 @@ public class TileFluidInterface extends AENetworkTile implements IGridTickable,
@Override
public ItemStack getItemStackRepresentation()
{
return AEApi.instance().definitions().blocks().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return Api.INSTANCE.definitions().blocks().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
@@ -232,7 +232,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
@Override
public IStorageChannel<IAEFluidStack> getChannel()
{
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override