Class EntityTrackerClientHandler

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

public class EntityTrackerClientHandler extends IArmorUpgradeClientHandler.AbstractHandler<EntityTrackerHandler>
  • Constructor Details

    • EntityTrackerClientHandler

      public EntityTrackerClientHandler()
  • 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
    • 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
    • getTargetsStream

      public Stream<RenderEntityTarget> getTargetsStream()
    • getTargetForEntity

      public RenderEntityTarget getTargetForEntity(net.minecraft.world.entity.Entity entity)
    • hack

      public void hack()
    • selectAsDebuggingTarget

      public void selectAsDebuggingTarget()
    • 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.
    • 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