Interface ICommonArmorRegistry

All Known Implementing Classes:
CommonArmorRegistry

public interface ICommonArmorRegistry
Retrieve an instance of this via PneumaticRegistry.IPneumaticCraftInterface.getCommonArmorRegistry()

Contains some common registration & query methods for Pneumatic Armor.

  • Method Details

    • registerUpgradeHandler

      @Nonnull <T extends IArmorUpgradeHandler<?>> T registerUpgradeHandler(@Nonnull T handler)
      Register a common (client and server) handler for a Pneumatic Armor upgrade. This must be called from a FMLCommonSetupEvent handler (do not use ParallelDispatchEvent.enqueueWork(Runnable)).
      Parameters:
      handler - the handler to register
    • getCommonArmorHandler

      @Nonnull ICommonArmorHandler getCommonArmorHandler(net.minecraft.world.entity.player.Player player)
      Retrieve the ICommonArmorHandler for the given player. Note that this will return a non-null result even if the player isn't currently wearing any Pneumatic Armor.
      Parameters:
      player - the player who is wearing one or more pieces of Pneumatic Armor
      Returns:
      the common armor handler
    • addHackable

      void addHackable(@Nonnull Class<? extends net.minecraft.world.entity.Entity> entityClazz, @Nonnull Supplier<? extends IHackableEntity> iHackable)
      Register a "foreign" entity with your hackable. This should be used for entities you didn't create, i.e. vanilla or from a different mod. For your own entities, just have your entity implement IHackableEntity.

      This must be called from a FMLCommonSetupEvent handler (it is not necessary to use ParallelDispatchEvent.enqueueWork(Runnable)).

      Parameters:
      entityClazz - entity class; subclasses of this entity will also be affected
      iHackable - the hack to register
    • addHackable

      void addHackable(@Nonnull net.minecraft.world.level.block.Block block, @Nonnull Supplier<? extends IHackableBlock> iHackable)
      Register a "foreign" block with your hackable. This should be used for blocks you didn't create, i.e. vanilla or from a different mod. For your own blocks, just have your block implement IHackableBlock.

      This must be called from a FMLCommonSetupEvent handler (it is not necessary to use ParallelDispatchEvent.enqueueWork(Runnable)).

      Parameters:
      block - the block class; subclasses of this block will also be affected
      iHackable - the hack to register
    • addHackable

      void addHackable(@Nonnull net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> blockTag, @Nonnull Supplier<? extends IHackableBlock> iHackable)
      Register a block tag with your hackable. By default, the vanilla doors, buttons & trapdoors block tags are registered, meaning any block added to any of those tags (e.g. modded doors) will also be considered hackable.

      This must be called from a FMLCommonSetupEvent handler (it is not necessary to use ParallelDispatchEvent.enqueueWork(Runnable)).

      Parameters:
      blockTag - the block tag to register
      iHackable - the hack to register
    • getCurrentEntityHacks

      @Nonnull List<IHackableEntity> getCurrentEntityHacks(@Nonnull net.minecraft.world.entity.Entity entity)
      Get a list of all current successful hacks on a given entity. This is used for example in Enderman hacking, so the user can only hack an enderman once (more times wouldn't have any effect). This is mostly used for display purposes.
      Parameters:
      entity - the entity to check
      Returns:
      a list of hacks currently on the entity, or an empty list if no hacks
    • registerBlockTrackerLootable

      void registerBlockTrackerLootable(BiConsumer<net.minecraft.world.entity.player.Player,net.minecraft.world.level.block.entity.BlockEntity> consumer)
      Register a block entity as being able to have a loot table for the purposes of dungeon-style loot generation. This is for the benefit of the Pneumatic Helmet Block Tracker module (inventory scanning).

      The supplied consumer must check that the block entity is of the appropriate type, and that the player may loot the chest (e.g. vanilla locking is honoured), and if so generate the chest's loot as if the player had just opened the chest.

      Vanilla chests and PneumaticCraft chests are registered with this by default; this method can be used for third party mods which add chests or other inventories with their own custom loot tables.

      Parameters:
      consumer - consumer accepting a player (who is doing the scanning) and the block entity of interest