Class BlockTrackerClientHandler

java.lang.Object
me.desht.pneumaticcraft.api.client.pneumatic_helmet.IArmorUpgradeClientHandler.AbstractHandler<BlockTrackerHandler>
me.desht.pneumaticcraft.client.pneumatic_armor.upgrade_handler.BlockTrackerClientHandler
All Implemented Interfaces:
IArmorUpgradeClientHandler<BlockTrackerHandler>

public class BlockTrackerClientHandler extends IArmorUpgradeClientHandler.AbstractHandler<BlockTrackerHandler>
  • Constructor Details

    • BlockTrackerClientHandler

      public BlockTrackerClientHandler()
  • Method Details

    • 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
    • getFocusedPos

      public net.minecraft.core.BlockPos getFocusedPos()
    • getFocusedFace

      public net.minecraft.core.Direction getFocusedFace()
    • countBlockTrackersOfType

      public int countBlockTrackersOfType(IBlockTrackEntry type)
    • 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(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, boolean armorPieceHasPressure)
      Description copied from interface: IArmorUpgradeClientHandler
      Called in the 2D render stage (via Forge's IGuiOverlay system).
      Parameters:
      graphics - the matrix stack
      partialTicks - partial ticks since last world tick
      armorPieceHasPressure - true if the armor piece actually has any pressure
    • 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
    • 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
    • hack

      public void hack()
    • getTargetForCoord

      public RenderBlockTarget getTargetForCoord(net.minecraft.core.BlockPos pos)
    • scroll

      public boolean scroll(net.minecraftforge.client.event.InputEvent.MouseScrollingEvent event)
    • 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.
    • getSubKeybinds

      public Collection<net.minecraft.resources.ResourceLocation> getSubKeybinds()
      Description copied from interface: IArmorUpgradeClientHandler
      Get all the sub-keybinds for this upgrade handler. The ID's of any checkboxes which toggle a sub-feature of this upgrade (e.g. the various Block Tracker categories, or the Jet Boots builder mode) need to be returned here so a key binding can be registered for them.

      The ID's returned here are the same as those passed to IClientArmorRegistry.makeKeybindingCheckBox(ResourceLocation, int, int, int, Consumer).

      Returns:
      a collection of ID's
    • getSubKeybindCategory

      public String getSubKeybindCategory()
      Description copied from interface: IArmorUpgradeClientHandler
      Get the keybind category for any sub-keybinds. By default, this is the same as the default category for all PneumaticCraft keybinds.
      Returns:
      a keybind category ID
    • setOverlayColor

      public void setOverlayColor(int color)
      Description copied from interface: IArmorUpgradeClientHandler
      Called when the player alters their eyepiece color in the Pneumatic Armor GUI "Colors..." screen to re-color any stat this client handler displays. The default implementation works for most cases, but if your handler displays extra stats (like the Entity or Block tracker does), override this method to re-color them too.
      Parameters:
      color - the new color for the stat display, as chosen by the player