├── .gitea └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENSE ├── README.md ├── VERSION ├── cmake ├── cpack │ ├── appimage.cmake │ └── packaging.cmake ├── options │ ├── core-options.cmake │ ├── extra-options.cmake │ └── paths.cmake ├── toolchain │ ├── amd64-toolchain.cmake │ ├── arm64-toolchain.cmake │ ├── armhf-toolchain.cmake │ ├── base-toolchain.cmake │ └── prebuilt │ │ ├── armhf-toolchain.cmake │ │ └── sysroot.cmake └── util │ ├── export.cmake │ ├── io.cmake │ ├── resource.c.in │ └── util.cmake ├── dependencies ├── CMakeLists.txt ├── LIEF │ └── CMakeLists.txt ├── glfw │ └── CMakeLists.txt ├── imgui │ ├── CMakeLists.txt │ ├── fix-hidpi.patch │ └── glad │ │ ├── CMakeLists.txt │ │ └── include │ │ └── GL │ │ └── gl.h ├── minecraft-pi │ ├── CMakeLists.txt │ └── minecraft-pi-0.1.1.tar.gz ├── runtime │ └── CMakeLists.txt ├── stb_image │ ├── CMakeLists.txt │ └── src │ │ └── stb_image_impl.c ├── symbol-processor │ └── CMakeLists.txt └── utf8cpp │ └── CMakeLists.txt ├── docs ├── API.md ├── CHANGELOG.md ├── CONTROLS.md ├── CREDITS.md ├── CUSTOM_SKINS.md ├── DEDICATED_SERVER.md ├── GETTING_STARTED.md ├── README.md ├── TERMINOLOGY.md └── modding │ ├── ADVANCED.md │ ├── BEGINNER.md │ ├── GHIDRA.md │ ├── INTERMEDIATE.md │ ├── MY_FIRST_MOD.md │ └── README.md ├── example-mods ├── README.md ├── build.sh ├── chat-commands │ ├── .gitignore │ ├── CMakeLists.txt │ └── src │ │ ├── chat-commands.cpp │ │ └── server-console-command.cpp ├── custom-block │ ├── .gitignore │ ├── CMakeLists.txt │ └── src │ │ └── custom-block.cpp ├── expanded-creative │ ├── .gitignore │ ├── CMakeLists.txt │ └── src │ │ └── expanded-creative.cpp └── recipes │ ├── .gitignore │ ├── CMakeLists.txt │ └── src │ └── recipes.cpp ├── images ├── CMakeLists.txt ├── background.png ├── icon.png ├── modern_logo.png ├── mojang │ ├── chest.png │ ├── grasscolor.png │ ├── shadow.png │ └── vignette.png └── screenshots │ ├── launcher.png │ └── start.png ├── launcher ├── CMakeLists.txt ├── data │ ├── appstream.xml │ └── launcher.desktop └── src │ ├── bootstrap │ ├── assets.cpp │ ├── bootstrap.cpp │ ├── bootstrap.h │ ├── debug.cpp │ ├── mods.cpp │ └── patchelf.cpp │ ├── client │ ├── cache.cpp │ ├── cache.h │ ├── configuration.cpp │ ├── configuration.h │ └── ui │ │ ├── about.cpp │ │ ├── advanced.cpp │ │ ├── main.cpp │ │ ├── servers.cpp │ │ └── window.cpp │ ├── logger │ ├── crash-report.cpp │ ├── logger.cpp │ └── logger.h │ ├── main.cpp │ ├── options │ ├── option-list.h │ ├── parser.cpp │ └── parser.h │ ├── ui │ ├── color.cpp │ ├── frame.cpp │ └── frame.h │ ├── updater │ ├── appimage.cpp │ ├── updater.cpp │ └── updater.h │ └── util │ ├── env.cpp │ ├── install.cpp │ ├── sdk.cpp │ ├── util.cpp │ └── util.h ├── libreborn ├── CMakeLists.txt ├── include │ └── libreborn │ │ ├── config.h │ │ ├── env │ │ ├── env.h │ │ ├── flags.h │ │ ├── list.h │ │ └── servers.h │ │ ├── log.h │ │ ├── patch.h │ │ └── util │ │ ├── exec.h │ │ ├── glfw.h │ │ ├── io.h │ │ ├── string.h │ │ └── util.h └── src │ ├── fake-libpng │ ├── empty.c │ └── empty.vers │ ├── patch │ ├── code-block.cpp │ ├── instruction.cpp │ ├── patch-internal.h │ ├── patch.cpp │ └── segments.cpp │ └── util │ ├── config.cpp.in │ ├── cp437.cpp │ ├── env │ ├── env.cpp │ ├── flags │ │ ├── available-feature-flags │ │ ├── flags.cpp │ │ └── node.cpp │ └── servers.cpp │ ├── exec.cpp │ ├── glfw.cpp │ ├── log.cpp │ ├── string.cpp │ └── util.cpp ├── media-layer ├── CMakeLists.txt ├── core │ ├── CMakeLists.txt │ └── src │ │ ├── audio │ │ ├── api.cpp │ │ ├── audio.h │ │ ├── engine.cpp │ │ └── file.cpp │ │ ├── base.cpp │ │ └── window │ │ ├── cursor.cpp │ │ ├── events.cpp │ │ ├── gles.cpp │ │ ├── media.cpp │ │ ├── media.h │ │ ├── offscreen.cpp │ │ └── util.cpp ├── include │ ├── EGL │ │ └── egl.h │ ├── GLES │ │ └── gl.h │ ├── SDL │ │ ├── SDL.h │ │ ├── SDL_events.h │ │ ├── SDL_keysym.h │ │ ├── SDL_syswm.h │ │ └── SDL_version.h │ ├── X11 │ │ └── Xlib.h │ └── media-layer │ │ ├── audio.h │ │ └── core.h └── trampoline │ ├── CMakeLists.txt │ └── src │ ├── GLESv1_CM.cpp │ ├── common │ └── common.h │ ├── guest │ └── guest.h │ ├── host │ ├── host.cpp │ └── host.h │ └── media-layer-core.cpp ├── mods ├── CMakeLists.txt ├── include │ └── mods │ │ ├── api │ │ └── api.h │ │ ├── atlas │ │ └── atlas.h │ │ ├── bucket │ │ └── bucket.h │ │ ├── chat │ │ └── chat.h │ │ ├── classic-ui │ │ └── classic-ui.h │ │ ├── compat │ │ └── compat.h │ │ ├── creative │ │ └── creative.h │ │ ├── feature │ │ ├── feature.h │ │ └── server.h │ │ ├── fps │ │ └── fps.h │ │ ├── game-mode │ │ └── game-mode.h │ │ ├── init │ │ └── init.h │ │ ├── input │ │ ├── input.h │ │ └── key-list.h │ │ ├── misc │ │ └── misc.h │ │ ├── multidraw │ │ └── multidraw.h │ │ ├── multiplayer │ │ └── packets.h │ │ ├── options │ │ └── options.h │ │ ├── override │ │ └── override.h │ │ ├── screenshot │ │ └── screenshot.h │ │ ├── server │ │ ├── properties.h │ │ └── server.h │ │ ├── sound │ │ └── sound.h │ │ ├── text-input-box │ │ ├── TextInputBox.h │ │ └── TextInputScreen.h │ │ ├── textures │ │ └── textures.h │ │ ├── title-screen │ │ └── title-screen.h │ │ ├── touch │ │ └── touch.h │ │ └── version │ │ └── version.h └── src │ ├── api │ ├── README.md │ ├── api.cpp │ ├── compat.cpp │ ├── diagram.drawio │ ├── events.cpp │ ├── internal.h │ ├── misc.cpp │ └── socket.cpp │ ├── atlas │ ├── README.md │ └── atlas.cpp │ ├── benchmark │ ├── README.md │ └── benchmark.cpp │ ├── bucket │ ├── README.md │ └── bucket.cpp │ ├── cake │ ├── README.md │ └── cake.cpp │ ├── camera │ ├── README.md │ └── camera.cpp │ ├── chat │ ├── README.md │ ├── chat.cpp │ ├── internal.h │ └── ui.cpp │ ├── classic-ui │ ├── README.md │ └── classic-ui.cpp │ ├── compat │ ├── README.md │ ├── compat.cpp │ ├── internal.h │ ├── readdir.cpp │ ├── sdl.cpp │ └── stubs │ │ ├── bcm_host.cpp │ │ ├── egl.cpp │ │ ├── sdl.cpp │ │ └── x11.cpp │ ├── creative │ ├── README.md │ └── creative.cpp │ ├── death │ ├── README.md │ └── death.cpp │ ├── f3 │ ├── README.md │ └── f3.cpp │ ├── feature │ ├── README.md │ └── feature.cpp │ ├── fps │ ├── README.md │ └── fps.cpp │ ├── game-mode │ ├── README.md │ ├── game-mode.cpp │ ├── internal.h │ └── ui.cpp │ ├── init │ ├── README.md │ └── init.cpp │ ├── input │ ├── README.md │ ├── attack.cpp │ ├── bow.cpp │ ├── drop.cpp │ ├── input.cpp │ ├── internal.h │ ├── keys.cpp │ ├── misc.cpp │ └── toggle.cpp │ ├── misc │ ├── README.md │ ├── api.cpp │ ├── base64.cpp │ ├── graphics.cpp │ ├── home.cpp │ ├── internal.h │ ├── logging.cpp │ ├── misc.cpp │ ├── tinting.cpp │ └── ui.cpp │ ├── multidraw │ ├── README.md │ ├── buffer.cpp │ ├── buffer.h │ ├── glue.cpp │ ├── storage.cpp │ └── storage.h │ ├── multiplayer │ ├── README.md │ ├── internal.h │ ├── inventory.cpp │ ├── loading │ │ ├── init.cpp │ │ ├── internal.h │ │ ├── misc.cpp │ │ ├── packets.cpp │ │ ├── terrain.cpp │ │ └── thread.cpp │ ├── misc.cpp │ ├── raknet.cpp │ ├── server-list.cpp │ └── syncing.cpp │ ├── options │ ├── README.md │ ├── info.cpp │ ├── internal.h │ ├── options.cpp │ └── ui.cpp │ ├── override │ ├── README.md │ └── override.cpp │ ├── screenshot │ ├── README.md │ └── screenshot.cpp │ ├── server │ ├── README.md │ ├── blacklist.cpp │ ├── commands.cpp │ ├── internal.h │ ├── playerdata.cpp │ ├── properties.cpp │ └── server.cpp │ ├── shading │ ├── README.md │ ├── init.cpp │ ├── internal.h │ ├── lighting.cpp │ ├── normals.cpp │ └── tesselator.cpp │ ├── skin │ ├── README.md │ ├── internal.h │ ├── loader.cpp │ └── skin.cpp │ ├── sound │ ├── README.md │ ├── internal.h │ ├── repository.cpp │ └── sound.cpp │ ├── text-input-box │ ├── README.md │ ├── TextInputBox.cpp │ └── TextInputScreen.cpp │ ├── textures │ ├── README.md │ ├── headless.cpp │ ├── internal.h │ ├── lava.cpp │ └── textures.cpp │ ├── title-screen │ ├── README.md │ ├── internal.h │ ├── splashes.cpp │ ├── splashes.txt │ ├── title-screen.cpp │ └── welcome.cpp │ ├── touch │ ├── README.md │ └── touch.cpp │ └── version │ ├── README.md │ └── version.cpp ├── scripts ├── build.mjs ├── fix-appimage-for-docker.sh ├── get-changelog.mjs ├── install-dependencies.mjs ├── lib │ ├── options.mjs │ └── util.mjs ├── screenshot.sh └── test.sh ├── symbols ├── CMakeLists.txt └── src │ ├── api │ ├── CommandServer.def │ ├── ConnectedClient.def │ └── OffsetPosTranslator.def │ ├── app-platform │ ├── AppPlatform.def │ ├── AppPlatform_linux.def │ └── AppPlatform_readAssetFile_return_value.def │ ├── entity │ ├── Arrow.def │ ├── ArrowRenderer.def │ ├── CameraEntity.def │ ├── Entity.def │ ├── EntityFactory.def │ ├── EntityRenderDispatcher.def │ ├── EntityRenderer.def │ ├── FallingTile.def │ ├── HumanoidMobRenderer.def │ ├── ItemEntity.def │ ├── ItemSpriteRenderer.def │ ├── Mob.def │ ├── MobFactory.def │ ├── MobRenderer.def │ ├── Particle.def │ ├── PathfinderMob.def │ ├── PrimedTnt.def │ ├── Throwable.def │ ├── TripodCamera.def │ ├── TripodCameraRenderer.def │ ├── animal │ │ ├── AgableMob.def │ │ ├── Animal.def │ │ ├── Chicken.def │ │ ├── Cow.def │ │ ├── Pig.def │ │ └── Sheep.def │ ├── model │ │ ├── HumanoidModel.def │ │ ├── ModelPart.def │ │ ├── PolygonQuad.def │ │ └── VertexPT.def │ ├── monster │ │ ├── Creeper.def │ │ ├── Monster.def │ │ ├── PigZombie.def │ │ ├── Skeleton.def │ │ ├── Spider.def │ │ └── Zombie.def │ ├── painting │ │ ├── HangingEntity.def │ │ ├── Motive.def │ │ ├── Painting.def │ │ └── PaintingRenderer.def │ └── player │ │ ├── Abilities.def │ │ ├── LocalPlayer.def │ │ ├── Player.def │ │ ├── PlayerRenderer.def │ │ ├── RemotePlayer.def │ │ └── ServerPlayer.def │ ├── game │ ├── GameRenderer.def │ ├── Minecraft.def │ ├── NinecraftApp.def │ ├── mode │ │ ├── CreatorMode.def │ │ ├── GameMode.def │ │ ├── SurvivalMode.def │ │ └── creator │ │ │ ├── Creator.def │ │ │ ├── EventList_Item.def │ │ │ ├── EventList_TileEvent.def │ │ │ ├── ICreator.def │ │ │ └── TileEvent.def │ └── options │ │ ├── Options.def │ │ ├── OptionsFile.def │ │ └── Options_Option.def │ ├── gui │ ├── Font.def │ ├── Gui.def │ ├── GuiMessage.def │ ├── components │ │ ├── Button.def │ │ ├── GuiComponent.def │ │ ├── ImageButton.def │ │ ├── IntRectangle.def │ │ ├── OptionButton.def │ │ ├── OptionsPane.def │ │ ├── RectangleArea.def │ │ ├── ScrollingPane.def │ │ └── Touch_TButton.def │ └── screens │ │ ├── ArmorScreen.def │ │ ├── DisconnectionScreen.def │ │ ├── FurnaceScreen.def │ │ ├── InBedScreen.def │ │ ├── OptionsScreen.def │ │ ├── PaneCraftingScreen.def │ │ ├── PauseScreen.def │ │ ├── ProgressScreen.def │ │ ├── Screen.def │ │ ├── ScreenChooser.def │ │ ├── SelectWorldScreen.def │ │ ├── SimpleChooseLevelScreen.def │ │ ├── StartMenuScreen.def │ │ ├── TextEditScreen.def │ │ ├── Touch_IngameBlockSelectionScreen.def │ │ ├── Touch_SelectWorldScreen.def │ │ ├── Touch_StartMenuScreen.def │ │ └── WorkbenchScreen.def │ ├── input │ ├── IBuildInput.def │ ├── IMoveInput.def │ ├── Keyboard.def │ ├── Mouse.def │ └── MouseBuildInput.def │ ├── item │ ├── ArmorItem.def │ ├── ArmorMaterial.def │ ├── AuxDataTileItem.def │ ├── DiggerItem.def │ ├── FoodItem.def │ ├── Item.def │ ├── ItemInHandRenderer.def │ ├── ItemInstance.def │ ├── ItemRenderer.def │ ├── TileItem.def │ └── TilePlanterItem.def │ ├── level │ ├── Biome.def │ ├── BiomeSource.def │ ├── ChunkCache.def │ ├── ChunkSource.def │ ├── ChunkStorage.def │ ├── CreatorLevel.def │ ├── DataLayer.def │ ├── Dimension.def │ ├── DistanceChunkSorter.def │ ├── ExternalFileLevelStorage.def │ ├── ExternalFileLevelStorageSource.def │ ├── Level.def │ ├── LevelChunk.def │ ├── LevelData.def │ ├── LevelListener.def │ ├── LevelSettings.def │ ├── LevelSource.def │ ├── LevelStorage.def │ ├── LevelStorageSource.def │ ├── LevelSummary.def │ ├── LightLayer.def │ ├── Material.def │ ├── MultiPlayerLevel.def │ ├── PerformanceTestChunkSource.def │ ├── RandomLevelSource.def │ ├── Region.def │ ├── RegionFile.def │ ├── ServerLevel.def │ ├── container │ │ ├── Container.def │ │ ├── ContainerMenu.def │ │ ├── FillingContainer.def │ │ └── Inventory.def │ ├── feature │ │ ├── Feature.def │ │ ├── LargeCaveFeature.def │ │ └── LargeFeature.def │ └── renderer │ │ ├── Chunk.def │ │ ├── LevelRenderer.def │ │ ├── ParticleEngine.def │ │ ├── RenderChunk.def │ │ └── RenderList.def │ ├── misc │ ├── AABB.def │ ├── CThread.def │ ├── Common.def │ ├── CompoundTag.def │ ├── Config.def │ ├── HitResult.def │ ├── I18n.def │ ├── Mth.def │ ├── PerfRenderer.def │ ├── Pos.def │ ├── Random.def │ ├── SimpleFoodData.def │ ├── SoundEngine.def │ ├── Strings.def │ ├── Tag.def │ ├── Tesselator.def │ ├── Util.def │ └── Vec3.def │ ├── network │ ├── ClientSideNetworkHandler.def │ ├── NetEventCallback.def │ ├── PingedCompatibleServer.def │ ├── RakNetInstance.def │ ├── ServerSideNetworkHandler.def │ ├── packet │ │ ├── ChatPacket.def │ │ ├── ChunkDataPacket.def │ │ ├── ContainerSetContentPacket.def │ │ ├── LoginPacket.def │ │ ├── MessagePacket.def │ │ ├── MinecraftPackets.def │ │ ├── MovePlayerPacket.def │ │ ├── Packet.def │ │ ├── PlayerActionPacket.def │ │ ├── PlayerEquipmentPacket.def │ │ ├── ReadyPacket.def │ │ ├── RemovePlayerPacket.def │ │ ├── RequestChunkPacket.def │ │ ├── SendInventoryPacket.def │ │ ├── SetEntityMotionPacket.def │ │ ├── SetSpawnPositionPacket.def │ │ ├── SignUpdatePacket.def │ │ ├── StartGamePacket.def │ │ ├── UpdateBlockPacket.def │ │ └── UseItemPacket.def │ └── raknet │ │ ├── RakNet.h │ │ ├── RakNet_AddressOrGUID.def │ │ ├── RakNet_BitStream.def │ │ ├── RakNet_RakNetGUID.def │ │ ├── RakNet_RakPeer.def │ │ ├── RakNet_RakString.def │ │ ├── RakNet_RakString_SharedString.def │ │ └── RakNet_SystemAddress.def │ ├── recipes │ ├── CItem.def │ ├── FurnaceRecipes.def │ ├── Recipes.def │ ├── Recipes_Type.def │ └── ReqItem.def │ ├── textures │ ├── DynamicTexture.def │ ├── Texture.def │ └── Textures.def │ └── tile │ ├── Bush.def │ ├── CarriedTile.def │ ├── ChestTile.def │ ├── CropTile.def │ ├── DoorTile.def │ ├── EntityTile.def │ ├── GrassTile.def │ ├── HeavyTile.def │ ├── LeafTile.def │ ├── LiquidTile.def │ ├── StemTile.def │ ├── TallGrass.def │ ├── Tile.def │ ├── TileRenderer.def │ ├── Tile_SoundType.def │ ├── TorchTile.def │ └── entity │ ├── ChestTileEntity.def │ ├── FurnaceTileEntity.def │ ├── SignTileEntity.def │ ├── TileEntity.def │ ├── TileEntityFactory.def │ ├── TileEntityRenderDispatcher.def │ └── TileEntityRenderer.def └── tools ├── .gitignore └── CMakeLists.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /out 2 | /debian/tmp 3 | /.vscode 4 | /build* 5 | /CMakeLists.txt.user 6 | *.autosave 7 | /AppImageBuilder.yml 8 | /appimage-builder-cache 9 | /appimage-build 10 | /AppDir 11 | /*.zsync 12 | /*.AppImage 13 | /core* 14 | /qemu_* 15 | /example-mods/out 16 | /.testing-tmp 17 | /cmake-build-* 18 | /.idea 19 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dependencies/glfw/src"] 2 | path = dependencies/glfw/src 3 | url = https://github.com/glfw/glfw.git 4 | [submodule "dependencies/LIEF/src"] 5 | path = dependencies/LIEF/src 6 | url = https://github.com/lief-project/LIEF.git 7 | [submodule "dependencies/stb_image/include"] 8 | path = dependencies/stb_image/include 9 | url = https://github.com/nothings/stb.git 10 | [submodule "dependencies/utf8cpp/src"] 11 | path = dependencies/utf8cpp/src 12 | url = https://github.com/nemtrif/utfcpp.git 13 | [submodule "archives"] 14 | path = archives 15 | url = https://gitea.thebrokenrail.com/minecraft-pi-reborn/archives.git 16 | shallow = true 17 | [submodule "dependencies/symbol-processor/src"] 18 | path = dependencies/symbol-processor/src 19 | url = https://gitea.thebrokenrail.com/minecraft-pi-reborn/symbol-processor.git 20 | [submodule "dependencies/runtime/src"] 21 | path = dependencies/runtime/src 22 | url = https://gitea.thebrokenrail.com/minecraft-pi-reborn/runtime.git 23 | [submodule "dependencies/imgui/src"] 24 | path = dependencies/imgui/src 25 | url = https://github.com/ocornut/imgui.git 26 | ignore = dirty 27 | [submodule "dependencies/imgui/glad/src"] 28 | path = dependencies/imgui/glad/src 29 | url = https://github.com/Dav1dde/glad.git 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 TheBrokenRail 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Start Screen 3 |

4 | 5 |

6 | Download as an AppImage 7 | Download on Flathub 8 | Get it from Pi-Apps 9 |

10 | 11 | # Minecraft: Pi Edition: Reborn [![Gitea Actions](https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions/workflows/build.yml/badge.svg)](https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions) 12 | Minecraft: Pi Edition: Reborn (also known as MCPI-Reborn) is modding project for [Minecraft: Pi Edition](https://minecraft.wiki/w/Pi_Edition). It serves the dual-purpose of porting it to modern hardware and enhancing the game itself. 13 | 14 | Get started [here](docs/GETTING_STARTED.md)! 15 | 16 | ## Documentation 17 | [View Documentation](docs/README.md) 18 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 3.0.0 2 | -------------------------------------------------------------------------------- /cmake/cpack/appimage.cmake: -------------------------------------------------------------------------------- 1 | # Package 2 | set(APPIMAGE_ARCH "unknown") 3 | if(CPACK_MCPI_ARCH STREQUAL "armhf") 4 | set(APPIMAGE_ARCH "arm") 5 | elseif(CPACK_MCPI_ARCH STREQUAL "arm64") 6 | set(APPIMAGE_ARCH "aarch64") 7 | elseif(CPACK_MCPI_ARCH STREQUAL "amd64") 8 | set(APPIMAGE_ARCH "x86_64") 9 | endif() 10 | execute_process( 11 | COMMAND 12 | "${CMAKE_COMMAND}" "-E" "env" 13 | "ARCH=${APPIMAGE_ARCH}" 14 | "VERSION=${CPACK_MCPI_VERSION}" 15 | "appimagetool" 16 | "--updateinformation" "zsync|${CPACK_MCPI_REPO}/releases/download/latest/${CPACK_PACKAGE_FILE_NAME_ZSYNC}${CPACK_MCPI_APPIMAGE_ZSYNC_EXT}" 17 | "${CPACK_TEMPORARY_DIRECTORY}" 18 | "${CPACK_PACKAGE_FILE_NAME}${CPACK_MCPI_APPIMAGE_EXT}" 19 | WORKING_DIRECTORY "${CPACK_PACKAGE_DIRECTORY}" 20 | COMMAND_ERROR_IS_FATAL ANY 21 | ) 22 | 23 | # Rename ZSync File 24 | file(RENAME "${CPACK_PACKAGE_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_MCPI_APPIMAGE_ZSYNC_EXT}" "${CPACK_PACKAGE_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME_ZSYNC}${CPACK_MCPI_APPIMAGE_ZSYNC_EXT}") 25 | 26 | # Summary Message 27 | function(check_file name) 28 | if(EXISTS "${CPACK_PACKAGE_DIRECTORY}/${name}") 29 | message(STATUS "Generated: ${name}") 30 | else() 31 | message(FATAL_ERROR "Missing File: ${name}") 32 | endif() 33 | endfunction() 34 | check_file("${CPACK_PACKAGE_FILE_NAME}${CPACK_MCPI_APPIMAGE_EXT}") 35 | check_file("${CPACK_PACKAGE_FILE_NAME_ZSYNC}${CPACK_MCPI_APPIMAGE_ZSYNC_EXT}") 36 | -------------------------------------------------------------------------------- /cmake/options/core-options.cmake: -------------------------------------------------------------------------------- 1 | # Build Mode 2 | set(MCPI_BUILD_MODE "native" CACHE STRING "\"arm\" = Build Only Code That Must Be ARM; \"native\" = Build Architecture-Independent Code") 3 | set_property(CACHE MCPI_BUILD_MODE PROPERTY STRINGS "arm" "native") 4 | if(MCPI_BUILD_MODE STREQUAL "arm") 5 | set(BUILD_ARM_COMPONENTS TRUE) 6 | set(BUILD_NATIVE_COMPONENTS FALSE) 7 | elseif(MCPI_BUILD_MODE STREQUAL "native") 8 | set(BUILD_ARM_COMPONENTS FALSE) 9 | set(BUILD_NATIVE_COMPONENTS TRUE) 10 | else() 11 | message(FATAL_ERROR "Invalid Mode") 12 | endif() 13 | 14 | # Specify Options 15 | set(MCPI_OPTIONS "") 16 | function(mcpi_option name description type default) 17 | set(full_name "MCPI_${name}") 18 | set("${full_name}" "${default}" CACHE "${type}" "${description}") 19 | list(APPEND MCPI_OPTIONS "-D${full_name}:${type}=${${full_name}}") 20 | set(MCPI_OPTIONS "${MCPI_OPTIONS}" PARENT_SCOPE) 21 | endfunction() 22 | 23 | # Clear External CFLAGS When Building ARM Components 24 | if(BUILD_ARM_COMPONENTS) 25 | unset(ENV{CFLAGS}) 26 | unset(ENV{CXXFLAGS}) 27 | endif() -------------------------------------------------------------------------------- /cmake/options/paths.cmake: -------------------------------------------------------------------------------- 1 | # Specify Installation Paths 2 | set(MCPI_INSTALL_DIR "lib/${MCPI_APP_NAME}") 3 | set(MCPI_LEGAL_DIR "${MCPI_INSTALL_DIR}/legal") # For Software Licenses 4 | set(MCPI_SDK_DIR "${MCPI_INSTALL_DIR}/sdk") 5 | set(MCPI_SDK_LIB_DIR "${MCPI_SDK_DIR}/lib") 6 | set(MCPI_SDK_INCLUDE_DIR "${MCPI_SDK_DIR}/include") 7 | 8 | # Library Directory 9 | set(MCPI_LIB_DIR "${MCPI_INSTALL_DIR}/lib") 10 | if(BUILD_ARM_COMPONENTS) 11 | string(APPEND MCPI_LIB_DIR "/arm") 12 | elseif(BUILD_NATIVE_COMPONENTS) 13 | string(APPEND MCPI_LIB_DIR "/native") 14 | endif() 15 | 16 | # Share Directory 17 | set(MCPI_SHARE_DIR "share") 18 | if(MCPI_IS_APPIMAGE_BUILD) 19 | string(PREPEND MCPI_SHARE_DIR "usr/") 20 | endif() 21 | 22 | # Specify Default Installation Prefix 23 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 24 | set(DEFAULT_PREFIX "/usr") 25 | if(MCPI_IS_APPIMAGE_BUILD) 26 | set(DEFAULT_PREFIX "/") 27 | elseif(MCPI_IS_FLATPAK_BUILD) 28 | set(DEFAULT_PREFIX "/app") 29 | endif() 30 | set(CMAKE_INSTALL_PREFIX "${DEFAULT_PREFIX}" CACHE PATH "Install Prefix" FORCE) 31 | set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE) 32 | endif() 33 | -------------------------------------------------------------------------------- /cmake/toolchain/amd64-toolchain.cmake: -------------------------------------------------------------------------------- 1 | # Compile For x86_64 2 | include("${CMAKE_CURRENT_LIST_DIR}/base-toolchain.cmake") 3 | # Use x86_64 Cross-Compiler 4 | setup_toolchain("x86_64-linux-gnu") 5 | # Details 6 | set(CMAKE_SYSTEM_NAME "Linux") 7 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 8 | -------------------------------------------------------------------------------- /cmake/toolchain/arm64-toolchain.cmake: -------------------------------------------------------------------------------- 1 | # Compile For ARM64 2 | include("${CMAKE_CURRENT_LIST_DIR}/base-toolchain.cmake") 3 | # Use ARM64 Cross-Compiler 4 | setup_toolchain("aarch64-linux-gnu") 5 | # Details 6 | set(CMAKE_SYSTEM_NAME "Linux") 7 | set(CMAKE_SYSTEM_PROCESSOR "aarch64") 8 | -------------------------------------------------------------------------------- /cmake/toolchain/armhf-toolchain.cmake: -------------------------------------------------------------------------------- 1 | # Compile For ARM 2 | include("${CMAKE_CURRENT_LIST_DIR}/base-toolchain.cmake") 3 | # Use ARM Cross-Compiler 4 | setup_toolchain("arm-linux-gnueabihf") 5 | # Details 6 | set(CMAKE_SYSTEM_NAME "Linux") 7 | set(CMAKE_SYSTEM_PROCESSOR "arm") 8 | -------------------------------------------------------------------------------- /cmake/toolchain/base-toolchain.cmake: -------------------------------------------------------------------------------- 1 | # Setup Toolchain 2 | macro(setup_toolchain target) 3 | # Target Variants 4 | set(target_variants "${target}") 5 | macro(add_target_variant value) 6 | string(REPLACE "-linux" "-${value}-linux" target_variant "${target}") 7 | list(APPEND target_variants "${target_variant}") 8 | endmacro() 9 | add_target_variant(unknown) 10 | add_target_variant(none) 11 | add_target_variant(pc) 12 | 13 | # Find Compiler 14 | macro(find_compiler output name) 15 | set(possible_names "") 16 | foreach(possible_target IN LISTS target_variants) 17 | list(APPEND possible_names "${possible_target}-${name}") 18 | endforeach() 19 | find_program( 20 | "${output}" 21 | NAMES ${possible_names} 22 | NO_CACHE 23 | ) 24 | if("${${output}}" STREQUAL "${output}-NOTFOUND") 25 | message(FATAL_ERROR "Unable To Find ${name}") 26 | endif() 27 | endmacro() 28 | find_compiler(CMAKE_C_COMPILER "gcc") 29 | find_compiler(CMAKE_CXX_COMPILER "g++") 30 | 31 | # Extra 32 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 33 | # Custom Search Paths 34 | set(CMAKE_FIND_ROOT_PATH "/usr/${target}" "/usr/lib/${target}" "/usr") 35 | # pkg-config 36 | set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/${target}/pkgconfig:/usr/${target}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig") 37 | endmacro() 38 | -------------------------------------------------------------------------------- /cmake/toolchain/prebuilt/armhf-toolchain.cmake: -------------------------------------------------------------------------------- 1 | # Target 2 | set(target "arm-linux-gnueabihf") 3 | 4 | # Pick Archive 5 | get_arch(arch) 6 | set(toolchain_name "arm-toolchain-${arch}") 7 | set(toolchain_dir "${CMAKE_CURRENT_BINARY_DIR}/${toolchain_name}") 8 | set(toolchain_file "${CMAKE_CURRENT_LIST_DIR}/../../../archives/${toolchain_name}.tar.xz") 9 | 10 | # Sysroot 11 | include("${CMAKE_CURRENT_LIST_DIR}/sysroot.cmake") 12 | 13 | # Extract If Needed 14 | file(SHA256 "${toolchain_file}" toolchain_hash) 15 | if(NOT (DEFINED CACHE{MCPI_TOOLCHAIN_HASH} AND toolchain_hash STREQUAL MCPI_TOOLCHAIN_HASH)) 16 | force_set(MCPI_TOOLCHAIN_HASH "${toolchain_hash}" INTERNAL) 17 | message(STATUS "Extracting Toolchain...") 18 | file(REMOVE_RECURSE "${toolchain_dir}") 19 | file(ARCHIVE_EXTRACT INPUT "${toolchain_file}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" TOUCH) 20 | 21 | # Force Toolchain 22 | file(WRITE "${toolchain_dir}/toolchain.cmake" 23 | "set(CMAKE_C_COMPILER \"\${CMAKE_CURRENT_LIST_DIR}/bin/${target}-gcc\")\n" 24 | "set(CMAKE_CXX_COMPILER \"\${CMAKE_CURRENT_LIST_DIR}/bin/${target}-g++\")\n" 25 | "set(CMAKE_SYSTEM_NAME \"Linux\")\n" 26 | "set(CMAKE_SYSTEM_PROCESSOR \"arm\")\n" 27 | "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n" 28 | ) 29 | force_set(MCPI_CMAKE_TOOLCHAIN_FILE "${toolchain_dir}/toolchain.cmake" FILEPATH) 30 | set(MCPI_FORCE_ARM_REBUILD TRUE) 31 | 32 | # Sysroot 33 | build_sysroot() 34 | endif() -------------------------------------------------------------------------------- /cmake/util/io.cmake: -------------------------------------------------------------------------------- 1 | # Make Directory 2 | function(set_and_mkdir name dir) 3 | set("${name}" "${dir}" PARENT_SCOPE) 4 | file(MAKE_DIRECTORY "${dir}") 5 | endfunction() 6 | 7 | # Download File With Error-Checking 8 | function(safe_download name url out) 9 | file(DOWNLOAD 10 | "${url}" 11 | "${out}" 12 | STATUS status 13 | ) 14 | list(GET status 0 status_code) 15 | list(GET status 1 error_message) 16 | if(NOT status_code EQUAL 0) 17 | message(FATAL_ERROR "Unable To Download ${name}: ${error_message}") 18 | else() 19 | message(STATUS "Downloaded ${name}: ${out}") 20 | endif() 21 | endfunction() 22 | 23 | # Symlink Function 24 | function(install_symlink target link) 25 | cmake_path(GET link PARENT_PATH parent) 26 | if(parent STREQUAL "") 27 | set(parent ".") 28 | endif() 29 | file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/symlink/${parent}") 30 | file(CREATE_LINK "${target}" "${CMAKE_BINARY_DIR}/symlink/${link}" SYMBOLIC) 31 | install(FILES "${CMAKE_BINARY_DIR}/symlink/${link}" DESTINATION "${parent}") 32 | endfunction() -------------------------------------------------------------------------------- /cmake/util/resource.c.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const unsigned char ${name}[] = { 4 | ${data} 5 | }; 6 | const size_t ${name}_len = sizeof(${name}); -------------------------------------------------------------------------------- /dependencies/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(dependencies) 2 | 3 | # stb_image 4 | if(BUILD_ARM_COMPONENTS) 5 | add_subdirectory(stb_image) 6 | endif() 7 | # Minecraft: Pi Edition 8 | if(BUILD_ARM_COMPONENTS AND NOT MCPI_OPEN_SOURCE_ONLY) 9 | add_subdirectory(minecraft-pi) 10 | endif() 11 | # LIEF 12 | if(BUILD_NATIVE_COMPONENTS OR BUILD_MEDIA_LAYER_CORE) 13 | add_subdirectory(LIEF) 14 | endif() 15 | # Extra Runtime 16 | add_subdirectory(runtime) 17 | # GLFW 18 | if(BUILD_NATIVE_COMPONENTS OR BUILD_MEDIA_LAYER_CORE) 19 | add_subdirectory(glfw) 20 | endif() 21 | # ImGui 22 | if(BUILD_NATIVE_COMPONENTS) 23 | add_subdirectory(imgui) 24 | endif() 25 | # UTF8-CPP 26 | add_subdirectory(utf8cpp) 27 | # Symbol Processor 28 | if(BUILD_ARM_COMPONENTS) 29 | add_subdirectory(symbol-processor) 30 | endif() 31 | -------------------------------------------------------------------------------- /dependencies/LIEF/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(LIEF) 2 | 3 | # Silence Warnings 4 | add_compile_options(-w -Wno-psabi) 5 | 6 | ## LIEF 7 | 8 | # Options 9 | force_set(LIEF_C_API FALSE BOOL) 10 | force_set(LIEF_EXAMPLES FALSE BOOL) 11 | force_set(LIEF_PYTHON_API FALSE BOOL) 12 | force_set(LIEF_TESTS FALSE BOOL) 13 | force_set(LIEF_USE_CCACHE FALSE BOOL) 14 | force_set(LIEF_LOGGING FALSE BOOL) 15 | force_set(LIEF_LOGGING_DEBUG FALSE BOOL) 16 | force_set(LIEF_ENABLE_JSON FALSE BOOL) 17 | force_set(LIEF_ELF TRUE BOOL) 18 | force_set(LIEF_PE FALSE BOOL) 19 | force_set(LIEF_MACHO FALSE BOOL) 20 | force_set(LIEF_DEX FALSE BOOL) 21 | force_set(LIEF_ART FALSE BOOL) 22 | force_set(LIEF_OAT FALSE BOOL) 23 | force_set(LIEF_VDEX FALSE BOOL) 24 | 25 | # Download 26 | set(MESSAGE_QUIET TRUE) 27 | add_subdirectory(src EXCLUDE_FROM_ALL SYSTEM) 28 | unset(MESSAGE_QUIET) 29 | 30 | # Install 31 | setup_library(LIB_LIEF TRUE TRUE) 32 | 33 | # License 34 | install(FILES src/LICENSE DESTINATION "${MCPI_LEGAL_DIR}/LIEF") 35 | 36 | # Fix Flags 37 | function(fix_flags property) 38 | get_target_property(flags LIB_LIEF "${property}") 39 | list(REMOVE_ITEM flags "_GLIBCXX_USE_CXX11_ABI=1") 40 | set_target_properties(LIB_LIEF PROPERTIES "${property}" "${flags}") 41 | endfunction() 42 | fix_flags(COMPILE_DEFINITIONS) 43 | fix_flags(INTERFACE_COMPILE_DEFINITIONS) -------------------------------------------------------------------------------- /dependencies/glfw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(glfw) 2 | 3 | # Silence Warnings 4 | add_compile_options(-w) 5 | 6 | ## GLFW 7 | 8 | # Download 9 | force_set(GLFW_BUILD_EXAMPLES FALSE BOOL) 10 | force_set(GLFW_BUILD_TESTS FALSE BOOL) 11 | force_set(GLFW_BUILD_DOCS FALSE BOOL) 12 | force_set(GLFW_INSTALL FALSE BOOL) 13 | force_set(GLFW_BUILD_WIN32 FALSE BOOL) 14 | force_set(GLFW_BUILD_COCOA FALSE BOOL) 15 | force_set(GLFW_BUILD_X11 TRUE BOOL) 16 | force_set(GLFW_BUILD_WAYLAND TRUE BOOL) 17 | force_set(GLFW_LIBRARY_TYPE "SHARED" STRING) 18 | set(MESSAGE_QUIET TRUE) 19 | add_subdirectory(src EXCLUDE_FROM_ALL SYSTEM) 20 | unset(MESSAGE_QUIET) 21 | 22 | # Install 23 | setup_library(glfw TRUE TRUE) 24 | 25 | # License 26 | install(FILES src/LICENSE.md DESTINATION "${MCPI_LEGAL_DIR}/GLFW") 27 | -------------------------------------------------------------------------------- /dependencies/imgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(imgui) 2 | 3 | # Silence Warnings 4 | add_compile_options(-w) 5 | 6 | ## ImGui 7 | 8 | # Build 9 | add_library(imgui SHARED 10 | src/imgui.cpp 11 | src/imgui_draw.cpp 12 | src/imgui_tables.cpp 13 | src/imgui_widgets.cpp 14 | src/misc/cpp/imgui_stdlib.cpp 15 | src/backends/imgui_impl_glfw.cpp 16 | src/backends/imgui_impl_opengl2.cpp 17 | ) 18 | setup_header_dirs(imgui 19 | "${CMAKE_CURRENT_SOURCE_DIR}/src" 20 | "${CMAKE_CURRENT_SOURCE_DIR}/src/backends" 21 | "${CMAKE_CURRENT_SOURCE_DIR}/src/misc/cpp" 22 | ) 23 | 24 | # OpenGL 25 | add_subdirectory(glad) 26 | target_link_libraries(imgui PUBLIC glfw glad) 27 | 28 | # Fonts 29 | embed_resource(imgui src/misc/fonts/Roboto-Medium.ttf) 30 | embed_resource(imgui src/misc/fonts/Cousine-Regular.ttf) 31 | 32 | # Configure 33 | target_compile_definitions(imgui PUBLIC 34 | IMGUI_DISABLE_DEMO_WINDOWS 35 | IMGUI_DISABLE_DEBUG_TOOLS 36 | IMGUI_DISABLE_DEFAULT_FONT 37 | IMGUI_DISABLE_OBSOLETE_FUNCTIONS 38 | ) 39 | 40 | # Patch 41 | execute_process( 42 | COMMAND "patch" "-p1" "--forward" "--reject-file=-" 43 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src" 44 | INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/fix-hidpi.patch" 45 | OUTPUT_QUIET 46 | ) 47 | 48 | # Install 49 | setup_library(imgui TRUE FALSE) 50 | 51 | # License 52 | install(FILES src/LICENSE.txt src/docs/FONTS.md DESTINATION "${MCPI_LEGAL_DIR}/ImGui") 53 | -------------------------------------------------------------------------------- /dependencies/imgui/glad/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(imgui-glad) 2 | 3 | # Directories 4 | set_and_mkdir(GLAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/glad") 5 | set_and_mkdir(GLAD_SRC_DIR "${GLAD_DIR}/src") 6 | set_and_mkdir(GLAD_INCLUDE_DIR "${GLAD_DIR}/include") 7 | 8 | # Files 9 | set(GLAD_SOURCES 10 | "${GLAD_INCLUDE_DIR}/KHR/khrplatform.h" 11 | "${GLAD_INCLUDE_DIR}/glad/glad.h" 12 | "${GLAD_SRC_DIR}/glad.c" 13 | ) 14 | 15 | # Find Python 16 | find_package(Python REQUIRED QUIET) 17 | 18 | # Generate 19 | add_custom_command(OUTPUT ${GLAD_SOURCES} 20 | COMMAND "${Python_EXECUTABLE}" 21 | ARGS "-m" "glad" 22 | "--out" "${GLAD_DIR}" 23 | "--api" "gl=1.1" 24 | "--generator" "c" 25 | "--reproducible" 26 | "--quiet" 27 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src" 28 | VERBATIM 29 | ) 30 | 31 | # Build 32 | add_library(glad SHARED ${GLAD_SOURCES}) 33 | target_compile_definitions(glad 34 | PUBLIC GLAD_GLAPI_EXPORT 35 | PRIVATE GLAD_GLAPI_EXPORT_BUILD 36 | ) 37 | 38 | # Link 39 | target_link_libraries(glad PRIVATE dl) 40 | 41 | # Headers 42 | setup_header_dirs(glad 43 | "${GLAD_INCLUDE_DIR}" 44 | "${CMAKE_CURRENT_SOURCE_DIR}/include" 45 | ) 46 | 47 | # Install 48 | setup_library(glad TRUE FALSE) -------------------------------------------------------------------------------- /dependencies/imgui/glad/include/GL/gl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include -------------------------------------------------------------------------------- /dependencies/minecraft-pi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(minecraft-pi) 2 | 3 | include(FetchContent) 4 | 5 | ## Minecraft: Pi Edition 6 | 7 | # Download 8 | FetchContent_Declare(minecraft-pi 9 | URL "${CMAKE_CURRENT_SOURCE_DIR}/minecraft-pi-0.1.1.tar.gz" 10 | ) 11 | FetchContent_MakeAvailable(minecraft-pi) 12 | 13 | # Install 14 | install( 15 | DIRECTORY "${minecraft-pi_SOURCE_DIR}/" 16 | DESTINATION "${MCPI_INSTALL_DIR}/game" 17 | USE_SOURCE_PERMISSIONS 18 | REGEX "api" EXCLUDE 19 | ) 20 | install_symlink("game/minecraft-pi" "${MCPI_INSTALL_DIR}/minecraft-pi") 21 | -------------------------------------------------------------------------------- /dependencies/minecraft-pi/minecraft-pi-0.1.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/dependencies/minecraft-pi/minecraft-pi-0.1.1.tar.gz -------------------------------------------------------------------------------- /dependencies/runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(runtime) 2 | 3 | ## Extra Runtime 4 | 5 | # Build 6 | add_subdirectory(src) -------------------------------------------------------------------------------- /dependencies/stb_image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(stb_image) 2 | 3 | # Silence Warnings 4 | add_compile_options(-w) 5 | 6 | ## stb_image 7 | 8 | # Build 9 | add_library(stb_image SHARED src/stb_image_impl.c) 10 | target_link_libraries(stb_image PRIVATE m) 11 | target_compile_definitions(stb_image PUBLIC STBI_ONLY_PNG) 12 | setup_header_dirs(stb_image "${CMAKE_CURRENT_SOURCE_DIR}/include") 13 | 14 | # Install 15 | setup_library(stb_image TRUE TRUE) 16 | 17 | # License 18 | install(FILES include/LICENSE DESTINATION "${MCPI_LEGAL_DIR}/stb_image") 19 | -------------------------------------------------------------------------------- /dependencies/stb_image/src/stb_image_impl.c: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_IMPLEMENTATION 2 | #define STB_IMAGE_WRITE_IMPLEMENTATION 3 | 4 | #include "stb_image.h" 5 | #include "stb_image_write.h" 6 | -------------------------------------------------------------------------------- /dependencies/symbol-processor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(symbol-processor) 2 | 3 | # Install Dependencies 4 | set(SRC "${CMAKE_CURRENT_SOURCE_DIR}/src") 5 | set(NODE_MODULES "${SRC}/node_modules") 6 | execute_process( 7 | COMMAND npm ci --silent 8 | WORKING_DIRECTORY "${SRC}" 9 | COMMAND_ERROR_IS_FATAL ANY 10 | ) 11 | -------------------------------------------------------------------------------- /dependencies/utf8cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(utf8cpp) 2 | 3 | # Silence Warnings 4 | add_compile_options(-w) 5 | 6 | ## stb_image 7 | 8 | # Build 9 | add_subdirectory(src EXCLUDE_FROM_ALL) 10 | 11 | # License 12 | install(FILES src/LICENSE DESTINATION "${MCPI_LEGAL_DIR}/UTF8-CPP") 13 | -------------------------------------------------------------------------------- /docs/CONTROLS.md: -------------------------------------------------------------------------------- 1 | # In-Game Controls 2 | 3 | ## Keyboard & Mouse 4 | | Action | Function | 5 | | --- | --- | 6 | | W | Move Forward | 7 | | A | Move Left | 8 | | S | Move Backward | 9 | | D | Move Right | 10 | | Space | Jump | 11 | | Shift | Sneak | 12 | | E | Open Inventory | 13 | | Q | Drop Item | 14 | | Ctrl+Q | Drop Item Stack | 15 | | 1-9 | Select Item In Toolbar/Hotbar | 16 | | Escape | Pause | 17 | | Tab | Lock/Unlock Mouse | 18 | | F11 | Fullscreen | 19 | | F2 | Screenshot | 20 | | F1 | Hide GUI | 21 | | F5 | Change Perspective | 22 | | T | Open Chat | 23 | | Mouse Movement | Camera Control | 24 | | Scroll Wheel | Cycle Selected Item In Toolbar | 25 | | Left-CLick | Attack/Destroy | 26 | | Right-Click | Use Item/Place Block | 27 | -------------------------------------------------------------------------------- /docs/CREDITS.md: -------------------------------------------------------------------------------- 1 | # Credits 2 | | Project | Reason | 3 | | --- | --- | 4 | | [mhsjlw/mcpilauncher](https://web.archive.org/web/20220727030722/https://github.com/mhsjlw/mcpilauncher/blob/master/trampoline/trampoline.c) | Information On Getting Minecraft: Pi Edition To Run On Desktop Linux | 5 | | [Phirel's Survival Patch](https://www.minecraftforum.net/forums/minecraft-editions/minecraft-pi-edition/1960005-survival-mode-patch) | Information On Survival Mode Support | 6 | | [zhuowei/MinecraftPEModWiki](https://github.com/zhuowei/MinecraftPEModWiki/wiki/How-some-unlocks-are-made) | Information On Smooth Lighting Support | 7 | | [zhuowei/RaspberryJuice](https://github.com/zhuowei/RaspberryJuice) | Design Of RaspberryJuice Extended API | 8 | | [Ghidra](https://ghidra-sre.org) | Used For Decompiling Minecraft: Pi Edition | 9 | | [RetDec](https://retdec.com) | Used For Decompiling Minecraft: Pi Edition | 10 | | [minecraft-linux/mcpelauncher-core](https://github.com/minecraft-linux/mcpelauncher-core/blob/6b5e17b5685a612143297ae4595bdd12327284f3/src/patch_utils.cpp#L42) | Original Function Overwrite Code | 11 | | [Hooking C Functions at Runtime - Thomas Finch](http://thomasfinch.me/blog/2015/07/24/Hooking-C-Functions-At-Runtime.html) | Original Patching Code | 12 | | [ReMinecraftPE](https://github.com/ReMinecraftPE/mcpe) | A Lot Of Decompiled Code | 13 | | [Bigjango](https://github.com/Bigjango13) | A Ton Of Programming Contributions | -------------------------------------------------------------------------------- /docs/CUSTOM_SKINS.md: -------------------------------------------------------------------------------- 1 | # Custom Skins 2 | MCPI-Reborn supports downloading custom skins from [a central skin server](https://github.com/MCPI-Revival/Skins). Skins are downloaded based on the current MCPI username. 3 | 4 | > [!NOTE] 5 | > This *does not* cache skins and *will not* work without internet access. 6 | 7 | Custom skins can be disabled using the `Load Custom Skins` feature flag. 8 | -------------------------------------------------------------------------------- /docs/DEDICATED_SERVER.md: -------------------------------------------------------------------------------- 1 | # Dedicated Server 2 | The dedicated server is a version of Minecraft: Pi Edition modified to run in a headless environment. 3 | It loads settings from a `server.properties` file. 4 | 5 | Compatibility with vanilla MCPE/MCPI can be enabled; 6 | however, this will break compatibility with many configurations of MCPI-Reborn. 7 | 8 | ## Setup 9 | To use, run the normal AppImage with the `--server` argument. It will generate the world and `server.properties` in the current directory. 10 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | * [View Getting Started](GETTING_STARTED.md) 3 | * [View Dedicated Server](DEDICATED_SERVER.md) 4 | * [View Credits](CREDITS.md) 5 | * [View Terminology](TERMINOLOGY.md) 6 | * [View In-Game Controls](CONTROLS.md) 7 | * [View Custom Skins](CUSTOM_SKINS.md) 8 | * [View API](API.md) 9 | * [View Changelog](CHANGELOG.md) 10 | * [View Modding Guide](modding/README.md) -------------------------------------------------------------------------------- /docs/TERMINOLOGY.md: -------------------------------------------------------------------------------- 1 | # Terminology 2 | | Name | Description | 3 | | --- | --- | 4 | | MCPI | Shorthand for Minecraft: Pi Edition | 5 | | MCPE | Shorthand for Minecraft: Pocket Edition | 6 | | Host Architecture | The native architecture of the CPU that MCPI-Reborn will be running on | 7 | | Native Component | A component that *can* be compiled for the host architecture | 8 | | ARM Component | A component that *must* be compiled for ARM | 9 | | Server Mode | A mode where MCPI is patched into behaving like a dedicated server | 10 | | Client Mode | The normal behavior of MCPI | 11 | | Stub | An implementation of a library where all functions either do nothing or error | 12 | -------------------------------------------------------------------------------- /docs/modding/README.md: -------------------------------------------------------------------------------- 1 | # Modding Guide 2 | In addition to various built-in mods, MCPI-Reborn includes an SDK for creating custom mods. 3 | 4 | This tutorial explains how to set up and use it. 5 | 6 | ## Chapters 7 | 1. [My First Mod](MY_FIRST_MOD.md) 8 | 2. [Beginner Modding](BEGINNER.md) 9 | 3. [Intermediate Modding](INTERMEDIATE.md) 10 | 4. [Introduction To Ghidra](GHIDRA.md) 11 | 5. [Advanced Modding](ADVANCED.md) 12 | 13 | ## Examples 14 | Example mods can be found [here](../../example-mods). -------------------------------------------------------------------------------- /example-mods/README.md: -------------------------------------------------------------------------------- 1 | # Example Mods 2 | These are example mods that can be built using the modding SDK. 3 | 4 | * **Expanded Creative Mod**: This mod adds even more items and blocks to the Creative Inventory. It was originally by [@Bigjango13](https://github.com/bigjango13). 5 | * **Chat Commands Mod**: This mod makes a chat message starting with `\` handled by the MCPI API. 6 | * **Recipes Mod**: This mod adds custom recipes. 7 | * **Custom Block Mod**: This mod adds a custom block. -------------------------------------------------------------------------------- /example-mods/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Create Output Directory 6 | cd "$(dirname "$0")" 7 | ROOT="$(pwd)" 8 | OUT="${ROOT}/out" 9 | rm -rf "${OUT}" 10 | mkdir -p "${OUT}" 11 | 12 | # Build 13 | build() { 14 | cd "${ROOT}/$1" 15 | # Build 16 | rm -rf build 17 | mkdir build 18 | cd build 19 | cmake -GNinja .. 20 | cmake --build . 21 | # Copy Result 22 | cp lib*.so "${OUT}" 23 | } 24 | build chat-commands 25 | build expanded-creative 26 | build recipes 27 | build custom-block -------------------------------------------------------------------------------- /example-mods/chat-commands/.gitignore: -------------------------------------------------------------------------------- 1 | /cmake-build-* 2 | /.idea 3 | /build 4 | -------------------------------------------------------------------------------- /example-mods/chat-commands/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16.0) 2 | 3 | # Build For ARM 4 | set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc") 5 | set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++") 6 | set(CMAKE_SYSTEM_NAME "Linux") 7 | set(CMAKE_SYSTEM_PROCESSOR "arm") 8 | 9 | # Start Project 10 | project(chat-commands) 11 | 12 | # Include SDK 13 | include("$ENV{HOME}/.minecraft-pi/sdk/lib/minecraft-pi-reborn/sdk/sdk.cmake") 14 | 15 | # Build 16 | add_library(chat-commands SHARED 17 | src/chat-commands.cpp 18 | src/server-console-command.cpp 19 | ) 20 | target_link_libraries(chat-commands mods reborn-util symbols) 21 | -------------------------------------------------------------------------------- /example-mods/chat-commands/src/server-console-command.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | // Add Server Command 6 | HOOK(server_get_commands, std::vector *, (Minecraft *minecraft, ServerSideNetworkHandler *server_side_network_handler)) { 7 | // Call Original Method 8 | std::vector *commands = real_server_get_commands()(minecraft, server_side_network_handler); 9 | // Add Command 10 | commands->push_back({ 11 | .name = "greet", 12 | .comment = "Example Custom Command", 13 | .callback = [](MCPI_UNUSED const std::string &cmd) { 14 | INFO("Hello World!"); 15 | } 16 | }); 17 | // Return 18 | return commands; 19 | } -------------------------------------------------------------------------------- /example-mods/custom-block/.gitignore: -------------------------------------------------------------------------------- 1 | /cmake-build-* 2 | /.idea 3 | /build 4 | -------------------------------------------------------------------------------- /example-mods/custom-block/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16.0) 2 | 3 | # Build For ARM 4 | set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc") 5 | set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++") 6 | set(CMAKE_SYSTEM_NAME "Linux") 7 | set(CMAKE_SYSTEM_PROCESSOR "arm") 8 | 9 | # Start Project 10 | project(custom-block) 11 | 12 | # Include SDK 13 | include("$ENV{HOME}/.minecraft-pi/sdk/lib/minecraft-pi-reborn/sdk/sdk.cmake") 14 | 15 | # Build 16 | add_library(custom-block SHARED src/custom-block.cpp) 17 | target_link_libraries(custom-block mods symbols) 18 | -------------------------------------------------------------------------------- /example-mods/custom-block/src/custom-block.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // Custom Tile 5 | struct CustomBlock final : CustomTile { 6 | // Constructor 7 | CustomBlock(): CustomTile(252, 30, Material::glass) {} 8 | 9 | // On Use 10 | bool use(Level *level, int x, int y, int z, Player *player) override { 11 | if (!level->is_client_side) { 12 | player->displayClientMessage("Hello World!"); 13 | } 14 | return true; 15 | } 16 | }; 17 | static constexpr const char *description_id = "custom_block"; 18 | static Tile *block; 19 | 20 | // Init 21 | __attribute__((constructor)) static void init_custom_block() { 22 | // Construct Block 23 | misc_run_on_tiles_setup([]() { 24 | block = (new CustomBlock())->self; 25 | block->init(); 26 | block->setDescriptionId(description_id); 27 | }); 28 | // Add To Creative Inventory 29 | misc_run_on_creative_inventory_setup([](FillingContainer *inventory) { 30 | inventory->addItem(new ItemInstance { 31 | .count = 1, 32 | .id = block->id, 33 | .auxiliary = 0 34 | }); 35 | }); 36 | // Add Language String 37 | misc_run_on_language_setup([]() { 38 | I18n::_strings[std::string("tile.") + description_id + ".name"] = "Custom Block"; 39 | }); 40 | } -------------------------------------------------------------------------------- /example-mods/expanded-creative/.gitignore: -------------------------------------------------------------------------------- 1 | /cmake-build-* 2 | /.idea 3 | /build 4 | -------------------------------------------------------------------------------- /example-mods/expanded-creative/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16.0) 2 | 3 | # Build For ARM 4 | set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc") 5 | set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++") 6 | set(CMAKE_SYSTEM_NAME "Linux") 7 | set(CMAKE_SYSTEM_PROCESSOR "arm") 8 | 9 | # Start Project 10 | project(expanded-creative) 11 | 12 | # Include SDK 13 | include("$ENV{HOME}/.minecraft-pi/sdk/lib/minecraft-pi-reborn/sdk/sdk.cmake") 14 | 15 | # Build 16 | add_library(expanded-creative SHARED src/expanded-creative.cpp) 17 | target_link_libraries(expanded-creative mods reborn-util symbols) 18 | -------------------------------------------------------------------------------- /example-mods/recipes/.gitignore: -------------------------------------------------------------------------------- 1 | /cmake-build-* 2 | /.idea 3 | /build 4 | -------------------------------------------------------------------------------- /example-mods/recipes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16.0) 2 | 3 | # Build For ARM 4 | set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc") 5 | set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++") 6 | set(CMAKE_SYSTEM_NAME "Linux") 7 | set(CMAKE_SYSTEM_PROCESSOR "arm") 8 | 9 | # Start Project 10 | project(recipes) 11 | 12 | # Include SDK 13 | include("$ENV{HOME}/.minecraft-pi/sdk/lib/minecraft-pi-reborn/sdk/sdk.cmake") 14 | 15 | # Build 16 | add_library(recipes SHARED src/recipes.cpp) 17 | target_link_libraries(recipes mods reborn-util symbols) 18 | -------------------------------------------------------------------------------- /images/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(images) 2 | 3 | # Logo 4 | install( 5 | FILES "modern_logo.png" 6 | DESTINATION "${MCPI_INSTALL_DIR}/data/images/gui" 7 | ) 8 | 9 | # Title Background 10 | install( 11 | FILES "background.png" 12 | DESTINATION "${MCPI_INSTALL_DIR}/data/images/gui" 13 | RENAME "titleBG.png" 14 | ) 15 | 16 | # Mojang Textures 17 | install( 18 | FILES "mojang/chest.png" 19 | DESTINATION "${MCPI_INSTALL_DIR}/data/images/item" 20 | ) 21 | install( 22 | FILES "mojang/shadow.png" "mojang/vignette.png" "mojang/grasscolor.png" 23 | DESTINATION "${MCPI_INSTALL_DIR}/data/images/misc" 24 | ) 25 | 26 | # Icon 27 | set(ICON_DIR "${MCPI_SHARE_DIR}/icons/hicolor/512x512/apps") 28 | set(ICON_NAME "${MCPI_APP_ID}.png") 29 | install( 30 | FILES "icon.png" 31 | DESTINATION "${ICON_DIR}" 32 | RENAME "${ICON_NAME}" 33 | ) 34 | set(ICON_PATH "${ICON_DIR}/${ICON_NAME}") 35 | cmake_path(RELATIVE_PATH ICON_PATH BASE_DIRECTORY "${MCPI_INSTALL_DIR}") 36 | target_compile_definitions(launcher PRIVATE "ICON_PATH=\"${ICON_PATH}\"") 37 | 38 | # AppImage 39 | if(MCPI_IS_APPIMAGE_BUILD) 40 | install_symlink("${ICON_DIR}/${MCPI_APP_ID}.png" "${MCPI_APP_ID}.png") 41 | install_symlink("${MCPI_APP_ID}.png" ".DirIcon") 42 | endif() 43 | -------------------------------------------------------------------------------- /images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/background.png -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/icon.png -------------------------------------------------------------------------------- /images/modern_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/modern_logo.png -------------------------------------------------------------------------------- /images/mojang/chest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/mojang/chest.png -------------------------------------------------------------------------------- /images/mojang/grasscolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/mojang/grasscolor.png -------------------------------------------------------------------------------- /images/mojang/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/mojang/shadow.png -------------------------------------------------------------------------------- /images/mojang/vignette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/mojang/vignette.png -------------------------------------------------------------------------------- /images/screenshots/launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/screenshots/launcher.png -------------------------------------------------------------------------------- /images/screenshots/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/images/screenshots/start.png -------------------------------------------------------------------------------- /launcher/data/launcher.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=${MCPI_APP_TITLE} 3 | Comment=Fun with Blocks 4 | Icon=${MCPI_APP_ID} 5 | Exec=${MCPI_APP_NAME} 6 | Type=Application 7 | Categories=Game; 8 | Terminal=false 9 | StartupNotify=false 10 | StartupWMClass=${MCPI_APP_ID} -------------------------------------------------------------------------------- /launcher/src/bootstrap/assets.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "bootstrap.h" 4 | #include "../util/util.h" 5 | 6 | // Setup Asset Paths 7 | static void setup_path(const char *env_name, std::string assets_path) { 8 | chop_last_component(assets_path); 9 | assets_path += "/data"; 10 | set_and_print_env(env_name, assets_path.c_str()); 11 | } 12 | void bootstrap_assets(const std::string &original_game_binary) { 13 | setup_path(_MCPI_REBORN_ASSETS_PATH_ENV, safe_realpath("/proc/self/exe")); 14 | setup_path(_MCPI_VANILLA_ASSETS_PATH_ENV, original_game_binary); 15 | } -------------------------------------------------------------------------------- /launcher/src/bootstrap/bootstrap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void bootstrap(); 7 | // Debugging 8 | void print_debug_information(); 9 | // Mods 10 | std::vector bootstrap_mods(const std::string &binary_directory); 11 | // Assets 12 | void bootstrap_assets(const std::string &original_game_binary); 13 | // ELF 14 | extern const std::string patched_exe_path; 15 | std::string get_new_linker(const std::string &binary_directory); 16 | std::vector get_ld_path(const std::string &binary_directory); 17 | void patch_mcpi_elf_dependencies(const std::string &original_path, const std::string &interpreter, const std::vector &rpath, const std::vector &mods); -------------------------------------------------------------------------------- /launcher/src/bootstrap/debug.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "bootstrap.h" 6 | 7 | // Debug Information 8 | static void run_debug_command(const char *const command[], const char *prefix) { 9 | int status = 0; 10 | const std::vector *output = run_command(command, &status); 11 | if (!is_exit_status_success(status)) { 12 | ERR("Unable To Gather Debug Information"); 13 | } 14 | std::string output_str = (const char *) output->data(); 15 | delete output; 16 | // Trim 17 | const std::string::size_type length = output_str.length(); 18 | if (length > 0 && output_str[length - 1] == '\n') { 19 | output_str.pop_back(); 20 | } 21 | // Print 22 | DEBUG("%s: %s", prefix, output_str.c_str()); 23 | } 24 | void print_debug_information() { 25 | // System Information 26 | constexpr const char *const command[] = {"uname", "-a", nullptr}; 27 | run_debug_command(command, "System Information"); 28 | 29 | // Version 30 | DEBUG("Reborn Version: %s", reborn_get_fancy_version().c_str()); 31 | 32 | // Architecture 33 | std::string arch = reborn_config.general.arch; 34 | for (char &c : arch) { 35 | c = char(std::toupper(c)); 36 | } 37 | DEBUG("Reborn Target Architecture: %s", arch.c_str()); 38 | } -------------------------------------------------------------------------------- /launcher/src/client/cache.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // Cache Version 6 | #define CACHE_VERSION 1 7 | 8 | // Load Cache 9 | struct State; 10 | State load_cache(); 11 | 12 | // Save Cache 13 | void write_cache(std::ostream &stream, const State &state); 14 | void save_cache(const State &state); 15 | 16 | // Wipe Cache 17 | void wipe_cache(); 18 | -------------------------------------------------------------------------------- /launcher/src/logger/logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | std::string get_logs_folder(); 6 | void setup_logger(); 7 | void show_report(const char *log_filename); -------------------------------------------------------------------------------- /launcher/src/options/option-list.h: -------------------------------------------------------------------------------- 1 | OPTION(debug, "debug", 'd', "Enable Debug Logging") 2 | OPTION(copy_sdk, "copy-sdk", -2, "Extract Modding SDK And Exit") 3 | OPTION(disable_logger, "disable-logger", -1, "Disable Logger (And Crash Report Dialog)") 4 | OPTION(use_default, "default", -3, "Skip Client-Mode Configuration Dialog") 5 | OPTION(no_cache, "no-cache", -4, "Disable Client-Mode Configuration Cache") 6 | OPTION(wipe_cache, "wipe-cache", -5, "Wipe Cached Client-Mode Configuration And Exit") 7 | OPTION(print_available_feature_flags, "print-available-feature-flags", -6, "Print Available Client-Mode Feature Flags") 8 | OPTION(benchmark, "benchmark", -7, "Run Client-Mode Benchmark") 9 | OPTION(only_generate, "only-generate", -8, "Generate World And Exit (Server-Mode Only)") 10 | OPTION(force_headless, "force-headless", -9, "Force Disable Game Rendering") 11 | OPTION(force_non_headless, "force-non-headless", -10, "Force Enable Game Rendering") 12 | OPTION(server_mode, "server", -11, "Run In Server-Mode") 13 | OPTION(run_update, "update", -13, "Run Updater (If Available)") 14 | OPTION(run_install, "install-desktop-entry", -14, "Install Desktop File And Icon") -------------------------------------------------------------------------------- /launcher/src/options/parser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define OPTION(name, ...) bool name; 4 | struct options_t { 5 | #include "option-list.h" 6 | }; 7 | #undef OPTION 8 | options_t parse_options(int argc, char *argv[]); -------------------------------------------------------------------------------- /launcher/src/ui/frame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // UI Frame 10 | struct Frame { 11 | Frame(const char *title, int width, int height); 12 | virtual ~Frame(); 13 | // Prevent Copying 14 | Frame(const Frame &) = delete; 15 | Frame &operator=(const Frame &) = delete; 16 | // Run 17 | int run(); 18 | virtual int render() = 0; 19 | protected: 20 | // API For Sub-Classes 21 | ImFont *monospace = nullptr; 22 | static float get_frame_width(const char *str); 23 | static void draw_right_aligned_buttons(const std::vector &buttons, const std::function &callback, bool should_actually_center = false); 24 | static constexpr const char *quit_text = "Quit"; 25 | private: 26 | // Properties 27 | GLFWwindow *window = nullptr; 28 | // Internal Methods 29 | float get_scale(); 30 | void setup_style(float scale); 31 | static void patch_colors(ImGuiStyle &style); 32 | }; -------------------------------------------------------------------------------- /launcher/src/updater/updater.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // Update Status 7 | enum class UpdateStatus { 8 | NOT_STARTED, 9 | CHECKING, 10 | UP_TO_DATE, 11 | DOWNLOADING, 12 | RESTART_NEEDED, 13 | ERROR 14 | }; 15 | 16 | // Updater 17 | struct Updater { 18 | // Instance 19 | static Updater *instance; 20 | 21 | // Constructor 22 | Updater(); 23 | virtual ~Updater() = default; 24 | 25 | // Methods 26 | [[nodiscard]] std::string get_status() const; 27 | void log_status(bool is_ui) const; 28 | [[nodiscard]] bool can_start() const; 29 | void start(); 30 | void run(); 31 | 32 | protected: 33 | // Implementation 34 | virtual std::optional check() = 0; 35 | virtual bool download(const std::string &version) = 0; 36 | virtual void restart() = 0; 37 | 38 | private: 39 | // Properties 40 | UpdateStatus status = UpdateStatus::NOT_STARTED; 41 | }; -------------------------------------------------------------------------------- /launcher/src/util/env.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "util.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | // Profile Directory 10 | void setup_home() { 11 | const char *custom_profile_directory = getenv(MCPI_PROFILE_DIRECTORY_ENV); 12 | std::string home; 13 | if (custom_profile_directory != nullptr) { 14 | // Custom Directory 15 | home = safe_realpath(custom_profile_directory); 16 | } else if (!reborn_is_server()) { 17 | // Ensure $HOME 18 | const char *value = getenv("HOME"); 19 | if (value == nullptr) { 20 | ERR("$HOME Is Not Set"); 21 | } 22 | home = value; 23 | // Flatpak 24 | if (reborn_config.packaging == RebornConfig::PackagingType::FLATPAK) { 25 | home += std::string("/.var/app/") + reborn_config.app.id; 26 | } 27 | } else { 28 | // Set Home To The Current Directory, So World Data Is Stored There 29 | char *launch_directory = getcwd(nullptr, 0); 30 | if (launch_directory == nullptr) { 31 | IMPOSSIBLE(); 32 | } 33 | home = launch_directory; 34 | free(launch_directory); 35 | } 36 | // Set 37 | set_and_print_env(_MCPI_HOME_ENV, home.c_str()); 38 | } -------------------------------------------------------------------------------- /launcher/src/util/util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // Paths 7 | void chop_last_component(std::string &str); 8 | std::string safe_realpath(const std::string &path); 9 | bool read_directory(const std::string &path, const std::function &callback, bool allow_nonexistent_dir = false); 10 | void make_directory(std::string path); 11 | void copy_file(const std::string &src, const std::string &dst, bool log = false); 12 | 13 | // Binary 14 | std::string get_binary(); 15 | std::string get_binary_directory(); 16 | std::string get_appimage_path(); 17 | 18 | // SDK 19 | void copy_sdk(const std::string &binary_directory, bool force); 20 | 21 | // Copying Desktop File 22 | bool is_desktop_file_installed(); 23 | void copy_desktop_file(); 24 | 25 | // Environment 26 | void setup_home(); -------------------------------------------------------------------------------- /libreborn/include/libreborn/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // Config 6 | struct RebornConfig { 7 | // General 8 | struct { 9 | const char *version; 10 | const char *author; 11 | const char *arch; 12 | } general; 13 | 14 | // App Information 15 | struct { 16 | const char *title; 17 | const char *id; 18 | const char *name; 19 | } app; 20 | 21 | // Extra Options 22 | struct { 23 | const char *skin_server; 24 | const char *discord_invite; 25 | const char *repo_url; 26 | } extra; 27 | 28 | // Documentation 29 | struct { 30 | const char *base; 31 | const char *getting_started; 32 | const char *changelog; 33 | } docs; 34 | 35 | // Internal 36 | struct { 37 | bool use_prebuilt_armhf_toolchain; 38 | const char *sdk_dir; 39 | } internal; 40 | 41 | // Packaging 42 | enum class PackagingType { 43 | NONE, 44 | APPIMAGE, 45 | FLATPAK, 46 | DEBIAN 47 | }; 48 | PackagingType packaging; 49 | struct { 50 | const char *json_url; 51 | const char *version_placeholder; 52 | const char *download_url; 53 | } appimage; 54 | }; 55 | extern const RebornConfig reborn_config; 56 | 57 | // Fancy Version Name 58 | std::string reborn_get_fancy_version(); 59 | 60 | // Runtime Configuration 61 | bool reborn_is_headless(); 62 | bool reborn_is_server(); -------------------------------------------------------------------------------- /libreborn/include/libreborn/env/env.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define ENV(name, ...) constexpr const char *name##_ENV = #name; 6 | #include "list.h" 7 | #undef ENV 8 | 9 | bool is_env_var_internal(const char *env); 10 | void clear_internal_env_vars(); 11 | 12 | // Set Environmental Variable 13 | void setenv_safe(const char *name, const char *value); 14 | void set_and_print_env(const char *name, const char *value); 15 | 16 | // Get Value 17 | const char *require_env(const char *name); 18 | 19 | // Convert Variable To Value And Vice-Versa 20 | struct Flags; 21 | struct ServerList; 22 | #define overload(type) \ 23 | std::string obj_to_env_value(const type &obj); \ 24 | void env_value_to_obj(type &out, const char *value) 25 | overload(std::string); 26 | overload(float); 27 | overload(Flags); 28 | overload(ServerList); 29 | #undef overload -------------------------------------------------------------------------------- /libreborn/include/libreborn/env/list.h: -------------------------------------------------------------------------------- 1 | // Configure Client 2 | ENV(MCPI_FEATURE_FLAGS, "Client-Mode Feature Flags") 3 | ENV(MCPI_USERNAME, "Player Username") 4 | ENV(MCPI_RENDER_DISTANCE, "Render Distance") 5 | ENV(MCPI_SERVER_LIST, "Server List") 6 | // Game Assets 7 | ENV(_MCPI_REBORN_ASSETS_PATH, "") 8 | ENV(_MCPI_VANILLA_ASSETS_PATH, "") 9 | // Command Line Arguments 10 | ENV(_MCPI_BENCHMARK, "") 11 | ENV(_MCPI_ONLY_GENERATE, "") 12 | // Logging 13 | ENV(_MCPI_LOG_FD, "") 14 | ENV(MCPI_DEBUG, "Enable Debug Logging") 15 | // Server/Headless 16 | ENV(_MCPI_SERVER_MODE, "") 17 | ENV(_MCPI_FORCE_HEADLESS, "") 18 | ENV(_MCPI_FORCE_NON_HEADLESS, "") 19 | // Extra Configuration 20 | ENV(MCPI_SKIN_SERVER, "Custom Skin Server") 21 | ENV(MCPI_API_PORT, "Custom API Port") 22 | ENV(MCPI_BLOCK_OUTLINE_WIDTH, "Custom Width For Block Outline (In Pixels)") 23 | ENV(MCPI_GUI_SCALE, "Custom GUI Scale") 24 | ENV(MCPI_BINARY, "Custom Game Binary") 25 | // $HOME 26 | ENV(_MCPI_HOME, "") 27 | ENV(MCPI_PROFILE_DIRECTORY, "Custom Profile Directory") 28 | // Lock File 29 | ENV(_MCPI_LOCK_FD, "") -------------------------------------------------------------------------------- /libreborn/include/libreborn/env/servers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | // Parse servers.txt 8 | struct ServerList { 9 | ServerList(); 10 | // Type 11 | typedef unsigned short port_t; 12 | typedef std::pair Entry; 13 | // Load 14 | static port_t parse_port(const std::string &s); 15 | void load(const std::string &str); 16 | // Save 17 | [[nodiscard]] std::string to_string() const; 18 | // Entries 19 | std::vector entries; 20 | }; -------------------------------------------------------------------------------- /libreborn/include/libreborn/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | // Log File 8 | int reborn_get_log_fd(); 9 | void reborn_set_log(int fd); 10 | // Debug Logging 11 | extern const char *reborn_debug_tag; 12 | int reborn_get_debug_fd(); 13 | 14 | // Logging 15 | #define INFO(format, ...) fprintf(stderr, "[INFO]: " format "\n", ##__VA_ARGS__) 16 | #define WARN(format, ...) fprintf(stderr, "[WARN]: " format "\n", ##__VA_ARGS__) 17 | #define DEBUG(format, ...) dprintf(reborn_get_debug_fd(), "[DEBUG]: %s" format "\n", reborn_debug_tag, ##__VA_ARGS__) 18 | #define ERR(format, ...) \ 19 | ({ \ 20 | fprintf(stderr, "[ERR]: (%s:%i): " format "\n", __FILE__, __LINE__, ##__VA_ARGS__); \ 21 | _exit(EXIT_FAILURE); \ 22 | }) 23 | #define IMPOSSIBLE() ERR("This Should Never Be Called") 24 | #define CONDITIONAL_ERR(is_error, ...) \ 25 | ({ \ 26 | if ((is_error)) { \ 27 | ERR(__VA_ARGS__); \ 28 | } else { \ 29 | WARN(__VA_ARGS__); \ 30 | } \ 31 | }) 32 | -------------------------------------------------------------------------------- /libreborn/include/libreborn/util/exec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | // fork() With I/O 11 | struct Process { 12 | static constexpr int fd_count = 3; 13 | Process(pid_t pid_, const std::array &fds_); 14 | // Close 15 | void close_fd(int i); 16 | [[nodiscard]] int close(); 17 | // Data 18 | const pid_t pid; 19 | const std::array fds; 20 | std::unordered_set closed; 21 | }; 22 | std::optional fork_with_stdio(); 23 | void poll_fds(const std::vector &fds, const std::function &on_data); 24 | 25 | // Safe execvpe() 26 | __attribute__((noreturn)) void safe_execvpe(const char *const argv[], const char *const envp[]); 27 | 28 | // Run Command And Get Output 29 | std::vector *run_command(const char *const command[], int *exit_status); 30 | bool is_exit_status_success(int status); 31 | 32 | // Get Exit Status String 33 | std::string get_exit_status_string(int status); 34 | 35 | // Open URL 36 | void open_url(const std::string &url); -------------------------------------------------------------------------------- /libreborn/include/libreborn/util/glfw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // GLFW Helpers 4 | #ifndef GLFW_VERSION_MAJOR 5 | #error "Missing GLFW" 6 | #endif 7 | 8 | void init_glfw(); 9 | GLFWwindow *create_glfw_window(const char *title, int width, int height); 10 | void cleanup_glfw(GLFWwindow *window); 11 | void get_glfw_scale(GLFWwindow *window, float *x_scale, float *y_scale); -------------------------------------------------------------------------------- /libreborn/include/libreborn/util/io.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // Safe Version Of pipe() 6 | struct Pipe { 7 | Pipe(); 8 | const int read; 9 | const int write; 10 | }; 11 | 12 | // Lock File 13 | int lock_file(const char *file); 14 | void unlock_file(int fd); 15 | 16 | // Safe write() 17 | void safe_write(int fd, const void *buf, size_t size); -------------------------------------------------------------------------------- /libreborn/include/libreborn/util/string.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // Sanitize String 6 | void sanitize_string(std::string &str, int max_length, bool allow_newlines); 7 | 8 | // CP437 9 | unsigned char utf32_to_cp437(char32_t codepoint); 10 | std::string to_cp437(const std::string &input); 11 | std::string from_cp437(const std::string &input); 12 | 13 | // Format Time 14 | std::string format_time(const char *fmt); 15 | std::string format_time(const char *fmt, int time); 16 | 17 | // Trimming 18 | void trim(std::string &str); -------------------------------------------------------------------------------- /libreborn/src/fake-libpng/empty.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCPI-Revival/minecraft-pi-reborn/5975d165b0726b14c337f3056c83951305d07678/libreborn/src/fake-libpng/empty.c -------------------------------------------------------------------------------- /libreborn/src/fake-libpng/empty.vers: -------------------------------------------------------------------------------- 1 | PNG12_0 { global: *; }; 2 | -------------------------------------------------------------------------------- /libreborn/src/patch/patch-internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef __arm__ 4 | #error "Patching Code Is ARM Only" 5 | #endif 6 | 7 | #include 8 | 9 | // Segments 10 | struct segment_data { 11 | void *start; 12 | void *end; 13 | bool is_executable; 14 | bool is_writable; 15 | }; 16 | MCPI_INTERNAL segment_data &get_data_for_addr(void *addr); 17 | MCPI_INTERNAL void add_segment(segment_data data); 18 | 19 | // Code Block 20 | MCPI_INTERNAL void *update_code_block(void *target); 21 | MCPI_INTERNAL void increment_code_block(); 22 | 23 | // BL Instruction Magic Number 24 | #define BL_INSTRUCTION 0xeb 25 | #define B_INSTRUCTION 0xea 26 | MCPI_INTERNAL bool is_branch_instruction(unsigned char opcode); 27 | MCPI_INTERNAL uint32_t generate_bl_instruction(void *from, void *to, unsigned char opcode = BL_INSTRUCTION); 28 | -------------------------------------------------------------------------------- /libreborn/src/util/log.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | // Debug Tag 9 | const char *reborn_debug_tag = ""; 10 | 11 | // Log File 12 | static constexpr int unset_fd = -1; 13 | static int log_fd = unset_fd; 14 | int reborn_get_log_fd() { 15 | if (log_fd != unset_fd) { 16 | return log_fd; 17 | } 18 | // Open Log File 19 | const char *fd_str = getenv(_MCPI_LOG_FD_ENV); 20 | log_fd = fd_str ? std::stoi(fd_str) : -2; 21 | // Return 22 | return reborn_get_log_fd(); 23 | } 24 | void reborn_set_log(const int fd) { 25 | // Set Variable 26 | log_fd = unset_fd; 27 | setenv_safe(_MCPI_LOG_FD_ENV, fd >= 0 ? std::to_string(fd).c_str() : nullptr); 28 | } 29 | 30 | // Debug Logging 31 | static bool should_print_debug_to_stderr() { 32 | return getenv(MCPI_DEBUG_ENV) != nullptr; 33 | } 34 | int reborn_get_debug_fd() { 35 | return should_print_debug_to_stderr() ? STDERR_FILENO : reborn_get_log_fd(); 36 | } -------------------------------------------------------------------------------- /media-layer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(media-layer) 2 | 3 | # Add Headers 4 | add_library(media-layer-headers INTERFACE) 5 | setup_header_dirs(media-layer-headers "${CMAKE_CURRENT_SOURCE_DIR}/include") 6 | setup_library(media-layer-headers FALSE TRUE) 7 | 8 | # Add Core 9 | if(BUILD_MEDIA_LAYER_CORE) 10 | add_subdirectory(core) 11 | endif() 12 | 13 | # Add Trampoline 14 | if(MCPI_USE_MEDIA_LAYER_TRAMPOLINE) 15 | add_subdirectory(trampoline) 16 | endif() 17 | -------------------------------------------------------------------------------- /media-layer/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(media-layer-core) 2 | 3 | # Build 4 | add_library(media-layer-core SHARED 5 | src/base.cpp 6 | src/window/media.cpp 7 | src/window/cursor.cpp 8 | src/window/util.cpp 9 | src/window/events.cpp 10 | src/window/offscreen.cpp 11 | src/window/gles.cpp 12 | src/audio/api.cpp 13 | src/audio/engine.cpp 14 | src/audio/file.cpp 15 | ) 16 | 17 | # Install 18 | setup_library(media-layer-core TRUE TRUE) 19 | 20 | # Link 21 | find_library(OPENAL_LIBRARY NAMES openal REQUIRED) 22 | target_link_libraries(media-layer-core 23 | PUBLIC 24 | media-layer-headers 25 | reborn-util 26 | dl 27 | PRIVATE 28 | "${OPENAL_LIBRARY}" 29 | m 30 | glfw 31 | LIB_LIEF 32 | ) 33 | -------------------------------------------------------------------------------- /media-layer/core/src/audio/audio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | MCPI_INTERNAL void _media_audio_delete_sources(); 6 | 7 | MCPI_INTERNAL void _media_audio_init(); 8 | MCPI_INTERNAL void _media_audio_cleanup(); 9 | MCPI_INTERNAL int _media_audio_is_loaded(); 10 | 11 | MCPI_INTERNAL ALuint _media_audio_get_buffer(const char *source, const char *name); 12 | MCPI_INTERNAL void _media_audio_delete_buffers(); -------------------------------------------------------------------------------- /media-layer/core/src/base.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "window/media.h" 6 | 7 | // SDL Is Replaced With GLFW 8 | int media_SDL_Init(MCPI_UNUSED uint32_t flags) { 9 | return 0; 10 | } 11 | 12 | // Event Queue 13 | static std::queue queue; 14 | int media_SDL_PollEvent(SDL_Event *event) { 15 | // Handle External Events 16 | _media_handle_media_SDL_PollEvent(); 17 | 18 | // Poll Event 19 | int ret; 20 | if (!queue.empty()) { 21 | *event = queue.front(); 22 | queue.pop(); 23 | ret = 1; 24 | } else { 25 | ret = 0; 26 | } 27 | return ret; 28 | } 29 | int media_SDL_PushEvent(const SDL_Event *event) { 30 | queue.push(*event); 31 | return 1; 32 | } 33 | -------------------------------------------------------------------------------- /media-layer/core/src/window/media.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define GLFW_INCLUDE_NONE 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | // Interactivity 15 | MCPI_INTERNAL extern bool is_interactable; 16 | 17 | // Window 18 | MCPI_INTERNAL extern GLFWwindow *glfw_window; 19 | 20 | // Cursor 21 | MCPI_INTERNAL void _media_update_cursor(); 22 | MCPI_INTERNAL extern bool ignore_relative_motion; 23 | MCPI_INTERNAL extern bool raw_mouse_motion_enabled; 24 | 25 | // Events 26 | MCPI_INTERNAL void _media_register_event_listeners(); 27 | MCPI_INTERNAL void _media_handle_media_SDL_PollEvent(); 28 | MCPI_INTERNAL void _media_glfw_motion(GLFWwindow *window, double xpos, double ypos); -------------------------------------------------------------------------------- /media-layer/core/src/window/offscreen.cpp: -------------------------------------------------------------------------------- 1 | #include "media.h" 2 | 3 | #include 4 | 5 | // Offscreen Rendering 6 | static GLFWwindow *offscreen_window = nullptr; 7 | void media_begin_offscreen_render(const int width, const int height) { 8 | if (!glfw_window) { 9 | IMPOSSIBLE(); 10 | } 11 | // Setup GLFW 12 | glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); 13 | glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); 14 | glfwWindowHint(GLFW_ALPHA_BITS, 8); 15 | glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); 16 | glfwWindowHint(GLFW_DECORATED, GLFW_FALSE); 17 | glfwWindowHint(GLFW_ALPHA_BITS, 8); 18 | // Open Window 19 | offscreen_window = glfwCreateWindow(width, height, "Offscreen Rendering", nullptr, glfw_window); 20 | if (!offscreen_window) { 21 | ERR("Unable To Create Offscreen Window"); 22 | } 23 | // Switch Context 24 | glfwMakeContextCurrent(offscreen_window); 25 | media_context_id++; 26 | // Check Framebuffer Size 27 | int fb_width; 28 | int fb_height; 29 | glfwGetFramebufferSize(offscreen_window, &fb_width, &fb_height); 30 | if (fb_width != width || fb_height != height) { 31 | ERR("Offscreen Framebuffer Has Invalid Size"); 32 | } 33 | } 34 | void media_end_offscreen_render() { 35 | // Destroy Window 36 | glfwDestroyWindow(offscreen_window); 37 | offscreen_window = nullptr; 38 | // Switch Context 39 | glfwMakeContextCurrent(glfw_window); 40 | media_context_id++; 41 | } -------------------------------------------------------------------------------- /media-layer/include/EGL/egl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | #define EGL_TRUE 1 8 | 9 | typedef unsigned int EGLenum; 10 | typedef unsigned int EGLBoolean; 11 | typedef void *EGLDisplay; 12 | typedef void *EGLConfig; 13 | typedef void *EGLSurface; 14 | typedef void *EGLContext; 15 | typedef int32_t EGLint; 16 | 17 | typedef void *EGLNativeDisplayType; 18 | typedef XID EGLNativeWindowType; 19 | typedef EGLNativeWindowType NativeWindowType; 20 | typedef EGLNativeDisplayType NativeDisplayType; -------------------------------------------------------------------------------- /media-layer/include/SDL/SDL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | 5 | #include 6 | 7 | #include "SDL_keysym.h" 8 | #include "SDL_events.h" 9 | #include "SDL_syswm.h" 10 | #include "SDL_version.h" 11 | 12 | int media_SDL_Init(uint32_t flags); 13 | int media_SDL_PollEvent(SDL_Event *event); 14 | int media_SDL_PushEvent(const SDL_Event *event); 15 | void media_SDL_WM_SetCaption(const char *title, const char *icon); 16 | 17 | typedef enum { 18 | SDL_GRAB_QUERY = -1, 19 | SDL_GRAB_OFF = 0, 20 | SDL_GRAB_ON = 1, 21 | SDL_GRAB_FULLSCREEN 22 | } SDL_GrabMode; 23 | SDL_GrabMode media_SDL_WM_GrabInput(SDL_GrabMode mode); 24 | 25 | #define SDL_QUERY (-1) 26 | #define SDL_IGNORE 0 27 | #define SDL_DISABLE 0 28 | #define SDL_ENABLE 1 29 | int media_SDL_ShowCursor(int toggle); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /media-layer/include/SDL/SDL_keysym.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef enum { 4 | SDLK_UNKNOWN = 0, 5 | SDLK_BACKSPACE = 8, 6 | SDLK_TAB = 9, 7 | SDLK_RETURN = 13, 8 | SDLK_ESCAPE = 27, 9 | SDLK_SPACE = 32, 10 | SDLK_0 = 48, 11 | SDLK_1 = 49, 12 | SDLK_2 = 50, 13 | SDLK_3 = 51, 14 | SDLK_4 = 52, 15 | SDLK_5 = 53, 16 | SDLK_6 = 54, 17 | SDLK_7 = 55, 18 | SDLK_8 = 56, 19 | SDLK_9 = 57, 20 | SDLK_a = 97, 21 | SDLK_d = 100, 22 | SDLK_e = 101, 23 | SDLK_q = 113, 24 | SDLK_s = 115, 25 | SDLK_t = 116, 26 | SDLK_w = 119, 27 | SDLK_DELETE = 127, 28 | SDLK_UP = 273, 29 | SDLK_DOWN = 274, 30 | SDLK_RIGHT = 275, 31 | SDLK_LEFT = 276, 32 | SDLK_F1 = 282, 33 | SDLK_F2 = 283, 34 | SDLK_F3 = 284, 35 | SDLK_F5 = 286, 36 | SDLK_F11 = 292, 37 | SDLK_F12 = 293, 38 | SDLK_RSHIFT = 303, 39 | SDLK_LSHIFT = 304 40 | } SDLKey; 41 | 42 | typedef enum { 43 | KMOD_NONE = 0x0, 44 | KMOD_LSHIFT = 0x1, 45 | KMOD_RSHIFT = 0x2, 46 | KMOD_LCTRL = 0x40, 47 | KMOD_RCTRL = 0x80, 48 | KMOD_LALT = 0x100, 49 | KMOD_RALT = 0x200 50 | } SDLMod; 51 | 52 | #define KMOD_SHIFT (KMOD_LSHIFT | KMOD_RSHIFT) 53 | #define KMOD_CTRL (KMOD_LCTRL | KMOD_RCTRL) 54 | #define KMOD_ALT (KMOD_LALT | KMOD_RALT) 55 | -------------------------------------------------------------------------------- /media-layer/include/SDL/SDL_syswm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "SDL_version.h" 6 | 7 | typedef enum { 8 | SDL_SYSWM_X11 9 | } SDL_SYSWM_TYPE; 10 | 11 | typedef struct SDL_SysWMinfo { 12 | SDL_version version; 13 | SDL_SYSWM_TYPE subsystem; 14 | union { 15 | struct { 16 | void *display; 17 | XID window; 18 | void (*lock_func)(); 19 | void (*unlock_func)(); 20 | XID fswindow; 21 | XID wmwindow; 22 | void *gfxdisplay; 23 | } x11; 24 | } info; 25 | } SDL_SysWMinfo; 26 | -------------------------------------------------------------------------------- /media-layer/include/SDL/SDL_version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | typedef struct SDL_version { 6 | uint8_t major; 7 | uint8_t minor; 8 | uint8_t patch; 9 | } SDL_version; 10 | -------------------------------------------------------------------------------- /media-layer/include/X11/Xlib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef unsigned long XID; 4 | typedef struct { 5 | int x, y; 6 | int width, height; 7 | int border_width; 8 | int depth; 9 | void *visual; 10 | XID root; 11 | int clazz; 12 | int bit_gravity; 13 | int win_gravity; 14 | int backing_store; 15 | unsigned long backing_planes; 16 | unsigned long backing_pixel; 17 | int save_under; 18 | XID colormap; 19 | int map_installed; 20 | int map_state; 21 | long all_event_masks; 22 | long your_event_mask; 23 | long do_not_propagate_mask; 24 | int override_redirect; 25 | void *screen; 26 | } XWindowAttributes; 27 | -------------------------------------------------------------------------------- /media-layer/include/media-layer/audio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void media_audio_update(float volume, float x, float y, float z, float yaw); 8 | void media_audio_play(const char *source, const char *name, float x, float y, float z, float pitch, float volume, int is_ui); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | -------------------------------------------------------------------------------- /media-layer/include/media-layer/core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | // Default Window Size 8 | #define DEFAULT_WIDTH 840 9 | #define DEFAULT_HEIGHT 480 10 | 11 | // SDL User Events 12 | #define USER_EVENT_CHARACTER 0 // data1 = 8-Bit Character 13 | #define USER_EVENT_REAL_KEY 1 // data1 = SDL_RELEASED/PRESSED, data2 = GLFW Key Code 14 | 15 | void media_toggle_fullscreen(); 16 | void media_swap_buffers(); 17 | void media_cleanup(); 18 | void media_get_framebuffer_size(int *width, int *height); 19 | void media_set_interactable(int toggle); 20 | void media_disable_vsync(); 21 | void media_set_raw_mouse_motion_enabled(int enabled); 22 | int media_has_extension(const char *name); 23 | void media_begin_offscreen_render(int width, int height); 24 | void media_end_offscreen_render(); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /media-layer/trampoline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(media-layer-trampoline) 2 | 3 | # Common Sources 4 | set(MEDIA_LAYER_TRAMPOLINE_SRC src/media-layer-core.cpp src/GLESv1_CM.cpp) 5 | 6 | # Build 7 | if(BUILD_NATIVE_COMPONENTS) 8 | # Host Component 9 | add_library("${TRAMPOLINE_LIBRARY_NAME}" src/host/host.cpp ${MEDIA_LAYER_TRAMPOLINE_SRC}) 10 | target_link_libraries("${TRAMPOLINE_LIBRARY_NAME}" 11 | reborn-util 12 | media-layer-core 13 | trampoline-headers 14 | ) 15 | target_compile_definitions("${TRAMPOLINE_LIBRARY_NAME}" PRIVATE MEDIA_LAYER_TRAMPOLINE_HOST) 16 | # Install 17 | setup_library("${TRAMPOLINE_LIBRARY_NAME}" TRUE TRUE) 18 | elseif(BUILD_ARM_COMPONENTS) 19 | # Guest Component 20 | add_library(media-layer-core SHARED ${MEDIA_LAYER_TRAMPOLINE_SRC}) 21 | target_link_libraries(media-layer-core 22 | PUBLIC 23 | media-layer-headers 24 | PRIVATE 25 | reborn-util 26 | trampoline 27 | ) 28 | target_compile_definitions(media-layer-core PRIVATE MEDIA_LAYER_TRAMPOLINE_GUEST) 29 | # Install 30 | setup_library(media-layer-core TRUE TRUE) 31 | endif() 32 | -------------------------------------------------------------------------------- /media-layer/trampoline/src/common/common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #if __BYTE_ORDER != __LITTLE_ENDIAN 9 | #error "Only Little Endian Is Supported" 10 | #endif 11 | 12 | static_assert(sizeof(int) == sizeof(int32_t)); 13 | #define block_pointer(T) static_assert(!std::is_pointer::value, "Do Not Use Raw Pointers Here") 14 | 15 | #if defined(MEDIA_LAYER_TRAMPOLINE_HOST) 16 | #include "../host/host.h" 17 | #elif defined(MEDIA_LAYER_TRAMPOLINE_GUEST) 18 | #include "../guest/guest.h" 19 | #else 20 | #error "Invalid Configuration" 21 | #endif -------------------------------------------------------------------------------- /media-layer/trampoline/src/host/host.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "host.h" 4 | 5 | // Registration 6 | static handler_t *handlers[256]; 7 | void _add_handler(const unsigned char id, handler_t *handler) { 8 | if (handlers[id]) { 9 | ERR("Conflicting Trampolines For ID: %i", (int) id); 10 | } 11 | handlers[id] = handler; 12 | } 13 | 14 | // Trampoline 15 | uint32_t trampoline(const trampoline_writer_t writer, const uint32_t id, const unsigned char *args) { 16 | return handlers[id](writer, args); 17 | } -------------------------------------------------------------------------------- /mods/include/mods/api/api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | extern "C" { 7 | void api_add_chat_event(const Player *sender, const std::string &message); 8 | void api_update_entity_position(const Entity *entity, const RakNet_RakNetGUID *guid = nullptr); 9 | } -------------------------------------------------------------------------------- /mods/include/mods/atlas/atlas.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | void atlas_update_tile(Textures *textures, int texture, const unsigned char *pixels); 5 | } -------------------------------------------------------------------------------- /mods/include/mods/bucket/bucket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern bool buckets_enabled; 4 | -------------------------------------------------------------------------------- /mods/include/mods/chat/chat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern "C" { 6 | // Override using the HOOK() macro to provide customized chat behavior. 7 | void ServerSideNetworkHandler_handle_ChatPacket_injection(ServerSideNetworkHandler *server_side_network_handler, const RakNet_RakNetGUID &rak_net_guid, ChatPacket *chat_packet); 8 | void chat_send_message_to_clients(ServerSideNetworkHandler *server_side_network_handler, const Player *sender, const char *message); 9 | void chat_handle_packet_send(const Minecraft *minecraft, ChatPacket *packet); 10 | bool chat_is_sending(); 11 | } 12 | -------------------------------------------------------------------------------- /mods/include/mods/classic-ui/classic-ui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern "C" { 6 | std::remove_reference_t get_blit_with_classic_hud_offset(); 7 | int get_classic_hud_y_offset(Minecraft *minecraft); 8 | } -------------------------------------------------------------------------------- /mods/include/mods/compat/compat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | int compat_check_exit_requested(); 5 | void compat_request_exit(); 6 | } -------------------------------------------------------------------------------- /mods/include/mods/creative/creative.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | extern void *const Gui_tick_Minecraft_isCreativeMode_addr; 5 | } -------------------------------------------------------------------------------- /mods/include/mods/feature/feature.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Flags In Server-Mode 4 | static constexpr bool server_enabled = true; 5 | static constexpr bool server_disabled = false; 6 | extern bool feature_server_flags_set; 7 | #define FLAG(name) extern bool server_##name 8 | #include "server.h" 9 | #undef FLAG 10 | #define server_is_not_vanilla_compatible (!server_is_vanilla_compatible) 11 | 12 | // Check If The Flag Is Enabled 13 | extern "C" { 14 | bool feature_has(const char *name, bool enabled_in_server_mode); 15 | } 16 | -------------------------------------------------------------------------------- /mods/include/mods/feature/server.h: -------------------------------------------------------------------------------- 1 | FLAG(is_vanilla_compatible); 2 | FLAG(force_mob_spawning); 3 | FLAG(generate_caves); 4 | FLAG(death_messages); -------------------------------------------------------------------------------- /mods/include/mods/fps/fps.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern double fps; 4 | extern double tps; -------------------------------------------------------------------------------- /mods/include/mods/game-mode/game-mode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | int get_seed_from_string(std::string str); -------------------------------------------------------------------------------- /mods/include/mods/init/init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | void init_version(); 5 | void init_compat(); 6 | void init_server(); 7 | void init_server_flags(); 8 | void init_multiplayer(); 9 | void init_benchmark(); 10 | void init_sound(); 11 | void init_input(); 12 | void init_camera(); 13 | void init_atlas(); 14 | void init_title_screen(); 15 | void init_skin(); 16 | void init_fps(); 17 | void init_touch(); 18 | void init_textures(); 19 | void init_creative(); 20 | void init_game_mode(); 21 | void init_misc(); 22 | void init_death(); 23 | void init_options(); 24 | void init_chat(); 25 | void init_bucket(); 26 | void init_cake(); 27 | void init_override(); 28 | void init_screenshot(); 29 | void init_f3(); 30 | void init_multidraw(); 31 | void init_classic_ui(); 32 | void init_api(); 33 | void init_shading(); 34 | } 35 | -------------------------------------------------------------------------------- /mods/include/mods/input/input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | void input_set_is_right_click(int val); 5 | void input_set_is_ctrl(bool val); 6 | 7 | enum { 8 | #define KEY(name, value) MC_KEY_##name = (value), 9 | #include "key-list.h" 10 | #undef KEY 11 | }; 12 | } -------------------------------------------------------------------------------- /mods/include/mods/input/key-list.h: -------------------------------------------------------------------------------- 1 | // MCPI Seems To Use https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes 2 | KEY(BACKSPACE, 0x8) 3 | KEY(DELETE, 0x2e) 4 | KEY(LEFT, 0x25) 5 | KEY(UP, 0x26) 6 | KEY(RIGHT, 0x27) 7 | KEY(DOWN, 0x28) 8 | KEY(F1, 0x70) 9 | KEY(F2, 0x71) 10 | KEY(F3, 0x72) 11 | KEY(F5, 0x74) 12 | KEY(F11, 0x7a) 13 | KEY(RETURN, 0xd) 14 | KEY(t, 0x54) 15 | KEY(q, 0x51) 16 | KEY(ESCAPE, 0x1b) -------------------------------------------------------------------------------- /mods/include/mods/multidraw/multidraw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern "C" { 6 | void LevelRenderer_renderSameAsLast(LevelRenderer *self, float delta); 7 | } 8 | -------------------------------------------------------------------------------- /mods/include/mods/multiplayer/packets.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Used To Designate Special Behavior 4 | void multiplayer_negate(int &x); 5 | 6 | // Armor Inventory Size 7 | static constexpr int multiplayer_armor_size = 4; 8 | 9 | // ContainerSetContentPacket IDs 10 | 11 | // Used To Overwrite Inventory 12 | static constexpr unsigned char multiplayer_inventory_container_id = 0; // This Is Also A Valid Container ID 13 | // Used To Overwrite Armor 14 | // This Is Added By Reborn 15 | static constexpr unsigned char multiplayer_armor_container_id = 200; -------------------------------------------------------------------------------- /mods/include/mods/options/options.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // Sound 6 | static constexpr const char *info_sound_data_loaded = "Loaded"; 7 | extern std::string info_sound_data_state; 8 | 9 | // Difficulty 10 | static constexpr int difficulty_normal = 2; 11 | static constexpr int difficulty_peaceful = 0; -------------------------------------------------------------------------------- /mods/include/mods/override/override.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern "C" { 6 | std::string override_get_path(std::string filename); 7 | } -------------------------------------------------------------------------------- /mods/include/mods/screenshot/screenshot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct Gui; 4 | 5 | extern "C" { 6 | void screenshot_take(Gui *gui); 7 | } -------------------------------------------------------------------------------- /mods/include/mods/server/properties.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | struct ServerProperty { 8 | static std::vector &get_all(); 9 | const std::string key; 10 | const std::string def; 11 | const std::string comment; 12 | ServerProperty(const std::string &key_, const std::string &def_, const std::string &comment_): 13 | key(key_), 14 | def(def_), 15 | comment(comment_) 16 | { 17 | get_all().push_back(this); 18 | } 19 | }; 20 | 21 | struct ServerProperties { 22 | void load(std::istream &stream); 23 | [[nodiscard]] std::string get_string(const ServerProperty &property) const; 24 | [[nodiscard]] int get_int(const ServerProperty &property) const; 25 | [[nodiscard]] bool get_bool(const ServerProperty &property) const; 26 | private: 27 | std::map properties; 28 | }; 29 | -------------------------------------------------------------------------------- /mods/include/mods/server/server.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "properties.h" 6 | 7 | struct ServerCommand { 8 | const std::string name; 9 | const std::string comment; 10 | const std::function callback; 11 | [[nodiscard]] bool has_args() const; 12 | [[nodiscard]] std::string get_lhs_help() const; 13 | [[nodiscard]] std::string get_full_help(int max_lhs_length) const; 14 | }; 15 | 16 | extern "C" { 17 | std::vector *server_get_commands(Minecraft *minecraft, ServerSideNetworkHandler *server_side_network_handler); 18 | ServerProperties &get_server_properties(); 19 | void server_kick(const ServerPlayer *player); 20 | } -------------------------------------------------------------------------------- /mods/include/mods/sound/sound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | extern std::unordered_map> sound_repository; 7 | -------------------------------------------------------------------------------- /mods/include/mods/text-input-box/TextInputBox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct TextInputBox { 6 | explicit TextInputBox(const std::string &placeholder = "", const std::string &text = ""); 7 | ~TextInputBox(); 8 | 9 | GuiComponent *component; 10 | 11 | void setSize(int x, int y, int width = 200, int height = 12); 12 | void init(Font *pFont); 13 | void setEnabled(bool bEnabled); 14 | void keyPressed(int key); 15 | void charPressed(int k); 16 | void render(); 17 | void tick(); 18 | void setFocused(bool b); 19 | void onClick(int x, int y); 20 | [[nodiscard]] bool clicked(int xPos, int yPos) const; 21 | [[nodiscard]] std::string getText() const; 22 | void setText(const std::string &text); 23 | [[nodiscard]] bool isFocused() const; 24 | void setMaxLength(int max_length); 25 | 26 | private: 27 | void recalculateScroll(); 28 | 29 | std::string m_text; 30 | bool m_bFocused; 31 | int m_xPos; 32 | int m_yPos; 33 | int m_width; 34 | int m_height; 35 | std::string m_placeholder; 36 | bool m_bEnabled; 37 | bool m_bCursorOn; 38 | int m_insertHead; 39 | int m_lastFlashed; 40 | Font *m_pFont; 41 | int m_maxLength; 42 | int m_scrollPos; 43 | }; 44 | -------------------------------------------------------------------------------- /mods/include/mods/text-input-box/TextInputScreen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | struct TextInputScreen : CustomScreen { 8 | std::vector *m_textInputs = nullptr; 9 | 10 | void keyPressed(int key) override; 11 | void keyboardNewChar(char key) override; 12 | void mouseClicked(int x, int y, int param_1) override; 13 | void render(int x, int y, float param_1) override; 14 | void init() override; 15 | ~TextInputScreen() override; 16 | }; 17 | -------------------------------------------------------------------------------- /mods/include/mods/textures/textures.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct Texture; 6 | 7 | extern "C" { 8 | void media_glTexSubImage2D_with_scaling(const Texture *target, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLfloat normal_texture_width, GLfloat normal_texture_height, const void *pixels); 9 | void textures_add(int width, int height, const unsigned char *pixels); 10 | } -------------------------------------------------------------------------------- /mods/include/mods/title-screen/title-screen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | extern "C" { 7 | void title_screen_load_splashes(std::vector &splashes); 8 | } -------------------------------------------------------------------------------- /mods/include/mods/touch/touch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern int touch_gui; 6 | extern "C" { 7 | Button *touch_create_button(int id, const std::string &text); 8 | } -------------------------------------------------------------------------------- /mods/include/mods/version/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | const char *version_get(); 5 | } -------------------------------------------------------------------------------- /mods/src/api/README.md: -------------------------------------------------------------------------------- 1 | # `api` Mod 2 | This mod extends the builtin API. See [here](../../../docs/API.md) for documentation. This [diagram](diagram.drawio) also provides some implementation details. -------------------------------------------------------------------------------- /mods/src/api/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | MCPI_INTERNAL extern bool api_compat_mode; 10 | 11 | static constexpr int no_entity_id = -1; 12 | static constexpr char arg_separator = ','; // Used For Arguments And Tuples 13 | static constexpr char list_separator = '|'; // Used For Lists 14 | 15 | MCPI_INTERNAL std::string api_get_input(std::string message); 16 | MCPI_INTERNAL std::string api_get_output(std::string message, bool replace_comma); 17 | MCPI_INTERNAL std::string api_join_outputs(const std::vector &pieces, char separator); 18 | 19 | MCPI_INTERNAL void api_convert_to_outside_entity_type(int &type); 20 | MCPI_INTERNAL void api_convert_to_mcpi_entity_type(int &type); 21 | 22 | MCPI_INTERNAL void _init_api_events(); 23 | MCPI_INTERNAL void _init_api_misc(); 24 | MCPI_INTERNAL void _init_api_socket(); 25 | 26 | MCPI_INTERNAL std::string api_handle_event_command(CommandServer *server, const ConnectedClient &client, const std::string_view &cmd, std::optional id); 27 | MCPI_INTERNAL void api_free_event_data(int sock); 28 | MCPI_INTERNAL void api_free_all_event_data(); 29 | 30 | MCPI_INTERNAL extern bool api_suppress_chat_events; 31 | -------------------------------------------------------------------------------- /mods/src/atlas/README.md: -------------------------------------------------------------------------------- 1 | # `atlas` Mod 2 | This mod allows regenerating the `gui_blocks` atlas at runtime. 3 | -------------------------------------------------------------------------------- /mods/src/benchmark/README.md: -------------------------------------------------------------------------------- 1 | # `benchmark` Mod 2 | This mod contain a simple game benchmark. 3 | -------------------------------------------------------------------------------- /mods/src/bucket/README.md: -------------------------------------------------------------------------------- 1 | # `bucket` Mod 2 | This mod adds buckets. 3 | -------------------------------------------------------------------------------- /mods/src/cake/README.md: -------------------------------------------------------------------------------- 1 | # `cake` Mod 2 | This mod adds cake. 3 | -------------------------------------------------------------------------------- /mods/src/camera/README.md: -------------------------------------------------------------------------------- 1 | # `camera` Mod 2 | This mod fixes the Camera's renderer so that it is no longer invisible. 3 | -------------------------------------------------------------------------------- /mods/src/chat/README.md: -------------------------------------------------------------------------------- 1 | # `chat` Mod 2 | This mod implements a chat system. 3 | -------------------------------------------------------------------------------- /mods/src/chat/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | // Message Limitations 8 | #define MAX_CHAT_MESSAGE_LENGTH 256 9 | 10 | // Message Prefix 11 | MCPI_INTERNAL std::string _chat_get_prefix(const char *username); 12 | // Queue Message For Sending 13 | MCPI_INTERNAL void _chat_send_message_to_server(const Minecraft *minecraft, const char *message); 14 | // Init Chat UI 15 | MCPI_INTERNAL void _init_chat_ui(); 16 | MCPI_INTERNAL void _chat_clear_history(); -------------------------------------------------------------------------------- /mods/src/classic-ui/README.md: -------------------------------------------------------------------------------- 1 | # `classic-ui` Mod 2 | This mod adjusts the UI to make it more similar to Java Edition. -------------------------------------------------------------------------------- /mods/src/compat/README.md: -------------------------------------------------------------------------------- 1 | # `compat` Mod 2 | This utility mod ensures compatibility with the host system. This includes fixing events, handling signals, and patching out bad function calls. -------------------------------------------------------------------------------- /mods/src/compat/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Stubs 4 | MCPI_INTERNAL void _patch_egl_calls(); 5 | MCPI_INTERNAL void _patch_x11_calls(); 6 | MCPI_INTERNAL void _patch_bcm_host_calls(); 7 | MCPI_INTERNAL void _patch_sdl_calls(); 8 | 9 | // Functionality 10 | MCPI_INTERNAL void _init_compat_sdl(); 11 | -------------------------------------------------------------------------------- /mods/src/compat/readdir.cpp: -------------------------------------------------------------------------------- 1 | #define __USE_LARGEFILE64 2 | 3 | #include 4 | 5 | // Minecraft: Pi Edition Was Not Compiled With 64-Bit Filesystem Support, So This Shims readdir() To Read Directories Properly 6 | 7 | #define FILENAME_SIZE 256 8 | 9 | dirent *readdir(DIR *dirp) { 10 | const dirent64 *original = readdir64(dirp); 11 | if (original == nullptr) { 12 | return nullptr; 13 | } 14 | static dirent new_dirent; 15 | for (int i = 0; i < FILENAME_SIZE; i++) { 16 | new_dirent.d_name[i] = original->d_name[i]; 17 | } 18 | new_dirent.d_type = original->d_type; 19 | return &new_dirent; 20 | } 21 | -------------------------------------------------------------------------------- /mods/src/compat/stubs/bcm_host.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../internal.h" 3 | 4 | // Do Nothing Function 5 | static void do_nothing() { 6 | // NOP 7 | } 8 | 9 | // Patch bcm_host Calls 10 | void _patch_bcm_host_calls() { 11 | // Disable bcm_host Calls 12 | overwrite_call_manual((void *) 0xdfec, (void *) do_nothing); // bcm_host_init 13 | overwrite_call_manual((void *) 0x12418, (void *) do_nothing); // bcm_host_deinit 14 | overwrite_call_manual((void *) 0x125a8, (void *) do_nothing); // graphics_get_display_size 15 | overwrite_call_manual((void *) 0x125dc, (void *) do_nothing); // vc_dispmanx_display_open 16 | overwrite_call_manual((void *) 0x125e8, (void *) do_nothing); // vc_dispmanx_update_start 17 | overwrite_call_manual((void *) 0x12618, (void *) do_nothing); // vc_dispmanx_element_add 18 | overwrite_call_manual((void *) 0x12624, (void *) do_nothing); // vc_dispmanx_update_submit_sync 19 | } 20 | -------------------------------------------------------------------------------- /mods/src/compat/stubs/sdl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include "../internal.h" 6 | 7 | // SDL Stub 8 | static void *SDL_SetVideoMode_injection(MCPI_UNUSED int width, MCPI_UNUSED int height, MCPI_UNUSED int bpp, MCPI_UNUSED uint32_t flags) { 9 | // Return Value Is Only Used For A NULL-Check 10 | return (void *) 1; 11 | } 12 | 13 | // Window Information 14 | static void x11_nop() { 15 | // NOP 16 | } 17 | static int SDL_GetWMInfo_injection(SDL_SysWMinfo *info) { 18 | // Return Fake Lock Functions Since XLib Isn't Directly Used 19 | SDL_SysWMinfo ret; 20 | ret.info.x11.lock_func = x11_nop; 21 | ret.info.x11.unlock_func = x11_nop; 22 | ret.info.x11.display = nullptr; 23 | ret.info.x11.window = 0; 24 | ret.info.x11.wmwindow = ret.info.x11.window; 25 | *info = ret; 26 | return 1; 27 | } 28 | 29 | // Quit 30 | static void SDL_Quit_injection() { 31 | // Cleanup Media Layer 32 | media_cleanup(); 33 | // Exit 34 | INFO("Stopped"); 35 | } 36 | 37 | // Patch SDL Calls 38 | void _patch_sdl_calls() { 39 | // Disable SDL Calls 40 | overwrite_call_manual((void *) 0xe020, (void *) SDL_SetVideoMode_injection); 41 | overwrite_call_manual((void *) 0x13284, (void *) SDL_GetWMInfo_injection); 42 | overwrite_call_manual((void *) 0x12410, (void *) SDL_Quit_injection); 43 | } 44 | -------------------------------------------------------------------------------- /mods/src/compat/stubs/x11.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include "../internal.h" 6 | 7 | // Functions That Have Their Return Values Used 8 | static int XTranslateCoordinates_injection(MCPI_UNUSED void *display, MCPI_UNUSED XID src_w, MCPI_UNUSED XID dest_w, int src_x, int src_y, int *dest_x_return, int *dest_y_return, MCPI_UNUSED XID *child_return) { 9 | // Use MCPI Replacement Function 10 | *dest_x_return = src_x; 11 | *dest_y_return = src_y; 12 | return 1; 13 | } 14 | static int XGetWindowAttributes_injection(MCPI_UNUSED void *display, MCPI_UNUSED XID w, XWindowAttributes *window_attributes_return) { 15 | // Use MCPI Replacement Function 16 | XWindowAttributes attributes = {}; 17 | attributes.x = 0; 18 | attributes.y = 0; 19 | media_get_framebuffer_size(&attributes.width, &attributes.height); 20 | *window_attributes_return = attributes; 21 | return 1; 22 | } 23 | 24 | // Patch X11 Calls 25 | void _patch_x11_calls() { 26 | // Disable X11 Calls 27 | overwrite_call_manual((void *) 0x132a4, (void *) XGetWindowAttributes_injection); // XGetWindowAttributes 28 | overwrite_call_manual((void *) 0x132d4, (void *) XTranslateCoordinates_injection); // XTranslateCoordinates 29 | } 30 | -------------------------------------------------------------------------------- /mods/src/creative/README.md: -------------------------------------------------------------------------------- 1 | # `creative` Mod 2 | This mod adds an optional feature flag to add more items to the Creative Mode inventory. 3 | -------------------------------------------------------------------------------- /mods/src/death/README.md: -------------------------------------------------------------------------------- 1 | # `death` Mod 2 | This mod implements death messages. 3 | -------------------------------------------------------------------------------- /mods/src/f3/README.md: -------------------------------------------------------------------------------- 1 | # `f3` Mod 2 | This mod add a proper F3 debug screen. -------------------------------------------------------------------------------- /mods/src/feature/README.md: -------------------------------------------------------------------------------- 1 | # `feature` Mod 2 | This utility mod handles feature flags. 3 | -------------------------------------------------------------------------------- /mods/src/feature/feature.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | // Flags In Server-Mode 11 | bool feature_server_flags_set = false; 12 | #define FLAG(name) bool server_##name = false 13 | #include 14 | #undef FLAG 15 | 16 | // Check For Feature 17 | bool feature_has(const char *name, const bool enabled_in_server_mode) { 18 | // Server Handling 19 | if (reborn_is_server()) { 20 | if (!feature_server_flags_set) { 21 | IMPOSSIBLE(); 22 | } 23 | return enabled_in_server_mode; 24 | } 25 | 26 | // Load Flags 27 | static Flags flags = Flags::get(); 28 | static bool loaded = false; 29 | if (!loaded) { 30 | const char *env = require_env(MCPI_FEATURE_FLAGS_ENV); 31 | env_value_to_obj(flags, env); 32 | loaded = true; 33 | } 34 | 35 | // Get Value 36 | int ret = -1; 37 | flags.root.for_each_const([&ret, &name](const FlagNode &flag) { 38 | if (flag.name == std::string(name)) { 39 | ret = flag.value; 40 | } 41 | }); 42 | if (ret == -1) { 43 | ERR("Invalid Feature Flag: %s", name); 44 | } 45 | 46 | // Log 47 | DEBUG("Feature: %s: %s", name, ret ? "Enabled" : "Disabled"); 48 | 49 | // Return 50 | return ret; 51 | } 52 | -------------------------------------------------------------------------------- /mods/src/fps/README.md: -------------------------------------------------------------------------------- 1 | # `fps` Mod 2 | This mod tracks the game's FPS. 3 | -------------------------------------------------------------------------------- /mods/src/game-mode/README.md: -------------------------------------------------------------------------------- 1 | # `game-mode` Mod 2 | This mod implements Survival Mode and dynamic game-mode switching. 3 | -------------------------------------------------------------------------------- /mods/src/game-mode/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_game_mode_ui(); -------------------------------------------------------------------------------- /mods/src/init/README.md: -------------------------------------------------------------------------------- 1 | # `init` Mod 2 | This utility mod handles initializing the other mods in the correct order. 3 | -------------------------------------------------------------------------------- /mods/src/input/README.md: -------------------------------------------------------------------------------- 1 | # `input` Mod 2 | This mod fixes various input-related bugs, including: 3 | * Bows being broken. 4 | * The cursor interacting with the toolbar while the it is locked. 5 | * Being unable to attack mobs. 6 | * The `ESC` key not behaving as expected. 7 | 8 | It also adds various features, including: 9 | * Hide GUI and third person toggle keys. 10 | * Dropping items with `Q`. 11 | -------------------------------------------------------------------------------- /mods/src/input/bow.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | #include "internal.h" 7 | #include 8 | 9 | // Store Right-Click Status 10 | static int is_right_click = 0; 11 | void input_set_is_right_click(const int val) { 12 | is_right_click = val; 13 | } 14 | 15 | // Handle Bow & Arrow 16 | static void _handle_bow(Minecraft_tickInput_t original, Minecraft *minecraft) { 17 | if (!is_right_click) { 18 | GameMode *game_mode = minecraft->game_mode; 19 | LocalPlayer *player = minecraft->player; 20 | if (player != nullptr && game_mode != nullptr && player->isUsingItem()) { 21 | game_mode->releaseUsingItem((Player *) player); 22 | } 23 | } 24 | // Call Original Method 25 | original(minecraft); 26 | } 27 | 28 | // Init 29 | void _init_bow() { 30 | // Enable Bow & Arrow Fix 31 | if (feature_has("Fix Bow & Arrow", server_disabled)) { 32 | overwrite_calls(Minecraft_tickInput, _handle_bow); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mods/src/input/input.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include "internal.h" 6 | #include 7 | 8 | // Init 9 | void init_input() { 10 | // Miscellaneous 11 | _init_misc(); 12 | 13 | // Toggleable Options 14 | _init_toggle(); 15 | 16 | // Item Dropping 17 | _init_drop(); 18 | 19 | // Enable Bow & Arrow Fix 20 | _init_bow(); 21 | 22 | // Allow Attacking Mobs 23 | _init_attack(); 24 | 25 | // Disable Raw Mouse Motion 26 | if (feature_has("Disable Raw Mouse Motion (Not Recommended)", server_disabled)) { 27 | media_set_raw_mouse_motion_enabled(0); 28 | } 29 | 30 | // Extra Key Codes 31 | _init_keys(); 32 | } 33 | -------------------------------------------------------------------------------- /mods/src/input/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_attack(); 4 | MCPI_INTERNAL void _init_bow(); 5 | MCPI_INTERNAL void _init_misc(); 6 | MCPI_INTERNAL void _init_toggle(); 7 | MCPI_INTERNAL void _init_drop(); 8 | MCPI_INTERNAL void _init_keys(); -------------------------------------------------------------------------------- /mods/src/input/keys.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | #include "internal.h" 11 | 12 | // Translator 13 | static int32_t sdl_key_to_minecraft_key_injection(Common_sdl_key_to_minecraft_key_t original, const int32_t sdl_key) { 14 | switch (sdl_key) { 15 | #define KEY(name, value) case SDLK_##name: return MC_KEY_##name; 16 | #include 17 | #undef KEY 18 | default: { 19 | // Call Original Method 20 | return original(sdl_key); 21 | } 22 | } 23 | } 24 | 25 | // Init 26 | void _init_keys() { 27 | if (feature_has("Extend Supported Keycodes", server_disabled)) { 28 | overwrite_calls(Common_sdl_key_to_minecraft_key, sdl_key_to_minecraft_key_injection); 29 | } 30 | } -------------------------------------------------------------------------------- /mods/src/misc/README.md: -------------------------------------------------------------------------------- 1 | # `misc` Mod 2 | This mod has several miscellaneous mods that are too small to be their own mod, including: 3 | * Rendering text above the toolbar when an item is selected. 4 | * Sanitizing player usernames for invalid characters. 5 | * Removing the red background from unobtainable items in the inventory. 6 | * Loading the bundled language file. 7 | * Printing chat messages to the log. 8 | * Implementing crafting remainders. 9 | * Correcting the profile directory. -------------------------------------------------------------------------------- /mods/src/misc/home.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "internal.h" 8 | 9 | // Use MCPI_HOME 10 | static const char *getenv_HOME(MCPI_UNUSED const char *env) { 11 | return require_env(_MCPI_HOME_ENV); 12 | } 13 | 14 | // Init 15 | void _init_misc_home() { 16 | // Store Data In ~/.minecraft-pi Instead Of ~/.minecraft 17 | patch_address(&Strings::default_path, (void *) get_home_subdirectory_for_game_data()); 18 | // Use MCPI_HOME Instead Of $HOME 19 | overwrite_call_manual((void *) 0xe0e4, (void *) getenv_HOME); 20 | 21 | // The override code resolves assets manually, 22 | // making changing directory redundant. 23 | unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" 24 | patch((void *) 0xe0ac, nop_patch); 25 | } 26 | -------------------------------------------------------------------------------- /mods/src/misc/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_misc_logging(); 4 | MCPI_INTERNAL void _init_misc_api(); 5 | MCPI_INTERNAL void _init_misc_graphics(); 6 | MCPI_INTERNAL void _init_misc_ui(); 7 | MCPI_INTERNAL void _init_misc_tinting(); 8 | MCPI_INTERNAL void _init_misc_home(); 9 | 10 | template 11 | static void nop(MCPI_UNUSED Args... args) { 12 | } -------------------------------------------------------------------------------- /mods/src/multidraw/README.md: -------------------------------------------------------------------------------- 1 | # `multidraw` Mod 2 | This mod optimizes rendering using `glMultiDrawArrays`. -------------------------------------------------------------------------------- /mods/src/multidraw/buffer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "buffer.h" 4 | 5 | // Setup Buffer 6 | Buffer::Buffer(const ssize_t size) { 7 | // Client-Side Data 8 | client_side_data = new unsigned char[size]; 9 | // Server-Side Data 10 | server_side_data = 0; 11 | media_glGenBuffers(1, &server_side_data); 12 | media_glBindBuffer(GL_ARRAY_BUFFER, server_side_data); 13 | media_glBufferData(GL_ARRAY_BUFFER, size, nullptr, GL_DYNAMIC_DRAW); 14 | clear_dirty(); 15 | } 16 | Buffer::~Buffer() { 17 | // Client-Side Data 18 | delete[] client_side_data; 19 | // Server-Side Data 20 | media_glDeleteBuffers(1, &server_side_data); 21 | } 22 | 23 | // Upload Data 24 | void Buffer::upload(const intptr_t offset, const ssize_t size, const void *data) { 25 | // Client-Side Data 26 | memcpy(client_side_data + offset, data, size); 27 | // Server-Side Data 28 | if (dirty_end == offset) { 29 | dirty_end += size; 30 | } else { 31 | sync(); 32 | dirty_start = offset; 33 | dirty_end = offset + size; 34 | } 35 | } 36 | 37 | // "Dirty" Data 38 | void Buffer::clear_dirty() { 39 | dirty_start = dirty_end = -1; 40 | } 41 | void Buffer::sync() { 42 | if (dirty_start >= 0) { 43 | media_glBindBuffer(GL_ARRAY_BUFFER, server_side_data); 44 | const void *data = client_side_data + dirty_start; 45 | media_glBufferSubData(GL_ARRAY_BUFFER, dirty_start, dirty_end - dirty_start, data); 46 | } 47 | clear_dirty(); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /mods/src/multidraw/buffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // Keep An OpenGL Buffer And Client-Side Memory Synchronized 7 | struct Buffer { 8 | explicit Buffer(ssize_t size); 9 | ~Buffer(); 10 | 11 | // Prevent Copying 12 | Buffer(const Buffer &) = delete; 13 | Buffer &operator=(const Buffer &) = delete; 14 | 15 | // Data 16 | GLuint server_side_data; 17 | unsigned char *client_side_data; 18 | 19 | // Upload Data 20 | void upload(intptr_t offset, ssize_t size, const void *data); 21 | 22 | // "Dirty" Data 23 | void clear_dirty(); 24 | void sync(); 25 | intptr_t dirty_start; 26 | intptr_t dirty_end; 27 | }; -------------------------------------------------------------------------------- /mods/src/multidraw/storage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "buffer.h" 7 | 8 | // Default Size Of Various Buffers 9 | #define DEFAULT_BUFFER_SIZE 16777216 // 16 MiB 10 | 11 | // Block Of Data 12 | struct Block { 13 | int chunk_id = -1; 14 | intptr_t offset = 0; 15 | ssize_t size = 0; 16 | // Equals 17 | bool operator==(const Block &other) const { 18 | return offset == other.offset; 19 | } 20 | }; 21 | 22 | // Storage 23 | struct Storage { 24 | Storage(); 25 | ~Storage(); 26 | 27 | // Buffer 28 | Buffer *buffer; 29 | 30 | // Chunks 31 | std::unordered_map chunk_to_offset = {}; 32 | void upload(int chunk, ssize_t size, const void *data); 33 | 34 | // Management 35 | ssize_t total_size; 36 | ssize_t used_size; 37 | std::vector free_blocks = {}; 38 | std::vector used_blocks = {}; 39 | void free_block(Block block); 40 | void recreate(ssize_t extra_size = 0); 41 | void check_fragmentation(); 42 | [[nodiscard]] ssize_t get_end() const; 43 | }; -------------------------------------------------------------------------------- /mods/src/multiplayer/README.md: -------------------------------------------------------------------------------- 1 | # `multiplayer` Mod 2 | This mod implements fixes and improvements for multiplayer. 3 | 4 | It also allows connecting to external (non-LAN) servers. 5 | -------------------------------------------------------------------------------- /mods/src/multiplayer/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_multiplayer_raknet(); 4 | MCPI_INTERNAL void _init_multiplayer_misc(); 5 | MCPI_INTERNAL void _init_multiplayer_loading(); 6 | MCPI_INTERNAL void _init_multiplayer_syncing(); 7 | MCPI_INTERNAL void _init_multiplayer_inventory(); -------------------------------------------------------------------------------- /mods/src/multiplayer/loading/init.cpp: -------------------------------------------------------------------------------- 1 | #include "internal.h" 2 | 3 | // Init 4 | void _init_multiplayer_loading() { 5 | _init_multiplayer_loading_packets(); 6 | _init_multiplayer_loading_thread(); 7 | _init_multiplayer_loading_misc(); 8 | _init_multiplayer_loading_terrain(); 9 | } -------------------------------------------------------------------------------- /mods/src/options/README.md: -------------------------------------------------------------------------------- 1 | # `options` Mod 2 | This mod allows various options to be configured, including: 3 | * Mob Spawning 4 | * The Render Distance 5 | * The Username 6 | * Peaceful Mode 7 | * 3D Anaglyph 8 | * Autojump 9 | * Player Nametags 10 | * Block Outlines 11 | * Smooth Lighting 12 | -------------------------------------------------------------------------------- /mods/src/options/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | MCPI_INTERNAL extern const std::string sound_doc_url; 6 | 7 | MCPI_INTERNAL void _init_options_ui(); 8 | MCPI_INTERNAL extern Options *stored_options; 9 | MCPI_INTERNAL Screen *_create_options_info_screen(); -------------------------------------------------------------------------------- /mods/src/override/README.md: -------------------------------------------------------------------------------- 1 | # `override` Mod 2 | This mod allows built-in assets to be overriden by placing replacements in an override folder. 3 | 4 | `/data/images/terrain.png` would be overriden by `/overrides/images/terrain.png`. 5 | -------------------------------------------------------------------------------- /mods/src/screenshot/README.md: -------------------------------------------------------------------------------- 1 | # `screenshot` Mod 2 | This mod implements the core screenshot logic. 3 | -------------------------------------------------------------------------------- /mods/src/server/README.md: -------------------------------------------------------------------------------- 1 | # `server` Mod 2 | This mod contains most of the code involved in converting MCPI into a server. 3 | -------------------------------------------------------------------------------- /mods/src/server/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | MCPI_INTERNAL std::string get_rak_net_guid_ip(RakNet_RakPeer *rak_peer, const RakNet_RakNetGUID &guid); 9 | 10 | MCPI_INTERNAL void handle_commands(Minecraft *minecraft); 11 | MCPI_INTERNAL void start_reading_commands(); 12 | MCPI_INTERNAL void stop_reading_commands(); 13 | 14 | MCPI_INTERNAL void _init_server_playerdata(); 15 | MCPI_INTERNAL void _load_playerdata(ServerPlayer *player); 16 | 17 | // Blacklist/Whitelist 18 | struct Blacklist { 19 | bool is_white; 20 | // General 21 | void load(); 22 | void save() const; 23 | // Miscellaneous 24 | [[nodiscard]] std::string get_name(bool upper) const; 25 | [[nodiscard]] bool contains(const std::string &ip) const; 26 | // Add/Remove 27 | void add_ip(const std::string &ip); 28 | void remove_ip(const std::string &ip); 29 | // Ban 30 | void ban(const ServerPlayer *player); 31 | private: 32 | // Data 33 | std::unordered_set ips; 34 | }; 35 | MCPI_INTERNAL extern Blacklist blacklist; -------------------------------------------------------------------------------- /mods/src/server/properties.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | // Get All Possible Properties 6 | std::vector &ServerProperty::get_all() { 7 | static std::vector out; 8 | return out; 9 | } 10 | 11 | // Load File 12 | void ServerProperties::load(std::istream &stream) { 13 | std::string line; 14 | while (std::getline(stream, line)) { 15 | if (!line.empty()) { 16 | if (line[0] == '#') { 17 | continue; 18 | } 19 | const size_t i = line.find('='); 20 | if (i == std::string::npos) { 21 | continue; 22 | } 23 | properties.insert(std::pair(line.substr(0, i), line.substr(i + 1))); 24 | } 25 | } 26 | } 27 | 28 | // Get Value 29 | std::string ServerProperties::get_string(const ServerProperty &property) const { 30 | return properties.contains(property.key) ? properties.at(property.key) : property.def; 31 | } 32 | int ServerProperties::get_int(const ServerProperty &property) const { 33 | try { 34 | return std::stoi(get_string(property)); 35 | } catch (...) { 36 | return std::stoi(property.def); 37 | } 38 | } 39 | static bool is_true(const std::string &val) { 40 | return val == "true" || val == "yes" || val == "1"; 41 | } 42 | bool ServerProperties::get_bool(const ServerProperty &property) const { 43 | return is_true(get_string(property)); 44 | } 45 | -------------------------------------------------------------------------------- /mods/src/shading/README.md: -------------------------------------------------------------------------------- 1 | # `shading` Mod 2 | This mod implements proper entity shading using OpenGL lighting. -------------------------------------------------------------------------------- /mods/src/shading/init.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "internal.h" 5 | 6 | // Init 7 | void init_shading() { 8 | if (feature_has("Proper Entity Shading", server_disabled)) { 9 | _init_custom_tesselator(); 10 | _init_normals(); 11 | _init_lighting(); 12 | } 13 | } -------------------------------------------------------------------------------- /mods/src/shading/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_custom_tesselator(); 4 | MCPI_INTERNAL void _init_normals(); 5 | MCPI_INTERNAL void _init_lighting(); -------------------------------------------------------------------------------- /mods/src/skin/README.md: -------------------------------------------------------------------------------- 1 | # `skin` Mod 2 | This mod adds custom skin loading. 3 | -------------------------------------------------------------------------------- /mods/src/skin/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_skin_loader(); 4 | -------------------------------------------------------------------------------- /mods/src/sound/README.md: -------------------------------------------------------------------------------- 1 | # `sound` Mod 2 | This mod implements a sound engine. 3 | -------------------------------------------------------------------------------- /mods/src/sound/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | MCPI_INTERNAL std::string _sound_get_source_file(); 6 | MCPI_INTERNAL void _sound_resolve_all(); 7 | MCPI_INTERNAL std::string _sound_pick(const std::string &sound); 8 | -------------------------------------------------------------------------------- /mods/src/text-input-box/README.md: -------------------------------------------------------------------------------- 1 | # `text-input-box` Mod 2 | This mod implements a GUI component for text input. This is ported from [ReMinecraftPE](https://github.com/ReMinecraftPE/mcpe/blob/d7a8b6baecf8b3b050538abdbc976f690312aa2d/source/client/gui/components/TextInputBox.cpp). 3 | -------------------------------------------------------------------------------- /mods/src/text-input-box/TextInputScreen.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // VTable 4 | void TextInputScreen::keyPressed(const int key) { 5 | CustomScreen::keyPressed(key); 6 | for (int i = 0; i < int(m_textInputs->size()); i++) { 7 | TextInputBox *textInput = (*m_textInputs)[i]; 8 | textInput->keyPressed(key); 9 | } 10 | } 11 | void TextInputScreen::keyboardNewChar(const char key) { 12 | CustomScreen::keyboardNewChar(key); 13 | for (int i = 0; i < int(m_textInputs->size()); i++) { 14 | TextInputBox *textInput = (*m_textInputs)[i]; 15 | textInput->charPressed(key); 16 | } 17 | } 18 | void TextInputScreen::mouseClicked(const int x, const int y, const int param_1) { 19 | CustomScreen::mouseClicked(x, y, param_1); 20 | for (int i = 0; i < int(m_textInputs->size()); i++) { 21 | TextInputBox *textInput = (*m_textInputs)[i]; 22 | textInput->onClick(x, y); 23 | } 24 | } 25 | void TextInputScreen::render(const int x, const int y, const float param_1) { 26 | CustomScreen::render(x, y, param_1); 27 | for (int i = 0; i < int(m_textInputs->size()); i++) { 28 | TextInputBox *textInput = (*m_textInputs)[i]; 29 | textInput->tick(); 30 | textInput->render(); 31 | } 32 | } 33 | void TextInputScreen::init() { 34 | CustomScreen::init(); 35 | m_textInputs = new std::vector; 36 | } 37 | TextInputScreen::~TextInputScreen() { 38 | delete m_textInputs; 39 | } 40 | -------------------------------------------------------------------------------- /mods/src/textures/README.md: -------------------------------------------------------------------------------- 1 | # `textures` Mod 2 | This mod enables the animated water texture. 3 | -------------------------------------------------------------------------------- /mods/src/textures/headless.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "internal.h" 5 | 6 | // Disable Texture Loading 7 | static Texture AppPlatform_linux_loadTexture_injection(MCPI_UNUSED AppPlatform_linux_loadTexture_t original, MCPI_UNUSED AppPlatform_linux *app_platform, MCPI_UNUSED const std::string &path, MCPI_UNUSED bool b) { 8 | Texture out; 9 | out.width = 0; 10 | out.height = 0; 11 | out.data = nullptr; 12 | out.field3_0xc = 0; 13 | out.field4_0x10 = true; 14 | out.field5_0x11 = false; 15 | out.field6_0x14 = 0; 16 | out.field7_0x18 = -1; 17 | return out; 18 | } 19 | 20 | // Init 21 | void _init_textures_headless() { 22 | // Disable Texture Loading 23 | overwrite_calls(AppPlatform_linux_loadTexture, AppPlatform_linux_loadTexture_injection); 24 | } 25 | -------------------------------------------------------------------------------- /mods/src/textures/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_textures_headless(); 4 | MCPI_INTERNAL void _init_textures_lava(bool animated_water, bool animated_lava, bool animated_fire); 5 | -------------------------------------------------------------------------------- /mods/src/title-screen/README.md: -------------------------------------------------------------------------------- 1 | # `title-screen` Mod 2 | This mod improves the title screen. 3 | -------------------------------------------------------------------------------- /mods/src/title-screen/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | MCPI_INTERNAL void _init_welcome(); 4 | MCPI_INTERNAL extern int version_text_bottom; 5 | MCPI_INTERNAL void _init_splashes(); 6 | -------------------------------------------------------------------------------- /mods/src/title-screen/splashes.txt: -------------------------------------------------------------------------------- 1 | (Not) Made by Notch! 2 | @Banana! 3 | As (not) seen on TV! 4 | As seen on Discord! 5 | Awesome community! 6 | Awesome! 7 | BANANA! 8 | Boba was here! 9 | Casual gaming! 10 | Classic! 11 | Create! 12 | Definitely not Minecraft Console! 13 | Didn't remove Herobrine! 14 | Don't look directly at the bugs! 15 | Enhanced! 16 | Exploding Creepers! 17 | FREE! 18 | Fantasy! 19 | I was promised pie! 20 | It's the segment's fault! 21 | Join the Discord! 22 | Keyboard compatible! 23 | Minecraft! 24 | Not Minecraft Java! 25 | Now with Multiplayer! 26 | Now in 3D! 27 | Now without Docker! 28 | Obfuscated! 29 | Oh yeah, that version... 30 | Oh, OK, Pigmen... 31 | Open-source! 32 | Pixels! 33 | Pretty! 34 | RIP MCPIL-Legacy, 2020-2020 35 | RIP Picraft 36 | Segmentation fault 37 | Segmentation fault (core dumped) 38 | Singleplayer! 39 | Survive! 40 | Teh! 41 | unsigend char! 42 | unsigned char! 43 | Try It! 44 | WDYM discontinued? 45 | Watch out for StevePi! 46 | Waterproof! 47 | We fixed the rail! 48 | Where is my pie? 49 | Who broke the rail? 50 | Who is StevePi? 51 | Why must you hurt me? 52 | Wow! Modded MCPI! 53 | mcpi-revival.github.io! 54 | discord.gg/aDqejQGMMy! 55 | Buckets! 56 | Caves! 57 | Multiplayer! 58 | Where's my sound? 59 | Animated Lava! 60 | Made with Ghidra! 61 | Python API! 62 | Raspberry Pi! 63 | It's alive! 64 | Now with cake! 65 | The bug attractor! 66 | I promise, this is the last time! -------------------------------------------------------------------------------- /mods/src/touch/README.md: -------------------------------------------------------------------------------- 1 | # `touch` Mod 2 | This mod allows the hidden touch GUI to be activated. 3 | -------------------------------------------------------------------------------- /mods/src/version/README.md: -------------------------------------------------------------------------------- 1 | # `version` Mod 2 | This mod adds the MCPI-Reborn version to the start screen. 3 | -------------------------------------------------------------------------------- /mods/src/version/version.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // Get New Version 10 | const char *version_get() { 11 | static std::string version = ""; 12 | // Load 13 | if (version.empty()) { 14 | version = std::string(Strings::minecraft_pi_version) + " / Reborn v" + reborn_config.general.version; 15 | } 16 | // Return 17 | return version.c_str(); 18 | } 19 | 20 | // Injection For Touch GUI Version 21 | static std::string Common_getGameVersionString_injection(MCPI_UNUSED Common_getGameVersionString_t original, MCPI_UNUSED const std::string &version_suffix) { 22 | // Set Version 23 | return version_get(); 24 | } 25 | 26 | // Init 27 | void init_version() { 28 | // Touch GUI 29 | overwrite_calls(Common_getGameVersionString, Common_getGameVersionString_injection); 30 | // Normal GUI 31 | patch_address((void *) &Strings::minecraft_pi_version, (void *) version_get()); 32 | 33 | // Log 34 | INFO("Starting Minecraft: Pi Edition (%s)", version_get()); 35 | } 36 | -------------------------------------------------------------------------------- /scripts/fix-appimage-for-docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | FILE="$1" 6 | chmod +x "${FILE}" 7 | sed -i '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' "${FILE}" -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Change Directory 6 | cd "$(dirname "$0")/../" 7 | 8 | # Variables 9 | MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')" 10 | ARCH="$(echo "$2" | tr '[:upper:]' '[:lower:]')" 11 | APPIMAGE="$(pwd)/out/minecraft-pi-reborn-$(cat VERSION)-${ARCH}.AppImage" 12 | 13 | # Check If File Exists 14 | if [ ! -f "${APPIMAGE}" ]; then 15 | echo 'Missing AppImage!' > /dev/stderr 16 | exit 1 17 | fi 18 | 19 | # Make Test Directory 20 | export MCPI_PROFILE_DIRECTORY="$(pwd)/.testing-tmp" 21 | rm -rf "${MCPI_PROFILE_DIRECTORY}" 22 | mkdir "${MCPI_PROFILE_DIRECTORY}" 23 | 24 | # Prepare AppImage For Docker 25 | EXE="$(mktemp)" 26 | cp "${APPIMAGE}" "${EXE}" 27 | ./scripts/fix-appimage-for-docker.sh "${EXE}" 28 | 29 | # Run 30 | if [ "${MODE}" = "server" ]; then 31 | # Server Test 32 | "${EXE}" --appimage-extract-and-run --server --only-generate 33 | else 34 | # Client Test 35 | "${EXE}" --appimage-extract-and-run --default --no-cache --benchmark --force-headless 36 | fi 37 | 38 | # Clean Up 39 | rm -f "${EXE}" 40 | -------------------------------------------------------------------------------- /symbols/src/api/CommandServer.def: -------------------------------------------------------------------------------- 1 | method std::string parse(ConnectedClient &client, const std::string &command) = 0x6aa8c; 2 | method void dispatchPacket(Packet &packet) = 0x6a548; 3 | static-method bool setSocketBlocking(int fd, bool param_1) = 0x6a2d4; 4 | method bool _updateClient(ConnectedClient &client) = 0x6ba6c; 5 | method void _close() = 0x6a314; 6 | method void *destructor(int unknown) = 0x6a6a0; 7 | 8 | property Minecraft *minecraft = 0x18; 9 | property OffsetPosTranslator pos_translator = 0x1c; 10 | property std::vector clients = 0x40; 11 | 12 | static-property std::string Fail = 0x137dbc; 13 | static-property std::string Ok = 0x138a08; 14 | static-property std::string NullString = 0x137db8; -------------------------------------------------------------------------------- /symbols/src/api/ConnectedClient.def: -------------------------------------------------------------------------------- 1 | size 0xc; 2 | 3 | property int sock = 0x0; 4 | property std::string str = 0x4; 5 | property int lastBlockHitPoll = 0x8; 6 | 7 | mark-as-simple; -------------------------------------------------------------------------------- /symbols/src/api/OffsetPosTranslator.def: -------------------------------------------------------------------------------- 1 | method void from_int(int &x, int &y, int &z) = 0x27c98; 2 | method void from_float(float &x, float &y, float &z) = 0x27c64; 3 | method void to_float(float &x, float &y, float &z) = 0x27be0; 4 | method void to_int(int &x, int &y, int &z) = 0x27c14; 5 | 6 | property float x = 0x4; 7 | property float y = 0x8; 8 | property float z = 0xc; 9 | -------------------------------------------------------------------------------- /symbols/src/app-platform/AppPlatform.def: -------------------------------------------------------------------------------- 1 | vtable 0x1020d8; 2 | 3 | virtual-method void saveScreenshot(const std::string &path, int width, int height) = 0x8; 4 | virtual-method AppPlatform_readAssetFile_return_value readAssetFile(const std::string &path) = 0x34; 5 | virtual-method Texture loadTexture(const std::string &path, bool b) = 0xc; 6 | virtual-method std::string getDateString(int time) = 0x24; 7 | -------------------------------------------------------------------------------- /symbols/src/app-platform/AppPlatform_linux.def: -------------------------------------------------------------------------------- 1 | extends AppPlatform; 2 | 3 | vtable 0x102158; 4 | -------------------------------------------------------------------------------- /symbols/src/app-platform/AppPlatform_readAssetFile_return_value.def: -------------------------------------------------------------------------------- 1 | size 0x8; 2 | 3 | property char *data = 0x0; 4 | property int length = 0x4; 5 | 6 | mark-as-simple; -------------------------------------------------------------------------------- /symbols/src/entity/Arrow.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | vtable 0x10db20; 4 | 5 | property bool is_critical = 0xd8; 6 | property int hit_x = 0xdc; 7 | property int hit_y = 0xe0; 8 | property int hit_z = 0xe4; 9 | property bool grounded = 0xf0; 10 | property int flight_time = 0xf8; -------------------------------------------------------------------------------- /symbols/src/entity/ArrowRenderer.def: -------------------------------------------------------------------------------- 1 | extends EntityRenderer; 2 | 3 | vtable 0x1075e0; -------------------------------------------------------------------------------- /symbols/src/entity/CameraEntity.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | size 0xbe4; 4 | vtable 0x108898; 5 | 6 | // -1 or an entity id 7 | property int tracking_id = 0xbe0; -------------------------------------------------------------------------------- /symbols/src/entity/EntityFactory.def: -------------------------------------------------------------------------------- 1 | // https://mcpirevival.miraheze.org/wiki/Minecraft:_Pi_Edition_Complete_Entity_List shows what id should be 2 | static-method Entity *CreateEntity(int id, Level *level) = 0x7d794; 3 | -------------------------------------------------------------------------------- /symbols/src/entity/EntityRenderDispatcher.def: -------------------------------------------------------------------------------- 1 | constructor () = 0x6096c; 2 | 3 | method void assign(uchar entity_id, EntityRenderer *renderer) = 0x6094c; 4 | method void render(Entity *entity, float x, float y, float z, float rot, float unknown) = 0x60674; 5 | method float distanceToSqr(float x, float y, float z) = 0x60790; 6 | static-method EntityRenderDispatcher *getInstance() = 0x60e90; 7 | 8 | property ItemInHandRenderer *item_renderer = 0x0; 9 | property float player_rot_y = 0x14; 10 | property Minecraft *minecraft = 0xc; 11 | property Level *level = 0x8; 12 | property Textures *textures = 0x4; -------------------------------------------------------------------------------- /symbols/src/entity/EntityRenderer.def: -------------------------------------------------------------------------------- 1 | vtable 0x1075a8; 2 | 3 | virtual-method void render(Entity *entity, float param_2, float param_3, float param_4, float param_5, float param_6) = 0x8; 4 | 5 | // Can be called without an EntityRenderer, just do EntityRenderer_bindTexture->get(false)(NULL, &file); 6 | method void bindTexture(const std::string &file) = 0x62540; 7 | 8 | property float shadow_radius = 0x4; 9 | property float shadow_strength = 0x8; 10 | 11 | // Globals 12 | static-property EntityRenderDispatcher *entityRenderDispatcher = 0x137bc0; 13 | static-method void renderFlat(const AABB &aabb) = 0x627c8; -------------------------------------------------------------------------------- /symbols/src/entity/FallingTile.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | vtable 0x10c460; 4 | 5 | property int tile_id = 0xd0; 6 | property int data = 0xd4; 7 | property int time = 0xd8; -------------------------------------------------------------------------------- /symbols/src/entity/HumanoidMobRenderer.def: -------------------------------------------------------------------------------- 1 | extends MobRenderer; 2 | 3 | vtable 0x107908; 4 | 5 | property HumanoidModel *model = 0x14; 6 | 7 | virtual-method void additionalRendering(Mob *mob) = 0x38; 8 | -------------------------------------------------------------------------------- /symbols/src/entity/ItemEntity.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | size 0xf4; 4 | vtable 0x10c5b0; 5 | 6 | constructor (Level *level, float x, float y, float z, const ItemInstance &item) = 0x86d70; 7 | 8 | property ItemInstance item = 0xd0; 9 | property int age = 0xdc; 10 | property float bob_offset = 0xe4; 11 | property int pickup_delay = 0xe0; -------------------------------------------------------------------------------- /symbols/src/entity/ItemSpriteRenderer.def: -------------------------------------------------------------------------------- 1 | extends EntityRenderer; 2 | 3 | vtable 0x107e18; 4 | 5 | size 0x10; 6 | 7 | constructor (int texture) = 0x64078; 8 | -------------------------------------------------------------------------------- /symbols/src/entity/Mob.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | vtable 0x10ad60; 4 | 5 | constructor (Level *level) = 0x81b80; 6 | 7 | virtual-method void actuallyHurt(int damage) = 0x16c; 8 | virtual-method void die(Entity *cause) = 0x130; 9 | virtual-method ItemInstance *getCarriedItem() = 0x1ac; 10 | virtual-method void updateAi() = 0x1cc; 11 | virtual-method float getWalkingSpeedModifier() = 0x1e8; 12 | virtual-method void aiStep() = 0x180; 13 | virtual-method int getMaxHealth() = 0x168; 14 | virtual-method bool isBaby() = 0x1a8; 15 | 16 | method bool getSharedFlag(int flag) = 0x81fd8; 17 | method void setSharedFlag(int flag, bool value) = 0x81ef8; 18 | 19 | property int health = 0xec; 20 | property std::string texture = 0xb54; 21 | property Random random = 0x138; 22 | -------------------------------------------------------------------------------- /symbols/src/entity/MobFactory.def: -------------------------------------------------------------------------------- 1 | static-method Mob *getStaticTestMob(int id, Level *level) = 0x18844; 2 | static-method Mob *CreateMob(int id, Level *level) = 0x18184; 3 | -------------------------------------------------------------------------------- /symbols/src/entity/MobRenderer.def: -------------------------------------------------------------------------------- 1 | extends EntityRenderer; 2 | 3 | vtable 0x107e58; 4 | 5 | virtual-method void renderNameTag(Mob *mob, const std::string &name, float x, float y, float z, int param_1) = 0x34; -------------------------------------------------------------------------------- /symbols/src/entity/Particle.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | vtable 0x105b68; -------------------------------------------------------------------------------- /symbols/src/entity/PathfinderMob.def: -------------------------------------------------------------------------------- 1 | extends Mob; 2 | 3 | vtable 0x10b218; 4 | 5 | virtual-method Entity *findAttackTarget() = 0x204; 6 | 7 | property int target_id = 0xbe0; 8 | property int running_away_timer = 0xbe8; 9 | -------------------------------------------------------------------------------- /symbols/src/entity/PrimedTnt.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | vtable 0x10c718; 4 | 5 | property int fuse = 0xd0; 6 | -------------------------------------------------------------------------------- /symbols/src/entity/Throwable.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | size 0xf4; 4 | vtable 0x10dcb8; 5 | vtable-size 0x13c; 6 | 7 | constructor (Level *level, Entity *thrower) = 0x8ccf0; 8 | 9 | virtual-method float getThrowPower() = 0x12c; 10 | virtual-method float getThrowUpAngleOffset() = 0x130; 11 | virtual-method float getGravity() = 0x134; 12 | virtual-method void onHit(HitResult *res) = 0x138; 13 | 14 | property int thrower_id = 0xd8; 15 | property int life = 0xdc; 16 | -------------------------------------------------------------------------------- /symbols/src/entity/TripodCamera.def: -------------------------------------------------------------------------------- 1 | extends Mob; 2 | 3 | vtable 0x10c870; -------------------------------------------------------------------------------- /symbols/src/entity/TripodCameraRenderer.def: -------------------------------------------------------------------------------- 1 | size 0x178; 2 | 3 | extends EntityRenderer; 4 | 5 | constructor () = 0x6583c; 6 | -------------------------------------------------------------------------------- /symbols/src/entity/animal/AgableMob.def: -------------------------------------------------------------------------------- 1 | extends PathfinderMob; 2 | 3 | method void setAge(int age) = 0x7a058; 4 | 5 | property int age = 0xbfc; 6 | -------------------------------------------------------------------------------- /symbols/src/entity/animal/Animal.def: -------------------------------------------------------------------------------- 1 | extends AgableMob; 2 | 3 | vtable 0x10b588; 4 | 5 | // This int seems to be unused, and changing it doesn't effect anything 6 | // I've called it love_timer because it matches where the love timer is on older java 7 | property int love_timer = 0xc00; 8 | -------------------------------------------------------------------------------- /symbols/src/entity/animal/Chicken.def: -------------------------------------------------------------------------------- 1 | extends Animal; 2 | 3 | vtable 0x10b7d0; 4 | constructor (Level *level) = 0x855a0; -------------------------------------------------------------------------------- /symbols/src/entity/animal/Cow.def: -------------------------------------------------------------------------------- 1 | extends Animal; 2 | 3 | vtable 0x10ba38; 4 | constructor (Level *level) = 0x857f4; -------------------------------------------------------------------------------- /symbols/src/entity/animal/Pig.def: -------------------------------------------------------------------------------- 1 | extends Animal; 2 | 3 | vtable 0x10bc90; 4 | constructor (Level *level) = 0x85948; 5 | -------------------------------------------------------------------------------- /symbols/src/entity/animal/Sheep.def: -------------------------------------------------------------------------------- 1 | extends Animal; 2 | 3 | vtable 0x10bef0; 4 | constructor (Level *level) = 0x85da0; 5 | 6 | method void setColor(int color) = 0x86274; 7 | -------------------------------------------------------------------------------- /symbols/src/entity/model/HumanoidModel.def: -------------------------------------------------------------------------------- 1 | property ModelPart head = 0x24; 2 | property ModelPart torso = 0x7c; 3 | property ModelPart rightArm = 0xd4; 4 | property ModelPart leftArm = 0x12c; 5 | property bool angleLeftArm = 0x234; 6 | property bool angleRightArm = 0x235; 7 | property bool is_sneaking = 0x236; 8 | -------------------------------------------------------------------------------- /symbols/src/entity/model/ModelPart.def: -------------------------------------------------------------------------------- 1 | method void render(float scale) = 0x416dc; 2 | 3 | property float x = 0x0; 4 | property float y = 0x4; 5 | property float z = 0x8; 6 | property float xRot = 0xc; 7 | property float yRot = 0x10; 8 | property float zRot = 0x14; 9 | -------------------------------------------------------------------------------- /symbols/src/entity/model/PolygonQuad.def: -------------------------------------------------------------------------------- 1 | method void render(Tesselator &t, float scale, int buffer) = 0x42744; 2 | 3 | property VertexPT vertices[4] = 0x0; -------------------------------------------------------------------------------- /symbols/src/entity/model/VertexPT.def: -------------------------------------------------------------------------------- 1 | size 0x14; 2 | 3 | property Vec3 pos = 0x0; 4 | property float u = 0xc; 5 | property float v = 0x10; 6 | 7 | mark-as-simple; -------------------------------------------------------------------------------- /symbols/src/entity/monster/Creeper.def: -------------------------------------------------------------------------------- 1 | extends Monster; 2 | 3 | vtable 0x10ca90; 4 | constructor (Level *level) = 0x87fe8; 5 | -------------------------------------------------------------------------------- /symbols/src/entity/monster/Monster.def: -------------------------------------------------------------------------------- 1 | extends PathfinderMob; 2 | 3 | vtable 0x10cd10; 4 | constructor (Level *level) = 0x885c0; 5 | -------------------------------------------------------------------------------- /symbols/src/entity/monster/PigZombie.def: -------------------------------------------------------------------------------- 1 | extends Monster; 2 | 3 | vtable 0x10cf50; 4 | constructor (Level *level) = 0x88b4c; 5 | -------------------------------------------------------------------------------- /symbols/src/entity/monster/Skeleton.def: -------------------------------------------------------------------------------- 1 | extends Monster; 2 | 3 | vtable 0x10d208; 4 | constructor (Level *level) = 0x89350; -------------------------------------------------------------------------------- /symbols/src/entity/monster/Spider.def: -------------------------------------------------------------------------------- 1 | extends Monster; 2 | 3 | vtable 0x10d490; 4 | constructor (Level *level) = 0x89618; -------------------------------------------------------------------------------- /symbols/src/entity/monster/Zombie.def: -------------------------------------------------------------------------------- 1 | extends Monster; 2 | 3 | vtable 0x10d8a0; 4 | constructor (Level *level) = 0x89cc8; 5 | -------------------------------------------------------------------------------- /symbols/src/entity/painting/HangingEntity.def: -------------------------------------------------------------------------------- 1 | extends Entity; 2 | 3 | vtable 0x10aba8; 4 | 5 | virtual-method bool survives() = 0x12c; 6 | 7 | method void setPosition(int x, int y, int z) = 0x7e888; 8 | method void setDir(int direction) = 0x7e950; -------------------------------------------------------------------------------- /symbols/src/entity/painting/Motive.def: -------------------------------------------------------------------------------- 1 | static-property Motive *DefaultImage = 0x135dc0; -------------------------------------------------------------------------------- /symbols/src/entity/painting/Painting.def: -------------------------------------------------------------------------------- 1 | extends HangingEntity; 2 | 3 | vtable 0x10b0b0; 4 | 5 | method void setRandomMotive(int direction) = 0x83420; 6 | 7 | static-property Motive **default_motive = 0x836d0; 8 | property Motive *motive = 0xe4; -------------------------------------------------------------------------------- /symbols/src/entity/painting/PaintingRenderer.def: -------------------------------------------------------------------------------- 1 | extends EntityRenderer; 2 | 3 | vtable 0x107eb8; -------------------------------------------------------------------------------- /symbols/src/entity/player/Abilities.def: -------------------------------------------------------------------------------- 1 | size 0x4; 2 | 3 | property bool immortal = 0x0; 4 | property bool infinite_items = 0x3; -------------------------------------------------------------------------------- /symbols/src/entity/player/LocalPlayer.def: -------------------------------------------------------------------------------- 1 | extends Player; 2 | 3 | vtable 0x106230; 4 | 5 | property IMoveInput *input = 0xc88; 6 | property Minecraft *minecraft = 0xc90; 7 | -------------------------------------------------------------------------------- /symbols/src/entity/player/Player.def: -------------------------------------------------------------------------------- 1 | extends Mob; 2 | 3 | vtable 0x10de70; 4 | 5 | virtual-method void drop(ItemInstance *item_instance, bool is_death) = 0x208; 6 | virtual-method void stopSleepInBed(bool param_1, bool param_2, bool param_3) = 0x228; 7 | virtual-method void openTextEdit(TileEntity *sign) = 0x230; 8 | virtual-method void displayClientMessage(const std::string &message) = 0x21c; 9 | 10 | method int isUsingItem() = 0x8f15c; 11 | method void stopUsingItem() = 0x8f514; 12 | method void startUsingItem(ItemInstance *item_instance, int use_duration) = 0x8f4b8; 13 | method ItemInstance *getArmor(int slot) = 0x8fda4; 14 | method void setArmor(int slot, const ItemInstance *item) = 0x8fde0; 15 | method bool isHurt() = 0x8fb44; 16 | method bool hasRespawnPosition() = 0x8fd9c; 17 | method Pos getRespawnPosition() = 0x8fc84; 18 | method void setRespawnPosition(const Pos &pos) = 0x8fca0; 19 | 20 | property Inventory *inventory = 0xbe0; 21 | property std::string username = 0xbf4; 22 | property ItemInstance itemBeingUsed = 0xc34; 23 | property SimpleFoodData foodData = 0xc00; 24 | property Abilities abilities = 0xbfc; 25 | -------------------------------------------------------------------------------- /symbols/src/entity/player/PlayerRenderer.def: -------------------------------------------------------------------------------- 1 | extends HumanoidMobRenderer; 2 | 3 | vtable 0x107f00; -------------------------------------------------------------------------------- /symbols/src/entity/player/RemotePlayer.def: -------------------------------------------------------------------------------- 1 | extends Player; 2 | 3 | vtable 0x106498; -------------------------------------------------------------------------------- /symbols/src/entity/player/ServerPlayer.def: -------------------------------------------------------------------------------- 1 | extends Player; 2 | 3 | vtable 0x109e38; 4 | 5 | property Minecraft *minecraft = 0xc8c; 6 | property RakNet_RakNetGUID guid = 0xc08; 7 | -------------------------------------------------------------------------------- /symbols/src/game/GameRenderer.def: -------------------------------------------------------------------------------- 1 | method void tick(int tick, int max_ticks) = 0x495bc; 2 | method void render(float param_1) = 0x4a338; 3 | method void setupCamera(float param_1, int param_2) = 0x489f8; 4 | 5 | property Minecraft *minecraft = 0x4; 6 | -------------------------------------------------------------------------------- /symbols/src/game/NinecraftApp.def: -------------------------------------------------------------------------------- 1 | extends Minecraft; 2 | 3 | vtable 0x1023b8; 4 | 5 | method void initGLStates() = 0x148c8; 6 | -------------------------------------------------------------------------------- /symbols/src/game/mode/CreatorMode.def: -------------------------------------------------------------------------------- 1 | extends GameMode; 2 | 3 | size 0x1c; 4 | vtable 0x102d00; 5 | 6 | constructor (Minecraft *minecraft) = 0x1a044; 7 | 8 | property Creator *creator = 0x4; -------------------------------------------------------------------------------- /symbols/src/game/mode/GameMode.def: -------------------------------------------------------------------------------- 1 | vtable 0x102e58; 2 | vtable-size 0x60; 3 | 4 | virtual-method void attack(Player *player, Entity *target) = 0x44; 5 | virtual-method void releaseUsingItem(Player *player) = 0x5c; 6 | virtual-method bool useItemOn(Player *player, Level *level, ItemInstance *item, int x, int y, int z, int param_1, const Vec3 ¶m_2) = 0x2c; 7 | virtual-method void initAbilities(Abilities &abilities) = 0x58; -------------------------------------------------------------------------------- /symbols/src/game/mode/SurvivalMode.def: -------------------------------------------------------------------------------- 1 | extends GameMode; 2 | 3 | size 0x24; 4 | 5 | constructor (Minecraft *minecraft) = 0x1b7d8; 6 | -------------------------------------------------------------------------------- /symbols/src/game/mode/creator/Creator.def: -------------------------------------------------------------------------------- 1 | size 0x20; 2 | 3 | extends ICreator; 4 | vtable 0x1a0dc; 5 | 6 | property EventList_TileEvent tileEvents = 0x4; 7 | property int tick = 0x1c; -------------------------------------------------------------------------------- /symbols/src/game/mode/creator/EventList_Item.def: -------------------------------------------------------------------------------- 1 | size 0x18; 2 | 3 | property int tick = 0x0; 4 | property TileEvent item = 0x4; 5 | 6 | mark-as-simple; -------------------------------------------------------------------------------- /symbols/src/game/mode/creator/EventList_TileEvent.def: -------------------------------------------------------------------------------- 1 | size 0x18; 2 | 3 | property int at = 0x0; 4 | property int len = 0x4; 5 | property int cap = 0x8; 6 | property std::vector events = 0xc; 7 | 8 | mark-as-simple; -------------------------------------------------------------------------------- /symbols/src/game/mode/creator/ICreator.def: -------------------------------------------------------------------------------- 1 | vtable 0x102ca8; 2 | 3 | virtual-method EventList_TileEvent &getTileEvents() = 0x8; -------------------------------------------------------------------------------- /symbols/src/game/mode/creator/TileEvent.def: -------------------------------------------------------------------------------- 1 | size 0x14; 2 | 3 | property int owner_id = 0x0; 4 | property int x = 0x4; 5 | property int y = 0x8; 6 | property int z = 0xc; 7 | property int face = 0x10; 8 | 9 | mark-as-simple; -------------------------------------------------------------------------------- /symbols/src/game/options/Options.def: -------------------------------------------------------------------------------- 1 | size 0x110; 2 | 3 | method void initDefaultValue() = 0x18a54; 4 | method bool getBooleanValue(Options_Option *option) = 0x1cd74; 5 | method void addOptionToSaveOutput(std::vector *data, std::string option, int value) = 0x195e4; 6 | method void save() = 0x1966c; 7 | method void update() = 0x19248; 8 | 9 | static-method bool readBool(const std::string &str, bool &out) = 0x19168; 10 | static-method bool readInt(const std::string &str, int &out) = 0x19014; 11 | 12 | property OptionsFile options_file = 0x10c; 13 | property bool fancy_graphics = 0x17; 14 | property bool split_controls = 0x105; 15 | property int game_difficulty = 0xe8; 16 | property bool anaglyph_3d = 0x15; 17 | property bool ambient_occlusion = 0x18; 18 | property bool hide_gui = 0xec; 19 | property uchar third_person = 0xed; // Technically This Is A Boolean 20 | property int render_distance = 0x10; 21 | property int sound = 0x4; 22 | property bool debug = 0xee; 23 | property bool server_visible = 0x104; 24 | property std::string username = 0x100; 25 | property bool invert_mouse = 0xc; 26 | property bool lefty = 0x1a; 27 | property bool view_bobbing = 0x14; 28 | property Minecraft *minecraft = 0xe4; -------------------------------------------------------------------------------- /symbols/src/game/options/OptionsFile.def: -------------------------------------------------------------------------------- 1 | size 0x4; 2 | 3 | method std::vector getOptionStrings() = 0x19c1c; 4 | method void save(std::vector *data) = 0x19bcc; 5 | 6 | property std::string options_txt_path = 0x0; 7 | -------------------------------------------------------------------------------- /symbols/src/game/options/Options_Option.def: -------------------------------------------------------------------------------- 1 | static-property Options_Option GRAPHICS = 0x136c2c; 2 | static-property Options_Option AMBIENT_OCCLUSION = 0x136c38; 3 | static-property Options_Option ANAGLYPH = 0x136c08; 4 | static-property Options_Option DIFFICULTY = 0x136c20; 5 | static-property Options_Option SERVER_VISIBLE = 0x136c68; 6 | static-property Options_Option SOUND = 0x136bcc; 7 | static-property Options_Option VIEW_BOBBING = 0x136bfc; -------------------------------------------------------------------------------- /symbols/src/gui/Font.def: -------------------------------------------------------------------------------- 1 | method int width(const std::string &string) = 0x24d4c; 2 | method void draw(const std::string &string, float x, float y, uint color) = 0x250e0; 3 | method void draw_raw(const char *string, float x, float y, uint color) = 0x25148; 4 | method void drawShadow(const std::string &string, float x, float y, uint color) = 0x250ec; 5 | method void drawShadow_raw(const char *string, float x, float y, uint color) = 0x25150; 6 | method void drawSlow(const char *text, float x, float y, uint color, bool param_1) = 0x24fa8; -------------------------------------------------------------------------------- /symbols/src/gui/GuiMessage.def: -------------------------------------------------------------------------------- 1 | size 0x8; 2 | 3 | property std::string message = 0x0; 4 | property int time = 0x4; 5 | 6 | mark-as-simple; -------------------------------------------------------------------------------- /symbols/src/gui/components/Button.def: -------------------------------------------------------------------------------- 1 | extends GuiComponent; 2 | 3 | size 0x28; 4 | constructor (int id, const std::string &text) = 0x1bc54; 5 | 6 | method int hovered(Minecraft *minecraft, int click_x, int click_y) = 0x1be2c; 7 | 8 | virtual-method bool clicked(Minecraft *minecraft, int click_x, int click_y) = 0x20; 9 | virtual-method void setPressed() = 0x28; 10 | virtual-method bool released(int click_x, int click_y) = 0x24; 11 | 12 | property int width = 0x14; 13 | property int height = 0x18; 14 | property int x = 0xc; 15 | property int y = 0x10; 16 | property std::string text = 0x1c; 17 | property int id = 0x20; -------------------------------------------------------------------------------- /symbols/src/gui/components/GuiComponent.def: -------------------------------------------------------------------------------- 1 | size 0x8; 2 | constructor () = 0x28204; 3 | 4 | vtable 0x1039b0; 5 | 6 | method void blit(int x_dest, int y_dest, int x_src, int y_src, int width_dest, int height_dest, int width_src, int height_src) = 0x282a4; 7 | method void drawCenteredString(Font *font, const std::string &text, int x, int y, uint color) = 0x2821c; 8 | method void drawString(Font *font, const std::string &text, int x, int y, uint color) = 0x28284; 9 | method void fill(int x1, int y1, int x2, int y2, uint color) = 0x285f0; 10 | method void fillGradient(int x1, int y1, int x2, int y2, int color1, int color2) = 0x287c0; 11 | 12 | property float z = 0x4; -------------------------------------------------------------------------------- /symbols/src/gui/components/ImageButton.def: -------------------------------------------------------------------------------- 1 | extends Button; 2 | -------------------------------------------------------------------------------- /symbols/src/gui/components/IntRectangle.def: -------------------------------------------------------------------------------- 1 | size 0x10; 2 | 3 | property int x = 0x0; 4 | property int y = 0x4; 5 | property int x_offset = 0x8; 6 | property int y_offset = 0xc; 7 | -------------------------------------------------------------------------------- /symbols/src/gui/components/OptionButton.def: -------------------------------------------------------------------------------- 1 | extends ImageButton; 2 | 3 | constructor (const Options_Option *option) = 0x1c968; 4 | 5 | method void updateImage(Options *options) = 0x1ca58; 6 | method void toggle(Options *options) = 0x1cb08; 7 | 8 | property Options_Option *option = 0x54; 9 | -------------------------------------------------------------------------------- /symbols/src/gui/components/OptionsPane.def: -------------------------------------------------------------------------------- 1 | method void unknown_toggle_creating_function(uint group_id, std::string *name, Options_Option *option) = 0x24470; 2 | -------------------------------------------------------------------------------- /symbols/src/gui/components/RectangleArea.def: -------------------------------------------------------------------------------- 1 | size 0x18; 2 | 3 | property float x1 = 0x8; 4 | property float x2 = 0xc; 5 | property float y1 = 0x10; 6 | property float y2 = 0x14; 7 | 8 | method bool isInside(float x, float y) = 0x21aa4; 9 | -------------------------------------------------------------------------------- /symbols/src/gui/components/ScrollingPane.def: -------------------------------------------------------------------------------- 1 | extends GuiComponent; 2 | 3 | constructor (int param_2, const IntRectangle &bb, const IntRectangle &itembb, int columns, int item_count, float scale, const IntRectangle &itembb2) = 0x22b44; 4 | 5 | method void setContentOffset(float x, float y) = 0x220a0; 6 | method void render(float param_1, float param_2, float alpha) = 0x22ee4; 7 | method void adjustContentSize() = 0x21aa4; 8 | method bool queryHoldTime(int *item_id, int *pressed_time) = 0x22ab4; 9 | 10 | property float scale = 0x2c; 11 | property RectangleArea area = 0x60; 12 | property Vec3 content_offset = 0xe4; 13 | property float max_y = 0x130; 14 | property float size_y = 0x170; 15 | property float adjust_content_size_y = 0x1ec; 16 | 17 | -------------------------------------------------------------------------------- /symbols/src/gui/components/Touch_TButton.def: -------------------------------------------------------------------------------- 1 | extends Button; 2 | 3 | size 0x28; 4 | constructor (int id, const std::string &text) = 0x1c168; 5 | -------------------------------------------------------------------------------- /symbols/src/gui/screens/ArmorScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | method void renderPlayer(float param_1, float param_2) = 0x29cd0; -------------------------------------------------------------------------------- /symbols/src/gui/screens/DisconnectionScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | vtable 0x104c18; 4 | size 0x50; 5 | 6 | constructor (const std::string &str) = 0x6e484; -------------------------------------------------------------------------------- /symbols/src/gui/screens/FurnaceScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | method bool handleAddItem(int slot, const ItemInstance *item) = 0x327a0; 4 | 5 | property FurnaceTileEntity *tile_entity = 0x1d0; 6 | -------------------------------------------------------------------------------- /symbols/src/gui/screens/InBedScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | vtable 0x1045f0; 4 | -------------------------------------------------------------------------------- /symbols/src/gui/screens/OptionsScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | vtable 0x104978; 4 | 5 | size 0x70; 6 | constructor () = 0x35488; -------------------------------------------------------------------------------- /symbols/src/gui/screens/PaneCraftingScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | method void craftSelectedItem() = 0x2e0e4; 4 | method void recheckRecipes() = 0x2dc98; 5 | 6 | property CItem *item = 0x74; 7 | -------------------------------------------------------------------------------- /symbols/src/gui/screens/PauseScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | vtable 0x104b20; 4 | 5 | method void updateServerVisibilityText() = 0x366b8; 6 | 7 | property Button *server_visibility_button = 0x60; 8 | -------------------------------------------------------------------------------- /symbols/src/gui/screens/ProgressScreen.def: -------------------------------------------------------------------------------- 1 | extends Screen; 2 | 3 | size 0x4c; 4 | 5 | constructor () = 0x37044; 6 | -------------------------------------------------------------------------------- /symbols/src/gui/screens/Screen.def: -------------------------------------------------------------------------------- 1 | extends GuiComponent; 2 | 3 | size 0x48; 4 | constructor () = 0x29028; 5 | generate-custom-wrapper; 6 | 7 | vtable-size 0x74; 8 | vtable 0x1039d8; 9 | 10 | virtual-method void init() = 0xc; 11 | virtual-method void render(int x, int y, float param_1) = 0x8; 12 | virtual-method void setupPositions() = 0x10; 13 | virtual-method void updateEvents() = 0x14; 14 | virtual-method bool handleBackEvent(bool do_nothing) = 0x24; 15 | virtual-method void tick() = 0x28; 16 | virtual-method void removed() = 0x2c; 17 | virtual-method void renderBackground() = 0x30; 18 | virtual-method void buttonClicked(Button *button) = 0x60; 19 | virtual-method void mouseClicked(int x, int y, int param_1) = 0x64; 20 | virtual-method void mouseReleased(int x, int y, int param_1) = 0x68; 21 | virtual-method void keyPressed(int key) = 0x6c; 22 | virtual-method void keyboardNewChar(char key) = 0x70; 23 | 24 | property int width = 0x8; 25 | property int height = 0xc; 26 | property bool passthrough_input = 0x10; 27 | property Minecraft *minecraft = 0x14; 28 | property std::vector