1
0
Fork 0

improve visuals

This commit is contained in:
Sen 2025-08-29 20:23:26 +02:00
parent 31bdece813
commit c6217bf106
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
36 changed files with 23 additions and 119 deletions

View file

@ -722,6 +722,8 @@ public class Client implements IThreadListener {
private MipmapType mipmapType = MipmapType.LINEAR;
@Variable(name = "gl_tex_filter", category = CVarCategory.RENDER, display = "Texturfilterung", callback = TextureBoolFunction.class)
private boolean textureFiltering = true;
@Variable(name = "gl_specular", category = CVarCategory.RENDER, display = "Beleuchtungseffekte")
public boolean specularColors = true;
public static final Client CLIENT = new Client();

View file

@ -28,6 +28,7 @@ public class GuiGraphics extends GuiOptions {
this.addSelector("gl_dynlight_maxdist", 242, 200, 240, 0);
this.addSelector("gl_light_blend", 0, 220, 240, 0);
this.addSelector("gl_specular", 242, 220, 240, 0);
this.addSelector("gl_tex_filter", 0, 240, 240, 0);
this.addSelector("gl_tex_mipmaps", 242, 240, 240, 0);

View file

@ -1179,7 +1179,6 @@ public class Renderer {
GlState.enableAlpha();
GlState.alphaFunc(GL46.GL_GREATER, 0.5F);
boolean flag = this.gm.getRenderViewEntity() != null && this.gm.getRenderViewEntity().isPlayer();
GlState.enableCull();
this.updateFogColor(partialTicks);
GL46.glClear(16640);
@ -1235,26 +1234,9 @@ public class Renderer {
GL46.glPopMatrix();
GL46.glPushMatrix();
if (this.gm.pointed != null && entity.isInsideOfLiquid() && flag)
{
EntityNPC entityplayer = (EntityNPC)entity;
GlState.disableAlpha();
this.drawSelectionBox(entityplayer, this.gm.pointed, partialTicks);
GlState.enableAlpha();
}
// }
GL46.glMatrixMode(GL46.GL_MODELVIEW);
GL46.glPopMatrix();
if (flag && this.gm.pointed != null && !entity.isInsideOfLiquid())
{
EntityNPC entityplayer1 = (EntityNPC)entity;
GlState.disableAlpha();
this.drawSelectionBox(entityplayer1, this.gm.pointed, partialTicks);
GlState.enableAlpha();
}
// GlState.enableBlend();
GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ONE, GL46.GL_ZERO);
GlState.disableBlend();
@ -2599,7 +2581,7 @@ public class Renderer {
break;
}
}
context.bool("sky_light", this.theWorld.dimension.hasSkyLight() && !this.gm.setGamma);
context.bool("sky_light", this.theWorld.dimension.hasSkyLight() && !this.gm.setGamma && !this.gm.xrayActive);
context.bool("moon_light", moon);
for (RenderChunk renderchunk : this.renderChunks)
{
@ -3091,40 +3073,6 @@ public class Renderer {
}
}
/**
* Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime
*
* @param execute If equals to 0 the method is executed
*/
private void drawSelectionBox(EntityNPC player, HitPosition movingObjectPositionIn, float partialTicks)
{
if (movingObjectPositionIn.type == HitPosition.ObjectType.BLOCK)
{
GlState.enableBlend();
GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO);
GlState.color(0.0F, 0.0F, 0.0F, 0.4F);
GL46.glLineWidth(2.0F);
GlState.disableTexture2D();
GlState.depthMask(false);
float f = 0.002F;
BlockPos blockpos = movingObjectPositionIn.block;
Block block = this.theWorld.getState(blockpos).getBlock();
if (block != Blocks.air) // && this.theWorld.getWorldBorder().contains(blockpos))
{
block.setBlockBounds(this.theWorld, blockpos);
double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTicks;
double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTicks;
double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTicks;
drawSelectionBoundingBox(block.getSelectionBox(this.theWorld, blockpos).expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D).offset(-d0, -d1, -d2));
}
GlState.depthMask(true);
GlState.enableTexture2D();
GlState.disableBlend();
}
}
public static void drawSelectionBoundingBox(BoundingBox boundingBox)
{
// Tessellator tessellator = Tessellator.getInstance();
@ -3333,8 +3281,8 @@ public class Renderer {
if(block == Blocks.air)
return false;
else if(block.getMaterial().isLiquid())
return this.renderFluid(world, state, pos, rb);
else if(block.isNonBlock())
return !this.gm.xrayActive && this.renderFluid(world, state, pos, rb);
else if(block.isNonBlock() && !this.gm.xrayActive)
return this.renderDynamic(world, state, pos, rb);
State mstate = state;
if(!this.gm.debugWorld) {

View file

@ -56,7 +56,7 @@ public enum Shader {
context.vec("max_cam_dist", Client.CLIENT.lightDistCam);
context.integer("n_lights", 0);
context.color3("specular", 0xffffff);
context.color3("specular", Client.CLIENT.specularColors && !Client.CLIENT.setGamma && !Client.CLIENT.xrayActive ? 0xffffff : 0x000000);
GlState.setActiveTexture(GL46.GL_TEXTURE0);
// glBindBufferBase(GL_UNIFORM_BUFFER, 0, world->light_buf);

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

View file

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 496 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 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: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 103 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

View file

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

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: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -1054,12 +1054,6 @@ public class Block {
: !world.getState(pos).getBlock().isOpaqueCube() && (!this.isNonBlock() || !world.getState(pos).getBlock().isNonBlock() || !world.getState(pos).getBlock().isVisuallyOpaque()))))));
}
@Clientside
public BoundingBox getSelectionBox(World world, BlockPos pos) {
return new BoundingBox((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ,
(double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ);
}
@Clientside
public boolean isXrayVisible() {
return false;

View file

@ -94,12 +94,6 @@ public class BlockDoor extends Block implements Rotatable {
return false;
}
@Clientside
public BoundingBox getSelectionBox(World world, BlockPos pos) {
this.setBlockBounds(world, pos);
return super.getSelectionBox(world, pos);
}
public BoundingBox getCollisionBox(World world, BlockPos pos, State state) {
this.setBlockBounds(world, pos);
return super.getCollisionBox(world, pos, state);

View file

@ -33,12 +33,6 @@ public class BlockLadder extends Block implements Rotatable
return super.getCollisionBox(worldIn, pos, state);
}
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
{
this.setBlockBounds(worldIn, pos);
return super.getSelectionBox(worldIn, pos);
}
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
{
State iblockstate = worldIn.getState(pos);

View file

@ -67,12 +67,6 @@ public class BlockTrapDoor extends Block implements Rotatable
return !((Boolean)worldIn.getState(pos).getValue(OPEN)).booleanValue();
}
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
{
this.setBlockBounds(worldIn, pos);
return super.getSelectionBox(worldIn, pos);
}
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
{
this.setBlockBounds(worldIn, pos);

View file

@ -69,12 +69,6 @@ public class BlockCactus extends Block
return new BoundingBox((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)((float)(pos.getY() + 1) - f), (double)((float)(pos.getZ() + 1) - f));
}
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
{
float f = 0.0625F;
return new BoundingBox((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)(pos.getY() + 1), (double)((float)(pos.getZ() + 1) - f));
}
public boolean isFullCube()
{
return false;

View file

@ -25,7 +25,7 @@ public class BlockSnowable extends BlockNonBlock {
}
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
if(this.snowy ? !worldIn.canFreezeAt(pos) : worldIn.isRaining() && worldIn.canFreezeAt(pos) && worldIn.getPrecipitationHeight(pos).getY() - 1 <= pos.getY())
if(this.snowy ? !worldIn.canFreezeAt(pos) : (worldIn.isRaining() || !worldIn.dimension.hasWeather()) && worldIn.canFreezeAt(pos) && worldIn.getPrecipitationHeight(pos).getY() - 1 <= pos.getY())
worldIn.setState(pos, this.other.getState());
}
}

View file

@ -324,11 +324,6 @@ public abstract class BlockLiquid extends Block
{
return new Property[] {LEVEL};
}
public boolean isXrayVisible()
{
return true;
}
protected boolean hasRegisteredItem() {
return false;

View file

@ -8,7 +8,7 @@ import common.item.Item;
import common.rng.Random;
import common.world.State;
public class BlockObsidian extends Block
public class BlockObsidian extends BlockNonBlock
{
public BlockObsidian()
{
@ -16,13 +16,13 @@ public class BlockObsidian extends Block
this.setTab(CheatTab.ROCK);
}
/**
* Get the Item that this Block should drop when harvested.
*/
public Item getDrop(State state, Random rand, int fortune)
{
return Items.obsidian;
}
// /**
// * Get the Item that this Block should drop when harvested.
// */
// public Item getDrop(State state, Random rand, int fortune)
// {
// return Items.obsidian;
// }
// /**
// * Get the MapColor for this Block and the given BlockState

View file

@ -80,12 +80,6 @@ public abstract class BlockDisplay extends Block implements Rotatable
return super.getCollisionBox(worldIn, pos, state);
}
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
{
this.setBlockBounds(worldIn, pos);
return super.getSelectionBox(worldIn, pos);
}
public boolean isFullCube()
{
return false;

View file

@ -50,12 +50,6 @@ public class BlockSign extends Block implements ITileEntityProvider, Rotatable
return null;
}
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
{
this.setBlockBounds(worldIn, pos);
return super.getSelectionBox(worldIn, pos);
}
public boolean isFullCube()
{
return false;

View file

@ -221,28 +221,28 @@ public abstract class BlockRegistry {
BlockSnowable podzol;
register("podzol", (podzol = new BlockPodzol(false)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Podsol").setMiningTool(Equipment.SHOVEL));
BlockSnowable snowy_podzol;
register("snowy_podzol", (snowy_podzol = new BlockPodzol(true).setOther(podzol)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Podsol").setMiningTool(Equipment.SHOVEL));
register("snowy_podzol", (snowy_podzol = new BlockPodzol(true).setOther(podzol)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Beschneiter Podsol").setMiningTool(Equipment.SHOVEL));
BlockSnowable mycelium;
register("mycelium", (mycelium = new BlockMycelium(false)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Myzel").setMiningTool(Equipment.SHOVEL));
BlockSnowable snowy_mycelium;
register("snowy_mycelium", (snowy_mycelium = new BlockMycelium(true).setOther(mycelium)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Myzel").setMiningTool(Equipment.SHOVEL));
register("snowy_mycelium", (snowy_mycelium = new BlockMycelium(true).setOther(mycelium)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Beschneites Myzel").setMiningTool(Equipment.SHOVEL));
BlockSnowable swamp;
register("swamp", (swamp = new BlockSwamp(false)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Sumpf").setMiningTool(Equipment.SHOVEL));
BlockSnowable snowy_swamp;
register("snowy_swamp", (snowy_swamp = new BlockSwamp(true).setOther(swamp)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Sumpf").setMiningTool(Equipment.SHOVEL));
register("snowy_swamp", (snowy_swamp = new BlockSwamp(true).setOther(swamp)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Beschneiter Sumpf").setMiningTool(Equipment.SHOVEL));
Block tian;
register("tian", (tian = new BlockNonBlock(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE)
.setDisplay("Tian").setTab(CheatTab.NATURE));
BlockSnowable tian_soil;
register("tian_soil", (tian_soil = new BlockTianSoil(false)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Tianerde").setTab(CheatTab.NATURE));
BlockSnowable snowy_tian_soil;
register("snowy_tian_soil", (snowy_tian_soil = new BlockTianSoil(true).setOther(tian_soil)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Tianerde").setTab(CheatTab.NATURE));
register("snowy_tian_soil", (snowy_tian_soil = new BlockTianSoil(true).setOther(tian_soil)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Beschneite Tianerde").setTab(CheatTab.NATURE));
Block blackened_dirt;
register("blackened_dirt", (blackened_dirt = new BlockBlackenedDirt()).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Schwarzerde").setMiningTool(Equipment.SHOVEL));
BlockSnowable blackened_soil;
register("blackened_soil", (blackened_soil = new BlockBlackenedSoil(false)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Schwarzgrund").setMiningTool(Equipment.SHOVEL));
BlockSnowable snowy_blackened_soil;
register("snowy_blackened_soil", (snowy_blackened_soil = new BlockBlackenedSoil(true).setOther(blackened_soil)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Schwarzgrund").setMiningTool(Equipment.SHOVEL));
register("snowy_blackened_soil", (snowy_blackened_soil = new BlockBlackenedSoil(true).setOther(blackened_soil)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Beschneiter Schwarzgrund").setMiningTool(Equipment.SHOVEL));
Block slime_block;
register("slime_block", (slime_block = new BlockSlime()).setDisplay("Schleimblock").setSound(SoundType.SLIME));
Block cheese;

View file

@ -27,9 +27,9 @@ public class CommandEpoch extends Command {
throw new RunException("'%s' ist keine gültige Zahl", input);
}
if(num < 0)
throw new RunException("Die Zeit muss mindestens 0 betragen", num);
throw new RunException("Die Zeit muss mindestens 0 betragen");
else if(num > max)
throw new RunException("Die Zeit darf höchstens %d betragen", num, max);
throw new RunException("Die Zeit darf höchstens %d betragen", max);
return num;
}