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.DataComponentInput
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
The number of ticks that a fresh copy of the currently-burning item would keep the infuser running for.int
The current animation frame.int
The number of ticks that the current item has been running for.int
The number of ticks that the infuser will keep running for.int
The number of ticks the current item must infuse for to completeboolean
Whether the infuser is processing an item.net.minecraft.world.item.Item
The item being processed by the infuser.int
Rendering only fieldsnet.minecraft.world.item.Item
The secondary item being processed by the infuser.int
The animation state of the mechanical infuser.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
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 TypeMethodDescriptionboolean
canPlaceItem
(int slotIndex, net.minecraft.world.item.ItemStack itemStack) Automation.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.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.void
net.minecraft.world.item.crafting.CraftingInput
protected net.minecraft.world.inventory.AbstractContainerMenu
createMenu
(int p_58627_, net.minecraft.world.entity.player.Inventory p_58628_) net.minecraft.world.inventory.AbstractContainerMenu
createMenu
(int id, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player) void
fillStackedContents
(net.minecraft.world.entity.player.StackedContents stackedContents) 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.int
Returns the number of slots in the inventory.protected @NotNull net.minecraft.network.chat.Component
net.minecraft.network.chat.Component
net.minecraft.core.NonNullList
<net.minecraft.world.item.ItemStack> 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.net.minecraft.world.item.ItemStack
getItem
(int slotIndex) Returns the stack in slot i.protected net.minecraft.core.NonNullList
<net.minecraft.world.item.ItemStack> getItems()
int
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.net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
net.minecraft.nbt.CompoundTag
getUpdateTag
(net.minecraft.core.HolderLookup.Provider lookup) boolean
isEmpty()
boolean
Checks if the infuser is running.void
loadAdditional
(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) void
onDataPacket
(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt, net.minecraft.core.HolderLookup.Provider lookup) net.minecraft.world.item.crafting.RecipeInput
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.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.void
saveAdditional
(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) static void
serverTick
(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, InfuserTileEntity entity) 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).protected void
setItems
(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items) void
startOpen
(net.minecraft.world.entity.player.Player playerIn) boolean
stillValid
(net.minecraft.world.entity.player.Player player) Do not give this method the name canInteractWith because it clashes with Container.void
stopOpen
(net.minecraft.world.entity.player.Player playerIn) Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
applyImplicitComponents, canOpen, canUnlock, collectImplicitComponents, getCustomName, getName, removeComponentsFromTag
Methods 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, triggerEvent
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate
Methods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData
Methods 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:
getContainerSize
in 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:
isEmpty
in interfacenet.minecraft.world.Container
- Overrides:
isEmpty
in 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
public net.minecraft.world.item.ItemStack getItem(int slotIndex) Returns the stack in slot i.- Specified by:
getItem
in interfacenet.minecraft.world.Container
- Overrides:
getItem
in 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:
removeItem
in interfacenet.minecraft.world.Container
- Overrides:
removeItem
in 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:
removeItemNoUpdate
in interfacenet.minecraft.world.Container
- Overrides:
removeItemNoUpdate
in 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:
setItem
in interfacenet.minecraft.world.Container
- Overrides:
setItem
in 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:
getMaxStackSize
in 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:
stillValid
in interfacenet.minecraft.world.Container
- Overrides:
stillValid
in 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:
canPlaceItem
in 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:
getSlotsForFace
in 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:
canPlaceItemThroughFace
in 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:
canTakeItemThroughFace
in 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:
getUpdateTag
in classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacket
in 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:
onDataPacket
in interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension
-
loadAdditional
public void loadAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) - Overrides:
loadAdditional
in classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup) - Overrides:
saveAdditional
in 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:
startOpen
in interfacenet.minecraft.world.Container
-
stopOpen
public void stopOpen(net.minecraft.world.entity.player.Player playerIn) - Specified by:
stopOpen
in interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfacenet.minecraft.world.Clearable
- Overrides:
clearContent
in classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayName
in interfacenet.minecraft.world.MenuProvider
- Specified by:
getDisplayName
in interfacenet.minecraft.world.Nameable
- Overrides:
getDisplayName
in classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getDefaultName
@NotNull protected @NotNull net.minecraft.network.chat.Component getDefaultName()- Specified by:
getDefaultName
in classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getItems
protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()- Specified by:
getItems
in classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
setItems
protected void setItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items) - Specified by:
setItems
in 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:
createMenu
in interfacenet.minecraft.world.inventory.MenuConstructor
- Overrides:
createMenu
in 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:
createMenu
in 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:
fillStackedContents
in interfacenet.minecraft.world.inventory.StackedContentsCompatible
-