Class CoreComponentsClientHandler
java.lang.Object
me.desht.pneumaticcraft.api.client.pneumatic_helmet.IArmorUpgradeClientHandler.AbstractHandler<CoreComponentsHandler>
me.desht.pneumaticcraft.client.pneumatic_armor.upgrade_handler.CoreComponentsClientHandler
- All Implemented Interfaces:
IArmorUpgradeClientHandler<CoreComponentsHandler>
public class CoreComponentsClientHandler
extends IArmorUpgradeClientHandler.AbstractHandler<CoreComponentsHandler>
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.api.client.pneumatic_helmet.IArmorUpgradeClientHandler
IArmorUpgradeClientHandler.AbstractHandler<T extends IArmorUpgradeHandler<?>>, IArmorUpgradeClientHandler.SimpleToggleableHandler<T extends IArmorUpgradeHandler<?>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionYou can return aIGuiAnimatedStathere, which the HUD Handler will pick up and render.static StatPanelLayoutReturn the default screen layout for this upgrade's stat panel, if it has one.getGuiOptionsPage(IGuiScreen screen) When you have some configurable options for your upgrade handler, return a new instance of anIOptionPage.Optional<net.minecraft.client.KeyMapping>Get the keybind used to trigger this upgrade's action, if any.voidThis is called when aModConfigEventis received for the mod.booleanIs this upgrade enabled by default, i.e.voidCalled when the screen resolution has changed.voidonTriggered(ICommonArmorHandler armorHandler) Called when the registered triggered keybind (if any) is pressed.voidrender2D(com.mojang.blaze3d.vertex.PoseStack matrixStack, float partialTicks, boolean armorPieceHasPressure) Called in the 2D render stage (via Forge'sIGuiOverlaysystem).voidrender3D(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, float partialTicks) Called in the 3D render stage (viaRenderLevelStageEvent)voidreset()Called when (re-)equipping the armor piece.voidWhen called this should save the settings to config.voidsetShowPressureNumerically(boolean showPressureNumerically) booleanvoidtickClient(ICommonArmorHandler armorHandler) This method is called every client tick, and should be used to update clientside logic for armor upgrades.Methods inherited from class me.desht.pneumaticcraft.api.client.pneumatic_helmet.IArmorUpgradeClientHandler.AbstractHandler
getCommonHandlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.api.client.pneumatic_helmet.IArmorUpgradeClientHandler
getID, getInitialKeyBinding, getKeybindCategory, getSubKeybindCategory, getSubKeybinds, isEnabledByDefault, isToggleable, setOverlayColor, tickClient
-
Constructor Details
-
CoreComponentsClientHandler
public CoreComponentsClientHandler()
-
-
Method Details
-
getTriggerKeyBinding
Description copied from interface:IArmorUpgradeClientHandlerGet the keybind used to trigger this upgrade's action, if any. This is distinct from the toggle keybind (which switches an upgrade on or off); the trigger keybind triggers an action, e.g. Hacking, Pneumatic Kick...- Returns:
- an optional keybinding name
-
onTriggered
Description copied from interface:IArmorUpgradeClientHandlerCalled when the registered triggered keybind (if any) is pressed.- Parameters:
armorHandler- the client-side common armor handler object for the player
-
tickClient
Description copied from interface:IArmorUpgradeClientHandlerThis method is called every client tick, and should be used to update clientside logic for armor upgrades. UnlikeIArmorUpgradeHandler.tick(ICommonArmorHandler, boolean), this method is only called for upgrades which are actually enabled (or not toggleable).- Parameters:
armorHandler- common armor handler for the player wearing this armor piece
-
initConfig
public void initConfig()Description copied from interface:IArmorUpgradeClientHandlerThis is called when aModConfigEventis received for the mod. -
saveToConfig
public void saveToConfig()Description copied from interface:IArmorUpgradeClientHandlerWhen called this should save the settings to config. -
isEnabledByDefault
public boolean isEnabledByDefault()Description copied from interface:IArmorUpgradeClientHandlerIs this upgrade enabled by default, i.e. when the player first equips the armor and there's no value saved in ArmorFeatureStatus.json?- Returns:
- whether the upgrade should be enabled by default
-
shouldShowPressureNumerically
public boolean shouldShowPressureNumerically() -
setShowPressureNumerically
public void setShowPressureNumerically(boolean showPressureNumerically) -
render3D
public void render3D(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, float partialTicks) Description copied from interface:IArmorUpgradeClientHandlerCalled in the 3D render stage (viaRenderLevelStageEvent)- Parameters:
matrixStack- the matrix stackbuffer- the render type bufferpartialTicks- partial ticks since last world tick
-
render2D
public void render2D(com.mojang.blaze3d.vertex.PoseStack matrixStack, float partialTicks, boolean armorPieceHasPressure) Description copied from interface:IArmorUpgradeClientHandlerCalled in the 2D render stage (via Forge'sIGuiOverlaysystem).- Parameters:
matrixStack- the matrix stackpartialTicks- partial ticks since last world tickarmorPieceHasPressure- true if the armor piece actually has any pressure
-
getAnimatedStat
Description copied from interface:IArmorUpgradeClientHandlerYou can return aIGuiAnimatedStathere, which the HUD Handler will pick up and render. It also automatically opens and closes the stat window as necessary.IClientArmorRegistry.makeHUDStatPanel(Component, ItemStack, IArmorUpgradeClientHandler)is a useful method for creating a panel.The recommended way to handle this is to have a
IGuiAnimatedStatfield in your client upgrade handler, and lazy-init that in this method, also resetting the field to null inIArmorUpgradeClientHandler.onResolutionChanged().- Returns:
- the animated stat, or null if this upgrade doesn't use/require a stat window
-
getDefaultStatLayout
Description copied from interface:IArmorUpgradeClientHandlerReturn the default screen layout for this upgrade's stat panel, if it has one. Note that the position is easily modifiable by the player using the "Move Screen..." button in the upgrade's GUI.If your handler doesn't have a stat panel (i.e.
IArmorUpgradeClientHandler.getAnimatedStat()returns null), you don't need to override this. If it does have a panel, it's recommended to override this with a reasonable default position.- Returns:
- the default position
-
reset
public void reset()Description copied from interface:IArmorUpgradeClientHandlerCalled when (re-)equipping the armor piece. Use this to clear any client-side state information held by the upgrade handler and initialise it to a known state. -
getGuiOptionsPage
Description copied from interface:IArmorUpgradeClientHandlerWhen you have some configurable options for your upgrade handler, return a new instance of anIOptionPage. 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.- Parameters:
screen- an instance of the gui Screen object- Returns:
- an options page, or null if the upgrade does not have an options page
-
onResolutionChanged
public void onResolutionChanged()Description copied from interface:IArmorUpgradeClientHandlerCalled when the screen resolution has changed. Primarily intended to allow render handlers to recalculate stat positions. -
getDefaultMessageLayout
-
getTestMessageStat
-