diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 1f73ad8..855906d 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -755,7 +755,12 @@ void Minecraft::tickInput() { if (key == Keyboard::KEY_F3) { options.toggle(OPTIONS_RENDER_DEBUG); } - + if (key == Keyboard::KEY_F4) { + player->inventory->add(new ItemInstance(Tile::goldBlock)); + player->inventory->add(new ItemInstance(Tile::netherReactor)); + player->inventory->add(new ItemInstance(Tile::stoneBrick)); + + } if (key == Keyboard::KEY_F5) { options.toggle(OPTIONS_THIRD_PERSON_VIEW); /* @@ -909,8 +914,6 @@ void Minecraft::tickInput() { // USPESHNO spizheno static int buildHoldTicks = 0; if (Mouse::isButtonDown(MouseAction::ACTION_RIGHT)) { - BuildActionIntention bai(BuildActionIntention::BAI_BUILD | BuildActionIntention::BAI_INTERACT); - handleBuildAction(&bai); if (buildHoldTicks >= 5) buildHoldTicks = 0; if (++buildHoldTicks == 1) { @@ -919,6 +922,7 @@ void Minecraft::tickInput() { } } else { buildHoldTicks = 0; + gameMode->releaseUsingItem(player); } } diff --git a/src/world/level/tile/entity/NetherReactorTileEntity.cpp b/src/world/level/tile/entity/NetherReactorTileEntity.cpp index 64c91fb..f55c12d 100755 --- a/src/world/level/tile/entity/NetherReactorTileEntity.cpp +++ b/src/world/level/tile/entity/NetherReactorTileEntity.cpp @@ -177,14 +177,14 @@ ItemInstance NetherReactorTileEntity::GetLowOddsSpawnItem() { Item::painting, Item::door_wood }; - int itemIndex = level->random.nextInt(sizeof(items) / 4); + int itemIndex = level->random.nextInt(sizeof(items) / sizeof(Item*)); Item* itemToSpawn = items[itemIndex]; return ItemInstance(itemToSpawn); } else { static Tile* tiles[] = { Tile::bookshelf }; - int tileIndex = level->random.nextInt(sizeof(tiles) / 4); + int tileIndex = level->random.nextInt(sizeof(tiles) / sizeof(Tile*)); Tile* tileToSpawn = tiles[tileIndex]; return ItemInstance(tileToSpawn); }