Class MinigunItem
java.lang.Object
net.minecraft.world.item.Item
me.desht.pneumaticcraft.common.item.PressurizableItem
me.desht.pneumaticcraft.common.item.minigun.MinigunItem
- All Implemented Interfaces:
IFOVModifierItem,IInventoryItem,IPressurizableItem,IChargeableContainerProvider,IShiftScrollable,net.minecraft.world.flag.FeatureElement,net.minecraft.world.item.Vanishable,net.minecraft.world.level.ItemLike,net.minecraftforge.common.extensions.IForgeItem
public class MinigunItem
extends PressurizableItem
implements IChargeableContainerProvider, IFOVModifierItem, IInventoryItem, IShiftScrollable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class net.minecraft.world.item.Item
net.minecraft.world.item.Item.PropertiesNested classes/interfaces inherited from interface me.desht.pneumaticcraft.common.item.IChargeableContainerProvider
IChargeableContainerProvider.Provider -
Field Summary
FieldsFields inherited from class net.minecraft.world.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZEFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackfinishUsingItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level worldIn, net.minecraft.world.entity.LivingEntity entityLiving) net.minecraft.world.MenuProviderGet a container provider for this itemfloatgetFOVModifier(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.EquipmentSlot slot) Get the FOV modifer for the given item stack.net.minecraft.network.chat.ComponentGet a header for the inventory list, for tooltip purposes.static intgetLockedSlot(net.minecraft.world.item.ItemStack stack) getMagazine(net.minecraft.world.item.ItemStack stack) getMinigun(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player) voidgetStacksInItem(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> curStacks) intgetUseDuration(net.minecraft.world.item.ItemStack stack) voidinitializeClient(Consumer<net.minecraftforge.client.extensions.common.IClientItemExtensions> consumer) voidinventoryTick(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world, net.minecraft.world.entity.Entity entity, int slot, boolean currentItem) voidonEquipmentChange(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack stack, boolean equipping) Called on server only, when player equips or unequips a minigunvoidonShiftScrolled(net.minecraft.world.entity.player.Player player, boolean forward, net.minecraft.world.InteractionHand hand) Called both client- and server-side when a player shift-scrolls the mouse wheel, while holding an item which implements this interface.voidonUseTick(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int pRemainingUseDuration) booleanshouldCauseReequipAnimation(net.minecraft.world.item.ItemStack oldStack, net.minecraft.world.item.ItemStack newStack, boolean slotChanged) net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack>use(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand handIn) Methods inherited from class me.desht.pneumaticcraft.common.item.PressurizableItem
getAir, getBarColor, getBarWidth, getBaseVolume, getEnchantmentValue, getMaxPressure, getShareTag, getVolumeUpgrades, initCapabilities, isBarVisible, isEnchantable, roundedPressureMethods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getFoodProperties, getId, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, hasCraftingRemainingItem, hurtEnemy, interactLivingEntity, isComplex, isCorrectToolForDrops, isEdible, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onDestroyed, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, requiredFeatures, shouldOverrideMultiplayerNbt, toString, useOn, useOnRelease, verifyTagAfterLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakResetMethods inherited from interface me.desht.pneumaticcraft.api.item.IInventoryItem
getTooltipPrefixMethods inherited from interface me.desht.pneumaticcraft.api.pressure.IPressurizableItem
getEffectiveVolume, getPressure
-
Field Details
-
MAGAZINE_SIZE
public static final int MAGAZINE_SIZE- See Also:
-
NBT_LOCKED_SLOT
- See Also:
-
OWNING_PLAYER_ID
- See Also:
-
-
Constructor Details
-
MinigunItem
public MinigunItem()
-
-
Method Details
-
initializeClient
public void initializeClient(Consumer<net.minecraftforge.client.extensions.common.IClientItemExtensions> consumer) - Overrides:
initializeClientin classnet.minecraft.world.item.Item
-
getMagazine
-
onEquipmentChange
public void onEquipmentChange(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack stack, boolean equipping) Called on server only, when player equips or unequips a minigun- Parameters:
player- the playerstack- the minigun itemequipping- true if equipping, false if unequipping
-
getUseDuration
public int getUseDuration(net.minecraft.world.item.ItemStack stack) - Overrides:
getUseDurationin classnet.minecraft.world.item.Item
-
inventoryTick
public void inventoryTick(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world, net.minecraft.world.entity.Entity entity, int slot, boolean currentItem) - Overrides:
inventoryTickin classnet.minecraft.world.item.Item
-
getMinigun
public Minigun getMinigun(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player) -
use
public net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack> use(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand handIn) - Overrides:
usein classnet.minecraft.world.item.Item
-
onUseTick
public void onUseTick(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int pRemainingUseDuration) - Overrides:
onUseTickin classnet.minecraft.world.item.Item
-
finishUsingItem
public net.minecraft.world.item.ItemStack finishUsingItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level worldIn, net.minecraft.world.entity.LivingEntity entityLiving) - Overrides:
finishUsingItemin classnet.minecraft.world.item.Item
-
shouldCauseReequipAnimation
public boolean shouldCauseReequipAnimation(net.minecraft.world.item.ItemStack oldStack, net.minecraft.world.item.ItemStack newStack, boolean slotChanged) - Specified by:
shouldCauseReequipAnimationin interfacenet.minecraftforge.common.extensions.IForgeItem- Overrides:
shouldCauseReequipAnimationin classPressurizableItem
-
getFOVModifier
public float getFOVModifier(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.EquipmentSlot slot) Description copied from interface:IFOVModifierItemGet the FOV modifer for the given item stack. Lower values zoom in.- Specified by:
getFOVModifierin interfaceIFOVModifierItem- Parameters:
stack- the equipped itemplayer- the player who has the item equippedslot- the equipment slot- Returns:
- the FOV modifier
-
getStacksInItem
public void getStacksInItem(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> curStacks) - Specified by:
getStacksInItemin interfaceIInventoryItem- Parameters:
stack- Item that potentially has an inventory.curStacks- List of all currently added stacks for this item. Add more stacks in here in your implementation when found the right item.
-
getInventoryHeader
public net.minecraft.network.chat.Component getInventoryHeader()Description copied from interface:IInventoryItemGet a header for the inventory list, for tooltip purposes. Default return of null will not add any header.- Specified by:
getInventoryHeaderin interfaceIInventoryItem- Returns:
- a header string (can be a translation string), or null for no header
-
getContainerProvider
Description copied from interface:IChargeableContainerProviderGet a container provider for this item- Specified by:
getContainerProviderin interfaceIChargeableContainerProvider- Parameters:
te- the charging station that the item is in- Returns:
- the container provider
-
onShiftScrolled
public void onShiftScrolled(net.minecraft.world.entity.player.Player player, boolean forward, net.minecraft.world.InteractionHand hand) Description copied from interface:IShiftScrollableCalled both client- and server-side when a player shift-scrolls the mouse wheel, while holding an item which implements this interface.- Specified by:
onShiftScrolledin interfaceIShiftScrollable- Parameters:
player- player doing the shift-scrollingforward- true if the mouse wheel was rotated up, false if rotated downhand- hand in which the item is held
-
getLockedSlot
public static int getLockedSlot(net.minecraft.world.item.ItemStack stack)
-