Class BlockEntitySpiritFurnace

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
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>, org.cyclops.cyclopscore.blockentity.IBlockEntityDelayedTickable, org.cyclops.cyclopscore.persist.IDirtyMarkListener, org.cyclops.cyclopscore.persist.nbt.INBTProvider, IUpgradable<BlockEntitySpiritFurnace,org.apache.commons.lang3.mutable.MutableDouble>

public class BlockEntitySpiritFurnace extends BlockEntityWorking<BlockEntitySpiritFurnace,org.apache.commons.lang3.mutable.MutableDouble> implements net.minecraft.world.MenuProvider
A furnace that is able to cook spirits for their inner entity drops.
  • Field Details

    • SLOT_CONTAINER

      public static final int SLOT_CONTAINER
      The id of the fluid container drainer slot.
      See Also:
    • SLOT_BOX

      public static final int SLOT_BOX
      The id of the box slot.
      See Also:
    • SLOTS_DROP

      public static final int[] SLOTS_DROP
      The id of the drops slot.
    • SLOTS

      public static final int SLOTS
      The total amount of slots in this machine.
    • METADATA

      public static BlockEntitySpiritFurnace.Metadata METADATA
    • LIQUID_PER_SLOT

      public static final int LIQUID_PER_SLOT
      The capacity of the tank.
      See Also:
    • minimumSizeValidator

      protected static final org.cyclops.cyclopscore.block.multi.MinimumSizeValidator minimumSizeValidator
    • TICKERS

      public static int TICKERS
    • UPGRADEEVENT_SPEED

      public static final Upgrades.UpgradeEventType UPGRADEEVENT_SPEED
    • UPGRADEEVENT_BLOODUSAGE

      public static final Upgrades.UpgradeEventType UPGRADEEVENT_BLOODUSAGE
  • Constructor Details

    • BlockEntitySpiritFurnace

      public BlockEntitySpiritFurnace(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
  • Method Details

    • getCubeDetector

      public static org.cyclops.cyclopscore.block.multi.CubeDetector getCubeDetector()
    • addItemHandlerCapabilities

      protected void addItemHandlerCapabilities()
      Overrides:
      addItemHandlerCapabilities in class BlockEntityTankInventory
    • createInventory

      protected org.cyclops.cyclopscore.inventory.SimpleInventory createInventory(int inventorySize, int stackSize)
      Overrides:
      createInventory in class BlockEntityWorking<BlockEntitySpiritFurnace,org.apache.commons.lang3.mutable.MutableDouble>
    • createTank

      protected org.cyclops.cyclopscore.fluid.SingleUseTank createTank(int tankSize)
      Overrides:
      createTank in class BlockEntityTankInventory
    • getWorkTicker

      protected int getWorkTicker()
      Specified by:
      getWorkTicker in class BlockEntityWorking<BlockEntitySpiritFurnace,org.apache.commons.lang3.mutable.MutableDouble>
    • getEntity

      public net.minecraft.world.entity.Entity getEntity()
      Get the entity that is contained in a box.
      Returns:
      The entity or null if no box or invalid box.
    • getPlayerId

      public String getPlayerId()
    • getPlayerName

      public String getPlayerName()
    • isPlayer

      public boolean isPlayer()
    • getEntitySize

      public net.minecraft.core.Vec3i getEntitySize()
      Get the size of the box entity.
      Returns:
      The box entity size.
    • isSizeValidForEntity

      public boolean isSizeValidForEntity()
      If the size is valid for the contained entity to cook. It will check the inner size of the furnace and the size of the entity.
      Returns:
      If it is valid.
    • getTileWorkingMetadata

      public BlockEntitySpiritFurnace.Metadata getTileWorkingMetadata()
      Specified by:
      getTileWorkingMetadata in class BlockEntityWorking<BlockEntitySpiritFurnace,org.apache.commons.lang3.mutable.MutableDouble>
    • canWork

      public boolean canWork()
      Description copied from class: BlockEntityWorking
      Check if this tile is valid and can start working. Mostly defined by environmental parameters.
      Specified by:
      canWork in class BlockEntityWorking<BlockEntitySpiritFurnace,org.apache.commons.lang3.mutable.MutableDouble>
      Returns:
      If it is valid and can work.
    • canWork

      public static boolean canWork(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos location)
      Check if the spirit furnace on the given location is valid and can start working.
      Parameters:
      world - The world.
      location - The location.
      Returns:
      If it is valid.
    • getAllowedCookItem

      public static net.minecraft.world.item.Item getAllowedCookItem()
      Get the allowed cooking item for this furnace.
      Returns:
      The allowed item.
    • detectStructure

      public static void detectStructure(net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos location, net.minecraft.core.Vec3i size, boolean valid, net.minecraft.core.BlockPos originCorner)
      Callback for when a structure has been detected for a spirit furnace block.
      Parameters:
      world - The world.
      location - The location of one block of the structure.
      size - The size of the structure.
      valid - If the structure is being validated(/created), otherwise invalidated.
      originCorner - The origin corner
    • getConsumeSlot

      public int getConsumeSlot()
      Get the id of the infusion slot.
      Returns:
      id of the infusion slot.
    • getProduceSlots

      public int[] getProduceSlots()
      Get the ids of the result slots.
      Returns:
      ids of the result slots.
    • getSize

      public net.minecraft.core.Vec3i getSize()
      Returns:
      the size
    • getInnerSize

      public net.minecraft.core.Vec3i getInnerSize()
      Returns:
      the actual inner size.
    • setSize

      public void setSize(net.minecraft.core.Vec3i size)
      Parameters:
      size - the size to set
    • onItemDrop

      public void onItemDrop(net.minecraft.world.item.ItemStack itemStack)
    • resetWork

      public void resetWork(boolean hardReset)
      Description copied from class: BlockEntityWorking
      Resets the ticks of the work.
      Overrides:
      resetWork in class BlockEntityWorking<BlockEntitySpiritFurnace,org.apache.commons.lang3.mutable.MutableDouble>
      Parameters:
      hardReset - If the tick and required tick should also be set to zero.
    • isForceHalt

      public boolean isForceHalt()
      If the cooking is being halted because the inventory is full.
      Returns:
      the forceHalt
    • isCaughtError

      public boolean isCaughtError()
      Returns:
      the caughtError
    • caughtError

      public void caughtError()
      If an error was caught while killing a spirit.
    • transformFacingForRotation

      protected net.minecraft.core.Direction transformFacingForRotation(net.minecraft.core.Direction facing)
      Overrides:
      transformFacingForRotation in class org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
    • createMenu

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

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