Class ButtonComponent
java.lang.Object
com.hrznstudio.titanium.component.button.ButtonComponent
- All Implemented Interfaces:
IScreenAddonProvider
- Direct Known Subclasses:
ArrowButtonComponent,RedstoneControlButtonComponent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetId()intgetPosX()intgetPosY()List<IFactory<? extends IScreenAddon>>intgetSizeX()intgetSizeY()voidonButtonClicked(net.minecraft.world.entity.player.Player entity, net.minecraft.nbt.CompoundTag information) setId(int id) 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
-
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
-
getScreenAddons
- Specified by:
getScreenAddonsin interfaceIScreenAddonProvider
-