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

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.item.Item

    net.minecraft.world.item.Item.Properties

    Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.common.item.IChargeableContainerProvider

    IChargeableContainerProvider.Provider
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final String
     
    static final String
     

    Fields 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_SIZE

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.ItemStack
    finishUsingItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level worldIn, net.minecraft.world.entity.LivingEntity entityLiving)
     
    net.minecraft.world.MenuProvider
    Get a container provider for this item
    float
    getFOVModifier(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.Component
    Get a header for the inventory list, for tooltip purposes.
    static int
    getLockedSlot(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)
     
    void
    getStacksInItem(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> curStacks)
     
    int
    getUseDuration(net.minecraft.world.item.ItemStack stack)
     
    void
    initializeClient(Consumer<net.minecraftforge.client.extensions.common.IClientItemExtensions> consumer)
     
    void
    inventoryTick(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world, net.minecraft.world.entity.Entity entity, int slot, boolean currentItem)
     
    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
    void
    onShiftScrolled(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.
    void
    onUseTick(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int pRemainingUseDuration)
     
    boolean
    shouldCauseReequipAnimation(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 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, verifyTagAfterLoad

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled

    Methods 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, shouldCauseBlockBreakReset

    Methods inherited from interface me.desht.pneumaticcraft.api.item.IInventoryItem

    getTooltipPrefix

    Methods inherited from interface me.desht.pneumaticcraft.api.pressure.IPressurizableItem

    getEffectiveVolume, getPressure
  • Field Details

  • Constructor Details

    • MinigunItem

      public MinigunItem()
  • Method Details

    • initializeClient

      public void initializeClient(Consumer<net.minecraftforge.client.extensions.common.IClientItemExtensions> consumer)
      Overrides:
      initializeClient in class net.minecraft.world.item.Item
    • getMagazine

      @Nonnull public MinigunItem.MagazineHandler getMagazine(net.minecraft.world.item.ItemStack stack)
    • 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 player
      stack - the minigun item
      equipping - true if equipping, false if unequipping
    • getUseDuration

      public int getUseDuration(net.minecraft.world.item.ItemStack stack)
      Overrides:
      getUseDuration in class net.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:
      inventoryTick in class net.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:
      use in class net.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:
      onUseTick in class net.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:
      finishUsingItem in class net.minecraft.world.item.Item
    • shouldCauseReequipAnimation

      public boolean shouldCauseReequipAnimation(net.minecraft.world.item.ItemStack oldStack, net.minecraft.world.item.ItemStack newStack, boolean slotChanged)
      Specified by:
      shouldCauseReequipAnimation in interface net.minecraftforge.common.extensions.IForgeItem
      Overrides:
      shouldCauseReequipAnimation in class PressurizableItem
    • 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: IFOVModifierItem
      Get the FOV modifer for the given item stack. Lower values zoom in.
      Specified by:
      getFOVModifier in interface IFOVModifierItem
      Parameters:
      stack - the equipped item
      player - the player who has the item equipped
      slot - 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:
      getStacksInItem in interface IInventoryItem
      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: IInventoryItem
      Get a header for the inventory list, for tooltip purposes. Default return of null will not add any header.
      Specified by:
      getInventoryHeader in interface IInventoryItem
      Returns:
      a header string (can be a translation string), or null for no header
    • getContainerProvider

      public net.minecraft.world.MenuProvider getContainerProvider(ChargingStationBlockEntity te)
      Description copied from interface: IChargeableContainerProvider
      Get a container provider for this item
      Specified by:
      getContainerProvider in interface IChargeableContainerProvider
      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: IShiftScrollable
      Called both client- and server-side when a player shift-scrolls the mouse wheel, while holding an item which implements this interface.
      Specified by:
      onShiftScrolled in interface IShiftScrollable
      Parameters:
      player - player doing the shift-scrolling
      forward - true if the mouse wheel was rotated up, false if rotated down
      hand - hand in which the item is held
    • getLockedSlot

      public static int getLockedSlot(net.minecraft.world.item.ItemStack stack)