Search in sources :

Example 1 with IWailaConfigHandler

use of mcp.mobius.waila.api.IWailaConfigHandler in project Totemic by TeamTotemic.

the class WailaTotemBase method getWailaBody.

@Override
@Nonnull
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
    TileTotemBase tile = (TileTotemBase) accessor.getTileEntity();
    if (tile.getState() instanceof StateSelection) {
        String selectors = ((StateSelection) tile.getState()).getSelectors().stream().map(instr -> I18n.format(instr.getUnlocalizedName())).collect(Collectors.joining(", "));
        currenttip.add(I18n.format("totemicmisc.selection", selectors));
    } else if (tile.getState() instanceof StateStartup) {
        Ceremony ceremony = ((StateStartup) tile.getState()).getCeremony();
        currenttip.add(I18n.format("totemic.waila.ceremonyStartup", I18n.format(ceremony.getUnlocalizedName())));
    } else if (tile.getState() instanceof StateCeremonyEffect) {
        Ceremony ceremony = ((StateCeremonyEffect) tile.getState()).getCeremony();
        currenttip.add(I18n.format("totemic.waila.ceremonyEffect", I18n.format(ceremony.getUnlocalizedName())));
    }
    return currenttip;
}
Also used : Ceremony(pokefenn.totemic.api.ceremony.Ceremony) Collectors(java.util.stream.Collectors) IWailaConfigHandler(mcp.mobius.waila.api.IWailaConfigHandler) I18n(net.minecraft.client.resources.I18n) ItemStack(net.minecraft.item.ItemStack) List(java.util.List) StateCeremonyEffect(pokefenn.totemic.tileentity.totem.StateCeremonyEffect) IWailaDataAccessor(mcp.mobius.waila.api.IWailaDataAccessor) StateStartup(pokefenn.totemic.tileentity.totem.StateStartup) StateSelection(pokefenn.totemic.tileentity.totem.StateSelection) Nonnull(javax.annotation.Nonnull) IWailaDataProvider(mcp.mobius.waila.api.IWailaDataProvider) TileTotemBase(pokefenn.totemic.tileentity.totem.TileTotemBase) TileTotemBase(pokefenn.totemic.tileentity.totem.TileTotemBase) StateStartup(pokefenn.totemic.tileentity.totem.StateStartup) StateCeremonyEffect(pokefenn.totemic.tileentity.totem.StateCeremonyEffect) StateSelection(pokefenn.totemic.tileentity.totem.StateSelection) Ceremony(pokefenn.totemic.api.ceremony.Ceremony) Nonnull(javax.annotation.Nonnull)

Aggregations

List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Nonnull (javax.annotation.Nonnull)1 IWailaConfigHandler (mcp.mobius.waila.api.IWailaConfigHandler)1 IWailaDataAccessor (mcp.mobius.waila.api.IWailaDataAccessor)1 IWailaDataProvider (mcp.mobius.waila.api.IWailaDataProvider)1 I18n (net.minecraft.client.resources.I18n)1 ItemStack (net.minecraft.item.ItemStack)1 Ceremony (pokefenn.totemic.api.ceremony.Ceremony)1 StateCeremonyEffect (pokefenn.totemic.tileentity.totem.StateCeremonyEffect)1 StateSelection (pokefenn.totemic.tileentity.totem.StateSelection)1 StateStartup (pokefenn.totemic.tileentity.totem.StateStartup)1 TileTotemBase (pokefenn.totemic.tileentity.totem.TileTotemBase)1