Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. package com.ziinzo.alienwars.world.dimensions;
  2.  
  3. import java.util.Random;
  4.  
  5. import com.ziinzo.alienwars.world.ModWorldGen;
  6.  
  7. import net.minecraft.client.Minecraft;
  8. import net.minecraft.client.gui.GuiCreateWorld;
  9. import net.minecraft.world.World;
  10. import net.minecraft.world.WorldServer;
  11. import net.minecraft.world.WorldType;
  12. import net.minecraft.world.biome.BiomeProvider;
  13. import net.minecraft.world.gen.IChunkGenerator;
  14. import net.minecraftforge.fml.relauncher.Side;
  15. import net.minecraftforge.fml.relauncher.SideOnly;
  16.  
  17. public class DemangusWorldType extends WorldType
  18. {
  19. public DemangusWorldType()
  20. {
  21. super(ModWorldGen.DEMANGUS_NAME);
  22.  
  23.  
  24. // DEBUG
  25. System.out.println("Constructing WorldTypeDemangus");
  26. }
  27.  
  28. /* (non-Javadoc)
  29. * @see net.minecraft.world.WorldType#getBiomeProvider(net.minecraft.world.World)
  30. */
  31. @Override
  32. public BiomeProvider getBiomeProvider(World world)
  33. {
  34. return new BiomeProviderDemangus();
  35. }
  36.  
  37. /* (non-Javadoc)
  38. * @see net.minecraft.world.WorldType#getChunkGenerator(net.minecraft.world.World, java.lang.String)
  39. */
  40. @Override
  41. public IChunkGenerator getChunkGenerator(World world, String generatorOptions)
  42. {
  43. return new ChunkGeneratorDemangus(world);
  44. }
  45.  
  46. /* (non-Javadoc)
  47. * @see net.minecraft.world.WorldType#getMinimumSpawnHeight(net.minecraft.world.World)
  48. */
  49. @Override
  50. public int getMinimumSpawnHeight(World world)
  51. {
  52. return world.getSeaLevel() + 1;
  53. }
  54.  
  55. /* (non-Javadoc)
  56. * @see net.minecraft.world.WorldType#getHorizon(net.minecraft.world.World)
  57. */
  58. @Override
  59. public double getHorizon(World world)
  60. {
  61. return 63.0D;
  62. }
  63.  
  64. /* (non-Javadoc)
  65. * @see net.minecraft.world.WorldType#voidFadeMagnitude()
  66. */
  67. @Override
  68. public double voidFadeMagnitude()
  69. {
  70. return 0.03125D;
  71. }
  72.  
  73. /* (non-Javadoc)
  74. * @see net.minecraft.world.WorldType#handleSlimeSpawnReduction(java.util.Random, net.minecraft.world.World)
  75. */
  76. @Override
  77. public boolean handleSlimeSpawnReduction(Random random, World world)
  78. {
  79. return false;
  80. }
  81.  
  82. /**
  83. * Called when 'Create New World' button is pressed before starting game.
  84. */
  85. @Override
  86. public void onGUICreateWorldPress() { }
  87.  
  88. /**
  89. * Gets the spawn fuzz for players who join the world.
  90. * Useful for void world types.
  91. *
  92. * @param world the world
  93. * @param server the server
  94. * @return Fuzz for entity initial spawn in blocks.
  95. */
  96. @Override
  97. public int getSpawnFuzz(WorldServer world, net.minecraft.server.MinecraftServer server)
  98. {
  99. return Math.max(0, server.getSpawnRadius(world));
  100. }
  101.  
  102. /**
  103. * Called when the 'Customize' button is pressed on world creation GUI.
  104. *
  105. * @param mc The Minecraft instance
  106. * @param guiCreateWorld the createworld GUI
  107. */
  108. @Override
  109. @SideOnly(Side.CLIENT)
  110. public void onCustomizeButton(Minecraft mc, GuiCreateWorld guiCreateWorld)
  111. {
  112. }
  113.  
  114. /**
  115. * Should world creation GUI show 'Customize' button for this world type?.
  116. *
  117. * @return if this world type has customization parameters
  118. */
  119. @Override
  120. public boolean isCustomizable()
  121. {
  122. return false;
  123. }
  124.  
  125. /**
  126. * returns true if selecting this worldtype from the customize menu should display the generator.[worldtype].info
  127. * message
  128. *
  129. * @return true, if successful
  130. */
  131. @Override
  132. @SideOnly(Side.CLIENT)
  133. public boolean hasInfoNotice()
  134. {
  135. return true;
  136. }
  137.  
  138. /**
  139. * Get the height to render the clouds for this world type.
  140. *
  141. * @return The height to render clouds at
  142. */
  143. @Override
  144. public float getCloudHeight()
  145. {
  146. return 128.0F;
  147. }
  148. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement