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
-
Method Summary
Modifier and TypeMethodDescriptiongetSupplies
(GEOResource resource, World world, int x, int z) This method returns the amount of a certainGEOResource
found in a givenChunk
.void
void
setSupplies
(GEOResource resource, World world, int x, int z, int value) This method will set the supplies in a givenChunk
to the specified value.
-
Constructor Details
-
ResourceManager
This will create a newResourceManager
.- Parameters:
plugin
- OurSlimefun
instance
-
-
Method Details
-
getSupplies
@Nonnull public OptionalInt getSupplies(@Nonnull GEOResource resource, @Nonnull World world, int x, int z) This method returns the amount of a certainGEOResource
found in a givenChunk
. The result is anOptionalInt
which will be empty if thisGEOResource
has not been generated at thatLocation
yet.- Parameters:
resource
- TheGEOResource
to queryworld
- TheWorld
of thisLocation
x
- TheChunk
x coordinatez
- TheChunk
z coordinate- Returns:
- An
OptionalInt
, either empty or containing the amount of the givenGEOResource
-
setSupplies
public void setSupplies(@Nonnull GEOResource resource, @Nonnull World world, int x, int z, int value) This method will set the supplies in a givenChunk
to the specified value.- Parameters:
resource
- TheGEOResource
world
- TheWorld
x
- The x coordinate of thatChunk
z
- The z coordinate of thatChunk
value
- The new supply value
-
scan
-