Search in sources :

Example 6 with Ceremony

use of pokefenn.totemic.api.ceremony.Ceremony 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

Ceremony (pokefenn.totemic.api.ceremony.Ceremony)6 ResourceLocation (net.minecraft.util.ResourceLocation)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 StateCeremonyEffect (pokefenn.totemic.tileentity.totem.StateCeremonyEffect)2 StateStartup (pokefenn.totemic.tileentity.totem.StateStartup)2 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 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 AbstractCriterionInstance (net.minecraft.advancements.critereon.AbstractCriterionInstance)1 Minecraft (net.minecraft.client.Minecraft)1 FontRenderer (net.minecraft.client.gui.FontRenderer)1 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)1 Tessellator (net.minecraft.client.renderer.Tessellator)1 I18n (net.minecraft.client.resources.I18n)1 ItemStack (net.minecraft.item.ItemStack)1 BlockPos (net.minecraft.util.math.BlockPos)1