Class ResourceManager

java.lang.Object
io.github.thebusybiscuit.slimefun4.api.geo.ResourceManager

public class ResourceManager extends Object
The ResourceManager is responsible for registering and managing a GEOResource. You have to use the ResourceManager if you want to generate or consume a GEOResource too.
Author:
TheBusyBiscuit
See Also:
  • Constructor Details

  • Method Details

    • getSupplies

      @Nonnull public OptionalInt getSupplies(@Nonnull GEOResource resource, @Nonnull World world, int x, int z)
      This method returns the amount of a certain GEOResource found in a given Chunk. The result is an OptionalInt which will be empty if this GEOResource has not been generated at that Location yet.
      Parameters:
      resource - The GEOResource to query
      world - The World of this Location
      x - The Chunk x coordinate
      z - The Chunk z coordinate
      Returns:
      An OptionalInt, either empty or containing the amount of the given GEOResource
    • setSupplies

      public void setSupplies(@Nonnull GEOResource resource, @Nonnull World world, int x, int z, int value)
      This method will set the supplies in a given Chunk to the specified value.
      Parameters:
      resource - The GEOResource
      world - The World
      x - The x coordinate of that Chunk
      z - The z coordinate of that Chunk
      value - The new supply value
    • scan

      public void scan(@Nonnull Player p, @Nonnull Block block, int page)
      This method will start a geo-scan at the given Block and display the result of that scan to the given Player. Note that scans are always per Chunk, not per Block, the Block parameter only determines the Location that was clicked but it will still scan the entire Chunk.
      Parameters:
      p - The Player who requested these results
      block - The Block which the scan starts at
      page - The page to display