
Harvest Sprites
关于这些跨维度的小精灵,人们知之甚少。你看不见它们,也摸不着它们,但如果你提供食物、一点光亮以及一盏供其居住的精灵灯(Sprite Lamp),它们会很乐意帮你收割作物。一旦作物被收割,这些小精灵似乎对作物本身不再感兴趣,除非附近有精灵储藏箱(Sprite Hoard),否则它们只会将收获的作物扔在地上。如果你保持安静并偷偷向内窥视,或许能听到小精灵在储藏箱附近活动的声音。如果你用高饱和度的食物喂养小精灵,它们每次可以同时收割更多的作物。此外,食物提供的生命值越高,持续时间就越长。
Harvest Sprites 是一个早期游戏模组,通过消耗食物来换取作物的自动收割。默认情况下,小精灵会在以精灵灯为中心、上下各延伸 4 个方块的 9x9 区域内进行收割。位于精灵灯 5 个方块范围内的精灵储藏箱会自动收集收获的物品。
作物会被自动重新种植,但种子必须最初手动播种(或通过其他播种机制)。
精灵灯会根据其库存中食物的数量发出成比例的红石信号。这可以用来利用原版机制自动化地维持精灵灯的燃料供应。

注意:抱歉,小精灵不会收割树木、花朵、高草、下界疣、蘑菇、南瓜或西瓜(那些小精灵属于另一个工会)。
遇到问题或有建议?请访问 Issues 页面。
版本历史
1.1.0 添加了支持原版自动化的红石信号功能
1.0.0 初始发布
技术细节
本模组旨在兼容服务器,并提供了一些配置功能以调整其运行速度。精灵灯是唯一具有自动化功能的方块,而储藏箱只是被动存储,由灯进行检测。灯和储藏箱都实现了无方向性的容器接口,并且与物品运输类模组兼容。
配置
配置参数应该是不言自明的,但这里有一些调整模组的建议。
'ticks_per_cycle' 参数控制收割周期在游戏刻(ticks)中的发生频率。此参数可能对服务器性能影响最大,因此设置周期速率时请谨慎。除非你有需要以牺牲服务器性能为代价来获得非常快速的收割响应,否则不要将此值设置为低于默认值。
'harvest_rate' 参数根据提供给灯的食物饱和度值,控制每个周期收割多少作物。例如,在灯中使用胡萝卜(饱和度值为 0.6)并将速率设置为 5,则每个周期最多可收割 3 株作物。通过提高 'ticks_per_cycle' 参数来减少收割周期的频率,并增加每个周期收割的作物数量,效果会更好。
'harvest_range' 和 'harvest_height' 参数控制精灵灯的收割扫描范围。将此范围设置得过大可能会影响服务器性能,因此请保持合理。
'hoard_range' 和 'hoard_height' 参数同样控制灯用于定位储藏箱的扫描范围。储藏箱的数量对性能影响很小。默认范围比收割范围多 1,以限制定位储藏箱时需要扫描的方块数量。
其余的配置参数不影响性能。
'food_consumption_rate' 调整食物在灯中以每点生命值为单位的收割周期内的持续时间。食物提供的生命值越多,持续时间越长。提高此值将减少对食物的需求。将此值设置为 0 将禁用食物消耗,但仍需给灯放入一块食物以设定饱和度率(参见 'harvest_rate')。
'consume_only_on_harvest' 设置是否在没有任何作物可收割时也被动消耗食物。
'suppress_seed_drops' 过滤作物收获时的掉落物,移除主要作物的种子。如果一种作物掉落两种或更多类型的种子,仅过滤与该作物关联的种子。如果需要控制种子的获取途径,或者只是想清除多余的种子,此参数会有所帮助。
'randomize_hoards' 会将作物产量分配给所有可用的储藏箱。如果将其设置为 'false',储藏箱将按照扫描顺序选择,并且在时间上保持一致。设置为 'true' 将随机化储藏箱列表,使作物不会集中在同一个储藏箱中。
'enable_light' 控制精灵灯在激活时是否发出相当于火把的光照。
'emit_redstone' 允许精灵灯根据其物品栏槽位中食物的数量发出成比例的红石信号。
极客闲聊
在底层逻辑中,只有精灵灯具备智能。破坏灯会保留其库存和当前的食物状态。储藏箱是一个基于原版木桶(Barrel)设计的被动存储方块,破坏后不会保留其中的内容物。
灯在每个收获周期内扫描配置好的区域一次,并生成可收获方块列表。该列表是随机化的,最多会收获至设定的上限数量。灯不会破坏作物,而是收集如果手动破坏时本应掉落的物品,并将作物的年龄重置为零。这意味着,如果作物下方的耕地变为无效种植状态但未弹出种子,作物仍有可能继续处于可收获状态。这是出于有意的设计:灯无需使用工具来翻耕土地,也无需准备种子池进行播种,更不需要担心其他方块干扰种植过程。这一机制类似于提供右键收获功能的模组。由于灯不具备种植能力,所有作物都必须通过其他方式(由玩家或借助其他自动化手段)进行种植。
只有继承自 CropsBlock 的作物才可被收获。这可能意味着某些模组添加的作物并不兼容。灯通过作物的年龄(调用 isMaxAge() 方法)来判断其是否可收获,并将其年龄重置为 0。掉落物根据战利品表计算得出,并从掉落物中扣除一个种子物品,以模拟重新播种的过程。
任何响应 isFood() 的物品均可作为灯的能源,其生命值和饱和度值将被消耗直至用完。这应该允许几乎任何食物物品——无论是原版还是模组添加的——都能在灯中使用。
宝箱并非像远程收集器或真空箱那样的通用收集方块。它是一个被动存储方块,灯会搜索它并将收获的货物存入其中,而不是让物品掉落在世界中。

