Cuberite Forum
A heads up - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: A heads up (/thread-460.html)

Pages: 1 2


A heads up - cedeel - 06-03-2012

Current trunk compiles fine with zlib updated to 1.2.7.

It should be time to kill
Code:
cServer * cServer::GetServer()
perfectly possible in current trunk.

I commented the function and pointed Bindings.cpp to
Code:
cRoot::Get()->GetServer()
instead, which seems to work fine in my limited testing.

I've been looking for the item metadata, since I wanted to fix upside down steps and stairs. Any hints as to where it's hiding?


RE: A heads up - xoft - 06-03-2012

Is there any advantage in moving to the newer zlib? If not, why fix something that's not broken? Wink

Did you manually edit Bindings.cpp? You shouldn't - it's an automatically generated file, re-generate it using source/AllToLua.bat. Functions get into that file if the respective C++ function is marked with a "// tolua_export" comment (and is in one of the processed files).

What do you mean by item metadata? WHat exactly is it that you're looking for? An example would really help Smile
As for some block metadata definitions, I've started a section in the BlockID.h header, defining the metadata I needed for trees generation etc. Is that what you need?


RE: A heads up - cedeel - 06-03-2012

I did edit Bindings.cpp by hand, since my shell can't execute the bat file.
I might look into porting it actually.

About the metadata:
Minecraft wiki has information that I believe pertains to this issue.

Specifically, in newer versions some items has another two bits of metadata (I'm not entirely sure though, thus I wanted to inspect the source.)


RE: A heads up - xoft - 06-03-2012

Items don't have metadata bits, items have damage value (16 bits, afaik). Blocks have metadata, always 4 bits.

MCServer handles some of the metadata information. For example, torches, doors, ladders are handled; you can check that yourself in the client, as the metadata defines those blocks' appearance clientside.
However, MCServer does almost no metadata handling when placing slabs or stairs. If you want to touch that, you need to make yourself comfortable with the cClientHandle::HandleBlockPlace() function, that's the place that it should be implemented at.


RE: A heads up - cedeel - 06-03-2012

Got tolua++ compiled and made a shell script doing the same thing as your batch file.

I've started out by attempting to fix the upside down stairs, since I think I'll be able to reuse the direction code for slabs.


RE: A heads up - xoft - 06-03-2012

Great news. Welcome to the team Smile


RE: A heads up - cedeel - 06-03-2012

Got stairs working as expected Smile

(Debugged for so long... I had made the error of setting the bit at 0x8 instead of 0x4)


Will post a patch once I fix the steps too.


RE: A heads up - xoft - 06-03-2012

Good job!

Send PM to FakeTruth to add you to the developers, so that you can directly commit to SVN.


RE: A heads up - xoft - 06-04-2012

Congratulations on your first commit. And on your first breaking of MCS build on Windows Smile The MSVC project file defines the include path for zlib, too, so it has to be changed. I'll fix that later today, I need to go to work now.


RE: A heads up - xoft - 06-04-2012

There, fixed.
Hmm, now I see that your Bindings are different than mine, and I found out why. We have a bit hacked ToLua, which treats AString the same as std::string. You might want to hack yours, too.
Unfortunately I can't provide the sources for that hack, because I used hex editor to hack it directly into the executableTongue However, if you manage to do that in some way, perhaps you could share the sources with us, so that we can have a proper dev chain.