Compare commits

..

No commits in common. "main" and "0.6.1-alpha-0.1.1" have entirely different histories.

8 changed files with 21 additions and 36 deletions

View file

@ -1,9 +1,9 @@
# MinecraftPE # MinecraftPE
> [!Warning] > [!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.sffnetwork.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.sffempire.ru/Kolyah35/minecraft-pe-0.6.1).
> [!Note] > [!Important]
> There is unofficial (not related to Kolyah35 and InviseDivine) discord server, where you can report bugs or send feedback https://discord.gg/udYrbNDfDH > We have a discord server, where you can report bugs or send feedback https://discord.gg/c58YesBxve
Source code for **Minecraft Pocket Edition 0.6.1 alpha** with various fixes and improvements. 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 # Screenshots
<p align="center"> <p align="center">
<img width="49%" alt="menu" src="https://sffnetwork.ru/mcpe-screenshots/menu.png" /> <img width="49%" alt="menu" src="https://sffempire.ru/mcpe-screenshots/menu.png" />
<img width="49%" alt="settings" src="https://sffnetwork.ru/mcpe-screenshots/settings.png" /> <img width="49%" alt="settings" src="https://sffempire.ru/mcpe-screenshots/settings.png" />
<img width="49%" alt="worlds" src="https://sffnetwork.ru/mcpe-screenshots/worlds.png" /> <img width="49%" alt="worlds" src="https://sffempire.ru/mcpe-screenshots/worlds.png" />
<img width="49%" alt="gameplay" src="https://sffnetwork.ru/mcpe-screenshots/gameplay.png" /> <img width="49%" alt="gameplay" src="https://sffempire.ru/mcpe-screenshots/gameplay.png" />
</p> </p>

View file

