diff --git a/game/assets/patches/patch_data.txt b/game/assets/patches/patch_data.txt index 399be306d..40e774f92 100755 --- a/game/assets/patches/patch_data.txt +++ b/game/assets/patches/patch_data.txt @@ -13,19 +13,15 @@ # * The X and Y destination coordinates will be multiplied by 16. # * The texture doesn't have to be 16x16, all of it will be patched on to terrain.png. -grass_sides_tint|true - # Add festive patches terrain|2|14|n_rocket_launcher.png terrain|3|14|n_rocket_launched.png items|14|2|n_rocket.png -# Add plant veggie patches -terrain|7|2|tall_grass.png -terrain|7|3|dead_bush.png -# terrain|8|3|fern.png -terrain|15|3|spruce_sapling.png -terrain|15|4|birch_sapling.png +# Add pocket patches +terrain|12|0|p_rose.png +terrain|14|1|p_crying_obsidian.png +items|2|15|p_camera.png # Stop now to ignore the below commands. They're for a patch I'm working on that I don't want to release yet. stop_now diff --git a/source/client/gui/components/OptionList.cpp b/source/client/gui/components/OptionList.cpp index ea32ff043..9a4dabdbe 100644 --- a/source/client/gui/components/OptionList.cpp +++ b/source/client/gui/components/OptionList.cpp @@ -291,8 +291,8 @@ void OptionList::initDefaultMenu() void OptionList::initVideoMenu() { Options* pOptions = m_pMinecraft->getOptions(); - int currentIndex = -1; - int idxGrass = -1, idxBiome = -1; + int currentIndex = 0; + (void)currentIndex; OPTION(Distance, m_iViewDistance, "Render Distance"); OPTION(Boolean, m_bThirdPerson, "Third Person View"); @@ -301,16 +301,10 @@ void OptionList::initVideoMenu() OPTION(Boolean, m_bViewBobbing, "View Bobbing"); OPTION(Boolean, m_bAnaglyphs, "3D Anaglyph"); OPTION(Boolean, m_bBlockOutlines, "Block Outlines"); - OPTION(Render, m_bFancyGrass, "Fancy Grass"); idxGrass = currentIndex; // renders colored grass side overlay - OPTION(Render, m_bBiomeColors, "Biome Colors"); idxBiome = currentIndex; // colors the grass based on the current biome + OPTION(Render, m_bFancyGrass, "Fancy Grass"); + OPTION(Render, m_bBiomeColors, "Biome Colors"); OPTION(Boolean, m_bDontRenderGui, "Hide GUI"); OPTION(Boolean, m_bDynamicHand, "Dynamic Hand Movement"); - - if (!GetPatchManager()->IsGrassSidesTinted()) - m_items[idxGrass]->setDisabled(true); - - if (!GrassColor::isAvailable() || !FoliageColor::isAvailable()) - m_items[idxBiome]->setDisabled(true); } void OptionList::initControlsMenu() diff --git a/source/client/gui/screens/IngameBlockSelectionScreen.cpp b/source/client/gui/screens/IngameBlockSelectionScreen.cpp index a2b8f6d7e..3922e89ed 100644 --- a/source/client/gui/screens/IngameBlockSelectionScreen.cpp +++ b/source/client/gui/screens/IngameBlockSelectionScreen.cpp @@ -102,6 +102,7 @@ IngameBlockSelectionScreen::IngameBlockSelectionScreen() : addCreativeItem(Tile::treeTrunk->m_ID, 1); addCreativeItem(Tile::treeTrunk->m_ID, 2); addCreativeItem(Tile::cactus->m_ID); + addCreativeItem(Tile::tallGrass->m_ID); addCreativeItem(Tile::deadBush->m_ID); addCreativeItem(Tile::pumpkin->m_ID); addCreativeItem(Tile::pumpkinLantern->m_ID); diff --git a/source/client/options/Options.cpp b/source/client/options/Options.cpp index dbaecd3ab..9e0afc239 100644 --- a/source/client/options/Options.cpp +++ b/source/client/options/Options.cpp @@ -125,12 +125,7 @@ void Options::_load() else if (key == "gfx_blockoutlines") m_bBlockOutlines = readBool(value); else if (key == "gfx_fancygrass") - { - if (!(GetPatchManager()->IsGrassSidesTinted())) - m_bFancyGrass = false; - else - m_bFancyGrass = readBool(value); - } + m_bFancyGrass = readBool(value); else if (key == "gfx_biomecolors") { if (!GrassColor::isAvailable() && !FoliageColor::isAvailable()) diff --git a/source/client/renderer/PatchManager.cpp b/source/client/renderer/PatchManager.cpp index 0ec5d7b0a..3234ec2dd 100644 --- a/source/client/renderer/PatchManager.cpp +++ b/source/client/renderer/PatchManager.cpp @@ -157,16 +157,6 @@ void PatchManager::LoadPatchData(const std::string& patchData) ReadInt(lineStream, m_nMetalSideYOffset); continue; } - if (command == "grass_sides_tint") - { - ReadBool(lineStream, m_bGrassSidesTinted); - - if (m_bGrassSidesTinted) - // push a magic value so we can determine whether to disable it if the file doesn't exist - m_patchData.push_back(PatchData(TYPE_TERRAIN, 100, 100, "grass_side_transparent.png")); - - continue; - } LOG_W("Unknown command %s from patch data.", command.c_str()); } @@ -185,24 +175,11 @@ void PatchManager::PatchTextures(TextureData& texture, ePatchType patchType) if (pd.m_type != patchType) continue; - bool bDisableFancyGrassIfFailed = false; - - // got the magic value, we can determine whether to disable fancy pants grass if the file doesn't exist - if (pd.m_destX == 1600 && pd.m_destY == 1600 && pd.m_type == TYPE_TERRAIN) - { - pd.m_destX = 4 * 16; - pd.m_destY = 5 * 16; - - bDisableFancyGrassIfFailed = true; - } - // N.B. Well, in some cases, you do want things to fail nicely. TextureData patchTex = Resource::loadTexture("patches/" + pd.m_filename); if (patchTex.isEmpty()) { LOG_W("Image %s was not found?! Skipping", pd.m_filename.c_str()); - if (bDisableFancyGrassIfFailed) - m_bGrassSidesTinted = false; continue; } @@ -253,11 +230,6 @@ bool PatchManager::IsGlassSemiTransparent() return m_bGlassSemiTransparent; } -bool PatchManager::IsGrassSidesTinted() -{ - return m_bGrassSidesTinted; -} - void PatchManager::ReadBool(std::istream& is, bool& b) { std::string flag; diff --git a/source/client/renderer/PatchManager.hpp b/source/client/renderer/PatchManager.hpp index 72854e0b4..2699f1a53 100644 --- a/source/client/renderer/PatchManager.hpp +++ b/source/client/renderer/PatchManager.hpp @@ -81,7 +81,6 @@ class PatchManager bool IsGrassTinted(); int GetMetalSideYOffset(); bool IsGlassSemiTransparent(); - bool IsGrassSidesTinted(); private: void ReadBool(std::istream& is, bool& b); @@ -91,7 +90,6 @@ class PatchManager bool m_bGrassTinted; bool m_bGlassSemiTransparent; int m_nMetalSideYOffset; - bool m_bGrassSidesTinted; std::vector m_patchData; }; diff --git a/source/client/renderer/TileRenderer.cpp b/source/client/renderer/TileRenderer.cpp index 5b104ad4d..a73cbf580 100644 --- a/source/client/renderer/TileRenderer.cpp +++ b/source/client/renderer/TileRenderer.cpp @@ -722,7 +722,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0) { t.color(topR * 0.8f * fLight, topG * 0.8f * fLight, topB * 0.8f * fLight); - renderNorth(tile, pos, TEXTURE_NONE84); + renderNorth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); } } @@ -741,7 +741,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0) { t.color(topR * 0.8f * fLight, topG * 0.8f * fLight, topB * 0.8f * fLight); - renderSouth(tile, pos, TEXTURE_NONE84); + renderSouth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); } } @@ -760,7 +760,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0) { t.color(topR * 0.6f * fLight, topG * 0.6f * fLight, topB * 0.6f * fLight); - renderWest(tile, pos, TEXTURE_NONE84); + renderWest(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); } } @@ -779,7 +779,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0) { t.color(topR * 0.6f * fLight, topG * 0.6f * fLight, topB * 0.6f * fLight); - renderEast(tile, pos, TEXTURE_NONE84); + renderEast(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); } } @@ -2965,22 +2965,22 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusionV2(Tile* tile, cons switch (dir) { case Facing::DOWN: - renderFaceUp(tile, pos, TEXTURE_NONE84); + renderFaceUp(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); break; case Facing::UP: - renderFaceDown(tile, pos, TEXTURE_NONE84); + renderFaceDown(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); break; case Facing::NORTH: - renderNorth(tile, pos, TEXTURE_NONE84); + renderNorth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); break; case Facing::SOUTH: - renderSouth(tile, pos, TEXTURE_NONE84); + renderSouth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); break; case Facing::WEST: - renderWest(tile, pos, TEXTURE_NONE84); + renderWest(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); break; case Facing::EAST: - renderEast(tile, pos, TEXTURE_NONE84); + renderEast(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY); break; } } diff --git a/source/common/Utils.hpp b/source/common/Utils.hpp index 5bfdd89cf..c994576c8 100644 --- a/source/common/Utils.hpp +++ b/source/common/Utils.hpp @@ -159,7 +159,7 @@ enum eTileID TILE_RAIL_ACTIVATOR, TILE_PISTON_STICKY, TILE_COBWEB, - TILE_TALLGRASS, + TILE_TALL_GRASS, TILE_DEAD_BUSH, TILE_PISTON, TILE_PISTON_HEAD, @@ -229,7 +229,7 @@ enum eTileID TILE_STONE_BRICKS, TILE_MUSHROOM1_BLOCK, TILE_MUSHROOM2_BLOCK, - TILE_CLOTH_00 = 101, // @TODO: make these save on newer worlds + TILE_CLOTH_00 = 101, TILE_CLOTH_10, TILE_CLOTH_20, TILE_CLOTH_30, @@ -354,7 +354,9 @@ enum eTileID ITEM_BED, ITEM_DIODE, ITEM_COOKIE, - ITEM_RECORD_01, + ITEM_MAP, + ITEM_SHEARS, + ITEM_RECORD_01 = 2000, ITEM_RECORD_02, ITEM_CAMERA = 456, @@ -395,7 +397,7 @@ enum // Textures TEXTURE_CHEST_ONE_FRONT, TEXTURE_MUSHROOM_RED, TEXTURE_MUSHROOM_BROWN, - TEXTURE_NONE30, + TEXTURE_OBSIDIAN_CRYING, TEXTURE_FIRE1, TEXTURE_ORE_GOLD, TEXTURE_ORE_IRON, @@ -403,8 +405,8 @@ enum // Textures TEXTURE_BOOKSHELF, TEXTURE_MOSSY_STONE, TEXTURE_OBSIDIAN, - TEXTURE_OBSIDIAN_CRYING, // would become grass side overlay after removel - TEXTURE_NONE39, // tall grass + TEXTURE_GRASS_SIDE_OVERLAY, + TEXTURE_TALL_GRASS, TEXTURE_NONE40, TEXTURE_CHEST_TWO_FRONT_LEFT, TEXTURE_CHEST_TWO_FRONT_RIGHT, @@ -420,7 +422,7 @@ enum // Textures TEXTURE_LEAVES_TRANSPARENT, TEXTURE_LEAVES_OPAQUE, TEXTURE_NONE54, - TEXTURE_NONE55, // dead bush + TEXTURE_DEAD_BUSH, TEXTURE_NONE56, TEXTURE_CHEST_TWO_BACK_LEFT, TEXTURE_CHEST_TWO_BACK_RIGHT, @@ -449,7 +451,7 @@ enum // Textures TEXTURE_DOOR_TOP, TEXTURE_DOOR_IRON_TOP, TEXTURE_LADDER, - TEXTURE_NONE84, + TEXTURE_TRAPDOOR, TEXTURE_NONE85, TEXTURE_FARMLAND, TEXTURE_FARMLAND_DRY, @@ -471,8 +473,8 @@ enum // Textures TEXTURE_BLOODSTONE, TEXTURE_SOULSAND, TEXTURE_GLOWSTONE, - TEXTURE_NONE106, - TEXTURE_NONE107, + TEXTURE_STICKY_PISTON, + TEXTURE_PISTON, TEXTURE_NONE108, TEXTURE_NONE109, TEXTURE_NONE110, @@ -493,9 +495,13 @@ enum // Textures TEXTURE_NONE125, TEXTURE_NONE126, TEXTURE_NONE127, + TEXTURE_RAIL, TEXTURE_LAPIS = 144, TEXTURE_ORE_LAPIS = 160, + TEXTURE_POWERED_RAIL = 163, + TEXTURE_REDSTONE_DUST, + TEXTURE_DETECTOR_RAIL = 195, TEXTURE_SANDSTONE_TOP = 176, TEXTURE_SANDSTONE_SIDE = 192, @@ -518,14 +524,19 @@ enum eRenderShape SHAPE_TORCH, SHAPE_FIRE, SHAPE_WATER, - SHAPE_UNK5, - SHAPE_UNK6, + SHAPE_DUST, + SHAPE_CROPS, SHAPE_DOOR, SHAPE_LADDER, - SHAPE_UNK9, + SHAPE_RAIL, SHAPE_STAIRS, SHAPE_FENCE, + SHAPE_LEVER, SHAPE_CACTUS, + SHAPE_BED, + SHAPE_REPEATER, + SHAPE_PISTON, + SHAPE_PISTON_HEAD, SHAPE_RANDOM_CROSS }; diff --git a/source/world/item/Inventory.cpp b/source/world/item/Inventory.cpp index 01255eb04..113cdb577 100644 --- a/source/world/item/Inventory.cpp +++ b/source/world/item/Inventory.cpp @@ -40,10 +40,12 @@ void Inventory::prepareSurvivalInventory() addTestItem(Tile::obsidian->m_ID, 64); addTestItem(Tile::fire->m_ID, 64);*/ + // 0.2.1 items +#ifdef MOD_POCKET_SURVIVAL addCreativeItem(ITEM_SHOVEL_STONE); addCreativeItem(ITEM_PICKAXE_STONE); addCreativeItem(ITEM_HATCHET_STONE); - //addCreativeItem(ITEM_SHEARS); + addCreativeItem(ITEM_SHEARS); addCreativeItem(ITEM_SWORD_STONE); addCreativeItem(TILE_LADDER); addCreativeItem(TILE_TORCH); @@ -98,7 +100,6 @@ void Inventory::prepareSurvivalInventory() addCreativeItem(TILE_CACTUS); addCreativeItem(ITEM_REEDS); -#ifdef MOD_POCKET_SURVIVAL for (size_t i = 0; i < m_items.size(); i++) { ItemStack& item = m_items[i]; diff --git a/source/world/item/Item.cpp b/source/world/item/Item.cpp index c5aa77dc1..ec292d5a7 100644 --- a/source/world/item/Item.cpp +++ b/source/world/item/Item.cpp @@ -15,6 +15,29 @@ #include "TileItem.hpp" #include "TilePlanterItem.hpp" #include "RocketItem.hpp" +//#include "BowlFoodItem.hpp" +//#include "SaddleItem.hpp" +//#include "BucketItem.hpp" +//#include "WeaponItem.hpp" +//#include "PickaxeItem.hpp" +//#include "AxeItem.hpp" +//#include "ShovelItem.hpp" +//#include "HoeItem.hpp" +//#include "ArmorItem.hpp" +//#include "FlintAndSteelItem.hpp" +//#include "CoalItem.hpp" +//#include "BowItem.hpp" +//#include "SeedItem.hpp" +//#include "MinecartItem.hpp" +//#include "BoatItem.hpp" +//#include "BedItem.hpp" +//#include "RecordItem.hpp" +//#include "SignItem.hpp" +//#include "EggItem.hpp" +//#include "PaintingItem.hpp" +//#include "FishingRodItem.hpp" +//#include "MapItem.hpp" +//#include "ShearsItem.hpp" #define ITEM(x) ((x) - 256) @@ -255,6 +278,22 @@ void Item::initItems() ->setIcon(0, 3) ->setDescriptionId("bootsCloth"); + Item::helmet_chain = NEW_ITEM(ITEM_HELMET_CHAIN) + ->setIcon(1, 0) + ->setDescriptionId("helmetChain"); + + Item::chestplate_chain = NEW_ITEM(ITEM_CHESTPLATE_CHAIN) + ->setIcon(1, 1) + ->setDescriptionId("chestplateChain"); + + Item::leggings_chain = NEW_ITEM(ITEM_LEGGINGS_CHAIN) + ->setIcon(1, 2) + ->setDescriptionId("leggingsChain"); + + Item::boots_chain = NEW_ITEM(ITEM_BOOTS_CHAIN) + ->setIcon(1, 3) + ->setDescriptionId("bootsChain"); + Item::helmet_iron = NEW_ITEM(ITEM_HELMET_IRON) ->setIcon(2, 0) ->setDescriptionId("helmetIron"); @@ -535,6 +574,14 @@ void Item::initItems() ->setIcon(10, 1) ->setDescriptionId("painting"); + Item::map = NEW_ITEM(ITEM_MAP) + ->setIcon(12, 3) + ->setDescriptionId("map"); + + Item::shears = NEW_ITEM(ITEM_SHEARS) + ->setIcon(13, 5) + ->setDescriptionId("shears"); + Item::record_01 = NEW_ITEM(ITEM_RECORD_01) ->setIcon(0, 15) ->setDescriptionId("record"); @@ -741,6 +788,10 @@ Item *Item::chestplate_cloth, *Item::leggings_cloth, *Item::boots_cloth, + *Item::helmet_chain, + *Item::chestplate_chain, + *Item::leggings_chain, + *Item::boots_chain, *Item::helmet_iron, *Item::chestplate_iron, *Item::leggings_iron, @@ -793,6 +844,8 @@ Item *Item::bed, *Item::diode, *Item::cookie, + *Item::map, + *Item::shears, *Item::record_01, *Item::record_02, *Item::camera, diff --git a/source/world/item/Item.hpp b/source/world/item/Item.hpp index 6b713cf76..c89760569 100644 --- a/source/world/item/Item.hpp +++ b/source/world/item/Item.hpp @@ -171,6 +171,10 @@ class Item *chestplate_cloth, *leggings_cloth, *boots_cloth, + *helmet_chain, + *chestplate_chain, + *leggings_chain, + *boots_chain, *helmet_iron, *chestplate_iron, *leggings_iron, @@ -223,6 +227,8 @@ class Item *bed, *diode, *cookie, + *map, + *shears, *record_01, *record_02, *camera, diff --git a/source/world/tile/DoorTile.cpp b/source/world/tile/DoorTile.cpp index 0b8b818bb..428c03d67 100644 --- a/source/world/tile/DoorTile.cpp +++ b/source/world/tile/DoorTile.cpp @@ -99,9 +99,9 @@ int DoorTile::getResource(TileData data, Random* random) const return 0; if (m_pMaterial == Material::metal) - return Item::door_wood->m_itemID; + return Item::door_iron->m_itemID; - return Item::door_iron->m_itemID; + return Item::door_wood->m_itemID; } int DoorTile::getTexture(Facing::Name face, TileData data) const diff --git a/source/world/tile/Tile.cpp b/source/world/tile/Tile.cpp index eafaad6ad..49d32b539 100644 --- a/source/world/tile/Tile.cpp +++ b/source/world/tile/Tile.cpp @@ -13,6 +13,7 @@ #include "world/item/AuxTileItem.hpp" #include "world/item/ClothItem.hpp" #include "world/item/SlabItem.hpp" +//#include "world/item/PistonItem.hpp" // Include tile definitions here #include "SandStoneTile.hpp" @@ -689,13 +690,13 @@ void Tile::initTiles() ->setSoundType(Tile::SOUND_STONE) ->setDescriptionId("rocketLauncher"); - Tile::tallGrass = (new TallGrass(TILE_TALLGRASS, TEXTURE_NONE39)) + Tile::tallGrass = (new TallGrass(TILE_TALL_GRASS, TEXTURE_TALL_GRASS)) ->init() ->setSoundType(Tile::SOUND_GRASS) ->setDestroyTime(0.0f) ->setDescriptionId("tallGrass"); - Tile::deadBush = (new DeadBush(TILE_DEAD_BUSH, TEXTURE_NONE55)) + Tile::deadBush = (new DeadBush(TILE_DEAD_BUSH, TEXTURE_DEAD_BUSH)) ->init() ->setSoundType(Tile::SOUND_GRASS) ->setDestroyTime(0.0f) @@ -736,7 +737,7 @@ void Tile::initTiles() Tile::web = (new Web(TILE_COBWEB, TEXTURE_COBWEB)) ->init() ->setDestroyTime(4.0f) - //->setLightBlock(1) + ->setLightBlock(1) ->setSoundType(Tile::SOUND_CLOTH) ->setDescriptionId("web"); @@ -756,6 +757,10 @@ void Tile::initTiles() Item::items[Tile::sapling->m_ID] = (new AuxTileItem(Tile::sapling->m_ID - C_MAX_TILES)) ->setDescriptionId("sapling"); + //Item::items[Tile::piston->m_ID] = (new PistonItem(Tile::piston->m_ID - C_MAX_TILES)); + + //Item::items[Tile::stickyPiston->m_ID] = (new PistonItem(Tile::stickyPiston->m_ID - C_MAX_TILES)); + for (int i = 0; i < C_MAX_TILES; i++) { if (Tile::tiles[i] && !Item::items[i])