/
BiomeNMS.java
68 lines (48 loc) · 1.7 KB
/
BiomeNMS.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package net.aufdemrand.denizen.nms.abstracts;
import org.bukkit.Location;
import org.bukkit.block.Biome;
import org.bukkit.entity.EntityType;
import java.util.ArrayList;
import java.util.List;
public abstract class BiomeNMS {
private final String name;
public BiomeNMS(Biome biome) {
this.name = biome.name();
}
public DownfallType getDownfallType() {
if (getDoesSnow()) {
return DownfallType.SNOW;
}
else if (getDoesRain()) {
return DownfallType.RAIN;
}
else {
return DownfallType.NONE;
}
}
public String getName() {
return name;
}
public abstract float getHumidity();
public abstract float getTemperature();
public List<EntityType> getAllEntities() {
List<EntityType> entityTypes = new ArrayList<>();
entityTypes.addAll(getAmbientEntities());
entityTypes.addAll(getCreatureEntities());
entityTypes.addAll(getMonsterEntities());
entityTypes.addAll(getWaterEntities());
return entityTypes;
}
public abstract List<EntityType> getAmbientEntities();
public abstract List<EntityType> getCreatureEntities();
public abstract List<EntityType> getMonsterEntities();
public abstract List<EntityType> getWaterEntities();
public abstract void setHumidity(float humidity);
public abstract void setTemperature(float temperature);
public abstract void changeBlockBiome(Location location);
public enum DownfallType {
RAIN, SNOW, NONE
}
protected abstract boolean getDoesRain();
protected abstract boolean getDoesSnow();
}