block/water rendering fixes: weighted blockstate variants picked per position like vanilla (Mth.getSeed + model random, multipart reseed, seed 42 for displays, falling blocks by start pos, block items keep the first variant), face textures are slot refs (heavy_core was invisible), missing textures as missingno, animated textures by mcmeta frame size and first frame, deterministic resource pack priority, full-height snapshot so the sky light under water counts the whole water column, camera surroundings captured for the water fog blend, underwater light applied per depth instead of per ray, camera fluid determined once in prepare, translucent layer limit 8 / 1/255 (3rd water face no longer opaque), rgb attribute modifiers for water_fog_color, pptest fix_* scenes
This commit is contained in:
1 parent
291d51891f
commit
0b781c3538
19 files changed
+731
-89
No files matched your search
@@ -286,6 +286,101 @@ public class PPTest extends JavaPlugin {
|
||||
// Block displays: end portal/gateway (unshaded), piston head (no skull), a non-uniformly scaled + rotated
|
||||
// log (normals), grass block (side overlay); shulkers without and with colour.
|
||||
scene("display_fixes", this::displayFixes, 4.5, 3.2, -5, 4.5, 0.8, 1.5);
|
||||
// F3b fixes. fix_deep_*: 7x7 shaft, 12 deep, camera 6 under the surface looking straight down (the frustum
|
||||
// ends at the eye: sky light must still count the water above it) and sideways (same floor, reference).
|
||||
scene("fix_deep_down", this::deepShaft, 3.5, -6, 3.2, 3.5, -12, 3.9);
|
||||
scene("fix_deep_side", this::deepShaft, 0.4, -6, 3.5, 6.4, -9, 3.5);
|
||||
// fix_layers: two/three water blocks with air between (4/6 water faces) in front of red walls; a stained
|
||||
// glass pane under a water block with water behind it vs the same pane without water behind (the pane is in
|
||||
// front of the water: not dimmed by the underwater light); a white stained glass + water stack.
|
||||
scene("fix_layers", this::fluidLayers, 4, 1.8, -4.5, 4, 1.2, 3);
|
||||
// fix_fog_swamp: swamp tank, camera near its west wall looking east: the biomes behind the camera (outside
|
||||
// the frustum) are part of the water fog blend.
|
||||
scene("fix_fog_swamp", this::fogSwamp, -3.5, -3, 0.5, 12, -4, 0.5);
|
||||
// fix_weighted: weighted blockstate variants picked per position (stone, grass, dirt, sand, netherrack,
|
||||
// bedrock, mycelium, podzol fields), a stone/grass block display (seed 42); fix_textures: heavy_core (face
|
||||
// texture "all" without '#'), animated textures (fire first frame = frames[0], sea lantern, magma, prismarine).
|
||||
scene("fix_weighted", this::weighted, 7.5, 6, -5, 7.5, 0, 3);
|
||||
scene("fix_textures", this::texturesScene, 3.5, 2.2, -3, 3.5, 0.6, 1);
|
||||
}
|
||||
|
||||
private void deepShaft(Location o) {
|
||||
biome(o, Biome.PLAINS);
|
||||
for (int x = -1; x <= 7; x++)
|
||||
for (int z = -1; z <= 7; z++)
|
||||
for (int y = -13; y <= -1; y++) {
|
||||
boolean wall = x == -1 || x == 7 || z == -1 || z == 7;
|
||||
put(o, x, y, z, wall ? "stone_bricks" : y == -13 ? "sand" : "water");
|
||||
}
|
||||
String[] marks = {"red_concrete", "yellow_concrete", "lime_concrete", "white_concrete"};
|
||||
for (int i = 0; i < marks.length; i++) put(o, 1 + i * 1, -12, 2 + (i % 2) * 2, marks[i]);
|
||||
put(o, 5, -12, 5, "gold_block");
|
||||
}
|
||||
|
||||
private void fluidLayers(Location o) {
|
||||
biome(o, Biome.PLAINS);
|
||||
// Two water blocks (4 faces) and three (6 faces) with air gaps, red/blue walls behind.
|
||||
put(o, 0, 1, 1, "water");
|
||||
put(o, 0, 1, 3, "water");
|
||||
for (int y = 0; y <= 2; y++) for (int x = -1; x <= 1; x++) put(o, x, y, 6, "red_concrete");
|
||||
put(o, 2, 1, 0, "water");
|
||||
put(o, 2, 1, 2, "water");
|
||||
put(o, 2, 1, 4, "water");
|
||||
for (int y = 0; y <= 2; y++) put(o, 2, y, 6, "blue_concrete");
|
||||
// Stained glass pane under a water block, water behind (x=4) / nothing behind (x=6).
|
||||
put(o, 4, 1, 1, "light_blue_stained_glass_pane[north=false,south=false,east=true,west=true]");
|
||||
put(o, 4, 2, 1, "water");
|
||||
put(o, 4, 1, 3, "water");
|
||||
put(o, 6, 1, 1, "light_blue_stained_glass_pane[north=false,south=false,east=true,west=true]");
|
||||
put(o, 6, 2, 1, "water");
|
||||
for (int y = 0; y <= 3; y++) for (int x = 3; x <= 7; x++) put(o, x, y, 6, "yellow_concrete");
|
||||
// White stained glass, water, white stained glass, water in a row.
|
||||
put(o, 9, 1, 0, "white_stained_glass");
|
||||
put(o, 9, 1, 1, "water");
|
||||
put(o, 9, 1, 3, "white_stained_glass");
|
||||
put(o, 9, 1, 4, "water");
|
||||
for (int y = 0; y <= 2; y++) put(o, 9, y, 6, "lime_concrete");
|
||||
}
|
||||
|
||||
private void fogSwamp(Location o) {
|
||||
for (int x = -40; x < 40; x += 2)
|
||||
for (int z = -40; z < 40; z += 2)
|
||||
for (int y = -16; y < 16; y += 2)
|
||||
w.setBiome(o.getBlockX() + x, o.getBlockY() + y, o.getBlockZ() + z, Biome.SWAMP);
|
||||
for (int x = -5; x <= 17; x++)
|
||||
for (int z = -8; z <= 8; z++)
|
||||
for (int y = -9; y <= -1; y++) {
|
||||
boolean wall = x == -5 || x == 17 || z == -8 || z == 8;
|
||||
put(o, x, y, z, wall ? "stone_bricks" : y == -9 ? "sand" : "water");
|
||||
}
|
||||
String[] pillars = {"red_concrete", "yellow_concrete", "lime_concrete", "white_concrete"};
|
||||
for (int i = 0; i < pillars.length; i++)
|
||||
for (int y = -8; y <= -4; y++) put(o, 2 + i * 4, y, -3 + (i % 2) * 6, pillars[i]);
|
||||
}
|
||||
|
||||
private void weighted(Location o) {
|
||||
biome(o, Biome.PLAINS);
|
||||
String[] fields = {"stone", "grass_block[snowy=false]", "dirt", "sand", "netherrack", "bedrock",
|
||||
"mycelium[snowy=false]", "podzol[snowy=false]"};
|
||||
for (int i = 0; i < fields.length; i++)
|
||||
for (int x = 0; x < 4; x++)
|
||||
for (int z = 0; z < 4; z++) put(o, (i % 4) * 4 + x, -1, (i / 4) * 4 + z, fields[i]);
|
||||
BlockDisplay stone = spawn(o, 4, 0, 9, 0, BlockDisplay.class);
|
||||
stone.setBlock(Bukkit.createBlockData("minecraft:stone"));
|
||||
BlockDisplay grass = spawn(o, 10, 0, 9, 0, BlockDisplay.class);
|
||||
grass.setBlock(Bukkit.createBlockData("minecraft:grass_block[snowy=false]"));
|
||||
}
|
||||
|
||||
private void texturesScene(Location o) {
|
||||
put(o, 0, 0, 1, "heavy_core");
|
||||
put(o, 1, 0, 1, "netherrack");
|
||||
put(o, 1, 1, 1, "fire");
|
||||
put(o, 2, 0, 1, "soul_sand");
|
||||
put(o, 2, 1, 1, "soul_fire");
|
||||
put(o, 3, 0, 1, "sea_lantern");
|
||||
put(o, 4, 0, 1, "magma_block");
|
||||
put(o, 5, 0, 1, "prismarine");
|
||||
put(o, 6, 0, 1, "lava");
|
||||
}
|
||||
|
||||
private void tintBlocks(Location o) {
|
||||
|
||||
Reference in new issue
Block a user