Posted May 19, 201411 yr I want to remove the clouds and change the sky colour of the Overworld. Do I do this using generateSurface() function? Or some other method?
May 19, 201411 yr In WorldProvider class, there is getSkyColor method. You can use it. For the cloud, one solution is editing your own cloudrenderer and sets the cloudrenderer of the WorldProvider with your own. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
May 19, 201411 yr When you change the skycolor, don't forge to change fogcolor too, or wierd shifts happen. On the cloudrender, I posted an example you can look at a week ago or so. I only had one issue, I couldn't figure out how to keep the clouds for brightening as if a light was shining on them. It was wierd. Long time Bukkit & Forge Programmer Happy to try and help
May 20, 201411 yr Author I've made an event manager (using a Wuppy tutorial for the base ), and am now figuring how to use the getSkyColor method. I suppose I put it in the generateSurface() method that I've created: package tutorial.generic; import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import cpw.mods.fml.common.IWorldGenerator; public class EventManager implements IWorldGenerator{ public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.dimensionId) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); } } private void generateEnd(World world, Random random, int x, int z) { } private void generateSurface(World world, Random random, int x, int z) { } private void generateNether(World world, Random random, int x, int z) { } }
May 20, 201411 yr Actually, I believe that code is hard-coded into WorldProvider. You can "maybe" use events to extract that and use it for your own use. Otherwise, you might think about using ASM.
May 20, 201411 yr There is a setcouldrender method Forge created in worldprovider. Just set your client after a few seconds to your custom cloudrender with the method. No need for anything fancy. Long time Bukkit & Forge Programmer Happy to try and help
May 26, 201411 yr Author This is doing my head in! I've made an ITWorldProvider that extends WorldProvider: package tutorial.generic.world; import net.minecraft.util.Vec3; import net.minecraft.world.WorldProvider; import com.sun.xml.internal.stream.Entity; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public abstract class ITWorldProvider extends WorldProvider { @Override @SideOnly(Side.CLIENT) public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) { System.out.println("getSkyColor was called."); return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0); } } But Eclipse puts a redline under "getSkyColor" and give me an error: The method getSkyColor(Entity, float) of the type ITWorldProvider must override or implement a supertype method. I copied the gist of this code from some Galacticraft code. Any ideas what I'm doing wrong?
May 26, 201411 yr See the code in the WorldProvider class. Find the getSkyColor method, and see what is wrong. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
May 27, 201411 yr Author Solved it. noob error. When I used the Eclipse auto-import-packages-keystroke-thing, it put in import com.sun.xml.internal.stream.Entity; rather than import net.minecraft.entity.Entity; New code: package tutorial.generic.world; import net.minecraft.entity.Entity; import net.minecraft.util.Vec3; import net.minecraft.world.WorldProvider; import net.minecraftforge.client.IRenderHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public abstract class ITWorldProvider extends WorldProvider { // @SideOnly(Side.CLIENT) @Override public Vec3 getFogColor(float var1, float var2) { System.out.println("getFogColor called"); return this.worldObj.getWorldVec3Pool().getVecFromPool((double) 0F / 255F, (double) 0F / 255F, (double) 0F / 255F); } @Override // @SideOnly(Side.CLIENT) public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) { System.out.println("getSkyColor called"); return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0); } @Override public void setCloudRenderer(IRenderHandler renderer) { System.out.println("setCloudRenderer called"); } } New question: how do I get my WorldProvider used on the Overworld?
May 27, 201411 yr Maybe changing DimensionManager.gerWorld(0).provider on World Load Event would work.. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.