Storage grid can now properly see crafting grid.
This commit is contained in:
parent
168309ee50
commit
ef4cab8f61
6
me/cache/CraftingCache.java
vendored
6
me/cache/CraftingCache.java
vendored
|
@ -47,10 +47,11 @@ public class CraftingCache implements IGridCache, ICraftingProviderHelper, ICell
|
|||
grid = g;
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void afterCacheConstruction(MENetworkPostCacheConstruction cc)
|
||||
{
|
||||
IStorageGrid sg = grid.getCache( IStorageGrid.class );
|
||||
sg.addCellProvider( this );
|
||||
sg.registerCellProvider( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -173,7 +174,8 @@ public class CraftingCache implements IGridCache, ICraftingProviderHelper, ICell
|
|||
public List<IMEInventoryHandler> getCellArray(StorageChannel channel)
|
||||
{
|
||||
ArrayList<IMEInventoryHandler> list = new ArrayList<IMEInventoryHandler>( 1 );
|
||||
list.add( this );
|
||||
if ( channel == StorageChannel.ITEMS )
|
||||
list.add( this );
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
14
me/cache/GridStorageCache.java
vendored
14
me/cache/GridStorageCache.java
vendored
|
@ -62,6 +62,19 @@ public class GridStorageCache implements IStorageGrid
|
|||
}
|
||||
|
||||
@Override
|
||||
public void registerCellProvider(ICellProvider provider)
|
||||
{
|
||||
inactiveCellProviders.add( provider );
|
||||
addCellProvider( provider );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterCellProvider(ICellProvider provider)
|
||||
{
|
||||
removeCellProvider( provider );
|
||||
inactiveCellProviders.remove( provider );
|
||||
}
|
||||
|
||||
public void addCellProvider(ICellProvider cc)
|
||||
{
|
||||
if ( inactiveCellProviders.contains( cc ) )
|
||||
|
@ -85,7 +98,6 @@ public class GridStorageCache implements IStorageGrid
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCellProvider(ICellProvider cc)
|
||||
{
|
||||
if ( activeCellProviders.contains( cc ) )
|
||||
|
|
Loading…
Reference in a new issue