Enum Class CommonArmorRegistry
- All Implemented Interfaces:
Serializable,Comparable<CommonArmorRegistry>,Constable,ICommonArmorRegistry
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Map<Class<? extends net.minecraft.world.entity.Entity>,Supplier<? extends IHackableEntity>> final Map<net.minecraft.resources.ResourceLocation,Supplier<? extends IHackableEntity>> -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHackable(Class<? extends net.minecraft.world.entity.Entity> entityClazz, Supplier<? extends IHackableEntity> iHackable) Register a "foreign" entity with your hackable.voidaddHackable(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> blockTag, Supplier<? extends IHackableBlock> iHackable) Register a block tag with your hackable.voidaddHackable(net.minecraft.world.level.block.Block block, Supplier<? extends IHackableBlock> iHackable) Register a "foreign" block with your hackable.getCommonArmorHandler(net.minecraft.world.entity.player.Player player) Retrieve theICommonArmorHandlerfor the given player.getCurrentEntityHacks(net.minecraft.world.entity.Entity entity) Get a list of all current successful hacks on a given entity.getHackable(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player) getHackable(net.minecraft.world.level.block.Block block) getHackableForId(net.minecraft.resources.ResourceLocation id) static CommonArmorRegistryvoidregisterBlockTrackerLootable(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.<T extends IArmorUpgradeHandler<?>>
TregisterUpgradeHandler(T handler) Register a common (client and server) handler for a Pneumatic Armor upgrade.voidNon-API.static CommonArmorRegistryReturns the enum constant of this class with the specified name.static CommonArmorRegistry[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
hackableEntities
public final Map<Class<? extends net.minecraft.world.entity.Entity>,Supplier<? extends IHackableEntity>> hackableEntities -
idToEntityHackables
public final Map<net.minecraft.resources.ResourceLocation,Supplier<? extends IHackableEntity>> idToEntityHackables
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getInstance
-
registerUpgradeHandler
Description copied from interface:ICommonArmorRegistryRegister a common (client and server) handler for a Pneumatic Armor upgrade. This must be called from aFMLCommonSetupEventhandler (do not useParallelDispatchEvent.enqueueWork(Runnable)).- Specified by:
registerUpgradeHandlerin interfaceICommonArmorRegistry- Parameters:
handler- the handler to register
-
getCommonArmorHandler
Description copied from interface:ICommonArmorRegistryRetrieve theICommonArmorHandlerfor the given player. Note that this will return a non-null result even if the player isn't currently wearing any Pneumatic Armor.- Specified by:
getCommonArmorHandlerin interfaceICommonArmorRegistry- Parameters:
player- the player who is wearing one or more pieces of Pneumatic Armor- Returns:
- the common armor handler
-
addHackable
public void addHackable(Class<? extends net.minecraft.world.entity.Entity> entityClazz, Supplier<? extends IHackableEntity> iHackable) Description copied from interface:ICommonArmorRegistryRegister 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 implementIHackableEntity.This must be called from a
FMLCommonSetupEventhandler (it is not necessary to useParallelDispatchEvent.enqueueWork(Runnable)).- Specified by:
addHackablein interfaceICommonArmorRegistry- Parameters:
entityClazz- entity class; subclasses of this entity will also be affectediHackable- the hack to register
-
addHackable
public void addHackable(net.minecraft.world.level.block.Block block, Supplier<? extends IHackableBlock> iHackable) Description copied from interface:ICommonArmorRegistryRegister 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 implementIHackableBlock.This must be called from a
FMLCommonSetupEventhandler (it is not necessary to useParallelDispatchEvent.enqueueWork(Runnable)).- Specified by:
addHackablein interfaceICommonArmorRegistry- Parameters:
block- the block class; subclasses of this block will also be affectediHackable- the hack to register
-
addHackable
public void addHackable(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> blockTag, Supplier<? extends IHackableBlock> iHackable) Description copied from interface:ICommonArmorRegistryRegister 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
FMLCommonSetupEventhandler (it is not necessary to useParallelDispatchEvent.enqueueWork(Runnable)).- Specified by:
addHackablein interfaceICommonArmorRegistry- Parameters:
blockTag- the block tag to registeriHackable- the hack to register
-
getCurrentEntityHacks
Description copied from interface:ICommonArmorRegistryGet 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.- Specified by:
getCurrentEntityHacksin interfaceICommonArmorRegistry- Parameters:
entity- the entity to check- Returns:
- a list of hacks currently on the entity, or an empty list if no hacks
-
registerBlockTrackerLootable
public void registerBlockTrackerLootable(BiConsumer<net.minecraft.world.entity.player.Player, net.minecraft.world.level.block.entity.BlockEntity> consumer) Description copied from interface:ICommonArmorRegistryRegister 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.
- Specified by:
registerBlockTrackerLootablein interfaceICommonArmorRegistry- Parameters:
consumer- consumer accepting a player (who is doing the scanning) and the block entity of interest
-
resolveBlockTags
public void resolveBlockTags()Non-API. Called when a TagsUpdatedEvent is received, on both server and client, to refresh the actual blocks referred to by the tags we've registered. -
getHackable
-
getHackable
public IHackableEntity getHackable(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player) -
getHackableForId
-