remove block tinting

This commit is contained in:
Sen 2025-07-21 19:54:21 +02:00
parent 189d6883b9
commit 0525ba5d56
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
241 changed files with 1162 additions and 1650 deletions

View file

@ -65,7 +65,6 @@ import client.renderer.blockmodel.ModelManager;
import client.renderer.chunk.RenderChunk; import client.renderer.chunk.RenderChunk;
import client.renderer.entity.RenderItem; import client.renderer.entity.RenderItem;
import client.renderer.entity.RenderManager; import client.renderer.entity.RenderManager;
import client.renderer.texture.ColormapLoader;
import client.renderer.texture.EntityTexManager; import client.renderer.texture.EntityTexManager;
import client.renderer.texture.TextureManager; import client.renderer.texture.TextureManager;
import client.renderer.texture.TextureMap; import client.renderer.texture.TextureMap;
@ -638,7 +637,6 @@ public class Client implements IThreadListener {
Font.unload(); Font.unload();
Font.load(this.font); Font.load(this.font);
this.textureManager.onReload(); this.textureManager.onReload();
ColormapLoader.reload();
this.modelManager.onReload(); this.modelManager.onReload();
this.renderItem.onReload(); this.renderItem.onReload();
this.blockRenderer.onReload(); this.blockRenderer.onReload();
@ -653,7 +651,6 @@ public class Client implements IThreadListener {
this.textureManager = new TextureManager(); this.textureManager = new TextureManager();
this.textureManager.onReload(); this.textureManager.onReload();
this.soundManager = new SoundManager(this); this.soundManager = new SoundManager(this);
ColormapLoader.reload();
GlState.enableTexture2D(); GlState.enableTexture2D();
GlState.shadeModel(GL11.GL_SMOOTH); GlState.shadeModel(GL11.GL_SMOOTH);
GL11.glClearDepth(1.0D); GL11.glClearDepth(1.0D);

View file

@ -111,27 +111,27 @@ public class GuiCreateDimension extends Gui {
addPreset("Chaotische Höhlen", "UpperLmtScale:2.0,LowerLmtScale:64.0,SeaLevel:6"); addPreset("Chaotische Höhlen", "UpperLmtScale:2.0,LowerLmtScale:64.0,SeaLevel:6");
addPreset("Viel Glück", "LiquidBlock:lava,SeaLevel:40"); addPreset("Viel Glück", "LiquidBlock:lava,SeaLevel:40");
addFlatPreset("Klassisch", Biome.PLAINS, false, Blocks.dirt.getState(), Blocks.bedrock.getState(), 2, Blocks.dirt.getState(), addFlatPreset("Klassisch", Biome.PLAIN, false, Blocks.dirt.getState(), Blocks.bedrock.getState(), 2, Blocks.dirt.getState(),
Blocks.grass.getState()).enableVillages(); Blocks.grass.getState()).enableVillages();
addFlatPreset("Abbauwelt", Biome.EXTREMEHILLS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 230, Blocks.stone.getState(), addFlatPreset("Abbauwelt", Biome.HILLS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 230, Blocks.stone.getState(),
5, Blocks.dirt.getState(), Blocks.grass.getState()).enableStrongholds().enableMineshafts().setDungeons(8); 5, Blocks.dirt.getState(), Blocks.grass.getState()).enableStrongholds().enableMineshafts().setDungeons(8);
addFlatPreset("Wasserwelt", Biome.SEA, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 5, Blocks.stone.getState(), addFlatPreset("Wasserwelt", Biome.SEA, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 5, Blocks.stone.getState(),
52, Blocks.dirt.getState(), 5, Blocks.sand.getState(), 90, Blocks.water.getState()); 52, Blocks.dirt.getState(), 5, Blocks.sand.getState(), 90, Blocks.water.getState());
addFlatPreset("Oberfläche", Biome.PLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(), addFlatPreset("Oberfläche", Biome.PLAIN, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
3, Blocks.dirt.getState(), Blocks.grass.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages().enableStrongholds().enableMineshafts().setDungeons(8) 3, Blocks.dirt.getState(), Blocks.grass.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages().enableStrongholds().enableMineshafts().setDungeons(8)
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false).addLake(Blocks.lava.getState(), Blocks.stone.getState(), null, 8, 8, 255, true); .addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false).addLake(Blocks.lava.getState(), Blocks.stone.getState(), null, 8, 8, 255, true);
addFlatPreset("Verschneites Königreich", Biome.ICEPLAINS, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(), addFlatPreset("Verschneites Königreich", Biome.ICE, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).enableVillages(); 3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).enableVillages();
addFlatPreset("Verschneites Königreich +", Biome.ICEPLAINS, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(), addFlatPreset("Verschneites Königreich +", Biome.ICE, true, Blocks.stone.getState(), Blocks.bedrock.getState(), 59, Blocks.stone.getState(),
3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages() 3, Blocks.dirt.getState(), Blocks.grass.getState(), Blocks.snow_layer.getState()).setBiomeReplacer(Blocks.gravel.getState()).enableVillages()
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false); .addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false);
addFlatPreset("Unendliche Grube", Biome.PLAINS, false, Blocks.dirt.getState(), 2, Blocks.cobblestone.getState(), 3, Blocks.dirt.getState(), Blocks.grass.getState()) addFlatPreset("Unendliche Grube", Biome.PLAIN, false, Blocks.dirt.getState(), 2, Blocks.cobblestone.getState(), 3, Blocks.dirt.getState(), Blocks.grass.getState())
.setBiomeReplacer(Blocks.gravel.getState()).enableVillages(); .setBiomeReplacer(Blocks.gravel.getState()).enableVillages();
addFlatPreset("Wüste", Biome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState()) addFlatPreset("Wüste", Biome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState())

View file

@ -54,15 +54,12 @@ import client.renderer.model.ModelPig;
import client.renderer.model.ModelRabbit; import client.renderer.model.ModelRabbit;
import client.renderer.model.ModelSheep2; import client.renderer.model.ModelSheep2;
import client.renderer.model.ModelWolf; import client.renderer.model.ModelWolf;
import client.renderer.texture.TextureTicked; import client.renderer.texture.TextureTicked.TextureCreator;
import client.renderer.ticked.TextureFlamesFX1; import client.renderer.ticked.TextureFlame;
import client.renderer.ticked.TextureFlamesFX2; import client.renderer.ticked.TextureMagma;
import client.renderer.ticked.TextureFlamesFXMono1; import client.renderer.ticked.TextureMagmaFlow;
import client.renderer.ticked.TextureFlamesFXMono2; import client.renderer.ticked.TextureWater;
import client.renderer.ticked.TextureLavaFX; import client.renderer.ticked.TextureWaterFlow;
import client.renderer.ticked.TextureLavaFlowFX;
import client.renderer.ticked.TextureWaterFX;
import client.renderer.ticked.TextureWaterFlowFX;
import common.entity.Entity; import common.entity.Entity;
import common.entity.animal.EntityBat; import common.entity.animal.EntityBat;
import common.entity.animal.EntityChicken; import common.entity.animal.EntityChicken;
@ -161,14 +158,18 @@ public abstract class RenderRegistry {
} }
} }
public static void registerAnimations(Map<TextureAnimation, Class<? extends TextureTicked>> anim) { public static void registerAnimations(Map<TextureAnimation, TextureCreator> anim) {
anim.put(TextureAnimation.FIRE1, TextureFlamesFX1.class); anim.put(TextureAnimation.FLAME_BASE, () -> new TextureFlame(0xffffffff, 0));
anim.put(TextureAnimation.FIRE2, TextureFlamesFX2.class); anim.put(TextureAnimation.FLAME_OFFSET, () -> new TextureFlame(0xffffffff, 160));
anim.put(TextureAnimation.FLAME1, TextureFlamesFXMono1.class); anim.put(TextureAnimation.BLACK_FLAME_BASE, () -> new TextureFlame(0xff202020, 0));
anim.put(TextureAnimation.FLAME2, TextureFlamesFXMono2.class); anim.put(TextureAnimation.BLACK_FLAME_OFFSET, () -> new TextureFlame(0xff202020, 160));
anim.put(TextureAnimation.LAVAFLOW, TextureLavaFlowFX.class); anim.put(TextureAnimation.BLUE_FLAME_BASE, () -> new TextureFlame(0xff4010ff, 0));
anim.put(TextureAnimation.LAVA, TextureLavaFX.class); anim.put(TextureAnimation.BLUE_FLAME_OFFSET, () -> new TextureFlame(0xff4010ff, 160));
anim.put(TextureAnimation.WATERFLOW, TextureWaterFlowFX.class); anim.put(TextureAnimation.MAGMA_FLOW, () -> new TextureMagmaFlow());
anim.put(TextureAnimation.WATER, TextureWaterFX.class); anim.put(TextureAnimation.MAGMA_STILL, () -> new TextureMagma());
anim.put(TextureAnimation.WATER_FLOW, () -> new TextureWaterFlow(0xffffffff));
anim.put(TextureAnimation.WATER_STILL, () -> new TextureWater(0xffffffff));
anim.put(TextureAnimation.SWAMP_WATER_FLOW, () -> new TextureWaterFlow(0xffe0ffae));
anim.put(TextureAnimation.SWAMP_WATER_STILL, () -> new TextureWater(0xffe0ffae));
} }
} }

View file

