Voxelmanip Forums
olive olive
Posted on 2024-04-20 21:53 Link
Found my password after a long while \(^ ° ^)/ hello again

Been fiddling with writing a Minecraft server, but rather than the well-documented Classic Protocol (& extensions) I've done before, the more "Who's Documentation?" Beta 1.7.

I separated out an old copy of wiki.vg docs which are very useful but don't describe how to actually use half the packets. (Praise be to whoever the "Great Old Ones" are.)

Just got it to send a stone & air world and have the client spawn-in, after… too much getting simple things wrong.
Used LuaJIT to FFI in libdeflate for chunk encoding to then be very happy you can skip that altogether and just send mass block changes!

(Winsnore for the client as I just could not get it to run on my Linux)

Everything pure Lua so far, featuring inefficient number→binary en/decoding, and assert(false)ing on trying to decode a 64-bit number too large to be safe in a Lua float for now. and I am very grateful to Lars for his float encoder which I've bodged in for now

Next step is to handle multiple clients, let them see each other, and then to let people interact with the world…
KodeWithMiggy KodeWithMiggy
Posted on 2024-09-08 20:14 Link
Wow! This sounds very promising! Using Lua for this out of all things is a questionable choice at best, but this is still an interesting project nonetheless. Please tell my if you've made any progress since April. I would love to see the code.
olive olive
Posted on 2024-11-02 00:09 Link
Yet again, found my password!

Promising is entirely the opposite of what you should think of anything I do :P
In typical me fashion this didn't go much further, partly due to me finding a new thing to try and a lot because b1.7.3's protocol is absolute- not very good.
I moved onto designing my own protocol and then that went nowhere.

I might pick up one of my Classic, Beta, or my own protocols again now you've reminded me of it…
just really need to pick a better thing to use for 3D graphics than Löve2D :S
(LöVR maybe… I like the idea of SDL3 but that requires doing 3D from GPU up which I know little about.)
ROllerozxa ROllerozxa
Posted on 2025-05-17 17:33 (edited 2025-05-17 17:35) Link
Pre-beta 1.8 versions of Minecraft always have a special place in my heart (which may be a bit strange since I didn't start playing Minecraft until 2014). Having a b1.7.3 server software written from the ground up and developed to the point it could reach some amount of parity for just a cosy survival server would be nice and possibly open up some new possibilities. There's of course custom server software that bolts onto the vanilla Java server (which I even dabbled in for SkySMP), but a clean break from the ground up would most likely unlock a lot of potential for improvement on the server-side even with a completely vanilla client.

Drew DeVault was working a very long time ago on a complete client and server reimplementation of b1.7.3 as TrueCraft, but it was abandoned and I have never been able to compile it with (relatively) modern C# .NET tooling.

Do you possibly still have the code for the server? I know it was very incomplete but you got in-game at least and I would certainly want to experiment with it.

Using Lua for this out of all things is a questionable choice at best, but this is still an interesting project nonetheless.
I assume you're just being inflammatory, but LuaJIT is both much faster than PUC Lua, and FFI allows you to sidestep a lot of overhead either by directly calling into functions of native libraries, or working with lower level manually allocated memory and data structures while staying in your Lua code from the programmer's perspective. It still makes a lot more sense since you will also simultaneously have the convenience of a higher-level language when you're not optimising heavy data structures or algorithms.
olive olive
Posted on 2025-05-17 17:45 (edited 2025-05-17 18:39) Link
Yes! I have the source on my laptop, I'll upload it to a git later. As I remember it, it is literally the bare minimum to have something work, a mash of not the best Lua :P

With intent to fiddle with b1.7.3 again, I was poking around in a semi-deobfuscated copy of the game recently. Good god maybe it's partly the obfuscation but the code is messy & confusing.

Drew was working on a Beta client again recently, in his Hare programming language: https://sr.ht/~sircmpwn/betamine/ I've not tried it yet, so no comments.

Edit: Looks like it already was a git repo! https://git.sr.ht/~olive/fourdee
I'd come up with better names for some packets, so I've just added a commit with those.
ROllerozxa ROllerozxa
Posted on 2025-05-18 00:19 Link
Nice! Nice.

With intent to fiddle with b1.7.3 again, I was poking around in a semi-deobfuscated copy of the game recently. Good god maybe it's partly the obfuscation but the code is messy & confusing.
It's almost likely that the original source code isn't too far off from what you see through the decompilation. Apart from the obfuscation step which renames entity names to random letters, and the obvious omittal of constants and comments, the Java compiler actually does not do a lot of optimisation of bytecode (even things like empty if statements and for loops without any side-effects are preserved - IIRC if you look at the sponge code in beta there will be some empty for loops where the classic-era sponge logic inside has been assumedly commented out) and trying to decompile the resulting bytecode back into Java usually creates something which is still quite similar to what the original source code would have been.

(There are of course some quirks that still show up in decompiled code, the analysis decompilers do is not magic. For example when I was working on a decompilation for an old Android game written in Java a while back, one of the reoccurring decompilation quirks I had to run around and fix was a lack of type casting causing integer overflows in various places.)

Notch-era Minecraft Java is well known for being poorly written. I suppose this is why I assume if someone were to sit down today and try to reimplement the featureset that b1.7.3 offered, either partially as a custom server or just reimplementing it entirely, the result would likely be much better because you'll have through hindsight a clear picture of what needs to be implemented and how to structure it to accomodate that. While the original Minecraft implementation was incrementally developed at breakneck speeds and likely without knowing what was next for the game.

Also it's crazy Drew made his own programming language and then was like "I'm gonna make a Minecraft b1.7.3 client in it". I have heard about that project previously too but had forgotten that it was a thing.
KodeWithMiggy KodeWithMiggy
Posted on 2026-01-31 21:19 Link
Using Lua for this out of all things is a questionable choice at best, but this is still an interesting project nonetheless.
I assume you're just being inflammatory, but LuaJIT is both much faster than PUC Lua, and FFI allows you to sidestep a lot of overhead either by directly calling into functions of native libraries, or working with lower level manually allocated memory and data structures while staying in your Lua code from the programmer's perspective. It still makes a lot more sense since you will also simultaneously have the convenience of a higher-level language when you're not optimising heavy data structures or algorithms.
Oh, sorry, I didn't know what LuaJIT was at the time of writing that post. Thought he was using regular parsed Lua.