This commit is contained in:
Salomão
2021-04-10 09:30:44 -03:00
parent 6ca3e6e696
commit 63616e5730
4 changed files with 157 additions and 11 deletions
@@ -401,10 +401,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
}
// Check via cap for IItemRepository
IItemRepository handlerRepo = target.getCapability( ITEM_REPOSITORY_CAPABILITY, targetSide );
if( handlerRepo != null )
if (ITEM_REPOSITORY_CAPABILITY != null && target.hasCapability( ITEM_REPOSITORY_CAPABILITY, targetSide ))
{
return new ItemRepositoryAdapter( handlerRepo, this );
IItemRepository handlerRepo = target.getCapability( ITEM_REPOSITORY_CAPABILITY, targetSide );
if( handlerRepo != null )
{
return new ItemRepositoryAdapter( handlerRepo, this );
}
}
// Check via cap for IItemHandler
IItemHandler handlerExt = target.getCapability( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, targetSide );
@@ -431,11 +434,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
return Objects.hash( target, target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) );
}
final IItemRepository handlerRepo = target.getCapability( ITEM_REPOSITORY_CAPABILITY, targetSide );
if( handlerRepo != null )
if (ITEM_REPOSITORY_CAPABILITY != null && target.hasCapability( ITEM_REPOSITORY_CAPABILITY, targetSide ))
{
return Objects.hash( target, handlerRepo, handlerRepo.getAllItems().size() );
final IItemRepository handlerRepo = target.getCapability( ITEM_REPOSITORY_CAPABILITY, targetSide );
if( handlerRepo != null )
{
return Objects.hash( target, handlerRepo, handlerRepo.getAllItems().size() );
}
}
final IItemHandler itemHandler = target.getCapability( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, targetSide );
@@ -47,7 +47,7 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
{
if( te != null )
{
if( te.hasCapability( ITEM_REPOSITORY_CAPABILITY, d ) )
if( ITEM_REPOSITORY_CAPABILITY != null && te.hasCapability( ITEM_REPOSITORY_CAPABILITY, d ) )
{
IItemRepository itemRepository = te.getCapability( ITEM_REPOSITORY_CAPABILITY, d );
if (itemRepository != null){