Fixed graveyard world generation

This commit is contained in:
David Berdik 2019-07-06 22:48:29 -04:00
parent 3b36b74284
commit c7417a37e3
3 changed files with 612 additions and 1217 deletions

View File

@ -10,16 +10,16 @@ import org.bukkit.Material;
public class GraveyardWorld {
public static void create() {
/*final Location loc = new Location(Bukkit.getServer().getWorld(Herobrine.getPluginCore().getConfigDB().HerobrineWorldName), 0.0, 3.0, 0.0);
final Location loc = new Location(Bukkit.getServer().getWorld(Herobrine.getPluginCore().getConfigDB().HerobrineWorldName), 0.0, 3.0, 0.0);
for (int x = -50; x <= 50; ++x) {
for (int z = -50; z <= 50; ++z) {
loc.getWorld().getBlockAt(x, 3, z).setType(Material.matchMaterial("MYCEL"));
loc.getWorld().getBlockAt(x, 3, z).setType(Material.MYCELIUM);
}
}
final int MainX = -10;
final int MainY = 3;
final int MainZ = -10;
new StructureLoader(Herobrine.getPluginCore().getInputStreamData("/res/graveyard_world.yml")).Build(loc.getWorld(), MainX, MainY, MainZ);*/
new StructureLoader(Herobrine.getPluginCore().getInputStreamData("/res/graveyard_world.yml")).Build(loc.getWorld(), MainX, MainY, MainZ);
}
}

View File

@ -6,6 +6,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
@ -43,8 +44,8 @@ public class StructureLoader {
length = file.getInt("DATA.LENGTH") - 1;
current = 0;
while (current <= length) {
/*world.getBlockAt(MainX + file.getInt("DATA." + current + ".X"), MainY + file.getInt("DATA." + current + ".Y"), MainZ + file.getInt("DATA." + current + ".Z"))
.setTypeIdAndData(file.getInt("DATA." + current + ".ID"), (byte) file.getInt("DATA." + current + ".DATA"), false);*/
world.getBlockAt(MainX + file.getInt("DATA." + current + ".X"), MainY + file.getInt("DATA." + current + ".Y"), MainZ + file.getInt("DATA." + current + ".Z"))
.setType(Material.valueOf(file.getString("DATA." + current + ".MATERIAL")));
++current;
}
}

File diff suppressed because it is too large Load Diff