Class JetBootsHandler
java.lang.Object
me.desht.pneumaticcraft.api.pneumatic_armor.BaseArmorUpgradeHandler<JetBootsHandler.JetBootsLocalState>
me.desht.pneumaticcraft.common.pneumatic_armor.handlers.JetBootsHandler
- All Implemented Interfaces:
IArmorUpgradeHandler<JetBootsHandler.JetBootsLocalState>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStuff that isn't sync'd like in JetBootsStateTracker but tracked internally on both client and server -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final net.minecraft.resources.ResourceLocationstatic final intFields inherited from interface me.desht.pneumaticcraft.api.pneumatic_armor.IArmorUpgradeHandler
UPGRADE_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet up player-specific extension data for this armor upgrade; since armor upgrade handlers are singleton objects, any player-specific data needs to be stored separately.net.minecraft.world.entity.EquipmentSlotGet the armor slot that this upgrade handler is attached to.net.minecraft.resources.ResourceLocationgetID()Get a unique ID for this upgrade handler.floatgetIdleAirUsage(ICommonArmorHandler armorHandler) Returns the usage in mL/tick when this upgrade handler is enabled.getJetBootsSyncedState(ICommonArmorHandler commonArmorHandler) Return the upgrades that are required to be in the armor piece to enable this module.voidonDataFieldUpdated(ICommonArmorHandler commonArmorHandler, String tagName, net.minecraft.nbt.Tag inbt) Called on both client and server when some NBT data is changed in this upgrade's armor itemstack.voidonInit(ICommonArmorHandler commonArmorHandler) Called when the armor is initialising and this upgrade is installed.voidonToggle(ICommonArmorHandler commonArmorHandler, boolean newState) Called when an upgrade is toggled on/off by the playervoidsetJetBootsActive(ICommonArmorHandler commonArmorHandler, boolean newActive) voidtick(ICommonArmorHandler commonArmorHandler, boolean enabled) Called every tick for a player when this upgrade is installed in their armorMethods inherited from class me.desht.pneumaticcraft.api.pneumatic_armor.BaseArmorUpgradeHandler
getIndex, setIndexMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.api.pneumatic_armor.IArmorUpgradeHandler
getMaxInstallableUpgrades, getMinimumPressure, getTranslationKey, onShutdown
-
Field Details
-
BUILDER_MODE_LEVEL
public static final int BUILDER_MODE_LEVEL- See Also:
-
STABILIZERS_LEVEL
public static final int STABILIZERS_LEVEL- See Also:
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
JetBootsHandler
public JetBootsHandler()
-
-
Method Details
-
getID
public net.minecraft.resources.ResourceLocation getID()Description copied from interface:IArmorUpgradeHandlerGet a unique ID for this upgrade handler.- Returns:
- a unique resource location
-
getRequiredUpgrades
Description copied from interface:IArmorUpgradeHandlerReturn the upgrades that are required to be in the armor piece to enable this module.- Returns:
- an array of required upgrades
-
getIdleAirUsage
Description copied from interface:IArmorUpgradeHandlerReturns the usage in mL/tick when this upgrade handler is enabled. Note this is constant usage just from the upgrade being switched on, and does not take into account air used when some action is taken, e.g. flying with the Jet Boots upgrade is not included here, but air used by the Entity Tracker upgrade is included.- Parameters:
armorHandler- the armor handler object (can be used to get upgrades, etc.)- Returns:
- usage in mL/tick
-
getEquipmentSlot
public net.minecraft.world.entity.EquipmentSlot getEquipmentSlot()Description copied from interface:IArmorUpgradeHandlerGet the armor slot that this upgrade handler is attached to.- Returns:
- the armor slot
-
extensionData
Description copied from interface:IArmorUpgradeHandlerSet up player-specific extension data for this armor upgrade; since armor upgrade handlers are singleton objects, any player-specific data needs to be stored separately. If your handler needs this (most don't), override this method to return a supplier of a new instance of some class that implementsIArmorExtensionData. This data will be stored in the common armor handler for the player, and can be retrieved withICommonArmorHandler.getExtensionData(IArmorUpgradeHandler).- Returns:
- a supplier for the extension data for this upgrade & player; supply null if there is none
-
tick
Description copied from interface:IArmorUpgradeHandlerCalled every tick for a player when this upgrade is installed in their armor- Parameters:
commonArmorHandler- the armor handler objectenabled- true if the upgrade is currently enabled, false otherwise
-
onInit
Description copied from interface:IArmorUpgradeHandlerCalled when the armor is initialising and this upgrade is installed.- Parameters:
commonArmorHandler- the armor handler object
-
onToggle
Description copied from interface:IArmorUpgradeHandlerCalled when an upgrade is toggled on/off by the player- Parameters:
commonArmorHandler- the armor handler objectnewState- the new state of the upgrade
-
onDataFieldUpdated
public void onDataFieldUpdated(ICommonArmorHandler commonArmorHandler, String tagName, net.minecraft.nbt.Tag inbt) Description copied from interface:IArmorUpgradeHandlerCalled on both client and server when some NBT data is changed in this upgrade's armor itemstack. Can be used to cache heavily-accessed NBT data for performance reasons.- Parameters:
commonArmorHandler- the armor handler objecttagName- the NBT tag nameinbt- the NBT data
-
setJetBootsActive
-
getJetBootsSyncedState
public JetBootsStateTracker.JetBootsState getJetBootsSyncedState(ICommonArmorHandler commonArmorHandler)
-