Class AnvilBlockEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
com.hbm_m.block.entity.machines.AnvilBlockEntity
All Implemented Interfaces:
net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeBlockEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class AnvilBlockEntity extends net.minecraft.world.level.block.entity.BlockEntity implements net.minecraft.world.MenuProvider
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>
  • Field Summary

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    INFINITE_EXTENT_AABB
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnvilBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    consumeMaterials(net.minecraft.world.entity.player.Player player, boolean craftMax, com.hbm_m.block.entity.machines.AnvilBlockEntity.EnergyTransferTracker tracker)
    Расходует материалы после крафта
    boolean
    craft(net.minecraft.world.entity.player.Player player, boolean craftMax)
    Выполняет крафт и помещает результат в инвентарь игрока
    net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player)
     
    void
     
    net.minecraft.network.chat.Component
     
     
    Optional<net.minecraft.resources.ResourceLocation>
     
     
    net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener>
     
    net.minecraft.nbt.CompoundTag
     
    void
    handleCombineOutputTaken(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack outputStack)
     
    void
    handleUpdateTag(net.minecraft.nbt.CompoundTag tag)
     
    void
    load(net.minecraft.nbt.CompoundTag tag)
     
    void
    openGui(net.minecraft.server.level.ServerPlayer player)
     
    void
    populateInputsFromPlayer(net.minecraft.server.level.ServerPlayer player, AnvilRecipe recipe)
     
    protected void
    saveAdditional(net.minecraft.nbt.CompoundTag tag)
     
    void
    setSelectedRecipeId(net.minecraft.resources.ResourceLocation recipeId)
     
    void
    Обновляет выходной слот на основе текущих входов и выбранного рецепта

    Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity

    addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability, getCapability

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    deserializeNBT, getModelData, getRenderBoundingBox, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
  • Constructor Details

    • AnvilBlockEntity

      public AnvilBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • saveAdditional

      protected void saveAdditional(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • load

      public void load(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      load in class net.minecraft.world.level.block.entity.BlockEntity
    • drops

      public void drops()
    • getDisplayName

      public net.minecraft.network.chat.Component getDisplayName()
      Specified by:
      getDisplayName in interface net.minecraft.world.MenuProvider
    • createMenu

      @Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
    • openGui

      public void openGui(net.minecraft.server.level.ServerPlayer player)
    • getItemHandler

      public ModItemStackHandler getItemHandler()
    • getTier

      public AnvilTier getTier()
    • getSelectedRecipeId

      public Optional<net.minecraft.resources.ResourceLocation> getSelectedRecipeId()
    • setSelectedRecipeId

      public void setSelectedRecipeId(@Nullable net.minecraft.resources.ResourceLocation recipeId)
    • updateCrafting

      public void updateCrafting()
      Обновляет выходной слот на основе текущих входов и выбранного рецепта
    • consumeMaterials

      public boolean consumeMaterials(net.minecraft.world.entity.player.Player player, boolean craftMax, @Nullable com.hbm_m.block.entity.machines.AnvilBlockEntity.EnergyTransferTracker tracker)
      Расходует материалы после крафта
      Parameters:
      player - игрок, выполняющий крафт
      craftMax - если true, крафтит максимальное количество
      Returns:
      true, если материалы были успешно расходованы
    • handleCombineOutputTaken

      public void handleCombineOutputTaken(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack outputStack)
    • craft

      public boolean craft(net.minecraft.world.entity.player.Player player, boolean craftMax)
      Выполняет крафт и помещает результат в инвентарь игрока
    • populateInputsFromPlayer

      public void populateInputsFromPlayer(net.minecraft.server.level.ServerPlayer player, AnvilRecipe recipe)
    • getUpdateTag

      public net.minecraft.nbt.CompoundTag getUpdateTag()
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • getUpdatePacket

      @Nullable public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()
      Overrides:
      getUpdatePacket in class net.minecraft.world.level.block.entity.BlockEntity
    • handleUpdateTag

      public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      handleUpdateTag in interface net.minecraftforge.common.extensions.IForgeBlockEntity