Require precipitation for Sigma soil snowfall
This commit is contained in:
parent
d7bcd912ac
commit
c11f0031fc
1 changed files with 99 additions and 1 deletions
|
|
@ -31,10 +31,14 @@ public final class PlanetSoil {
|
|||
return false;
|
||||
}
|
||||
static Material target(String planet){return switch(planet){case "arrakis"->Material.SAND;case "giedi_prime"->Material.COARSE_DIRT;case "sigma_draconis_iv"->Material.GRASS_BLOCK;default->null;};}
|
||||
static boolean weatheringActive(World world){
|
||||
String name=world.getName();
|
||||
return PLANETS.contains(name)&&(!name.equals("sigma_draconis_iv")||world.hasStorm());
|
||||
}
|
||||
private void tick(){
|
||||
int current=round++;
|
||||
for(World world:Bukkit.getWorlds()){
|
||||
if(!PLANETS.contains(world.getName()))continue;
|
||||
if(!weatheringActive(world))continue;
|
||||
Chunk[] chunks=world.getLoadedChunks();if(chunks.length==0)continue;
|
||||
for(int i=0;i<Math.min(8,chunks.length);i++){
|
||||
Chunk chunk=chunks[Math.floorMod(current*8+i,chunks.length)];
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff