Permalink
Browse files

Fixed a server crash (loading client classes)

  • Loading branch information...
Ri5ux committed Dec 27, 2017
1 parent 5dca9c1 commit 34cf9ffe7e85795d61eae796397fcf13e0bc805e
@@ -73,6 +73,7 @@ public void fogRenderEvent(RenderFogEvent event)
}
}
@SideOnly(Side.CLIENT)
private void generateStars()
{
Tessellator tessellator = Tessellator.getInstance();
@@ -94,6 +95,7 @@ private void generateStars()
this.starGLCallList += 1;
}
@SideOnly(Side.CLIENT)
private void renderStars(VertexBuffer buffer)
{
Random random = new Random(10842L);
@@ -143,6 +145,7 @@ private void renderStars(VertexBuffer buffer)
Tessellator.getInstance().draw();
}
@SideOnly(Side.CLIENT)
@Override
public void render(float renderPartialTicks, WorldClient world, Minecraft mc)
{
@@ -236,6 +239,7 @@ public void render(float renderPartialTicks, WorldClient world, Minecraft mc)
}
}
@SideOnly(Side.CLIENT)
public void renderClouds(float renderPartialTicks)
{
for (int cloudPass = 1; cloudPass > 0; cloudPass--)
@@ -3,20 +3,18 @@
import org.avp.AliensVsPredator;
import com.arisux.mdx.lib.client.render.Texture;
import com.arisux.mdx.lib.client.render.world.ClimateProvider;
import com.arisux.mdx.lib.client.render.world.IStormProvider;
import com.arisux.mdx.lib.client.render.world.CloudProvider;
import com.arisux.mdx.lib.game.Game;
import com.arisux.mdx.lib.util.MDXMath;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ClimateProviderVarda extends ClimateProvider
public class CloudProviderVarda extends CloudProvider
{
public StormProviderVarda stormProvider = new StormProviderVarda();
@SideOnly(Side.CLIENT)
@Override
public Texture getCloudTexture()
{
@@ -40,16 +38,4 @@ public double getCloudMovementZ(World world, float cloudTicksPrev, float cloudTi
{
return -MDXMath.interpolateRotation(cloudTicksPrev, cloudTicks, Game.partialTicks());
}
@Override
public void render(float partialTicks, WorldClient world, Minecraft mc)
{
super.render(partialTicks, world, mc);
}
@Override
public IStormProvider getStormProvider()
{
return stormProvider;
}
}
@@ -19,6 +19,8 @@
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraftforge.client.IRenderHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class SkyProviderVarda extends IRenderHandler
{
@@ -100,6 +102,7 @@ private void renderStars(VertexBuffer buffer)
Tessellator.getInstance().draw();
}
@SideOnly(Side.CLIENT)
@Override
public void render(float partialTicks, WorldClient world, Minecraft mc)
{
@@ -9,6 +9,8 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class StormProviderVarda extends StormProvider
{
@@ -54,6 +56,7 @@ public boolean doesLightingApply()
return true;
}
@SideOnly(Side.CLIENT)
@Override
public Texture getStormTexture(World world, Biome biome)
{
@@ -2,6 +2,10 @@
import org.avp.AliensVsPredator;
import com.arisux.mdx.lib.client.render.world.IClimateProvider;
import com.arisux.mdx.lib.client.render.world.ICloudProvider;
import com.arisux.mdx.lib.client.render.world.IStormProvider;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
@@ -14,13 +18,24 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class WorldProviderVarda extends WorldProvider
public class WorldProviderVarda extends WorldProvider implements IClimateProvider
{
@SideOnly(Side.CLIENT)
public ClimateProviderVarda climateProvider = new ClimateProviderVarda();
private StormProviderVarda storm = new StormProviderVarda();
private CloudProviderVarda clouds = new CloudProviderVarda();
private SkyProviderVarda sky;
@Override
public IStormProvider getStormProvider()
{
return storm;
}
@Override
public ICloudProvider getCloudProvider()
{
return clouds;
}
@SideOnly(Side.CLIENT)
private SkyProviderVarda skyProvider;
public WorldProviderVarda()
{
@@ -45,18 +60,19 @@ protected void createBiomeProvider()
this.biomeProvider = new BiomeProviderVarda(this.getSeed(), WorldType.DEFAULT);
}
@Override
@SideOnly(Side.CLIENT)
public IRenderHandler getSkyRenderer()
{
return skyProvider == null ? skyProvider = new SkyProviderVarda() : skyProvider;
return sky == null ? sky = new SkyProviderVarda() : sky;
}
@Override
@SideOnly(Side.CLIENT)
public IRenderHandler getCloudRenderer()
{
return climateProvider;
return (CloudProviderVarda) getCloudProvider();
}
@Override

0 comments on commit 34cf9ff

Please sign in to comment.