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 Type
    Method
    Description
    void
    tick(Key world, int sectionX, int sectionZ, long currentTick)
    Runs one game tick of farming on a region: where random ticks are given to its blocks.
    world(World world)
    Gets the farming view of a world: what its plants read, and what changes them.
  • Method Details

    • world

      FarmingWorld world(World 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

      void tick(Key world, int sectionX, int sectionZ, long currentTick)
      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 RegionTickHandler is. It is not called while the game is frozen.

      Parameters:
      world - the key of the world of the region
      sectionX - the X coordinate of the region, in regions
      sectionZ - the Z coordinate of the region, in regions
      currentTick - the number of ticks the region ran
      Since:
      0.1.0