Advertisement
RageCoreBin

Untitled

Jul 20th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. private Overworld plugin;
  2.  
  3. public OverworldGenerator(Overworld instance) {
  4. this.plugin = instance;
  5. }
  6.  
  7. private int coordsToInt(int x, int y, int z) {
  8. return (x*16+z) * 128 + y;
  9. }
  10.  
  11. public List<BlockPopulator> getDefaultPopulators(World world) {
  12. return new ArrayList<>();
  13. }
  14.  
  15. public Location getFixedSpawnLocation(World world, Random random) {
  16. return new Location(world, 0.5, 27, 0.5);
  17. }
  18.  
  19. public byte[] generate(World world, Random rand, int chunkX, int chunkZ) {
  20. byte[] blocks = new byte[32768];
  21. int x, y, z;
  22.  
  23. for (x = 0; x < 16; ++x) {
  24. for (z = 0; z < 16; ++z) {
  25. blocks[this.coordsToInt(x, 0, z)] = (byte) Material.BEDROCK.getId();
  26. }
  27. }
  28.  
  29. for (y=1; y < 26; ++y) {
  30. for (x = 0; x < 16; ++x) {
  31. for (z = 0; z < 16; ++z) {
  32. blocks[this.coordsToInt(x, y, z)] = (byte) Material.STAINED_CLAY.getId();
  33. }
  34. }
  35. }
  36.  
  37. return blocks;
  38.  
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement