Adds a SkyProvider class that can handle the rendering of the sky
This commit is contained in:
parent
7f40671ad8
commit
59c77d7ca4
3 changed files with 66 additions and 7 deletions
12
client/net/minecraftforge/client/SkyProvider.java
Normal file
12
client/net/minecraftforge/client/SkyProvider.java
Normal file
|
@ -0,0 +1,12 @@
|
|||
package net.minecraftforge.client;
|
||||
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.WorldClient;
|
||||
|
||||
public abstract class SkyProvider
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract void render(float partialTicks, WorldClient world, Minecraft mc);
|
||||
}
|
|
@ -1,13 +1,23 @@
|
|||
--- ../src_base/common/net/minecraft/src/WorldProvider.java
|
||||
+++ ../src_work/common/net/minecraft/src/WorldProvider.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import net.minecraftforge.client.SkyProvider;
|
||||
+import net.minecraftforge.common.DimensionManager;
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
|
||||
@@ -185,7 +186,7 @@
|
||||
@@ -30,6 +32,8 @@
|
||||
|
||||
/** Array for sunrise/sunset colors (RGBA) */
|
||||
private float[] colorsSunriseSunset = new float[4];
|
||||
+
|
||||
+ private SkyProvider skyProvider = null;
|
||||
|
||||
/**
|
||||
* associate an existing world with a World provider, and setup its lightbrightness table
|
||||
@@ -185,7 +189,7 @@
|
||||
|
||||
public static WorldProvider getProviderForDimension(int par0)
|
||||
{
|
||||
|
@ -16,7 +26,7 @@
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -251,4 +252,79 @@
|
||||
@@ -251,4 +255,92 @@
|
||||
}
|
||||
|
||||
public abstract String func_80007_l();
|
||||
|
@ -95,4 +105,17 @@
|
|||
+ }
|
||||
+ return 1.0;
|
||||
+ }
|
||||
+
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
+ public SkyProvider getSkyProvider()
|
||||
+ {
|
||||
+ return this.skyProvider;
|
||||
+ }
|
||||
+
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
+ public void setSkyProvider(SkyProvider skyProvider)
|
||||
+ {
|
||||
+ this.skyProvider = skyProvider;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
|
|
@ -1,6 +1,30 @@
|
|||
--- ../src_base/minecraft/net/minecraft/src/RenderGlobal.java
|
||||
+++ ../src_work/minecraft/net/minecraft/src/RenderGlobal.java
|
||||
@@ -1787,6 +1787,7 @@
|
||||
@@ -9,7 +9,10 @@
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
+
|
||||
import net.minecraft.client.Minecraft;
|
||||
+import net.minecraftforge.client.SkyProvider;
|
||||
+
|
||||
import org.lwjgl.opengl.ARBOcclusionQuery;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -867,6 +870,12 @@
|
||||
*/
|
||||
public void renderSky(float par1)
|
||||
{
|
||||
+ SkyProvider skyProvider = null;
|
||||
+ if ((skyProvider = this.mc.theWorld.provider.getSkyProvider()) != null)
|
||||
+ {
|
||||
+ skyProvider.render(par1, this.theWorld, mc);
|
||||
+ return;
|
||||
+ }
|
||||
if (this.mc.theWorld.provider.worldType == 1)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
@@ -1787,6 +1796,7 @@
|
||||
double var17 = this.mc.renderViewEntity.posY - par4;
|
||||
double var19 = this.mc.renderViewEntity.posZ - par6;
|
||||
EntityFX var21 = null;
|
||||
|
@ -8,7 +32,7 @@
|
|||
|
||||
if (par1Str.equals("hugeexplosion"))
|
||||
{
|
||||
@@ -1906,6 +1907,7 @@
|
||||
@@ -1906,6 +1916,7 @@
|
||||
else if (par1Str.equals("snowballpoof"))
|
||||
{
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball);
|
||||
|
@ -16,7 +40,7 @@
|
|||
}
|
||||
else if (par1Str.equals("dripWater"))
|
||||
{
|
||||
@@ -1922,6 +1924,7 @@
|
||||
@@ -1922,6 +1933,7 @@
|
||||
else if (par1Str.equals("slime"))
|
||||
{
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall);
|
||||
|
@ -24,7 +48,7 @@
|
|||
}
|
||||
else if (par1Str.equals("heart"))
|
||||
{
|
||||
@@ -1935,17 +1938,19 @@
|
||||
@@ -1935,17 +1947,19 @@
|
||||
{
|
||||
var24 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var24]);
|
||||
|
|
Loading…
Reference in a new issue