Package cn.nukkit.blockentity
Class BlockEntityBrewingStand
java.lang.Object
cn.nukkit.math.Vector3
cn.nukkit.positiontracking.NamedPosition
cn.nukkit.level.Position
cn.nukkit.blockentity.BlockEntity
cn.nukkit.blockentity.BlockEntitySpawnable
cn.nukkit.blockentity.BlockEntityBrewingStand
- All Implemented Interfaces:
BlockEntityContainer
,BlockEntityNameable
,InventoryHolder
,Cloneable
public class BlockEntityBrewingStand
extends BlockEntitySpawnable
implements InventoryHolder, BlockEntityContainer, BlockEntityNameable
-
Field Summary
Modifier and TypeFieldDescriptionint
int
int
Deprecated.protected BrewingInventory
static final int
Fields inherited from class cn.nukkit.blockentity.BlockEntity
BANNER, BARREL, BEACON, BED, BEEHIVE, BELL, BLAST_FURNACE, BREWING_STAND, CAMPFIRE, CAULDRON, CHEST, chunk, closed, COMMAND_BLOCK, COMPARATOR, CONDUIT, count, DAYLIGHT_DETECTOR, DISPENSER, DROPPER, ENCHANT_TABLE, END_GATEWAY, END_PORTAL, ENDER_CHEST, FLOWER_POT, FURNACE, HOPPER, id, ITEM_FRAME, JUKEBOX, lastUpdate, LECTERN, LODESTONE, MOB_SPAWNER, movable, MOVING_BLOCK, MUSIC, name, namedTag, NETHER_REACTOR, PISTON_ARM, SCULK_CATALYST, SCULK_SENSOR, SCULK_SHRIEKER, server, SHULKER_BOX, SIGN, SKULL, SMOKER, TARGET, timing
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkIngredient
(Item ingredient) Deprecated.void
close()
int
getFuel()
getItem
(int index) 返回一个存储在容器里的物品的Item
对象。
Returns an item that stores in this container, as anItem
object.getName()
返回这个事物的名字。
Gets the name of this object.int
getSize()
返回这个容器最多能包含的物品数量。
Returns the max number of items that this container can contain.protected int
getSlotIndex
(int index) boolean
hasName()
返回这个事物是否有名字。
Whether this object has a name.protected void
boolean
void
loadNBT()
void
onBreak()
boolean
onUpdate()
void
saveNBT()
protected void
protected void
sendFuel()
void
setFuel
(int fuel) void
把一个物品存储进容器。
Sets or stores this item into this container.void
设置或更改这个事物的名字。
Changes the name of this object, or names it.void
Methods inherited from class cn.nukkit.blockentity.BlockEntitySpawnable
getSpawnPacket, getSpawnPacket, spawnTo, spawnToAll, updateCompoundTag
Methods inherited from class cn.nukkit.blockentity.BlockEntity
createBlockEntity, createBlockEntity, createBlockEntity, getBlock, getCleanedNBT, getDefaultCompound, getId, getLevelBlockEntity, getSaveId, isMovable, isObservable, onBreak, registerBlockEntity, scheduleUpdate, setDirty
Methods inherited from class cn.nukkit.level.Position
abs, add, add, add, add, ceil, clone, divide, floor, fromObject, fromObject, getChunk, getLevel, getLevelBlock, getLevelBlock, getLevelBlock, getLevelBlockAround, getLevelBlockAtLayer, getLevelBlockState, getLevelBlockState, getLevelName, getLocation, getSide, getSide, getTickCachedLevelBlock, getTickCachedLevelBlockAtLayer, getTypedBlockEntity, getValidLevel, isValid, multiply, round, setComponents, setComponents, setLevel, setStrong, setWeak, subtract, subtract, subtract, subtract, subtract, toString
Methods inherited from class cn.nukkit.positiontracking.NamedPosition
matchesNamedPosition
Methods inherited from class cn.nukkit.math.Vector3
asBlockVector3, asVector3f, cross, distance, distance, distanceManhattan, distanceSquared, distanceSquared, dot, down, down, east, east, equals, getAxis, getChunkSectionY, getChunkVector, getChunkX, getChunkZ, getFloorX, getFloorY, getFloorZ, getForward, getIntermediateWithXValue, getIntermediateWithYValue, getIntermediateWithZValue, getRight, getSideVec, getSouth, getUp, getWest, getX, getY, getZ, hashCode, length, lengthSquared, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, normalize, north, north, rawHashCode, setComponentsAdding, setComponentsAdding, setX, setY, setZ, south, south, up, up, west, west
-
Field Details
-
inventory
-
MAX_BREW_TIME
public static final int MAX_BREW_TIME- See Also:
-
brewTime
public int brewTime -
fuelTotal
public int fuelTotal -
fuelAmount
public int fuelAmount -
ingredients
@Deprecated @DeprecationDetails(since="1.3.1.2-PN", reason="Makes no sense and is unused", replaceWith="Use CraftingManager") public static final List<Integer> ingredientsDeprecated.
-
-
Constructor Details
-
BlockEntityBrewingStand
-
-
Method Details
-
initBlockEntity
protected void initBlockEntity()- Overrides:
initBlockEntity
in classBlockEntitySpawnable
-
getName
Description copied from interface:BlockEntityNameable
返回这个事物的名字。
Gets the name of this object.- Specified by:
getName
in interfaceBlockEntityNameable
- Overrides:
getName
in classBlockEntity
- Returns:
- 这个事物的名字。
The name of this object.
-
hasName
public boolean hasName()Description copied from interface:BlockEntityNameable
返回这个事物是否有名字。
Whether this object has a name.- Specified by:
hasName
in interfaceBlockEntityNameable
- Returns:
- 如果有名字,返回
true
。true
for this object has a name.
-
setName
Description copied from interface:BlockEntityNameable
设置或更改这个事物的名字。
Changes the name of this object, or names it.- Specified by:
setName
in interfaceBlockEntityNameable
- Parameters:
name
- 这个事物的新名字。
The new name of this object.
-
close
public void close()- Overrides:
close
in classBlockEntity
-
onBreak
public void onBreak()- Overrides:
onBreak
in classBlockEntity
-
saveNBT
public void saveNBT()- Overrides:
saveNBT
in classBlockEntity
-
loadNBT
- Overrides:
loadNBT
in classBlockEntity
-
isBlockEntityValid
public boolean isBlockEntityValid()- Specified by:
isBlockEntityValid
in classBlockEntity
-
getSize
public int getSize()Description copied from interface:BlockEntityContainer
返回这个容器最多能包含的物品数量。
Returns the max number of items that this container can contain.- Specified by:
getSize
in interfaceBlockEntityContainer
- Returns:
- 最多能包含的物品数量。
The max number.
-
getSlotIndex
protected int getSlotIndex(int index) -
getItem
Description copied from interface:BlockEntityContainer
返回一个存储在容器里的物品的Item
对象。
Returns an item that stores in this container, as anItem
object.- Specified by:
getItem
in interfaceBlockEntityContainer
- Parameters:
index
- 这个物品的索引序号。
The index number of this item.- Returns:
- 这个物品的
Item
对象。
AnItem
object for this item.
-
setItem
Description copied from interface:BlockEntityContainer
把一个物品存储进容器。
Sets or stores this item into this container.注意:如果这个容器相应的索引序号已经有了物品,那么新存储的物品将会替换原有的物品。
Notice: If there is already an item for this index number, the new item being stored will REPLACE the old one.- Specified by:
setItem
in interfaceBlockEntityContainer
- Parameters:
index
- 这个物品的索引序号。
The index number of this item.item
- 描述这个物品的Item
对象。
TheItem
object that describes this item.
-
getInventory
- Specified by:
getInventory
in interfaceInventoryHolder
-
checkIngredient
@Deprecated @DeprecationDetails(since="1.3.1.2-PN", reason="Checks the wrong location") protected boolean checkIngredient(Item ingredient) Deprecated. -
onUpdate
@PowerNukkitDifference(info="Fixed a lot of issues involving the brewing processes",since="1.3.1.2-PN") @PowerNukkitDifference(info="Using new method to play sounds",since="1.4.0.0-PN") public boolean onUpdate()- Overrides:
onUpdate
in classBlockEntity
-
sendFuel
protected void sendFuel() -
sendBrewTime
protected void sendBrewTime() -
updateBlock
@PowerNukkitDifference(info="Will stop the processing if there are no other matching recipe", since="1.3.1.2-PN") public void updateBlock() -
getFuel
public int getFuel() -
setFuel
public void setFuel(int fuel) -
getSpawnCompound
- Overrides:
getSpawnCompound
in classBlockEntitySpawnable
-