Class TeslaSynthesizerBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
tech.anonymoushacker1279.immersiveweapons.blockentity.TeslaSynthesizerBlockEntity
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.inventory.MenuConstructor,net.minecraft.world.inventory.StackedContentsCompatible,net.minecraft.world.level.block.EntityBlock,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 TeslaSynthesizerBlockEntity
extends net.minecraft.world.level.block.entity.BaseContainerBlockEntity
implements net.minecraft.world.WorldlyContainer, net.minecraft.world.inventory.StackedContentsCompatible, net.minecraft.world.level.block.EntityBlock
-
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 TypeFieldDescriptionfinal net.minecraft.world.inventory.ContainerDataprotected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> 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
ConstructorsConstructorDescriptionTeslaSynthesizerBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) Constructor for AbstractTeslaBlockEntity. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceItem(int index, net.minecraft.world.item.ItemStack stack) Check if automation is allowed to insert the given stack (ignoring stack size) into the given slot.booleancanPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, @Nullable net.minecraft.core.Direction direction) Determine if an item can be placed through a face.booleancanTakeItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction) Determine if an item can be removed through a face.voidClear the inventory.protected net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int id, net.minecraft.world.entity.player.Inventory inventory) voidfillStackedContents(net.minecraft.world.entity.player.StackedContents helper) Fill stacked contents.intGet the number of slots in the inventory.protected net.minecraft.network.chat.Componentnet.minecraft.world.item.ItemStackgetItem(int index) Get the stack in the given slot.protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()int[]getSlotsForFace(net.minecraft.core.Direction side) Get slots for faces.net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider provider) booleanisEmpty()Check if the inventory is empty.static booleanisFuel(net.minecraft.world.item.ItemStack stack) Check if an item is fuel.voidloadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) @Nullable net.minecraft.world.level.block.entity.BlockEntitynewBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) Create a block entity for the block.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.net.minecraft.world.item.ItemStackremoveItemNoUpdate(int index) Removes a stack from the given slot and returns it.protected voidsaveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) voidsetItem(int index, net.minecraft.world.item.ItemStack stack) Sets the given item stack to the specified slot in the inventory.protected voidsetItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> stacks) booleanstillValid(net.minecraft.world.entity.player.Player player) Check if the player is still valid.voidtick(net.minecraft.world.level.Level level) Runs once per tick.Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
applyImplicitComponents, canOpen, canUnlock, collectImplicitComponents, createMenu, getCustomName, getDisplayName, 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, getUpdatePacket, 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, getExistingData, 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, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpenMethods inherited from interface net.minecraft.world.level.block.EntityBlock
getListener, getTickerMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdateMethods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpenMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
items
protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items -
containerData
public final net.minecraft.world.inventory.ContainerData containerData
-
-
Constructor Details
-
TeslaSynthesizerBlockEntity
public TeslaSynthesizerBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) Constructor for AbstractTeslaBlockEntity.
-
-
Method Details
-
getDefaultName
protected 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> stacks) - Specified by:
setItemsin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
createMenu
protected net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, net.minecraft.world.entity.player.Inventory inventory) - Specified by:
createMenuin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
isFuel
public static boolean isFuel(net.minecraft.world.item.ItemStack stack) Check if an item is fuel.- Parameters:
stack- theItemStackto check- Returns:
- boolean
-
tick
public void tick(net.minecraft.world.level.Level level) Runs once per tick. Handle smelting procedures here. -
newBlockEntity
@Nullable public @Nullable net.minecraft.world.level.block.entity.BlockEntity newBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) Create a block entity for the block.- Specified by:
newBlockEntityin interfacenet.minecraft.world.level.block.EntityBlock- Parameters:
blockPos- theBlockPosthe block is atblockState- theBlockStateof the block- Returns:
- BlockEntity
-
loadAdditional
public void loadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider provider) - Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
getSlotsForFace
public int[] getSlotsForFace(net.minecraft.core.Direction side) Get slots for faces.- Specified by:
getSlotsForFacein interfacenet.minecraft.world.WorldlyContainer- Parameters:
side- theDirectionto check- Returns:
- int[]
-
getContainerSize
public int getContainerSize()Get the number of slots in the inventory.- Specified by:
getContainerSizein interfacenet.minecraft.world.Container- Returns:
- int
-
isEmpty
public boolean isEmpty()Check if the inventory is empty.- Specified by:
isEmptyin interfacenet.minecraft.world.Container- Overrides:
isEmptyin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Returns:
- boolean
-
canPlaceItemThroughFace
public boolean canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, @Nullable @Nullable net.minecraft.core.Direction direction) Determine if an item can be placed through a face.- Specified by:
canPlaceItemThroughFacein interfacenet.minecraft.world.WorldlyContainer- Parameters:
index- the slot indexitemStack- theItemStackto insertdirection- theDirectionthe block is facing- Returns:
- boolean
-
canTakeItemThroughFace
public boolean canTakeItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction) Determine if an item can be removed through a face.- Specified by:
canTakeItemThroughFacein interfacenet.minecraft.world.WorldlyContainer- Parameters:
index- the slot indexitemStack- theItemStackto removedirection- theDirectionthe block is facing- Returns:
- boolean
-
getItem
public net.minecraft.world.item.ItemStack getItem(int index) Get the stack in the given slot.- Specified by:
getItemin interfacenet.minecraft.world.Container- Overrides:
getItemin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Parameters:
index- the slot index- Returns:
- ItemStack
-
removeItem
public 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- Parameters:
index- the slot indexcount- the number to remove- Returns:
- ItemStack
-
removeItemNoUpdate
public 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- Parameters:
index- the slot index- Returns:
- ItemStack
-
setItem
public void setItem(int index, net.minecraft.world.item.ItemStack stack) Sets the given item stack to the specified slot in the inventory.- Specified by:
setItemin interfacenet.minecraft.world.Container- Overrides:
setItemin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Parameters:
index- the slot indexstack- theItemStackto set
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) Check if the player is still valid.- Specified by:
stillValidin interfacenet.minecraft.world.Container- Overrides:
stillValidin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Parameters:
player- thePlayerEntityto check- Returns:
- boolean
-
canPlaceItem
public boolean canPlaceItem(int index, net.minecraft.world.item.ItemStack stack) Check if automation is allowed to insert the given stack (ignoring stack size) into the given slot.- Specified by:
canPlaceItemin interfacenet.minecraft.world.Container- Parameters:
index- the slot indexstack- theItemStackto insert
-
clearContent
public void clearContent()Clear the inventory.- Specified by:
clearContentin interfacenet.minecraft.world.Clearable- Overrides:
clearContentin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
fillStackedContents
public void fillStackedContents(net.minecraft.world.entity.player.StackedContents helper) Fill stacked contents.- Specified by:
fillStackedContentsin interfacenet.minecraft.world.inventory.StackedContentsCompatible- Parameters:
helper- theRecipeItemHelperinstance
-