Project Rename

This commit is contained in:
TheBrokenRail 2021-01-27 11:13:06 -05:00
parent 88843f6cbe
commit 62204aa1bf
11 changed files with 68 additions and 22 deletions

2
Jenkinsfile vendored
View File

@ -21,7 +21,7 @@ pipeline {
withCredentials([usernamePassword(credentialsId: 'docker_hub_login', usernameVariable: 'DOCKER_HUB_USERNAME', passwordVariable: 'DOCKER_HUB_PASSWORD')]) { withCredentials([usernamePassword(credentialsId: 'docker_hub_login', usernameVariable: 'DOCKER_HUB_USERNAME', passwordVariable: 'DOCKER_HUB_PASSWORD')]) {
sh 'docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"' sh 'docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"'
} }
sh 'docker push thebrokenrail/minecraft-pi' sh 'docker push thebrokenrail/minecraft-pi-reborn'
} }
} }
stage('Package') { stage('Package') {

View File

@ -1,17 +1,17 @@
# Modding # Modding
Modding Minecraft: Pi Edition is possible by patching the binary at runtime. To make this easier ``minecraft-pi-docker`` includes a libary called ``libcore.so`` which provides several functions to help you patch the game. Modding Minecraft: Pi Edition is possible by patching the binary at runtime. To make this easier ``minecraft-pi-reborn`` includes a library called ``libcore.so`` which provides several functions to help you patch the game.
## Hex Addresses ## Hex Addresses
Minecraft: Pi Edition has no symbols so you must patch the hex address of an instruction instead of using a function name. Hex addresses can be found using tools like [Ghidra](https://ghidra-sre.org) or [RetDec](https://retdec.com). To find out what a function does, you can find its equivalent in Minecraft: Pocket Edition 0.6.1 and use its name for reference because Minecraft: Pocket Edition 0.6.1 includes symbols. Minecraft: Pi Edition has no symbols so you must patch the hex address of an instruction instead of using a function name. Hex addresses can be found using tools like [Ghidra](https://ghidra-sre.org) or [RetDec](https://retdec.com). To find out what a function does, you can find its equivalent in Minecraft: Pocket Edition 0.6.1 and use its name for reference because Minecraft: Pocket Edition 0.6.1 includes symbols.
## Loading Directories ## Loading Directories
``minecraft-pi-docker`` loads mods from two locations, ``/app/minecraft-pi/mods``, and ``~/.minecraft/mods``. The first location only exists in the Docker container and is immutable, so you should place your mods in ``~/.minecraft/mods`` which is mounted on the host as ``~/.minecraft-pi/mods``. ``minecraft-pi-reborn`` loads mods from two locations, ``/app/minecraft-pi/mods``, and ``~/.minecraft/mods``. The first location only exists in the Docker container and is immutable, so you should place your mods in ``~/.minecraft/mods`` which is mounted on the host as ``~/.minecraft-pi/mods``.
## C++ Strings ## C++ Strings
Minecraft: Pi Edition was compiled with an old version of GCC, so when interacting with C++ strings, make sure you set ``-D_GLIBCXX_USE_CXX11_ABI=0``. Minecraft: Pi Edition was compiled with an old version of GCC, so when interacting with C++ strings, make sure you set ``-D_GLIBCXX_USE_CXX11_ABI=0``.
## ``libcore.so`` API ## ``libcore.so`` API
Header files and the shared library can be download from [Jenkins](https://jenkins.thebrokenrail.com/job/minecraft-pi-docker/job/master/lastSuccessfulBuild/artifact/out/lib). Header files and the shared library can be download from [Jenkins](https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/master/lastSuccessfulBuild/artifact/out/lib).
### ``void overwrite(void *start, void *target)`` ### ``void overwrite(void *start, void *target)``
This method replaces a function with another function. This method replaces a function with another function.

View File

@ -1,26 +1,26 @@
# Minecraft: Pi Edition For Docker # Minecraft: Pi Edition: Reborn
This is a project allowing Minecraft: Pi Edition to be run without a Raspberry Pi using Docker. Minecraft: Pi Edition Modding Project
## Setup ## Setup
1. Remove Old Minecraft: Pi Edition Package If Installed (``sudo apt remove minecraft-pi``) 1. Remove Old Minecraft: Pi Edition Package If Installed (``sudo apt remove minecraft-pi``)
2. Download Appropriate Package (See Table Below) From [Here](https://jenkins.thebrokenrail.com/job/minecraft-pi-docker/job/master/lastSuccessfulBuild/artifact/out/deb/) 2. Download Appropriate Package (See Table Below) From [Here](https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/master/lastSuccessfulBuild/artifact/out/deb/)
3. Install With ``sudo apt install ./<Path To File>`` 3. Install With ``sudo apt install ./<Path To File>``
### Packages ### Packages
| Package | Description | | Package | Description |
| --- | --- | | --- | --- |
| ``minecraft-pi-server`` | Minecraft Pi Edition Modded Into A Dedicated Server | | ``minecraft-pi-reborn-server`` | Minecraft Pi Edition Modded Into A Dedicated Server |
| ``minecraft-pi-virgl`` | Minecraft Pi Edition Using VirGL For Hardware Acceleration (Recommended For Desktop) | | ``minecraft-pi-reborn-virgl`` | Minecraft Pi Edition Using VirGL For Hardware Acceleration (Recommended For Desktop) |
| ``minecraft-pi-native`` | Minecraft: Pi Edition Using Docker Device Mounting For GPU Acceleration (Recommended For ARM Devices (ie. Raspberry Pi, PinePhone, etc)) | | ``minecraft-pi-reborn-native`` | Minecraft: Pi Edition Using Docker Device Mounting For GPU Acceleration (Recommended For ARM Devices (ie. Raspberry Pi, PinePhone, etc)) |
### General Notes ### General Notes
#### Docker Versions #### Docker Versions
While the distribution-provided version of Docker works fine on most systems, in rare cases it can be outdated and cause bugs. Before reporting a bug, try using the official builds of Docker. These can be installed by following your distribution's instructions at https://docs.docker.com/engine/install. While the distribution-provided version of Docker is fine for most systems, in rare cases it can be outdated and cause bugs. Before reporting a bug, try using the official builds of Docker. These can be installed by following your distribution's instructions at https://docs.docker.com/engine/install.
### Specific Notes ### Specific Notes
#### Raspbian Buster #### Debian/Raspbian Buster
By default Raspbian Buster ships an older version of the package ``libseccomp2``. This package is used to block certain dangerous system calls from running inside Docker containers. The included version accidentally blocks the system call ``clock_gettime64``, this causes bugs inside Minecraft: Pi Edition. However, the Debian ``buster-backports`` repo includes an updated version. You can enable the ``buster-backports`` repo and update ``libseccomp2`` by running: By default Raspbian Buster ships an older version of the package ``libseccomp2``. This package is used to block certain dangerous system calls from running inside Docker containers. The included version accidentally blocks the system call ``clock_gettime64``, this causes bugs inside Minecraft: Pi Edition. However, the Debian ``buster-backports`` repo includes an updated version. You can enable the ``buster-backports`` repo and update ``libseccomp2`` by running:
```sh ```sh
@ -36,7 +36,7 @@ sudo apt install -t buster-backports libseccomp2
``` ```
### PinePhone (Mobian) ### PinePhone (Mobian)
This supports running on a PinePhone using Mobian. However, you will need to attach a keyboard and mouse as Minecraft: Pi Edition does not have touch support. This supports running on a PinePhone using Mobian. However, you will need to attach a keyboard and mouse because Minecraft: Pi Edition does not have touch support.
## Troubleshooting Crashes ## Troubleshooting Crashes
Game logs are located in ``/tmp/minecraft-pi``. Game logs are located in ``/tmp/minecraft-pi``.
@ -58,7 +58,7 @@ This is also compatible with MCPE 0.6.1.
### Limitations ### Limitations
- Player data is not saved because of limitations with MCPE LAN worlds - Player data is not saved because of limitations with MCPE LAN worlds
- An easy workaround is to place your inventory in a chest before logging off - An easy workaround is to place your inventory in a chest before logging off
- Survival mode servers are only compatible with ``minecraft-pi-docker`` clients - Survival mode servers are only compatible with ``minecraft-pi-reborn`` clients
## Modding ## Modding
[View Modding](MODDING.md) [View Modding](MODDING.md)

View File

@ -1,4 +1,4 @@
Package: minecraft-pi-native Package: minecraft-pi-reborn-native
Version: ${VERSION} Version: ${VERSION}
Maintainer: TheBrokenRail <connor24nolan@live.com> Maintainer: TheBrokenRail <connor24nolan@live.com>
Description: Fun with Blocks Description: Fun with Blocks
@ -6,4 +6,4 @@ Homepage: https://www.minecraft.net/en-us/edition/pi
Architecture: all Architecture: all
Depends: ${DEPENDENCIES} Depends: ${DEPENDENCIES}
Recommends: ${RECOMMENDED_DEPENDENCIES} Recommends: ${RECOMMENDED_DEPENDENCIES}
Conflicts: minecraft-pi, minecraft-pi-virgl Conflicts: minecraft-pi, minecraft-pi-reborn-virgl

View File

@ -1,4 +1,4 @@
Package: minecraft-pi-virgl Package: minecraft-pi-reborn-virgl
Version: ${VERSION} Version: ${VERSION}
Maintainer: TheBrokenRail <connor24nolan@live.com> Maintainer: TheBrokenRail <connor24nolan@live.com>
Description: Fun with Blocks Description: Fun with Blocks
@ -6,4 +6,4 @@ Homepage: https://www.minecraft.net/en-us/edition/pi
Architecture: all Architecture: all
Depends: ${DEPENDENCIES}, virgl-server Depends: ${DEPENDENCIES}, virgl-server
Recommends: ${RECOMMENDED_DEPENDENCIES} Recommends: ${RECOMMENDED_DEPENDENCIES}
Conflicts: minecraft-pi, minecraft-pi-native Conflicts: minecraft-pi, minecraft-pi-reborn-native

View File

@ -1,4 +1,4 @@
Package: minecraft-pi-server Package: minecraft-pi-reborn-server
Version: ${VERSION} Version: ${VERSION}
Maintainer: TheBrokenRail <connor24nolan@live.com> Maintainer: TheBrokenRail <connor24nolan@live.com>
Description: Fun with Blocks Description: Fun with Blocks

View File

@ -55,5 +55,7 @@ target_link_libraries(override dl)
add_library(textures SHARED src/textures/textures.cpp) add_library(textures SHARED src/textures/textures.cpp)
target_link_libraries(textures core feature GLESv1_CM) target_link_libraries(textures core feature GLESv1_CM)
add_library(test SHARED src/test/test.c)
add_library(init SHARED src/init/init.c) add_library(init SHARED src/init/init.c)
target_link_libraries(init compat server game_mode camera input misc options textures) target_link_libraries(init compat server game_mode camera input misc options textures test)

View File

@ -1,6 +1,7 @@
#include "init.h" #include "init.h"
__attribute__((constructor)) static void init() { __attribute__((constructor)) static void init() {
run_tests();
init_compat(); init_compat();
init_server(); init_server();
init_game_mode(); init_game_mode();

View File

@ -6,6 +6,7 @@
extern "C" { extern "C" {
#endif #endif
void run_tests();
void init_compat(); void init_compat();
void init_server(); void init_server();
void init_game_mode(); void init_game_mode();

42
mods/src/test/test.c Normal file
View File

@ -0,0 +1,42 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <time.h>
#include <libcore/libcore.h>
#include "../init/init.h"
// Types
typedef long long time64_t;
struct timespec64 {
time64_t tv_sec;
long tv_nsec;
};
typedef long int time32_t;
struct timespec32 {
time32_t tv_sec;
long tv_nsec;
};
void run_tests() {
// Test clock_gettime64
struct timespec64 ts64;
long out = syscall(SYS_clock_gettime64, CLOCK_MONOTONIC, &ts64);
if (out != 0) {
if (errno == ENOSYS) {
// clock_gettime64 Unsupported, Testing clock_gettime
struct timespec32 ts32;
out = syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &ts32);
if (out != 0) {
// Failure
ERR("Unable To Run clock_gettime Syscall: %s", strerror(errno));
}
} else {
// Failure
ERR("Unable To Run clock_gettime64 Syscall: %s", strerror(errno));
}
}
}

View File

@ -2,5 +2,5 @@
set -e set -e
docker build ${DOCKER_BUILD_OPTIONS} --tag thebrokenrail/minecraft-pi:client -f Dockerfile.client . docker build ${DOCKER_BUILD_OPTIONS} --tag thebrokenrail/minecraft-pi-reborn:client -f Dockerfile.client .
docker build ${DOCKER_BUILD_OPTIONS} --tag thebrokenrail/minecraft-pi:server -f Dockerfile.server . docker build ${DOCKER_BUILD_OPTIONS} --tag thebrokenrail/minecraft-pi-reborn:server -f Dockerfile.server .