Parts display correctly in WAILA
Register an method that can be overidden Register the same method in the interface New class that picks the item and displays it to WAILA Register the new class and call the other class method Import in PartWailaDataProvider Fixed errors Renamed all Display -> Stack Stuff
This commit is contained in:
@@ -39,6 +39,7 @@ import appeng.api.parts.IPart;
|
||||
import appeng.integration.modules.waila.part.ChannelWailaDataProvider;
|
||||
import appeng.integration.modules.waila.part.IPartWailaDataProvider;
|
||||
import appeng.integration.modules.waila.part.PartAccessor;
|
||||
import appeng.integration.modules.waila.part.PartStackWailaDataProvider;
|
||||
import appeng.integration.modules.waila.part.PowerStateWailaDataProvider;
|
||||
import appeng.integration.modules.waila.part.StorageMonitorWailaDataProvider;
|
||||
import appeng.integration.modules.waila.part.Tracer;
|
||||
@@ -76,13 +77,32 @@ public final class PartWailaDataProvider implements IWailaDataProvider
|
||||
final IPartWailaDataProvider channel = new ChannelWailaDataProvider();
|
||||
final IPartWailaDataProvider storageMonitor = new StorageMonitorWailaDataProvider();
|
||||
final IPartWailaDataProvider powerState = new PowerStateWailaDataProvider();
|
||||
final IPartWailaDataProvider partStack = new PartStackWailaDataProvider();
|
||||
|
||||
this.providers = Lists.newArrayList( channel, storageMonitor, powerState );
|
||||
this.providers = Lists.newArrayList( channel, storageMonitor, powerState, partStack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack( IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
final TileEntity te = accessor.getTileEntity();
|
||||
final MovingObjectPosition mop = accessor.getPosition();
|
||||
|
||||
final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
|
||||
|
||||
if( maybePart.isPresent() )
|
||||
{
|
||||
final IPart part = maybePart.get();
|
||||
|
||||
ItemStack wailaStack = null;
|
||||
|
||||
for( IPartWailaDataProvider provider : this.providers )
|
||||
{
|
||||
wailaStack = provider.getWailaStack( part, config, wailaStack );
|
||||
}
|
||||
return wailaStack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user