Skip to content

KdotDevelopment/MinecraftInC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft in C

This is a boredom project for me where I'm rewriting Minecraft true to its original form into pure C. Each branch represents a different version of Minecraft. There is a good chance I might return back to old versions if I find that there is an inconsistency with the original and mine, even if I am already working on a newer version.

Version Infdev 20100420 (WIP)

I got bored of working on Classic 0.30 so I moved on to Infdev.

How to Build

I only make this project on WSL, so it must be built on linux unless you rewrite the makefile for building on Windows. However, the primary binary that I create here is only for Windows, which by the way, is completely statically linked.

Before the project can be built, you must convert all the assets into header files. This can be easily done with the following command: make assets You may need some dependencies for creating the assets, such as ImageMagik and libpng-dev.

Building for Windows: make windows -j Don't forget to download the mingw-w64 to use gcc for windows.

Building for Linux: make -j

There is no more creative mode, so no additional changes need to be made to the makefile.

Useful things to know for developers

Inside the folder ./lib is every library that you need in order to statically build minecraft.exe. This folder shouldn't need to be touched at all. Also, when you run make assets it will convert any .png or .ogg file in the ./res/assets directory to .h files, which are then included within the source files. (This is why ./src/sound/sounds.c takes so long to build -- it must read all those sound files). The exe icon can also be changed easily if you replace the .ico file with anything (retaining the name) and running make icon. This new icon will be linked with the exe next time it is built. Do note, however, that the new icon may not show up because Windows caches icons. Restarting or moving the file may help.

Credits

I handwrote all of the code, however I must give credit to johnpayne-dev since I used his code as a big reference in early development while working on creative mode for Classic 0.30. Also, it is worth mentioning this project is not affiliated whatsoever with Mojang Studios or Minecraft at all.

About

A line-for-line reimplementation of Minecraft to C

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages