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
,Tickable
public class BrewingStandBlockEntity extends LockableContainerBlockEntity implements SidedInventory, Tickable
-
Field Summary
Fields Modifier and Type Field Description private static int[]
BOTTOM_SLOTS
private int
brewTime
private int
fuel
private DefaultedList<ItemStack>
inventory
private Item
itemBrewing
protected PropertyDelegate
propertyDelegate
private static int[]
SIDE_SLOTS
private boolean[]
slotsEmptyLastTick
private static int[]
TOP_SLOTS
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
Constructors Constructor Description BrewingStandBlockEntity()
-
Method Summary
Modifier and Type Method Description private boolean
canCraft()
boolean
canExtract(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.boolean
canInsert(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.boolean
canPlayerUse(PlayerEntity player)
void
clear()
private void
craft()
protected ScreenHandler
createScreenHandler(int syncId, PlayerInventory playerInventory)
void
fromTag(BlockState state, CompoundTag tag)
int[]
getAvailableSlots(Direction side)
Gets the available slot positions that are reachable from a given side.protected Text
getContainerName()
boolean[]
getSlotsEmpty()
ItemStack
getStack(int slot)
Fetches the stack currently stored at the given slot.boolean
isEmpty()
boolean
isValid(int slot, ItemStack stack)
Returns whether the given stack is a valid for the indicated slot position.ItemStack
removeStack(int slot)
Removes the stack currently stored at the indicated slot.ItemStack
removeStack(int slot, int amount)
Removes a specific number of items from the given slot.void
setStack(int slot, ItemStack stack)
int
size()
void
tick()
CompoundTag
toTag(CompoundTag tag)
Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, checkUnlocked, createMenu, getCustomName, getDisplayName, getName, setCustomName
Methods inherited from class net.minecraft.block.entity.BlockEntity
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacket
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
containsAny, count, getMaxCountPerStack, markDirty, onClose, onOpen
Methods 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
public BrewingStandBlockEntity()
-
-
Method Details
-
getContainerName
- Specified by:
getContainerName
in classLockableContainerBlockEntity
-
size
public int size() -
isEmpty
public boolean isEmpty() -
tick
public void tick() -
getSlotsEmpty
public boolean[] getSlotsEmpty() -
canCraft
private boolean canCraft() -
craft
private void craft() -
fromTag
- Overrides:
fromTag
in classLockableContainerBlockEntity
-
toTag
- Overrides:
toTag
in 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:
removeStack
in interfaceInventory
- Returns:
- the removed items as a stack
-
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the stack previously stored at the indicated slot.
-
setStack
-
canPlayerUse
- Specified by:
canPlayerUse
in 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:
getAvailableSlots
in interfaceSidedInventory
-
canInsert
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.- Specified by:
canInsert
in interfaceSidedInventory
-
canExtract
Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.- Specified by:
canExtract
in interfaceSidedInventory
-
clear
public void clear() -
createScreenHandler
- Specified by:
createScreenHandler
in classLockableContainerBlockEntity
-