mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Apply suggestions from code review
Co-authored-by: svr333 <vanrompaey.senne@protonmail.com>
This commit is contained in:
parent
796193207e
commit
50310fd2ce
@ -7,7 +7,7 @@ import org.bukkit.NamespacedKey;
|
|||||||
import io.github.thebusybiscuit.slimefun4.utils.biomes.BiomeMap;
|
import io.github.thebusybiscuit.slimefun4.utils.biomes.BiomeMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link BiomeMapException} is thrown whenever a {@link BiomeMap}
|
* A {@link BiomeMapException} is thrown whenever a {@link BiomeMap}
|
||||||
* contains illegal, invalid or unknown values.
|
* contains illegal, invalid or unknown values.
|
||||||
*
|
*
|
||||||
* @author TheBusyBiscuit
|
* @author TheBusyBiscuit
|
||||||
@ -44,5 +44,4 @@ public class BiomeMapException extends Exception {
|
|||||||
public BiomeMapException(NamespacedKey key, Throwable cause) {
|
public BiomeMapException(NamespacedKey key, Throwable cause) {
|
||||||
super("Biome Map '" + key + "' has been misconfigured (" + cause.getMessage() + ')', cause);
|
super("Biome Map '" + key + "' has been misconfigured (" + cause.getMessage() + ')', cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,8 @@ abstract class AbstractResource implements GEOResource {
|
|||||||
*/
|
*/
|
||||||
@ParametersAreNonnullByDefault
|
@ParametersAreNonnullByDefault
|
||||||
static final @Nonnull BiomeMap<Integer> getBiomeMap(AbstractResource resource, String path) {
|
static final @Nonnull BiomeMap<Integer> getBiomeMap(AbstractResource resource, String path) {
|
||||||
Validate.notNull(resource, "Resource cannot be null");
|
Validate.notNull(resource, "Resource cannot be null.");
|
||||||
Validate.notNull(path, "Path cannot be null");
|
Validate.notNull(path, "Path cannot be null.");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return BiomeMap.fromResource(resource.getKey(), path, JsonElement::getAsInt);
|
return BiomeMap.fromResource(resource.getKey(), path, JsonElement::getAsInt);
|
||||||
@ -105,5 +105,4 @@ abstract class AbstractResource implements GEOResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
|||||||
* <p>
|
* <p>
|
||||||
* We heavily utilise this method of data mapping for {@link GEOResource}s, especially
|
* We heavily utilise this method of data mapping for {@link GEOResource}s, especially
|
||||||
* when supporting multiple versions of Minecraft. This way, we can have different {@link BiomeMap}s
|
* when supporting multiple versions of Minecraft. This way, we can have different {@link BiomeMap}s
|
||||||
* for different versions of Minecraft, incase {@link Biome} names change inbetween versions.
|
* for different versions of Minecraft, in case {@link Biome} names change in-between versions.
|
||||||
* <p>
|
* <p>
|
||||||
* The data type can be any type of {@link Object}.
|
* The data type can be any type of {@link Object}.
|
||||||
* The most common type is {@link Integer}, if you are using complex objects and try to read
|
* The most common type is {@link Integer}, if you are using complex objects and try to read
|
||||||
|
Loading…
Reference in New Issue
Block a user