GithubHelp home page GithubHelp logo

ninecraft's Introduction

Ninecraft

alt screenshot

Installing compile dependencies

Debian/Ubuntu:

x86_64:

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install git make cmake gcc g++ gcc-multilib g++-multilib libopenal-dev:i386 libx11-dev:i386 libxrandr-dev:i386 libxinerama-dev:i386 libxcursor-dev:i386 libxi-dev:i386 libgl-dev:i386 zenity unzip

arm64:

sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install git make cmake gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libopenal-dev:armhf libx11-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxcursor-dev:armhf libxi-dev:armhf libgl-dev:armhf zenity unzip

x86:

sudo apt update
sudo apt install git make cmake gcc g++ libopenal-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev zenity unzip

arm:

sudo apt update
sudo apt install git make cmake gcc g++ libopenal-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev zenity unzip

ArchLinux

x86_64:

sudo pacman -Syu
sudo pacman -S git make cmake gcc gcc-multilib lib32-openal lib32-libx11 lib32-libxrandr lib32-libxinerama lib32-libxcursor lib32-libxi lib32-libglvnd zenity unzip

arm:

sudo pacman -Syu
sudo pacman -S git make cmake gcc openal libx11 libxrandr libxinerama libxcursor libxi libglvnd zenity unzip

AlpineLinux (Not working)

x86:

apk update
apk add git make cmake gcc g++ openal-soft-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-dev zenity unzip

Fedora

x86_64:

dnf update
dnf install git make cmake gcc g++ glibc-devel.i686 libstdc++-devel.i686 openal-soft-devel.i686 libX11-devel.i686 libXrandr-devel.i686 libXinerama-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libglvnd-devel.i686 zenity unzip

x86:

dnf update
dnf install git make cmake gcc g++ openal-soft-devel libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel libglvnd-devel zenity unzip

arm:

dnf update
dnf install git make cmake gcc g++ openal-soft-devel libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel libglvnd-devel zenity unzip

Compiling

x86_64 & x86:

git clone --recursive http://github.com/MCPI-Revival/Ninecraft.git
cd Ninecraft
make build-i686

arm64 & arm:

git clone --recursive http://github.com/MCPI-Revival/Ninecraft.git
cd Ninecraft
make build-arm

Before running for the first time

./tools/extract.sh /path/to/your/apk

Running

x86_64 & x86:

./build-i686/ninecraft/ninecraft

arm64 & arm

./build-arm/ninecraft/ninecraft

Creating mods

Example mod

#include <stdio.h>

extern void *handle;
extern void *ninecraft_app;

int mod_init() {
    puts("TEST > Loaded mod");
}

Compiling

To compile you must include the ninecraft header files in your project's root directory

x86

gcc -m32 -c -fpic -I./ninecraft/include test.c
gcc -m32 -shared -o mods/libtest.so test.o

ARM

gcc -mthumb -c -fpic -I./ninecraft/include test.c
gcc -mthumb -shared -o mods/libtest.so test.o

ninecraft's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ninecraft's Issues

will not compile

