-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
WorldInfo.java
41 lines (34 loc) · 1.14 KB
/
WorldInfo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.bgsoftware.superiorskyblock.api.world;
import com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI;
import com.google.common.base.Preconditions;
import org.bukkit.World;
public interface WorldInfo {
/**
* Get the name of this world.
*/
String getName();
/**
* Get the environment of this world.
*/
World.Environment getEnvironment();
/**
* Create a new world info.
*
* @param world The world.
*/
static WorldInfo of(World world) {
Preconditions.checkNotNull(world, "world parameter cannot be null");
return of(world.getName(), world.getEnvironment());
}
/**
* Create a new world info.
*
* @param worldName The name of the world.
* @param environment The environment of the world.
*/
static WorldInfo of(String worldName, World.Environment environment) {
Preconditions.checkNotNull(worldName, "worldName parameter cannot be null");
Preconditions.checkNotNull(environment, "environment parameter cannot be null");
return SuperiorSkyblockAPI.getFactory().createWorldInfo(worldName, environment);
}
}