Class ButtonComponent

java.lang.Object
com.hrznstudio.titanium.component.button.ButtonComponent
All Implemented Interfaces:
IScreenAddonProvider
Direct Known Subclasses:
ArrowButtonComponent, RedstoneControlButtonComponent

public class ButtonComponent extends Object implements IScreenAddonProvider
  • Constructor Details

    • ButtonComponent

      public ButtonComponent(int posX, int posY, int sizeX, int sizeY)
  • Method Details

    • setPredicate

      public ButtonComponent setPredicate(BiConsumer<net.minecraft.world.entity.player.Player,net.minecraft.nbt.CompoundTag> serverPredicate)
      Sets a predicate that will be runned in the server when the button is clicked in the client
      Parameters:
      serverPredicate - A predicate that has a NBTTagCompound with client information
      Returns:
      itself
    • onButtonClicked

      public void onButtonClicked(net.minecraft.world.entity.player.Player entity, net.minecraft.nbt.CompoundTag information)
    • getPosX

      public int getPosX()
    • getPosY

      public int getPosY()
    • getSizeX

      public int getSizeX()
    • getSizeY

      public int getSizeY()
    • getId

      public int getId()
    • setId

      public ButtonComponent setId(int id)
    • getScreenAddons

      public List<IFactory<? extends IScreenAddon>> getScreenAddons()
      Specified by:
      getScreenAddons in interface IScreenAddonProvider