Class SolarCookerBlockEntity
java.lang.Object
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.fabricmc.fabric.api.attachment.v1.AttachmentTarget,net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity,net.fabricmc.fabric.api.screenhandler.v1.FabricScreenHandlerFactory,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
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 interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
net.fabricmc.fabric.api.attachment.v1.AttachmentTarget.OnAttachedSet<A>Nested classes/interfaces inherited from interface net.minecraft.world.Container
net.minecraft.world.Container.ContainerIteratorNested 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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intprotected intprotected intprotected net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe> protected final net.minecraft.world.inventory.ContainerDataprotected net.minecraft.world.item.ItemStackstatic final intprotected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> static final intprotected net.minecraft.world.item.Itemstatic final intstatic final intprotected booleanprotected booleanprotected 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, worldPositionFields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
NBT_ATTACHMENT_KEYFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionSolarCookerBlockEntity(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 TypeMethodDescriptionvoidawardUsedRecipesAndPopExperience(net.minecraft.world.entity.player.Player p_235645_1_) booleancanPlaceItem(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.booleancanPlaceItemThroughFace(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 booleancanSmelt(net.minecraft.core.RegistryAccess registryAccess, @Nullable net.minecraft.world.item.crafting.RecipeHolder<?> recipe) booleancanTakeItemThroughFace(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.voidprotected @NotNull net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int id, @NotNull net.minecraft.world.entity.player.Inventory player) voidfillStackedContents(@NotNull net.minecraft.world.entity.player.StackedItemContents stackedContents) intReturns the number of slots in the inventory.intintprotected @NotNull net.minecraft.network.chat.Component@NotNull net.minecraft.world.item.ItemStackgetItem(int index) Returns the stack in the given slot.protected @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()floatgetOpenNess(float partialTicks) protected net.minecraft.world.item.crafting.RecipeHolder<? extends net.minecraft.world.item.crafting.AbstractCookingRecipe> protected intList<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<?> @org.jetbrains.annotations.NotNull int[]getSlotsForFace(@NotNull net.minecraft.core.Direction side) @Nullable net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket@NotNull net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider provider) booleanbooleanbooleanisEmpty()booleanisSunlit()static voidlidAnimateTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, SolarCookerBlockEntity blockEntity) protected voidloadAdditional(@NotNull net.minecraft.world.level.storage.ValueInput valueInput) static voidplaySound(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.sounds.SoundEvent soundEvent) void@NotNull net.minecraft.world.item.ItemStackremoveItem(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.ItemStackremoveItemNoUpdate(int index) Removes a stack from the given slot and returns it.protected voidsaveAdditional(@NotNull net.minecraft.world.level.storage.ValueOutput valueOutput) voidsetItem(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 voidsetItems(@NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> nonNullList) voidsetRecipeUsed(@Nullable net.minecraft.world.item.crafting.RecipeHolder<?> recipe) booleanshouldLidBeOpen(int numPlayersUsing) static voidsignalOpenCount(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int numPlayersUsing, boolean playSound) voidstartOpen(@NotNull net.minecraft.world.entity.ContainerUser user) booleanstillValid(@NotNull net.minecraft.world.entity.player.Player player) Don't rename this method to canInteractWith due to conflicts with ContainervoidstopOpen(@NotNull net.minecraft.world.entity.ContainerUser user) static voidtick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, SolarCookerBlockEntity entity) booleantriggerEvent(int id, int numPlayersUsing) This must return true serverside before it is called clientside.voidupdateShouldLidBeOpen(int numPlayersUsing) Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
applyImplicitComponents, canOpen, collectImplicitComponents, createMenu, getCustomName, getDisplayName, getName, isLocked, removeComponentsFromTag, sendChestLockedNotificationsMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getNameForReporting, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setLevel, setRemovedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, onAttachedSet, removeAttached, setAttachedMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, setChangedMethods inherited from interface net.fabricmc.fabric.api.screenhandler.v1.FabricScreenHandlerFactory
shouldCloseCurrentScreenMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.world.Nameable
getPlainTextName, hasCustomNameMethods inherited from interface net.minecraft.world.inventory.RecipeCraftingHolder
awardUsedRecipes, setRecipeUsedMethods inherited from interface net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity
getRenderDataMethods inherited from interface net.minecraft.world.entity.SlotProvider
getSlotsFromRange
-
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:
getDefaultNamein classnet.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:
createMenuin classnet.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:
loadAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
saveAdditional
protected void saveAdditional(@NotNull @NotNull net.minecraft.world.level.storage.ValueOutput valueOutput) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getUpdateTag
@NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
@Nullable public @Nullable net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacketin classnet.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:
triggerEventin classnet.minecraft.world.level.block.entity.BlockEntity
-
startOpen
public void startOpen(@NotNull @NotNull net.minecraft.world.entity.ContainerUser user) - Specified by:
startOpenin interfacenet.minecraft.world.Container
-
stopOpen
public void stopOpen(@NotNull @NotNull net.minecraft.world.entity.ContainerUser user) - Specified by:
stopOpenin interfacenet.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(net.minecraft.core.RegistryAccess registryAccess, @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 @org.jetbrains.annotations.NotNull int[] getSlotsForFace(@NotNull @NotNull net.minecraft.core.Direction side) - Specified by:
getSlotsForFacein interfacenet.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:
canPlaceItemThroughFacein interfacenet.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:
canTakeItemThroughFacein interfacenet.minecraft.world.WorldlyContainer
-
getContainerSize
public int getContainerSize()Returns the number of slots in the inventory.- Specified by:
getContainerSizein interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container- Overrides:
isEmptyin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getItems
@NotNull protected @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()- Specified by:
getItemsin classnet.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:
getItemin interfacenet.minecraft.world.Container- Overrides:
getItemin classnet.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:
removeItemin interfacenet.minecraft.world.Container- Overrides:
removeItemin classnet.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:
removeItemNoUpdatein interfacenet.minecraft.world.Container- Overrides:
removeItemNoUpdatein classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
setItems
protected void setItems(@NotNull @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> nonNullList) - Specified by:
setItemsin classnet.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:
setItemin interfacenet.minecraft.world.Container- Overrides:
setItemin classnet.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:
stillValidin interfacenet.minecraft.world.Container- Overrides:
stillValidin classnet.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:
canPlaceItemin interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable- Overrides:
clearContentin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
setRecipeUsed
public void setRecipeUsed(@Nullable @Nullable net.minecraft.world.item.crafting.RecipeHolder<?> recipe) - Specified by:
setRecipeUsedin interfacenet.minecraft.world.inventory.RecipeCraftingHolder
-
getRecipeUsed
@Nullable public @Nullable net.minecraft.world.item.crafting.RecipeHolder<?> getRecipeUsed()- Specified by:
getRecipeUsedin interfacenet.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:
fillStackedContentsin interfacenet.minecraft.world.inventory.StackedContentsCompatible
-
getOpenNess
public float getOpenNess(float partialTicks) - Specified by:
getOpenNessin interfacenet.minecraft.world.level.block.entity.LidBlockEntity
-