Enum Class ClientArmorRegistry
java.lang.Object
java.lang.Enum<ClientArmorRegistry>
me.desht.pneumaticcraft.client.pneumatic_armor.ClientArmorRegistry
- All Implemented Interfaces:
Serializable,Comparable<ClientArmorRegistry>,Constable,IClientArmorRegistry
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.api.client.pneumatic_helmet.IClientArmorRegistry
IClientArmorRegistry.BlockTrackerFocus -
Enum Constant Summary
Enum Constants -
Field Summary
Fields inherited from interface me.desht.pneumaticcraft.api.client.pneumatic_helmet.IClientArmorRegistry
DEFAULT_MESSAGE_BGCOLOR -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHUDMessage(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 displayGet the block position and face that is currently focused on by the player via the Block Tracker upgrade.getClientHandler(net.minecraft.resources.ResourceLocation id) <C extends IArmorUpgradeClientHandler<U>,U extends IArmorUpgradeHandler<?>>
CgetClientHandler(U armorUpgradeHandler, Class<C> clientClass) getHandlersForSlot(net.minecraft.world.entity.EquipmentSlot slot) Get all the client handlers for the given armor slot.static ClientArmorRegistrynet.minecraft.client.KeyMappinggetKeybindingForUpgrade(net.minecraft.resources.ResourceLocation upgradeID) getTriggeredHandler(net.minecraft.client.KeyMapping keyBinding) makeHUDStatPanel(net.minecraft.network.chat.Component title, net.minecraft.resources.ResourceLocation icon, IArmorUpgradeClientHandler<?> clientHandler) Just likeIClientArmorRegistry.makeHUDStatPanel(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.voidvoidregisterBlockTrackEntry(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.voidvoid<T extends IArmorUpgradeHandler<?>>
voidregisterUpgradeHandler(T handler, IArmorUpgradeClientHandler<T> clientHandler) Registers the client handler for a Pneumatic Armor upgrade.static ClientArmorRegistryReturns the enum constant of this class with the specified name.static ClientArmorRegistry[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface me.desht.pneumaticcraft.api.client.pneumatic_helmet.IClientArmorRegistry
addHUDMessage
-
Enum Constant Details
-
INSTANCE
-
-
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
-
registerEntityTrackEntry
Description copied from interface:IClientArmorRegistryRegister an entity tracker for the Pneumatic Helmet. Call this fromFMLCommonSetupEventlistener (do not useParallelDispatchEvent.enqueueWork(Runnable)).- Specified by:
registerEntityTrackEntryin interfaceIClientArmorRegistry- Parameters:
entry- the entity tracker
-
registerBlockTrackEntry
public void registerBlockTrackEntry(net.minecraft.resources.ResourceLocation id, Supplier<? extends IBlockTrackEntry> entry) Description copied from interface:IClientArmorRegistryRegister 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)).- Specified by:
registerBlockTrackEntryin interfaceIClientArmorRegistry- Parameters:
id- the block entry IDentry- the block track entry (IBlockTrackEntry.getEntryID()must return the same ID as theidparameter
-
addHUDMessage
public void addHUDMessage(net.minecraft.network.chat.Component title, List<net.minecraft.network.chat.Component> message, int duration, int backColor) Description copied from interface:IClientArmorRegistryAdd a message for display in the Pneumatic Helmet HUD display- Specified by:
addHUDMessagein interfaceIClientArmorRegistry- 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)
-
registerUpgradeHandler
public <T extends IArmorUpgradeHandler<?>> void registerUpgradeHandler(T handler, IArmorUpgradeClientHandler<T> clientHandler) Description copied from interface:IClientArmorRegistryRegisters 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().- Specified by:
registerUpgradeHandlerin interfaceIClientArmorRegistry- Parameters:
handler- the common upgrade handler, previously registered withclientHandler- the client handler to register with the common upgrade handler
-
makeKeybindingButton
Description copied from interface:IClientArmorRegistryCreate 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.- Specified by:
makeKeybindingButtonin interfaceIClientArmorRegistry- Parameters:
yPos- y position of the buttonkeyBinding- the keybinding modified by the button- Returns:
- the new button
-
makeKeybindingCheckBox
public ICheckboxWidget makeKeybindingCheckBox(net.minecraft.resources.ResourceLocation upgradeId, int xPos, int yPos, int color, Consumer<ICheckboxWidget> onPressed) Description copied from interface:IClientArmorRegistryCreate 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.- Specified by:
makeKeybindingCheckBoxin interfaceIClientArmorRegistry- 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
public IGuiAnimatedStat makeHUDStatPanel(net.minecraft.network.chat.Component title, net.minecraft.world.item.ItemStack icon, IArmorUpgradeClientHandler<?> clientHandler) Description copied from interface:IClientArmorRegistryCreate 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.- Specified by:
makeHUDStatPanelin interfaceIClientArmorRegistry- 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
public IGuiAnimatedStat makeHUDStatPanel(net.minecraft.network.chat.Component title, net.minecraft.resources.ResourceLocation icon, IArmorUpgradeClientHandler<?> clientHandler) Description copied from interface:IClientArmorRegistryJust likeIClientArmorRegistry.makeHUDStatPanel(Component, ItemStack, IArmorUpgradeClientHandler)but you can pass an arbitrary texture to use as the icon. The texture should be 16x16.- Specified by:
makeHUDStatPanelin interfaceIClientArmorRegistry- 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
public net.minecraft.client.gui.components.AbstractWidget makeStatMoveButton(int x, int y, IArmorUpgradeClientHandler<?> handler) Description copied from interface:IClientArmorRegistryCreate 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.- Specified by:
makeStatMoveButtonin interfaceIClientArmorRegistry- Parameters:
x- button X positiony- button Y positionhandler- the client upgrade handler (can be obtained viaIOptionPage.SimpleOptionPage.getClientUpgradeHandler()- Returns:
- the button
-
getBlockTrackerFocus
Description copied from interface:IClientArmorRegistryGet 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 returnOptional.empty().- Specified by:
getBlockTrackerFocusin interfaceIClientArmorRegistry- Returns:
- the block and face the player is currently looking at, or Optional.empty() if not focused on a block
-
registerSubKeyBinds
public void registerSubKeyBinds() -
registerKeybindsWithMinecraft
public void registerKeybindsWithMinecraft() -
getKeybindingForUpgrade
public net.minecraft.client.KeyMapping getKeybindingForUpgrade(net.minecraft.resources.ResourceLocation upgradeID) -
getClientHandler
public <C extends IArmorUpgradeClientHandler<U>,U extends IArmorUpgradeHandler<?>> C getClientHandler(U armorUpgradeHandler, Class<C> clientClass) -
getClientHandler
-
getTriggeredHandler
public Optional<IArmorUpgradeClientHandler<?>> getTriggeredHandler(net.minecraft.client.KeyMapping keyBinding) -
getHandlersForSlot
public List<IArmorUpgradeClientHandler<?>> getHandlersForSlot(net.minecraft.world.entity.EquipmentSlot slot) Get all the client handlers for the given armor slot. This is guaranteed to be in exactly the same order as the common handlers for the same slot (as returned byArmorUpgradeRegistry.getHandlersForSlot(EquipmentSlot)- Parameters:
slot- the slot to query- Returns:
- a list of all the client upgrade handlers registered for that slot
-
refreshConfig
public void refreshConfig()
-