Make fields final

This commit is contained in:
tastybento 2021-07-31 11:05:40 -07:00
parent 2fe7df2824
commit 2c6c59e4aa
3 changed files with 9 additions and 10 deletions

View File

@ -49,7 +49,7 @@ public class Boxed extends GameModeAddon {
// Settings
private Settings settings;
private ChunkGenerator chunkGenerator;
private Config<Settings> configObject = new Config<>(this, Settings.class);
private final Config<Settings> configObject = new Config<>(this, Settings.class);
private AdvancementsManager advManager;
private DeleteGen delChunks;
private ChunkGenerator netherChunkGenerator;
@ -103,10 +103,10 @@ public class Boxed extends GameModeAddon {
return;
}
// Check for recommended addons
if (!this.getPlugin().getAddonsManager().getAddonByName("Border").isPresent()) {
if (this.getPlugin().getAddonsManager().getAddonByName("Border").isEmpty()) {
this.logWarning("Boxed normally requires the Border addon.");
}
if (!this.getPlugin().getAddonsManager().getAddonByName("InvSwitcher").isPresent()) {
if (this.getPlugin().getAddonsManager().getAddonByName("InvSwitcher").isEmpty()) {
this.logWarning("Boxed normally requires the InvSwitcher addon for per-world Advancements.");
}
// Advancements manager

View File

@ -15,7 +15,7 @@ public class BoxedChunkGenerator {
private final WorldRef wordRef;
private final Boxed addon;
private WorldRef wordRefNether;
private final WorldRef wordRefNether;
public BoxedChunkGenerator(Boxed addon) {
this.addon = addon;

View File

@ -27,7 +27,6 @@ public class NetherGenerator implements BaseNoiseGenerator {
private final BiomeNoise defaultNoise = new BiomeNoise(10D, 0D, 2D);
private final NoiseGenerator mainNoiseGenerator;
private final Boxed addon;
private final YamlConfiguration config;
private final Map<Biome, BiomeNoise> biomeNoiseMap;
@ -40,7 +39,7 @@ public class NetherGenerator implements BaseNoiseGenerator {
if (!biomeFile.exists()) {
addon.saveResource("biomes.yml", true);
}
config = YamlConfiguration.loadConfiguration(biomeFile);
YamlConfiguration config = YamlConfiguration.loadConfiguration(biomeFile);
biomeNoiseMap = new EnumMap<>(Biome.class);
if (config.isConfigurationSection(NETHER_BIOMES)) {
for (String key : config.getConfigurationSection(NETHER_BIOMES).getKeys(false)) {
@ -53,14 +52,14 @@ public class NetherGenerator implements BaseNoiseGenerator {
}
}
class BiomeNoise {
static class BiomeNoise {
double noiseScaleHorizontal = 10D;
double height = 0D;
double noiseScaleVertical = 2D;
/**
* @param noiseScaleHorizontal
* @param height
* @param noiseScaleVertical
* @param noiseScaleHorizontal horizontal noise scale
* @param height height
* @param noiseScaleVertical vertical noise scale
*/
public BiomeNoise(double noiseScaleHorizontal, double height, double noiseScaleVertical) {
this.noiseScaleHorizontal = noiseScaleHorizontal;