Skip to content

Commit

Permalink
Make fields final
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jul 31, 2021
1 parent 2fe7df2 commit 2c6c59e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/main/java/world/bentobox/boxed/Boxed.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -103,10 +103,10 @@ public void onEnable(){
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand All @@ -40,7 +39,7 @@ public NetherGenerator(Boxed addon, long seed) {
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)) {
Expand All @@ -53,14 +52,14 @@ public NetherGenerator(Boxed addon, long seed) {
}
}

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;
Expand Down

0 comments on commit 2c6c59e

Please sign in to comment.