Class InfuserTileEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
com.pixelmonmod.pixelmon.blocks.tileentity.InfuserTileEntity
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.inventory.MenuConstructor,net.minecraft.world.inventory.StackedContentsCompatible,net.minecraft.world.MenuProvider,net.minecraft.world.Nameable,net.minecraft.world.WorldlyContainer,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.client.extensions.IMenuProviderExtension,net.neoforged.neoforge.common.extensions.IBlockEntityExtension
public class InfuserTileEntity
extends net.minecraft.world.level.block.entity.BaseContainerBlockEntity
implements net.minecraft.world.MenuProvider, net.minecraft.world.WorldlyContainer, net.minecraft.world.inventory.StackedContentsCompatible
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInputNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionintThe number of ticks that a fresh copy of the currently-burning item would keep the infuser running for.intThe current animation frame.intThe number of ticks that the current item has been running for.intThe number of ticks that the infuser will keep running for.intThe number of ticks the current item must infuse for to completebooleanWhether the infuser is processing an item.net.minecraft.world.item.ItemThe item being processed by the infuser.intRendering only fieldsnet.minecraft.world.item.ItemThe secondary item being processed by the infuser.intThe animation state of the mechanical infuser.Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionInfuserTileEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) InfuserTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack) Automation.booleancanPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStackIn, net.minecraft.core.Direction direction) Returns true if automation can insert the given item in the given slot from the given side.booleancanTakeItemThroughFace(int slotIndex, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction) Returns true if automation can extract the given item in the given slot from the given side.voidnet.minecraft.world.item.crafting.CraftingInputprotected net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int p_58627_, net.minecraft.world.entity.player.Inventory p_58628_) net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int id, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player) voidfillStackedContents(net.minecraft.world.entity.player.StackedContents stackedContents) intgetBurnTimeRemainingScaled(int p_145955_1_) Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel item, where 0 means that the item is exhausted and the passed value means that the item is fresh.intReturns the number of slots in the inventory.protected @NotNull net.minecraft.network.chat.Componentnet.minecraft.network.chat.Componentnet.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> intgetInfusionProgressScaled(int p_145953_1_) Returns an integer between 0 and the passed value representing how close the current item is to being completely hammered.@NotNull net.minecraft.world.item.ItemStackgetItem(int slotIndex) Returns the stack in slot i.protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()intint[]getSlotsForFace(net.minecraft.core.Direction side) Returns an array containing the indices of the slots that can be accessed by automation on the given side of this block.net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacketnet.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider lookup) booleanisEmpty()booleanChecks if the infuser is running.voidloadAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) voidonDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt, net.minecraft.core.HolderLookup.Provider lookup) net.minecraft.world.item.crafting.RecipeInputnet.minecraft.world.item.ItemStackremoveItem(int slotIndex, int decreaseBy) Removes from an inventory slot up to a specified number of items and returns them in a new stack.net.minecraft.world.item.ItemStackremoveItemNoUpdate(int slotIndex) When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.voidsaveAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) static voidserverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, InfuserTileEntity entity) voidsetItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack) Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).protected voidsetItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items) voidstartOpen(net.minecraft.world.entity.player.Player playerIn) booleanstillValid(net.minecraft.world.entity.player.Player player) Do not give this method the name canInteractWith because it clashes with Container.voidstopOpen(net.minecraft.world.entity.player.Player playerIn) Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
applyImplicitComponents, canOpen, canUnlock, collectImplicitComponents, getCustomName, getName, removeComponentsFromTagMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChangedMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdateMethods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideDataMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
infuserRunTime
public int infuserRunTimeThe number of ticks that the infuser will keep running for. -
currentItemRunTime
public int currentItemRunTimeThe number of ticks that a fresh copy of the currently-burning item would keep the infuser running for. -
infuserProgressTime
public int infuserProgressTimeThe number of ticks that the current item has been running for. -
infuserTotalTime
public int infuserTotalTimeThe number of ticks the current item must infuse for to complete -
renderPass
public int renderPassRendering only fields -
isRunning
public boolean isRunningWhether the infuser is processing an item. -
itemOnInfuser
public net.minecraft.world.item.Item itemOnInfuserThe item being processed by the infuser. -
secondItemOnInfuser
public net.minecraft.world.item.Item secondItemOnInfuserThe secondary item being processed by the infuser. -
state
public int stateThe animation state of the mechanical infuser. -
frame
public int frameThe current animation frame.
-
-
Constructor Details
-
InfuserTileEntity
public InfuserTileEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) -
InfuserTileEntity
public InfuserTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
-
-
Method Details
-
getContainerSize
public int getContainerSize()Returns the number of slots in the inventory.- Specified by:
getContainerSizein interfacenet.minecraft.world.Container- Returns:
- The number of slots in the inventory.
-
getInfuserItemStacks
public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getInfuserItemStacks() -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container- Overrides:
isEmptyin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
recipeInput
public net.minecraft.world.item.crafting.RecipeInput recipeInput() -
craftingInput
public net.minecraft.world.item.crafting.CraftingInput craftingInput() -
getItem
@NotNull public @NotNull net.minecraft.world.item.ItemStack getItem(int slotIndex) Returns the stack in slot i.- Specified by:
getItemin interfacenet.minecraft.world.Container- Overrides:
getItemin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Returns:
- The stack in slot i.
-
removeItem
public net.minecraft.world.item.ItemStack removeItem(int slotIndex, int decreaseBy) Removes from an inventory slot up to a specified number of items and returns them in a new stack.- Specified by:
removeItemin interfacenet.minecraft.world.Container- Overrides:
removeItemin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Parameters:
slotIndex- An inventory slot.decreaseBy- A specified number of items.- Returns:
- The items in a new stack.
-
removeItemNoUpdate
public net.minecraft.world.item.ItemStack removeItemNoUpdate(int slotIndex) When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.- Specified by:
removeItemNoUpdatein interfacenet.minecraft.world.Container- Overrides:
removeItemNoUpdatein classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Returns:
- The EntityItem to drop.
-
setItem
public void setItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack) 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- Parameters:
slotIndex- A specified slot in the inventory.itemStack- An item stack.
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfacenet.minecraft.world.Container
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) Do not give this method the name canInteractWith because it clashes with Container.- Specified by:
stillValidin interfacenet.minecraft.world.Container- Overrides:
stillValidin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
canPlaceItem
public boolean canPlaceItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack) Automation. Slot index: 0 = fuel 1 and 2 = inputs 3 = output.- Specified by:
canPlaceItemin interfacenet.minecraft.world.Container
-
getSlotsForFace
public int[] getSlotsForFace(net.minecraft.core.Direction side) Returns an array containing the indices of the slots that can be accessed by automation on the given side of this block.- Specified by:
getSlotsForFacein interfacenet.minecraft.world.WorldlyContainer- Parameters:
side- A side.- Returns:
- An array containing the indices of the slots that can be accessed by automation on the given side of this block.
-
canPlaceItemThroughFace
public boolean canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStackIn, 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- Parameters:
index- Slot.itemStackIn- Item.direction- Side.- Returns:
- True if automation can insert the given item in the given slot from the given side.
-
canTakeItemThroughFace
public boolean canTakeItemThroughFace(int slotIndex, net.minecraft.world.item.ItemStack itemStack, 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- Parameters:
slotIndex- Slot.itemStack- Item.direction- Side.- Returns:
- True if automation can extract the given item in the given slot from the given side.
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider lookup) - Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity
-
onDataPacket
public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt, net.minecraft.core.HolderLookup.Provider lookup) - Specified by:
onDataPacketin interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension
-
loadAdditional
public void loadAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getInfusionProgressScaled
public int getInfusionProgressScaled(int p_145953_1_) Returns an integer between 0 and the passed value representing how close the current item is to being completely hammered.- Returns:
- An integer between 0 and the passed value representing how close the current item is to being completely hammered.
-
getBurnTimeRemainingScaled
public int getBurnTimeRemainingScaled(int p_145955_1_) Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel item, where 0 means that the item is exhausted and the passed value means that the item is fresh.- Parameters:
p_145955_1_- The fresh burn time.- Returns:
- An integer between 0 and the passed value representing how much burn time is left on the current fuel item, where 0 means that the item is exhausted and the passed value means that the item is fresh.
-
isRunning
public boolean isRunning()Checks if the infuser is running.- Returns:
- Whether the infuser is running.
-
startOpen
public void startOpen(net.minecraft.world.entity.player.Player playerIn) - Specified by:
startOpenin interfacenet.minecraft.world.Container
-
stopOpen
public void stopOpen(net.minecraft.world.entity.player.Player playerIn) - Specified by:
stopOpenin interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable- Overrides:
clearContentin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayNamein interfacenet.minecraft.world.MenuProvider- Specified by:
getDisplayNamein interfacenet.minecraft.world.Nameable- Overrides:
getDisplayNamein classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getDefaultName
@NotNull protected @NotNull net.minecraft.network.chat.Component getDefaultName()- Specified by:
getDefaultNamein classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getItems
protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()- Specified by:
getItemsin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
setItems
protected void setItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items) - Specified by:
setItemsin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
createMenu
public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player) - Specified by:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor- Overrides:
createMenuin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
createMenu
protected net.minecraft.world.inventory.AbstractContainerMenu createMenu(int p_58627_, net.minecraft.world.entity.player.Inventory p_58628_) - Specified by:
createMenuin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
serverTick
public static void serverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, InfuserTileEntity entity) -
fillStackedContents
public void fillStackedContents(net.minecraft.world.entity.player.StackedContents stackedContents) - Specified by:
fillStackedContentsin interfacenet.minecraft.world.inventory.StackedContentsCompatible
-