Giter VIP home page Giter VIP logo

Comments (16)

m-doescode avatar m-doescode commented on July 26, 2024

If I remember correctly, the first 8 bits represents block type, and the last 8 bits block data.

For block sides, a bit mask is used which filters out all bits except for the block side.

You can find an example of this in doorrenderer.cpp

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

That makes sense, but which bits are for the block side?
(I decided to try to make cake edible, everything but block data seems to work)

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

I'm also guessing that the gap between special IDs 135-146 are for binary purposes? (wait nevermind, still no idea why it has that)

from crafti.

m-doescode avatar m-doescode commented on July 26, 2024

That makes sense, but which bits are for the block side? (I decided to try to make cake edible, everything but block data seems to work)

The first 3 bits are used. But you should probably be using BLOCK_SIDE_BITS. Look in doorrenderer.cpp for an example

from crafti.

m-doescode avatar m-doescode commented on July 26, 2024

I'm also guessing that the gap between special IDs 135-146 are for binary purposes? (wait nevermind, still no idea why it has that)

This, I have no idea why. For some reason the first 127 tupes are reserved for plain blocks and there other half is reserved for special block types

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

That makes sense, but which bits are for the block side? (I decided to try to make cake edible, everything but block data seems to work)

The first 3 bits are used. But you should probably be using BLOCK_SIDE_BITS. Look in doorrenderer.cpp for an example

Yeah, I just wanted to make sure I wasn't overwriting anything important
Also, I'm working on full docs of the code in my repo's wiki

from crafti.

m-doescode avatar m-doescode commented on July 26, 2024

Also, I'm working on full docs of the code in my repo's wiki

Oh, that's nice! That would actually be pretty helpful.

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

When you say first 3 bits, you mean right-to-left right?

So like:
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1

Because I thought that was reserved for block type

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

Also, I'm working on full docs of the code in my repo's wiki

Oh, that's nice! That would actually be pretty helpful.

https://github.com/Bluebotlaboratories/crafti/wiki
Feel free to help if you really want to try
(So much code and I'm not that good at C++ overall)

from crafti.

m-doescode avatar m-doescode commented on July 26, 2024

When you say first 3 bits, you mean right-to-left right?

So like: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1

Because I thought that was reserved for block type

I meant of the block data. I have no idea of its from the left or the right (I will research this later) but it definitely starts after 8 bits. Something like

0000 0000 1110 0000
Or
0000 0000 0000 0111

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

Should we continue this discussion on my repo?

from crafti.

m-doescode avatar m-doescode commented on July 26, 2024

Should we continue this discussion on my repo?

Probably. Also, maybe you could enable the discussions tab and continue it there?

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

yep
done
(under the Q&A section)

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

@m-doescode Forget that, moved it to general

from crafti.

Vogtinator avatar Vogtinator commented on July 26, 2024

Every block is stored as 16 bits (BLOCK_WDATA), the lower 8 bits are the block number and the higher 8 bits the data, which is specific to each block.

In previous releases, the high bit of the data of every block (independent of the type) determined whether the block was redstone powered, but after the redstone rewrite that is no longer the case. For compatibility with existing maps, this bit is currently ignored for non-redstone blocks.

from crafti.

Bluebotlabz avatar Bluebotlabz commented on July 26, 2024

Ok, thanks!

from crafti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.