public interface IArmorUpgradeClientHandler<T extends IArmorUpgradeHandler<?>>
IArmorUpgradeClientHandler.AbstractHandler or IArmorUpgradeClientHandler.SimpleToggleableHandler rather than implement this interface directly.| Modifier and Type | Interface and Description |
|---|---|
static class |
IArmorUpgradeClientHandler.AbstractHandler<T extends IArmorUpgradeHandler<?>>
Convenience class which allows a reference to the common upgrade handler to be passed in and retrieved.
|
static class |
IArmorUpgradeClientHandler.SimpleToggleableHandler<T extends IArmorUpgradeHandler<?>>
Convenience class for simple toggleable armor features with no additional settings.
|
| Modifier and Type | Method and Description |
|---|---|
default IGuiAnimatedStat |
getAnimatedStat()
You can return a
IGuiAnimatedStat here, which the HUD Handler will pick up and render. |
T |
getCommonHandler()
Get the common handler corresponding to this client handler.
|
IOptionPage |
getGuiOptionsPage(IGuiScreen screen)
When you have some configurable options for your upgrade handler, return a new instance of an
IOptionPage. |
default java.util.Optional<net.minecraft.client.settings.KeyBinding> |
getInitialKeyBinding()
Get the default keybinding for toggling this upgrade on/off.
|
default java.lang.String |
getKeybindCategory()
Get the keybind category for this upgrade.
|
default java.lang.String |
getSubKeybindCategory()
Get the keybind category for any sub-keybinds.
|
default java.util.Collection<net.minecraft.util.ResourceLocation> |
getSubKeybinds()
Get all the sub-keybinds for this upgrade handler.
|
default java.util.Optional<net.minecraft.client.settings.KeyBinding> |
getTriggerKeyBinding()
Get the keybind used to trigger this upgrade's action, if any.
|
default void |
initConfig()
This is called when a
ModConfig.ModConfigEvent is received for the mod. |
default boolean |
isToggleable()
Is this upgrade toggleable, i.e.
|
default void |
onResolutionChanged()
Called when the screen resolution has changed.
|
default void |
onTriggered(ICommonArmorHandler armorHandler)
Called when the registered triggered keybind (if any) is pressed.
|
void |
render2D(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
float partialTicks,
boolean armorPieceHasPressure)
Called in the 2D render stage (via
RenderGameOverlayEvent.Post) |
void |
render3D(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
net.minecraft.client.renderer.IRenderTypeBuffer buffer,
float partialTicks)
Called in the 3D render stage (via
RenderWorldLastEvent) |
void |
reset()
Called when (re-)equipping the armor piece.
|
default void |
saveToConfig()
When called this should save the settings to config.
|
default void |
setOverlayColor(int color)
Called when the player alters their eyepiece color in the Pneumatic Armor GUI "Colors..." screen to re-color any
stat this client handler displays.
|
void |
tickClient(ICommonArmorHandler armorHandler)
This method is called every client tick, and should be used to update clientside logic for armor upgrades.
|
T getCommonHandler()
default void initConfig()
ModConfig.ModConfigEvent is received for the mod.default void saveToConfig()
void tickClient(ICommonArmorHandler armorHandler)
IArmorUpgradeHandler.tick(ICommonArmorHandler, boolean), this method is only called for upgrades
which are actually enabled (or not toggleable).armorHandler - common armor handler for the player wearing this armor piecevoid render3D(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
net.minecraft.client.renderer.IRenderTypeBuffer buffer,
float partialTicks)
RenderWorldLastEvent)matrixStack - the matrix stackbuffer - the render type bufferpartialTicks - partial ticks since last world tickvoid render2D(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
float partialTicks,
boolean armorPieceHasPressure)
RenderGameOverlayEvent.Post)matrixStack - the matrix stackpartialTicks - partial ticks since last world tickarmorPieceHasPressure - true if the armor piece actually has any pressuredefault IGuiAnimatedStat getAnimatedStat()
IGuiAnimatedStat here, which the HUD Handler will pick up and render. It also
automatically opens and closes the stat window as necessary.void reset()
IOptionPage getGuiOptionsPage(IGuiScreen screen)
IOptionPage.
When you do so, it will automatically get picked up by the armor GUI handler, and a button for the upgrade
will be displayed in the main armor GUI.screen - an instance of the gui Screen objectdefault void onResolutionChanged()
default boolean isToggleable()
default java.util.Optional<net.minecraft.client.settings.KeyBinding> getInitialKeyBinding()
You should not override this default implementation. Non-toggleable upgrades return Optional.empty()
by default.
default java.util.Collection<net.minecraft.util.ResourceLocation> getSubKeybinds()
default java.util.Optional<net.minecraft.client.settings.KeyBinding> getTriggerKeyBinding()
default void onTriggered(ICommonArmorHandler armorHandler)
armorHandler - the client-side common armor handler object for the playerdefault java.lang.String getKeybindCategory()
default java.lang.String getSubKeybindCategory()
default void setOverlayColor(int color)
color - the new color for the stat display, as chosen by the player