Use vanilla height profiles for existing planet ores
Some checks failed
Planet Ore Profiles Build / planet-ore-profiles (push) Successful in 42s
DuneRealms Resourcepack CI / resourcepack (push) Failing after 11s
DuneRealms Plugin CI / plugins (push) Successful in 2m59s

This commit is contained in:
unimatrixgit 2026-12-02 07:08:09 +01:00
commit b54c277568

View file

@ -633,34 +633,8 @@ public final class DuneTerrain extends JavaPlugin implements Listener {
}
}
}
// Arrakis now permits only its explicitly configured coal and emerald deposits.
org.bukkit.configuration.ConfigurationSection ores = plugin.getConfig().getConfigurationSection(path + "ores");
if (ores == null) return;
int minY = Math.max(minWorldY + 1, plugin.getConfig().getInt(path + "ores.min-y", -48));
int maxY = Math.min(maxWorldY - 4, plugin.getConfig().getInt(path + "ores.max-y", 48));
int veinSize = Math.max(1, Math.min(16, plugin.getConfig().getInt(path + "ores.vein-size", 5)));
if (maxY < minY) return;
for (String key : ores.getKeys(false)) {
Material ore = Material.matchMaterial(key);
if (ore == null || (!key.endsWith("_ORE") && !(planet.equals("giedi_prime") && ore == Material.ANCIENT_DEBRIS))) continue;
if(planet.equals("arrakis")&&ore!=Material.COAL_ORE&&ore!=Material.EMERALD_ORE)continue;
int attempts = Math.max(0, Math.min(64, ores.getInt(key, 0)));
int effectiveVeinSize = ore == Material.ANCIENT_DEBRIS
? Math.max(1, Math.min(16, plugin.getConfig().getInt(path + "ancient-debris.vein-size", 5))) : veinSize;
int oreMinY = ore == Material.ANCIENT_DEBRIS ? Math.max(minWorldY + 1, plugin.getConfig().getInt(path + "ancient-debris.min-y", -59)) : minY;
int oreMaxY = ore == Material.ANCIENT_DEBRIS ? Math.min(maxWorldY - 4, plugin.getConfig().getInt(path + "ancient-debris.max-y", 16)) : maxY;
if (oreMaxY < oreMinY) continue;
for (int attempt = 0; attempt < attempts; attempt++) {
int x = random.nextInt(16), z = random.nextInt(16), y = oreMinY + random.nextInt(oreMaxY - oreMinY + 1);
for (int n = 0; n < effectiveVeinSize; n++) {
int vx = Math.max(0, Math.min(15, x + random.nextInt(3) - 1));
int vz = Math.max(0, Math.min(15, z + random.nextInt(3) - 1));
int vy = Math.max(oreMinY, Math.min(oreMaxY, y + random.nextInt(3) - 1));
Material existing = data.getType(vx, vy, vz);
if (existing == Material.STONE || existing == Material.DEEPSLATE || existing == Material.TUFF) data.setBlock(vx, vy, vz, ore);
}
}
}
OreHeights.place(plugin.getConfig().getConfigurationSection(path + "ores"),
data, random, path, planet, minWorldY, maxWorldY);
}
private void placeJungleTree(ChunkData data, int x, int y, int z, Random random, int maxY) {
int height = 4 + random.nextInt(4);