r/GraphicsProgramming • u/degradka • Oct 18 '26
Source Code I rewrote Minecraft Classic versions in plain C
A while ago I posted my C rewrite of pre-classic versions. Now I did the same with Classic: every version from 0.0.11a up to 0.30, plus the dedicated servers.
It renders the same way the original did in 2009: fixed-function OpenGL, a display list per chunk, glFog, no shaders. I tried to keep the output exactly like the original.
Uses GLFW, GLEW, zlib and stb. Play around, feedback is welcome!
456
Upvotes
17
u/pierspad Oct 18 '26
What's the difference with Minecraft Java edition/bedrock edition?
Up to which version do you plan do rewrite?
What do you think about setting up few benchmarks (such as world generation speed, chunk loading etc.) to compare it with the original? Maybe this wasn't your goal, but I think it will be way more painful for you to optimize and parallelize plain c
62
u/Gobrosse Oct 18 '26
so to be clear, this is a line-by-line port from decompiled Java, by hand? not LLM-generated?
9
u/Gabrunken Oct 18 '26
Thats simply amazing man, keep it up
3
u/Competitive_Cash5216 Oct 22 '26
Really cool dude! also i'm pretty sure classicube also does the same thing.
6
u/Firepal64 Oct 18 '26
This seems great. I'm curious about the decompilation process
2
u/TheJackiMonster Oct 18 '26
Looks pretty good!
6
u/outofindustry Oct 18 '26
display list, now that's a term I've never heard for a long time.
1
u/LeateWonceslace Oct 21 '26
Why are you using the beta version of cobblestone instead of the alpha version?
1
u/Renulev Oct 18 '26
What about copyright infringement, though? The textures are proprietary!
1
u/psicodelico6 Oct 19 '26
Does ir use less memory?
1
u/AloneBlueberry9390 Oct 19 '26
Wow, that’s really cool… How long did the entire project take?
3
u/TimeSFG Oct 18 '26
Awesome sauce
2
u/ArmyFrosty7976 Oct 22 '26
You really interested me and I'm thinking of porting your version to my OS, but before that I need to do a Damn OpenGL (I think I'm porting TinyGL)
2
u/EBASHY_SOLI Oct 22 '26
АХ классический майн что может быть лучше
0
u/tree-hut Oct 18 '26
So what is the point of this, just learning? Since you didn't even modernize the rendering pipeline
1
u/BingoBongoVrn 26d ago
It doesn’t look fully AI-generated. The first part looks written by a person, and the later work was very likely done with heavy help from an AI. Nothing proves this either way, but the signs are fairly clear.
Phase 1: Jan–Sep 2024, looks hand-written
levelRenderer_lightColumnChangednext toLevel_init, and K&R()instead of(void).Phase 2: Sep 25–26 2025, strong signs of AI
15b1d20, “fix segfaults, block placement, cleanup build, and add README”, rewrites all 27 files at once (+1066/−1146). The beginner comments disappear, and every file gets a header like// level.c — world storage, lighting columns, IO, and solid-cube queries. That em-dash summary header is a typical ChatGPT habit, and it now appears in 125 of the 180 source files.(size_t)casts everywhere,(Java parity)notes, designated initializers, andstaticcaching ofQueryPerformanceFrequency.mach_absolute_timesupport, even though the README only covers Windows and Arch Linux. Adding code for platforms nobody asked about is a classic chatbot tendency.Phase 3: Jul 2026 bush fix, likely an AI coding agent
e69c90fhas a comment describing the code’s own history: “(this previously drew a flat shaded box diagonal… same bug already found and fixed in mc-classic-c)”. AI agents often leave comments like this; people rarely do.What a person clearly wrote
orbisai0security, the other a one-line GLEW fix.Overall: a person started a real hand-written C port in 2024, then in 2025 had an AI (most likely ChatGPT or similar) rewrite and extend it. Most of the code you see in the repo today was probably AI-written or AI-rewritten, with the author steering it and testing the result.
1
u/Ok-Compote-2968 Oct 19 '26
why
-9
u/helpprogram2 Oct 18 '26
What’s plain about c?
-2
u/Novel-Umpire3867 Oct 19 '26
Now do it in Rust