@ -61,12 +61,6 @@ bool Screen::handleBackEvent( bool isDown )
return false; return false;
} }
void Screen::tick() {
for (auto& textbox : textBoxes) {
textbox->tick(minecraft);
}
}
void Screen::updateEvents() void Screen::updateEvents()
{ {
if (passEvents) if (passEvents)
@ -116,12 +110,10 @@ void Screen::keyboardEvent()
keyPressed(Keyboard::getEventKey()); keyPressed(Keyboard::getEventKey());
} }
} }
void Screen::keyboardTextEvent() void Screen::keyboardTextEvent()
{ {
charPressed(Keyboard::getChar()); charPressed(Keyboard::getChar());
} }
void Screen::renderBackground() void Screen::renderBackground()
{ {
renderBackground(0); renderBackground(0);

View file

@ -31,7 +31,7 @@ public:
virtual void keyboardTextEvent(); virtual void keyboardTextEvent();
virtual bool handleBackEvent(bool isDown); virtual bool handleBackEvent(bool isDown);
virtual void tick(); virtual void tick() {}
virtual void removed() {} virtual void removed() {}

View file

@ -65,7 +65,7 @@ void ConsoleScreen::execute()
if (minecraft->netCallback && !minecraft->raknetInstance->isServer()) { if (minecraft->netCallback && !minecraft->raknetInstance->isServer()) {
MessagePacket packet(_input.c_str()); MessagePacket packet(_input.c_str());
minecraft->raknetInstance->send(packet); minecraft->raknetInstance->send(&packet);
} else if (_input[0] == '/') { } else if (_input[0] == '/') {
_input = Util::stringTrim(_input.substr(1)); _input = Util::stringTrim(_input.substr(1));
@ -80,7 +80,7 @@ void ConsoleScreen::execute()
else { else {
if (minecraft->raknetInstance->isServer()) { if (minecraft->raknetInstance->isServer()) {
MessagePacket packet(_input.c_str()); MessagePacket packet(_input.c_str());
minecraft->raknetInstance->send(packet); minecraft->raknetInstance->send(&packet);
} }
minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input); minecraft->gui.addMessage("<" + minecraft->player->name + "> " + _input);

View file

@ -220,23 +220,16 @@ static int androidKeyToInternal(int androidKey) {
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_com_mojang_minecraftpe_MainActivity_nativeOnKeyDown(JNIEnv* env, jclass cls, jint keyCode) { Java_com_mojang_minecraftpe_MainActivity_nativeOnKeyDown(JNIEnv* env, jclass cls, jint keyCode) {
LOGI("@nativeOnKeyDown: %d\n", keyCode); LOGI("@nativeOnKeyDown: %d\n", keyCode);
// @rewrite
if (keyCode != AKEYCODE_1) {
int mapped = androidKeyToInternal(keyCode); int mapped = androidKeyToInternal(keyCode);
Keyboard::feed(mapped, true); Keyboard::feed(mapped, true);
}
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_com_mojang_minecraftpe_MainActivity_nativeTextChar(JNIEnv* env, jclass cls, jint unicodeChar) { 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 // soft-keyboards may send a backspace as a character code
// Kolyah35: i dont believe :v if (unicodeChar == 8) {
/*if (unicodeChar == 8) {
Keyboard::feed(Keyboard::KEY_BACKSPACE, true); Keyboard::feed(Keyboard::KEY_BACKSPACE, true);
Keyboard::feed(Keyboard::KEY_BACKSPACE, false); Keyboard::feed(Keyboard::KEY_BACKSPACE, false);
} else*/ if (unicodeChar > 0 && unicodeChar < 128) { } else if (unicodeChar > 0 && unicodeChar < 128) {
Keyboard::feedText((char)unicodeChar); Keyboard::feedText((char)unicodeChar);
} }
} }

View file

@ -448,7 +448,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, TakeItem
LOGI("TakeItemPacket\n"); LOGI("TakeItemPacket\n");
ItemInstance* item = new ItemInstance(); ItemInstance* item;
item->count = packet->count; item->count = packet->count;
item->id = packet->itemId; item->id = packet->itemId;

View file

@ -3,7 +3,6 @@
#include "../Level.h" #include "../Level.h"
#include "../../item/Item.h" #include "../../item/Item.h"
#include "../../entity/player/Player.h" #include "../../entity/player/Player.h"
#include "world/level/LevelSettings.h"
DoorTile::DoorTile(int id, const Material* material) DoorTile::DoorTile(int id, const Material* material)
: super(id, material) : super(id, material)
@ -151,7 +150,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) { void DoorTile::neighborChanged(Level* level, int x, int y, int z, int type) {
int data = level->getData(x, y, z); int data = level->getData(x, y, z);
if ((data & C_IS_UPPER_MASK) == 0) { if ((data & UPPER_BIT) == 0) {
bool spawn = false; bool spawn = false;
if (level->getTile(x, y + 1, z) != id) { if (level->getTile(x, y + 1, z) != id) {
level->setTile(x, y, z, 0); level->setTile(x, y, z, 0);
@ -165,7 +164,7 @@ void DoorTile::neighborChanged(Level* level, int x, int y, int z, int type) {
} }
} }
if (spawn) { if (spawn) {
if (!level->isClientSide && level->getLevelData()->getGameType() != GameType::Creative) { if (!level->isClientSide) {
// use default chance (1.0) so the drop always occurs // use default chance (1.0) so the drop always occurs
spawnResources(level, x, y, z, data); spawnResources(level, x, y, z, data);
} }
@ -194,7 +193,7 @@ int DoorTile::getResource(int data, Random* random) {
// itself never drops anything and playerDestroy suppresses spawning // itself never drops anything and playerDestroy suppresses spawning
// from the top. This prevents duplicate drops if the bottom half is // from the top. This prevents duplicate drops if the bottom half is
// mined. // mined.
if ((data & C_IS_UPPER_MASK) != 0) return 0; if ((data & UPPER_BIT) != 0) return 0;
if (material == Material::metal) return Item::door_iron->id; if (material == Material::metal) return Item::door_iron->id;
return Item::door_wood->id; return Item::door_wood->id;
} }
@ -206,7 +205,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 // 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) { void DoorTile::playerDestroy(Level* level, Player* player, int x, int y, int z, int data) {
if ((data & C_IS_UPPER_MASK) == 0) { if ((data & UPPER_BIT) == 0) {
// only let the lower half handle the actual spawning // only let the lower half handle the actual spawning
super::playerDestroy(level, player, x, y, z, data); super::playerDestroy(level, player, x, y, z, data);
} }
@ -226,7 +225,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 DoorTile::getCompositeData( LevelSource* level, int x, int y, int z ) {
int data = level->getData(x, y, z); int data = level->getData(x, y, z);
bool isUpper = (data & C_IS_UPPER_MASK) != 0; bool isUpper = (data & UPPER_BIT) != 0;
int lowerData; int lowerData;
int upperData; int upperData;
if (isUpper) { if (isUpper) {

View file

@ -17,6 +17,7 @@ class DoorTile: public Tile
{ {
typedef Tile super; typedef Tile super;
public: public:
static const int UPPER_BIT = 8;
static const int C_DIR_MASK = 3; static const int C_DIR_MASK = 3;
static const int C_OPEN_MASK = 4; static const int C_OPEN_MASK = 4;
static const int C_LOWER_DATA_MASK = 7; static const int C_LOWER_DATA_MASK = 7;