diff --git a/Minecraft.Client/Common/Media/platformskin.swf b/Minecraft.Client/Common/Media/platformskin.swf new file mode 100644 index 00000000..c9366377 Binary files /dev/null and b/Minecraft.Client/Common/Media/platformskin.swf differ diff --git a/Minecraft.Client/Common/Media/platformskinHD.swf b/Minecraft.Client/Common/Media/platformskinHD.swf new file mode 100644 index 00000000..c51a7cae Binary files /dev/null and b/Minecraft.Client/Common/Media/platformskinHD.swf differ diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index ac1dbdfc..0933db4a 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -165,6 +165,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Tile::mycelium_Id) ITEM_AUX(Tile::dirt_Id, DirtTile::COARSE_DIRT) ITEM_AUX(Tile::dirt_Id, DirtTile::PODZOL) + ITEM(Tile::grass_path_Id) ITEM(Tile::nether_brick_Id) ITEM(Tile::end_stone_Id) ITEM_AUX(Tile::quartz_block_Id,QuartzBlockTile::TYPE_CHISELED) @@ -567,6 +568,8 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::carrot_Id) ITEM(Item::golden_carrot_Id) ITEM(Item::pumpkin_pie_Id) + ITEM(Item::beetroot_Id) + ITEM(Item::beetroot_soup_Id) // Tools, Armour and Weapons (Complete) DEF(eCreativeInventory_ToolsArmourWeapons) @@ -683,6 +686,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::wheat_seeds_Id) ITEM(Item::melon_seeds_Id) ITEM(Item::pumpkin_seeds_Id) + ITEM(Item::beetroot_seeds_Id) ITEM(Item::wheat_Id) ITEM(Item::reeds_Id) ITEM(Item::egg_Id) diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 7ba1774a..db4bd631 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -662,9 +662,21 @@ void UIController::loadSkins() { m_iggyLibraries[eLibraryFallback_Platform] = loadSkin(L"skinWin.swf", L"platformskin.swf"); } + if(m_iggyLibraries[eLibraryFallback_Platform] == IGGY_INVALID_LIBRARY) + { + m_iggyLibraries[eLibraryFallback_Platform] = loadSkin(L"skinWin.swf", L"platformskin.swf"); + } if(m_iggyLibraries[eLibrary_Platform] == IGGY_INVALID_LIBRARY) { +<<<<<<< Updated upstream m_iggyLibraries[eLibrary_Platform] = loadSkin(L"skinHDWin.swf", L"platformskin.swf"); +======= + m_iggyLibraries[eLibrary_Platform] = loadSkin(L"Graphics\\ControlType\\HD\\windowsHD.swf", L"platformskinHD.swf"); + if(m_iggyLibraries[eLibrary_Platform] == IGGY_INVALID_LIBRARY) + { + m_iggyLibraries[eLibrary_Platform] = loadSkin(L"skinHDWin.swf", L"platformskinHD.swf"); + } +>>>>>>> Stashed changes } // Non-HD skin set (720p/480p scenes import these) @@ -679,17 +691,28 @@ void UIController::loadSkins() m_iggyLibraries[eLibraryFallback_Tooltips] = loadSkin(L"skinTooltips.swf", L"skinTooltips.swf"); m_iggyLibraries[eLibraryFallback_Default] = loadSkin(L"skin.swf", L"skin.swf"); - // HD skin set (1080p scenes import these) - m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.swf"); - m_iggyLibraries[eLibrary_GraphicsHUD] = loadSkin(L"skinHDGraphicsHud.swf", L"skinHDGraphicsHud.swf"); - m_iggyLibraries[eLibrary_GraphicsInGame] = loadSkin(L"skinHDGraphicsInGame.swf", L"skinHDGraphicsInGame.swf"); - m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf"); - m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf"); - m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinHDLabels.swf", L"skinHDLabels.swf"); - m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinHDInGame.swf", L"skinHDInGame.swf"); - m_iggyLibraries[eLibrary_HUD] = loadSkin(L"skinHDHud.swf", L"skinHDHud.swf"); - m_iggyLibraries[eLibrary_Tooltips] = loadSkin(L"skinHDTooltips.swf", L"skinHDTooltips.swf"); - m_iggyLibraries[eLibrary_Default] = loadSkin(L"skinHD.swf", L"skinHD.swf"); + // HD skin set (1080p scenes import these). Fall back to skinHDWin.swf for any + // that are missing so scenes can always resolve their HD skin imports. + struct { IggyLibrary *slot; const wchar_t *file; const wchar_t *name; } hdSkins[] = { + { &m_iggyLibraries[eLibrary_GraphicsDefault], L"skinHDGraphics.swf", L"skinHDGraphics.swf" }, + { &m_iggyLibraries[eLibrary_GraphicsHUD], L"skinHDGraphicsHud.swf", L"skinHDGraphicsHud.swf" }, + { &m_iggyLibraries[eLibrary_GraphicsInGame], L"skinHDGraphicsInGame.swf", L"skinHDGraphicsInGame.swf" }, + { &m_iggyLibraries[eLibrary_GraphicsTooltips], L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf" }, + { &m_iggyLibraries[eLibrary_GraphicsLabels], L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf" }, + { &m_iggyLibraries[eLibrary_Labels], L"skinHDLabels.swf", L"skinHDLabels.swf" }, + { &m_iggyLibraries[eLibrary_InGame], L"skinHDInGame.swf", L"skinHDInGame.swf" }, + { &m_iggyLibraries[eLibrary_HUD], L"skinHDHud.swf", L"skinHDHud.swf" }, + { &m_iggyLibraries[eLibrary_Tooltips], L"skinHDTooltips.swf", L"skinHDTooltips.swf" }, + { &m_iggyLibraries[eLibrary_Default], L"skinHD.swf", L"skinHD.swf" }, + }; + for(auto &s : hdSkins) + { + *s.slot = loadSkin(s.file, s.name); + if(*s.slot == IGGY_INVALID_LIBRARY) + { + *s.slot = loadSkin(L"skinHDWin.swf", s.name); + } + } //Load skins specifcally edited for use on achievements, if we //used these as skin.swf and skinInGame.swf it breaks some other things diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 2b94ab02..75f95c9a 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -398,7 +398,7 @@ void UIScene::loadMovie() // Read movie dimensions from the SWF header (available immediately after // CreateFromMemory, no init tick needed). IggyProperties *properties = IggyPlayerProperties ( swf ); - if(!properties) + if(!properties || (uintptr_t)properties < 0x1000) { app.DebugPrintf("ERROR: IggyPlayerProperties returned null for scene '%ls'\n", moviePath.c_str()); #ifndef _CONTENT_PACKAGE diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/items.png b/Minecraft.Client/Common/res/TitleUpdate/res/items.png index c9ace5b7..0f241da7 100644 Binary files a/Minecraft.Client/Common/res/TitleUpdate/res/items.png and b/Minecraft.Client/Common/res/TitleUpdate/res/items.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/terrain.png b/Minecraft.Client/Common/res/TitleUpdate/res/terrain.png index 3db05c72..6879ad4e 100644 Binary files a/Minecraft.Client/Common/res/TitleUpdate/res/terrain.png and b/Minecraft.Client/Common/res/TitleUpdate/res/terrain.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel2.png b/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel2.png index cbc0d0be..d3042132 100644 Binary files a/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel2.png and b/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel2.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel3.png b/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel3.png index d229e448..8e83fabb 100644 Binary files a/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel3.png and b/Minecraft.Client/Common/res/TitleUpdate/res/terrainMipMapLevel3.png differ diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index a3ce657e..6e2677ab 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -23,6 +23,7 @@ #include "../Minecraft.World/net.minecraft.world.food.h" #include "../Minecraft.World/net.minecraft.world.effect.h" #include "../Minecraft.World/net.minecraft.world.entity.player.h" +#include "../Minecraft.World/net.minecraft.world.item.enchantment.h" #include "../Minecraft.World/net.minecraft.world.entity.monster.h" #include "../Minecraft.World/ItemEntity.h" #include "../Minecraft.World/net.minecraft.world.level.h" @@ -526,6 +527,16 @@ void LocalPlayer::aiStep() onGround = true; } + if (isAlive()) + { + int frostWalkerLevel = EnchantmentHelper::getFrostWalker(dynamic_pointer_cast(shared_from_this())); + if (frostWalkerLevel > 0) + { + FrostWalkerEnchantment::freezeNearby(dynamic_pointer_cast(shared_from_this()), level, + Mth::floor(x), Mth::floor(y), Mth::floor(z), frostWalkerLevel); + } + } + // Check if the player is idle and the rich presence needs updated if( !m_bIsIdle && InputManager.GetIdleSeconds( m_iPad ) > PLAYER_IDLE_TIME ) { diff --git a/Minecraft.Client/PreStitchedTextureMap.cpp b/Minecraft.Client/PreStitchedTextureMap.cpp index dac289c3..c2922c10 100644 --- a/Minecraft.Client/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/PreStitchedTextureMap.cpp @@ -564,8 +564,11 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(13, 2, L"doorDark") ADD_ICON(13, 3, L"doorJungle") ADD_ICON(13, 4, L"doorSpruce") - ADD_ICON(13, 5, L"rabbit_stew") + ADD_ICON(13, 5, L"rabbit_stew") ADD_ICON(13, 6, L"salmonCooked") + ADD_ICON(12, 1, L"beetroot") + ADD_ICON(12, 2, L"beetroot_seeds") + ADD_ICON(12, 3, L"beetroot_soup") ADD_ICON(14, 0, L"skull_skeleton") @@ -577,8 +580,8 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(14, 6, L"rabbitHide") ADD_ICON(13, 14, L"prismarineCrystal"); ADD_ICON(13, 13, L"prismarineShard"); - ADD_ICON(13, 12, L"elytra"); - ADD_ICON(13, 11, L"broken_elytra"); + ADD_ICON(0, 15, L"elytra"); + ADD_ICON(1, 15, L"broken_elytra"); ADD_ICON_WITH_NAME(14, 7, L"compassP0", L"compass") // 4J Added ADD_ICON_WITH_NAME(14, 8, L"compassP1", L"compass") // 4J Added @@ -1068,6 +1071,26 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(24, 3, L"jungle_door_lower"); ADD_ICON(24, 4, L"spruce_door_lower"); + ADD_ICON(24, 12, L"frosted_ice_0"); + ADD_ICON(24, 13, L"frosted_ice_1"); + ADD_ICON(24, 14, L"frosted_ice_2"); + ADD_ICON(24, 15, L"frosted_ice_3"); + + ADD_ICON(23, 9, L"grass_path_side"); + ADD_ICON(23, 10, L"grass_path_top"); + ADD_ICON(24, 9, L"magma"); + ADD_ICON(24, 10, L"nether_wart_block"); + + ADD_ICON(23, 8, L"end_bricks"); + ADD_ICON(26, 1, L"bone_block_top"); + ADD_ICON(26, 0, L"bone_block_side"); + + ADD_ICON(25, 0, L"beetroots_stage_0"); + ADD_ICON(25, 1, L"beetroots_stage_1"); + ADD_ICON(25, 2, L"beetroots_stage_2"); + ADD_ICON(25, 3, L"beetroots_stage_3"); + ADD_ICON(24, 11, L"red_nether_brick"); + ADD_ICON(21, 1, L"tallgrass2_tall_grass_lower"); ADD_ICON(20, 1, L"tallgrass2_tall_grass_upper"); ADD_ICON(21, 0, L"tallgrass2_large_fern_lower"); diff --git a/Minecraft.Client/Windows64/Windows64_UIController.cpp b/Minecraft.Client/Windows64/Windows64_UIController.cpp index 3f5285ae..3a0d7c1d 100644 --- a/Minecraft.Client/Windows64/Windows64_UIController.cpp +++ b/Minecraft.Client/Windows64/Windows64_UIController.cpp @@ -92,6 +92,7 @@ void ConsoleUIController::render() let it know we're done rendering, so it can do any finalization it needs to do. */ gdraw_D3D11_NoMoreGDrawThisFrame(); + #endif } diff --git a/Minecraft.Client/Windows64Media/Media/platformskinHD.swf b/Minecraft.Client/Windows64Media/Media/platformskinHD.swf new file mode 100644 index 00000000..8b62afc3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Media/platformskinHD.swf differ diff --git a/Minecraft.Client/Windows64Media/Media/skinHD.swf b/Minecraft.Client/Windows64Media/Media/skinHD.swf new file mode 100644 index 00000000..1c81efe6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Media/skinHD.swf differ diff --git a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index c8e403ba..22e373f7 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -9181,6 +9181,10 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Packed Ice + + Frosted Ice + + Sunflower @@ -9464,6 +9468,14 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Luck of the Sea + + + Frost Walker + + + + Mending + Red Sandstone Slab @@ -9471,6 +9483,15 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Elytra + Dirt Path + Beetroot + Beetroot + Beetroot Seeds + Beetroot Stew + Restores {*ICON_SHANK_HALF_01*}. + Plant on Farmland. + Restores 3{*ICON_SHANK_01*}. + Taking Inventory Open your inventory. diff --git a/Minecraft.World/BeetrootTile.cpp b/Minecraft.World/BeetrootTile.cpp new file mode 100644 index 00000000..6095591d --- /dev/null +++ b/Minecraft.World/BeetrootTile.cpp @@ -0,0 +1,88 @@ +#include "stdafx.h" +#include "net.minecraft.world.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.world.level.h" +#include "BeetrootTile.h" + +BeetrootTile::BeetrootTile(int id) : CropTile(id) +{ +} + +Icon *BeetrootTile::getTexture(int face, int data) +{ + if (data < 0 || data > 3) data = 3; + return icons[data]; +} + +int BeetrootTile::getBaseSeedId() +{ + return Item::beetroot_seeds_Id; +} + +int BeetrootTile::getBasePlantId() +{ + return Item::beetroot_Id; +} + +void BeetrootTile::tick(Level *level, int x, int y, int z, Random *random) +{ + Bush::tick(level, x, y, z, random); + if (level->getRawBrightness(x, y + 1, z) >= Level::MAX_BRIGHTNESS - 6) + { + int age = level->getData(x, y, z); + if (age < 3) + { + if (random->nextInt(3) != 0) + { + float growthSpeed = 1.0f; + if (random->nextInt(static_cast(25 / growthSpeed) + 1) == 0) + { + age++; + level->setData(x, y, z, age, Tile::UPDATE_CLIENTS); + } + } + } + } +} + +void BeetrootTile::growCrops(Level *level, int x, int y, int z) +{ + int stage = level->getData(x, y, z) + 1; + if (stage > 3) stage = 3; + level->setData(x, y, z, stage, Tile::UPDATE_CLIENTS); +} + +int BeetrootTile::getResource(int data, Random *random, int playerBonusLevel) +{ + if (data == 3) + { + return getBasePlantId(); + } + return getBaseSeedId(); +} + +void BeetrootTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus) +{ + Bush::spawnResources(level, x, y, z, data, odds, 0); + + if (level->isClientSide) + { + return; + } + if (data >= 3) + { + int seedCount = 1 + level->random->nextInt(4); + for (int i = 0; i < seedCount; i++) + { + popResource(level, x, y, z, std::make_shared(getBaseSeedId(), 1, 0)); + } + } +} + +void BeetrootTile::registerIcons(IconRegister *iconRegister) +{ + for (int i = 0; i < 4; i++) + { + icons[i] = iconRegister->registerIcon(getIconName() + L"_stage_" + std::to_wstring(i)); + } +} diff --git a/Minecraft.World/BeetrootTile.h b/Minecraft.World/BeetrootTile.h new file mode 100644 index 00000000..6a8e201d --- /dev/null +++ b/Minecraft.World/BeetrootTile.h @@ -0,0 +1,26 @@ +#pragma once + +#include "CropTile.h" + +class BeetrootTile : public CropTile +{ + friend class ChunkRebuildData; +private: + Icon *icons[4]; + +public: + BeetrootTile(int id); + + Icon *getTexture(int face, int data); + +protected: + int getBaseSeedId(); + int getBasePlantId(); + +public: + void tick(Level *level, int x, int y, int z, Random *random); + void growCrops(Level *level, int x, int y, int z); + int getResource(int data, Random *random, int playerBonusLevel); + void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus); + void registerIcons(IconRegister *iconRegister); +}; diff --git a/Minecraft.World/DyePowderItem.cpp b/Minecraft.World/DyePowderItem.cpp index e4a87ddb..b3cf0f76 100644 --- a/Minecraft.World/DyePowderItem.cpp +++ b/Minecraft.World/DyePowderItem.cpp @@ -234,12 +234,25 @@ bool DyePowderItem::growCrop(shared_ptr itemInstance, Level *level } return true; } - else if (tile == Tile::wheat_Id) + else if (tile == Tile::wheat_Id) { if (level->getData(x, y, z) == 7) return false; if(!bTestUseOnOnly) - { - if (!level->isClientSide) + { + if (!level->isClientSide) + { + static_cast(Tile::tiles[tile])->growCrops(level, x, y, z); + itemInstance->count--; + } + } + return true; + } + else if (tile == Tile::beetroots_Id) + { + if (level->getData(x, y, z) == 3) return false; + if (!bTestUseOnOnly) + { + if (!level->isClientSide) { static_cast(Tile::tiles[tile])->growCrops(level, x, y, z); itemInstance->count--; diff --git a/Minecraft.World/Enchantment.cpp b/Minecraft.World/Enchantment.cpp index b1db79f8..3d3a94e1 100644 --- a/Minecraft.World/Enchantment.cpp +++ b/Minecraft.World/Enchantment.cpp @@ -4,6 +4,8 @@ #include "Enchantment.h" #include "WaterWalkerEnchantment.h" +#include "FrostWalkerEnchantment.h" +#include "MendingEnchantment.h" #include "LuckOfTheSeaEnchantment.h" #include "LureEnchantment.h" @@ -19,6 +21,7 @@ Enchantment *Enchantment::projectileProtection = nullptr; Enchantment *Enchantment::drownProtection = nullptr; Enchantment *Enchantment::waterWorker = nullptr; Enchantment *Enchantment::waterWalker = nullptr; +Enchantment *Enchantment::frostWalker = nullptr; Enchantment *Enchantment::thorns = nullptr; // weapon @@ -45,6 +48,9 @@ Enchantment *Enchantment::arrowInfinite = nullptr; Enchantment *Enchantment::lure = nullptr; Enchantment *Enchantment::luckOfTheSea = nullptr; +// misc / treasure +Enchantment *Enchantment::mending = nullptr; + void Enchantment::staticCtor() { allDamageProtection = new ProtectionEnchantment(0, FREQ_COMMON, ProtectionEnchantment::ALL); @@ -55,6 +61,7 @@ void Enchantment::staticCtor() drownProtection = new OxygenEnchantment(5, FREQ_RARE); waterWorker = new WaterWorkerEnchantment(6, FREQ_RARE); waterWalker = new WaterWalkerEnchantment(8, FREQ_RARE); + frostWalker = new FrostWalkerEnchantment(9, FREQ_RARE); thorns = new ThornsEnchantment(7, FREQ_VERY_RARE); // weapon @@ -81,10 +88,13 @@ void Enchantment::staticCtor() lure = new LureEnchantment(64, FREQ_RARE); luckOfTheSea = new LuckOfTheSeaEnchantment(65, FREQ_RARE); + // misc / treasure + mending = new MendingEnchantment(70, FREQ_RARE); + for(unsigned int i = 0; i < 256; ++i) { Enchantment *enchantment = enchantments[i]; - if (enchantment != nullptr) + if (enchantment != nullptr && !enchantment->isTreasureEnchantment()) { validEnchantments.push_back(enchantment); } diff --git a/Minecraft.World/Enchantment.h b/Minecraft.World/Enchantment.h index b302a2c6..e7d4f658 100644 --- a/Minecraft.World/Enchantment.h +++ b/Minecraft.World/Enchantment.h @@ -26,6 +26,7 @@ public : static Enchantment *drownProtection; static Enchantment *waterWorker; static Enchantment *waterWalker; + static Enchantment *frostWalker; static Enchantment *thorns; // weapon @@ -52,6 +53,9 @@ public : static Enchantment *lure; static Enchantment *luckOfTheSea; + // misc / treasure + static Enchantment *mending; + const int id; static void staticCtor(); @@ -81,6 +85,7 @@ public: virtual int getDamageProtection(int level, DamageSource *source); virtual float getDamageBonus(int level, shared_ptr target); virtual bool isCompatibleWith(Enchantment *other) const; + virtual bool isTreasureEnchantment() const { return false; } virtual Enchantment *setDescriptionId(int id); virtual int getDescriptionId(); virtual HtmlString getFullname(int level); diff --git a/Minecraft.World/EnchantmentHelper.cpp b/Minecraft.World/EnchantmentHelper.cpp index e02299b3..0be92cbc 100644 --- a/Minecraft.World/EnchantmentHelper.cpp +++ b/Minecraft.World/EnchantmentHelper.cpp @@ -239,11 +239,41 @@ int EnchantmentHelper::getWaterWalker(shared_ptr source) return getEnchantmentLevel(Enchantment::waterWalker->id, source->getEquipmentSlots() ); } +int EnchantmentHelper::getFrostWalker(shared_ptr source) +{ + return getEnchantmentLevel(Enchantment::frostWalker->id, source->getEquipmentSlots()); +} + int EnchantmentHelper::getArmorThorns(shared_ptr source) { return getEnchantmentLevel(Enchantment::thorns->id, source->getEquipmentSlots()); } +shared_ptr EnchantmentHelper::getMendingItem(shared_ptr source) +{ + int mendId = Enchantment::mending->id; + vector> candidates; + + shared_ptr held = source->getCarriedItem(); + if (held != nullptr && held->isDamaged() && getEnchantmentLevel(mendId, held) > 0) + { + candidates.push_back(held); + } + + ItemInstanceArray armor = source->getEquipmentSlots(); + for (unsigned int i = 0; i < armor.length; ++i) + { + shared_ptr piece = armor[i]; + if (piece != nullptr && piece->isDamaged() && getEnchantmentLevel(mendId, piece) > 0) + { + candidates.push_back(piece); + } + } + + if (candidates.empty()) return nullptr; + return candidates[random.nextInt((int)candidates.size())]; +} + shared_ptr EnchantmentHelper::getRandomItemWith(Enchantment *enchantment, shared_ptr source) { ItemInstanceArray items = source->getEquipmentSlots(); diff --git a/Minecraft.World/EnchantmentHelper.h b/Minecraft.World/EnchantmentHelper.h index 46a0e719..57761d21 100644 --- a/Minecraft.World/EnchantmentHelper.h +++ b/Minecraft.World/EnchantmentHelper.h @@ -81,7 +81,9 @@ public: static int getKillingLootBonus(shared_ptr source); static bool hasWaterWorkerBonus(shared_ptr source); static int getWaterWalker(shared_ptr source); + static int getFrostWalker(shared_ptr source); static int getArmorThorns(shared_ptr source); + static shared_ptr getMendingItem(shared_ptr source); static shared_ptr getRandomItemWith(Enchantment *enchantment, shared_ptr source); /** diff --git a/Minecraft.World/ExperienceOrb.cpp b/Minecraft.World/ExperienceOrb.cpp index cc4b12bc..23b3fdee 100644 --- a/Minecraft.World/ExperienceOrb.cpp +++ b/Minecraft.World/ExperienceOrb.cpp @@ -4,6 +4,7 @@ #include "net.minecraft.world.phys.h" #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.damagesource.h" +#include "net.minecraft.world.item.enchantment.h" #include "com.mojang.nbt.h" #include "JavaMath.h" #include "SharedConstants.h" @@ -198,7 +199,21 @@ void ExperienceOrb::playerTouch(shared_ptr player) // 4J - sound change brought forward from 1.2.3 playSound(eSoundType_RANDOM_ORB, 0.1f, 0.5f * ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.8f)); player->take(shared_from_this(), 1); - player->increaseXp(value); + + shared_ptr mendItem = EnchantmentHelper::getMendingItem(dynamic_pointer_cast(player)); + if (mendItem != nullptr) + { + int repair = value * 2; + int damage = mendItem->getDamageValue(); + if (repair > damage) repair = damage; + mendItem->setAuxValue(mendItem->getAuxValue() - repair); + value -= repair / 2; + } + + if (value > 0) + { + player->increaseXp(value); + } remove(); } } diff --git a/Minecraft.World/FrostWalkerEnchantment.cpp b/Minecraft.World/FrostWalkerEnchantment.cpp new file mode 100644 index 00000000..f25b8363 --- /dev/null +++ b/Minecraft.World/FrostWalkerEnchantment.cpp @@ -0,0 +1,63 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.entity.h" +#include "Material.h" +#include "Mth.h" +#include "FrostWalkerEnchantment.h" + +FrostWalkerEnchantment::FrostWalkerEnchantment(int id, int frequency) : Enchantment(id, frequency, EnchantmentCategory::armor_feet) +{ + setDescriptionId(IDS_ENCHANTMENT_FROST_WALKER); +} + +int FrostWalkerEnchantment::getMinCost(int level) +{ + return level * 10; +} + +int FrostWalkerEnchantment::getMaxCost(int level) +{ + return getMinCost(level) + 15; +} + +int FrostWalkerEnchantment::getMaxLevel() +{ + return 2; +} + +void FrostWalkerEnchantment::freezeNearby(shared_ptr living, Level *level, int px, int py, int pz, int enchLevel) +{ + if (!living->onGround) return; + + int radius = 2 + enchLevel; + if (radius > 16) radius = 16; + float f = (float)radius; + int r = radius; + + for (int dx = -r; dx <= r; dx++) + { + for (int dz = -r; dz <= r; dz++) + { + int bx = px + dx; + int by = py - 1; + int bz = pz + dz; + + double ddx = (bx + 0.5) - living->x; + double ddy = (by + 0.5) - living->y; + double ddz = (bz + 0.5) - living->z; + if (ddx * ddx + ddy * ddy + ddz * ddz > (double)(f * f)) continue; + + if (level->getTile(bx, by + 1, bz) != 0) continue; + + Material *ground = level->getMaterial(bx, by, bz); + if (ground != Material::water) continue; + if (level->getData(bx, by, bz) != 0) continue; + + if (Tile::frosted_ice->mayPlace(level, bx, by, bz)) + { + level->setTileAndData(bx, by, bz, Tile::frosted_ice_Id, 0, Tile::UPDATE_ALL); + } + } + } +} diff --git a/Minecraft.World/FrostWalkerEnchantment.h b/Minecraft.World/FrostWalkerEnchantment.h new file mode 100644 index 00000000..b8e5c0aa --- /dev/null +++ b/Minecraft.World/FrostWalkerEnchantment.h @@ -0,0 +1,19 @@ +#pragma once + +#include "Enchantment.h" + +class Level; +class LivingEntity; + +class FrostWalkerEnchantment : public Enchantment +{ +public: + FrostWalkerEnchantment(int id, int freq); + + virtual int getMinCost(int level) override; + virtual int getMaxCost(int level) override; + virtual int getMaxLevel() override; + virtual bool isTreasureEnchantment() const override { return true; } + + static void freezeNearby(shared_ptr living, Level *level, int px, int py, int pz, int enchLevel); +}; diff --git a/Minecraft.World/FrostedIceTile.cpp b/Minecraft.World/FrostedIceTile.cpp new file mode 100644 index 00000000..baba0b8f --- /dev/null +++ b/Minecraft.World/FrostedIceTile.cpp @@ -0,0 +1,147 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.dimension.h" +#include "net.minecraft.world.item.enchantment.h" +#include "net.minecraft.world.food.h" +#include "net.minecraft.stats.h" +#include "FrostedIceTile.h" +#include "Random.h" +#include "IconRegister.h" + +const int FrostedIceTile::MAX_AGE; + +FrostedIceTile::FrostedIceTile(int id) : IceTile(id) +{ + // Inherits ice friction/sound from IceTile. Scheduled ticks drive the melt. + for (int i = 0; i < 4; i++) m_ageIcons[i] = nullptr; +} + +void FrostedIceTile::registerIcons(IconRegister *iconRegister) +{ + m_ageIcons[0] = iconRegister->registerIcon(L"frosted_ice_0"); + m_ageIcons[1] = iconRegister->registerIcon(L"frosted_ice_1"); + m_ageIcons[2] = iconRegister->registerIcon(L"frosted_ice_2"); + m_ageIcons[3] = iconRegister->registerIcon(L"frosted_ice_3"); + icon = m_ageIcons[0]; +} + +Icon *FrostedIceTile::getTexture(int face, int data) +{ + int age = data; + if (age < 0) age = 0; + if (age > MAX_AGE) age = MAX_AGE; + return m_ageIcons[age]; +} + +int FrostedIceTile::randomTickDelay(Random *random) +{ + return 20 + random->nextInt(21); // 20-40 ticks +} + +void FrostedIceTile::onPlace(Level *level, int x, int y, int z) +{ + // Schedule the first melt check 60-120 ticks after forming + level->addToTickNextTick(x, y, z, id, 60 + level->random->nextInt(61)); +} + +int FrostedIceTile::countIceNeighbours(Level *level, int x, int y, int z) +{ + static const int off[6][3] = { + { 0, -1, 0 }, { 0, 1, 0 }, { 0, 0, -1 }, { 0, 0, 1 }, { -1, 0, 0 }, { 1, 0, 0 } + }; + int count = 0; + for (int i = 0; i < 6; i++) + { + if (level->getTile(x + off[i][0], y + off[i][1], z + off[i][2]) == id) + { + if (++count >= 4) return count; + } + } + return count; +} + +void FrostedIceTile::meltToWater(Level *level, int x, int y, int z) +{ + if (level->dimension->ultraWarm) + { + level->removeTile(x, y, z); + return; + } + level->setTileAndUpdate(x, y, z, Tile::water_Id); + level->updateNeighborsAt(x, y, z, Tile::water_Id); +} + +bool FrostedIceTile::slightlyMelt(Level *level, int x, int y, int z, Random *random, bool spreadToNeighbours) +{ + int age = level->getData(x, y, z); + if (age < MAX_AGE) + { + level->setData(x, y, z, age + 1, Tile::UPDATE_CLIENTS); + level->addToTickNextTick(x, y, z, id, randomTickDelay(random)); + return false; + } + meltToWater(level, x, y, z); + + if (spreadToNeighbours) + { + static const int off[6][3] = { + { 0, -1, 0 }, { 0, 1, 0 }, { 0, 0, -1 }, { 0, 0, 1 }, { -1, 0, 0 }, { 1, 0, 0 } + }; + for (int i = 0; i < 6; i++) + { + int nx = x + off[i][0], ny = y + off[i][1], nz = z + off[i][2]; + if (level->getTile(nx, ny, nz) == id) + slightlyMelt(level, nx, ny, nz, random, false); + } + } + return true; +} + +void FrostedIceTile::tick(Level *level, int x, int y, int z, Random *random) +{ + if (level->isClientSide) return; + + int age = level->getData(x, y, z); + + int light = level->getRawBrightness(x, y, z); + + + if ((random->nextInt(3) == 0 || countIceNeighbours(level, x, y, z) < 4) + && light > 11 - age - Tile::lightBlock[id]) + { + slightlyMelt(level, x, y, z, random, true); + } + else + { + level->addToTickNextTick(x, y, z, id, randomTickDelay(random)); + } +} + +void FrostedIceTile::neighborChanged(Level *level, int x, int y, int z, int neighborId) +{ + // If a neighbouring frosted ice melts away leaving us poorly supported, melt too + if (neighborId == id && countIceNeighbours(level, x, y, z) < 2) + { + meltToWater(level, x, y, z); + } +} + +int FrostedIceTile::getResourceCount(Random *random) +{ + return 0; // never drops anything, even with silk touch +} + +void FrostedIceTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +{ + // Frosted ice yields nothing and turns to water like normal ice + if (level->dimension->ultraWarm) + { + level->removeTile(x, y, z); + return; + } + Material *below = level->getMaterial(x, y - 1, z); + if (below->blocksMotion() || below->isLiquid()) + { + level->setTileAndUpdate(x, y, z, Tile::water_Id); + } +} diff --git a/Minecraft.World/FrostedIceTile.h b/Minecraft.World/FrostedIceTile.h new file mode 100644 index 00000000..58b2760e --- /dev/null +++ b/Minecraft.World/FrostedIceTile.h @@ -0,0 +1,31 @@ +#pragma once +#include "IceTile.h" + +class Random; +class Icon; +class IconRegister; + +class FrostedIceTile : public IceTile +{ +public: + static const int MAX_AGE = 3; + + FrostedIceTile(int id); + + virtual void registerIcons(IconRegister *iconRegister); + virtual Icon *getTexture(int face, int data); + + virtual void onPlace(Level *level, int x, int y, int z); + virtual void tick(Level *level, int x, int y, int z, Random *random); + virtual void neighborChanged(Level *level, int x, int y, int z, int neighborId); + virtual int getResourceCount(Random *random); + virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + +private: + Icon *m_ageIcons[4]; + + bool slightlyMelt(Level *level, int x, int y, int z, Random *random, bool spreadToNeighbours); + void meltToWater(Level *level, int x, int y, int z); + int countIceNeighbours(Level *level, int x, int y, int z); + int randomTickDelay(Random *random); +}; diff --git a/Minecraft.World/GrassPathTile.cpp b/Minecraft.World/GrassPathTile.cpp new file mode 100644 index 00000000..a39d1616 --- /dev/null +++ b/Minecraft.World/GrassPathTile.cpp @@ -0,0 +1,60 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "Material.h" +#include "IconRegister.h" +#include "Facing.h" +#include "GrassPathTile.h" + +GrassPathTile::GrassPathTile(int id) : Tile(id, Material::dirt), iconTop(nullptr) +{ +} + +void GrassPathTile::updateDefaultShape() +{ + setShape(0, 0, 0, 1, 15 / 16.0f, 1); +} + +bool GrassPathTile::isSolidRender(bool isServerLevel) +{ + return false; +} + +bool GrassPathTile::isCubeShaped() +{ + return false; +} + +void GrassPathTile::registerIcons(IconRegister *iconRegister) +{ + iconTop = iconRegister->registerIcon(L"grass_path_top"); + icon = iconRegister->registerIcon(L"grass_path_side"); +} + +Icon *GrassPathTile::getTexture(int face, int data) +{ + if (face == Facing::UP) return iconTop; + return icon; +} + +void GrassPathTile::checkAndConvert(Level *level, int x, int y, int z) +{ + if (level->getMaterial(x, y + 1, z)->blocksMotion()) + { + level->setTileAndUpdate(x, y, z, Tile::dirt_Id); + } +} + +void GrassPathTile::neighborChanged(Level *level, int x, int y, int z, int neighborId) +{ + checkAndConvert(level, x, y, z); +} + +int GrassPathTile::getResource(int data, Random *random, int playerBonusLevel) +{ + return Tile::dirt_Id; +} + +int GrassPathTile::getResourceCount(Random *random) +{ + return 1; +} diff --git a/Minecraft.World/GrassPathTile.h b/Minecraft.World/GrassPathTile.h new file mode 100644 index 00000000..cb748f50 --- /dev/null +++ b/Minecraft.World/GrassPathTile.h @@ -0,0 +1,22 @@ +#pragma once +#include "Tile.h" + +class GrassPathTile : public Tile +{ + Icon *iconTop; + +public: + GrassPathTile(int id); + + virtual void updateDefaultShape() override; + virtual bool isSolidRender(bool isServerLevel = false) override; + virtual bool isCubeShaped() override; + virtual void neighborChanged(Level *level, int x, int y, int z, int neighborId) override; + virtual void registerIcons(IconRegister *iconRegister) override; + virtual Icon *getTexture(int face, int data) override; + virtual int getResource(int data, Random *random, int playerBonusLevel) override; + virtual int getResourceCount(Random *random) override; + +private: + void checkAndConvert(Level *level, int x, int y, int z); +}; diff --git a/Minecraft.World/Item.cpp b/Minecraft.World/Item.cpp index 3ffe9a5a..aee69209 100644 --- a/Minecraft.World/Item.cpp +++ b/Minecraft.World/Item.cpp @@ -274,6 +274,10 @@ Item* Item::prismarine_shard = nullptr; Item* Item::elytra = nullptr; +Item* Item::beetroot = nullptr; +Item* Item::beetroot_seeds = nullptr; +Item* Item::beetroot_soup = nullptr; + void Item::staticCtor() { @@ -541,6 +545,10 @@ void Item::staticCtor() Item::prismarine_crystal = (new Item(154))->setIconName(L"prismarineCrystal")->setDescriptionId(IDS_ITEM_PRISMARINE_CRYSTAL)->setUseDescriptionId(IDS_ITEM_PRISMARINE_CRYSTAL_DESC); Item::prismarine_shard = (new Item(153))->setIconName(L"prismarineShard")->setDescriptionId(IDS_ITEM_PRISMARINE_SHARD)->setUseDescriptionId(IDS_ITEM_PRISMARINE_SHARD_DESC); Item::elytra = (new ElytraItem())->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_cloth)->setIconName(L"elytra")->setDescriptionId(IDS_ITEM_ELYTRA)->setUseDescriptionId(IDS_ITEM_ELYTRA); + + Item::beetroot = (new FoodItem(178, 1, 0.6f, false))->setIconName(L"beetroot")->setDescriptionId(IDS_BEETROOT)->setUseDescriptionId(IDS_DESC_BEETROOT); + Item::beetroot_seeds = (new SeedItem(179, Tile::beetroots_Id, Tile::farmland_Id))->setIconName(L"beetroot_seeds")->setDescriptionId(IDS_BEETROOT_SEEDS)->setUseDescriptionId(IDS_DESC_BEETROOT_SEEDS); + Item::beetroot_soup = (new BowlFoodItem(180, 6))->setIconName(L"beetroot_soup")->setDescriptionId(IDS_ITEM_BEETROOT_SOUP)->setUseDescriptionId(IDS_DESC_BEETROOT_SOUP); } @@ -1195,5 +1203,8 @@ const int Item::carrot_on_a_stick_Id ; const int Item::pumpkin_pie_Id ; const int Item::enchanted_book_Id ; const int Item::quartz_Id ; +const int Item::beetroot_Id ; +const int Item::beetroot_seeds_Id ; +const int Item::beetroot_soup_Id ; #endif diff --git a/Minecraft.World/Item.h b/Minecraft.World/Item.h index f1feb30f..8c1a62ba 100644 --- a/Minecraft.World/Item.h +++ b/Minecraft.World/Item.h @@ -439,6 +439,10 @@ public: static Item* prismarine_shard; static Item* elytra; + static Item* beetroot; + static Item* beetroot_seeds; + static Item* beetroot_soup; + static const int iron_shovel_Id = 256; static const int iron_pickaxe_Id = 257; @@ -671,6 +675,10 @@ public: static const int elytra_Id = 443; + + static const int beetroot_Id = 434; + static const int beetroot_seeds_Id = 435; + static const int beetroot_soup_Id = 436; //TU31 diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index 8dbfa494..5b1e7f9b 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -288,6 +288,16 @@ void LivingEntity::baseTick() animStepO = animStep; + if (!level->isClientSide && isAlive()) + { + int frostWalkerLevel = EnchantmentHelper::getFrostWalker(dynamic_pointer_cast(shared_from_this())); + if (frostWalkerLevel > 0) + { + FrostWalkerEnchantment::freezeNearby(dynamic_pointer_cast(shared_from_this()), level, + Mth::floor(x), Mth::floor(y), Mth::floor(z), frostWalkerLevel); + } + } + yBodyRotO = yBodyRot; yHeadRotO = yHeadRot; yRotO = yRot; diff --git a/Minecraft.World/MendingEnchantment.cpp b/Minecraft.World/MendingEnchantment.cpp new file mode 100644 index 00000000..856ee9a5 --- /dev/null +++ b/Minecraft.World/MendingEnchantment.cpp @@ -0,0 +1,29 @@ +#include "stdafx.h" +#include "net.minecraft.world.item.h" +#include "ItemInstance.h" +#include "MendingEnchantment.h" + +MendingEnchantment::MendingEnchantment(int id, int frequency) : Enchantment(id, frequency, EnchantmentCategory::all) +{ + setDescriptionId(IDS_ENCHANTMENT_MENDING); +} + +int MendingEnchantment::getMinCost(int level) +{ + return level * 25; +} + +int MendingEnchantment::getMaxCost(int level) +{ + return getMinCost(level) + 50; +} + +int MendingEnchantment::getMaxLevel() +{ + return 1; +} + +bool MendingEnchantment::canEnchant(shared_ptr item) +{ + return item->isDamageableItem(); +} diff --git a/Minecraft.World/MendingEnchantment.h b/Minecraft.World/MendingEnchantment.h new file mode 100644 index 00000000..3892bb40 --- /dev/null +++ b/Minecraft.World/MendingEnchantment.h @@ -0,0 +1,15 @@ +#pragma once + +#include "Enchantment.h" + +class MendingEnchantment : public Enchantment +{ +public: + MendingEnchantment(int id, int freq); + + virtual int getMinCost(int level) override; + virtual int getMaxCost(int level) override; + virtual int getMaxLevel() override; + virtual bool isTreasureEnchantment() const override { return true; } + virtual bool canEnchant(shared_ptr item) override; +}; diff --git a/Minecraft.World/ShovelItem.cpp b/Minecraft.World/ShovelItem.cpp index 4b75cd85..06dddcb2 100644 --- a/Minecraft.World/ShovelItem.cpp +++ b/Minecraft.World/ShovelItem.cpp @@ -1,6 +1,9 @@ #include "stdafx.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.level.h" #include "net.minecraft.world.level.tile.h" +#include "ItemInstance.h" #include "ShovelItem.h" TileArray *ShovelItem::diggables = nullptr; @@ -24,6 +27,30 @@ ShovelItem::ShovelItem(int id, const Tier *tier) : DiggerItem(id, 1, tier, digga { } +bool ShovelItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +{ + if (!player->mayUseItemAt(x, y, z, face, instance)) return false; + + int targetType = level->getTile(x, y, z); + int above = level->getTile(x, y + 1, z); + + if (face != 0 && above == 0 && (targetType == Tile::grass_Id || targetType == Tile::dirt_Id)) + { + if (!bTestUseOnOnly) + { + Tile *tile = Tile::grass_path; + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, tile->soundType->getStepSound(), (tile->soundType->getVolume() + 1) / 2, tile->soundType->getPitch() * 0.8f); + + if (level->isClientSide) return true; + level->setTileAndUpdate(x, y, z, tile->id); + instance->hurtAndBreak(1, player); + } + return true; + } + + return false; +} + bool ShovelItem::canDestroySpecial(Tile *tile) { if (tile == Tile::topSnow) return true; diff --git a/Minecraft.World/ShovelItem.h b/Minecraft.World/ShovelItem.h index c9c42240..d4a13e71 100644 --- a/Minecraft.World/ShovelItem.h +++ b/Minecraft.World/ShovelItem.h @@ -11,5 +11,6 @@ public: static void staticCtor(); ShovelItem(int id, const Tier *tier); + bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) override; bool canDestroySpecial(Tile *tile); }; \ No newline at end of file diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index f7840344..254a8d3d 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -266,6 +266,9 @@ Tile* Tile::prismarine = nullptr; Tile* Tile::log2 = nullptr; Tile* Tile::packedIce = nullptr; +FrostedIceTile* Tile::frosted_ice = nullptr; +GrassPathTile* Tile::grass_path = nullptr; +BeetrootTile* Tile::beetroots = nullptr; Tile* Tile::barrier = nullptr; TallGrass2* Tile::double_plant = nullptr; @@ -577,6 +580,9 @@ void Tile::staticCtor() // Tile::packedIce = (new PackedIceTile(174))->setDestroyTime(0.5f)->setSoundType(SOUND_GLASS)->setIconName(L"packed_ice")->setDescriptionId(IDS_TILE_PACKED_ICE)->setUseDescriptionId(IDS_DESC_PACKED_ICE); + Tile::beetroots = static_cast((new BeetrootTile(beetroots_Id))->setIconName(L"beetroots")->setDescriptionId(IDS_TILE_BEETROOTS)->setUseDescriptionId(IDS_DESC_BEETROOT_SEEDS)->disableMipmap()); + Tile::grass_path = static_cast((new GrassPathTile(grass_path_Id))->setDestroyTime(0.65f)->setSoundType(SOUND_GRAVEL)->setIconName(L"grass_path_top")->setDescriptionId(IDS_TILE_GRASS_PATH)->setUseDescriptionId(IDS_DESC_DIRT)->sendTileData()); + Tile::frosted_ice = static_cast((new FrostedIceTile(frosted_ice_Id))->setDestroyTime(0.5f)->setLightBlock(3)->setSoundType(Tile::SOUND_GLASS)->setIconName(L"ice")->setDescriptionId(IDS_TILE_FROSTED_ICE)->setUseDescriptionId(IDS_DESC_ICE)->setNotCollectStatistics()); Tile::daylight_detector_inverted = static_cast((new DaylightDetectorTile(178, true))->setDestroyTime(0.2f)->setSoundType(SOUND_WOOD)->setIconName(L"daylight_detector")->setDescriptionId(IDS_TILE_DAYLIGHT_DETECTOR)->setUseDescriptionId(IDS_DESC_DAYLIGHT_DETECTOR)); Tile::red_sandstone = (new RedSandStoneTile(red_sandstone_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_sand)->setSoundType(Tile::SOUND_STONE)->setDestroyTime(0.8f)->sendTileData()->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_RED_SANDSTONE)->sendTileData(); @@ -670,7 +676,7 @@ void Tile::staticCtor() { propagate = true; } - if (i == Tile::farmland_Id) propagate = true; + if (i == Tile::farmland_Id || i == Tile::grass_path_Id) propagate = true; if (Tile::transculent[i]) { propagate = true; @@ -1906,4 +1912,6 @@ const int Tile::carpet_Id; const int Tile::acacia_stairs_Id; const int Tile::dark_oak_stairs_Id; const int Tile::slime_Id; +const int Tile::beetroots_Id; +const int Tile::grass_path_Id; #endif diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index 595815dc..10677db9 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -44,6 +44,9 @@ class HalfSlabTile; class Icon; class IconRegister; class TallGrass2; +class FrostedIceTile; +class GrassPathTile; +class BeetrootTile; class ChunkRebuildData; @@ -441,10 +444,10 @@ public: //purpur_double_slab 204 //purpur_slab 205 //end_bricks 206 - //beetroots 207 - //grass_path 208 + static const int beetroots_Id = 207; + static const int grass_path_Id = 208; //end_gateway 209 - //frosted_ice 212 + static const int frosted_ice_Id = 212; //magma 213 //nether_wart_block 214 //red_nether_brick 215 @@ -662,6 +665,9 @@ public: static HalfSlabTile* stoneSlab2Half; static Tile* log2; static Tile* packedIce; + static FrostedIceTile* frosted_ice; + static GrassPathTile* grass_path; + static BeetrootTile* beetroots; static Tile* seaLantern; static Tile* prismarine; diff --git a/Minecraft.World/cmake/sources/Common.cmake b/Minecraft.World/cmake/sources/Common.cmake index a54e2c99..7cc02d80 100644 --- a/Minecraft.World/cmake/sources/Common.cmake +++ b/Minecraft.World/cmake/sources/Common.cmake @@ -1273,6 +1273,10 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_ITEM_ENCHANTMENT "${CMAKE_CURRENT_SOURCE_DIR}/WaterWorkerEnchantment.h" "${CMAKE_CURRENT_SOURCE_DIR}/WaterWalkerEnchantment.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/WaterWalkerEnchantment.h" + "${CMAKE_CURRENT_SOURCE_DIR}/FrostWalkerEnchantment.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/FrostWalkerEnchantment.h" + "${CMAKE_CURRENT_SOURCE_DIR}/MendingEnchantment.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/MendingEnchantment.h" "${CMAKE_CURRENT_SOURCE_DIR}/net.minecraft.world.item.enchantment.h" ) source_group("net/minecraft/world/item/enchantment" FILES ${_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_ITEM_ENCHANTMENT}) @@ -2039,6 +2043,12 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_LEVEL_TILE "${CMAKE_CURRENT_SOURCE_DIR}/Rose.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/TreeTile2.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/PackedIceTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/FrostedIceTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/FrostedIceTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/GrassPathTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/GrassPathTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/BeetrootTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/BeetrootTile.h" "${CMAKE_CURRENT_SOURCE_DIR}/RedSandStoneTile.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SeaLanternTile.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/PrismarineTile.cpp" diff --git a/Minecraft.World/net.minecraft.world.item.enchantment.h b/Minecraft.World/net.minecraft.world.item.enchantment.h index 57ec4753..96f65ad8 100644 --- a/Minecraft.World/net.minecraft.world.item.enchantment.h +++ b/Minecraft.World/net.minecraft.world.item.enchantment.h @@ -27,4 +27,7 @@ #include "LuckOfTheSeaEnchantment.h" -#include "LureEnchantment.h" \ No newline at end of file +#include "LureEnchantment.h" + +#include "FrostWalkerEnchantment.h" +#include "MendingEnchantment.h" \ No newline at end of file diff --git a/Minecraft.World/net.minecraft.world.level.tile.h b/Minecraft.World/net.minecraft.world.level.tile.h index f819e761..e27a8afc 100644 --- a/Minecraft.World/net.minecraft.world.level.tile.h +++ b/Minecraft.World/net.minecraft.world.level.tile.h @@ -55,6 +55,7 @@ #include "HopperTile.h" #include "HugeMushroomTile.h" #include "IceTile.h" +#include "FrostedIceTile.h" #include "JukeboxTile.h" #include "LadderTile.h" #include "LeafTile.h" @@ -144,5 +145,7 @@ #include "PackedIceTile.h" #include "StoneSlabTile2.h" +#include "GrassPathTile.h" +#include "BeetrootTile.h"