Class InfuserTileEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
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.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>
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.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
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.booleanWhether 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 interface net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZEFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
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.voidprotected 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.net.minecraft.world.item.ItemStackgetItem(int slotIndex) Returns the stack in slot i.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.CompoundTagbooleanisEmpty()booleanChecks if the infuser is running.voidload(net.minecraft.nbt.CompoundTag nbtTagCompound) voidonDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt) net.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) static voidserverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, InfuserTileEntity blockEntity) 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).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
canOpen, canUnlock, createUnSidedHandler, getCapability, getCustomName, getName, invalidateCaps, reviveCaps, setCustomNameMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCapsMethods 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, hasAnyMatching, hasAnyOf, setChangedMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onLoad, requestModelDataUpdate, serializeNBTMethods 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. -
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
-
getItem
public net.minecraft.world.item.ItemStack getItem(int slotIndex) Returns the stack in slot i.- Specified by:
getItemin interfacenet.minecraft.world.Container- 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- 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- 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- 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
-
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()- 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) - Specified by:
onDataPacketin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag nbtTagCompound) - Overrides:
loadin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound) - 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
-
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
-
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 blockEntity) -
fillStackedContents
public void fillStackedContents(net.minecraft.world.entity.player.StackedContents stackedContents) - Specified by:
fillStackedContentsin interfacenet.minecraft.world.inventory.StackedContentsCompatible
-