Cuberite Forum
Great Idea - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Great Idea (/thread-1156.html)

Pages: 1 2


RE: Great Idea - DrMasik - 08-20-2015

Do you have any description link about blockhandler?


RE: Great Idea - NiLSPACE - 08-20-2015

No, I'm afraid not. You can see how they are used in C++ though: https://github.com/cuberite/cuberite/blob/master/src/Blocks/BlockHandler.h

A blockhandler simply overrides a function if it needs to.


RE: Great Idea - SamJBarney - 08-21-2015

I am currently working on getting a lot of Cuberite up to date with vanilla minecraft, specifically tree and biome generation.

There was a discussion about lua bindings for block handlers: https://github.com/cuberite/cuberite/issues/2390

However, I have been looking at the forge source code for a while, and it looks like we would have to have a separate branch specifically for Forge that could never be merged. The issue is that in vanilla minecraft, block ids are a single byte, while in Forge minecraft they are an int (4 bytes), and probably encoded as a VarInt when sent across the network. I don't know for certain about the network encoding, though.

I don't have time to do it right now, but perhaps you could test current compatibility. Create a cuberite server and connect to it with a client that has forge installed, along with a few mods that provide blocks. Then place a few blocks, log out, shutdown the server, start the server and reconnect. If the blocks are still there, maybe I am worrying for nothing.


RE: Great Idea - worktycho - 08-23-2015

From what I've heard, vanilla mine-craft uses four byte ids internally, then serializes them down to one byte ids for the network. There is nothing saying we can't do that to.
So the biggest issues I can see with forge block compatibility is increased memory usage (cChunkSegment would grow by 120%), and protocol detection.

Memory usage can be mitigated by making blockids an opaque class, then adding a compile time flag as to whether to support forge.