Interface IPneumaticHelmetRegistry
- All Known Implementing Classes:
PneumaticHelmetRegistry
public interface IPneumaticHelmetRegistry
Retrieve an instance of this via
PneumaticRegistry.IPneumaticCraftInterface.getHelmetRegistry()
Note: despite the name of this interface, it is for used for all armor pieces. The name is historical.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHackable(Class<? extends net.minecraft.world.entity.Entity> entityClazz, Supplier<? extends IHackableEntity> iHackable) Deprecated, for removal: This API element is subject to removal in a future version.voidaddHackable(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> blockTag, Supplier<? extends IHackableBlock> iHackable) Deprecated, for removal: This API element is subject to removal in a future version.voidaddHackable(net.minecraft.world.level.block.Block block, Supplier<? extends IHackableBlock> iHackable) Deprecated, for removal: This API element is subject to removal in a future version.default voidaddHUDMessage(net.minecraft.network.chat.Component title) Convenience version ofaddHUDMessage(Component, List, int, int)which displays a one-line message for 2.5 seconds, using the default green background colourvoidaddHUDMessage(net.minecraft.network.chat.Component title, List<net.minecraft.network.chat.Component> message, int duration, int backColor) Add a message for display in the Pneumatic Helmet HUD displayorg.apache.commons.lang3.tuple.Pair<net.minecraft.core.BlockPos,net.minecraft.core.Direction> Get the block position and face that is currently focused on by the player via the Block Tracker upgrade.getCurrentEntityHacks(net.minecraft.world.entity.Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.makeHUDStatPanel(net.minecraft.network.chat.Component title, net.minecraft.resources.ResourceLocation icon, IArmorUpgradeClientHandler<?> clientHandler) Just likemakeHUDStatPanel(Component, ItemStack, IArmorUpgradeClientHandler)but you can pass an arbitrary texture to use as the icon.makeHUDStatPanel(net.minecraft.network.chat.Component title, net.minecraft.world.item.ItemStack icon, IArmorUpgradeClientHandler<?> clientHandler) Create a stat panel for display on the Pneumatic Armor HUD.makeKeybindingButton(int yPos, net.minecraft.client.KeyMapping keyBinding) Create a new keybinding button for anIOptionPagearmor GUI screen.makeKeybindingCheckBox(net.minecraft.resources.ResourceLocation upgradeId, int xPos, int yPos, int color, Consumer<ICheckboxWidget> onPressed) Create or retrieve the toggle checkbox for the given upgrade.net.minecraft.client.gui.components.AbstractWidgetmakeStatMoveButton(int x, int y, IArmorUpgradeClientHandler<?> handler) Create a "Move Stat Screen..." button to allow the stat panel for an upgrade to be moved.default voidDeprecated, for removal: This API element is subject to removal in a future version.voidregisterBlockTrackEntry(net.minecraft.resources.ResourceLocation id, Supplier<? extends IBlockTrackEntry> entry) Register an block track entry (i.e.voidregisterEntityTrackEntry(Supplier<? extends IEntityTrackEntry> entry) Register an entity tracker for the Pneumatic Helmet.<T extends IArmorUpgradeHandler<?>>
voidregisterRenderHandler(T handler, IArmorUpgradeClientHandler<T> clientHandler) Registers the client handler for a Pneumatic Armor upgrade.voidregisterUpgradeHandler(IArmorUpgradeHandler<?> handler) Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
DEFAULT_MESSAGE_BGCOLOR
static final int DEFAULT_MESSAGE_BGCOLOR- See Also:
-
-
Method Details
-
registerEntityTrackEntry
Register an entity tracker for the Pneumatic Helmet. Call this fromFMLCommonSetupEventlistener (do not useParallelDispatchEvent.enqueueWork(Runnable)).- Parameters:
entry- the entity tracker
-
registerBlockTrackEntry
void registerBlockTrackEntry(net.minecraft.resources.ResourceLocation id, Supplier<? extends IBlockTrackEntry> entry) Register an block track entry (i.e. a subcategory of the Block Tracker) for the Pneumatic Helmet. Call this from aFMLClientSetupEventlistener (do not useParallelDispatchEvent.enqueueWork(Runnable)).- Parameters:
id- the block entry IDentry- the block track entry (IBlockTrackEntry.getEntryID()must return the same ID as theidparameter
-
registerBlockTrackEntry
Deprecated, for removal: This API element is subject to removal in a future version.Register a block tracker for the Pneumatic Helmet- Parameters:
entry- the block tracker
-
addHUDMessage
void addHUDMessage(net.minecraft.network.chat.Component title, List<net.minecraft.network.chat.Component> message, int duration, int backColor) Add a message for display in the Pneumatic Helmet HUD display- Parameters:
title- the message titlemessage- the message text (can be empty if the title suffices for a one-line message)duration- the duration in ticks for the message to be displayedbackColor- the message background color, including alpha (DEFAULT_MESSAGE_BGCOLOR is the default green color used by most messages)
-
addHUDMessage
default void addHUDMessage(net.minecraft.network.chat.Component title) Convenience version ofaddHUDMessage(Component, List, int, int)which displays a one-line message for 2.5 seconds, using the default green background colour- Parameters:
title- the message
-
addHackable
@Deprecated(forRemoval=true) void addHackable(Class<? extends net.minecraft.world.entity.Entity> entityClazz, Supplier<? extends IHackableEntity> iHackable) Deprecated, for removal: This API element is subject to removal in a future version.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 implementIHackableEntity- Parameters:
entityClazz- entity class; subclasses of this entity will also be affectediHackable- the hack to register
-
addHackable
@Deprecated(forRemoval=true) void addHackable(@Nonnull net.minecraft.world.level.block.Block block, @Nonnull Supplier<? extends IHackableBlock> iHackable) Deprecated, for removal: This API element is subject to removal in a future version.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 implementIHackableBlock- Parameters:
block- the block class; subclasses of this block will also be affectediHackable- the hack to register
-
addHackable
@Deprecated(forRemoval=true) void addHackable(@Nonnull net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> blockTag, @Nonnull Supplier<? extends IHackableBlock> iHackable) Deprecated, for removal: This API element is subject to removal in a future version.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.- Parameters:
blockTag- the block tag to registeriHackable- the hack to register
-
getCurrentEntityHacks
@Deprecated(forRemoval=true) List<IHackableEntity> getCurrentEntityHacks(net.minecraft.world.entity.Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.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:
- empty list if no hacks.
-
registerUpgradeHandler
Deprecated, for removal: This API element is subject to removal in a future version.Register a common (client and server) handler for a Pneumatic Armor upgrade. This must be called from aFMLCommonSetupEventhandler (it is not necessary to useParallelDispatchEvent.enqueueWork(Runnable)).- Parameters:
handler- the handler to register
-
registerRenderHandler
<T extends IArmorUpgradeHandler<?>> void registerRenderHandler(T handler, IArmorUpgradeClientHandler<T> clientHandler) Registers the client handler for a Pneumatic Armor upgrade. This must be called from aFMLClientSetupEventhandler; do not useParallelDispatchEvent.enqueueWork(Runnable). This also registers any keybindings referenced by the render handler (seeIArmorUpgradeClientHandler.getInitialKeyBinding()andIArmorUpgradeClientHandler.getSubKeybinds().- Parameters:
handler- the common upgrade handler, previously registered withclientHandler- the client handler to register with the common upgrade handler
-
makeKeybindingButton
Create a new keybinding button for anIOptionPagearmor GUI screen. This is intended to be called fromIOptionPage.populateGui(IGuiScreen)to set up a button which can be used to change a particular key binding.- Parameters:
yPos- y position of the buttonkeyBinding- the keybinding modified by the button- Returns:
- the new button
-
makeKeybindingCheckBox
ICheckboxWidget makeKeybindingCheckBox(net.minecraft.resources.ResourceLocation upgradeId, int xPos, int yPos, int color, Consumer<ICheckboxWidget> onPressed) Create or retrieve the toggle checkbox for the given upgrade. If the checkbox doesn't already exist, it will be created; if it exists, the existing checkbox will be returned. There is only ever one toggle checkbox in existence for any given upgrade ID / clientside upgrade handler.This is intended to be called from
IOptionPage.populateGui(IGuiScreen)when creating the GUI for an upgrade handler.- Parameters:
upgradeId- the upgrade IDxPos- X position of the widgetyPos- Y position of the widgetcolor- widget's text color in ARGB formatonPressed- called when the checkbox is toggled
-
makeHUDStatPanel
IGuiAnimatedStat makeHUDStatPanel(net.minecraft.network.chat.Component title, net.minecraft.world.item.ItemStack icon, IArmorUpgradeClientHandler<?> clientHandler) Create a stat panel for display on the Pneumatic Armor HUD.This panel is automatically coloured according to the player's armor eyepiece color setting, and is re-positionable by the player. See
IArmorUpgradeClientHandler.getDefaultStatLayout()to define the default positioning for the panel.- Parameters:
title- title text to display on the staticon- an icon to draw next to the titleclientHandler- the client upgrade handler this panel is associated with- Returns:
- the stat panel
-
makeHUDStatPanel
IGuiAnimatedStat makeHUDStatPanel(net.minecraft.network.chat.Component title, net.minecraft.resources.ResourceLocation icon, IArmorUpgradeClientHandler<?> clientHandler) Just likemakeHUDStatPanel(Component, ItemStack, IArmorUpgradeClientHandler)but you can pass an arbitrary texture to use as the icon. The texture should be 16x16.- Parameters:
title- title text to display on the staticon- an icon to draw next to the titleclientHandler- the client upgrade handler this panel is associated with- Returns:
- the stat panel
-
makeStatMoveButton
net.minecraft.client.gui.components.AbstractWidget makeStatMoveButton(int x, int y, IArmorUpgradeClientHandler<?> handler) Create a "Move Stat Screen..." button to allow the stat panel for an upgrade to be moved. Clicking this button will automatically open the stat panel configuration GUI and allow the panel to be moved.Call this from
IOptionPage.populateGui(IGuiScreen), and pass the return value toIGuiScreen.addWidget(AbstractWidget)to add this button to your upgrade GUI.- Parameters:
x- button X positiony- button Y positionhandler- the client upgrade handler (can be obtained viaIOptionPage.SimpleOptionPage.getClientUpgradeHandler()- Returns:
- the button
-
getBlockTrackerFocus
org.apache.commons.lang3.tuple.Pair<net.minecraft.core.BlockPos,net.minecraft.core.Direction> getBlockTrackerFocus()Get the block position and face that is currently focused on by the player via the Block Tracker upgrade. If the Block Tracker isn't currently active or the player isn't currently looking at a block which is of interest to the block tracker, this will return (null,null).- Returns:
- a pair of position and facing
-
ICommonArmorRegistry.addHackable(Class, Supplier)