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>
  • Constructor Details

    • CoreComponentsClientHandler

      public CoreComponentsClientHandler()
  • Method Details

    • getTriggerKeyBinding

      public Optional<net.minecraft.client.KeyMapping> getTriggerKeyBinding()
      Description copied from interface: IArmorUpgradeClientHandler
      Get 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

      public void onTriggered(ICommonArmorHandler armorHandler)
      Description copied from interface: IArmorUpgradeClientHandler
      Called when the registered triggered keybind (if any) is pressed.
      Parameters:
      armorHandler - the client-side common armor handler object for the player
    • tickClient

      public void tickClient(ICommonArmorHandler armorHandler, boolean isEnabled)
      Description copied from interface: IArmorUpgradeClientHandler
      This method is called every client tick, and should be used to update clientside logic for armor upgrades.
      Parameters:
      armorHandler - common armor handler for the player wearing this armor piece
      isEnabled - true if the upgrade is currently enabled, false otherwise
    • initConfig

      public void initConfig()
      Description copied from interface: IArmorUpgradeClientHandler
      This is called when a ModConfigEvent is received for the mod.
    • saveToConfig

      public void saveToConfig()
      Description copied from interface: IArmorUpgradeClientHandler
      When called this should save the settings to config.
    • isEnabledByDefault

      public boolean isEnabledByDefault()
      Description copied from interface: IArmorUpgradeClientHandler
      Is 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: IArmorUpgradeClientHandler
      Called in the 3D render stage (via RenderLevelStageEvent)
      Parameters:
      matrixStack - the matrix stack
      buffer - the render type buffer
      partialTicks - partial ticks since last world tick
    • render2D

      public void render2D(com.mojang.blaze3d.vertex.PoseStack matrixStack, float partialTicks, boolean armorPieceHasPressure)
      Description copied from interface: IArmorUpgradeClientHandler
      Called in the 2D render stage (via Forge's IGuiOverlay system).
      Parameters:
      matrixStack - the matrix stack
      partialTicks - partial ticks since last world tick
      armorPieceHasPressure - true if the armor piece actually has any pressure
    • getAnimatedStat

      public IGuiAnimatedStat getAnimatedStat()
      Description copied from interface: IArmorUpgradeClientHandler
      You can return a IGuiAnimatedStat here, 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 IGuiAnimatedStat field in your client upgrade handler, and lazy-init that in this method, also resetting the field to null in IArmorUpgradeClientHandler.onResolutionChanged().

      Returns:
      the animated stat, or null if this upgrade doesn't use/require a stat window
    • getDefaultStatLayout

      public StatPanelLayout getDefaultStatLayout()
      Description copied from interface: IArmorUpgradeClientHandler
      Return 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: IArmorUpgradeClientHandler
      Called 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

      public IOptionPage getGuiOptionsPage(IGuiScreen screen)
      Description copied from interface: IArmorUpgradeClientHandler
      When you have some configurable options for your upgrade handler, return a new instance of an 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.
      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: IArmorUpgradeClientHandler
      Called when the screen resolution has changed. Primarily intended to allow render handlers to recalculate stat positions.
    • getDefaultMessageLayout

      public static StatPanelLayout getDefaultMessageLayout()
    • getTestMessageStat

      public IGuiAnimatedStat getTestMessageStat()