java.lang.Object
me.desht.pneumaticcraft.client.render.pneumatic_armor.block_tracker.BlockTrackEntryMobSpawner
All Implemented Interfaces:
IBlockTrackEntry

public class BlockTrackEntryMobSpawner extends Object implements IBlockTrackEntry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addInformation(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.entity.BlockEntity te, net.minecraft.core.Direction face, List<net.minecraft.network.chat.Component> infoList)
    This method is called each client tick to retrieve the block's additional information.
    net.minecraft.resources.ResourceLocation
    Return a unique identifier for this block track entry.
    List<net.minecraft.core.BlockPos>
    getServerUpdatePositions(net.minecraft.world.level.block.entity.BlockEntity te)
    This method controls whether to send server update requests, at 3 second intervals while the player is looking at the block.
    boolean
    shouldTrackWithThisEntry(net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.entity.BlockEntity te)
    This method should return true if the block at the coordinate checked is one that should be tracked.
    int
    The return of this method defines at how many tracked blocks of this type the HUD should stop displaying text at the tracked blocks of this type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ID

      public static final net.minecraft.resources.ResourceLocation ID
  • Constructor Details

    • BlockTrackEntryMobSpawner

      public BlockTrackEntryMobSpawner()
  • Method Details

    • shouldTrackWithThisEntry

      public boolean shouldTrackWithThisEntry(net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.entity.BlockEntity te)
      Description copied from interface: IBlockTrackEntry
      This method should return true if the block at the coordinate checked is one that should be tracked. This is often as simple as just checking the block type, but could be more complex for some trackers, i.e. checking if a certain capability exists on the block entity. This gets called a lot when the block tracker is active, so keep it as simple as possible.
      Specified by:
      shouldTrackWithThisEntry in interface IBlockTrackEntry
      Parameters:
      world - the world
      pos - the blockpos
      state - blockstate at this blockpos
      te - the block entity at this blockpos (may be null)
      Returns:
      true if this block should be tracked by this BlockTrackEntry
    • getServerUpdatePositions

      public List<net.minecraft.core.BlockPos> getServerUpdatePositions(net.minecraft.world.level.block.entity.BlockEntity te)
      Description copied from interface: IBlockTrackEntry
      This method controls whether to send server update requests, at 3 second intervals while the player is looking at the block. This is specifically aimed at Block Entities, as the server will send an NBT update packet in response. Return an empty list if no updates are needed, otherwise a (possibly immutable) list of the block positions for which updates should be requested (in most cases, only the BE's own block pos, but potentially others for multiblocks like the vanilla double chest)
      Specified by:
      getServerUpdatePositions in interface IBlockTrackEntry
      Parameters:
      te - the block entity at the currently checked location, may be null
      Returns:
      a list of the block positions for which update request packets should be sent
    • spamThreshold

      public int spamThreshold()
      Description copied from interface: IBlockTrackEntry
      The return of this method defines at how many tracked blocks of this type the HUD should stop displaying text at the tracked blocks of this type.
      Specified by:
      spamThreshold in interface IBlockTrackEntry
      Returns:
      amount of blocks the HUD should stop displaying the block info.
    • addInformation

      public void addInformation(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.entity.BlockEntity te, net.minecraft.core.Direction face, List<net.minecraft.network.chat.Component> infoList)
      Description copied from interface: IBlockTrackEntry
      This method is called each client tick to retrieve the block's additional information. The method behaves much the same as Item.appendHoverText(ItemStack, Level, List, TooltipFlag). This method is only called if IBlockTrackEntry.shouldTrackWithThisEntry(BlockGetter, BlockPos, BlockState, BlockEntity) returned true, and the player is currently focused on the block.
      Specified by:
      addInformation in interface IBlockTrackEntry
      Parameters:
      world - the world
      pos - the blockpos
      te - the block entity at this blockpos (may be null)
      face - the block face the player is looking at (null if player is not looking directly at the block)
      infoList - list of text to add information to
    • getEntryID

      public net.minecraft.resources.ResourceLocation getEntryID()
      Description copied from interface: IBlockTrackEntry
      Return a unique identifier for this block track entry. This is also used for translation key and keybind naming purposes; see IArmorUpgradeHandler.getStringKey(ResourceLocation)
      Specified by:
      getEntryID in interface IBlockTrackEntry
      Returns:
      the ID of this entry