Atherys / AtherysProfessions

A survival professions plugin for the A'therys Horizons server
GNU General Public License v3.0
0 stars 0 forks source link

Crop Growth System #5

Open cicetil opened 3 years ago

cicetil commented 3 years ago

The crop growth system allows us to further depth and control for crops as a gameplay avenue.

Since some materials (cloth) which are needed for crafting recipes will be produced from crops, we need a way to limit the amount and speed of which those materials are acquired. Higher tier materials should be rarer and thus be harder to mass produce with crops.

How we can do this is through two methods:

- Requiring direct sunlight In order to grow, plants must have access to the sky without any non-transparent blocks above them. (In the same method as a beacon would be required for the beam). This is to prevent massive, multi-layered underground farms which are used to mass produce crops with little area investment. Players must now have enough town area claimed to plant large farms since they can't be stacked.

If the majority of players are against this, we could potentially only limit the crops which produce high tier materials in the future. (or preemptively make the affected crops configurable)


- Custom growth timers To limit how fast certain crops can be grown, (and thus their material rarity), plants should have a configurable timer which can be adjusted in accordance to their material tier. Higher tier crops will take much longer to grow than normal vanilla plants but will be very rewarding when fully grown.

One potential way to do this is using random block tick events. Listening for the TickBlockEvent.Random event and checking the config for any configured blocks. If a configured block is found, cancel any other tick update events and run a secondary event with a configured chance to replace that block with another configured block. While not a perfect timer, it mimics Minecraft's crop growth well. Would need some testing to get average growth times.

Example: minecraft:wheat:0 has a 0.50 (50%) chance of being replaced with minecraft:wheat:1 after being affected by a random tick event.


In order to include vanilla Minecraft's growth conditions while also retaining more use-case beyond just crops, a is-crop boolean option should be available. If true, it will affect what happens based on various conditions.


Example Config:

growth-timers [

"minecraft:wheat:0": {
     "replace-with": "minecraft:wheat:1",
     "replace-chance": 0.50,
     "is-crop": true
},
"minecraft:wheat:1": {
     "replace-with": "minecraft:wheat:2",
     "replace-chance": 0.50,
     "is-crop": true
},
"minecraft:wheat:2": {
     "replace-with": "minecraft:wheat:3",
     "replace-chance": 0.50,
     "is-crop": true
}
]
cicetil commented 2 years ago

adjusted issue