Skip to content

Commit 9c803fd

Browse files
committed
v0.15.1.0 - Add some missing docs
- Add docs for ColorMap#getWithBiome - Add docs for ColorMap.Builder#biome - Add docs for StormType Took 23 minutes
1 parent 4151ffc commit 9c803fd

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

src/main/java/net/nullved/pmweatherapi/util/ColorMap.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,16 @@ public Color get(float val) {
9393
return lookup[idx];
9494
}
9595

96+
/**
97+
* Retrieves the color value using a color derived from the biome
98+
* @param val The value to get a color for
99+
* @param biome The biome to derive the starting color from
100+
* @param worldPos The world position (for grass color checks)
101+
* @return The approximate color for this value
102+
* @since 0.15.0.0
103+
*/
96104
public Color getWithBiome(float val, Holder<Biome> biome, Vec3 worldPos) {
97-
Color startColor = Color.BLACK;
105+
Color startColor;
98106
String rn = biome.getRegisteredName().toLowerCase();
99107
if (rn.contains("ocean") || rn.contains("river")) startColor = new Color(biome.value().getWaterColor());
100108
else if (rn.contains("beach") || rn.contains("desert")) {
@@ -191,7 +199,8 @@ public static Builder of(Color base) {
191199
}
192200

193201
/**
194-
* Creates a new {@link ColorMap.Builder} that has a default {@link Color#BLACK} base
202+
* Creates a new {@link ColorMap.Builder} that has a default {@link Color#BLACK} base.
203+
* This method has no effect unless you use {@link ColorMap#getWithBiome(float, Holder, Vec3)}
195204
* @return The created {@link ColorMap.Builder}
196205
* @since 0.15.0.0
197206
*/

src/main/java/net/nullved/pmweatherapi/util/StormType.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
import dev.protomanly.pmweather.weather.Storm;
44

5+
/**
6+
* An enum holding different storm types
7+
* @since 0.15.0.0
8+
*/
59
public enum StormType {
610
SUPERCELL(0),
711
TORNADO(0, 3),
@@ -20,14 +24,31 @@ public enum StormType {
2024
this.stage = -1;
2125
}
2226

27+
/**
28+
* Gets the index of the {@link StormType}
29+
* @return The {@link StormType} index
30+
* @since 0.15.0.0
31+
*/
2332
public int idx() {
2433
return idx;
2534
}
2635

36+
/**
37+
* Gets the minimum stage of the {@link StormType}
38+
* @return The minimum stage of the {@link StormType}
39+
* @since 0.15.0.0
40+
*/
2741
public int stage() {
2842
return stage;
2943
}
3044

45+
/**
46+
* Determines if the {@link Storm} meets this {@link StormType}'s specification.
47+
* If this {@link StormType} defines a `stage` (such as {@link StormType#TORNADO}), the {@link Storm} must be equal to or above that stage
48+
* @param storm The {@link Storm} to check
49+
* @return {@code true} if this {@link Storm} meets the {@link StormType} specification
50+
* @since 0.15.0.0
51+
*/
3152
public boolean matches(Storm storm) {
3253
return storm.stormType == idx && storm.stage >= stage;
3354
}

0 commit comments

Comments
 (0)