mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-17 21:35:13 +00:00
GUI Api
This commit is contained in:
1 parent
8c2c226d34
commit
a876b4d191
9 files changed
+933
-193
No files matched your search
@@ -2,38 +2,136 @@ package noppes.npcs.api.gui;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Base interface for all custom GUI components.
|
||||
* Defines common methods for position, appearance, and NBT serialization.
|
||||
*/
|
||||
public interface ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the unique ID of this component.
|
||||
*
|
||||
* @return the component ID.
|
||||
*/
|
||||
int getID();
|
||||
|
||||
/**
|
||||
* Sets the unique ID for this component.
|
||||
*
|
||||
* @param id the new ID.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setID(int id);
|
||||
|
||||
/**
|
||||
* Returns the x position of this component.
|
||||
*
|
||||
* @return the x position.
|
||||
*/
|
||||
int getPosX();
|
||||
|
||||
/**
|
||||
* Returns the y position of this component.
|
||||
*
|
||||
* @return the y position.
|
||||
*/
|
||||
int getPosY();
|
||||
|
||||
/**
|
||||
* Sets the position of the component.
|
||||
*
|
||||
* @param x the new x position.
|
||||
* @param y the new y position.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setPos(int x, int y);
|
||||
|
||||
/**
|
||||
* Checks if the component has hover text.
|
||||
*
|
||||
* @return true if hover text is set.
|
||||
*/
|
||||
boolean hasHoverText();
|
||||
|
||||
/**
|
||||
* Returns the hover text as an array of strings.
|
||||
*
|
||||
* @return the hover text.
|
||||
*/
|
||||
String[] getHoverText();
|
||||
|
||||
/**
|
||||
* Sets the hover text with a single line.
|
||||
*
|
||||
* @param hoverText the hover text.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setHoverText(String hoverText);
|
||||
|
||||
/**
|
||||
* Sets the hover text with multiple lines.
|
||||
*
|
||||
* @param hoverTextLines the hover text lines.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setHoverText(String[] hoverTextLines);
|
||||
|
||||
/**
|
||||
* Returns the text color.
|
||||
*
|
||||
* @return the color as an integer.
|
||||
*/
|
||||
int getColor();
|
||||
|
||||
/**
|
||||
* Sets the text color.
|
||||
*
|
||||
* @param color the color.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setColor(int color);
|
||||
|
||||
float getAlpha();
|
||||
/**
|
||||
* Returns the component's transparency (alpha).
|
||||
*
|
||||
* @return the alpha value.
|
||||
*/
|
||||
float getAlpha();
|
||||
|
||||
/**
|
||||
* Sets the component's transparency (alpha).
|
||||
*
|
||||
* @param alpha the alpha value.
|
||||
*/
|
||||
void setAlpha(float alpha);
|
||||
|
||||
/**
|
||||
* Returns the component's rotation.
|
||||
*
|
||||
* @return the rotation angle.
|
||||
*/
|
||||
float getRotation();
|
||||
|
||||
/**
|
||||
* Sets the component's rotation.
|
||||
*
|
||||
* @param rotation the rotation angle.
|
||||
*/
|
||||
void setRotation(float rotation);
|
||||
|
||||
/**
|
||||
* Serializes the component to an NBT compound.
|
||||
*
|
||||
* @param nbt the NBT compound to populate.
|
||||
* @return the NBT compound.
|
||||
*/
|
||||
NBTTagCompound toNBT(NBTTagCompound nbt);
|
||||
|
||||
/**
|
||||
* Deserializes the component from an NBT compound.
|
||||
*
|
||||
* @param nbt the NBT compound.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent fromNBT(NBTTagCompound nbt);
|
||||
}
|
||||
Reference in new issue
Block a user