Class TeslaSynthesizerBlockEntity
java.lang.Object
net.neoforged.neoforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
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.common.capabilities.ICapabilityProvider,net.neoforged.neoforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>,net.neoforged.neoforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>,net.neoforged.neoforge.common.extensions.IBlockEntityExtension,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
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.neoforged.neoforge.common.capabilities.CapabilityProvider
net.neoforged.neoforge.common.capabilities.CapabilityProvider.AsField<B extends net.neoforged.neoforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected 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 interface net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE -
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.<T> @NotNull net.neoforged.neoforge.common.util.LazyOptional<T>getCapability(net.neoforged.neoforge.common.capabilities.Capability<T> capability, @Nullable net.minecraft.core.Direction facing) Get capabilities.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.int[]getSlotsForFace(net.minecraft.core.Direction side) Get slots for faces.voidInvalidate capabilities.booleanisEmpty()Check if the inventory is empty.static booleanisFuel(net.minecraft.world.item.ItemStack stack) Check if an item is fuel.voidload(net.minecraft.nbt.CompoundTag nbt) Load NBT data.@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 pTag) Save NBT data.voidsetItem(int index, net.minecraft.world.item.ItemStack stack) Sets the given item stack to the specified slot in the inventory.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
canOpen, canUnlock, createMenu, createUnSidedHandler, getCustomName, getDisplayName, getName, reviveCaps, setCustomNameMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class net.neoforged.neoforge.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, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpenMethods inherited from interface net.minecraft.world.level.block.EntityBlock
getListener, getTickerMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
deserializeNBT, getModelData, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBTMethods inherited from interface net.neoforged.neoforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
items
protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items
-
-
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
-
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
-
load
public void load(net.minecraft.nbt.CompoundTag nbt) Load NBT data.- Overrides:
loadin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Parameters:
nbt- theCompoundNBTto load
-
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag pTag) Save NBT data.- Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Parameters:
pTag- theCompoundNBTto save
-
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- 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- 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- 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- 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- 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- 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
-
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
-
getCapability
@NotNull public <T> @NotNull net.neoforged.neoforge.common.util.LazyOptional<T> getCapability(net.neoforged.neoforge.common.capabilities.Capability<T> capability, @Nullable @Nullable net.minecraft.core.Direction facing) Get capabilities.- Specified by:
getCapabilityin interfacenet.neoforged.neoforge.common.capabilities.ICapabilityProvider- Overrides:
getCapabilityin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity- Parameters:
capability- theCapabilityinstancefacing- theDirectionthe block is facing- Returns:
- LazyOptional
-
invalidateCaps
public void invalidateCaps()Invalidate capabilities.- Specified by:
invalidateCapsin interfacenet.neoforged.neoforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>- Overrides:
invalidateCapsin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-