Harvest Sprites
Not much is known about these trans-dimensional sprites. You can't see them, can't feel them, but they will happily harvest crops if you offer them some food, a little light and a Sprite Lamp to live in. The sprites don't seem to have any interest in the crops once harvested and will just drop them on the ground unless a Sprite Hoard is nearby. If you are quiet, you may hear the sprites hanging around the hoard if you take a peek inside. If you feed the sprites with high saturation food, they will harvest more crops at the same time. Also, the more health a food item provides, the longer it lasts.
Harvest Sprites is an early game mod that harvests crops in exchange for food. By default, the sprites will harvest a 9x9 area centered on the Sprite Lamp and up to 4 blocks above/below. Sprite Hoards within 5 blocks of the Sprite Lamp will collect harvested items.
Crops are automatically replanted but the seeds must be initially planted manually (or through some other planting mechanism).
Sprite Lamps emit a redstone signal proportional to the amount of food it its inventory. This can be used to automate keeping the Sprite Lamp fueled using vanilla mechanics.

Note: Sorry, the sprites do not harvest trees, flowers, tall grass, nether wart, mushrooms, pumpkins, or melons (those sprites are from a different union).
Have an issue or a suggestion? Please visit the Issues page.
Version History
1.1.0 Added redstone signal support for vanilla automation
1.0.0 Initial release
Technical Details
This mod in intended to be server friendly and has some configuration features to adjust how fast it operates. The Sprite Lamp is the only block that has any automation, the hoards are just passive storage that the lamp detects. Both the Lamp and Hoard implement unsided inventories and are compatible with item transportation mods.
Configuration
The configuration parameters should be self explanatory but here are some suggestions for tuning the mod.
The 'ticks_per_cycle' parameter controls how often a harvest cycle occurs, in game ticks. This parameter probably has the most impact on server performance so be careful setting the cycle rate too low. Unless you have a need for very responsive harvesting at the cost of server performance, don't set this to anything lower than the default.
'harvest_rate' controls how many crops are harvested per cycle based on the saturation value of the food provided to the lamp. For example, using carrots in the lamp (saturation value of 0.6) and a rate setting of 5 will harvest up to 3 crops per cycle. You are better suited by decreasing how often harvest cycles occur (by raising the 'ticks_per_cycle' parameter) and increasing the number of harvested crops per cycle.
The 'harvest_range' and 'harvest_height' parameters control the harvest scan area of the Sprite Lamp. Making this range too big can have an effect on server performance, so keep it reasonable.
The 'hoard_range' and 'hoard_height' parameters likewise controls the scan area that the lamp will use to locate hoards. The number of hoards has very little impact on performance. The default range defaults to one more than the harvest range to limit how many blocks need to be scanned to locate hoards.
The rest of the configuration parameters have no effect on performance.
'food_consumption_rate' adjusts how long food lasts in the lamp in harvest cycles per health point. The more health a food item provides, the longer it lasts. Raising this value will decrease the demand on food. Setting this value to 0 will disable food consumption but a piece of food still needs to be given to the lamp to set the saturation rate (see 'harvest_rate')
'consume_only_on_harvest' sets if food is passively consumed even if there are no crops to harvest.
'suppress_seed_drops' filters what the crop drops on harvest to remove the seeds for the primary crop. If a crop drops two or more seed types, only the seed that associated with the crop is filtered. This parameter can help if there is a need to control seed availability or if you just want to get rid of excess seeds.
'randomize_hoards' will distribute crop yield to all available hoards. If this is set to 'false', hoards will be chosen in the order they are scanned and will be consistent over time. Setting to 'true' will randomize the list of hoards so the crops are not concentrated in the same hoard.
'enable_light' controls if the Sprite Lamp emits light equivalent to a torch when active.
'emit_redstone' allows the Sprite Lamp to emit a redstone signal proportional to the amount of food in its inventory slot.
Nerd Talk
Under the hood, only the Sprite Lamp has any intelligence. Breaking the lamp will maintain its inventory and current food state. The hoard is a passive storage block modeled after the vanilla Barrel and doesn't maintain its contents when broken.
The lamp scans the configured area once per harvest cycle and produces a list of harvestable blocks. This list is randomized and up to the harvest limit crops will be harvested. The lamp doesn't break the crop but it gathers the drops that would have resulted if it had been broken and resets its age back to zero. This means that there is a small chance that if the farmland under the crop becomes invalid for planting but doesn't eject the seed, the crop will continue to be harvestable. This is a conscious decision so that the lamp doesn't need to have a tool to till the ground, doesn't need a pool of seeds for planting, or worry about other blocks interfering with planting. This is a similar mechanic to mods that provide right-click harvesting. Since the lamp doesn't have the capability to plant, all crops must be planted through some other mechanism, either by the player or through other automation.
Only crops that are a sub class of CropsBlock are eligible for harvesting. This might mean that some modded crops are not compatible. The lamp uses a crop's age (via the isMaxAge() method) to determine if it is harvestable and resets it's age to 0. The drops are calculated from the loot table and one seed item is deducted from the drops to simulate replanting.
Any item that responds to isFood() is eligible to power the lamp with its health and saturation values used until it is consumed. This should allow nearly any food item, vanilla or modded, to be used in the lamp.
The hoard is not a general collector block like the Ranged Collector or Vacuum Chest. It is a passive storage block that the lamp searches for to receive harvested items instead of dropping them in the world.
评论 0
登录后参与评分
还没有评论,来抢沙发吧