diff --git a/Minecraft.Client/Common/Media/MediaWindows64.arc b/Minecraft.Client/Common/Media/MediaWindows64.arc index ea0095ab..67f9d188 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64.arc and b/Minecraft.Client/Common/Media/MediaWindows64.arc differ diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 85178827..fa377ad0 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -75,6 +75,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Tile::treeTrunk_Id, TreeTile::JUNGLE_TRUNK) ITEM_AUX(Tile::tree2Trunk_Id, TreeTile2::ACACIA_TRUNK) ITEM_AUX(Tile::tree2Trunk_Id, TreeTile2::DARK_TRUNK) + ITEM(Tile::seaLantern_Id) ITEM(Tile::gravel_Id) ITEM(Tile::redBrick_Id) ITEM(Tile::mossyCobblestone_Id) @@ -590,6 +591,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::feather_Id) ITEM(Item::flint_Id) ITEM(Item::leather_Id) + ITEM(Item::prismarine_cystal_Id) ITEM(Item::rabbit_hide_Id) ITEM(Item::gunpowder_Id) ITEM(Item::clay_Id) diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/prismarine_rough.png b/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/prismarine_rough.png new file mode 100644 index 00000000..305f2776 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/prismarine_rough.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/sea_lantern.png b/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/sea_lantern.png new file mode 100644 index 00000000..4f08fd2d Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/sea_lantern.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/sea_lantern.txt b/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/sea_lantern.txt new file mode 100644 index 00000000..f90a8df3 --- /dev/null +++ b/Minecraft.Client/Common/res/TitleUpdate/res/textures/blocks/sea_lantern.txt @@ -0,0 +1,40 @@ +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +2 +2 +2 +2 +2 +3 +3 +3 +3 +3 +4 +4 +4 +4 +4 +3 +3 +3 +3 +3 +2 +2 +2 +2 +2 +1 +1 +1 +1 +1 \ No newline at end of file diff --git a/Minecraft.Client/PreStitchedTextureMap.cpp b/Minecraft.Client/PreStitchedTextureMap.cpp index 289bf901..023e5d7a 100644 --- a/Minecraft.Client/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/PreStitchedTextureMap.cpp @@ -566,6 +566,7 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(14, 4, L"skull_creeper") ADD_ICON(14, 5, L"rabbitsFoot") ADD_ICON(14, 6, L"rabbitHide") + ADD_ICON(13, 14, L"prismarineCrystal"); ADD_ICON_WITH_NAME(14, 7, L"compassP0", L"compass") // 4J Added ADD_ICON_WITH_NAME(14, 8, L"compassP1", L"compass") // 4J Added ADD_ICON_WITH_NAME(14, 9, L"compassP2", L"compass") // 4J Added @@ -1031,6 +1032,7 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(23, 2, L"door_dark_upper"); ADD_ICON(23, 3, L"door_jungle_upper"); ADD_ICON(23, 4, L"door_spruce_upper"); + ADD_ICON(23, 13, L"sea_lantern"); ADD_ICON(23, 14, L"inverted_daylight_detector"); ADD_ICON(23, 15, L"iron_trapdoor"); @@ -1040,5 +1042,6 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(24, 2, L"door_dark_lower"); ADD_ICON(24, 3, L"door_jungle_lower"); ADD_ICON(24, 4, L"door_spruce_lower"); + } } diff --git a/Minecraft.Client/Windows64Media/strings.h b/Minecraft.Client/Windows64Media/strings.h index fecbcd57..0b03c0ba 100644 --- a/Minecraft.Client/Windows64Media/strings.h +++ b/Minecraft.Client/Windows64Media/strings.h @@ -2334,3 +2334,5 @@ #define IDS_RICHPRESENCESTATE_BREWING 2328 #define IDS_RICHPRESENCESTATE_ANVIL 2329 #define IDS_RICHPRESENCESTATE_TRADING 2330 +#define IDS_TILE_SEA_LANTERN 2331 +#define IDS_ITEM_PRISMARINE_CRYSTAL 2332 \ No newline at end of file diff --git a/Minecraft.World/Item.cpp b/Minecraft.World/Item.cpp index c05a3519..3c0d82f0 100644 --- a/Minecraft.World/Item.cpp +++ b/Minecraft.World/Item.cpp @@ -266,6 +266,8 @@ Item* Item::rabbits_foot = nullptr; Item* Item::rabbit_hide = nullptr; Item* Item::armor_stand = nullptr; +Item* Item::prismarine_crystal = nullptr; + void Item::staticCtor() { Item::sword_wood = ( new WeaponItem(12, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_wood) ->setIconName(L"swordWood")->setDescriptionId(IDS_ITEM_SWORD_WOOD)->setUseDescriptionId(IDS_DESC_SWORD); @@ -524,6 +526,7 @@ void Item::staticCtor() Item::rabbits_foot = ( new Item(158) ) ->setIconName(L"rabbitsFoot")->setDescriptionId(IDS_ITEM_RABBIT_FOOT)->setUseDescriptionId(IDS_DESC_RABBIT_FOOT); Item::armor_stand = (new ArmorStandItem(160)) ->setBaseItemTypeAndMaterial(eBaseItemType_HangingItem,eMaterial_cloth)->setIconName(L"armorStand")->setDescriptionId(IDS_ITEM_ARMOR_STAND)->setUseDescriptionId(IDS_DESC_ARMOR_STAND); + Item::prismarine_crystal = (new Item(161))->setIconName(L"prismarineCrystal")->setDescriptionId(IDS_ITEM_PRISMARINE_CRYSTAL)->setUseDescriptionId(IDS_DESC_BRICK); } diff --git a/Minecraft.World/Item.h b/Minecraft.World/Item.h index c6e54c02..c58fd76b 100644 --- a/Minecraft.World/Item.h +++ b/Minecraft.World/Item.h @@ -432,6 +432,8 @@ public: static Item* rabbits_foot; static Item* armor_stand; + static Item* prismarine_crystal; + static const int shovel_iron_Id = 256; @@ -657,6 +659,8 @@ public: static const int rabbit_hide_Id = 415; static const int armor_stand_Id = 416; + static const int prismarine_cystal_Id = 417; + public: const int id; diff --git a/Minecraft.World/SeaLanternTile.cpp b/Minecraft.World/SeaLanternTile.cpp new file mode 100644 index 00000000..411e52d8 --- /dev/null +++ b/Minecraft.World/SeaLanternTile.cpp @@ -0,0 +1,30 @@ +#include "stdafx.h" +#include "SeaLanternTile.h" + +SeaLanternTile::SeaLanternTile(int id, Material* material) : Tile(id, material) +{ +} +int SeaLanternTile::getResourceCountForLootBonus(int bonusLevel, Random* random) +{ + return Mth::clamp(getResourceCount(random) + random->nextInt(bonusLevel + 1), 1, 4); +} + +int SeaLanternTile::getResourceCount(Random* random) +{ + return 2 + random->nextInt(3); +} + +int SeaLanternTile::getResource(int data, Random* random, int playerBonusLevel) +{ + return Item::prismarine_crystal->id; +} + +void SeaLanternTile::registerIcons(IconRegister* iconRegister) +{ + icon = iconRegister->registerIcon(L"sea_lantern"); +} + +Icon* SeaLanternTile::getTexture(int face, int data) +{ + return icon; +} \ No newline at end of file diff --git a/Minecraft.World/SeaLanternTile.h b/Minecraft.World/SeaLanternTile.h new file mode 100644 index 00000000..5013249c --- /dev/null +++ b/Minecraft.World/SeaLanternTile.h @@ -0,0 +1,15 @@ +#pragma once +#include "Tile.h" + +class SeaLanternTile : public Tile +{ +public: + SeaLanternTile(int id, Material* material); + virtual void registerIcons(IconRegister* iconRegister); + virtual Icon* getTexture(int face, int data); + virtual int getResourceCountForLootBonus(int bonusLevel, Random* random); + virtual int getResourceCount(Random* random); + virtual int getResource(int data, Random* random, int playerBonusLevel); +private: + Icon* icon; +}; \ No newline at end of file diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index cac85e14..3d49896a 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -16,6 +16,8 @@ #include "net.minecraft.world.h" #include "net.minecraft.h" #include "Tile.h" +#include "SeaLanternTile.h" +#include "SeaLanternTile.cpp" wstring Tile::TILE_DESCRIPTION_PREFIX = L"Tile."; @@ -246,6 +248,7 @@ Tile* Tile::darkGate = nullptr; Tile* Tile::invertedDaylightDetector = nullptr; Tile* Tile::red_sandstone = nullptr; Tile* Tile::stairs_red_sandstone = nullptr; +Tile* Tile::seaLantern = nullptr; Tile* Tile::tree2Trunk = nullptr; @@ -496,6 +499,9 @@ void Tile::staticCtor() Tile::door_jungle = (new DoorTile(195, Material::wood, L"doorJungle"))->setDestroyTime(3.0f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"door_jungle")->setDescriptionId(IDS_TILE_DOOR_JUNGLE)->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_DOOR_WOOD); Tile::door_acacia = (new DoorTile(196, Material::wood, L"doorAcacia"))->setDestroyTime(3.0f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"door_acacia")->setDescriptionId(IDS_TILE_DOOR_ACACIA)->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_DOOR_WOOD); Tile::door_dark = (new DoorTile(197, Material::wood, L"doorDark"))->setDestroyTime(3.0f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"door_dark")->setDescriptionId(IDS_TILE_DOOR_DARK)->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_DOOR_WOOD); + + Tile::seaLantern = (new SeaLanternTile(198, Material::glass))->setBaseItemTypeAndMaterial(Item::eBaseItemType_torch, Item::eMaterial_glowstone)->setDestroyTime(0.3f)->setSoundType(Tile::SOUND_GLASS)->setLightEmission(1.0f)->setIconName(L"glowstone")->setDescriptionId(IDS_TILE_SEA_LANTERN)->setUseDescriptionId(IDS_DESC_GLOWSTONE); + // Special cases for certain items since they can have different icons Item::items[wool_Id] = ( new WoolTileItem(Tile::wool_Id- 256) )->setIconName(L"cloth")->setDescriptionId(IDS_TILE_CLOTH)->setUseDescriptionId(IDS_DESC_WOOL); diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index 86a4d72c..12e8ac10 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -388,6 +388,7 @@ public: static const int darkFence_Id = 191; static const int acaciaFence_Id = 192; + static const int seaLantern_Id = 198; static Tile *stone; static GrassTile *grass; @@ -590,6 +591,7 @@ public: static Tile* red_sandstone; static Tile* stairs_red_sandstone; static Tile* tree2Trunk; + static Tile* seaLantern; static void staticCtor();