public class CommonArmorHandler extends java.lang.Object implements ICommonArmorHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
CommonArmorHandler.ClientListeners |
static class |
CommonArmorHandler.Listeners |
| Modifier and Type | Field and Description |
|---|---|
static float |
CRITICAL_PRESSURE |
static float |
LOW_PRESSURE |
| Modifier and Type | Method and Description |
|---|---|
float |
addAir(net.minecraft.inventory.EquipmentSlotType slot,
int airAmount)
Add (or remove) air from the armor piece in the given slot.
|
float |
getArmorPressure(net.minecraft.inventory.EquipmentSlotType slot)
Get the pressure for the armor piece in the given equipment slot.
|
<T extends IArmorExtensionData> |
getExtensionData(IArmorUpgradeHandler<T> handler)
Get the per-player extension data for the given upgrade, if any
|
static CommonArmorHandler |
getHandlerForPlayer() |
static CommonArmorHandler |
getHandlerForPlayer(net.minecraft.entity.player.PlayerEntity player) |
float |
getIdleAirUsage(net.minecraft.inventory.EquipmentSlotType slot,
boolean countDisabled) |
net.minecraft.entity.player.PlayerEntity |
getPlayer()
Get the player wearing this armor
|
int |
getSpeedFromUpgrades(net.minecraft.inventory.EquipmentSlotType slot)
Convenience method to get the speed boost for the given armor piece, which is 1 + {number_of_speed_upgrades}
|
int |
getStartupTime(net.minecraft.inventory.EquipmentSlotType slot) |
int |
getTicksSinceEquipped(net.minecraft.inventory.EquipmentSlotType slot) |
int |
getUpgradeCount(net.minecraft.inventory.EquipmentSlotType slot,
EnumUpgrade upgrade)
Get the number of the given upgrade installed in the given armor slot
|
int |
getUpgradeCount(net.minecraft.inventory.EquipmentSlotType slot,
EnumUpgrade upgrade,
int max) |
boolean |
hasMinPressure(net.minecraft.inventory.EquipmentSlotType slot)
Check that the armor in the given is above the minimum pressure limit to operate
|
void |
initArmorInventory(net.minecraft.inventory.EquipmentSlotType slot)
Called on the first tick after the armor piece is equipped.
|
void |
invalidate() |
boolean |
isArmorEnabled()
Check if the armor master switch is enabled (i.e.
|
boolean |
isArmorReady(net.minecraft.inventory.EquipmentSlotType slot) |
boolean |
isUpgradeEnabled(net.minecraft.inventory.EquipmentSlotType slot,
int featureIndex) |
boolean |
isUpgradeInserted(net.minecraft.inventory.EquipmentSlotType slot,
int featureIndex) |
boolean |
isValid() |
void |
setUpgradeEnabled(net.minecraft.inventory.EquipmentSlotType slot,
byte featureIndex,
boolean state) |
void |
tickArmorPiece(net.minecraft.inventory.EquipmentSlotType slot) |
boolean |
upgradeUsable(IArmorUpgradeHandler<?> upgrade,
boolean mustBeActive)
Validate that the given upgrade can currently be used.
|
public static final float CRITICAL_PRESSURE
public static final float LOW_PRESSURE
public static CommonArmorHandler getHandlerForPlayer(net.minecraft.entity.player.PlayerEntity player)
public static CommonArmorHandler getHandlerForPlayer()
public <T extends IArmorExtensionData> T getExtensionData(IArmorUpgradeHandler<T> handler)
ICommonArmorHandlergetExtensionData in interface ICommonArmorHandlerT - handler typehandler - the armor upgrade handlerpublic void tickArmorPiece(net.minecraft.inventory.EquipmentSlotType slot)
public float getIdleAirUsage(net.minecraft.inventory.EquipmentSlotType slot,
boolean countDisabled)
public float addAir(net.minecraft.inventory.EquipmentSlotType slot,
int airAmount)
ICommonArmorHandleraddAir in interface ICommonArmorHandlerslot - the slotairAmount - amount to add (negative amounts remove air)public void initArmorInventory(net.minecraft.inventory.EquipmentSlotType slot)
slot - the equipment slotpublic net.minecraft.entity.player.PlayerEntity getPlayer()
ICommonArmorHandlergetPlayer in interface ICommonArmorHandlerpublic int getUpgradeCount(net.minecraft.inventory.EquipmentSlotType slot,
EnumUpgrade upgrade)
ICommonArmorHandlergetUpgradeCount in interface ICommonArmorHandlerslot - the equipment slot (must be one of HEAD, CHEST, LEGS or FEET)upgrade - the upgrade to querypublic int getUpgradeCount(net.minecraft.inventory.EquipmentSlotType slot,
EnumUpgrade upgrade,
int max)
public boolean isUpgradeInserted(net.minecraft.inventory.EquipmentSlotType slot,
int featureIndex)
public boolean isUpgradeEnabled(net.minecraft.inventory.EquipmentSlotType slot,
int featureIndex)
public void setUpgradeEnabled(net.minecraft.inventory.EquipmentSlotType slot,
byte featureIndex,
boolean state)
public int getTicksSinceEquipped(net.minecraft.inventory.EquipmentSlotType slot)
public int getSpeedFromUpgrades(net.minecraft.inventory.EquipmentSlotType slot)
ICommonArmorHandlergetSpeedFromUpgrades in interface ICommonArmorHandlerslot - the equipment slotpublic int getStartupTime(net.minecraft.inventory.EquipmentSlotType slot)
public boolean isArmorReady(net.minecraft.inventory.EquipmentSlotType slot)
public float getArmorPressure(net.minecraft.inventory.EquipmentSlotType slot)
ICommonArmorHandlergetArmorPressure in interface ICommonArmorHandlerslot - the equipment slotpublic boolean isArmorEnabled()
ICommonArmorHandlerisArmorEnabled in interface ICommonArmorHandlerpublic boolean isValid()
public void invalidate()
public boolean hasMinPressure(net.minecraft.inventory.EquipmentSlotType slot)
ICommonArmorHandlerhasMinPressure in interface ICommonArmorHandlerslot - the slotpublic boolean upgradeUsable(IArmorUpgradeHandler<?> upgrade, boolean mustBeActive)
mustBeActiveupgradeUsable in interface ICommonArmorHandlerupgrade - the upgrade to checkmustBeActive - true if the upgrade must be switched on, false otherwise