didnt compile.
got this error in terminal when compiling
home/tom/Ninecraft/ninecraft/src/main.c:560:23: warning: ‘struct aFILE’ declared inside parameter list will not be visible outside of this definition or declaration
560 | int __my_srget(struct aFILE *astream) {
| ^~~~~
/home/tom/Ninecraft/ninecraft/src/main.c: In function ‘missing_hook’:
/home/tom/Ninecraft/ninecraft/src/main.c:601:5: warning: ‘ftime’ is deprecated [-Wdeprecated-declarations]
601 | hybris_hook("ftime", ftime);
| ^~~~~~~~~~~
In file included from /home/tom/Ninecraft/ninecraft/src/main.c:8:
/usr/include/arm-linux-gnueabihf/sys/timeb.h:39:12: note: declared here
39 | extern int ftime (struct timeb *__timebuf)
| ^~~~~
/home/tom/Ninecraft/ninecraft/src/main.c: In function ‘main’:
/home/tom/Ninecraft/ninecraft/src/main.c:914:30: error: ‘NINECRAFTAPP_SIZE_0_7_0’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_3_0’?
914 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_7_0;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_3_0
/home/tom/Ninecraft/ninecraft/src/main.c:914:30: note: each undeclared identifier is reported only once for each function it appears in
/home/tom/Ninecraft/ninecraft/src/main.c:916:30: error: ‘NINECRAFTAPP_SIZE_0_7_1’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_6_1’?
916 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_7_1;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_6_1
/home/tom/Ninecraft/ninecraft/src/main.c:918:30: error: ‘NINECRAFTAPP_SIZE_0_7_2’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_3_2’?
918 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_7_2;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_3_2
/home/tom/Ninecraft/ninecraft/src/main.c:920:30: error: ‘NINECRAFTAPP_SIZE_0_7_3’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_3_3’?
920 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_7_3;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_3_3
/home/tom/Ninecraft/ninecraft/src/main.c:922:30: error: ‘NINECRAFTAPP_SIZE_0_7_4’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_3_0’?
922 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_7_4;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_3_0
/home/tom/Ninecraft/ninecraft/src/main.c:924:30: error: ‘NINECRAFTAPP_SIZE_0_7_5’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_3_0’?
924 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_7_5;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_3_0
/home/tom/Ninecraft/ninecraft/src/main.c:926:30: error: ‘NINECRAFTAPP_SIZE_0_7_6’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_3_0’?
926 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_7_6;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_3_0
/home/tom/Ninecraft/ninecraft/src/main.c:928:30: error: ‘NINECRAFTAPP_SIZE_0_8_0’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_3_0’?
928 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_8_0;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_3_0
/home/tom/Ninecraft/ninecraft/src/main.c:930:30: error: ‘NINECRAFTAPP_SIZE_0_8_1’ undeclared (first use in this function); did you mean ‘NINECRAFTAPP_SIZE_0_6_1’?
930 | ninecraft_app_size = NINECRAFTAPP_SIZE_0_8_1;
| ^~~~~~~~~~~~~~~~~~~~~~~
| NINECRAFTAPP_SIZE_0_6_1
/home/tom/Ninecraft/ninecraft/src/main.c:1049:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_8_1’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_1’?
1049 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_8_1;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_1
/home/tom/Ninecraft/ninecraft/src/main.c:1051:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_8_0’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_0’?
1051 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_8_0;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_0
/home/tom/Ninecraft/ninecraft/src/main.c:1053:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_7_6’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_0’?
1053 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_7_6;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_0
/home/tom/Ninecraft/ninecraft/src/main.c:1055:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_7_5’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_0’?
1055 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_7_5;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_0
/home/tom/Ninecraft/ninecraft/src/main.c:1057:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_7_4’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_0’?
1057 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_7_4;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_0
/home/tom/Ninecraft/ninecraft/src/main.c:1059:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_7_3’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_3_3’?
1059 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_7_3;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_3_3
/home/tom/Ninecraft/ninecraft/src/main.c:1061:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_7_2’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_2’?
1061 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_7_2;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_2
/home/tom/Ninecraft/ninecraft/src/main.c:1063:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_7_1’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_1’?
1063 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_7_1;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_1
/home/tom/Ninecraft/ninecraft/src/main.c:1065:38: error: ‘MINECRAFT_ISGRABBED_OFFSET_0_7_0’ undeclared (first use in this function); did you mean ‘MINECRAFT_ISGRABBED_OFFSET_0_1_0’?
1065 | minecraft_isgrabbed_offset = MINECRAFT_ISGRABBED_OFFSET_0_7_0;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MINECRAFT_ISGRABBED_OFFSET_0_1_0
gmake[3]: *** [ninecraft/CMakeFiles/ninecraft.dir/build.make:251: ninecraft/CMakeFiles/ninecraft.dir/src/main.c.o] Error 1
gmake[3]: Leaving directory '/home/tom/Ninecraft/build-arm'
gmake[2]: *** [CMakeFiles/Makefile2:333: ninecraft/CMakeFiles/ninecraft.dir/all] Error 2
gmake[2]: Leaving directory '/home/tom/Ninecraft/build-arm'
gmake[1]: *** [Makefile:149: all] Error 2
gmake[1]: Leaving directory '/home/tom/Ninecraft/build-arm'
make: *** [Makefile:16: build-arm] Error 2

libGL uses wrong graphics driver

libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: nouveau
lib: /home/lassebq/Downloads/ninecraft/lib/x86/libminecraftpe.so: : 0x566eef60
Ninecraft is running mcpe v0.8.0 alpha
zsh: segmentation fault (core dumped)  ./ninecraft

libGL tries to load nouveau, even though my system uses proprietary nvidia-dkms

custom keyboard layout

keyboard layout is hard codded in main.c, is it possible to use ini file to set keyboard layouts,
in my case the layout is "azerty" french

Requires too new of a libc6 version to be launched on Debian 11 (the latest debian)

./ninecraft-client: /lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./ninecraft-client)
./ninecraft-client: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./ninecraft-client)
./ninecraft-client: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./ninecraft-client)
./ninecraft-client: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./ninecraft-client)

Does it need this new of a libc version? Could it run with glibc 2.31?

Arch Linux: segfaults after displaying MCPE version (built from master)

After installing all listed dependencies, compiling Ninecraft (with debug build type) and doing extract.sh on a x86 apk of 0.8.1, Ninecraft briefly shows a black window and segfaults:

[AUDIO_ENGINE] Failed to open device
lib: /home/zaafonin/Downloads/Ninecraft/lib/x86/libminecraftpe.so: : 0x56738ce0
Ninecraft is running mcpe v0.8.1
Segmentation fault (core dumped)

Fixing the audio (btw, I'd add lib32-libpulse to readme as OpenAL still uses it) didn't change much except for the first line not being present, and the window showing up for just a little longer.

Same thing happens with 0.7.6 and 0.6.1.
Not familiar with MCPE internals atm, so can't figure out what might be wrong.

Update the documentation

You should enable Wikis for this repository, and move the compilation instructions there. A lot of people seem to be getting confused and trying to compile it when they don't need to, and aren't able to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.