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
+1 -1
View File
@@ -54,7 +54,7 @@ public class Grid implements IGrid
{
this.pivot = center;
final Map<Class<? extends IGridCache>, IGridCache> myCaches = AEApi.instance().registries().gridCache().createCacheInstance( this );
final Map<Class<? extends IGridCache>, IGridCache> myCaches = Api.INSTANCE.registries().gridCache().createCacheInstance( this );
for( final Entry<Class<? extends IGridCache>, IGridCache> c : myCaches.entrySet() )
{
final Class<? extends IGridCache> key = c.getKey();
+4 -4
View File
@@ -250,7 +250,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
this.emitableItems.clear();
// update the stuff that was in the list...
this.storageGrid.postAlterationOfStoredItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ), oldItems.keySet(),
this.storageGrid.postAlterationOfStoredItems( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ), oldItems.keySet(),
new BaseActionSource() );
// re-create list..
@@ -287,7 +287,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
this.craftableItems.put( e.getKey(), ImmutableList.copyOf( e.getValue() ) );
}
this.storageGrid.postAlterationOfStoredItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ), this.craftableItems.keySet(),
this.storageGrid.postAlterationOfStoredItems( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ), this.craftableItems.keySet(),
new BaseActionSource() );
}
@@ -367,7 +367,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
{
final List<IMEInventoryHandler> list = new ArrayList<>( 1 );
if( channel == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
if( channel == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
{
list.add( this );
}
@@ -456,7 +456,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
@Override
public IStorageChannel<IAEItemStack> getChannel()
{
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
}
@Override
+1 -1
View File
@@ -75,7 +75,7 @@ public class GridStorageCache implements IStorageGrid
this.storageNetworks = new IdentityHashMap<>();
this.storageMonitors = new IdentityHashMap<>();
AEApi.instance().storage().storageChannels().forEach( channel -> this.storageMonitors.put( channel, new NetworkMonitor<>( this, channel ) ) );
Api.INSTANCE.storage().storageChannels().forEach( channel -> this.storageMonitors.put( channel, new NetworkMonitor<>( this, channel ) ) );
}
@Override
+1 -1
View File
@@ -351,7 +351,7 @@ public class PathGridCache implements IPathingGrid
{
for( final IGridNode n : this.requireChannels )
{
PlayerEntity player = AEApi.instance().registries().players().findPlayer( n.getPlayerID() );
PlayerEntity player = Api.INSTANCE.registries().players().findPlayer( n.getPlayerID() );
if( player instanceof PlayerEntityMP )
{
currentBracket.trigger( (PlayerEntityMP) player );
@@ -102,7 +102,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
private MECraftingInventory inventory = new MECraftingInventory();
private IAEItemStack finalOutput;
private boolean waiting = false;
private IItemList<IAEItemStack> waitingFor = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
private IItemList<IAEItemStack> waitingFor = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
private long availableStorage = 0;
private MachineSource machineSrc = null;
private int accelerator = 0;
@@ -546,7 +546,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
}
final IItemList<IAEItemStack> list;
this.getListOfItem( list = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList(), CraftingItemList.ALL );
this.getListOfItem( list = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList(), CraftingItemList.ALL );
for( final IAEItemStack is : list )
{
this.postChange( is, this.machineSrc );
@@ -839,7 +839,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
}
final IStorageGrid sg = g.getCache( IStorageGrid.class );
final IMEInventory<IAEItemStack> ii = sg.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IMEInventory<IAEItemStack> ii = sg.getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
for( IAEItemStack is : this.inventory.getItemList() )
{
@@ -883,7 +883,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
}
final IStorageGrid sg = g.getCache( IStorageGrid.class );
final IMEInventory<IAEItemStack> storage = sg.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IMEInventory<IAEItemStack> storage = sg.getInventory( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
final MECraftingInventory ci = new MECraftingInventory( storage, true, false, false );
try
@@ -914,7 +914,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
this.submitLink( this.myLastLink );
this.submitLink( whatLink );
final IItemList<IAEItemStack> list = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
final IItemList<IAEItemStack> list = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
this.getListOfItem( list, CraftingItemList.ALL );
for( final IAEItemStack ge : list )
{
@@ -1282,7 +1282,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
private IItemList<IAEItemStack> readList( final NBTTagList tag )
{
final IItemList<IAEItemStack> out = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
final IItemList<IAEItemStack> out = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
if( tag == null )
{
@@ -1326,7 +1326,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
this.lastTime = System.nanoTime();
this.elapsedTime = 0;
final IItemList<IAEItemStack> list = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
final IItemList<IAEItemStack> list = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
this.getListOfItem( list, CraftingItemList.ACTIVE );
this.getListOfItem( list, CraftingItemList.PENDING );
@@ -87,7 +87,7 @@ public class QuantumCalculator extends MBCalculator
}
num++;
final IBlocks blocks = AEApi.instance().definitions().blocks();
final IBlocks blocks = Api.INSTANCE.definitions().blocks();
if( num == 5 )
{
if( !this.isBlockAtLocation( w, p, blocks.quantumLink() ) )
@@ -113,7 +113,7 @@ public class QuantumCluster implements ILocatable, IAECluster
}
}
final ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide );
final ILocatable myOtherSide = this.otherSide == 0 ? null : Api.INSTANCE.registries().locatable().getLocatableBy( this.otherSide );
boolean shutdown = false;
@@ -156,7 +156,7 @@ public class QuantumCluster implements ILocatable, IAECluster
}
}
sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance()
sideA.connection = sideB.connection = new ConnectionWrapper( Api.INSTANCE
.grid()
.createGridConnection( sideA.getNode(),
sideB.getNode() ) );
@@ -190,7 +190,7 @@ public class QuantumCluster implements ILocatable, IAECluster
private boolean canUseNode( final long qe )
{
final QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe );
final QuantumCluster qc = (QuantumCluster) Api.INSTANCE.registries().locatable().getLocatableBy( qe );
if( qc != null )
{
final World theWorld = qc.center.getWorld();
@@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Direction;
import appeng.api.AEApi;
import appeng.api.networking.GridFlags;
import appeng.api.networking.GridNotification;
import appeng.api.networking.IGrid;
@@ -147,7 +146,7 @@ public class AENetworkProxy implements IGridBlock
{
if( this.node == null && Platform.isServer() && this.isReady )
{
this.node = AEApi.instance().grid().createGridNode( this );
this.node = Api.INSTANCE.grid().createGridNode( this );
this.readFromNBT( this.data );
this.node.updateState();
}
@@ -38,7 +38,7 @@ import appeng.util.item.AEItemStack;
public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
{
private final IItemList<IAEItemStack> itemListCache = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
private final IItemList<IAEItemStack> itemListCache = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
protected CreativeCellInventory( final ItemStack o )
{
@@ -56,7 +56,7 @@ public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
public static ICellInventoryHandler getCell( final ItemStack o )
{
return new BasicCellInventoryHandler( new CreativeCellInventory( o ), AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
return new BasicCellInventoryHandler( new CreativeCellInventory( o ), Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) );
}
@Override
@@ -96,7 +96,7 @@ public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
@Override
public IStorageChannel getChannel()
{
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
}
@Override
@@ -48,7 +48,7 @@ import appeng.api.storage.data.IItemList;
public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack>, ITickingMonitor
{
private final IFluidHandler handler;
private final IItemList<IAEFluidStack> list = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createList();
private final IItemList<IAEFluidStack> list = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
private final HashMap<IMEMonitorHandlerReceiver<IAEFluidStack>, Object> listeners = new HashMap<>();
private final NavigableMap<Integer, CachedFluidStack> memory;
private IActionSource mySource;
@@ -120,7 +120,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack>, ITicki
@Override
public IStorageChannel getChannel()
{
return AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
}
@Override
@@ -169,7 +169,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack>, ITicki
if( newIS != null )
{
stack = ( old == null || old.aeStack == null ? AEApi.instance()
stack = ( old == null || old.aeStack == null ? Api.INSTANCE
.storage()
.getStorageChannel( IFluidStorageChannel.class )
.createStack( newIS ) : old.aeStack.copy() );
@@ -342,7 +342,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack>, ITicki
else
{
this.fluidStack = is.copy();
this.aeStack = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ).createStack( is );
this.aeStack = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createStack( is );
}
}
}
@@ -50,7 +50,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
{
private final InventoryAdaptor adaptor;
private final IItemList<IAEItemStack> list = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
private final IItemList<IAEItemStack> list = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
private final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap<>();
private final NavigableMap<Integer, CachedItemStack> memory;
private IActionSource mySource;
@@ -138,7 +138,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
@Override
public IStorageChannel getChannel()
{
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
}
@Override
@@ -182,7 +182,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
final int newSize = ( newIS.isEmpty() ? 0 : newIS.getCount() );
final int diff = newSize - ( oldIS.isEmpty() ? 0 : oldIS.getCount() );
final IAEItemStack stack = ( old == null || old.aeStack == null ? AEApi.instance()
final IAEItemStack stack = ( old == null || old.aeStack == null ? Api.INSTANCE
.storage()
.getStorageChannel( IItemStorageChannel.class )
.createStack( newIS ) : old.aeStack.copy() );
@@ -357,7 +357,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
else
{
this.itemStack = is.copy();
this.aeStack = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( is );
this.aeStack = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( is );
}
}
}
@@ -54,7 +54,7 @@ public class NullInventory<T extends IAEStack<T>> implements IMEInventoryHandler
@Override
public IStorageChannel getChannel()
{
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
}
@Override
@@ -39,7 +39,7 @@ import appeng.tile.misc.TileSecurityStation;
public class SecurityStationInventory implements IMEInventoryHandler<IAEItemStack>
{
private final IItemList<IAEItemStack> storedItems = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
private final IItemList<IAEItemStack> storedItems = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
private final TileSecurityStation securityTile;
public SecurityStationInventory( final TileSecurityStation ts )
@@ -52,7 +52,7 @@ public class SecurityStationInventory implements IMEInventoryHandler<IAEItemStac
{
if( this.hasPermission( src ) )
{
if( AEApi.instance().definitions().items().biometricCard().isSameAs( input.createItemStack() ) )
if( Api.INSTANCE.definitions().items().biometricCard().isSameAs( input.createItemStack() ) )
{
if( this.canAccept( input ) )
{
@@ -123,7 +123,7 @@ public class SecurityStationInventory implements IMEInventoryHandler<IAEItemStac
@Override
public IStorageChannel getChannel()
{
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
}
@Override
@@ -146,7 +146,7 @@ public class SecurityStationInventory implements IMEInventoryHandler<IAEItemStac
final IBiometricCard tbc = (IBiometricCard) input.getItem();
final GameProfile newUser = tbc.getProfile( input.createItemStack() );
final int PlayerID = AEApi.instance().registries().players().getID( newUser );
final int PlayerID = Api.INSTANCE.registries().players().getID( newUser );
if( this.securityTile.getOwner() == PlayerID )
{
return false;