Multiple generator fixes.

This commit is contained in:
Brianna O'Keefe 2019-02-01 14:42:26 -05:00
parent 504f0ff57f
commit 63441f1d6c
4 changed files with 712 additions and 759 deletions

View File

@ -47,7 +47,7 @@ public class GeneratorManager {
Materials materials = Materials.fromString(materialList); Materials materials = Materials.fromString(materialList);
if (materials != null) { if (materials != null) {
generatorMaterials.add(new GeneratorMaterial(materials, configLoad.getInt( generatorMaterials.add(new GeneratorMaterial(materials, configLoad.getDouble(
"Generators." + generatorList + ".Materials." + materialList + ".Chance"))); "Generators." + generatorList + ".Materials." + materialList + ".Chance")));
} }
} }

View File

@ -7,7 +7,7 @@ public class GeneratorMaterial {
private Materials materials; private Materials materials;
private double chance; private double chance;
public GeneratorMaterial(Materials materials, int chance) { public GeneratorMaterial(Materials materials, double chance) {
this.materials = materials; this.materials = materials;
this.chance = chance; this.chance = chance;
} }

View File

@ -312,6 +312,10 @@ public class Block implements Listener {
return; return;
} }
Material material = event.getBlock().getType();
if (material != Material.WATER && material != Material.LAVA) return;
if (generatorManager != null && generatorManager.getGenerators().size() > 0) { if (generatorManager != null && generatorManager.getGenerators().size() > 0) {
Island island = islandManager.getIslandAtLocation(event.getBlock().getLocation()); Island island = islandManager.getIslandAtLocation(event.getBlock().getLocation());
IslandWorld world = worldManager.getIslandWorld(event.getBlock().getWorld()); IslandWorld world = worldManager.getIslandWorld(event.getBlock().getWorld());