rozukke / mcpp

A library to interface with Minecraft using C++.
https://rozukke.github.io/mcpp/
Apache License 2.0
100 stars 15 forks source link

Some blocks are unable to be placed #95

Open MotchHmmF opened 1 week ago

MotchHmmF commented 1 week ago

While testing all the blocks available with the library I have noticed a few issues

Mobheads don't place Cobblestone walls don't place Double slab variants only place a single slab Block 36 exists but isn't documented and causes an unbreakable, undetectable block to be placed (If I am not mistake this is the moving piston head block)

rozukke commented 1 week ago

Will investigate, though might be unfixable without major structural changes

Charme11235 commented 1 week ago

I believe this is caused by some of the background Java plugins being made for earlier Minecraft versions.

It's an issue to do with the flattening which occurred in 1.13 which changed item ids and removed numeric ids.

For example, if we wanted to place a skeleton skull, we would put id 397 which would refer to the older block id that was common to all skulls, minecraft:skull. However, in modern Minecraft, the skeleton skull is now known as minecraft:skeleton_skull. Then Legacy Material Support is used to resolve the issue.

When I do try to place a skeleton skull, the following exception arises, "java.lang.IllegalArgumentException: Cannot get data for not block LEGACY_SKULL_ITEM". Could be that Legacy Material Support is not entirely comprehensive?

I've found that for blocks that don't exist prior to the flattening, they cannot be replaced with air but can be replaced with other blocks like stone. I haven't checked but, maybe, unknown blocks are treated as air (id 0) and, hence, a replacement isn't deemed necessary.

In terms of a solution, I'd discuss it with the course coordinator as I'm unsure if a downgrade to 1.12.1 or major update would be permitted to be done midway through the course. I'm mainly concerned about how an assessor would treat the bugs that stem from this issue. Are they considered something the student has to handle or are they ignored in terms of marking if they do not result in a major failure?

rozukke commented 6 days ago

None of these bugs will influence marking as the test areas are sandboxed to avoid this calibre of issues. In terms of fixing the current system/downgrading Minecraft version, that is under consideration and will probably be done for next semester. Fixing these errors would involve a large rewrite, but a downgrade is probably a good move to avoid people being confused and worrying about things breaking 👍 So, this is probably a 'wontfix' until someone has the time to invest into a rewrite or until we downgrade the version next semester.

johnathanchann commented 6 days ago

As long as your code is correct logically, you will be fine.