1
0
Fork 0

remove translucency

This commit is contained in:
Sen 2025-08-27 21:38:51 +02:00
parent 259bcab1fd
commit 8678351810
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
18 changed files with 44 additions and 58 deletions

View file

@ -170,7 +170,7 @@ public class RenderChunk
if (block != Blocks.air) if (block != Blocks.air)
{ {
BlockLayer layer = block.hasTransparency() ? (block.getMaterial().isLiquid() ? BlockLayer.TRANSLUCENT : BlockLayer.CUTOUT) : BlockLayer.SOLID; BlockLayer layer = block.hasTransparency() ? BlockLayer.CUTOUT : BlockLayer.SOLID;
int idx = layer.ordinal(); int idx = layer.ordinal();
RenderBuffer worldrenderer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayerId(idx); RenderBuffer worldrenderer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayerId(idx);

View file

@ -81,7 +81,10 @@ public class TextureWater extends TextureTicked
b = (b * (this.color & 0xff)) / 255; b = (b * (this.color & 0xff)) / 255;
a = (a * ((this.color >> 24) & 0xff)) / 255; a = (a * ((this.color >> 24) & 0xff)) / 255;
} }
textureData[i1] = (a << 24) | (r << 16) | (g << 8) | b; r = (r * a) / 255;
g = (g * a) / 255;
b = (b * a) / 255;
textureData[i1] = 0xff000000 | (r << 16) | (g << 8) | b;
} }
} }

View file

@ -80,10 +80,13 @@ public class TextureWaterFlow extends TextureTicked
g = (g * ((this.color >> 8) & 0xff)) / 255; g = (g * ((this.color >> 8) & 0xff)) / 255;
b = (b * (this.color & 0xff)) / 255; b = (b * (this.color & 0xff)) / 255;
a = (a * ((this.color >> 24) & 0xff)) / 255; a = (a * ((this.color >> 24) & 0xff)) / 255;
} }
r = (r * a) / 255;
g = (g * a) / 255;
b = (b * a) / 255;
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; 0xff000000 | (r << 16) | (g << 8) | b;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 320 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

View file

