Class ResourceManager
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.geo.ResourceManager
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSupplies(GEOResource resource, org.bukkit.World world, int x, int z) This method returns the amount of a certainGEOResourcefound in a givenChunk.voidgetSuppliesAsync(GEOResource resource, org.bukkit.Chunk chunk, IAsyncReadCallback<Integer> callback) voidscan(org.bukkit.entity.Player p, org.bukkit.block.Block block, int page) This method will start a geo-scan at the givenBlockand display the result of that scan to the givenPlayer.voidsetSupplies(GEOResource resource, org.bukkit.World world, int x, int z, int value) This method will set the supplies in a givenChunkto the specified value.
-
Constructor Details
-
ResourceManager
This will create a newResourceManager.- Parameters:
plugin- OurSlimefuninstance
-
-
Method Details
-
getSupplies
@Nonnull public OptionalInt getSupplies(@Nonnull GEOResource resource, @Nonnull org.bukkit.World world, int x, int z) This method returns the amount of a certainGEOResourcefound in a givenChunk. The result is anOptionalIntwhich will be empty if thisGEOResourcehas not been generated at thatLocationyet.- Parameters:
resource- TheGEOResourceto queryworld- TheWorldof thisLocationx- TheChunkx coordinatez- TheChunkz coordinate- Returns:
- An
OptionalInt, either empty or containing the amount of the givenGEOResource
-
getSuppliesAsync
public void getSuppliesAsync(GEOResource resource, org.bukkit.Chunk chunk, IAsyncReadCallback<Integer> callback) -
setSupplies
public void setSupplies(@Nonnull GEOResource resource, @Nonnull org.bukkit.World world, int x, int z, int value) This method will set the supplies in a givenChunkto the specified value.- Parameters:
resource- TheGEOResourceworld- TheWorldx- The x coordinate of thatChunkz- The z coordinate of thatChunkvalue- The new supply value
-
scan
public void scan(@Nonnull org.bukkit.entity.Player p, @Nonnull org.bukkit.block.Block block, int page) This method will start a geo-scan at the givenBlockand display the result of that scan to the givenPlayer. Note that scans are always perChunk, not perBlock, theBlockparameter only determines theLocationthat was clicked but it will still scan the entireChunk.- Parameters:
p- ThePlayerwho requested these resultsblock- TheBlockwhich the scan starts atpage- The zero-based page to display
-