Search in sources :

Example 16 with HoverEvent

use of net.minecraft.util.text.event.HoverEvent in project RecurrentComplex by Ivorforce.

the class RCTextStyle method submit.

@Nonnull
public static ITextComponent submit(String id) {
    ITextComponent submit = ServerTranslations.get("reccomplex.save.submit");
    submit.getStyle().setColor(TextFormatting.AQUA);
    submit.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, ServerTranslations.get("reccomplex.save.submit.hover")));
    submit.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, Repository.submitURL(id)));
    return submit;
}
Also used : HoverEvent(net.minecraft.util.text.event.HoverEvent) ClickEvent(net.minecraft.util.text.event.ClickEvent) Nonnull(javax.annotation.Nonnull)

Example 17 with HoverEvent

use of net.minecraft.util.text.event.HoverEvent in project RecurrentComplex by Ivorforce.

the class RCTextStyle method structure.

public static ITextComponent structure(String id) {
    TextComponentString comp = new TextComponentString(id);
    comp.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/%s %s", RCCommands.lookup.getName(), id)));
    comp.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, ServerTranslations.get("commands.rcsearch.lookup")));
    comp.getStyle().setColor(TextFormatting.AQUA);
    return comp;
}
Also used : HoverEvent(net.minecraft.util.text.event.HoverEvent) ClickEvent(net.minecraft.util.text.event.ClickEvent)

Example 18 with HoverEvent

use of net.minecraft.util.text.event.HoverEvent in project RecurrentComplex by Ivorforce.

the class RCTextStyle method area.

public static ITextComponent area(BlockArea area) {
    ITextComponent component = ServerTranslations.format("commands.rcarea.get", pos(area.getPoint1()), pos(area.getPoint2()));
    component.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, ServerTranslations.get("commands.rcarea.select")));
    component.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/%s %s %d %d %d %d %d %d --first --second", RCCommands.select.getName(), RCCommands.select.set.getName(), area.getPoint1().getX(), area.getPoint1().getY(), area.getPoint1().getZ(), area.getPoint2().getX(), area.getPoint2().getY(), area.getPoint2().getZ())));
    return component;
}
Also used : HoverEvent(net.minecraft.util.text.event.HoverEvent) ClickEvent(net.minecraft.util.text.event.ClickEvent)

Aggregations

HoverEvent (net.minecraft.util.text.event.HoverEvent)18 ClickEvent (net.minecraft.util.text.event.ClickEvent)16 Nonnull (javax.annotation.Nonnull)7 TextComponentString (net.minecraft.util.text.TextComponentString)5 ITextComponent (net.minecraft.util.text.ITextComponent)4 RCEntityInfo (ivorius.reccomplex.capability.RCEntityInfo)1 RCParameters (ivorius.reccomplex.commands.parameters.RCParameters)1 WorldRandomData (ivorius.reccomplex.world.gen.feature.WorldRandomData)1 GenericStructure (ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)1 Metadata (ivorius.reccomplex.world.gen.feature.structure.generic.Metadata)1 IGrowable (net.minecraft.block.IGrowable)1 IBlockState (net.minecraft.block.state.IBlockState)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 WorldServer (net.minecraft.world.WorldServer)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1