@ -19,14 +19,12 @@ import common.world.AWorldServer;
public class BlockDynamicLiquid extends BlockLiquid public class BlockDynamicLiquid extends BlockLiquid
{ {
private final boolean infinite;
int adjacentSourceBlocks; int adjacentSourceBlocks;
private BlockStaticLiquid staticBlock; private BlockStaticLiquid staticBlock;
public BlockDynamicLiquid(Material materialIn, boolean infinite, boolean opaque, int rate, Object animation) public BlockDynamicLiquid(Material materialIn, int rate, Object animation)
{ {
super(materialIn, true, opaque, rate, animation); super(materialIn, true, rate, animation);
this.infinite = infinite;
} }
void setStaticBlock(BlockStaticLiquid block) { void setStaticBlock(BlockStaticLiquid block) {
@ -89,8 +87,8 @@ public class BlockDynamicLiquid extends BlockLiquid
if (this.adjacentSourceBlocks >= 2 && ((Vars.mergeWater && this.material == Material.WATER) if (this.adjacentSourceBlocks >= 2 && ((Vars.mergeWater && this.material == Material.WATER)
|| (Vars.mergeLava && this.material == Material.LAVA) || (Vars.mergeLava && this.material == Material.LAVA)
|| (this.infinite && Vars.mergeInfinite && this.material != Material.WATER && this.material != Material.LAVA) || (Vars.mergeCold && this.material == Material.COLD)
|| (!this.infinite && Vars.mergeFinite && this.material != Material.WATER && this.material != Material.LAVA))) || (Vars.mergeHot && this.material == Material.HOT)))
{ {
State iblockstate1 = worldIn.getState(pos.down()); State iblockstate1 = worldIn.getState(pos.down());

View file

@ -14,7 +14,6 @@ import common.properties.PropertyInteger;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.Clientside;
import common.util.ExtMath; import common.util.ExtMath;
import common.util.Facing; import common.util.Facing;
import common.util.Pair; import common.util.Pair;
@ -32,18 +31,16 @@ public abstract class BlockLiquid extends Block
public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 15); public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 15);
public static final List<Pair<BlockStaticLiquid, BlockDynamicLiquid>> LIQUIDS = Lists.newArrayList(); public static final List<Pair<BlockStaticLiquid, BlockDynamicLiquid>> LIQUIDS = Lists.newArrayList();
protected final boolean opaque;
protected final int flowRate; protected final int flowRate;
protected final Object animation; protected final Object animation;
public BlockLiquid(Material materialIn, boolean tick, boolean opaque, int rate, Object animation) public BlockLiquid(Material materialIn, boolean tick, int rate, Object animation)
{ {
super(materialIn); super(materialIn);
this.setDefaultState(this.getBaseState().withProperty(LEVEL, Integer.valueOf(0))); this.setDefaultState(this.getBaseState().withProperty(LEVEL, Integer.valueOf(0)));
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
if(tick) if(tick)
this.setTicked(); this.setTicked();
this.opaque = opaque;
this.flowRate = rate; this.flowRate = rate;
this.animation = animation; this.animation = animation;
} }
@ -212,11 +209,6 @@ public abstract class BlockLiquid extends Block
return this.flowRate >= 0 ? this.flowRate : (worldIn.isLavaFaster(pos) ? (-this.flowRate / 3) : (-this.flowRate)); return this.flowRate >= 0 ? this.flowRate : (worldIn.isLavaFaster(pos) ? (-this.flowRate / 3) : (-this.flowRate));
} }
@Clientside
public boolean hasTransparency() {
return !this.opaque;
}
public void displayTick(World worldIn, BlockPos pos, State state, Random rand) public void displayTick(World worldIn, BlockPos pos, State state, Random rand)
{ {
double d0 = (double)pos.getX(); double d0 = (double)pos.getX();

View file

@ -19,9 +19,9 @@ public class BlockStaticLiquid extends BlockLiquid
{ {
private final BlockDynamicLiquid dynamicBlock; private final BlockDynamicLiquid dynamicBlock;
public BlockStaticLiquid(Material materialIn, boolean opaque, int rate, Object animation, BlockDynamicLiquid flowing) public BlockStaticLiquid(Material materialIn, int rate, Object animation, BlockDynamicLiquid flowing)
{ {
super(materialIn, materialIn == Material.LAVA, opaque, rate, animation); super(materialIn, materialIn == Material.LAVA, rate, animation);
this.dynamicBlock = flowing; this.dynamicBlock = flowing;
flowing.setStaticBlock(this); flowing.setStaticBlock(this);
LIQUIDS.add(new Pair<BlockStaticLiquid, BlockDynamicLiquid>(this, flowing)); LIQUIDS.add(new Pair<BlockStaticLiquid, BlockDynamicLiquid>(this, flowing));

View file

@ -9,7 +9,6 @@ import common.item.CheatTab;
import common.rng.Random; import common.rng.Random;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Clientside;
import common.util.Facing; import common.util.Facing;
import common.vars.Vars; import common.vars.Vars;
import common.world.LightType; import common.world.LightType;
@ -20,21 +19,12 @@ import common.world.IWorldAccess;
public class BlockIce extends Block { public class BlockIce extends Block {
public BlockIce() { public BlockIce() {
super(Material.TRANSLUCENT); super(Material.LOOSE);
this.setSlipperiness(0.98F); this.setSlipperiness(0.98F);
this.setTicked(); this.setTicked();
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.NATURE);
} }
public boolean isOpaqueCube() {
return false;
}
@Clientside
public boolean hasTransparency() {
return true;
}
public boolean canRender(IWorldAccess world, BlockPos pos, Facing side) { public boolean canRender(IWorldAccess world, BlockPos pos, Facing side) {
State state = world.getState(pos); State state = world.getState(pos);
Block block = state.getBlock(); Block block = state.getBlock();

View file

@ -115,13 +115,13 @@ public abstract class BlockRegistry {
return STATES; return STATES;
} }
private static void registerFluid(String name, String display, boolean infinite, LiquidType type, boolean opaque, int light, int rate, private static void registerFluid(String name, String display, LiquidType type, int light, int rate,
float radiation, Object still, Object flowing) { float radiation, Object still, Object flowing) {
BlockDynamicLiquid dy = (BlockDynamicLiquid)(new BlockDynamicLiquid(type.material, infinite, opaque, rate, flowing)).setHardness(100.0F) BlockDynamicLiquid dy = (BlockDynamicLiquid)(new BlockDynamicLiquid(type.material, rate, flowing)).setHardness(100.0F)
.setOpacity(opaque ? 0 : 3).setLight((float)light / 15.0f).setDisplay(display) .setLight((float)light / 15.0f).setDisplay(display)
.setRadiation(radiation); .setRadiation(radiation);
BlockStaticLiquid st = (BlockStaticLiquid)(new BlockStaticLiquid(type.material, opaque, rate, still, dy)).setHardness(100.0F) BlockStaticLiquid st = (BlockStaticLiquid)(new BlockStaticLiquid(type.material, rate, still, dy)).setHardness(100.0F)
.setOpacity(opaque ? 0 : 3).setLight((float)light / 15.0f).setDisplay(display) .setLight((float)light / 15.0f).setDisplay(display)
.setRadiation(radiation); .setRadiation(radiation);
register("flowing_" + name, dy); register("flowing_" + name, dy);
register(name, st); register(name, st);
@ -176,20 +176,20 @@ public abstract class BlockRegistry {
.setDisplay("Schwarzbruchstein").setTab(CheatTab.ROCK)); .setDisplay("Schwarzbruchstein").setTab(CheatTab.ROCK));
registerFluid("water", "Wasser", true, LiquidType.WATER, false, 0, 5, 0.0f, TextureAnimation.WATER_STILL, TextureAnimation.WATER_FLOW); registerFluid("water", "Wasser", LiquidType.WATER, 0, 5, 0.0f, TextureAnimation.WATER_STILL, TextureAnimation.WATER_FLOW);
registerFluid("lava", "Lava", false, LiquidType.LAVA, true, 15, -30, 0.0f, 2, 3); registerFluid("lava", "Lava", LiquidType.LAVA, 15, -30, 0.0f, 2, 3);
registerFluid("magma", "Magma", false, LiquidType.HOT, true, 15, 40, 0.0f, TextureAnimation.MAGMA_STILL, TextureAnimation.MAGMA_FLOW); registerFluid("magma", "Magma", LiquidType.HOT, 15, 40, 0.0f, TextureAnimation.MAGMA_STILL, TextureAnimation.MAGMA_FLOW);
registerFluid("plasma", "Plasma", false, LiquidType.HOT, false, 15, 15, 0.0f, 2, 2); registerFluid("plasma", "Plasma", LiquidType.HOT, 15, 15, 0.0f, 2, 2);
registerFluid("mercury", "Quecksilber", false, LiquidType.COLD, true, 0, 40, 0.0f, 8, 4); registerFluid("mercury", "Quecksilber", LiquidType.COLD, 0, 40, 0.0f, 8, 4);
registerFluid("hydrogen", "Wasserstoff", false, LiquidType.COLD, true, 0, 50, 0.0f, 8, 4); registerFluid("hydrogen", "Wasserstoff", LiquidType.COLD, 0, 50, 0.0f, 8, 4);
registerFluid("acid", "Säure", false, LiquidType.HOT, false, 0, 5, 0.0f, 1, 1); registerFluid("acid", "Säure", LiquidType.HOT, 0, 5, 0.0f, 1, 1);
registerFluid("slime", "Schleim", false, LiquidType.COLD, true, 0, 50, 0.0f, 8, 4); registerFluid("slime", "Schleim", LiquidType.COLD, 0, 50, 0.0f, 8, 4);
registerFluid("goo", "Klebrige Masse", false, LiquidType.COLD, true, 0, 60, 0.0f, 10, 5); registerFluid("goo", "Klebrige Masse", LiquidType.COLD, 0, 60, 0.0f, 10, 5);
registerFluid("nukage", "Radioaktive Masse", false, LiquidType.COLD, true, 10, 10, 4.0f, 2, 2); registerFluid("nukage", "Radioaktive Masse", LiquidType.COLD, 10, 10, 4.0f, 2, 2);
registerFluid("blood", "Blut", false, LiquidType.COLD, false, 0, 10, 0.0f, 2, 1); registerFluid("blood", "Blut", LiquidType.COLD, 0, 10, 0.0f, 2, 1);
registerFluid("spring_water", "Klares Wasser", true, LiquidType.COLD, false, 0, 5, 0.0f, 1, 1); registerFluid("spring_water", "Klares Wasser", LiquidType.COLD, 0, 5, 0.0f, 1, 1);
registerFluid("swamp_water", "Sumpfwasser", true, LiquidType.COLD, false, 0, 5, 0.0f, TextureAnimation.SWAMP_WATER_STILL, TextureAnimation.SWAMP_WATER_FLOW); registerFluid("swamp_water", "Sumpfwasser", LiquidType.COLD, 0, 5, 0.0f, TextureAnimation.SWAMP_WATER_STILL, TextureAnimation.SWAMP_WATER_FLOW);
registerFluid("milk", "Milch", false, LiquidType.COLD, true, 0, 5, 0.0f, 1, 1); registerFluid("milk", "Milch", LiquidType.COLD, 0, 5, 0.0f, 1, 1);
for(MetalType metal : MetalType.values()) { for(MetalType metal : MetalType.values()) {

View file

@ -57,10 +57,6 @@ public abstract class Vars {
public static boolean liquidPhysics = true; public static boolean liquidPhysics = true;
@Var(name = "lavaFire") @Var(name = "lavaFire")
public static boolean lavaFire = true; public static boolean lavaFire = true;
@Var(name = "mergeWater")
public static boolean mergeWater = true;
@Var(name = "mergeInfinite")
public static boolean mergeInfinite = true;
@Var(name = "infighting") @Var(name = "infighting")
public static boolean infight = true; public static boolean infight = true;
@Var(name = "damageFall") @Var(name = "damageFall")
@ -200,10 +196,14 @@ public abstract class Vars {
public static boolean keepInventory = false; public static boolean keepInventory = false;
@Var(name = "cleanCut") @Var(name = "cleanCut")
public static boolean cleanCut = false; public static boolean cleanCut = false;
@Var(name = "mergeLava") @Var(name = "infiniteWater")
public static boolean mergeWater = false;
@Var(name = "infiniteLava")
public static boolean mergeLava = false; public static boolean mergeLava = false;
@Var(name = "mergeFinite") @Var(name = "infiniteColdLiquids")
public static boolean mergeFinite = false; public static boolean mergeCold = false;
@Var(name = "infiniteHotLiquids")
public static boolean mergeHot = false;
@Var(name = "veryHungryRabbits") @Var(name = "veryHungryRabbits")
public static boolean rabidRabbits = false; public static boolean rabidRabbits = false;
@Var(name = "evilFowl") @Var(name = "evilFowl")