Class SolarCookerBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
de.cech12.solarcooker.blockentity.SolarCookerBlockEntity
All Implemented Interfaces:
Iterable<net.minecraft.world.item.ItemStack>, net.minecraft.core.TypedInstance<net.minecraft.world.level.block.entity.BlockEntityType<?>>, net.minecraft.util.debug.DebugValueSource, net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.entity.SlotProvider, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.inventory.RecipeCraftingHolder, net.minecraft.world.inventory.StackedContentsCompatible, net.minecraft.world.level.block.entity.LidBlockEntity, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, net.minecraft.world.WorldlyContainer, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.ContainerExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension, net.neoforged.neoforge.common.extensions.IMenuProviderExtension

public class SolarCookerBlockEntity extends net.minecraft.world.level.block.entity.BaseContainerBlockEntity implements net.minecraft.world.WorldlyContainer, net.minecraft.world.inventory.RecipeCraftingHolder, net.minecraft.world.inventory.StackedContentsCompatible, net.minecraft.world.level.block.entity.LidBlockEntity
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField

    Nested classes/interfaces inherited from interface net.minecraft.world.Container

    net.minecraft.world.Container.ContainerIterator

    Nested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource

    net.minecraft.util.debug.DebugValueSource.Registration, net.minecraft.util.debug.DebugValueSource.ValueGetter<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    protected int
     
    protected int
     
    protected net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe>
     
    protected final net.minecraft.world.inventory.ContainerData
     
    protected net.minecraft.world.item.ItemStack
     
    static final int
     
    protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    static final int
     
    protected net.minecraft.world.item.Item
     
    static final int
     
    static final int
     
    protected boolean
     
    protected boolean
     
    protected final net.minecraft.world.item.crafting.RecipeType<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe>
     

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

    level, remove, worldPosition

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_BUFFER
  • Constructor Summary

    Constructors
    Constructor
    Description
    SolarCookerBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
    SolarCookerBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> tileTypeIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.item.crafting.RecipeType<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe> specificRecipeTypeIn)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    awardUsedRecipesAndPopExperience(net.minecraft.world.entity.player.Player p_235645_1_)
     
    boolean
    canPlaceItem(int index, @NotNull net.minecraft.world.item.ItemStack stack)
    Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
    boolean
    canPlaceItemThroughFace(int index, @NotNull net.minecraft.world.item.ItemStack itemStackIn, @Nullable net.minecraft.core.Direction direction)
    Returns true if automation can insert the given item in the given slot from the given side.
    protected boolean
    canSmelt(@Nullable net.minecraft.world.item.crafting.RecipeHolder<?> recipe)
     
    boolean
    canTakeItemThroughFace(int index, @NotNull net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.core.Direction direction)
    Returns true if automation can extract the given item in the given slot from the given side.
    void
     
    protected @NotNull net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int id, @NotNull net.minecraft.world.entity.player.Inventory player)
     
    void
    fillStackedContents(@NotNull net.minecraft.world.entity.player.StackedItemContents stackedContents)
     
    int
    Returns the number of slots in the inventory.
    int
     
    int
     
    protected @NotNull net.minecraft.network.chat.Component
     
    @NotNull net.minecraft.world.item.ItemStack
    getItem(int index)
    Returns the stack in the given slot.
    protected @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    float
    getOpenNess(float partialTicks)
     
    protected net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe>
     
    protected int
     
    List<net.minecraft.world.item.crafting.RecipeHolder<?>>
    getRecipesToAwardAndPopExperience(net.minecraft.world.level.Level p_235640_1_, net.minecraft.world.phys.Vec3 p_235640_2_)
     
    @Nullable net.minecraft.world.item.crafting.RecipeHolder<?>
     
    @NotNull int[]
    getSlotsForFace(@NotNull net.minecraft.core.Direction side)
     
    @Nullable net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
     
    @NotNull net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    static void
    lidAnimateTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, SolarCookerBlockEntity blockEntity)
     
    protected void
    loadAdditional(@NotNull net.minecraft.world.level.storage.ValueInput valueInput)
     
    static void
    playSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.sounds.SoundEvent soundEvent)
     
    void
     
    @NotNull net.minecraft.world.item.ItemStack
    removeItem(int index, int count)
    Removes up to a specified number of items from an inventory slot and returns them in a new stack.
    @NotNull net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int index)
    Removes a stack from the given slot and returns it.
    protected void
    saveAdditional(@NotNull net.minecraft.world.level.storage.ValueOutput valueOutput)
     
    void
    setItem(int index, net.minecraft.world.item.ItemStack stack)
    Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
    protected void
    setItems(@NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> nonNullList)
     
    void
    setRecipeUsed(@Nullable net.minecraft.world.item.crafting.RecipeHolder<?> recipe)
     
    boolean
    shouldLidBeOpen(int numPlayersUsing)
     
    static void
    signalOpenCount(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int numPlayersUsing, boolean playSound)
     
    void
    startOpen(@NotNull net.minecraft.world.entity.ContainerUser user)
     
    boolean
    stillValid(@NotNull net.minecraft.world.entity.player.Player player)
    Don't rename this method to canInteractWith due to conflicts with Container
    void
    stopOpen(@NotNull net.minecraft.world.entity.ContainerUser user)
     
    static void
    tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, SolarCookerBlockEntity entity)
     
    boolean
    triggerEvent(int id, int numPlayersUsing)
    This must return true serverside before it is called clientside.
    void
    updateShouldLidBeOpen(int numPlayersUsing)
     

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

    applyImplicitComponents, canOpen, collectImplicitComponents, createMenu, getCustomName, getDisplayName, getName, isLocked, removeComponentsFromTag, sendChestLockedNotifications, setItem

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

    addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, typeHolder

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachments

    Methods inherited from class Object

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

    Methods inherited from interface net.minecraft.world.Container

    canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, setChanged

    Methods inherited from interface net.neoforged.neoforge.common.extensions.ContainerExtension

    onTransfer, setItem

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IMenuProviderExtension

    shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData

    Methods inherited from interface Iterable

    forEach, spliterator

    Methods inherited from interface net.minecraft.world.Nameable

    getPlainTextName, hasCustomName

    Methods inherited from interface net.minecraft.world.inventory.RecipeCraftingHolder

    awardUsedRecipes, setRecipeUsed

    Methods inherited from interface net.minecraft.world.entity.SlotProvider

    getSlotsFromRange

    Methods inherited from interface net.minecraft.core.TypedInstance

    is, is, is, is, is, tags
  • Field Details

    • CONTAINER_IS_SUNLIT

      public static final int CONTAINER_IS_SUNLIT
      See Also:
    • CONTAINER_COOK_TIME

      public static final int CONTAINER_COOK_TIME
      See Also:
    • CONTAINER_COOK_TIME_TOTAL

      public static final int CONTAINER_COOK_TIME_TOTAL
      See Also:
    • INPUT

      public static final int INPUT
      See Also:
    • OUTPUT

      public static final int OUTPUT
      See Also:
    • REFLECTOR_LEFT

      public static final int REFLECTOR_LEFT
      See Also:
    • REFLECTOR_RIGHT

      public static final int REFLECTOR_RIGHT
      See Also:
    • items

      protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items
    • previousInput

      protected net.minecraft.world.item.Item previousInput
    • cookTime

      protected int cookTime
    • cookTimeTotal

      protected int cookTimeTotal
    • reflectorLeft

      protected boolean reflectorLeft
    • reflectorRight

      protected boolean reflectorRight
    • specificRecipeType

      protected final net.minecraft.world.item.crafting.RecipeType<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe> specificRecipeType
    • curRecipe

      protected net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe> curRecipe
    • failedMatch

      protected net.minecraft.world.item.ItemStack failedMatch
    • dataAccess

      protected final net.minecraft.world.inventory.ContainerData dataAccess
  • Constructor Details

    • SolarCookerBlockEntity

      public SolarCookerBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> tileTypeIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.item.crafting.RecipeType<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe> specificRecipeTypeIn)
    • SolarCookerBlockEntity

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

    • getDefaultName

      @NotNull protected @NotNull net.minecraft.network.chat.Component getDefaultName()
      Specified by:
      getDefaultName in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • createMenu

      @NotNull protected @NotNull net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, @NotNull @NotNull net.minecraft.world.entity.player.Inventory player)
      Specified by:
      createMenu in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • isSunlit

      public boolean isSunlit()
    • getCookTime

      public int getCookTime()
    • getCookTimeTotal

      public int getCookTimeTotal()
    • loadAdditional

      protected void loadAdditional(@NotNull @NotNull net.minecraft.world.level.storage.ValueInput valueInput)
      Overrides:
      loadAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • saveAdditional

      protected void saveAdditional(@NotNull @NotNull net.minecraft.world.level.storage.ValueOutput valueOutput)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getUpdateTag

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • getUpdatePacket

      @Nullable public @Nullable net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()
      Overrides:
      getUpdatePacket in class net.minecraft.world.level.block.entity.BlockEntity
    • tick

      public static void tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, SolarCookerBlockEntity entity)
    • shouldLidBeOpen

      public boolean shouldLidBeOpen(int numPlayersUsing)
    • updateShouldLidBeOpen

      public void updateShouldLidBeOpen(int numPlayersUsing)
    • lidAnimateTick

      public static void lidAnimateTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, SolarCookerBlockEntity blockEntity)
    • triggerEvent

      public boolean triggerEvent(int id, int numPlayersUsing)
      This must return true serverside before it is called clientside.
      Overrides:
      triggerEvent in class net.minecraft.world.level.block.entity.BlockEntity
    • startOpen

      public void startOpen(@NotNull @NotNull net.minecraft.world.entity.ContainerUser user)
      Specified by:
      startOpen in interface net.minecraft.world.Container
    • stopOpen

      public void stopOpen(@NotNull @NotNull net.minecraft.world.entity.ContainerUser user)
      Specified by:
      stopOpen in interface net.minecraft.world.Container
    • recheckOpen

      public void recheckOpen()
    • signalOpenCount

      public static void signalOpenCount(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int numPlayersUsing, boolean playSound)
    • playSound

      public static void playSound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.sounds.SoundEvent soundEvent)
    • canSmelt

      protected boolean canSmelt(@Nullable @Nullable net.minecraft.world.item.crafting.RecipeHolder<?> recipe)
    • getRecipeCookTime

      protected int getRecipeCookTime()
    • getRecipe

      protected net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe> getRecipe()
    • hasLeftReflector

      public boolean hasLeftReflector()
    • hasRightReflector

      public boolean hasRightReflector()
    • getSlotsForFace

      @NotNull public @NotNull int[] getSlotsForFace(@NotNull @NotNull net.minecraft.core.Direction side)
      Specified by:
      getSlotsForFace in interface net.minecraft.world.WorldlyContainer
    • canPlaceItemThroughFace

      public boolean canPlaceItemThroughFace(int index, @NotNull @NotNull net.minecraft.world.item.ItemStack itemStackIn, @Nullable @Nullable net.minecraft.core.Direction direction)
      Returns true if automation can insert the given item in the given slot from the given side.
      Specified by:
      canPlaceItemThroughFace in interface net.minecraft.world.WorldlyContainer
    • canTakeItemThroughFace

      public boolean canTakeItemThroughFace(int index, @NotNull @NotNull net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.core.Direction direction)
      Returns true if automation can extract the given item in the given slot from the given side.
      Specified by:
      canTakeItemThroughFace in interface net.minecraft.world.WorldlyContainer
    • getContainerSize

      public int getContainerSize()
      Returns the number of slots in the inventory.
      Specified by:
      getContainerSize in interface net.minecraft.world.Container
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface net.minecraft.world.Container
      Overrides:
      isEmpty in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getItems

      @NotNull protected @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()
      Specified by:
      getItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getItem

      @NotNull public @NotNull net.minecraft.world.item.ItemStack getItem(int index)
      Returns the stack in the given slot.
      Specified by:
      getItem in interface net.minecraft.world.Container
      Overrides:
      getItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • removeItem

      @NotNull public @NotNull net.minecraft.world.item.ItemStack removeItem(int index, int count)
      Removes up to a specified number of items from an inventory slot and returns them in a new stack.
      Specified by:
      removeItem in interface net.minecraft.world.Container
      Overrides:
      removeItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • removeItemNoUpdate

      @NotNull public @NotNull net.minecraft.world.item.ItemStack removeItemNoUpdate(int index)
      Removes a stack from the given slot and returns it.
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
      Overrides:
      removeItemNoUpdate in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • setItems

      protected void setItems(@NotNull @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> nonNullList)
      Specified by:
      setItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • setItem

      public void setItem(int index, net.minecraft.world.item.ItemStack stack)
      Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
      Specified by:
      setItem in interface net.minecraft.world.Container
      Overrides:
      setItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • stillValid

      public boolean stillValid(@NotNull @NotNull net.minecraft.world.entity.player.Player player)
      Don't rename this method to canInteractWith due to conflicts with Container
      Specified by:
      stillValid in interface net.minecraft.world.Container
      Overrides:
      stillValid in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • canPlaceItem

      public boolean canPlaceItem(int index, @NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid
      Specified by:
      canPlaceItem in interface net.minecraft.world.Container
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable
      Overrides:
      clearContent in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • setRecipeUsed

      public void setRecipeUsed(@Nullable @Nullable net.minecraft.world.item.crafting.RecipeHolder<?> recipe)
      Specified by:
      setRecipeUsed in interface net.minecraft.world.inventory.RecipeCraftingHolder
    • getRecipeUsed

      @Nullable public @Nullable net.minecraft.world.item.crafting.RecipeHolder<?> getRecipeUsed()
      Specified by:
      getRecipeUsed in interface net.minecraft.world.inventory.RecipeCraftingHolder
    • awardUsedRecipesAndPopExperience

      public void awardUsedRecipesAndPopExperience(net.minecraft.world.entity.player.Player p_235645_1_)
    • getRecipesToAwardAndPopExperience

      public List<net.minecraft.world.item.crafting.RecipeHolder<?>> getRecipesToAwardAndPopExperience(net.minecraft.world.level.Level p_235640_1_, net.minecraft.world.phys.Vec3 p_235640_2_)
    • fillStackedContents

      public void fillStackedContents(@NotNull @NotNull net.minecraft.world.entity.player.StackedItemContents stackedContents)
      Specified by:
      fillStackedContents in interface net.minecraft.world.inventory.StackedContentsCompatible
    • getOpenNess

      public float getOpenNess(float partialTicks)
      Specified by:
      getOpenNess in interface net.minecraft.world.level.block.entity.LidBlockEntity