Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stairs not rendering #427

Open
mkmark opened this issue Feb 11, 2024 · 5 comments
Open

Stairs not rendering #427

mkmark opened this issue Feb 11, 2024 · 5 comments

Comments

@mkmark
Copy link

mkmark commented Feb 11, 2024

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.

@zardoy
Copy link
Contributor

zardoy commented Feb 11, 2024

zardoy/minecraft-web-client@6090493

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)

@rom1504
Copy link
Member

rom1504 commented Feb 11, 2024

please send a PR

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

@zardoy
Copy link
Contributor

zardoy commented Feb 12, 2024

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 PrismarineJS/node-minecraft-data#335

@vniversvs-cw
Copy link

same here.

@vniversvs-cw
Copy link

has this been solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants