地块属性
获取地块tile
tile可以通过Location Class的tile方法获取,其参数为:
对于农场Location,可以这样获取:
基本属性
如果获取到的tile上不是空,即tile != null
。就会有如下至少两个属性:
Key |
Value Type |
Value |
type |
string |
base feature type |
passable |
integer |
true (1) if a bot could pass through this tile; false (0) if it’s impassable |
不同地块name与属性
trees
Key |
Value Type |
Value |
treeType |
integer |
type of tree |
growthStage |
integer |
tree’s current stage of growth |
health |
integer |
tree health |
stump |
boolean |
whether this tree has been cut down |
tapped |
boolean |
whether this tree has been tapped |
hasSeed |
boolean |
whether this tree has seeds available |
chests/bots
Key |
Value Type |
Value |
inventory |
list |
list of items contained in this chest/bot |
HoeDirt
Key |
Value Type |
Value |
dry |
boolean |
whether this dirt is dry (true) or watered (false) |
crop |
map |
map of information about the crop growing here, or null if none |
crop
使用harvestable
来检测作物是否可以收割。
Key |
Value Type |
Value |
name |
string |
name of the crop being grown, e.g. “Potato” |
phase |
integer |
current growth phase of this crop |
maxPhase |
integer |
number of growth phases of this crop type |
mature |
boolean |
whether crop is fully grown (Note 1) |
dead |
boolean |
whether the crop is dead |
harvestable |
boolean |
whether this crop is ready to harvest |
harvestMethod |
integer |
0 = normal (hand), 1 = scythe |