Interface FarmingEngine
public interface FarmingEngine
The farming simulation, registered as a service: which blocks get a
random tick, how a block change reaches the plants around it, and what hoes and fertilizers do.
The server only ever talks to the engine in effect: it calls tick(Key, int, int, long) on every game tick
of every region, and reports what happens in a world to the FarmingWorld the engine
hands out. An engine wrapping the built-in one passes on what it does not handle itself.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidRuns one game tick of farming on a region: where random ticks are given to its blocks.Gets the farming view of a world: what its plants read, and what changes them.
-
Method Details
-
world
Gets the farming view of a world: what its plants read, and what changes them.- Parameters:
world- a loaded world- Returns:
- the farming view of the world
- Throws:
IllegalArgumentException- if the world is not one the engine can drive- Since:
- 0.1.0
-
tick
Runs one game tick of farming on a region: where random ticks are given to its blocks.Called by the server on the thread of the region, once per tick of the region, as a
RegionTickHandleris. It is not called while the game is frozen.- Parameters:
world- the key of the world of the regionsectionX- the X coordinate of the region, in regionssectionZ- the Z coordinate of the region, in regionscurrentTick- the number of ticks the region ran- Since:
- 0.1.0
-