prismarine-viewer icon indicating copy to clipboard operation
prismarine-viewer copied to clipboard

Stairs not rendering

Open mkmark opened this issue 1 year ago • 6 comments

minimal reproduction sample:

const standaloneViewer = require('prismarine-viewer').standalone;
const { Vec3 } = require('vec3');

(async () => {
  const version = "1.13";
  const World = require('prismarine-world')(version);
  const Chunk = require('prismarine-chunk')(version);

  const world = new World(() => new Chunk())
  const viewer = standaloneViewer({
    version,
    world,
    center: new Vec3(0,0,0),
    port: 3002,
  });
  await world.setBlockStateId(new Vec3(0, 0, 0), 1)
  await world.setBlockStateId(new Vec3(0, 0, 1), 4423)
  await world.setBlockStateId(new Vec3(0, 0, 2), 4424)
  // for (let i=0; i<6000; ++i){
  //   await world.setBlockStateId(new Vec3(Math.floor(i/100), 0, i%100), i);
  // }
  viewer.update();
})()

Only the stone (state id 1) is drawn when running the code. The stairs (4423, 4424) are invisible. This happens to all stairs. Happens to different versions (1.13, 1.19 tested)

4423 should be the state of stone_brick_stairs

Actually, there are more empty textures to be seen if you uncomment the for loop lines (not sure if the state id is continuous though, but they seems so for 1.13).


I am not entirely sure if this is the correct way of drawing stairs. My actual problem is that prismarine-viewer can not render schematics properly, where all stairs are not drawn. This is an attempt to trace the issue. Please help.

mkmark avatar Feb 11 '24 15:02 mkmark

https://github.com/zardoy/prismarine-web-client/commit/6090493bf08310ece0cc861d773a5afc24f008e1

the breakage wasn't intentional. also IMO isAir block property should be used here instead (example: https://github.com/PrismarineJS/minecraft-data/pull/829/files#diff-0d255e355947920697ca68432e2877c7814032af84c682c8281e725b232226fa)

zardoy avatar Feb 11 '24 21:02 zardoy

please send a PR

also I don't think the ends_with is right either. Just enumerate all the relevant blocks

rom1504 avatar Feb 11 '24 21:02 rom1504

This is what i meant by the sentence above. @rom1504 BTW your idea of grouped block fits well here (air blocks) but still has nothing in common with https://github.com/PrismarineJS/node-minecraft-data/pull/335

zardoy avatar Feb 12 '24 03:02 zardoy

same here.

vniversvs-cw avatar Aug 26 '24 20:08 vniversvs-cw

has this been solved?

vniversvs-cw avatar Aug 26 '24 22:08 vniversvs-cw