mirror of
https://github.com/BentoBoxWorld/Boxed.git
synced 2024-12-04 13:33:35 +01:00
Code cleanup.
This commit is contained in:
parent
816e1e86be
commit
9c714e10ba
@ -67,7 +67,7 @@ public class AdvancementsManager {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
protected IslandAdvancements getIsland(Island island) {
|
protected IslandAdvancements getIsland(Island island) {
|
||||||
return cache.computeIfAbsent(island.getUniqueId(), k -> getFromDb(k));
|
return cache.computeIfAbsent(island.getUniqueId(), this::getFromDb);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public class Boxed extends GameModeAddon {
|
|||||||
.getInstance(getPlugin(), 0, 5)
|
.getInstance(getPlugin(), 0, 5)
|
||||||
.createCustomGenerator(wordRef, generator -> {
|
.createCustomGenerator(wordRef, generator -> {
|
||||||
// Set the noise generator
|
// Set the noise generator
|
||||||
generator.setBaseNoiseGenerator(new BasicWorldGenerator(this, wordRef, getSettings().getSeed()));
|
generator.setBaseNoiseGenerator(new BasicWorldGenerator(this, getSettings().getSeed()));
|
||||||
if (getSettings().isAllowStructures()) {
|
if (getSettings().isAllowStructures()) {
|
||||||
generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.SURFACE_STRUCTURES);
|
generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.SURFACE_STRUCTURES);
|
||||||
}
|
}
|
||||||
@ -74,15 +74,8 @@ public class Boxed extends GameModeAddon {
|
|||||||
generator.setBiomeGenerator(new BoxedBiomeGenerator(this));
|
generator.setBiomeGenerator(new BoxedBiomeGenerator(this));
|
||||||
});
|
});
|
||||||
// Register commands
|
// Register commands
|
||||||
playerCommand = new DefaultPlayerCommand(this)
|
playerCommand = new DefaultPlayerCommand(this) {};
|
||||||
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void setup()
|
|
||||||
{
|
|
||||||
super.setup();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
adminCommand = new DefaultAdminCommand(this) {};
|
adminCommand = new DefaultAdminCommand(this) {};
|
||||||
|
|
||||||
// Register listeners
|
// Register listeners
|
||||||
@ -104,8 +97,6 @@ public class Boxed extends GameModeAddon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable(){
|
public void onEnable(){
|
||||||
// Register this
|
|
||||||
//registerListener(new JoinListener(this));
|
|
||||||
// Advancements manager
|
// Advancements manager
|
||||||
advManager = new AdvancementsManager(this);
|
advManager = new AdvancementsManager(this);
|
||||||
// Get delete chunk generator
|
// Get delete chunk generator
|
||||||
@ -180,6 +171,13 @@ public class Boxed extends GameModeAddon {
|
|||||||
}
|
}
|
||||||
// Set spawn rates
|
// Set spawn rates
|
||||||
if (w != null) {
|
if (w != null) {
|
||||||
|
setSpawnRates(w);
|
||||||
|
}
|
||||||
|
return w;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setSpawnRates(World w) {
|
||||||
if (getSettings().getSpawnLimitMonsters() > 0) {
|
if (getSettings().getSpawnLimitMonsters() > 0) {
|
||||||
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
|
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
|
||||||
}
|
}
|
||||||
@ -199,9 +197,6 @@ public class Boxed extends GameModeAddon {
|
|||||||
w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns());
|
w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return w;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldSettings getWorldSettings() {
|
public WorldSettings getWorldSettings() {
|
||||||
|
@ -1615,10 +1615,6 @@ public class Settings implements WorldSettings {
|
|||||||
this.defaultEndBiome = defaultEndBiome;
|
this.defaultEndBiome = defaultEndBiome;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getNoiseScaleHorizontal() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the seed
|
* @return the seed
|
||||||
*/
|
*/
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.util.noise.SimplexNoiseGenerator;
|
|||||||
|
|
||||||
import nl.rutgerkok.worldgeneratorapi.BaseNoiseGenerator;
|
import nl.rutgerkok.worldgeneratorapi.BaseNoiseGenerator;
|
||||||
import nl.rutgerkok.worldgeneratorapi.BiomeGenerator;
|
import nl.rutgerkok.worldgeneratorapi.BiomeGenerator;
|
||||||
import nl.rutgerkok.worldgeneratorapi.WorldRef;
|
|
||||||
import world.bentobox.boxed.Boxed;
|
import world.bentobox.boxed.Boxed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,7 +21,7 @@ public class BasicWorldGenerator implements BaseNoiseGenerator {
|
|||||||
private final YamlConfiguration config;
|
private final YamlConfiguration config;
|
||||||
|
|
||||||
|
|
||||||
public BasicWorldGenerator(Boxed addon, WorldRef world, long seed) {
|
public BasicWorldGenerator(Boxed addon, long seed) {
|
||||||
this.addon = addon;
|
this.addon = addon;
|
||||||
// Initialize the noise generator based on the world seed
|
// Initialize the noise generator based on the world seed
|
||||||
this.mainNoiseGenerator = new SimplexNoiseGenerator(seed);
|
this.mainNoiseGenerator = new SimplexNoiseGenerator(seed);
|
||||||
|
@ -24,8 +24,6 @@ public class DeleteGen extends ChunkGenerator {
|
|||||||
public DeleteGen(Boxed addon) {
|
public DeleteGen(Boxed addon) {
|
||||||
backMap = new HashMap<>();
|
backMap = new HashMap<>();
|
||||||
backMap.put(addon.getOverWorld(), Bukkit.getWorld(addon.getOverWorld().getName() + "_bak"));
|
backMap.put(addon.getOverWorld(), Bukkit.getWorld(addon.getOverWorld().getName() + "_bak"));
|
||||||
//backMap.put(addon.getNetherWorld(), Bukkit.getWorld(addon.getNetherWorld().getName() + "_bak"));
|
|
||||||
//backMap.put(addon.getEndWorld(), Bukkit.getWorld(addon.getEndWorld().getName() + "_bak"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user