diff --git a/README.md b/README.md index 1d4caa8..094ec25 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # MinecraftPE > [!Warning] -> [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1). +> [Github repository](https://github.com/Minecraft-PE-0-6-1/minecraft-pe-0.6.1-on-all) **isnt main**. All issues and pull requests should be send in [Gitea Repository](https://gitea.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1). -> [!Important] -> We have a discord server, where you can report bugs or send feedback https://discord.gg/c58YesBxve +> [!Note] +> There is unofficial (not related to Kolyah35 and InviseDivine) discord server, where you can report bugs or send feedback https://discord.gg/udYrbNDfDH Source code for **Minecraft Pocket Edition 0.6.1 alpha** with various fixes and improvements. @@ -17,10 +17,10 @@ This project aims to preserve and improve this early version of Minecraft PE. # Screenshots

-menu -settings -worlds -gameplay +menu +settings +worlds +gameplay

diff --git a/src/client/gui/Screen.cpp b/src/client/gui/Screen.cpp index a6bcc6f..1a19efb 100755 --- a/src/client/gui/Screen.cpp +++ b/src/client/gui/Screen.cpp @@ -61,6 +61,12 @@ bool Screen::handleBackEvent( bool isDown ) return false; } +void Screen::tick() { + for (auto& textbox : textBoxes) { + textbox->tick(minecraft); + } +} + void Screen::updateEvents() { if (passEvents) @@ -110,10 +116,12 @@ void Screen::keyboardEvent() keyPressed(Keyboard::getEventKey()); } } + void Screen::keyboardTextEvent() { charPressed(Keyboard::getChar()); } + void Screen::renderBackground() { renderBackground(0); diff --git a/src/client/gui/Screen.h b/src/client/gui/Screen.h index be44d5c..16b551a 100755 --- a/src/client/gui/Screen.h +++ b/src/client/gui/Screen.h @@ -31,7 +31,7 @@ public: virtual void keyboardTextEvent(); virtual bool handleBackEvent(bool isDown); - virtual void tick() {} + virtual void tick(); virtual void removed() {} diff --git a/src/client/gui/screens/ConsoleScreen.cpp b/src/client/gui/screens/ConsoleScreen.cpp index ccb6039..9d3e874 100644 --- a/src/client/gui/screens/ConsoleScreen.cpp +++ b/src/client/gui/screens/ConsoleScreen.cpp @@ -65,7 +65,7 @@ void ConsoleScreen::execute() if (minecraft->netCallback && !minecraft->raknetInstance->isServer()) { MessagePacket packet(_input.c_str()); - minecraft->raknetInstance->send(&packet); + minecraft->raknetInstance->send(packet); } else if (_input[0] == '/') { _input = Util::stringTrim(_input.substr(1)); @@ -80,7 +80,7 @@ void ConsoleScreen::execute() else { if (minecraft->raknetInstance->isServer()) { MessagePacket packet(_input.c_str()); - minecraft->raknetInstance->send(&packet); + minecraft->raknetInstance->send(packet); } minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); diff --git a/src/main_android_java.cpp b/src/main_android_java.cpp index c89ae03..d407ba7 100755 --- a/src/main_android_java.cpp +++ b/src/main_android_java.cpp @@ -220,16 +220,23 @@ static int androidKeyToInternal(int androidKey) { JNIEXPORT void JNICALL Java_com_mojang_minecraftpe_MainActivity_nativeOnKeyDown(JNIEnv* env, jclass cls, jint keyCode) { LOGI("@nativeOnKeyDown: %d\n", keyCode); - int mapped = androidKeyToInternal(keyCode); - Keyboard::feed(mapped, true); + + // @rewrite + + if (keyCode != AKEYCODE_1) { + int mapped = androidKeyToInternal(keyCode); + Keyboard::feed(mapped, true); + } } JNIEXPORT void JNICALL Java_com_mojang_minecraftpe_MainActivity_nativeTextChar(JNIEnv* env, jclass cls, jint unicodeChar) { + LOGI("@nativeTextChar: %d '%c'", unicodeChar, (char)unicodeChar); // soft-keyboards may send a backspace as a character code - if (unicodeChar == 8) { + // Kolyah35: i dont believe :v + /*if (unicodeChar == 8) { Keyboard::feed(Keyboard::KEY_BACKSPACE, true); Keyboard::feed(Keyboard::KEY_BACKSPACE, false); - } else if (unicodeChar > 0 && unicodeChar < 128) { + } else*/ if (unicodeChar > 0 && unicodeChar < 128) { Keyboard::feedText((char)unicodeChar); } } diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 022b35f..e2b8150 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -448,7 +448,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, TakeItem LOGI("TakeItemPacket\n"); - ItemInstance* item; + ItemInstance* item = new ItemInstance(); item->count = packet->count; item->id = packet->itemId; diff --git a/src/world/level/tile/DoorTile.cpp b/src/world/level/tile/DoorTile.cpp index 7aea82f..203e424 100755 --- a/src/world/level/tile/DoorTile.cpp +++ b/src/world/level/tile/DoorTile.cpp @@ -3,6 +3,7 @@ #include "../Level.h" #include "../../item/Item.h" #include "../../entity/player/Player.h" +#include "world/level/LevelSettings.h" DoorTile::DoorTile(int id, const Material* material) : super(id, material) @@ -150,7 +151,7 @@ void DoorTile::setOpen(Level* level, int x, int y, int z, bool shouldOpen) { void DoorTile::neighborChanged(Level* level, int x, int y, int z, int type) { int data = level->getData(x, y, z); - if ((data & UPPER_BIT) == 0) { + if ((data & C_IS_UPPER_MASK) == 0) { bool spawn = false; if (level->getTile(x, y + 1, z) != id) { level->setTile(x, y, z, 0); @@ -164,7 +165,7 @@ void DoorTile::neighborChanged(Level* level, int x, int y, int z, int type) { } } if (spawn) { - if (!level->isClientSide) { + if (!level->isClientSide && level->getLevelData()->getGameType() != GameType::Creative) { // use default chance (1.0) so the drop always occurs spawnResources(level, x, y, z, data); } @@ -193,7 +194,7 @@ int DoorTile::getResource(int data, Random* random) { // itself never drops anything and playerDestroy suppresses spawning // from the top. This prevents duplicate drops if the bottom half is // mined. - if ((data & UPPER_BIT) != 0) return 0; + if ((data & C_IS_UPPER_MASK) != 0) return 0; if (material == Material::metal) return Item::door_iron->id; return Item::door_wood->id; } @@ -205,7 +206,7 @@ HitResult DoorTile::clip(Level* level, int xt, int yt, int zt, const Vec3& a, co // override to prevent double-dropping when top half is directly mined void DoorTile::playerDestroy(Level* level, Player* player, int x, int y, int z, int data) { - if ((data & UPPER_BIT) == 0) { + if ((data & C_IS_UPPER_MASK) == 0) { // only let the lower half handle the actual spawning super::playerDestroy(level, player, x, y, z, data); } @@ -225,7 +226,7 @@ bool DoorTile::mayPlace(Level* level, int x, int y, int z, unsigned char face) { int DoorTile::getCompositeData( LevelSource* level, int x, int y, int z ) { int data = level->getData(x, y, z); - bool isUpper = (data & UPPER_BIT) != 0; + bool isUpper = (data & C_IS_UPPER_MASK) != 0; int lowerData; int upperData; if (isUpper) { diff --git a/src/world/level/tile/DoorTile.h b/src/world/level/tile/DoorTile.h index 250d274..bd585e5 100755 --- a/src/world/level/tile/DoorTile.h +++ b/src/world/level/tile/DoorTile.h @@ -17,7 +17,6 @@ class DoorTile: public Tile { typedef Tile super; public: - static const int UPPER_BIT = 8; static const int C_DIR_MASK = 3; static const int C_OPEN_MASK = 4; static const int C_LOWER_DATA_MASK = 7;