Package net.minecraft.block.entity
Class BrewingStandBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LockableContainerBlockEntity
net.minecraft.block.entity.BrewingStandBlockEntity
- All Implemented Interfaces:
Inventory,SidedInventory,NamedScreenHandlerFactory,ScreenHandlerFactory,Clearable,Nameable
public class BrewingStandBlockEntity extends LockableContainerBlockEntity implements SidedInventory
-
Field Summary
Fields Modifier and Type Field Description private static int[]BOTTOM_SLOTSprivate intbrewTimeprivate intfuelprivate DefaultedList<ItemStack>inventoryprivate ItemitemBrewingprotected PropertyDelegatepropertyDelegateprivate static int[]SIDE_SLOTSprivate boolean[]slotsEmptyLastTickprivate static int[]TOP_SLOTSFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors Constructor Description BrewingStandBlockEntity(BlockPos blockPos, BlockState blockState) -
Method Summary
Modifier and Type Method Description private static booleancanCraft(DefaultedList<ItemStack> defaultedList)booleancanExtract(int slot, ItemStack stack, Direction dir)Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.booleancanInsert(int slot, ItemStack stack, Direction dir)Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.booleancanPlayerUse(PlayerEntity player)voidclear()private static voidcraft(World world, BlockPos blockPos, DefaultedList<ItemStack> defaultedList)protected ScreenHandlercreateScreenHandler(int syncId, PlayerInventory playerInventory)voidfromTag(CompoundTag tag)int[]getAvailableSlots(Direction side)Gets the available slot positions that are reachable from a given side.protected TextgetContainerName()private boolean[]getSlotsEmpty()ItemStackgetStack(int slot)Fetches the stack currently stored at the given slot.booleanisEmpty()booleanisValid(int slot, ItemStack stack)Returns whether the given stack is a valid for the indicated slot position.ItemStackremoveStack(int slot)Removes the stack currently stored at the indicated slot.ItemStackremoveStack(int slot, int amount)Removes a specific number of items from the given slot.voidsetStack(int slot, ItemStack stack)intsize()static voidtick(World world, BlockPos blockPos, BlockState blockState, BrewingStandBlockEntity brewingStandBlockEntity)CompoundTagtoTag(CompoundTag tag)Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, checkUnlocked, createMenu, getCustomName, getDisplayName, getName, setCustomNameMethods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, setCachedState, setWorld, toInitialChunkDataTag, toUpdatePacketMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
containsAny, count, getMaxCountPerStack, markDirty, onClose, onOpenMethods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
TOP_SLOTS
private static final int[] TOP_SLOTS -
BOTTOM_SLOTS
private static final int[] BOTTOM_SLOTS -
SIDE_SLOTS
private static final int[] SIDE_SLOTS -
inventory
-
brewTime
private int brewTime -
slotsEmptyLastTick
private boolean[] slotsEmptyLastTick -
itemBrewing
-
fuel
private int fuel -
propertyDelegate
-
-
Constructor Details
-
BrewingStandBlockEntity
-
-
Method Details
-
getContainerName
- Specified by:
getContainerNamein classLockableContainerBlockEntity
-
size
public int size() -
isEmpty
public boolean isEmpty() -
tick
public static void tick(World world, BlockPos blockPos, BlockState blockState, BrewingStandBlockEntity brewingStandBlockEntity) -
getSlotsEmpty
private boolean[] getSlotsEmpty() -
canCraft
-
craft
-
fromTag
- Overrides:
fromTagin classLockableContainerBlockEntity
-
toTag
- Overrides:
toTagin classLockableContainerBlockEntity
-
getStack
Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY. -
removeStack
Removes a specific number of items from the given slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
-
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot.
-
setStack
-
canPlayerUse
- Specified by:
canPlayerUsein interfaceInventory
-
isValid
Returns whether the given stack is a valid for the indicated slot position. -
getAvailableSlots
Gets the available slot positions that are reachable from a given side.- Specified by:
getAvailableSlotsin interfaceSidedInventory
-
canInsert
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.- Specified by:
canInsertin interfaceSidedInventory
-
canExtract
Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.- Specified by:
canExtractin interfaceSidedInventory
-
clear
public void clear() -
createScreenHandler
- Specified by:
createScreenHandlerin classLockableContainerBlockEntity
-