move worldgen to server
This commit is contained in:
parent
e26938ee77
commit
111226fe28
159 changed files with 1917 additions and 1951 deletions
|
@ -95,7 +95,7 @@ import client.window.Wheel;
|
|||
import client.window.Window;
|
||||
import client.window.WindowEvent;
|
||||
import client.world.WorldClient;
|
||||
import common.biome.Biome;
|
||||
import common.biome.BaseBiome;
|
||||
import common.block.Block;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
|
@ -116,6 +116,7 @@ import common.init.ItemRegistry;
|
|||
import common.init.Items;
|
||||
import common.init.Registry;
|
||||
import common.init.SoundEvent;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.inventory.InventoryPlayer;
|
||||
import common.item.Item;
|
||||
import common.item.ItemBlock;
|
||||
|
@ -1728,7 +1729,7 @@ public class Client implements IThreadListener {
|
|||
break;
|
||||
}
|
||||
|
||||
Biome biome = null;
|
||||
BaseBiome biome = null;
|
||||
String bline;
|
||||
String lline;
|
||||
if(this.world.isBlockLoaded(blockpos)) {
|
||||
|
@ -2638,6 +2639,7 @@ public class Client implements IThreadListener {
|
|||
Window.init();
|
||||
ModelBlock.setAsProvider();
|
||||
Registry.setup("Render thread");
|
||||
UniverseRegistry.register();
|
||||
CLIENT.run();
|
||||
Window.end();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import client.renderer.particle.EffectRenderer;
|
|||
import client.renderer.texture.DynamicTexture;
|
||||
import client.renderer.texture.TextureMap;
|
||||
import client.world.WorldClient;
|
||||
import common.biome.Biome;
|
||||
import common.biome.BaseBiome;
|
||||
import common.block.Block;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -1144,7 +1144,7 @@ public class EntityRenderer {
|
|||
for (int l = 0; l < k; ++l)
|
||||
{
|
||||
BlockPos blockpos1 = world.getPrecipitationHeight(blockpos.add(this.random.zrange(i) - this.random.zrange(i), 0, this.random.zrange(i) - this.random.zrange(i)));
|
||||
Biome biomegenbase = world.getBiomeGenForCoords(blockpos1);
|
||||
BaseBiome biomegenbase = world.getBiomeGenForCoords(blockpos1);
|
||||
BlockPos blockpos2 = blockpos1.down();
|
||||
Block block = world.getState(blockpos2).getBlock();
|
||||
float temp = World.ABSOLUTE_ZERO + world.getTempOffset() + biomegenbase.getTemperature(blockpos1);
|
||||
|
@ -1253,7 +1253,7 @@ public class EntityRenderer {
|
|||
double d3 = (double)this.rainXCoords[i2] * 0.5D;
|
||||
double d4 = (double)this.rainYCoords[i2] * 0.5D;
|
||||
blockpos$mutableblockpos.set(l1, 0, k1);
|
||||
Biome biomegenbase = world.getBiomeGenForCoords(blockpos$mutableblockpos);
|
||||
BaseBiome biomegenbase = world.getBiomeGenForCoords(blockpos$mutableblockpos);
|
||||
|
||||
// if (biomegenbase.canRain() || biomegenbase.isSnowyBiome())
|
||||
// {
|
||||
|
|
|
@ -2,7 +2,7 @@ package client.renderer;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.biome.BaseBiome;
|
||||
import common.init.Blocks;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
|
@ -125,7 +125,7 @@ public class RegionRenderCache extends ChunkCache implements IWorldAccess
|
|||
return i << 20 | j << 4;
|
||||
}
|
||||
|
||||
public Biome getBiomeGenForCoords(BlockPos pos)
|
||||
public BaseBiome getBiomeGenForCoords(BlockPos pos)
|
||||
{
|
||||
return this.worldObj.getBiomeGenForCoords(pos);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.Set;
|
|||
import client.Client;
|
||||
import client.renderer.particle.EntityFX;
|
||||
import client.renderer.particle.EntityFirework;
|
||||
import common.biome.Biome;
|
||||
import common.biome.BaseBiome;
|
||||
import common.block.Block;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Sets;
|
||||
|
@ -759,10 +759,10 @@ public class WorldClient extends AWorldClient
|
|||
public Vec3 getSkyColor(Entity entity, float partial) {
|
||||
BlockPos pos = new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
|
||||
ExtMath.floord(entity.posZ));
|
||||
Biome biome = this.getBiomeGenForCoords(pos);
|
||||
BaseBiome biome = this.getBiomeGenForCoords(pos);
|
||||
Vec3 vec;
|
||||
if(biome.getSkyColor() != 0xffffffff)
|
||||
vec = new Vec3(biome.getSkyColor());
|
||||
if(biome.skyColor != 0xffffffff)
|
||||
vec = new Vec3(biome.skyColor);
|
||||
else
|
||||
vec = new Vec3(this.dimension.getSkyColor());
|
||||
if(this.dimension.getType().days) {
|
||||
|
@ -815,10 +815,10 @@ public class WorldClient extends AWorldClient
|
|||
|
||||
public Vec3 getCloudColour(Entity entity, float partialTicks) {
|
||||
Vec3 color = new Vec3(this.dimension.getCloudColor());
|
||||
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
|
||||
BaseBiome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
|
||||
ExtMath.floord(entity.posZ)));
|
||||
if(biome.getCloudColor() != 0xffffffff)
|
||||
color = new Vec3(biome.getCloudColor());
|
||||
if(biome.cloudColor != 0xffffffff)
|
||||
color = new Vec3(biome.cloudColor);
|
||||
float r = (float)color.xCoord;
|
||||
float g = (float)color.yCoord;
|
||||
float b = (float)color.zCoord;
|
||||
|
@ -854,10 +854,10 @@ public class WorldClient extends AWorldClient
|
|||
|
||||
public Vec3 getFogColor(Entity entity, float partialTicks) {
|
||||
Vec3 color = new Vec3(this.dimension.getFogColor());
|
||||
Biome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
|
||||
BaseBiome biome = this.getBiomeGenForCoords(new BlockPos(ExtMath.floord(entity.posX), ExtMath.floord(entity.posY),
|
||||
ExtMath.floord(entity.posZ)));
|
||||
if(biome.getFogColor() != 0xffffffff)
|
||||
color = new Vec3(biome.getFogColor());
|
||||
if(biome.fogColor != 0xffffffff)
|
||||
color = new Vec3(biome.fogColor);
|
||||
if(!this.dimension.getType().days)
|
||||
return color;
|
||||
float sun = ExtMath.clampf(ExtMath.cos(this.getCelestialAngle(partialTicks) * (float)Math.PI * 2.0F) * 2.0F + 0.5F,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue