Merge pull request 'Fix Whool and block variations n slabs n stuff' (#13) from EpikIzCool/minecraft-pe-0.6.1:main into main
Reviewed-on: #13
This commit was merged in pull request #13.
This commit is contained in:
@@ -54,16 +54,3 @@ void CreativeMode::initAbilities( Abilities& abilities ) {
|
|||||||
bool CreativeMode::isCreativeType() {
|
bool CreativeMode::isCreativeType() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreativeMode::releaseUsingItem( Player* player ) {
|
|
||||||
if(player->getCarriedItem() != NULL) {
|
|
||||||
int oldItemId = player->getCarriedItem()->id;
|
|
||||||
int oldAux = player->getAuxData();
|
|
||||||
super::releaseUsingItem(player);
|
|
||||||
if(player->getCarriedItem() != NULL && player->getCarriedItem()->id == oldItemId) {
|
|
||||||
player->getCarriedItem()->setAuxValue(oldAux);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
super::releaseUsingItem(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public:
|
|||||||
|
|
||||||
void initAbilities(Abilities& abilities);
|
void initAbilities(Abilities& abilities);
|
||||||
|
|
||||||
void releaseUsingItem(Player* player);
|
|
||||||
private:
|
private:
|
||||||
void creativeDestroyBlock(int x, int y, int z, int face);
|
void creativeDestroyBlock(int x, int y, int z, int face);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -92,19 +92,6 @@ bool CreatorMode::isCreativeType() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatorMode::releaseUsingItem( Player* player ) {
|
|
||||||
if(player->getCarriedItem() != NULL) {
|
|
||||||
int oldItemId = player->getCarriedItem()->id;
|
|
||||||
int oldAux = player->getAuxData();
|
|
||||||
super::releaseUsingItem(player);
|
|
||||||
if(player->getCarriedItem() != NULL && player->getCarriedItem()->id == oldItemId) {
|
|
||||||
player->getCarriedItem()->setAuxValue(oldAux);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
super::releaseUsingItem(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ICreator* CreatorMode::getCreator() {
|
ICreator* CreatorMode::getCreator() {
|
||||||
return _creator;
|
return _creator;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ public:
|
|||||||
|
|
||||||
void initAbilities(Abilities& abilities);
|
void initAbilities(Abilities& abilities);
|
||||||
|
|
||||||
void releaseUsingItem(Player* player);
|
|
||||||
private:
|
private:
|
||||||
void CreatorDestroyBlock(int x, int y, int z, int face);
|
void CreatorDestroyBlock(int x, int y, int z, int face);
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ bool GameMode::useItemOn(Player* player, Level* level, ItemInstance* item, int x
|
|||||||
float clickX = hit.x - x;
|
float clickX = hit.x - x;
|
||||||
float clickY = hit.y - y;
|
float clickY = hit.y - y;
|
||||||
float clickZ = hit.z - z;
|
float clickZ = hit.z - z;
|
||||||
item = player->inventory->getSelected();
|
if (level->isClientSide) {
|
||||||
if(level->isClientSide) {
|
item = player->inventory->getSelected();
|
||||||
UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ);
|
UseItemPacket packet(x, y, z, face, item, player->entityId, clickX, clickY, clickZ);
|
||||||
minecraft->raknetInstance->send(packet);
|
minecraft->raknetInstance->send(packet);
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ void GameMode::initPlayer( Player* player ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GameMode::releaseUsingItem(Player* player){
|
void GameMode::releaseUsingItem(Player* player){
|
||||||
if(minecraft->level->isClientSide) {
|
if (minecraft->level->isClientSide && player->isUsingItem()) {
|
||||||
PlayerActionPacket packet(PlayerActionPacket::RELEASE_USE_ITEM, 0, 0, 0, 0, player->entityId);
|
PlayerActionPacket packet(PlayerActionPacket::RELEASE_USE_ITEM, 0, 0, 0, 0, player->entityId);
|
||||||
minecraft->raknetInstance->send(packet);
|
minecraft->raknetInstance->send(packet);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ void IngameBlockSelectionScreen::init()
|
|||||||
//for (int i = 0; i < inventory->getContainerSize(); ++i)
|
//for (int i = 0; i < inventory->getContainerSize(); ++i)
|
||||||
//LOGI("> %d - %s\n", i, inventory->getItem(i)? inventory->getItem(i)->getDescriptionId().c_str() : "<-->\n");
|
//LOGI("> %d - %s\n", i, inventory->getItem(i)? inventory->getItem(i)->getDescriptionId().c_str() : "<-->\n");
|
||||||
|
|
||||||
InventorySize = inventory->getContainerSize();
|
// Grid indices are 0..N-1 for main inventory only; slots 0..MAX_SELECTION_SIZE-1 are hotbar links.
|
||||||
|
InventorySize = inventory->getContainerSize() - Inventory::MAX_SELECTION_SIZE;
|
||||||
InventoryRows = 1 + (InventorySize-1) / InventoryColumns;
|
InventoryRows = 1 + (InventorySize-1) / InventoryColumns;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -265,7 +266,8 @@ void IngameBlockSelectionScreen::buttonClicked(Button* button) {
|
|||||||
|
|
||||||
bool IngameBlockSelectionScreen::isAllowed( int slot )
|
bool IngameBlockSelectionScreen::isAllowed( int slot )
|
||||||
{
|
{
|
||||||
if (slot < 0 || slot >= minecraft->player->inventory->getContainerSize())
|
const int gridCount = minecraft->player->inventory->getContainerSize() - Inventory::MAX_SELECTION_SIZE;
|
||||||
|
if (slot < 0 || slot >= gridCount)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef DEMO_MODE
|
#ifdef DEMO_MODE
|
||||||
|
|||||||
Reference in New Issue
Block a user