@ -297,82 +297,42 @@ public class BlockRenderer
worldRendererIn.addVertexData(bakedquad.getVertexData()); worldRendererIn.addVertexData(bakedquad.getVertexData());
worldRendererIn.putBrightness4(brightnessIn, brightnessIn, brightnessIn, brightnessIn); worldRendererIn.putBrightness4(brightnessIn, brightnessIn, brightnessIn, brightnessIn);
if (bakedquad.hasTintIndex())
{
int l = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());
// if (EntityRenderer.anaglyphEnable)
// {
// l = TextureUtil.anaglyphColor(l);
// }
float f = (float)(l >> 16 & 255) / 255.0F;
float f1 = (float)(l >> 8 & 255) / 255.0F;
float f2 = (float)(l & 255) / 255.0F;
worldRendererIn.putColorMultiplier(f, f1, f2, 4);
worldRendererIn.putColorMultiplier(f, f1, f2, 3);
worldRendererIn.putColorMultiplier(f, f1, f2, 2);
worldRendererIn.putColorMultiplier(f, f1, f2, 1);
}
worldRendererIn.putPosition(d0, d1, d2); worldRendererIn.putPosition(d0, d1, d2);
} }
} }
public void renderModelBrightnessColor(IBakedModel bakedModel, float p_178262_2_, float red, float green, float blue) private void renderModelBrightnessColor(IBakedModel bakedModel, float brightness)
{ {
for (Facing enumfacing : Facing.values()) for (Facing enumfacing : Facing.values())
{ {
this.renderModelBrightnessColorQuads(p_178262_2_, red, green, blue, bakedModel.getFace(enumfacing)); this.renderModelBrightnessColorQuads(brightness, bakedModel.getFace(enumfacing));
} }
this.renderModelBrightnessColorQuads(p_178262_2_, red, green, blue, bakedModel.getQuads()); this.renderModelBrightnessColorQuads(brightness, bakedModel.getQuads());
} }
private void renderModelBrightness(IBakedModel model, State p_178266_2_, float brightness, boolean p_178266_4_) private void renderModelBrightness(IBakedModel model, State p_178266_2_, float brightness, boolean p_178266_4_)
{ {
Block block = p_178266_2_.getBlock(); Block block = p_178266_2_.getBlock();
block.setItemBounds();
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
int i = block.getRenderColor(block.getEntityState(p_178266_2_));
// if (EntityRenderer.anaglyphEnable)
// {
// i = TextureUtil.anaglyphColor(i);
// }
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
if (!p_178266_4_) if (!p_178266_4_)
{ {
GlState.color(brightness, brightness, brightness, 1.0F); GlState.color(brightness, brightness, brightness, 1.0F);
} }
this.renderModelBrightnessColor(model, brightness, f, f1, f2); this.renderModelBrightnessColor(model, brightness);
} }
private void renderModelBrightnessColorQuads(float brightness, float red, float green, float blue, List<BakedQuad> listQuads) private void renderModelBrightnessColorQuads(float brightness, List<BakedQuad> listQuads)
{ {
// Tessellator tessellator = Tessellator.getInstance();
RenderBuffer worldrenderer = Tessellator.getBuffer(); RenderBuffer worldrenderer = Tessellator.getBuffer();
for (BakedQuad bakedquad : listQuads) for (BakedQuad bakedquad : listQuads)
{ {
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM); worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
worldrenderer.addVertexData(bakedquad.getVertexData()); worldrenderer.addVertexData(bakedquad.getVertexData());
worldrenderer.putColorRGB_F4(brightness, brightness, brightness);
if (bakedquad.hasTintIndex())
{
worldrenderer.putColorRGB_F4(red * brightness, green * brightness, blue * brightness);
}
else
{
worldrenderer.putColorRGB_F4(brightness, brightness, brightness);
}
Vec3i vec3i = bakedquad.getFace().getDirectionVec(); Vec3i vec3i = bakedquad.getFace().getDirectionVec();
worldrenderer.putNormal((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ()); worldrenderer.putNormal((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ());
Tessellator.draw(); Tessellator.draw();
@ -395,10 +355,6 @@ public class BlockRenderer
BlockLiquid blockliquid = (BlockLiquid)blockStateIn.getBlock(); BlockLiquid blockliquid = (BlockLiquid)blockStateIn.getBlock();
blockliquid.setBlockBounds(blockAccess, blockPosIn); blockliquid.setBlockBounds(blockAccess, blockPosIn);
Sprite[] atextureatlassprite = this.fluids.get(blockliquid); Sprite[] atextureatlassprite = this.fluids.get(blockliquid);
int i = blockliquid.colorMultiplier(blockAccess, blockPosIn, 0);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
boolean flag = blockliquid.canRender(blockAccess, blockPosIn.up(), Facing.UP); boolean flag = blockliquid.canRender(blockAccess, blockPosIn.up(), Facing.UP);
boolean flag1 = blockliquid.canRender(blockAccess, blockPosIn.down(), Facing.DOWN); boolean flag1 = blockliquid.canRender(blockAccess, blockPosIn.down(), Facing.DOWN);
boolean[] aboolean = new boolean[] {blockliquid.canRender(blockAccess, blockPosIn.north(), Facing.NORTH), blockliquid.canRender(blockAccess, blockPosIn.south(), Facing.SOUTH), blockliquid.canRender(blockAccess, blockPosIn.west(), Facing.WEST), blockliquid.canRender(blockAccess, blockPosIn.east(), Facing.EAST)}; boolean[] aboolean = new boolean[] {blockliquid.canRender(blockAccess, blockPosIn.north(), Facing.NORTH), blockliquid.canRender(blockAccess, blockPosIn.south(), Facing.SOUTH), blockliquid.canRender(blockAccess, blockPosIn.west(), Facing.WEST), blockliquid.canRender(blockAccess, blockPosIn.east(), Facing.EAST)};
@ -414,11 +370,10 @@ public class BlockRenderer
float f4 = 1.0F; float f4 = 1.0F;
float f5 = 0.8F; float f5 = 0.8F;
float f6 = 0.6F; float f6 = 0.6F;
Material material = blockliquid.getMaterial(); float f7 = this.getFluidHeight(blockAccess, blockPosIn);
float f7 = this.getFluidHeight(blockAccess, blockPosIn, material); float f8 = this.getFluidHeight(blockAccess, blockPosIn.south());
float f8 = this.getFluidHeight(blockAccess, blockPosIn.south(), material); float f9 = this.getFluidHeight(blockAccess, blockPosIn.east().south());
float f9 = this.getFluidHeight(blockAccess, blockPosIn.east().south(), material); float f10 = this.getFluidHeight(blockAccess, blockPosIn.east());
float f10 = this.getFluidHeight(blockAccess, blockPosIn.east(), material);
double d0 = (double)blockPosIn.getX(); double d0 = (double)blockPosIn.getX();
double d1 = (double)blockPosIn.getY(); double d1 = (double)blockPosIn.getY();
double d2 = (double)blockPosIn.getZ(); double d2 = (double)blockPosIn.getZ();
@ -477,9 +432,9 @@ public class BlockRenderer
int k2 = blockliquid.getLightmapValue(blockAccess, blockPosIn); int k2 = blockliquid.getLightmapValue(blockAccess, blockPosIn);
int l2 = k2 >> 16 & 65535; int l2 = k2 >> 16 & 65535;
int i3 = k2 & 65535; int i3 = k2 & 65535;
float f24 = f4 * f; float f24 = f4;
float f25 = f4 * f1; float f25 = f4;
float f26 = f4 * f2; float f26 = f4;
worldRendererIn.pos(d0 + 0.0D, d1 + (double)f7, d2 + 0.0D).color(f24, f25, f26, 1.0F).tex((double)f13, (double)f17).lightmap(l2, i3).endVertex(); worldRendererIn.pos(d0 + 0.0D, d1 + (double)f7, d2 + 0.0D).color(f24, f25, f26, 1.0F).tex((double)f13, (double)f17).lightmap(l2, i3).endVertex();
worldRendererIn.pos(d0 + 0.0D, d1 + (double)f8, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f14, (double)f18).lightmap(l2, i3).endVertex(); worldRendererIn.pos(d0 + 0.0D, d1 + (double)f8, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f14, (double)f18).lightmap(l2, i3).endVertex();
worldRendererIn.pos(d0 + 1.0D, d1 + (double)f9, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f15, (double)f19).lightmap(l2, i3).endVertex(); worldRendererIn.pos(d0 + 1.0D, d1 + (double)f9, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f15, (double)f19).lightmap(l2, i3).endVertex();
@ -594,9 +549,9 @@ public class BlockRenderer
int k = j >> 16 & 65535; int k = j >> 16 & 65535;
int l = j & 65535; int l = j & 65535;
float f31 = i1 < 2 ? f5 : f6; float f31 = i1 < 2 ? f5 : f6;
float f32 = f4 * f31 * f; float f32 = f4 * f31;
float f33 = f4 * f31 * f1; float f33 = f4 * f31;
float f34 = f4 * f31 * f2; float f34 = f4 * f31;
worldRendererIn.pos(d3, d1 + (double)f39, d4).color(f32, f33, f34, 1.0F).tex((double)f41, (double)f28).lightmap(k, l).endVertex(); worldRendererIn.pos(d3, d1 + (double)f39, d4).color(f32, f33, f34, 1.0F).tex((double)f41, (double)f28).lightmap(k, l).endVertex();
worldRendererIn.pos(d5, d1 + (double)f40, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f29).lightmap(k, l).endVertex(); worldRendererIn.pos(d5, d1 + (double)f40, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f29).lightmap(k, l).endVertex();
worldRendererIn.pos(d5, d1 + 0.0D, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f30).lightmap(k, l).endVertex(); worldRendererIn.pos(d5, d1 + 0.0D, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f30).lightmap(k, l).endVertex();
@ -612,7 +567,7 @@ public class BlockRenderer
} }
} }
private float getFluidHeight(IBlockAccess blockAccess, BlockPos blockPosIn, Material blockMaterial) private float getFluidHeight(IBlockAccess blockAccess, BlockPos blockPosIn)
{ {
int i = 0; int i = 0;
float f = 0.0F; float f = 0.0F;
@ -621,7 +576,7 @@ public class BlockRenderer
{ {
BlockPos blockpos = blockPosIn.add(-(j & 1), 0, -(j >> 1 & 1)); BlockPos blockpos = blockPosIn.add(-(j & 1), 0, -(j >> 1 & 1));
if (blockAccess.getState(blockpos.up()).getBlock().getMaterial() == blockMaterial) if (blockAccess.getState(blockpos.up()).getBlock().getMaterial().isLiquid())
{ {
return 1.0F; return 1.0F;
} }
@ -629,7 +584,7 @@ public class BlockRenderer
State iblockstate = blockAccess.getState(blockpos); State iblockstate = blockAccess.getState(blockpos);
Material material = iblockstate.getBlock().getMaterial(); Material material = iblockstate.getBlock().getMaterial();
if (material != blockMaterial) if (!material.isLiquid())
{ {
if (!material.isSolid()) if (!material.isSolid())
{ {

View file

@ -708,7 +708,7 @@ public class EffectRenderer {
this.offsetY = rng.floatv() * 3.0F; this.offsetY = rng.floatv() * 3.0F;
} }
protected Icon(double x, double y, double z, State state, BlockPos pos, boolean hit) { protected Icon(double x, double y, double z, State state, boolean hit) {
this(x, y, z, hit ? 0.6f : 1.0f, Client.CLIENT.getBlockRendererDispatcher().getModelManager().getTexture(state)); this(x, y, z, hit ? 0.6f : 1.0f, Client.CLIENT.getBlockRendererDispatcher().getModelManager().getTexture(state));
this.gravity = 1.0F; this.gravity = 1.0F;
this.red = this.green = this.blue = 0.6F; this.red = this.green = this.blue = 0.6F;
@ -717,13 +717,6 @@ public class EffectRenderer {
this.motionY = (this.motionY - 0.1) * 0.2 + 0.1; this.motionY = (this.motionY - 0.1) * 0.2 + 0.1;
this.motionZ *= 0.2; this.motionZ *= 0.2;
} }
Block block = state.getBlock();
if(block == Blocks.grass)
return;
int color = pos == null ? block.getRenderColor(state) : block.colorMultiplier(world, pos, 0);
this.red *= (float)(color >> 16 & 255) / 255.0F;
this.green *= (float)(color >> 8 & 255) / 255.0F;
this.blue *= (float)(color & 255) / 255.0F;
} }
protected Icon(double x, double y, double z, Item item) { protected Icon(double x, double y, double z, Item item) {
@ -971,7 +964,7 @@ public class EffectRenderer {
}); });
this.register(ParticleType.BLOCK_CRACK, (x, y, z, id) -> { this.register(ParticleType.BLOCK_CRACK, (x, y, z, id) -> {
State state = BlockRegistry.byId(id); State state = BlockRegistry.byId(id);
return state == null ? null : new Icon(x, y, z, state, null, false); return state == null ? null : new Icon(x, y, z, state, false);
}); });
this.register(ParticleType.EXPLOSION_HUGE, (x, y, z, u) -> new ExplosionSpawner(x, y, z)); this.register(ParticleType.EXPLOSION_HUGE, (x, y, z, u) -> new ExplosionSpawner(x, y, z));
this.register(ParticleType.EXPLOSION_LARGE, this.register(ParticleType.EXPLOSION_LARGE,
@ -1089,7 +1082,7 @@ public class EffectRenderer {
double d0 = (double)pos.getX() + ((double)j + 0.5D) / (double)i; double d0 = (double)pos.getX() + ((double)j + 0.5D) / (double)i;
double d1 = (double)pos.getY() + ((double)k + 0.5D) / (double)i; double d1 = (double)pos.getY() + ((double)k + 0.5D) / (double)i;
double d2 = (double)pos.getZ() + ((double)l + 0.5D) / (double)i; double d2 = (double)pos.getZ() + ((double)l + 0.5D) / (double)i;
this.add(new Icon(d0, d1, d2, state, pos, false)); this.add(new Icon(d0, d1, d2, state, false));
} }
} }
} }
@ -1136,7 +1129,7 @@ public class EffectRenderer {
d0 = (double)i + block.getBlockBoundsMaxX() + (double)f; d0 = (double)i + block.getBlockBoundsMaxX() + (double)f;
} }
this.add(new Icon(d0, d1, d2, iblockstate, pos, true)); this.add(new Icon(d0, d1, d2, iblockstate, true));
} }
} }

View file

@ -21,7 +21,7 @@ import common.item.Item;
import common.item.ItemAction; import common.item.ItemAction;
import common.item.ItemStack; import common.item.ItemStack;
import common.model.BlockLayer; import common.model.BlockLayer;
import common.model.Transform; import common.model.GuiPosition;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.ExtMath; import common.util.ExtMath;
import common.util.Vec3; import common.util.Vec3;

View file

@ -287,36 +287,6 @@ public class RenderBuffer
return ((this.vertexCount - p_78909_1_) * this.vertexFormat.getNextOffset() + this.vertexFormat.getColorOffset()) / 4; return ((this.vertexCount - p_78909_1_) * this.vertexFormat.getNextOffset() + this.vertexFormat.getColorOffset()) / 4;
} }
public void putColorMultiplier(float red, float green, float blue, int p_178978_4_)
{
int i = this.getColorIndex(p_178978_4_);
int j = -1;
if (!this.noColor)
{
j = this.rawIntBuffer.get(i);
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN)
{
int k = (int)((float)(j & 255) * red);
int l = (int)((float)(j >> 8 & 255) * green);
int i1 = (int)((float)(j >> 16 & 255) * blue);
j = j & -16777216;
j = j | i1 << 16 | l << 8 | k;
}
else
{
int j1 = (int)((float)(j >> 24 & 255) * red);
int k1 = (int)((float)(j >> 16 & 255) * green);
int l1 = (int)((float)(j >> 8 & 255) * blue);
j = j & 255;
j = j | j1 << 24 | k1 << 16 | l1 << 8;
}
}
this.rawIntBuffer.put(i, j);
}
private void putColor(int argb, int p_178988_2_) private void putColor(int argb, int p_178988_2_)
{ {
int i = this.getColorIndex(p_178988_2_); int i = this.getColorIndex(p_178988_2_);

View file

@ -5,10 +5,10 @@ import java.util.List;
import client.renderer.texture.Sprite; import client.renderer.texture.Sprite;
import common.collect.Lists; import common.collect.Lists;
import common.model.Transform; import common.model.GuiPosition;
import common.util.Facing; import common.util.Facing;
public record BakedModel(List<BakedQuad> getQuads, List<List<BakedQuad>> getFace, boolean isGui3d, Sprite getBaseTexture, Transform getTransforms) implements IBakedModel { public record BakedModel(List<BakedQuad> getQuads, List<List<BakedQuad>> getFace, boolean isGui3d, Sprite getBaseTexture, GuiPosition getTransforms) implements IBakedModel {
public List<BakedQuad> getFace(Facing face) { public List<BakedQuad> getFace(Facing face) {
return this.getFace.get(face.ordinal()); return this.getFace.get(face.ordinal());
} }
@ -22,7 +22,7 @@ public record BakedModel(List<BakedQuad> getQuads, List<List<BakedQuad>> getFace
private final List<List<BakedQuad>> faces; private final List<List<BakedQuad>> faces;
private Sprite texture; private Sprite texture;
private boolean gui3d; private boolean gui3d;
private Transform transforms; private GuiPosition transforms;
public Builder(ModelBlock model) { public Builder(ModelBlock model) {
this(model.isGui3d(), model.getTransform()); this(model.isGui3d(), model.getTransform());
@ -51,7 +51,7 @@ public record BakedModel(List<BakedQuad> getQuads, List<List<BakedQuad>> getFace
} }
} }
private Builder(boolean gui3d, Transform transforms) { private Builder(boolean gui3d, GuiPosition transforms) {
this.quads = Lists.<BakedQuad>newArrayList(); this.quads = Lists.<BakedQuad>newArrayList();
this.faces = new ArrayList<List<BakedQuad>>(6); this.faces = new ArrayList<List<BakedQuad>>(6);

View file

@ -3,10 +3,10 @@ package client.renderer.blockmodel;
import java.util.List; import java.util.List;
import client.renderer.texture.Sprite; import client.renderer.texture.Sprite;
import common.model.Transform; import common.model.GuiPosition;
import common.util.Facing; import common.util.Facing;
public record BuiltInModel(Transform getTransforms) implements IBakedModel { public record BuiltInModel(GuiPosition getTransforms) implements IBakedModel {
public List<BakedQuad> getFace(Facing face) { public List<BakedQuad> getFace(Facing face) {
return null; return null;
} }

View file

@ -3,7 +3,7 @@ package client.renderer.blockmodel;
import java.util.List; import java.util.List;
import client.renderer.texture.Sprite; import client.renderer.texture.Sprite;
import common.model.Transform; import common.model.GuiPosition;
import common.util.Facing; import common.util.Facing;
public interface IBakedModel public interface IBakedModel
@ -18,5 +18,5 @@ public interface IBakedModel
Sprite getBaseTexture(); Sprite getBaseTexture();
Transform getTransforms(); GuiPosition getTransforms();
} }

View file

@ -22,7 +22,7 @@ import common.item.Item;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.ModelRotation; import common.model.ModelRotation;
import common.model.Transform; import common.model.GuiPosition;
import common.util.Facing; import common.util.Facing;
import common.util.Pair; import common.util.Pair;
import common.world.State; import common.world.State;
@ -74,7 +74,7 @@ public abstract class ModelBakery
if(extra != null) { if(extra != null) {
for(String sprite : extra) { for(String sprite : extra) {
loc = "item/" + sprite; loc = "item/" + sprite;
models.put(loc, new ModelBlock(Transform.IDENTITY, sprite)); models.put(loc, new ModelBlock(GuiPosition.NORMAL, sprite));
itemLocations.add(loc); itemLocations.add(loc);
} }
} }
@ -211,16 +211,14 @@ public abstract class ModelBakery
private static final ModelBlock getModel(Item item, ModelProvider provider, String name) { private static final ModelBlock getModel(Item item, ModelProvider provider, String name) {
ModelBlock model = (ModelBlock)item.getCustomModel(provider, name); ModelBlock model = (ModelBlock)item.getCustomModel(provider, name);
if(model != null) if(model != null)
return new ModelBlock(model, item.getCustomTransform()); return new ModelBlock(model, item.getCustomPosition());
if(item.hasBuiltinModel()) if(item.hasBuiltinModel())
return new ModelBlock(MODEL_ENTITY, Transform.IDENTITY); return new ModelBlock(MODEL_ENTITY, GuiPosition.NORMAL);
Block block = item.getBlock(); Block block = item.getBlock();
if(block != null && block.getRenderType() != 3)
return new ModelBlock(MODEL_ENTITY, Transform.IDENTITY);
State state = block == null ? null : block.getItemState(); State state = block == null ? null : block.getItemState();
if(state != null) if(state != null)
return new ModelBlock((ModelBlock)state.getBlock().getModel(provider, BlockRegistry.getName(state.getBlock()), state), state.getBlock().getTransform()); return new ModelBlock((ModelBlock)state.getBlock().getModel(provider, BlockRegistry.getName(state.getBlock()), state), state.getBlock().getItemPosition());
return new ModelBlock(Transform.IDENTITY, item.getTextures(name)); return new ModelBlock(GuiPosition.NORMAL, item.getTextures(name));
} }
private static IBakedModel bakeModel(Map<String, Sprite> sprites, FaceBakery faceBakery, private static IBakedModel bakeModel(Map<String, Sprite> sprites, FaceBakery faceBakery,

View file

@ -8,7 +8,7 @@ import common.collect.Maps;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.ModelRotation; import common.model.ModelRotation;
import common.model.Transform; import common.model.GuiPosition;
import common.util.Facing; import common.util.Facing;
import common.util.Vector3f; import common.util.Vector3f;
@ -27,7 +27,7 @@ public class ModelBlock extends Model {
private ModelRotation rotation; private ModelRotation rotation;
private boolean uvLock; private boolean uvLock;
private Transform transform; private GuiPosition transform;
private BlockPart lastPart; private BlockPart lastPart;
private BlockPartFace[] last; private BlockPartFace[] last;
@ -79,13 +79,6 @@ public class ModelBlock extends Model {
return this; return this;
} }
public ModelBlock tint() {
for(BlockPartFace last : this.last) {
last.tint = 0;
}
return this;
}
public ModelBlock rot(int rot) { public ModelBlock rot(int rot) {
for(BlockPartFace last : this.last) { for(BlockPartFace last : this.last) {
last.uv = new BlockFaceUV(last.uv.uvs, rot); last.uv = new BlockFaceUV(last.uv.uvs, rot);
@ -106,29 +99,29 @@ public class ModelBlock extends Model {
public ModelBlock(String primary) { public ModelBlock(String primary) {
this(null, Lists.newArrayList(), primary != null && primary.indexOf('/') == -1 ? "blocks/" + primary : primary, true, true, Transform.IDENTITY, null); this(null, Lists.newArrayList(), primary != null && primary.indexOf('/') == -1 ? "blocks/" + primary : primary, true, true, GuiPosition.NORMAL, null);
} }
public ModelBlock(Transform transform, String ... layers) { public ModelBlock(GuiPosition transform, String ... layers) {
this(ModelBakery.MODEL_GENERATED, ModelBakery.MODEL_GENERATED.elements, this(ModelBakery.MODEL_GENERATED, ModelBakery.MODEL_GENERATED.elements,
layers[0].indexOf('/') == -1 ? "items/" + layers[0] : layers[0], false, false, transform, layers); layers[0].indexOf('/') == -1 ? "items/" + layers[0] : layers[0], false, false, transform, layers);
} }
public ModelBlock(ModelBlock parent, Transform transform) { public ModelBlock(ModelBlock parent, GuiPosition transform) {
this(parent, Lists.newArrayList(), parent.getPrimary(), false, true, transform, null); this(parent, Lists.newArrayList(), parent.getPrimary(), false, true, transform, null);
} }
public ModelBlock(String primary, Transform transform, String ... layers) { public ModelBlock(String primary, GuiPosition transform, String ... layers) {
this(ModelBakery.MODEL_GENERATED, ModelBakery.MODEL_GENERATED.elements, this(ModelBakery.MODEL_GENERATED, ModelBakery.MODEL_GENERATED.elements,
primary.indexOf('/') == -1 ? "items/" + primary : primary, false, false, transform, layers); primary.indexOf('/') == -1 ? "items/" + primary : primary, false, false, transform, layers);
} }
public ModelBlock(String primary, List<BlockPart> elements, Transform transform, String ... layers) { public ModelBlock(String primary, List<BlockPart> elements, GuiPosition transform, String ... layers) {
this(null, elements, primary, false, false, transform, layers); this(null, elements, primary, false, false, transform, layers);
} }
private ModelBlock(ModelBlock parent, List<BlockPart> elements, String primary, boolean occlude, boolean gui3d, private ModelBlock(ModelBlock parent, List<BlockPart> elements, String primary, boolean occlude, boolean gui3d,
Transform transform, String[] layers) { GuiPosition transform, String[] layers) {
for(int z = 0; layers != null && z < layers.length; z++) { for(int z = 0; layers != null && z < layers.length; z++) {
layers[z] = layers[z].indexOf('/') == -1 ? "items/" + layers[z] : layers[z]; layers[z] = layers[z].indexOf('/') == -1 ? "items/" + layers[z] : layers[z];
} }
@ -166,7 +159,7 @@ public class ModelBlock extends Model {
return this.parent; return this.parent;
} }
public Transform getTransform() { public GuiPosition getTransform() {
return this.transform; return this.transform;
} }

View file

@ -8,6 +8,8 @@ import java.util.Set;
import client.renderer.texture.Sprite; import client.renderer.texture.Sprite;
import client.renderer.texture.TextureMap; import client.renderer.texture.TextureMap;
import common.block.Block; import common.block.Block;
import common.block.liquid.BlockDynamicLiquid;
import common.block.liquid.BlockLiquid;
import common.collect.Maps; import common.collect.Maps;
import common.init.BlockRegistry; import common.init.BlockRegistry;
import common.properties.Property; import common.properties.Property;
@ -74,11 +76,9 @@ public class ModelManager
Block block = state.getBlock(); Block block = state.getBlock();
IBakedModel model = this.getModelForState(state); IBakedModel model = this.getModelForState(state);
if (model == null || model == this.defaultModel) if ((model == null || model == this.defaultModel) && block.getMaterial().isLiquid())
{ {
String tex = block.getFallbackTexture(); return this.texMap.getAtlasSprite("blocks/" + BlockRegistry.getName(block instanceof BlockDynamicLiquid liquid ? liquid.getStaticBlock() : block) + "_still");
if(tex != null)
return this.texMap.getAtlasSprite("blocks/" + tex);
} }
if (model == null) if (model == null)

View file

@ -23,7 +23,7 @@ import common.item.ItemStack;
import common.item.WieldType; import common.item.WieldType;
import common.item.material.ItemArmor; import common.item.material.ItemArmor;
import common.item.material.ItemHorseArmor; import common.item.material.ItemHorseArmor;
import common.model.Transform; import common.model.GuiPosition;
import common.util.Facing; import common.util.Facing;
import common.util.Vec3i; import common.util.Vec3i;
@ -331,8 +331,8 @@ public class RenderItem
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
this.setupGuiTransform(x, y, ibakedmodel.isGui3d()); this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
Transform vec = ibakedmodel.getTransforms(); GuiPosition vec = ibakedmodel.getTransforms();
if(vec != Transform.IDENTITY) { if(vec != GuiPosition.NORMAL) {
GL11.glTranslatef(vec.translationX(), vec.translationY(), vec.translationZ()); GL11.glTranslatef(vec.translationX(), vec.translationY(), vec.translationZ());
GL11.glRotatef(vec.rotationY(), 0.0F, 1.0F, 0.0F); GL11.glRotatef(vec.rotationY(), 0.0F, 1.0F, 0.0F);
GL11.glRotatef(vec.rotationX(), 1.0F, 0.0F, 0.0F); GL11.glRotatef(vec.rotationX(), 1.0F, 0.0F, 0.0F);

View file

@ -7,7 +7,7 @@ import client.renderer.texture.TextureMap;
import common.entity.Entity; import common.entity.Entity;
import common.item.Item; import common.item.Item;
import common.item.ItemStack; import common.item.ItemStack;
import common.model.Transform; import common.model.GuiPosition;
public class RenderItemEntity<T extends Entity> extends Render<T> public class RenderItemEntity<T extends Entity> extends Render<T>

View file

@ -10,7 +10,7 @@ import common.entity.types.EntityLiving;
import common.init.Items; import common.init.Items;
import common.item.Item; import common.item.Item;
import common.item.ItemStack; import common.item.ItemStack;
import common.model.Transform; import common.model.GuiPosition;
public class LayerHeldItem implements LayerRenderer<EntityLiving> public class LayerHeldItem implements LayerRenderer<EntityLiving>
{ {

View file

@ -1,27 +0,0 @@
package client.renderer.texture;
import java.awt.image.BufferedImage;
import client.util.FileUtils;
import common.color.Colorizer;
public abstract class ColormapLoader {
private static final String GRASS_TEX = "textures/world/grass.png";
private static final String FOLIAGE_TEX = "textures/world/foliage.png";
public static void reload() {
BufferedImage img;
try {
img = TextureUtil.readImage(FileUtils.getResource(GRASS_TEX));
img.getRGB(0, 0, 256, 256, Colorizer.getGrassMap(), 0, 256);
}
catch(Exception e) {
}
try {
img = TextureUtil.readImage(FileUtils.getResource(FOLIAGE_TEX));
img.getRGB(0, 0, 256, 256, Colorizer.getFoliageMap(), 0, 256);
}
catch(Exception e) {
}
}
}

View file

@ -4,6 +4,7 @@ import java.awt.image.BufferedImage;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import client.renderer.texture.TextureTicked.TextureCreator;
import common.collect.Lists; import common.collect.Lists;
public class Sprite public class Sprite
@ -197,15 +198,10 @@ public class Sprite
} }
} }
public void loadSprite(Class<? extends TextureTicked> tex) public void loadSprite(TextureCreator tex)
{ {
this.resetSprite(); this.resetSprite();
try { this.tickedTexture = tex.create();
this.tickedTexture = tex.getConstructor().newInstance();
}
catch(Exception e) {
throw new RuntimeException(e);
}
this.height = this.width = this.tickedTexture.getSize(); this.height = this.width = this.tickedTexture.getSize();
int[] aint = new int[this.height * this.width]; int[] aint = new int[this.height * this.width];
this.framesTextureData.add(aint); this.framesTextureData.add(aint);

View file

@ -10,6 +10,7 @@ import java.util.Map.Entry;
import client.init.RenderRegistry; import client.init.RenderRegistry;
import client.renderer.GlState; import client.renderer.GlState;
import client.renderer.texture.TextureTicked.TextureCreator;
import client.util.FileUtils; import client.util.FileUtils;
import common.block.Block; import common.block.Block;
import common.collect.Lists; import common.collect.Lists;
@ -26,7 +27,7 @@ public class TextureMap extends Texture
private final List<Sprite> listAnimatedSprites; private final List<Sprite> listAnimatedSprites;
private final Map<String, Sprite> mapRegisteredSprites; private final Map<String, Sprite> mapRegisteredSprites;
private final Map<String, Sprite> mapUploadedSprites; private final Map<String, Sprite> mapUploadedSprites;
private final Map<String, Class<? extends TextureTicked>> tickedTextures; private final Map<String, TextureCreator> tickedTextures;
private final Map<String, Integer> animTextures; private final Map<String, Integer> animTextures;
private final Sprite missingImage; private final Sprite missingImage;
@ -35,11 +36,11 @@ public class TextureMap extends Texture
this.listAnimatedSprites = Lists.<Sprite>newArrayList(); this.listAnimatedSprites = Lists.<Sprite>newArrayList();
this.mapRegisteredSprites = Maps.<String, Sprite>newHashMap(); this.mapRegisteredSprites = Maps.<String, Sprite>newHashMap();
this.mapUploadedSprites = Maps.<String, Sprite>newHashMap(); this.mapUploadedSprites = Maps.<String, Sprite>newHashMap();
this.tickedTextures = Maps.<String, Class<? extends TextureTicked>>newHashMap(); this.tickedTextures = Maps.<String, TextureCreator>newHashMap();
this.animTextures = Maps.<String, Integer>newHashMap(); this.animTextures = Maps.<String, Integer>newHashMap();
this.missingImage = new Sprite(MISSING); this.missingImage = new Sprite(MISSING);
Map<String, Object> map = Maps.newHashMap(); Map<String, Object> map = Maps.newHashMap();
Map<TextureAnimation, Class<? extends TextureTicked>> anim = Maps.newHashMap(); Map<TextureAnimation, TextureCreator> anim = Maps.newHashMap();
RenderRegistry.registerAnimations(anim); RenderRegistry.registerAnimations(anim);
for(Block block : BlockRegistry.blocks()) { for(Block block : BlockRegistry.blocks()) {
block.getAnimatedTextures(map); block.getAnimatedTextures(map);
@ -49,7 +50,7 @@ public class TextureMap extends Texture
this.animTextures.put("blocks/" + entry.getKey(), (Integer)entry.getValue()); this.animTextures.put("blocks/" + entry.getKey(), (Integer)entry.getValue());
} }
else { else {
Class<? extends TextureTicked> clazz = anim.get((TextureAnimation)entry.getValue()); TextureCreator clazz = anim.get((TextureAnimation)entry.getValue());
if(clazz == null) if(clazz == null)
throw new RuntimeException("Animation '" + entry.getValue() + "' existiert nicht"); throw new RuntimeException("Animation '" + entry.getValue() + "' existiert nicht");
this.tickedTextures.put("blocks/" + entry.getKey(), clazz); this.tickedTextures.put("blocks/" + entry.getKey(), clazz);
@ -97,7 +98,7 @@ public class TextureMap extends Texture
try try
{ {
Class<? extends TextureTicked> animationmetadatasection = this.tickedTextures.get(textureatlassprite.getIconName()); TextureCreator animationmetadatasection = this.tickedTextures.get(textureatlassprite.getIconName());
if(animationmetadatasection != null) { if(animationmetadatasection != null) {
textureatlassprite.loadSprite(animationmetadatasection); textureatlassprite.loadSprite(animationmetadatasection);

View file

@ -1,6 +1,10 @@
package client.renderer.texture; package client.renderer.texture;
public abstract class TextureTicked { public abstract class TextureTicked {
public static interface TextureCreator {
TextureTicked create();
}
public abstract void renderStep(int[] data); public abstract void renderStep(int[] data);
public int getSize() { public int getSize() {

View file

@ -3,20 +3,22 @@ package client.renderer.ticked;
import client.renderer.texture.TextureTicked; import client.renderer.texture.TextureTicked;
public class TextureFlamesFX1 extends TextureTicked public class TextureFlame extends TextureTicked
{ {
private final boolean mono; private final int color;
public TextureFlamesFX1(boolean mono) public TextureFlame(int color, int pre)
{ {
field_1133_g = new float[320]; field_1133_g = new float[320];
field_1132_h = new float[320]; field_1132_h = new float[320];
this.mono = mono; this.color = color;
if(pre > 0) {
int[] tex = new int[256];
for(int z = 0; z < pre; z++) {
this.renderStep(tex);
}
}
} }
public TextureFlamesFX1() {
this(false);
}
public void renderStep(int textureData[]) public void renderStep(int textureData[])
{ {
@ -65,13 +67,13 @@ public class TextureFlamesFX1 extends TextureTicked
f = 0.0F; f = 0.0F;
} }
float f2 = f; float f2 = f;
int j1 = (int)(f2 * 155F + 100F); int r = (int)(f2 * 155F + 100F);
int l1 = (int)(f2 * f2 * 255F); int g = (int)(f2 * f2 * 255F);
int j2 = (int)(f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * 255F); int b = (int)(f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * 255F);
int c = 255; int a = 255;
if(f2 < 0.5F) if(f2 < 0.5F)
{ {
c = 0; a = 0;
} }
f2 = (f2 - 0.5F) * 2.0F; f2 = (f2 - 0.5F) * 2.0F;
// if(flag) // if(flag)
@ -83,13 +85,14 @@ public class TextureFlamesFX1 extends TextureTicked
// l1 = i3; // l1 = i3;
// j2 = j3; // j2 = j3;
// } // }
if(this.mono) { if(this.color != 0xffffffff) {
j2 = (j1 + l1 + j2) / 3; b = (r + g + b) / 3;
textureData[k] = (c << 24) | (j2 << 16) | (j2 << 8) | j2; r = (b * ((this.color >> 16) & 0xff)) / 255;
g = (b * ((this.color >> 8) & 0xff)) / 255;
b = (b * (this.color & 0xff)) / 255;
a = (a * ((this.color >> 24) & 0xff)) / 255;
} }
else { textureData[k] = (a << 24) | (r << 16) | (g << 8) | b;
textureData[k] = (c << 24) | (j1 << 16) | (l1 << 8) | j2;
}
} }
} }

View file

@ -1,17 +0,0 @@
package client.renderer.ticked;
public class TextureFlamesFX2 extends TextureFlamesFX1 {
public TextureFlamesFX2(boolean mono)
{
super(mono);
int[] tex = new int[256];
for(int z = 0; z < 160; z++) {
this.renderStep(tex);
}
}
public TextureFlamesFX2()
{
this(false);
}
}

View file

@ -1,7 +0,0 @@
package client.renderer.ticked;
public class TextureFlamesFXMono1 extends TextureFlamesFX1 {
public TextureFlamesFXMono1() {
super(true);
}
}

View file

@ -1,7 +0,0 @@
package client.renderer.ticked;
public class TextureFlamesFXMono2 extends TextureFlamesFX2 {
public TextureFlamesFXMono2() {
super(true);
}
}

View file

@ -3,10 +3,9 @@ package client.renderer.ticked;
import client.renderer.texture.TextureTicked; import client.renderer.texture.TextureTicked;
import common.util.ExtMath; import common.util.ExtMath;
public class TextureLavaFX extends TextureTicked public class TextureMagma extends TextureTicked
{ {
public TextureMagma()
public TextureLavaFX()
{ {
field_1147_g = new float[256]; field_1147_g = new float[256];
field_1146_h = new float[256]; field_1146_h = new float[256];

View file

@ -3,10 +3,9 @@ package client.renderer.ticked;
import client.renderer.texture.TextureTicked; import client.renderer.texture.TextureTicked;
import common.util.ExtMath; import common.util.ExtMath;
public class TextureLavaFlowFX extends TextureTicked public class TextureMagmaFlow extends TextureTicked
{ {
public TextureMagmaFlow()
public TextureLavaFlowFX()
{ {
field_1143_g = new float[256]; field_1143_g = new float[256];
field_1142_h = new float[256]; field_1142_h = new float[256];

View file

@ -3,11 +3,13 @@ package client.renderer.ticked;
import client.renderer.texture.TextureTicked; import client.renderer.texture.TextureTicked;
public class TextureWaterFX extends TextureTicked public class TextureWater extends TextureTicked
{ {
private final int color;
public TextureWaterFX() public TextureWater(int color)
{ {
this.color = color;
field_1158_g = new float[256]; field_1158_g = new float[256];
field_1157_h = new float[256]; field_1157_h = new float[256];
field_1156_i = new float[256]; field_1156_i = new float[256];
@ -72,15 +74,13 @@ public class TextureWaterFX extends TextureTicked
int g = (int)(50F + f2 * 64F); int g = (int)(50F + f2 * 64F);
int b = 255; int b = 255;
int a = (int)(146F + f2 * 50F); int a = (int)(146F + f2 * 50F);
// if(flag) if(this.color != 0xffffffff)
// { {
// int i3 = (l1 * 30 + j2 * 59 + k2 * 11) / 100; r = (r * ((this.color >> 16) & 0xff)) / 255;
// int j3 = (l1 * 30 + j2 * 70) / 100; g = (g * ((this.color >> 8) & 0xff)) / 255;
// int k3 = (l1 * 30 + k2 * 70) / 100; b = (b * (this.color & 0xff)) / 255;
// l1 = i3; a = (a * ((this.color >> 24) & 0xff)) / 255;
// j2 = j3; }
// k2 = k3;
// }
textureData[i1] = (a << 24) | (r << 16) | (g << 8) | b; textureData[i1] = (a << 24) | (r << 16) | (g << 8) | b;
} }

View file

@ -3,11 +3,13 @@ package client.renderer.ticked;
import client.renderer.texture.TextureTicked; import client.renderer.texture.TextureTicked;
public class TextureWaterFlowFX extends TextureTicked public class TextureWaterFlow extends TextureTicked
{ {
private final int color;
public TextureWaterFlowFX() public TextureWaterFlow(int color)
{ {
this.color = color;
field_1138_g = new float[256]; field_1138_g = new float[256];
field_1137_h = new float[256]; field_1137_h = new float[256];
field_1136_i = new float[256]; field_1136_i = new float[256];
@ -71,16 +73,14 @@ public class TextureWaterFlowFX extends TextureTicked
int r = (int)(32F + v * 32F); int r = (int)(32F + v * 32F);
int g = (int)(50F + v * 64F); int g = (int)(50F + v * 64F);
int b = 255; int b = 255;
int a = (int)(146F + v * 50F); int a = (int)(146F + v * 50F);
// if(flag) if(this.color != 0xffffffff)
// { {
// int i3 = (l1 * 30 + j2 * 59 + k2 * 11) / 100; r = (r * ((this.color >> 16) & 0xff)) / 255;
// int j3 = (l1 * 30 + j2 * 70) / 100; g = (g * ((this.color >> 8) & 0xff)) / 255;
// int k3 = (l1 * 30 + k2 * 70) / 100; b = (b * (this.color & 0xff)) / 255;
// l1 = i3; a = (a * ((this.color >> 24) & 0xff)) / 255;
// j2 = j3; }
// k2 = k3;
// }
textureData[(i1 & 0x0f) | ((i1 & 0xf0) * 2)] = textureData[((i1 & 0x0f) + 16) | ((i1 & 0xf0) * 2)] = textureData[(i1 & 0x0f) | ((i1 & 0xf0) * 2)] = textureData[((i1 & 0x0f) + 16) | ((i1 & 0xf0) * 2)] =
textureData[(i1 & 0x0f) | (((i1 & 0xf0) + 256) * 2)] = textureData[((i1 & 0x0f) + 16) | (((i1 & 0xf0) + 256) * 2)] = textureData[(i1 & 0x0f) | (((i1 & 0xf0) + 256) * 2)] = textureData[((i1 & 0x0f) + 16) | (((i1 & 0xf0) + 256) * 2)] =
(a << 24) | (r << 16) | (g << 8) | b; (a << 24) | (r << 16) | (g << 8) | b;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 B

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 4.7 KiB

Before After
Before After

BIN
client/src/main/resources/textures/blocks/grass_side.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Before After
Before After

BIN
client/src/main/resources/textures/blocks/iron_block.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 333 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 5.7 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 4.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 5.7 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 823 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 4.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 5 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

BIN
client/src/main/resources/textures/items/iron_ingot.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 191 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View file

@ -5,91 +5,88 @@ import java.util.Map;
import common.collect.Lists; import common.collect.Lists;
import common.collect.Maps; import common.collect.Maps;
import common.color.Colorizer;
import common.log.Log; import common.log.Log;
import common.rng.PerlinGen; import common.rng.PerlinGen;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Displayable; import common.util.Displayable;
import common.util.ExtMath;
import common.util.Identifyable; import common.util.Identifyable;
public enum Biome implements Identifyable, Displayable { public enum Biome implements Identifyable, Displayable {
NONE(0, "none", "<Keins>", 0x000000), NONE("none", "<Keins>", 0x000000),
PLAINS(1, "plains", "Ebene", 0x8db360, 12.0f, 40.0f), PLAIN("plain", "Ebene", 0x8db360, 12.0f, 40.0f),
DESERT(2, "desert", "Wüste", 0xfa9418, 60.0f, 0.0f), DESERT("desert", "Wüste", 0xfa9418, 60.0f, 0.0f),
EXTREMEHILLS(3, "extremeHills", "Extremes Bergland", 0x606060, -12.0f, 30.0f), HILLS("hills", "Bergland", 0x606060, -12.0f, 30.0f),
FOREST(4, "forest", "Wald", 0x056621, 8.0f, 80.0f), FOREST("forest", "Wald", 0x056621, 8.0f, 80.0f),
TAIGA(5, "taiga", "Taiga", 0x0b6659, -10.0f, 80.0f), TAIGA("taiga", "Taiga", 0x0b6659, -10.0f, 80.0f),
SWAMPLAND(6, "swampland", "Sumpf", 0x07f9b2, 12.0f, 90.0f, 0xe0ffae, 0xffffffff, 6975545), SWAMP("swamp", "Sumpf", 0x07f9b2, 12.0f, 90.0f),
RIVER(7, "river", "Fluss", 0x0000ff), RIVER("river", "Fluss", 0x0000ff),
EXTERMINATED(8, "exterminated", "Ausgelöscht", 0x000000, 150.0f, 0.0f, 0x202020, 0x303030, 0x303030), EXTERMINATED("exterminated", "Ausgelöscht", 0x000000, 150.0f, 0.0f),
SPACE(9, "space", "Leere des Weltraums", 0x000000, 0.0f, 0.0f), SPACE("space", "Leere des Weltraums", 0x000000, 0.0f, 0.0f),
FROZENSEA(10, "frozenSea", "Vereister See", 0x9090a0, -20.0f), ICE_SEA("ice_sea", "Vereister See", 0x9090a0, -20.0f),
FROZENRIVER(11, "frozenRiver", "Vereister Fluss", 0xa0a0ff, -20.0f), ICE_RIVER("ice_river", "Vereister Fluss", 0xa0a0ff, -20.0f),
ICEPLAINS(12, "icePlains", "Eisebene", 0xffffff, -20.0f), ICE("ice", "Eisebene", 0xffffff, -20.0f),
ICEMOUNTAINS(13, "iceMountains", "Vereistes Bergland", 0xa0a0a0, -20.0f), ICE_HILLS("ice_hills", "Vereistes Bergland", 0xa0a0a0, -20.0f),
MUSHROOMPLAINS(14, "mushroomPlains", "Pilzland", 0xff00ff, 16.0f, 100.0f), MUSHROOM("mushroom", "Pilzland", 0xff00ff, 16.0f, 100.0f),
BLACKENED(15, "blackened", "Schwarz", 0x000000, 0.0f, 0.0f, 0x000000, 0x303030, 0x303030), BLACKENED("blackened", "Schwarz", 0x000000, 0.0f, 0.0f),
BEACH(16, "beach", "Strand", 0xfade55, 12.0f, 40.0f), BEACH("beach", "Strand", 0xfade55, 12.0f, 40.0f),
DESERTHILLS(17, "desertHills", "Wüsten-Bergland", 0xd25f12, 60.0f, 0.0f), DESERT_HILLS("desert_hills", "Wüsten-Bergland", 0xd25f12, 60.0f, 0.0f),
FORESTHILLS(18, "forestHills", "Wald-Bergland", 0x22551c, 8.0f, 80.0f), FOREST_HILLS("forest_hills", "Wald-Bergland", 0x22551c, 8.0f, 80.0f),
TAIGAHILLS(19, "taigaHills", "Taiga-Bergland", 0x163933, -10.0f, 80.0f), TAIGA_HILLS("taiga_hills", "Taiga-Bergland", 0x163933, -10.0f, 80.0f),
EXTREMEHILLSEDGE(20, "extremeHillsEdge", "Extremes Bergland Gr.", 0x72789a, -12.0f, 30.0f), HILLS_EDGE("hills_edge", "Bergland-Grenze", 0x72789a, -12.0f, 30.0f),
JUNGLE(21, "jungle", "Urwald", 0x537b09, 18.0f, 90.0f), TROPIC("tropic", "Urwald", 0x537b09, 18.0f, 90.0f),
JUNGLEHILLS(22, "jungleHills", "Urwald-Bergland", 0x2c4205, 18.0f, 90.0f), TROPIC_HILLS("tropic_hills", "Urwald-Bergland", 0x2c4205, 18.0f, 90.0f),
JUNGLEEDGE(23, "jungleEdge", "Urwald Gr.", 0x628b17, 18.0f, 80.0f), TROPIC_EDGE("tropic_edge", "Urwald-Grenze", 0x628b17, 18.0f, 80.0f),
SEA(24, "sea", "See", 0x000070), SEA("sea", "See", 0x000070),
STONEBEACH(25, "stoneBeach", "Steinstrand", 0xa2a284, -12.0f, 30.0f), STONE_BEACH("stone_beach", "Steinstrand", 0xa2a284, -12.0f, 30.0f),
COLDBEACH(26, "coldBeach", "Vereister Strand", 0xfaf0c0, -18.0f, 30.0f), ICE_BEACH("ice_beach", "Vereister Strand", 0xfaf0c0, -18.0f, 30.0f),
BIRCHFOREST(27, "birchForest", "Birkenwald", 0x307444, 4.0f, 60.0f), BIRCH_FOREST("birch_forest", "Birkenwald", 0x307444, 4.0f, 60.0f),
BIRCHFORESTHILLS(28, "birchForestHills", "Birkenwald-Bergland", 0x1f5f32, 4.0f, 60.0f), BIRCH_HILLS("birch_hills", "Birken-Bergland", 0x1f5f32, 4.0f, 60.0f),
ROOFEDFOREST(29, "roofedForest", "Dichter Wald", 0x40511a, 8.0f, 80.0f), DARK_FOREST("dark_forest", "Dichter Wald", 0x40511a, 8.0f, 80.0f),
COLDTAIGA(30, "coldTaiga", "Vereiste Taiga", 0x31554a, -40.0f, 40.0f), ICE_TAIGA("ice_taiga", "Vereiste Taiga", 0x31554a, -40.0f, 40.0f),
COLDTAIGAHILLS(31, "coldTaigaHills", "Vereistes Taiga-Bergland", 0x243f36, -40.0f, 40.0f), ICE_TAIGA_HILLS("ice_taiga_hills", "Vereistes Taiga-Bergland", 0x243f36, -40.0f, 40.0f),
MEGATAIGA(32, "megaTaiga", "Hohe Taiga", 0x596651, -8.0f, 80.0f), LARGE_TAIGA("large_taiga", "Hohe Taiga", 0x596651, -8.0f, 80.0f),
MEGATAIGAHILLS(33, "megaTaigaHills", "Hohes Taiga-Bergland", 0x454f3e, -8.0f, 80.0f), LARGE_TAIGA_HILLS("large_taiga_hills", "Hohes Taiga-Bergland", 0x454f3e, -8.0f, 80.0f),
EXTREMEHILLSPLUS(34, "extremeHillsPlus", "Extremes Bergland +", 0x507050, -12.0f, 30.0f), LARGE_HILLS("large_hills", "Hohes Bergland", 0x507050, -12.0f, 30.0f),
SAVANNA(35, "savanna", "Savanne", 0xbdb25f, 28.0f, 0.0f), SAVANNA("savanna", "Savanne", 0xbdb25f, 28.0f, 0.0f),
SAVANNAPLATEAU(36, "savannaPlateau", "Savannen-Plateau", 0xa79d64, 20.0f, 0.0f), SAVANNA_PLATEAU("savanna_plateau", "Savannen-Plateau", 0xa79d64, 20.0f, 0.0f),
MESA(37, "mesa", "Mesa", 0xd94515, 0.0f, 0.0f, 0xffffff, 9470285, 10387789), MESA("mesa", "Mesa", 0xd94515, 0.0f, 0.0f),
MESAPLATEAUF(38, "mesaPlateauF", "Mesa-Waldplateau", 0xb09765, 0.0f, 0.0f, 0xffffff, 9470285, 10387789), MESA_FOREST("mesa_forest", "Mesa-Wald", 0xb09765, 0.0f, 0.0f),
MESAPLATEAU(39, "mesaPlateau", "Mesa-Plateau", 0xca8c65, 0.0f, 0.0f, 0xffffff, 9470285, 10387789), MESA_PLATEAU("mesa_plateau", "Mesa-Plateau", 0xca8c65, 0.0f, 0.0f),
SNOWLAND(40, "snowLand", "Eisland", 0xffffff, 0.0f, 100.0f), SNOW("snow", "Eisland", 0xffffff, 0.0f, 100.0f),
TIAN(41, "tian", "Tian", 0x808080, 0.0f, 80.0f), TIAN("tian", "Tian", 0x808080, 0.0f, 80.0f),
ELVENFOREST(42, "elvenForest", "Elbenwald", 0x059821, 8.0f, 90.0f), ELVEN_FOREST("elven_forest", "Elbenwald", 0x059821, 8.0f, 90.0f),
UPPERHELL(43, "upperHell", "Übergang in die Hölle", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000), UPPER_HELL("upper_hell", "Übergang in die Hölle", 0xff0000, 0.0f, 0.0f),
LOWERHELL(44, "lowerHell", "Abgrund der Hölle", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000), LOWER_HELL("lower_hell", "Abgrund der Hölle", 0xff0000, 0.0f, 0.0f),
HELLHILLS(45, "hellHills", "Bergland der Hölle", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000), HELL_HILLS("hell_hills", "Bergland der Hölle", 0xff0000, 0.0f, 0.0f),
SOULPLAINS(46, "soulPlains", "Seelenland", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000), SOUL_PLAINS("soul_plains", "Seelenland", 0xff0000, 0.0f, 0.0f),
ASHLAND(47, "ashLand", "Verbrannt", 0xff0000, 0.0f, 0.0f, 0x000000, 0x000000, 0x000000), ASH("ash", "Verbrannt", 0xff0000, 0.0f, 0.0f),
MOON(48, "moon", "Mondoberfläche", 0xa0a0a0, 0.0f, 0.0f), MOON("moon", "Mondoberfläche", 0xa0a0a0, 0.0f, 0.0f),
CHAOS(49, "chaos", "Chaos", 0xff00ff), CHAOS("chaos", "Chaos", 0xff00ff),
DESERTM(130, "desertM", "Wüste M", 0xfa9418, 60.0f, 0.0f), DESERT_MOD("desert_mod", "Wüste M", 0xfa9418, 60.0f, 0.0f),
EXTREMEHILLSM(131, "extremeHillsM", "Extremes Bergland M", 0x606060, -12.0f, 30.0f), HILLS_MOD("hills_mod", "Bergland M", 0x606060, -12.0f, 30.0f),
FLOWERFOREST(132, "flowerForest", "Blumenwald", 0x6a7425, 8.0f, 80.0f), FLOWER_FOREST("flower_forest", "Blumenwald", 0x6a7425, 8.0f, 80.0f),
TAIGAM(133, "taigaM", "Taiga M", 0x0b6659, -10.0f, 80.0f), TAIGA_MOD("taiga_mod", "Taiga M", 0x0b6659, -10.0f, 80.0f),
SWAMPLANDM(134, "swamplandM", "Sumpf M", 0x07f9b2, 12.0f, 90.0f, 0xe0ffae, 0xffffffff, 6975545), SWAMP_MOD("swamp_mod", "Sumpf M", 0x07f9b2, 12.0f, 90.0f),
ICEPLAINSSPIKES(140, "icePlainsSpikes", "Eisebene + Spitzen", 0xd2ffff, -20.0f), ICE_SPIKES("ice_spikes", "Eisebene mit Spitzen", 0xd2ffff, -20.0f),
JUNGLEM(149, "jungleM", "Urwald M", 0x537b09, 18.0f, 90.0f), TROPIC_MOD("tropic_mod", "Urwald M", 0x537b09, 18.0f, 90.0f),
JUNGLEEDGEM(151, "jungleEdgeM", "Urwald Gr. M", 0x628b17, 18.0f, 80.0f), TROPIC_EDGE_MOD("propic_edge_mod", "Urwald-Grenze M", 0x628b17, 18.0f, 80.0f),
BIRCHFORESTM(155, "birchForestM", "Birkenwald M", 0x307444, 4.0f, 60.0f), BIRCH_FOREST_MOD("birch_forest_mod", "Birkenwald M", 0x307444, 4.0f, 60.0f),
BIRCHFORESTHILLSM(156, "birchForestHillsM", "Birkenwald-Bergland M", 0x1f5f32, 4.0f, 60.0f), BIRCH_HILLS_MOD("birch_hills_mod", "Birken-Bergland M", 0x1f5f32, 4.0f, 60.0f),
ROOFEDFORESTM(157, "roofedForestM", "Dichter Wald M", 0x40511a, 8.0f, 80.0f), DARK_FOREST_MOD("dark_forest_mod", "Dichter Wald M", 0x40511a, 8.0f, 80.0f),
COLDTAIGAM(158, "coldTaigaM", "Vereiste Taiga M", 0x31554a, -40.0f, 40.0f), ICE_TAIGA_MOD("ice_taiga_mod", "Vereiste Taiga M", 0x31554a, -40.0f, 40.0f),
MEGASPRUCETAIGA(160, "megaSpruceTaiga", "Hohe Fichtentaiga", 0x596651, -10.0f, 80.0f), SPRUCE_TAIGA("spruce_taiga", "Fichtentaiga", 0x596651, -10.0f, 80.0f),
REDWOODTAIGAHILLSM(161, "redwoodTaigaHillsM", "Mammutbaumtaiga", 0x596651, -10.0f, 80.0f), REDWOOD_TAIGA("redwood_taiga", "Mammutbaumtaiga", 0x596651, -10.0f, 80.0f),
EXTREMEHILLSPLUSM(162, "extremeHillsPlusM", "Extremes Bergland + M", 0x507050, -12.0f, 30.0f), LARGE_HILLS_MOD("large_hills_mod", "Hohes Bergland M", 0x507050, -12.0f, 30.0f),
SAVANNAM(163, "savannaM", "Savanne M", 0xbdb25f, 24.0f, 0.0f), SAVANNA_MOD("savanna_mod", "Savanne M", 0xbdb25f, 24.0f, 0.0f),
SAVANNAPLATEAUM(164, "savannaPlateauM", "Savannen-Plateau M", 0xa79d64, 20.0f, 0.0f), SAVANNA_PLATEAU_MOD("savanna_plateau_mod", "Savannen-Plateau M", 0xa79d64, 20.0f, 0.0f),
MESABRYCE(165, "mesaBryce", "Mesa (Bryce)", 0xd94515, 0.0f, 0.0f, 0xffffff, 9470285, 10387789), MESA_PEAK("mesa_peak", "Mesa-Spitze", 0xd94515, 0.0f, 0.0f),
MESAPLATEAUFM(166, "mesaPlateauFM", "Mesa-Waldplateau M", 0xb09765, 0.0f, 0.0f, 0xffffff, 9470285, 10387789), MESA_FOREST_MOD("mesa_forest_mod", "Mesa-Wald M", 0xb09765, 0.0f, 0.0f),
MESAPLATEAUM(167, "mesaPlateauM", "Mesa-Plateau M", 0xca8c65, 0.0f, 0.0f, 0xffffff, 9470285, 10387789); MESA_PLATEAU_MOD("mesa_plateau_mod", "Mesa-Plateau M", 0xca8c65, 0.0f, 0.0f);
public static final Biome DEF_BIOME = FOREST; public static final Biome DEF_BIOME = FOREST;
private static final PerlinGen TEMP_NOISE = new PerlinGen(new Random(836430928262265276L), 1); private static final PerlinGen TEMP_NOISE = new PerlinGen(new Random(836430928262265276L), 1);
private static final PerlinGen COLOR_NOISE = new PerlinGen(new Random(6549321755809421L), 1);
private static final Biome[] BIOMES = new Biome[256]; private static final Biome[] BIOMES = new Biome[256];
private static final Map<String, Biome> LOOKUP = Maps.newTreeMap(); private static final Map<String, Biome> LOOKUP = Maps.newTreeMap();
@ -99,16 +96,13 @@ public enum Biome implements Identifyable, Displayable {
public final int color; public final int color;
public final float temperature; public final float temperature;
public final float humidity; public final float humidity;
public final int waterColor;
public final int grassColor;
public final int foliageColor;
static { static {
for(Biome biome : values()) { for(Biome biome : values()) {
BIOMES[biome.id] = biome; BIOMES[biome.id] = biome;
if(LOOKUP.containsKey(biome.name.toLowerCase())) if(LOOKUP.containsKey(biome.name))
throw new IllegalStateException("Biom \"" + biome.name + "\" ist als ID " + LOOKUP.get(biome.name.toLowerCase()).id + " und " + biome.id + " definiert"); throw new IllegalStateException("Biom \"" + biome.name + "\" ist als ID " + LOOKUP.get(biome.name).id + " und " + biome.id + " definiert");
LOOKUP.put(biome.name.toLowerCase(), biome); LOOKUP.put(biome.name, biome);
} }
} }
@ -158,28 +152,21 @@ public enum Biome implements Identifyable, Displayable {
return biome; return biome;
} }
private Biome(int id, String name, String display, int color, float temperature, float humidity, int waterColor, int grassColor, int foliageColor) { private Biome(String name, String display, int color, float temperature, float humidity) {
this.id = id; this.id = this.ordinal();
this.name = name; this.name = name;
this.display = display; this.display = display;
this.temperature = temperature; this.temperature = temperature;
this.humidity = humidity; this.humidity = humidity;
this.color = color; this.color = color;
this.waterColor = waterColor;
this.grassColor = grassColor;
this.foliageColor = foliageColor;
} }
private Biome(int id, String name, String display, int color, float temperature, float humidity) { private Biome(String name, String display, int color, float temperature) {
this(id, name, display, color, temperature, humidity, 0xffffff, 0xffffffff, 0xffffffff); this(name, display, color, temperature, 50.0f);
} }
private Biome(int id, String name, String display, int color, float temperature) { private Biome(String name, String display, int color) {
this(id, name, display, color, temperature, 50.0f, 0xffffff, 0xffffffff, 0xffffffff); this(name, display, color, 0.0f, 50.0f);
}
private Biome(int id, String name, String display, int color) {
this(id, name, display, color, 0.0f, 50.0f, 0xffffff, 0xffffffff, 0xffffffff);
} }
public final float getTemperature(BlockPos pos) { public final float getTemperature(BlockPos pos) {
@ -195,37 +182,9 @@ public enum Biome implements Identifyable, Displayable {
return f > 1.0f ? 1.0f : f; return f > 1.0f ? 1.0f : f;
} }
public boolean isHighHumidity() {
return this.humidity > 85.0f;
}
// skycolor = ((temp + 14) / 40 + 0.15) / 3 // skycolor = ((temp + 14) / 40 + 0.15) / 3
public int getGrassColorAtPos(BlockPos pos) { public String getName() {
if(this.grassColor != 0xffffffff)
return this.grassColor;
if(this == SWAMPLAND || this == SWAMPLANDM) {
double d0 = COLOR_NOISE.generate((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return d0 < -0.1D ? 5011004 : 6975545;
}
if(this == ELVENFOREST)
return Colorizer.getGrassColor(1.0f, this.humidity * 0.01f);
double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return this == ROOFEDFOREST || this == ROOFEDFORESTM ? (Colorizer.getGrassColor(d0, d1) & 16711422) + 2634762 >> 1 : Colorizer.getGrassColor(d0, d1);
}
public int getFoliageColorAtPos(BlockPos pos) {
if(this.foliageColor != 0xffffffff)
return this.foliageColor;
if(this == ELVENFOREST)
return Colorizer.getFoliageColor(1.0f, this.humidity * 0.01f);
double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return Colorizer.getFoliageColor(d0, d1);
}
public String getName() {
return this.name; return this.name;
} }

View file

@ -15,6 +15,7 @@ import java.util.function.Function;
import common.attributes.Attribute; import common.attributes.Attribute;
import common.attributes.UsageSlot; import common.attributes.UsageSlot;
import common.biome.Biome;
import common.block.artificial.BlockSlab; import common.block.artificial.BlockSlab;
import common.block.natural.BlockSnow; import common.block.natural.BlockSnow;
import common.collect.ImmutableList; import common.collect.ImmutableList;
@ -39,7 +40,7 @@ import common.item.StackSize;
import common.model.BlockLayer; import common.model.BlockLayer;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.Transform; import common.model.GuiPosition;
import common.properties.Property; import common.properties.Property;
import common.rng.Random; import common.rng.Random;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
@ -1033,14 +1034,14 @@ public class Block {
} }
return light; return light;
} }
public BlockLayer getRenderLayer() {
return BlockLayer.SOLID;
}
public int getRenderType() { public int getRenderType() {
return 3; return 3;
} }
public BlockLayer getRenderLayer() {
return BlockLayer.SOLID;
}
public boolean isXrayVisible() { public boolean isXrayVisible() {
return false; return false;
@ -1053,41 +1054,18 @@ public class Block {
public void getAnimatedTextures(Map<String, Object> map) { public void getAnimatedTextures(Map<String, Object> map) {
} }
public int getRenderColor(State state) {
return 16777215;
}
public int colorMultiplier(IWorldAccess world, BlockPos pos, int pass) {
return 16777215;
}
public State getEntityState(State state) {
return state;
}
public Model getModel(ModelProvider provider, String name, State state) { public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel(name).add().all(); return provider.getModel(name).add().all();
} }
public String getFallbackTexture() {
return null;
}
public void setItemBounds() {
}
public Transform getTransform() { public GuiPosition getItemPosition() {
return Transform.IDENTITY; return GuiPosition.NORMAL;
} }
public State getItemState() { public State getItemState() {
return this.getState(); return this.getState();
} }
public boolean isItemColored() {
return false;
}
public TextColor getItemColor() { public TextColor getItemColor() {
return this.radiation > 0.0f ? TextColor.GREEN : null; return this.radiation > 0.0f ? TextColor.GREEN : null;
} }

View file

@ -102,16 +102,6 @@ public class BlockCake extends Block
this.setBlockBounds(f1, 0.0F, f, 1.0F - f, f2, 1.0F - f); this.setBlockBounds(f1, 0.0F, f, 1.0F - f, f2, 1.0F - f);
} }
/**
* Sets the block's bounds for rendering it as an item
*/
public void setItemBounds()
{
float f = 0.0625F;
float f1 = 0.5F;
this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f);
}
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state) public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
{ {
float f = 0.0625F; float f = 0.0625F;

Some files were not shown because too many files have changed in this diff Show more