diff --git a/.github/roadmap.png b/.github/roadmap.png index 393ed367..93c8574c 100644 Binary files a/.github/roadmap.png and b/.github/roadmap.png differ diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 615c40c4..2999d40d 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -22,7 +22,7 @@ jobs: run: | git fetch --all for branch in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin/); do - if [[ "$branch" == "origin/exp/"* || "$branch" == "origin/feat/"* || "$branch" == "origin/experimental" ]]; then + if [[ "$branch" == "origin/exp/"* || "$branch" == "origin/feat/"* || "$branch" == "origin/experimental" || "$branch" == "origin/TU"* ]]; then local_branch="${branch#origin/}" git checkout -B "$local_branch" "$branch" if git merge origin/main --no-edit; then diff --git a/BUMP b/BUMP index 8b7b705c..f22a22da 100644 --- a/BUMP +++ b/BUMP @@ -1 +1 @@ -1.0.8b + 1.0.9b diff --git a/CMakeLists.txt b/CMakeLists.txt index c2562f70..fb25a2a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,41 @@ if(PLATFORM_NAME STREQUAL "Windows64") # Server is only supported on Windows for add_subdirectory(Minecraft.Server) endif() +if(TARGET Minecraft.Client) + add_custom_target(AssetTitleUpdateColourOverride ALL + COMMAND ${CMAKE_COMMAND} -E remove "$/Common/res/TitleUpdate/res/colours.col" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml" + "$/Common/res/TitleUpdate/res/colours.xml" + VERBATIM + ) + add_dependencies(AssetTitleUpdateColourOverride AssetFolderCopy_Minecraft.Client) + add_dependencies(Minecraft.Client AssetTitleUpdateColourOverride) + set_property(TARGET AssetTitleUpdateColourOverride PROPERTY FOLDER "Build") +endif() + +if(TARGET Minecraft.Server) + add_custom_target(AssetTitleUpdateColourOverride_Minecraft.Server ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml" + "$/Common/res/TitleUpdate/res/colours.xml" + VERBATIM + ) + add_dependencies(Minecraft.Server AssetTitleUpdateColourOverride_Minecraft.Server) + set_property(TARGET AssetTitleUpdateColourOverride_Minecraft.Server PROPERTY FOLDER "Build") +endif() + +if(TARGET Minecraft.Server.FourKit) + add_custom_target(AssetTitleUpdateColourOverride_Minecraft.Server.FourKit ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml" + "$/Common/res/TitleUpdate/res/colours.xml" + VERBATIM + ) + add_dependencies(Minecraft.Server.FourKit AssetTitleUpdateColourOverride_Minecraft.Server.FourKit) + set_property(TARGET AssetTitleUpdateColourOverride_Minecraft.Server.FourKit PROPERTY FOLDER "Build") +endif() + if(TARGET GenerateStringsHeader_Minecraft.Client) add_dependencies(Minecraft.World GenerateStringsHeader_Minecraft.Client) endif() diff --git a/Minecraft.Client/BannerModel.cpp b/Minecraft.Client/BannerModel.cpp new file mode 100644 index 00000000..314d36ce --- /dev/null +++ b/Minecraft.Client/BannerModel.cpp @@ -0,0 +1,28 @@ +#include "stdafx.h" +#include "BannerModel.h" +#include "ModelPart.h" + +BannerModel::BannerModel() +{ + texWidth = 64; + texHeight = 64; + + bannerSlate = new ModelPart(this, 0, 0); + bannerSlate->addBox(-10.0f, 0.0f, -2.0f, 20, 40, 1, 0.0f); + + bannerStand = new ModelPart(this, 44, 0); + bannerStand->addBox(-1.0f, -30.0f, -1.0f, 2, 42, 2, 0.0f); + + bannerTop = new ModelPart(this, 0, 42); + bannerTop->addBox(-10.0f, -32.0f, -1.0f, 20, 2, 2, 0.0f); + + bannerStand->compile(1.0f / 16.0f); + bannerTop->compile(1.0f / 16.0f); +} + +void BannerModel::renderBanner(bool useCompiled) +{ + bannerSlate->render(1.0f / 16.0f, false); + bannerStand->render(1.0f / 16.0f, useCompiled); + bannerTop->render(1.0f / 16.0f, useCompiled); +} diff --git a/Minecraft.Client/BannerModel.h b/Minecraft.Client/BannerModel.h new file mode 100644 index 00000000..1cac53b2 --- /dev/null +++ b/Minecraft.Client/BannerModel.h @@ -0,0 +1,15 @@ +#pragma once +#include "Model.h" + +class ModelPart; + +class BannerModel : public Model +{ +public: + ModelPart *bannerSlate; + ModelPart *bannerStand; + ModelPart *bannerTop; + + BannerModel(); + void renderBanner(bool useCompiled); +}; diff --git a/Minecraft.Client/BannerRenderer.cpp b/Minecraft.Client/BannerRenderer.cpp new file mode 100644 index 00000000..248d4a92 --- /dev/null +++ b/Minecraft.Client/BannerRenderer.cpp @@ -0,0 +1,147 @@ +#include "stdafx.h" +#include "BannerRenderer.h" +#include "BannerModel.h" +#include "ModelPart.h" +#include "TileEntityRenderDispatcher.h" +#include "../Minecraft.World/net.minecraft.world.level.tile.entity.h" +#include "../Minecraft.World/net.minecraft.world.level.tile.h" +#include "../Minecraft.World/net.minecraft.world.level.h" +#include "../Minecraft.World/DyePowderItem.h" +#include "../Minecraft.World/Entity.h" +#include "../Minecraft.World/Level.h" +#include "Lighting.h" +#include + +BannerRenderer *BannerRenderer::instance = nullptr; +ResourceLocation BannerRenderer::BANNER_LOCATION = ResourceLocation(TN_MOB_BANNER_BANNER_BASE); + +BannerRenderer::BannerRenderer() +{ + bannerModel = new BannerModel(); +} + +void BannerRenderer::init(TileEntityRenderDispatcher *dispatcher) +{ + TileEntityRenderer::init(dispatcher); + instance = this; +} + +static void applyBannerColor(int baseColor, float alpha, float brightness = 1.0f) +{ + if (baseColor >= 0 && baseColor < 16) + { + int rgb = DyePowderItem::COLOR_RGB[baseColor]; + float r = ((rgb >> 16) & 0xFF) / 255.0f * brightness; + float g = ((rgb >> 8) & 0xFF) / 255.0f * brightness; + float b = ( rgb & 0xFF) / 255.0f * brightness; + glColor4f(r, g, b, alpha); + } + else + { + glColor4f(brightness, brightness, brightness, alpha); + } +} + +void BannerRenderer::renderModelColoured(int baseColor, float alpha, bool useCompiled, float brightness) +{ + bindTexture(&BANNER_LOCATION); + + applyBannerColor(baseColor, alpha, brightness); + bannerModel->bannerSlate->render(1.0f / 16.0f, false); + + glColor4f(brightness, brightness, brightness, alpha); + bannerModel->bannerStand->render(1.0f / 16.0f, useCompiled); + bannerModel->bannerTop->render(1.0f / 16.0f, useCompiled); +} + +void BannerRenderer::render(shared_ptr _banner, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +{ + shared_ptr banner = dynamic_pointer_cast(_banner); + if (!banner) return; + + Tile *tile = banner->getTile(); + if (tile != Tile::standing_banner && tile != Tile::wall_banner) return; + const float f = 0.6666667f; + + glDisable(GL_LIGHTING); + glPushMatrix(); + + if (tile == Tile::standing_banner) + { + glTranslatef((float)x + 0.5f, (float)y + 0.75f * f, (float)z + 0.5f); + float rot = banner->getData() * 360.0f / 16.0f; + glRotatef(-rot, 0.0f, 1.0f, 0.0f); + bannerModel->bannerStand->visible = true; + } + else + { + glTranslatef((float)x + 0.5f, (float)y - 0.25f * f, (float)z + 0.5f); + int face = banner->getData(); + float rot = 0.0f; + if (face == 2) rot = 180.0f; + if (face == 4) rot = 90.0f; + if (face == 5) rot = -90.0f; + glRotatef(-rot, 0.0f, 1.0f, 0.0f); + glTranslatef(0.0f, -0.3125f, -0.4375f); + bannerModel->bannerStand->visible = false; + } + + bannerModel->bannerSlate->y = -32.0f; + + float f3 = (float)(banner->x * 7 + banner->y * 9 + banner->z * 13) + + (float)banner->level->getGameTime() + a; + bannerModel->bannerSlate->xRot = (-0.0125f + 0.01f * cosf(f3 * 3.14159265f * 0.02f)) * 3.14159265f; + + glScalef(f, -f, -f); + renderModelColoured(banner->getBaseColor(), alpha, useCompiled); + + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glPopMatrix(); + glEnable(GL_LIGHTING); +} + +void BannerRenderer::renderBannerForGui(float x, float y, float scaleX, float scaleY, float alpha, int baseColor) +{ + glPushMatrix(); + glEnable(GL_COLOR_MATERIAL); + + glTranslatef(x, y, 0.0f); + glScalef(16.0f * scaleX, 16.0f * scaleY, 1.0f); + + glTranslatef(0.5f, 0.72f, 0.0f); + + glRotatef(-25.0f, 1.0f, 0.0f, 0.0f); + glRotatef(199.0f, 0.0f, 1.0f, 0.0f); + glScalef(-1.0f, 1.0f, 1.0f); + + const float s = 0.33f; + glScalef(s, s, s); + + bannerModel->bannerSlate->y = -32.0f; + bannerModel->bannerSlate->xRot = 0.0f; + bannerModel->bannerStand->visible = true; + + Lighting::setAmbient(0.6f); + renderModelColoured(baseColor, alpha, false); + Lighting::setAmbient(0.4f); + + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glDisable(GL_COLOR_MATERIAL); + glPopMatrix(); +} + +void BannerRenderer::renderBannerForHand(float alpha, int baseColor) +{ + glDisable(GL_LIGHTING); + glPushMatrix(); + + bannerModel->bannerSlate->y = -32.0f; + bannerModel->bannerSlate->xRot = 0.0f; + bannerModel->bannerStand->visible = true; + + renderModelColoured(baseColor, alpha, false); + + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glPopMatrix(); + glEnable(GL_LIGHTING); +} diff --git a/Minecraft.Client/BannerRenderer.h b/Minecraft.Client/BannerRenderer.h new file mode 100644 index 00000000..b511dd4d --- /dev/null +++ b/Minecraft.Client/BannerRenderer.h @@ -0,0 +1,23 @@ +#pragma once +#include "TileEntityRenderer.h" +class BannerModel; + +class BannerRenderer : public TileEntityRenderer +{ +public: + static BannerRenderer *instance; + +private: + static ResourceLocation BANNER_LOCATION; + BannerModel *bannerModel; + + void renderModelColoured(int baseColor, float alpha, bool useCompiled, float brightness = 1.0f); + +public: + BannerRenderer(); + virtual void init(TileEntityRenderDispatcher *dispatcher) override; + virtual void render(shared_ptr banner, double x, double y, double z, float a, bool setColor, float alpha = 1.0f, bool useCompiled = true); + + void renderBannerForGui(float x, float y, float scaleX, float scaleY, float alpha, int baseColor); + void renderBannerForHand(float alpha, int baseColor); +}; diff --git a/Minecraft.Client/CMakeLists.txt b/Minecraft.Client/CMakeLists.txt index fe87cc40..7e435a1d 100644 --- a/Minecraft.Client/CMakeLists.txt +++ b/Minecraft.Client/CMakeLists.txt @@ -148,18 +148,6 @@ endif() # Copy redist files add_copyredist_target(Minecraft.Client) -# replace col file with xml file -add_custom_target(AssetTitleUpdateColourOverride_Minecraft.Client ALL - COMMAND ${CMAKE_COMMAND} -E remove "$/Common/res/TitleUpdate/res/colours.col" - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${CMAKE_CURRENT_SOURCE_DIR}/Common/res/TitleUpdate/res/colours.xml" - "$/Common/res/TitleUpdate/res/colours.xml" - VERBATIM -) -add_dependencies(AssetTitleUpdateColourOverride_Minecraft.Client AssetFolderCopy_Minecraft.Client) -add_dependencies(Minecraft.Client AssetTitleUpdateColourOverride_Minecraft.Client) -set_property(TARGET AssetTitleUpdateColourOverride_Minecraft.Client PROPERTY FOLDER "Build") - # Make sure GameHDD exists on Windows if(PLATFORM_NAME STREQUAL "Windows64") add_gamehdd_target(Minecraft.Client) diff --git a/Minecraft.Client/ChatScreen.cpp b/Minecraft.Client/ChatScreen.cpp index 32f824ea..b27f89bb 100644 --- a/Minecraft.Client/ChatScreen.cpp +++ b/Minecraft.Client/ChatScreen.cpp @@ -33,6 +33,15 @@ ChatScreen::ChatScreen() ChatScreen::s_chatIndex = 0; } +ChatScreen::ChatScreen(const wstring &initialMessage) +{ + frame = 0; + message = initialMessage; + cursorIndex = static_cast(message.length()); + s_historyIndex = -1; + ChatScreen::s_chatIndex = 0; +} + void ChatScreen::init() { Keyboard::enableRepeatEvents(true); diff --git a/Minecraft.Client/ChatScreen.h b/Minecraft.Client/ChatScreen.h index 70d65e8c..4c70f38c 100644 --- a/Minecraft.Client/ChatScreen.h +++ b/Minecraft.Client/ChatScreen.h @@ -22,6 +22,7 @@ private: public: ChatScreen(); + ChatScreen(const wstring &initialMessage); virtual void init(); virtual void removed(); virtual void tick(); diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 8fb1ceb7..7afec5c7 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -3482,6 +3482,10 @@ void ClientConnection::handleTileEntityData(shared_ptr pac { dynamic_pointer_cast(te)->load(packet->tag); } + else if (packet->type == TileEntityDataPacket::TYPE_BANNER && dynamic_pointer_cast(te) != nullptr) + { + dynamic_pointer_cast(te)->load(packet->tag); + } } } } diff --git a/Minecraft.Client/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h index f546a289..50ff0da0 100644 --- a/Minecraft.Client/Common/App_enums.h +++ b/Minecraft.Client/Common/App_enums.h @@ -469,7 +469,6 @@ enum eMinecraftColour eMinecraftColour_Mob_Guardian_Colour2, eMinecraftColour_Mob_ElderGuardian_Colour1, eMinecraftColour_Mob_ElderGuardian_Colour2, - eMinecraftColour_Armour_Default_Leather_Colour, eMinecraftColour_Under_Water_Clear_Colour, @@ -568,6 +567,9 @@ enum eMinecraftColour //eHTMLColor_e_dark = 0x3f3f15, //r:3f , g: 3f, b: 15, i: 1e //eHTMLColor_f_dark = 0x3f3f3f, //r:3f , g: 3f, b: 3f, i: 1f + eMinecraftColour_Mob_PolarBear_Colour1, + eMinecraftColour_Mob_PolarBear_Colour2, + eMinecraftColour_COUNT, }; diff --git a/Minecraft.Client/Common/Audio/SoundNames.cpp b/Minecraft.Client/Common/Audio/SoundNames.cpp index 7c0dd382..afc3343c 100644 --- a/Minecraft.Client/Common/Audio/SoundNames.cpp +++ b/Minecraft.Client/Common/Audio/SoundNames.cpp @@ -287,7 +287,14 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= L"mob.guardian.curse", L"mob.guardian.elder_death", L"mob.guardian.elder_hit", - L"mob.guardian.elder_idle" + L"mob.guardian.elder_idle", + + L"mob.polarbear.babyidle", + L"mob.polarbear.idle", + L"mob.polarbear.hurt", + L"mob.polarbear.death", + L"mob.polarbear.step", + L"mob.polarbear.warning" }; diff --git a/Minecraft.Client/Common/Colours/ColourTable.cpp b/Minecraft.Client/Common/Colours/ColourTable.cpp index 6e6b4755..7cbd849a 100644 --- a/Minecraft.Client/Common/Colours/ColourTable.cpp +++ b/Minecraft.Client/Common/Colours/ColourTable.cpp @@ -344,6 +344,8 @@ const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = L"Color_EnchantTextFocus", L"Color_EnchantTextDisabled", L"Color_RenamedItemTitle", + L"Mob_PolarBear_Colour1", + L"Mob_PolarBear_Colour2", }; void ColourTable::staticCtor() diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_01.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_01.xml new file mode 100644 index 00000000..6bf67a85 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_01.xml @@ -0,0 +1,104 @@ + + + + + + y + + + x + + + z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_01_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_01_coal.xml new file mode 100644 index 00000000..6de3f4ec --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_01_coal.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_02.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_02.xml new file mode 100644 index 00000000..f886b894 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_02.xml @@ -0,0 +1,93 @@ + + + + + + y + + + x + + + z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_02_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_02_coal.xml new file mode 100644 index 00000000..4a7391ed --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_02_coal.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_03.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_03.xml new file mode 100644 index 00000000..b0c4614a --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_03.xml @@ -0,0 +1,76 @@ + + + + + + y + + + x + + + z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_03_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_03_coal.xml new file mode 100644 index 00000000..dbf0c3ac --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_03_coal.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_04.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_04.xml new file mode 100644 index 00000000..226f0a6e --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_04.xml @@ -0,0 +1,47 @@ + + + + + + y + + + x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_04_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_04_coal.xml new file mode 100644 index 00000000..3c3cc5c4 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_skull_04_coal.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_01.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_01.xml new file mode 100644 index 00000000..199042a9 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_01.xml @@ -0,0 +1,52 @@ + + + + + + z + + + y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_01_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_01_coal.xml new file mode 100644 index 00000000..2ca00fe3 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_01_coal.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_02.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_02.xml new file mode 100644 index 00000000..970f8664 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_02.xml @@ -0,0 +1,79 @@ + + + + + + z + + + x + + + y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_02_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_02_coal.xml new file mode 100644 index 00000000..193670b4 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_02_coal.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_03.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_03.xml new file mode 100644 index 00000000..10fc3990 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_03.xml @@ -0,0 +1,115 @@ + + + + + + z + + + y + + + x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_03_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_03_coal.xml new file mode 100644 index 00000000..acaeb59f --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_03_coal.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_04.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_04.xml new file mode 100644 index 00000000..0d2b54ba --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_04.xml @@ -0,0 +1,139 @@ + + + + + + z + + + x + + + y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_04_coal.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_04_coal.xml new file mode 100644 index 00000000..6b51471f --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/fossils/fossil_spine_04_coal.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_bottom.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_bottom.xml new file mode 100644 index 00000000..6511c394 --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_bottom.xml @@ -0,0 +1,346 @@ + + + + + + stone + + + stonebrick + + + cracked_stonebrick + + + + mossy_stonebrick + + + smooth_andesite + + + chiseled_stonebrick + + + chiseled_brick + + + stone_brick + + + mossy_brick + + + south + + + east + + + data + + + false + true + false + + + 0 + empty + + + false + false + false + false + + + red + + + + south + + + 2 + + + top + north + straight + + + top + spruce + + + top + south + straight + + + north + + + north + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [2, 1, 1] + {'Attributes': [{'Name': 'generic.maxHealth', 'Base': 20.0}, {'Name': 'generic.knockbackResistance', 'Base': 0.0}, {'Name': 'generic.movementSpeed', 'Base': 0.5}, {'Name': 'generic.armor', 'Base': 0.0}, {'Name': 'generic.followRange', 'Base': 16.0, 'Modifiers': [{'Name': 'Random spawn bonus', 'Operation': 1, 'Amount': -0.07807250298271795, 'UUIDLeast': -9042289162618353532, 'UUIDMost': -8050404301371587461}]}], 'Age': 0, 'UUIDLeast': -8404016208519177543, 'Motion': [0.0, -0.0784000015258789, 0.0], 'Health': 20.0, 'Inventory': [], 'HandItems': [{}, {}], 'Offers': {'Recipes': [{'maxUses': 7, 'sell': {'id': 'minecraft:emerald', 'Damage': 0, 'Count': 1}, 'buy': {'id': 'minecraft:rotten_flesh', 'Damage': 0, 'Count': 36}, 'rewardExp': 1, 'uses': 0}, {'maxUses': 7, 'sell': {'id': 'minecraft:emerald', 'Damage': 0, 'Count': 1}, 'buy': {'id': 'minecraft:gold_ingot', 'Damage': 0, 'Count': 9}, 'rewardExp': 1, 'uses': 0}]}, 'Riches': 15, 'id': 'Villager', 'CareerLevel': 1, 'Career': 1, 'ArmorItems': [{}, {}, {}, {}], 'Fire': -1, 'Invulnerable': 0, 'DeathTime': 0, 'ForcedAge': 0, 'AbsorptionAmount': 0.0, 'HurtTime': 0, 'OnGround': 1, 'UUIDMost': 1009044389481761978, 'Profession': 2, 'ArmorDropChances': [0.08500000089406967, 0.08500000089406967, 0.08500000089406967, 0.08500000089406967], 'HurtByTimestamp': 0, 'Dimension': 0, 'Air': 300, 'Willing': 0, 'CanPickUpLoot': 1, 'Pos': [-72.5, 62.0, -120.5], 'PortalCooldown': 0, 'PersistenceRequired': 1, 'HandDropChances': [0.08500000089406967, 0.08500000089406967], 'Leashed': 0, 'LeftHanded': 0, 'FallDistance': 0.0, 'Rotation': [-4.32769775390625, -3.4165501594543457]} + [2.5, 1.0, 1.5] + + + [4, 1, 1] + {'ConversionTime': -1, 'Attributes': [{'Name': 'generic.maxHealth', 'Base': 20.0}, {'Name': 'generic.knockbackResistance', 'Base': 0.0, 'Modifiers': [{'Name': 'Random spawn bonus', 'Operation': 0, 'Amount': 0.033586338385064834, 'UUIDLeast': -9185924421726330189, 'UUIDMost': -1136549371827500916}]}, {'Name': 'generic.movementSpeed', 'Base': 0.23000000417232513}, {'Name': 'generic.armor', 'Base': 2.0}, {'Name': 'generic.followRange', 'Base': 35.0, 'Modifiers': [{'Name': 'Random spawn bonus', 'Operation': 1, 'Amount': -0.013882809459502736, 'UUIDLeast': -4972655095452447334, 'UUIDMost': -7187282525081156696}]}, {'Name': 'generic.attackDamage', 'Base': 3.0}, {'Name': 'zombie.spawnReinforcements', 'Base': 0.08507647017248195}], 'UUIDLeast': -6631449421406796428, 'Motion': [0.0, -0.0784000015258789, 0.0], 'IsVillager': 1, 'Health': 19.049999237060547, 'HandItems': [{}, {}], 'VillagerProfession': 2, 'id': 'Zombie', 'ArmorItems': [{}, {}, {}, {}], 'Fire': -1, 'Invulnerable': 0, 'DeathTime': 0, 'CanBreakDoors': 0, 'AbsorptionAmount': 0.0, 'HurtTime': 0, 'OnGround': 1, 'UUIDMost': 9169347718178752431, 'ArmorDropChances': [0.08500000089406967, 0.08500000089406967, 0.08500000089406967, 0.08500000089406967], 'HurtByTimestamp': 125, 'Dimension': 0, 'Air': 300, 'CanPickUpLoot': 0, 'Pos': [-70.5, 62.0, -120.69999998807907], 'PortalCooldown': 0, 'PersistenceRequired': 1, 'HandDropChances': [0.08500000089406967, 0.08500000089406967], 'Leashed': 0, 'LeftHanded': 0, 'FallDistance': 0.0, 'Rotation': [-95.78887939453125, 0.0]} + [4.5, 1.0, 1.300000011920929] + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_middle.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_middle.xml new file mode 100644 index 00000000..efd4fa0d --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_middle.xml @@ -0,0 +1,30 @@ + + + + + + stonebrick + + + north + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_top.xml b/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_top.xml new file mode 100644 index 00000000..2140591b --- /dev/null +++ b/Minecraft.Client/Common/Media/MediaWindows64/Structures/igloo/igloo_top.xml @@ -0,0 +1,192 @@ + + + + + + + + + + east + + + white + + + up + + + false + south + foot + + + false + top + north + + + false + south + head + + + silver + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/font/CHS/MSYH.ttf b/Minecraft.Client/Common/Media/font/CHS/MSYH.ttf new file mode 100644 index 00000000..96d1db19 Binary files /dev/null and b/Minecraft.Client/Common/Media/font/CHS/MSYH.ttf differ diff --git a/Minecraft.Client/Common/Media/font/CHT/DFHeiMedium-B5.ttf b/Minecraft.Client/Common/Media/font/CHT/DFHeiMedium-B5.ttf new file mode 100644 index 00000000..f9fb4894 Binary files /dev/null and b/Minecraft.Client/Common/Media/font/CHT/DFHeiMedium-B5.ttf differ diff --git a/Minecraft.Client/Common/Media/font/JPN/DFGMaruGothic-Md.ttf b/Minecraft.Client/Common/Media/font/JPN/DFGMaruGothic-Md.ttf new file mode 100644 index 00000000..4eb4eef7 Binary files /dev/null and b/Minecraft.Client/Common/Media/font/JPN/DFGMaruGothic-Md.ttf differ diff --git a/Minecraft.Client/Common/Media/font/KOR/BOKMSD.ttf b/Minecraft.Client/Common/Media/font/KOR/BOKMSD.ttf new file mode 100644 index 00000000..83fe8699 Binary files /dev/null and b/Minecraft.Client/Common/Media/font/KOR/BOKMSD.ttf differ diff --git a/Minecraft.Client/Common/Media/font/Mojangles.ttf b/Minecraft.Client/Common/Media/font/Mojangles.ttf new file mode 100644 index 00000000..e7b87e9f Binary files /dev/null and b/Minecraft.Client/Common/Media/font/Mojangles.ttf differ 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..09201999 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -165,8 +165,14 @@ 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::red_nether_brick_Id) ITEM(Tile::end_stone_Id) + ITEM(Tile::end_bricks_Id) + ITEM(Tile::magma_Id) + ITEM(Tile::nether_wart_block_Id) + ITEM(Tile::bone_block_Id) ITEM_AUX(Tile::quartz_block_Id,QuartzBlockTile::TYPE_CHISELED) ITEM_AUX(Tile::quartz_block_Id,QuartzBlockTile::TYPE_LINES_Y) ITEM(Tile::trapdoor_Id) @@ -305,6 +311,20 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Tile::bookshelf_Id) ITEM(Item::flower_pot_Id) ITEM(Tile::hay_block_Id) + ITEM_AUX(Tile::standing_banner_Id, 1) // Red + ITEM_AUX(Tile::standing_banner_Id, 14) // Orange + ITEM_AUX(Tile::standing_banner_Id, 11) // Yellow + ITEM_AUX(Tile::standing_banner_Id, 10) // Green + ITEM_AUX(Tile::standing_banner_Id, 12) // Light Blue + ITEM_AUX(Tile::standing_banner_Id, 6) // Cyan + ITEM_AUX(Tile::standing_banner_Id, 4) // Blue + ITEM_AUX(Tile::standing_banner_Id, 5) // Purple + ITEM_AUX(Tile::standing_banner_Id, 13) // Magenta + ITEM_AUX(Tile::standing_banner_Id, 9) // Pink + ITEM_AUX(Tile::standing_banner_Id, 15) // White + ITEM_AUX(Tile::standing_banner_Id, 8) // Dark Grey + ITEM_AUX(Tile::standing_banner_Id, 7) // Light Grey + ITEM_AUX(Tile::standing_banner_Id, 0) // Black ITEM_AUX(Tile::wool_Id,14) // Red ITEM_AUX(Tile::wool_Id,1) // Orange ITEM_AUX(Tile::wool_Id,4) // Yellow @@ -373,6 +393,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Tile::stained_glass_pane_Id,13) // Green ITEM_AUX(Tile::stained_glass_pane_Id,12) // Brown + #ifndef _CONTENT_PACKAGE DEF(eCreativeInventory_ArtToolsDecorations) if(app.DebugSettingsOn()) @@ -498,6 +519,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Item::spawn_egg_Id, 100 | ((EntityHorse::TYPE_MULE + 1) << 12)); // Mule ITEM_AUX(Item::spawn_egg_Id, 120); // Villager ITEM_AUX(Item::spawn_egg_Id, 101); // Rabbit Brown + ITEM_AUX(Item::spawn_egg_Id, 107); // Polar Bear ITEM(Item::record_13_Id) ITEM(Item::record_cat_Id) ITEM(Item::record_blocks_Id) @@ -567,6 +589,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 +707,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 765ce602..d2415b1f 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -514,9 +514,12 @@ void UIController::SetupFont() } else { + //removed this cause it caused a crash when switching from custom font to bitmap font but not when loading the game with font selected, needs a deeper look +#if 0 app.DebugPrintf("[Iggy] Set font indirect to '%hs'.\n", m_mcTTFFont->getFontName().c_str()); IggyFontSetIndirectUTF8( "Mojangles7", -1, IGGY_FONTFLAG_all, m_mcTTFFont->getFontName().c_str(), -1, IGGY_FONTFLAG_none ); IggyFontSetIndirectUTF8( "Mojangles11", -1, IGGY_FONTFLAG_all, m_mcTTFFont->getFontName().c_str(), -1, IGGY_FONTFLAG_none ); +#endif } } else @@ -660,11 +663,19 @@ void UIController::loadSkins() m_iggyLibraries[eLibraryFallback_Platform] = loadSkin(platformSkin, L"platformskin.swf"); if(m_iggyLibraries[eLibraryFallback_Platform] == IGGY_INVALID_LIBRARY) { - m_iggyLibraries[eLibraryFallback_Platform] = loadSkin(L"Graphics\\ControlType\\windows.swf", L"platformskin.swf"); + 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) { - m_iggyLibraries[eLibrary_Platform] = loadSkin(L"Graphics\\ControlType\\HD\\windowsHD.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"); + } } // Non-HD skin set (720p/480p scenes import these) @@ -679,17 +690,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 @@ -838,8 +860,8 @@ void UIController::PushDefaultPlatformSkinForPanorama() m_panoramaPlatformSkinHD = IGGY_INVALID_LIBRARY; m_panoramaPlatformSkin = IGGY_INVALID_LIBRARY; - const wstring defaultHd = L"Graphics\\ControlType\\HD\\windowsHD.swf"; - const wstring defaultSd = L"Graphics\\ControlType\\windows.swf"; + const wstring defaultHd = L"skinHDWin.swf"; + const wstring defaultSd = L"skinWin.swf"; IggyLibrary hdLib = loadSkin(defaultHd, L"platformskinHD.swf"); if(hdLib != IGGY_INVALID_LIBRARY) diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 1d648c71..e612ac34 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -460,7 +460,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/1_2_2/mob/banner/banner_base.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/banner_base.png new file mode 100644 index 00000000..6b50b8a8 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/banner_base.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/base.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/base.png new file mode 100644 index 00000000..9baba14f Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/base.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/border.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/border.png new file mode 100644 index 00000000..6c2cc9af Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/border.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/bricks.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/bricks.png new file mode 100644 index 00000000..c5da811a Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/bricks.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/circle.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/circle.png new file mode 100644 index 00000000..86cdcab3 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/circle.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/creeper.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/creeper.png new file mode 100644 index 00000000..8bb880fe Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/creeper.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/cross.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/cross.png new file mode 100644 index 00000000..a7f383d4 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/cross.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/curly_border.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/curly_border.png new file mode 100644 index 00000000..27589cd0 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/curly_border.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_left.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_left.png new file mode 100644 index 00000000..63f9832b Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_left.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_right.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_right.png new file mode 100644 index 00000000..64765204 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_right.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_up_left.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_up_left.png new file mode 100644 index 00000000..8808da1a Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_up_left.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_up_right.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_up_right.png new file mode 100644 index 00000000..325f4225 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/diagonal_up_right.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/flower.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/flower.png new file mode 100644 index 00000000..476dbf3a Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/flower.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/gradient.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/gradient.png new file mode 100644 index 00000000..f59caca7 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/gradient.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/gradient_up.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/gradient_up.png new file mode 100644 index 00000000..292f1082 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/gradient_up.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/half_horizontal.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_horizontal.png new file mode 100644 index 00000000..b855754b Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_horizontal.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/half_horizontal_bottom.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_horizontal_bottom.png new file mode 100644 index 00000000..9dfa27e5 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_horizontal_bottom.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/half_vertical.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_vertical.png new file mode 100644 index 00000000..c1e070a4 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_vertical.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/half_vertical_right.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_vertical_right.png new file mode 100644 index 00000000..9a21b93b Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/half_vertical_right.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/mojang.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/mojang.png new file mode 100644 index 00000000..1343fd8f Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/mojang.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/rhombus.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/rhombus.png new file mode 100644 index 00000000..412ea8b3 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/rhombus.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/skull.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/skull.png new file mode 100644 index 00000000..4c0e0b77 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/skull.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/small_stripes.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/small_stripes.png new file mode 100644 index 00000000..b164906a Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/small_stripes.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/square_bottom_left.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_bottom_left.png new file mode 100644 index 00000000..c3edbce5 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_bottom_left.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/square_bottom_right.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_bottom_right.png new file mode 100644 index 00000000..8db252a7 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_bottom_right.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/square_top_left.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_top_left.png new file mode 100644 index 00000000..e090efd5 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_top_left.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/square_top_right.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_top_right.png new file mode 100644 index 00000000..6e8aeabf Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/square_top_right.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/straight_cross.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/straight_cross.png new file mode 100644 index 00000000..7a4c2326 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/straight_cross.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_bottom.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_bottom.png new file mode 100644 index 00000000..7b18f725 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_bottom.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_center.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_center.png new file mode 100644 index 00000000..a6440008 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_center.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_downleft.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_downleft.png new file mode 100644 index 00000000..ab216689 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_downleft.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_downright.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_downright.png new file mode 100644 index 00000000..37b43795 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_downright.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_left.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_left.png new file mode 100644 index 00000000..5659ac76 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_left.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_middle.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_middle.png new file mode 100644 index 00000000..f4cf0cb0 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_middle.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_right.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_right.png new file mode 100644 index 00000000..56b01da2 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_right.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_top.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_top.png new file mode 100644 index 00000000..af628ad4 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/stripe_top.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/triangle_bottom.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangle_bottom.png new file mode 100644 index 00000000..435fb86a Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangle_bottom.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/triangle_top.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangle_top.png new file mode 100644 index 00000000..045b55e2 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangle_top.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/triangles_bottom.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangles_bottom.png new file mode 100644 index 00000000..e933a03e Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangles_bottom.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/banner/triangles_top.png b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangles_top.png new file mode 100644 index 00000000..205275a6 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/banner/triangles_top.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/bear/polarbear.png b/Minecraft.Client/Common/res/1_2_2/mob/bear/polarbear.png new file mode 100644 index 00000000..a340db83 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/bear/polarbear.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml b/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml index 3bc4010f..9aaf82ea 100644 --- a/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml +++ b/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml @@ -291,6 +291,8 @@ if __name__=="__main__": notecolors() + + 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/mob/banner/banner_base.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/banner_base.png new file mode 100644 index 00000000..6b50b8a8 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/banner_base.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/base.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/base.png new file mode 100644 index 00000000..9baba14f Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/base.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/border.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/border.png new file mode 100644 index 00000000..6c2cc9af Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/border.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/bricks.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/bricks.png new file mode 100644 index 00000000..c5da811a Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/bricks.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/circle.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/circle.png new file mode 100644 index 00000000..86cdcab3 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/circle.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/creeper.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/creeper.png new file mode 100644 index 00000000..8bb880fe Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/creeper.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/cross.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/cross.png new file mode 100644 index 00000000..a7f383d4 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/cross.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/curly_border.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/curly_border.png new file mode 100644 index 00000000..27589cd0 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/curly_border.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_left.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_left.png new file mode 100644 index 00000000..63f9832b Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_left.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_right.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_right.png new file mode 100644 index 00000000..64765204 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_right.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_up_left.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_up_left.png new file mode 100644 index 00000000..8808da1a Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_up_left.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_up_right.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_up_right.png new file mode 100644 index 00000000..325f4225 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/diagonal_up_right.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/flower.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/flower.png new file mode 100644 index 00000000..476dbf3a Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/flower.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/gradient.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/gradient.png new file mode 100644 index 00000000..f59caca7 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/gradient.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/gradient_up.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/gradient_up.png new file mode 100644 index 00000000..292f1082 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/gradient_up.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_horizontal.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_horizontal.png new file mode 100644 index 00000000..b855754b Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_horizontal.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_horizontal_bottom.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_horizontal_bottom.png new file mode 100644 index 00000000..9dfa27e5 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_horizontal_bottom.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_vertical.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_vertical.png new file mode 100644 index 00000000..c1e070a4 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_vertical.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_vertical_right.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_vertical_right.png new file mode 100644 index 00000000..9a21b93b Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/half_vertical_right.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/mojang.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/mojang.png new file mode 100644 index 00000000..1343fd8f Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/mojang.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/rhombus.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/rhombus.png new file mode 100644 index 00000000..412ea8b3 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/rhombus.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/skull.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/skull.png new file mode 100644 index 00000000..4c0e0b77 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/skull.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/small_stripes.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/small_stripes.png new file mode 100644 index 00000000..b164906a Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/small_stripes.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_bottom_left.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_bottom_left.png new file mode 100644 index 00000000..c3edbce5 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_bottom_left.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_bottom_right.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_bottom_right.png new file mode 100644 index 00000000..8db252a7 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_bottom_right.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_top_left.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_top_left.png new file mode 100644 index 00000000..e090efd5 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_top_left.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_top_right.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_top_right.png new file mode 100644 index 00000000..6e8aeabf Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/square_top_right.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/straight_cross.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/straight_cross.png new file mode 100644 index 00000000..7a4c2326 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/straight_cross.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_bottom.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_bottom.png new file mode 100644 index 00000000..7b18f725 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_bottom.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_center.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_center.png new file mode 100644 index 00000000..a6440008 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_center.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_downleft.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_downleft.png new file mode 100644 index 00000000..ab216689 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_downleft.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_downright.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_downright.png new file mode 100644 index 00000000..37b43795 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_downright.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_left.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_left.png new file mode 100644 index 00000000..5659ac76 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_left.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_middle.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_middle.png new file mode 100644 index 00000000..f4cf0cb0 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_middle.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_right.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_right.png new file mode 100644 index 00000000..56b01da2 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_right.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_top.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_top.png new file mode 100644 index 00000000..af628ad4 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/stripe_top.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangle_bottom.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangle_bottom.png new file mode 100644 index 00000000..435fb86a Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangle_bottom.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangle_top.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangle_top.png new file mode 100644 index 00000000..045b55e2 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangle_top.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangles_bottom.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangles_bottom.png new file mode 100644 index 00000000..e933a03e Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangles_bottom.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangles_top.png b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangles_top.png new file mode 100644 index 00000000..205275a6 Binary files /dev/null and b/Minecraft.Client/Common/res/TitleUpdate/res/mob/banner/triangles_top.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/EntityRenderDispatcher.cpp b/Minecraft.Client/EntityRenderDispatcher.cpp index accda0f7..43db7d3c 100644 --- a/Minecraft.Client/EntityRenderDispatcher.cpp +++ b/Minecraft.Client/EntityRenderDispatcher.cpp @@ -82,6 +82,8 @@ #include "BatRenderer.h" #include "CaveSpiderRenderer.h" #include "RabbitRenderer.h" +#include "PolarBearRenderer.h" +#include "PolarBearModel.h" #include "ArmorStandRenderer.h" #include "EndermiteRenderer.h" @@ -142,6 +144,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() renderers[eTYPE_WITHERBOSS] = new WitherBossRenderer(); renderers[eTYPE_RABBIT] = new RabbitRenderer(); + renderers[eTYPE_POLARBEAR] = new PolarBearRenderer(new PolarBearModel(), 0.7f); renderers[eTYPE_ENTITY] = new DefaultRenderer(); diff --git a/Minecraft.Client/ItemInHandRenderer.cpp b/Minecraft.Client/ItemInHandRenderer.cpp index 8bd5ca99..8b4fc060 100644 --- a/Minecraft.Client/ItemInHandRenderer.cpp +++ b/Minecraft.Client/ItemInHandRenderer.cpp @@ -12,6 +12,8 @@ #include "Minimap.h" #include "MultiPlayerLevel.h" #include "SkullTileRenderer.h" +#include "BannerRenderer.h" +#include "../Minecraft.World/BannerItem.h" #include "../Minecraft.World/Facing.h" #include "../Minecraft.World/net.minecraft.world.item.h" #include "../Minecraft.World/net.minecraft.world.level.tile.h" @@ -255,6 +257,14 @@ void ItemInHandRenderer::renderItem(shared_ptr mob, shared_ptr(item->getItem()) != nullptr && BannerRenderer::instance != nullptr) + { + int baseColor = item->getAuxValue() & 15; + BannerRenderer::instance->renderBannerForHand(1.0f, baseColor); + glPopMatrix(); + return; + } + Tile *tile = Tile::tiles[item->id]; if ((item->getIconType() == Icon::TYPE_TERRAIN && tile != nullptr && TileRenderer::canRender(tile->getRenderShape())) && item->id != AirTile::barrier_Id) { @@ -709,6 +719,17 @@ void ItemInHandRenderer::render(float a) glPopMatrix(); return; } + else if (dynamic_cast(item->getItem()) != nullptr && BannerRenderer::instance != nullptr) + { + int baseColor = item->getAuxValue() & 15; + glRotatef(50.0f, 0.0f, 1.0f, 0.0f); + glTranslatef(0.0f, 0.05f, 0.0f); + const float bs = 0.6f; + glScalef(bs, -bs, -bs); + BannerRenderer::instance->renderBannerForHand(1.0f, baseColor); + glPopMatrix(); + return; + } else { renderItem(player, item, 0, false); diff --git a/Minecraft.Client/ItemRenderer.cpp b/Minecraft.Client/ItemRenderer.cpp index ae6e730d..36bda853 100644 --- a/Minecraft.Client/ItemRenderer.cpp +++ b/Minecraft.Client/ItemRenderer.cpp @@ -3,7 +3,9 @@ #include "TileRenderer.h" #include "EntityRenderDispatcher.h" #include "SkullTileRenderer.h" +#include "BannerRenderer.h" #include "../Minecraft.World/SkullItem.h" +#include "../Minecraft.World/BannerItem.h" #include "../Minecraft.World/Facing.h" #include "../Minecraft.World/JavaMath.h" #include "../Minecraft.World/net.minecraft.world.entity.item.h" @@ -94,6 +96,14 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do glScalef(0.5f, 0.5f, 0.5f); SkullTileRenderer::instance->renderSkull(-0.5f, -0.25f, -0.5f, Facing::UP, 0.0f, item->getAuxValue(), extra); } + else if (dynamic_cast(item->getItem()) != nullptr && BannerRenderer::instance != nullptr) + { + int baseColor = item->getAuxValue() & 15; + glRotatef(spin, 0.0f, 1.0f, 0.0f); + const float s = 0.18f; + glScalef(s, -s, -s); + BannerRenderer::instance->renderBannerForHand(1.0f, baseColor); + } else if ((item->getIconType() == Icon::TYPE_TERRAIN && tile != nullptr && TileRenderer::canRender(tile->getRenderShape())) && item->id != Tile::barrier_Id) { glRotatef(spin, 0, 1, 0); @@ -403,6 +413,13 @@ void ItemRenderer::renderGuiItem(Font *font, Textures *textures, shared_ptr(item->getItem()) != nullptr && BannerRenderer::instance != nullptr) + { + int baseColor = item->getAuxValue() & 15; + BannerRenderer::instance->renderBannerForGui(x, y, fScaleX, fScaleY, fAlpha, baseColor); + return; + } + if ((item->getIconType() == Icon::TYPE_TERRAIN && TileRenderer::canRender(Tile::tiles[itemId]->getRenderShape())) && itemId != Tile::barrier_Id) { PIXBeginNamedEvent(0,"3D gui item render %d\n",itemId); diff --git a/Minecraft.Client/Lighting.cpp b/Minecraft.Client/Lighting.cpp index 24fecbb9..d95896dc 100644 --- a/Minecraft.Client/Lighting.cpp +++ b/Minecraft.Client/Lighting.cpp @@ -55,7 +55,12 @@ FloatBuffer *Lighting::getBuffer(float a, float b, float c, float d) return lb; } -void Lighting::turnOnGui() +void Lighting::setAmbient(float a) +{ + glLightModel(GL_LIGHT_MODEL_AMBIENT, getBuffer(a, a, a, 1.0f)); +} + +void Lighting::turnOnGui() { glPushMatrix(); glRotatef(-30, 0, 1, 0); diff --git a/Minecraft.Client/Lighting.h b/Minecraft.Client/Lighting.h index c06fd539..972ab238 100644 --- a/Minecraft.Client/Lighting.h +++ b/Minecraft.Client/Lighting.h @@ -10,6 +10,7 @@ public: static void turnOff(); static void turnOn(); static void turnOnGui(); + static void setAmbient(float a); private: static FloatBuffer *getBuffer(double a, double b, double c, double d); static FloatBuffer *getBuffer(float a, float b, float c, float d); 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/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index dfd041fd..d5ad2eb4 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -175,7 +175,7 @@ int PlayerRenderer::prepareArmor(shared_ptr _player, int layer, fl case SkullTileEntity::TYPE_CHAR: { armor = armorParts3; - auto t = new SkeletonHeadModel(0, 0, 64, 64, 1); + auto t = new SkeletonHeadModel(0, 0, 64, 32, 1); armor->head = t->head; bindTexture(&PlayerRenderer::DEFAULT_LOCATION); break; @@ -627,6 +627,13 @@ void PlayerRenderer::additionalRendering(shared_ptr _mob, float a) glRotatef(45, 0, 1, 0); glScalef(-s, -s, s); } + else if (dynamic_cast(Item::items[item->id]) != nullptr) + { + glTranslatef(0 / 16.0f, 2 / 16.0f, -4 / 16.0f); + glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + glScalef(0.22f, 0.22f, 0.22f); + } else { float s = 6 / 16.0f; diff --git a/Minecraft.Client/PolarBearModel.cpp b/Minecraft.Client/PolarBearModel.cpp new file mode 100644 index 00000000..bdd8b730 --- /dev/null +++ b/Minecraft.Client/PolarBearModel.cpp @@ -0,0 +1,78 @@ +#include "stdafx.h" +#include "PolarBearModel.h" +#include "ModelPart.h" + +PolarBearModel::PolarBearModel() : QuadrupedModel(10, 0) +{ + texWidth = 128; + texHeight = 64; + + float g = 0; + + head = new ModelPart(this, 0, 0); + head->addBox(-3.5f, -3, -3, 7, 7, 7, g); + head->setPos(0, 10, -16); + head->texOffs(0, 44)->addBox(-2.5f, 1, -6, 5, 3, 3, g); + head->texOffs(26, 0)->addBox(-4.5f, -4, -1, 2, 2, 1, g); + head->texOffs(26, 0)->addBox(2.5f, -4, -1, 2, 2, 1, g); + + body = new ModelPart(this, 0, 19); + body->addBox(-5, -13, -7, 14, 14, 11, g); + body->texOffs(39, 0)->addBox(-4, -25, -7, 12, 12, 10, g); + body->setPos(-2, 9, 12); + + leg0 = new ModelPart(this, 50, 22); + leg0->addBox(-2, 0, -2, 4, 10, 8, g); + leg0->setPos(-4.5f, 14, 6); + + leg1 = new ModelPart(this, 50, 22); + leg1->addBox(-2, 0, -2, 4, 10, 8, g); + leg1->setPos(4.5f, 14, 6); + + leg2 = new ModelPart(this, 50, 40); + leg2->addBox(-2, 0, -2, 4, 10, 6, g); + leg2->setPos(-3.5f, 14, -8); + + leg3 = new ModelPart(this, 50, 40); + leg3->addBox(-2, 0, -2, 4, 10, 6, g); + leg3->setPos(3.5f, 14, -8); + + head->compile(1.0f / 16.0f); + body->compile(1.0f / 16.0f); + leg0->compile(1.0f / 16.0f); + leg1->compile(1.0f / 16.0f); + leg2->compile(1.0f / 16.0f); + leg3->compile(1.0f / 16.0f); +} + +void PolarBearModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +{ + setupAnim(time, r, bob, yRot, xRot, scale, entity); + + if (young) + { + glPushMatrix(); + glScalef(0.6666667f, 0.6666667f, 0.6666667f); + glTranslatef(0, scale * 16.0f, scale * 4.0f); + head->render(scale, usecompiled); + glPopMatrix(); + glPushMatrix(); + glScalef(0.5f, 0.5f, 0.5f); + glTranslatef(0, scale * 24.0f, 0); + body->render(scale, usecompiled); + leg0->render(scale, usecompiled); + leg1->render(scale, usecompiled); + leg2->render(scale, usecompiled); + leg3->render(scale, usecompiled); + glPopMatrix(); + } + else + { + head->render(scale, usecompiled); + body->render(scale, usecompiled); + leg0->render(scale, usecompiled); + leg1->render(scale, usecompiled); + leg2->render(scale, usecompiled); + leg3->render(scale, usecompiled); + } +} diff --git a/Minecraft.Client/PolarBearModel.h b/Minecraft.Client/PolarBearModel.h new file mode 100644 index 00000000..c0b6db97 --- /dev/null +++ b/Minecraft.Client/PolarBearModel.h @@ -0,0 +1,9 @@ +#pragma once +#include "QuadrupedModel.h" + +class PolarBearModel : public QuadrupedModel +{ +public: + PolarBearModel(); + virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); +}; diff --git a/Minecraft.Client/PolarBearRenderer.cpp b/Minecraft.Client/PolarBearRenderer.cpp new file mode 100644 index 00000000..dec207e1 --- /dev/null +++ b/Minecraft.Client/PolarBearRenderer.cpp @@ -0,0 +1,18 @@ +#include "stdafx.h" +#include "PolarBearRenderer.h" + +ResourceLocation PolarBearRenderer::POLARBEAR_LOCATION = ResourceLocation(TN_MOB_POLARBEAR); + +PolarBearRenderer::PolarBearRenderer(Model *model, float shadow) : MobRenderer(model, shadow) +{ +} + +void PolarBearRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +{ + MobRenderer::render(_mob, x, y, z, rot, a); +} + +ResourceLocation *PolarBearRenderer::getTextureLocation(shared_ptr mob) +{ + return &POLARBEAR_LOCATION; +} diff --git a/Minecraft.Client/PolarBearRenderer.h b/Minecraft.Client/PolarBearRenderer.h new file mode 100644 index 00000000..ec23307e --- /dev/null +++ b/Minecraft.Client/PolarBearRenderer.h @@ -0,0 +1,14 @@ +#pragma once +#include "MobRenderer.h" + +class PolarBearRenderer : public MobRenderer +{ +private: + static ResourceLocation POLARBEAR_LOCATION; + +public: + PolarBearRenderer(Model *model, float shadow); + + virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual ResourceLocation *getTextureLocation(shared_ptr mob); +}; 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/SkullTileRenderer.cpp b/Minecraft.Client/SkullTileRenderer.cpp index 3822e3af..5c998657 100644 --- a/Minecraft.Client/SkullTileRenderer.cpp +++ b/Minecraft.Client/SkullTileRenderer.cpp @@ -16,7 +16,7 @@ ResourceLocation SkullTileRenderer::CREEPER_LOCATION = ResourceLocation(TN_MOB_C SkullTileRenderer::SkullTileRenderer() { skeletonModel = new SkeletonHeadModel(0, 0, 64, 32); - zombieModel = new SkeletonHeadModel(0, 0, 64, 64); + zombieModel = new SkeletonHeadModel(0, 0, 64, 32); } SkullTileRenderer::~SkullTileRenderer() diff --git a/Minecraft.Client/Textures.cpp b/Minecraft.Client/Textures.cpp index d5205282..31fb714d 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -194,6 +194,8 @@ const wchar_t *Textures::preLoaded[TN_COUNT] = L"mob/guardian", L"mob/guardian_elder", L"mob/guardian_beam", + L"mob/bear/polarbear", + L"mob/banner/banner_base", #ifdef _LARGE_WORLDS L"misc/additionalmapicons", diff --git a/Minecraft.Client/Textures.h b/Minecraft.Client/Textures.h index 48eec6a4..6b2fb973 100644 --- a/Minecraft.Client/Textures.h +++ b/Minecraft.Client/Textures.h @@ -180,7 +180,8 @@ typedef enum _TEXTURE_NAME TN_MOB_GUARDIAN, TN_MOB_GUARDIAN_ELDER, TN_MOB_GUARDIAN_BEAM, - + TN_MOB_POLARBEAR, + TN_MOB_BANNER_BANNER_BASE, #ifdef _LARGE_WORLDS TN_MISC_ADDITIONALMAPICONS, diff --git a/Minecraft.Client/TileEntityRenderDispatcher.cpp b/Minecraft.Client/TileEntityRenderDispatcher.cpp index ecef1720..6b182a11 100644 --- a/Minecraft.Client/TileEntityRenderDispatcher.cpp +++ b/Minecraft.Client/TileEntityRenderDispatcher.cpp @@ -14,6 +14,8 @@ #include "SkullTileRenderer.h" #include "EnderChestRenderer.h" #include "BeaconRenderer.h" +#include "BannerRenderer.h" +#include "BannerModel.h" TileEntityRenderDispatcher *TileEntityRenderDispatcher::instance = nullptr; double TileEntityRenderDispatcher::xOff = 0; @@ -47,6 +49,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() renderers[eTYPE_SKULLTILEENTITY] = new SkullTileRenderer(); renderers[eTYPE_FURNACETILEENTITY] = nullptr; renderers[eTYPE_BEACONTILEENTITY] = new BeaconRenderer(); + renderers[eTYPE_BANNERTILEENTITY] = new BannerRenderer(); glDisable(GL_LIGHTING); for(auto& renderer : renderers) diff --git a/Minecraft.Client/VillagerZombieModel.cpp b/Minecraft.Client/VillagerZombieModel.cpp index 707a5d63..4217b4b8 100644 --- a/Minecraft.Client/VillagerZombieModel.cpp +++ b/Minecraft.Client/VillagerZombieModel.cpp @@ -14,15 +14,61 @@ void VillagerZombieModel::_init(float g, float yOffset, bool isArmor) } else { + delete pants0; + delete pants1; + delete jacket; + head = new ModelPart(this); head->setPos(0, 0 + yOffset, 0); head->texOffs(0, 32)->addBox(-4, -10, -4, 8, 10, 8, g); head->texOffs(24, 32)->addBox(-1, -3, -6, 2, 4, 2, g); - } + delete body; + body = new ModelPart(this, 16, 16); + body->addBox(-4, 0, -2, 8, 12, 4, g); + body->setPos(0, 0 + yOffset, 0); + + delete arm0; + arm0 = new ModelPart(this, 40, 16); + arm0->addBox(-3, -2, -2, 4, 12, 4, g); + arm0->setPos(-5, 2 + yOffset, 0); + + pants0 = new ModelPart(this, 40, 16); + pants0->addBox(0, 0, 0, 0, 0, 0, g); + pants0->setPos(0, 0 + yOffset, 0); + + pants1 = new ModelPart(this, 40, 16); + pants1->addBox(0, 0, 0, 0, 0, 0, g); + pants1->setPos(0, 0 + yOffset, 0); + + delete arm1; + arm1 = new ModelPart(this, 40, 16); + arm1->bMirror = true; + arm1->addBox(-1, -2, -2, 4, 12, 4, g); + arm1->setPos(5, 2 + yOffset, 0); + + delete leg0; + leg0 = new ModelPart(this, 0, 16); + leg0->addBox(-2, 0, -2, 4, 12, 4, g); + leg0->setPos(-1.9f, 12 + yOffset, 0); + + delete leg1; + leg1 = new ModelPart(this, 0, 16); + leg1->bMirror = true; + leg1->addBox(-2, 0, -2, 4, 12, 4, g); + leg1->setPos(1.9f, 12 + yOffset, 0); + } // 4J added - compile now to avoid random performance hit first time cubes are rendered head->compile(1.0f/16.0f); + if (!isArmor) + { + body->compile(1.0f/16.0f); + arm0->compile(1.0f/16.0f); + arm1->compile(1.0f/16.0f); + leg0->compile(1.0f/16.0f); + leg1->compile(1.0f/16.0f); + } } VillagerZombieModel::VillagerZombieModel() : HumanoidModel(0, 0, 64, 64) diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index a28a6091..07574f73 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -2191,6 +2191,12 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, pMinecraft->setScreen(new ChatScreen()); SetFocus(g_hWnd); } + if (g_KBMInput.IsKeyPressed(VK_OEM_2) && app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL) + { + g_KBMInput.ClearCharBuffer(); + pMinecraft->setScreen(new ChatScreen(L"/")); + SetFocus(g_hWnd); + } #if 0 // has the game defined profile data been changed (by a profile load) 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/Sound/Minecraft/fire/new_ignite.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/new_ignite.ogg new file mode 100644 index 00000000..2b390a48 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/new_ignite.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt1.ogg index 645bf199..a45f97a9 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt1.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt2.ogg index 3fa9d201..77dcd4a5 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt2.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt3.ogg index 89273d7a..465b6ae8 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt3.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk1.ogg new file mode 100644 index 00000000..c24d7bfe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk2.ogg new file mode 100644 index 00000000..9cd31963 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk3.ogg new file mode 100644 index 00000000..92d902fd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/milk3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say1.ogg index 278ff272..4fdc93f8 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say1.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say2.ogg index 86c76f8f..bc6d9d27 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say2.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say3.ogg index 9feb0483..692b579c 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say3.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say4.ogg index dee0784a..e7c90786 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say4.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/babyidle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/babyidle3.ogg new file mode 100644 index 00000000..9b0d35a9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/babyidle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death1.ogg new file mode 100644 index 00000000..f4d53636 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death2.ogg new file mode 100644 index 00000000..2a613e6a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death3.ogg new file mode 100644 index 00000000..a95321a7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/death3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt1.ogg new file mode 100644 index 00000000..1cfc69d2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt2.ogg new file mode 100644 index 00000000..f8064f96 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt3.ogg new file mode 100644 index 00000000..9505b50c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt4.ogg new file mode 100644 index 00000000..1409d8e3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/hurt4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idl3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idl3.ogg new file mode 100644 index 00000000..3f539a1f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idl3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle1.ogg new file mode 100644 index 00000000..ed4783b6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle2.ogg new file mode 100644 index 00000000..73b33906 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle4.ogg new file mode 100644 index 00000000..4ed9a4a3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/idle4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar1.ogg new file mode 100644 index 00000000..ad652aaf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar2.ogg new file mode 100644 index 00000000..c4be0c78 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar3.ogg new file mode 100644 index 00000000..8fb6fe48 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/roar3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step1.ogg new file mode 100644 index 00000000..6b8aae33 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step2.ogg new file mode 100644 index 00000000..93f07268 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step3.ogg new file mode 100644 index 00000000..664a8ffa Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step4.ogg new file mode 100644 index 00000000..70cee7de Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/polarbear/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index c8e403ba..62ae7dd7 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -3712,7 +3712,7 @@ Can also be used for low-level lighting. - Stained Clay + Hardened Clay @@ -3728,67 +3728,67 @@ Can also be used for low-level lighting. - Black Stained Clay + Black Hardened Clay - Red Stained Clay + Red Hardened Clay - Green Stained Clay + Green Hardened Clay - Brown Stained Clay + Brown Hardened Clay - Blue Stained Clay + Blue Hardened Clay - Purple Stained Clay + Purple Hardened Clay - Cyan Stained Clay + Cyan Hardened Clay - Light Gray Stained Clay + Light Gray Hardened Clay - Gray Stained Clay + Gray Hardened Clay - Pink Stained Clay + Pink Hardened Clay - Lime Stained Clay + Lime Hardened Clay - Yellow Stained Clay + Yellow Hardened Clay - Light Blue Stained Clay + Light Blue Hardened Clay - Magenta Stained Clay + Magenta Hardened Clay - Orange Stained Clay + Orange Hardened Clay - White Stained Clay + White Hardened Clay @@ -9029,6 +9029,10 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Rabbit + + Polar Bear + + A harmless creature. May drop a rabbit hide or a rabbit's foot when killed. @@ -9181,6 +9185,10 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Packed Ice + + Frosted Ice + + Sunflower @@ -9464,6 +9472,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 +9487,20 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Elytra + Dirt Path + Beetroot + End Stone Bricks + Magma Block + Nether Wart Block + Red Nether Bricks + Bone Block + Beetroot + Beetroot Seeds + Beetroot Stew + Restores {*ICON_SHANK_HALF_01*}. + Plant on Farmland. + Restores 3{*ICON_SHANK_01*}. + Taking Inventory Open your inventory. @@ -9664,4 +9694,72 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Remove Favorite + + + Banner + + + + Black Banner + + + + Red Banner + + + + Green Banner + + + + Brown Banner + + + + Blue Banner + + + + Purple Banner + + + + Cyan Banner + + + + Light Gray Banner + + + + Gray Banner + + + + Pink Banner + + + + Lime Banner + + + + Yellow Banner + + + + Light Blue Banner + + + + Magenta Banner + + + + Orange Banner + + + + White Banner + diff --git a/Minecraft.Client/ZombieRenderer.cpp b/Minecraft.Client/ZombieRenderer.cpp index 1ff1ec9a..289ad7aa 100644 --- a/Minecraft.Client/ZombieRenderer.cpp +++ b/Minecraft.Client/ZombieRenderer.cpp @@ -99,6 +99,7 @@ void ZombieRenderer::swapArmor(shared_ptr mob) } humanoidModel = static_cast(model); + resModel = model; } void ZombieRenderer::setupRotations(shared_ptr _mob, float bob, float bodyRot, float a) diff --git a/Minecraft.Client/cmake/sources/Common.cmake b/Minecraft.Client/cmake/sources/Common.cmake index 454419f9..4017f32e 100644 --- a/Minecraft.Client/cmake/sources/Common.cmake +++ b/Minecraft.Client/cmake/sources/Common.cmake @@ -924,6 +924,10 @@ set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_RENDERER_ENTITY "${CMAKE_CURRENT_SOURCE_DIR}/ZombieRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/RabbitRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/RabbitRenderer.h" + "${CMAKE_CURRENT_SOURCE_DIR}/PolarBearModel.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/PolarBearModel.h" + "${CMAKE_CURRENT_SOURCE_DIR}/PolarBearRenderer.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/PolarBearRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/ArmorStandRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/EndermiteRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/EndermiteRenderer.h" @@ -967,6 +971,10 @@ source_group("net/minecraft/client/renderer/texture/custom" FILES ${_MINECRAFT_C set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_RENDERER_TILEENTITY "${CMAKE_CURRENT_SOURCE_DIR}/BeaconRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/BeaconRenderer.h" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerModel.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerModel.h" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerRenderer.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/ChestRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/ChestRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/EnchantTableRenderer.cpp" diff --git a/Minecraft.Client/stubs.cpp b/Minecraft.Client/stubs.cpp index 6caaaf2c..ddf2d99d 100644 --- a/Minecraft.Client/stubs.cpp +++ b/Minecraft.Client/stubs.cpp @@ -60,6 +60,7 @@ static const int s_keyToVK[] = { VK_SUBTRACT,// KEY_SUBTRACT = 53 VK_LEFT, // KEY_LEFT = 54 VK_RIGHT, // KEY_RIGHT = 55 + VK_OEM_2, // KEY_SLASH = 56 }; static const int s_keyToVKCount = sizeof(s_keyToVK) / sizeof(s_keyToVK[0]); diff --git a/Minecraft.Client/stubs.h b/Minecraft.Client/stubs.h index 60aa4885..97792a26 100644 --- a/Minecraft.Client/stubs.h +++ b/Minecraft.Client/stubs.h @@ -250,6 +250,7 @@ public: static const int KEY_SUBTRACT = 53; static const int KEY_LEFT = 54; static const int KEY_RIGHT = 55; + static const int KEY_SLASH = 56; #ifdef _WINDOWS64 // Map LWJGL-style key constant to Windows VK code diff --git a/Minecraft.Server/cmake/sources/Common.cmake b/Minecraft.Server/cmake/sources/Common.cmake index 1dd26941..52b0e9a9 100644 --- a/Minecraft.Server/cmake/sources/Common.cmake +++ b/Minecraft.Server/cmake/sources/Common.cmake @@ -413,6 +413,10 @@ set(_MINECRAFT_SERVER_COMMON_ROOT "${_MS_SRC}/../Minecraft.Client/QuadrupedModel.cpp" "${_MS_SRC}/../Minecraft.Client/RabbitModel.cpp" "${_MS_SRC}/../Minecraft.Client/RabbitRenderer.cpp" + "${_MS_SRC}/../Minecraft.Client/PolarBearModel.cpp" + "${_MS_SRC}/../Minecraft.Client/PolarBearRenderer.cpp" + "${_MS_SRC}/../Minecraft.Client/BannerModel.cpp" + "${_MS_SRC}/../Minecraft.Client/BannerRenderer.cpp" "${_MS_SRC}/../Minecraft.Client/Rect2i.cpp" "${_MS_SRC}/../Minecraft.Client/RedDustParticle.cpp" "${_MS_SRC}/../Minecraft.Client/RemotePlayer.cpp" diff --git a/Minecraft.World/AddIslandLayer.cpp b/Minecraft.World/AddIslandLayer.cpp index 37e05822..f68ae6ea 100644 --- a/Minecraft.World/AddIslandLayer.cpp +++ b/Minecraft.World/AddIslandLayer.cpp @@ -40,16 +40,16 @@ intArray AddIslandLayer::getArea(int xo, int yo, int w, int h) } else { - if (swap == 4) result[x + y * w] = Biome::frozenOcean->id; - else result[x + y * w] = 0; + if (swap == 4) result[x + y * w] = 4; + else result[x + y * w] = 0; } } else if (c > 0 && (n1 == 0 || n2 == 0 || n3 == 0 || n4 == 0)) { if (nextRandom(5) == 0) { - if (c == 4) result[x + y * w] = Biome::frozenOcean->id; - else result[x + y * w] = 0; + if (c == 4) result[x + y * w] = 4; + else result[x + y * w] = 0; } else result[x + y * w] = c; } diff --git a/Minecraft.World/BannerItem.cpp b/Minecraft.World/BannerItem.cpp new file mode 100644 index 00000000..34eaecb2 --- /dev/null +++ b/Minecraft.World/BannerItem.cpp @@ -0,0 +1,81 @@ +#include "stdafx.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.tile.entity.h" +#include "ItemInstance.h" +#include "BannerItem.h" +#include "BannerTileEntity.h" +#include "Mth.h" + +const unsigned int BannerItem::COLOR_DESCS[16] = +{ + IDS_TILE_BANNER_BLACK, + IDS_TILE_BANNER_RED, + IDS_TILE_BANNER_GREEN, + IDS_TILE_BANNER_BROWN, + IDS_TILE_BANNER_BLUE, + IDS_TILE_BANNER_PURPLE, + IDS_TILE_BANNER_CYAN, + IDS_TILE_BANNER_SILVER, + IDS_TILE_BANNER_GRAY, + IDS_TILE_BANNER_PINK, + IDS_TILE_BANNER_LIME, + IDS_TILE_BANNER_YELLOW, + IDS_TILE_BANNER_LIGHT_BLUE, + IDS_TILE_BANNER_MAGENTA, + IDS_TILE_BANNER_ORANGE, + IDS_TILE_BANNER_WHITE, +}; + +BannerItem::BannerItem(int id) : Item(id) +{ + maxStackSize = 16; + setStackedByData(true); + setMaxDamage(0); +} + +unsigned int BannerItem::getDescriptionId(shared_ptr instance) +{ + int color = instance->getAuxValue() & 15; + return COLOR_DESCS[color]; +} + +bool BannerItem::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 (face == 0) return false; + if (!level->getMaterial(x, y, z)->isSolid()) return false; + + if (face == 1) y++; + if (face == 2) z--; + if (face == 3) z++; + if (face == 4) x--; + if (face == 5) x++; + + if (!player->mayUseItemAt(x, y, z, face, instance)) return false; + + if (!bTestUseOnOnly) + { + if (face == 1) + { + int rot = Mth::floor(((player->yRot + 180.0f) * 16.0f) / 360.0f + 0.5f) & 15; + level->setTileAndData(x, y, z, Tile::standing_banner_Id, rot, Tile::UPDATE_CLIENTS); + } + else + { + level->setTileAndData(x, y, z, Tile::wall_banner_Id, face, Tile::UPDATE_CLIENTS); + } + + shared_ptr bte = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + if (bte != nullptr) + { + int color = instance->getAuxValue() & 15; + bte->setBaseColor(color); + bte->setChanged(); + } + + instance->count--; + } + return true; +} diff --git a/Minecraft.World/BannerItem.h b/Minecraft.World/BannerItem.h new file mode 100644 index 00000000..829268c4 --- /dev/null +++ b/Minecraft.World/BannerItem.h @@ -0,0 +1,15 @@ +#pragma once +#include "Item.h" + +class IconRegister; + +class BannerItem : public Item +{ +private: + static const unsigned int COLOR_DESCS[16]; + +public: + BannerItem(int id); + virtual unsigned int getDescriptionId(shared_ptr instance) override; + virtual 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 = false) override; +}; diff --git a/Minecraft.World/BannerTile.cpp b/Minecraft.World/BannerTile.cpp new file mode 100644 index 00000000..2a0dfc93 --- /dev/null +++ b/Minecraft.World/BannerTile.cpp @@ -0,0 +1,155 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.world.entity.player.h" +#include "Material.h" +#include "ItemInstance.h" +#include "Random.h" +#include "BannerTileEntity.h" +#include "BannerTile.h" + +BannerTile::BannerTile(int id, bool onGround) : BaseEntityTile(id, Material::wood, isSolidRender()) +{ + this->onGround = onGround; + this->m_dropColor = 15; + updateDefaultShape(); +} + +Icon *BannerTile::getTexture(int face, int data) +{ + return Tile::wood->getTexture(face); +} + +void BannerTile::updateDefaultShape() +{ + if (onGround) + { + float r = 4 / 16.0f; + float h = 16 / 16.0f; + this->setShape(0.5f - r, 0, 0.5f - r, 0.5f + r, h, 0.5f + r); + } + else + { + this->setShape(0, 0, 0, 1, 1, 1); + } +} + +AABB *BannerTile::getAABB(Level *level, int x, int y, int z) +{ + return nullptr; +} + +AABB *BannerTile::getTileAABB(Level *level, int x, int y, int z) +{ + updateShape(level, x, y, z); + return BaseEntityTile::getTileAABB(level, x, y, z); +} + +void BannerTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +{ + if (onGround) return; + + int face = level->getData(x, y, z); + + float h0 = 0 / 16.0f; + float h1 = 16 / 16.0f; + float d0 = 2 / 16.0f; + float w0 = 2 / 16.0f; + float w1 = 14 / 16.0f; + + setShape(0, 0, 0, 1, 1, 1); + if (face == 2) setShape(w0, h0, 1 - d0, w1, h1, 1); + if (face == 3) setShape(w0, h0, 0, w1, h1, d0); + if (face == 4) setShape(1 - d0, h0, w0, 1, h1, w1); + if (face == 5) setShape(0, h0, w0, d0, h1, w1); +} + +int BannerTile::getRenderShape() +{ + return Tile::SHAPE_INVISIBLE; +} + +bool BannerTile::isCubeShaped() +{ + return false; +} + +bool BannerTile::isPathfindable(LevelSource *level, int x, int y, int z) +{ + return true; +} + +bool BannerTile::isSolidRender(bool isServerLevel) +{ + return false; +} + +shared_ptr BannerTile::newTileEntity(Level *level) +{ + return std::make_shared(); +} + +int BannerTile::getResource(int data, Random *random, int playerBonusLevel) +{ + return Tile::standing_banner_Id; +} + +void BannerTile::neighborChanged(Level *level, int x, int y, int z, int type) +{ + bool remove = false; + + if (onGround) + { + if (!level->getMaterial(x, y - 1, z)->isSolid()) remove = true; + } + else + { + int face = level->getData(x, y, z); + remove = true; + if (face == 2 && level->getMaterial(x, y, z + 1)->isSolid()) remove = false; + if (face == 3 && level->getMaterial(x, y, z - 1)->isSolid()) remove = false; + if (face == 4 && level->getMaterial(x + 1, y, z)->isSolid()) remove = false; + if (face == 5 && level->getMaterial(x - 1, y, z)->isSolid()) remove = false; + } + if (remove) + { + spawnResources(level, x, y, z, level->getData(x, y, z), 0); + level->removeTile(x, y, z); + level->removeTileEntity(x, y, z); + } + + BaseEntityTile::neighborChanged(level, x, y, z, type); +} + +int BannerTile::cloneTileId(Level *level, int x, int y, int z) +{ + return Tile::standing_banner_Id; +} + +void BannerTile::registerIcons(IconRegister *iconRegister) +{ +} + +void BannerTile::playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player) +{ + shared_ptr bte = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + m_dropColor = (bte != nullptr) ? (bte->getBaseColor() & 15) : 15; + + BaseEntityTile::playerWillDestroy(level, x, y, z, data, player); +} + +void BannerTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel) +{ + if (level->isClientSide) return; + + int color = m_dropColor; + shared_ptr bte = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + if (bte != nullptr) color = bte->getBaseColor() & 15; + + int count = getResourceCountForLootBonus(playerBonusLevel, level->random); + for (int i = 0; i < count; i++) + { + if (level->random->nextFloat() > odds) continue; + popResource(level, x, y, z, std::make_shared(Tile::standing_banner_Id, 1, color)); + } +} diff --git a/Minecraft.World/BannerTile.h b/Minecraft.World/BannerTile.h new file mode 100644 index 00000000..6b02bd9c --- /dev/null +++ b/Minecraft.World/BannerTile.h @@ -0,0 +1,44 @@ +#pragma once + +#include "BaseEntityTile.h" +#include "TileEntity.h" + +#include "stdafx.h" +#include "Material.h" + +class Player; + +class BannerTile : public BaseEntityTile +{ + friend class Tile; +private: + bool onGround; + int m_dropColor; + +protected: + BannerTile(int id, bool onGround); + +public: + Icon *getTexture(int face, int data); + virtual void updateDefaultShape(); + AABB *getAABB(Level *level, int x, int y, int z); + AABB *getTileAABB(Level *level, int x, int y, int z); + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + int getRenderShape(); + bool isCubeShaped(); + virtual bool isPathfindable(LevelSource *level, int x, int y, int z); + bool isSolidRender(bool isServerLevel = false); + +protected: + shared_ptr newTileEntity(Level *level); + +public: + int getResource(int data, Random *random, int playerBonusLevel); + void neighborChanged(Level *level, int x, int y, int z, int type); + int cloneTileId(Level *level, int x, int y, int z); + void registerIcons(IconRegister *iconRegister); + + virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player) override; + virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel) override; + using BaseEntityTile::spawnResources; +}; diff --git a/Minecraft.World/BannerTileEntity.cpp b/Minecraft.World/BannerTileEntity.cpp new file mode 100644 index 00000000..abaa3992 --- /dev/null +++ b/Minecraft.World/BannerTileEntity.cpp @@ -0,0 +1,70 @@ +#include "stdafx.h" +#include "com.mojang.nbt.h" +#include "net.minecraft.network.packet.h" +#include "BannerTileEntity.h" +#include "TileEntityDataPacket.h" + +BannerTileEntity::BannerTileEntity() : TileEntity() +{ + baseColor = 15; +} + +void BannerTileEntity::save(CompoundTag *tag) +{ + TileEntity::save(tag); + tag->putInt(L"Base", baseColor); + + if (!patterns.empty()) + { + ListTag *list = new ListTag(); + for (const BannerPattern &bp : patterns) + { + CompoundTag *entry = new CompoundTag(); + entry->putString(L"Pattern", bp.pattern); + entry->putInt(L"Color", bp.color); + list->add(entry); + } + tag->put(L"Patterns", list); + } +} + +void BannerTileEntity::load(CompoundTag *tag) +{ + TileEntity::load(tag); + baseColor = tag->getInt(L"Base"); + patterns.clear(); + + if (tag->contains(L"Patterns")) + { + ListTag *list = static_cast *>( + static_cast(tag->getList(L"Patterns"))); + if (list) + { + for (int i = 0; i < list->size(); i++) + { + CompoundTag *entry = list->get(i); + BannerPattern bp; + bp.pattern = entry->getString(L"Pattern"); + bp.color = entry->getInt(L"Color"); + patterns.push_back(bp); + if (patterns.size() >= 6) break; + } + } + } +} + +shared_ptr BannerTileEntity::getUpdatePacket() +{ + CompoundTag *tag = new CompoundTag(); + save(tag); + return std::make_shared(x, y, z, TileEntityDataPacket::TYPE_BANNER, tag); +} + +shared_ptr BannerTileEntity::clone() +{ + shared_ptr result = std::make_shared(); + TileEntity::clone(result); + result->baseColor = baseColor; + result->patterns = patterns; + return result; +} diff --git a/Minecraft.World/BannerTileEntity.h b/Minecraft.World/BannerTileEntity.h new file mode 100644 index 00000000..792759b6 --- /dev/null +++ b/Minecraft.World/BannerTileEntity.h @@ -0,0 +1,38 @@ +#pragma once +using namespace std; + +#include "TileEntity.h" +#include + +struct BannerPattern +{ + wstring pattern; + int color; +}; + +class BannerTileEntity : public TileEntity +{ +public: + eINSTANCEOF GetType() { return eTYPE_BANNERTILEENTITY; } + static TileEntity *create() { return new BannerTileEntity(); } + +private: + int baseColor; + vector patterns; + +public: + BannerTileEntity(); + virtual ~BannerTileEntity() {} + + int getBaseColor() const { return baseColor; } + void setBaseColor(int color) { baseColor = color; } + + const vector &getPatterns() const { return patterns; } + void addPattern(const wstring &pattern, int color) { patterns.push_back({ pattern, color }); } + void clearPatterns() { patterns.clear(); } + + virtual void save(CompoundTag *tag); + virtual void load(CompoundTag *tag); + virtual shared_ptr getUpdatePacket(); + virtual shared_ptr clone(); +}; 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/Biome.cpp b/Minecraft.World/Biome.cpp index efd6014d..628eb185 100644 --- a/Minecraft.World/Biome.cpp +++ b/Minecraft.World/Biome.cpp @@ -92,7 +92,7 @@ void Biome::staticCtor() Biome::sky = (new TheEndBiome(9))->setColor(0x8080ff)->setName(L"Sky")->setNoRain()->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Sky, eMinecraftColour_Foliage_Sky, eMinecraftColour_Water_Sky,eMinecraftColour_Sky_Sky); Biome::frozenOcean = (new OceanBiome(10))->setColor(0x9090a0)->setName(L"Frozen Ocean")->setSnowCovered()->setDepthAndScale(-1, 0.5f)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_FrozenOcean, eMinecraftColour_Foliage_FrozenOcean, eMinecraftColour_Water_FrozenOcean,eMinecraftColour_Sky_FrozenOcean); Biome::frozenRiver = (new RiverBiome(11))->setColor(0xa0a0ff)->setName(L"Frozen River")->setSnowCovered()->setDepthAndScale(-0.5f, 0)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_FrozenRiver, eMinecraftColour_Foliage_FrozenRiver, eMinecraftColour_Water_FrozenRiver,eMinecraftColour_Sky_FrozenRiver); - Biome::iceFlats = (new IceBiome(12))->setColor(0xffffff)->setName(L"Ice Plains")->setSnowCovered()->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_IcePlains, eMinecraftColour_Foliage_IcePlains, eMinecraftColour_Water_IcePlains,eMinecraftColour_Sky_IcePlains); + Biome::iceFlats = (new IceBiome(12))->setColor(0xffffff)->setName(L"Ice Plains")->setSnowCovered()->setDepthAndScale(0, 0.5f)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_IcePlains, eMinecraftColour_Foliage_IcePlains, eMinecraftColour_Water_IcePlains,eMinecraftColour_Sky_IcePlains); Biome::iceMountains = (new IceBiome(13))->setColor(0xa0a0a0)->setName(L"Ice Mountains")->setSnowCovered()->setDepthAndScale(0.3f, 1.3f)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_IceMountains, eMinecraftColour_Foliage_IceMountains, eMinecraftColour_Water_IceMountains,eMinecraftColour_Sky_IceMountains); Biome::mushroomIsland = (new MushroomIslandBiome(14))->setColor(0xff00ff)->setName(L"Mushroom Island")->setTemperatureAndDownfall(0.9f, 1.0f)->setDepthAndScale(0.2f, 1.0f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_MushroomIsland, eMinecraftColour_Foliage_MushroomIsland, eMinecraftColour_Water_MushroomIsland,eMinecraftColour_Sky_MushroomIsland); Biome::mushroomIslandShore = (new MushroomIslandBiome(15))->setColor(0xa000ff)->setName(L"Mushroom Island Shore")->setTemperatureAndDownfall(0.9f, 1.0f)->setDepthAndScale(-1, 0.1f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_MushroomIslandShore, eMinecraftColour_Foliage_MushroomIslandShore, eMinecraftColour_Water_MushroomIslandShore,eMinecraftColour_Sky_MushroomIslandShore); diff --git a/Minecraft.World/BiomeDecorator.h b/Minecraft.World/BiomeDecorator.h index 2c7e9404..4502fa93 100644 --- a/Minecraft.World/BiomeDecorator.h +++ b/Minecraft.World/BiomeDecorator.h @@ -17,6 +17,7 @@ class BiomeDecorator friend class SavannaBiome; friend class JungleBiome; friend class FlowerForestBiome; + friend class MesaBiome; protected: Level *level; Random *random; diff --git a/Minecraft.World/BiomeInitLayer.cpp b/Minecraft.World/BiomeInitLayer.cpp index c9389419..49b05537 100644 --- a/Minecraft.World/BiomeInitLayer.cpp +++ b/Minecraft.World/BiomeInitLayer.cpp @@ -33,11 +33,11 @@ BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptr parent, int64_t s { desertBiomes[0] = Biome::desert; - desertBiomes[1] = Biome::desert; - desertBiomes[2] = Biome::desert; - desertBiomes[3] = Biome::savanna; - desertBiomes[4] = Biome::savanna; - desertBiomes[5] = Biome::plains; + desertBiomes[1] = Biome::forest; + desertBiomes[2] = Biome::extremeHills; + desertBiomes[3] = Biome::swampland; + desertBiomes[4] = Biome::plains; + desertBiomes[5] = Biome::taiga; } warmBiomes[0] = Biome::forest; diff --git a/Minecraft.World/BoneBlockTile.cpp b/Minecraft.World/BoneBlockTile.cpp new file mode 100644 index 00000000..c9ca2881 --- /dev/null +++ b/Minecraft.World/BoneBlockTile.cpp @@ -0,0 +1,22 @@ +#include "stdafx.h" +#include "net.minecraft.world.h" +#include "net.minecraft.world.entity.player.h" +#include "IconRegister.h" +#include "BoneBlockTile.h" + +BoneBlockTile::BoneBlockTile(int id) : HayBlockTile(id) +{ + material = Material::stone; +} + +void BoneBlockTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +{ + if (player->canDestroy(this)) + Tile::playerDestroy(level, player, x, y, z, data); +} + +void BoneBlockTile::registerIcons(IconRegister *iconRegister) +{ + iconTop = iconRegister->registerIcon(L"bone_block_top"); + icon = iconRegister->registerIcon(L"bone_block_side"); +} diff --git a/Minecraft.World/BoneBlockTile.h b/Minecraft.World/BoneBlockTile.h new file mode 100644 index 00000000..28ccec55 --- /dev/null +++ b/Minecraft.World/BoneBlockTile.h @@ -0,0 +1,10 @@ +#pragma once +#include "HayBlockTile.h" + +class BoneBlockTile : public HayBlockTile +{ +public: + BoneBlockTile(int id); + virtual void registerIcons(IconRegister *iconRegister) override; + virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) override; +}; diff --git a/Minecraft.World/Class.h b/Minecraft.World/Class.h index 09107147..e7128086 100644 --- a/Minecraft.World/Class.h +++ b/Minecraft.World/Class.h @@ -138,6 +138,7 @@ enum eINSTANCEOF eTYPE_PIG = eTYPE_ANIMAL | eTYPE_ANIMALS_SPAWN_LIMIT_CHECK | 0x3, eTYPE_CHICKEN = eTYPE_ANIMAL | 0x4, eTYPE_RABBIT = eTYPE_ANIMAL | eTYPE_ANIMALS_SPAWN_LIMIT_CHECK | 0x5, + eTYPE_POLARBEAR = eTYPE_ANIMAL | eTYPE_ANIMALS_SPAWN_LIMIT_CHECK | 0x6, eTYPE_COW = eTYPE_ANIMAL | eTYPE_ANIMALS_SPAWN_LIMIT_CHECK | BIT_COW, eTYPE_MUSHROOMCOW = eTYPE_COW | 0x1, @@ -318,6 +319,7 @@ enum eINSTANCEOF eTYPE_COMPARATORTILEENTITY = eTYPE_TILEENTITY | 0x0F, eTYPE_DAYLIGHTDETECTORTILEENTITY = eTYPE_TILEENTITY | 0x10, eTYPE_HOPPERTILEENTITY = eTYPE_TILEENTITY | 0x11, + eTYPE_BANNERTILEENTITY = eTYPE_TILEENTITY | 0x12, eTYPE_DISPENSERTILEENTITY = eTYPE_TILEENTITY | BIT_DISPENSERTILEENTITY, eTYPE_DROPPERTILEENTITY = eTYPE_DISPENSERTILEENTITY | 0x1, @@ -545,6 +547,7 @@ public: classes->push_back( SUBCLASS(eTYPE_COMPARATORTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_DAYLIGHTDETECTORTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_HOPPERTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); + classes->push_back( SUBCLASS(eTYPE_BANNERTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_DISPENSERTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_DROPPERTILEENTITY )->addParent( eTYPE_DISPENSERTILEENTITY ) ); 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/EntityIO.cpp b/Minecraft.World/EntityIO.cpp index f866e8b9..80379f5a 100644 --- a/Minecraft.World/EntityIO.cpp +++ b/Minecraft.World/EntityIO.cpp @@ -118,6 +118,10 @@ void EntityIO::staticCtor() eMinecraftColour_Mob_Rabbit_Colour1, eMinecraftColour_Mob_Rabbit_Colour2, IDS_RABBIT); + setId(PolarBear::create, eTYPE_POLARBEAR, L"PolarBear", 107, + eMinecraftColour_Mob_PolarBear_Colour1, + eMinecraftColour_Mob_PolarBear_Colour2, IDS_POLAR_BEAR); + setId(ArmorStand::create, eTYPE_ARMORSTAND, L"ArmorStand", 102); //change IDS_Endermite later 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..153208ef --- /dev/null +++ b/Minecraft.World/GrassPathTile.cpp @@ -0,0 +1,62 @@ +#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), iconBottom(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"); + iconBottom = iconRegister->registerIcon(L"dirt"); + icon = iconRegister->registerIcon(L"grass_path_side"); +} + +Icon *GrassPathTile::getTexture(int face, int data) +{ + if (face == Facing::UP) return iconTop; + if (face == Facing::DOWN) return iconBottom; + 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..cbabc8da --- /dev/null +++ b/Minecraft.World/GrassPathTile.h @@ -0,0 +1,23 @@ +#pragma once +#include "Tile.h" + +class GrassPathTile : public Tile +{ + Icon *iconTop; + Icon *iconBottom; + +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/Guardian.cpp b/Minecraft.World/Guardian.cpp index 59cd023a..b7ed612b 100644 --- a/Minecraft.World/Guardian.cpp +++ b/Minecraft.World/Guardian.cpp @@ -206,7 +206,10 @@ float Guardian::getSpikesAnimation(float partialTicks) void Guardian::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) { - //loot (prismarine, sponge) + if (isElder()) + { + spawnAtLocation(make_shared(Tile::sponge_Id, 1, 0), 0.0f); + } } float Guardian::getEyeHeight() diff --git a/Minecraft.World/HellBiome.cpp b/Minecraft.World/HellBiome.cpp index 865b21d7..ca49d79f 100644 --- a/Minecraft.World/HellBiome.cpp +++ b/Minecraft.World/HellBiome.cpp @@ -15,4 +15,5 @@ HellBiome::HellBiome(int id) : Biome(id) enemies.push_back(new MobSpawnerData(eTYPE_PIGZOMBIE, 100, 4, 4)); enemies.push_back(new MobSpawnerData(eTYPE_LAVASLIME, 1, 4, 4)); enemies.push_back(new MobSpawnerData(eTYPE_SKELETON, 1, 4, 4)); + enemies.push_back(new MobSpawnerData(eTYPE_ENDERMAN, 1, 1, 4)); } \ No newline at end of file diff --git a/Minecraft.World/HoeItem.cpp b/Minecraft.World/HoeItem.cpp index c6855cf5..5978c10b 100644 --- a/Minecraft.World/HoeItem.cpp +++ b/Minecraft.World/HoeItem.cpp @@ -38,7 +38,14 @@ bool HoeItem::useOn(shared_ptr instance, shared_ptr player return false; } -bool HoeItem::isHandEquipped() +float HoeItem::getDestroySpeed(shared_ptr itemInstance, Tile *tile) +{ + if (tile != nullptr && (tile->id == Tile::nether_wart_block_Id || tile->id == Tile::hayBlock->id)) + return tier->getSpeed(); + return Item::getDestroySpeed(itemInstance, tile); +} + +bool HoeItem::isHandEquipped() { return true; } diff --git a/Minecraft.World/HoeItem.h b/Minecraft.World/HoeItem.h index a4d015ac..bb3dd370 100644 --- a/Minecraft.World/HoeItem.h +++ b/Minecraft.World/HoeItem.h @@ -14,6 +14,7 @@ public: virtual 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=false); virtual bool isHandEquipped(); + virtual float getDestroySpeed(shared_ptr itemInstance, Tile *tile) override; const Tier *getTier(); }; \ No newline at end of file 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..ed710c5f 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -208,6 +208,15 @@ void LivingEntity::baseTick() hurt(DamageSource::inWall, 1); } + if (!level->isClientSide && isAlive() && onGround && !isSneaking() && tickCount % 10 == 0) + { + int tileBelow = level->getTile(Mth::floor(x), Mth::floor(bb->y0) - 1, Mth::floor(z)); + if (tileBelow == Tile::magma_Id) + { + hurt(DamageSource::inFire, 1); + } + } + if (isFireImmune() || level->isClientSide) clearFire(); shared_ptr thisPlayer = dynamic_pointer_cast(shared_from_this()); bool isInvulnerable = (thisPlayer != nullptr && thisPlayer->abilities.invulnerable); @@ -288,6 +297,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/MagmaTile.cpp b/Minecraft.World/MagmaTile.cpp new file mode 100644 index 00000000..ccc979cf --- /dev/null +++ b/Minecraft.World/MagmaTile.cpp @@ -0,0 +1,8 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "MagmaTile.h" + +MagmaTile::MagmaTile(int id) : Tile(id, Material::stone) +{ + setLightEmission(0.2f); +} diff --git a/Minecraft.World/MagmaTile.h b/Minecraft.World/MagmaTile.h new file mode 100644 index 00000000..51abbf83 --- /dev/null +++ b/Minecraft.World/MagmaTile.h @@ -0,0 +1,8 @@ +#pragma once +#include "Tile.h" + +class MagmaTile : public Tile +{ +public: + MagmaTile(int id); +}; 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/MesaBiome.cpp b/Minecraft.World/MesaBiome.cpp index 9e8eda19..dc4fa951 100644 --- a/Minecraft.World/MesaBiome.cpp +++ b/Minecraft.World/MesaBiome.cpp @@ -182,6 +182,13 @@ BandEntry MesaBiome::getBand(int x, int y, int z) void MesaBiome::decorate(Level* level, Random* random, int xo, int zo) { Biome::decorate(level, random, xo, zo); + decorator->level = level; + decorator->random = random; + decorator->xo = xo; + decorator->zo = zo; + decorator->decorateDepthSpan(20, decorator->goldOreFeature, 32, 80); + decorator->level = nullptr; + decorator->random = nullptr; } Feature* MesaBiome::getTreeFeature(Random* random) diff --git a/Minecraft.World/Pig.cpp b/Minecraft.World/Pig.cpp index 38af8cab..03c9a5da 100644 --- a/Minecraft.World/Pig.cpp +++ b/Minecraft.World/Pig.cpp @@ -36,6 +36,8 @@ Pig::Pig(Level *level) : Animal( level ) goalSelector.addGoal(3, new BreedGoal(this, 1.0)); goalSelector.addGoal(4, new TemptGoal(this, 1.2, Item::carrot_on_a_stick_Id, false)); goalSelector.addGoal(4, new TemptGoal(this, 1.2, Item::carrot_Id, false)); + goalSelector.addGoal(4, new TemptGoal(this, 1.2, Item::potato_Id, false)); + goalSelector.addGoal(4, new TemptGoal(this, 1.2, Item::beetroot_Id, false)); goalSelector.addGoal(5, new FollowParentGoal(this, 1.1)); goalSelector.addGoal(6, new RandomStrollGoal(this, 1.0)); goalSelector.addGoal(7, new LookAtPlayerGoal(this, typeid(Player), 6)); @@ -199,7 +201,10 @@ shared_ptr Pig::getBreedOffspring(shared_ptr target) bool Pig::isFood(shared_ptr itemInstance) { - return itemInstance != nullptr && itemInstance->id == Item::carrot_Id; + if (itemInstance == nullptr) return false; + return itemInstance->id == Item::carrot_Id + || itemInstance->id == Item::potato_Id + || itemInstance->id == Item::beetroot_Id; } ControlledByPlayerGoal *Pig::getControlGoal() diff --git a/Minecraft.World/PolarBear.cpp b/Minecraft.World/PolarBear.cpp new file mode 100644 index 00000000..deea853c --- /dev/null +++ b/Minecraft.World/PolarBear.cpp @@ -0,0 +1,209 @@ +#include "stdafx.h" +#include "com.mojang.nbt.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.phys.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.animal.h" +#include "net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.ai.goal.h" +#include "net.minecraft.world.entity.ai.goal.target.h" +#include "net.minecraft.world.entity.ai.navigation.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.damagesource.h" +#include "SharedMonsterAttributes.h" +#include "PolarBear.h" +#include "../Minecraft.Client/Textures.h" +#include "SoundTypes.h" + +PolarBear::PolarBear(Level *level) : Animal(level) +{ + this->defineSynchedData(); + registerAttributes(); + setHealth(getMaxHealth()); + + m_standing = false; + clientSideStandAnimation = clientSideStandAnimationO = 0.0f; + warningSoundTicks = 0; + cubDefenseCooldown = 0; + + setSize(1.3f, 1.4f); + + getNavigation()->setAvoidWater(true); + goalSelector.addGoal(0, new FloatGoal(this)); + goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.25, true)); + goalSelector.addGoal(1, new PanicGoal(this, 2.0)); + goalSelector.addGoal(4, new FollowParentGoal(this, 1.25)); + goalSelector.addGoal(5, new RandomStrollGoal(this, 1.0)); + goalSelector.addGoal(6, new LookAtPlayerGoal(this, typeid(Player), 6)); + goalSelector.addGoal(7, new RandomLookAroundGoal(this)); + + targetSelector.addGoal(1, new HurtByTargetGoal(this, true)); +} + +bool PolarBear::useNewAi() +{ + return true; +} + +void PolarBear::registerAttributes() +{ + Animal::registerAttributes(); + + getAttribute(SharedMonsterAttributes::MAX_HEALTH)->setBaseValue(30); + getAttribute(SharedMonsterAttributes::FOLLOW_RANGE)->setBaseValue(20); + getAttribute(SharedMonsterAttributes::MOVEMENT_SPEED)->setBaseValue(0.25f); + + getAttributes()->registerAttribute(SharedMonsterAttributes::ATTACK_DAMAGE)->setBaseValue(6); +} + +shared_ptr PolarBear::getBreedOffspring(shared_ptr target) +{ + return std::make_shared(level); +} + +bool PolarBear::isFood(shared_ptr itemInstance) +{ + return false; +} + +int PolarBear::getAmbientSound() +{ + return isBaby() ? eSoundType_MOB_POLARBEAR_BABY_AMBIENT : eSoundType_MOB_POLARBEAR_AMBIENT; +} + +int PolarBear::getHurtSound() +{ + return eSoundType_MOB_POLARBEAR_HURT; +} + +int PolarBear::getDeathSound() +{ + return eSoundType_MOB_POLARBEAR_DEATH; +} + +void PolarBear::playStepSound(int xt, int yt, int zt, int t) +{ + playSound(eSoundType_MOB_POLARBEAR_STEP, 0.15f, 1.0f); +} + +void PolarBear::playWarningSound() +{ + if (warningSoundTicks <= 0) + { + playSound(eSoundType_MOB_POLARBEAR_WARNING, 1.0f, getVoicePitch()); + warningSoundTicks = 40; + } +} + +void PolarBear::setTarget(shared_ptr newTarget) +{ + shared_ptr old = getTarget(); + Animal::setTarget(newTarget); + if (newTarget != nullptr && old == nullptr && !isBaby()) + { + playWarningSound(); + } +} + +int PolarBear::getDeathLoot() +{ + return Item::fish_Id; +} + +bool PolarBear::doHurtTarget(shared_ptr target) +{ + if (isBaby()) + { + return false; + } + float dmg = (float)getAttribute(SharedMonsterAttributes::ATTACK_DAMAGE)->getValue(); + return target->hurt(DamageSource::mobAttack(dynamic_pointer_cast(shared_from_this())), dmg); +} + +bool PolarBear::isStanding() +{ + return m_standing; +} + +void PolarBear::setStanding(bool standing) +{ + m_standing = standing; +} + +float PolarBear::getStandingAnimationScale(float a) +{ + return (clientSideStandAnimationO + (clientSideStandAnimation - clientSideStandAnimationO) * a) / 6.0f; +} + +void PolarBear::aiStep() +{ + Animal::aiStep(); + + if (level->isClientSide) + { + clientSideStandAnimationO = clientSideStandAnimation; + if (isStanding()) + { + clientSideStandAnimation = Mth::clamp(clientSideStandAnimation + 1.0f, 0.0f, 6.0f); + } + else + { + clientSideStandAnimation = Mth::clamp(clientSideStandAnimation - 1.0f, 0.0f, 6.0f); + } + } + + if (warningSoundTicks > 0) + { + --warningSoundTicks; + } + + if (!level->isClientSide && !isBaby() && getTarget() == nullptr) + { + if (cubDefenseCooldown > 0) + { + --cubDefenseCooldown; + } + else + { + cubDefenseCooldown = 10; + bool cubNear = false; + vector > *bears = level->getEntitiesOfClass(typeid(PolarBear), bb->grow(8.0, 4.0, 8.0)); + for (auto &it : *bears) + { + shared_ptr other = dynamic_pointer_cast(it); + if (other != nullptr && other.get() != this && other->isBaby()) + { + cubNear = true; + break; + } + } + delete bears; + if (cubNear) + { + shared_ptr p = level->getNearestAttackablePlayer(shared_from_this(), 16.0); + if (p != nullptr) + { + setTarget(dynamic_pointer_cast(p)); + } + } + } + } +} + +MobGroupData *PolarBear::finalizeMobSpawn(MobGroupData *groupData, int extraData) +{ + groupData = Animal::finalizeMobSpawn(groupData); + + if (groupData == nullptr || dynamic_cast(groupData) == nullptr) + { + groupData = new PolarBearGroupData(); + } + else + { + setAge(CUB_AGE); + } + + return groupData; +} diff --git a/Minecraft.World/PolarBear.h b/Minecraft.World/PolarBear.h new file mode 100644 index 00000000..1b83d00c --- /dev/null +++ b/Minecraft.World/PolarBear.h @@ -0,0 +1,59 @@ +#pragma once + +#include "Animal.h" +#include "MobGroupData.h" + +class DamageSource; + +class PolarBear : public Animal +{ +public: + eINSTANCEOF GetType() { return eTYPE_POLARBEAR; } + static Entity *create(Level *level) { return new PolarBear(level); } + +private: + static const int CUB_AGE = -23488; + + float clientSideStandAnimationO; + float clientSideStandAnimation; + int warningSoundTicks; + int cubDefenseCooldown; + +public: + PolarBear(Level *level); + + virtual bool useNewAi(); + +protected: + virtual void registerAttributes(); + +public: + virtual shared_ptr getBreedOffspring(shared_ptr target); + virtual bool isFood(shared_ptr itemInstance); + +protected: + virtual int getAmbientSound(); + virtual int getHurtSound(); + virtual int getDeathSound(); + virtual int getDeathLoot(); + virtual void playStepSound(int xt, int yt, int zt, int t); + +public: + virtual bool doHurtTarget(shared_ptr target); + virtual bool isStanding(); + void setStanding(bool standing); + float getStandingAnimationScale(float a); + + void playWarningSound(); + virtual void setTarget(shared_ptr target); + + virtual void aiStep(); + virtual MobGroupData *finalizeMobSpawn(MobGroupData *groupData, int extraData = 0); + +private: + bool m_standing; +}; + +class PolarBearGroupData : public MobGroupData +{ +}; 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/Skeleton.cpp b/Minecraft.World/Skeleton.cpp index dfbbc11c..d152a8cd 100644 --- a/Minecraft.World/Skeleton.cpp +++ b/Minecraft.World/Skeleton.cpp @@ -188,7 +188,7 @@ void Skeleton::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) { if (getSkeletonType() == TYPE_WITHER) { - // drop some arrows + // drop some coal int count = random->nextInt(3 + playerBonusLevel) - 1; for (int i = 0; i < count; i++) { diff --git a/Minecraft.World/SoundTypes.h b/Minecraft.World/SoundTypes.h index a2d1bf4d..131760c4 100644 --- a/Minecraft.World/SoundTypes.h +++ b/Minecraft.World/SoundTypes.h @@ -275,7 +275,14 @@ enum eSOUND_TYPE eSoundType_MOB_ELDER_GUARDIAN_DEATH, eSoundType_MOB_ELDER_GUARDIAN_HIT, eSoundType_MOB_ELDER_GUARDIAN_IDLE, - + + eSoundType_MOB_POLARBEAR_BABY_AMBIENT, + eSoundType_MOB_POLARBEAR_AMBIENT, + eSoundType_MOB_POLARBEAR_HURT, + eSoundType_MOB_POLARBEAR_DEATH, + eSoundType_MOB_POLARBEAR_STEP, + eSoundType_MOB_POLARBEAR_WARNING, + eSoundType_MAX }; diff --git a/Minecraft.World/StringHelpers.cpp b/Minecraft.World/StringHelpers.cpp index b56a85f1..9bd84660 100644 --- a/Minecraft.World/StringHelpers.cpp +++ b/Minecraft.World/StringHelpers.cpp @@ -1,4 +1,6 @@ #include "stdafx.h" +#include +#include wstring toLower(const wstring& a) { @@ -41,9 +43,26 @@ bool equalsIgnoreCase(const wstring& a, const wstring& b) wstring convStringToWstring(const string& converting) { - wstring converted(converting.length(), L' '); - copy(converting.begin(), converting.end(), converted.begin()); - return converted; + if (converting.empty()) return wstring(); + +#ifdef _WIN32 + // windows - UTF-16 + std::wstring_convert, wchar_t> converter; +#else + // unix - UTF-32 + std::wstring_convert, wchar_t> converter; +#endif + try + { + return converter.from_bytes(converting); + } + catch(...) + { + // fallbakc - simple widening + wstring converted(converting.length(), L' '); + copy(converting.begin(), converting.end(), converted.begin()); + return converted; + } } // Convert for filename wstrings to a straight character pointer for Xbox APIs. The returned string is only valid until diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index f7840344..0a8db3a9 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -266,9 +266,19 @@ 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::end_bricks = nullptr; +MagmaTile* Tile::magma = nullptr; +Tile* Tile::nether_wart_block = nullptr; +Tile* Tile::red_nether_brick = nullptr; +BoneBlockTile* Tile::bone_block = nullptr; Tile* Tile::barrier = nullptr; TallGrass2* Tile::double_plant = nullptr; +BannerTile* Tile::standing_banner = nullptr; +BannerTile* Tile::wall_banner = nullptr; DWORD Tile::tlsIdxShape = TlsAlloc(); @@ -577,6 +587,15 @@ 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::end_bricks = (new Tile(end_bricks_Id, Material::stone))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_stone)->setDestroyTime(3.0f)->setExplodeable(9)->setSoundType(SOUND_STONE)->setIconName(L"end_bricks")->setDescriptionId(IDS_TILE_END_BRICKS)->setUseDescriptionId(IDS_DESC_STONE); + Tile::magma = static_cast((new MagmaTile(magma_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_stone)->setDestroyTime(0.5f)->setExplodeable(6)->setSoundType(SOUND_STONE)->setIconName(L"magma")->setDescriptionId(IDS_TILE_MAGMA)->setUseDescriptionId(IDS_DESC_STONE)); + Tile::nether_wart_block = (new Tile(nether_wart_block_Id, Material::grass))->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_wheat)->setDestroyTime(0.5f)->setSoundType(SOUND_WOOD)->setIconName(L"nether_wart_block")->setDescriptionId(IDS_TILE_NETHER_WART_BLOCK)->setUseDescriptionId(IDS_DESC_STONE); + Tile::red_nether_brick = (new Tile(red_nether_brick_Id, Material::stone))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(6)->setSoundType(SOUND_STONE)->setIconName(L"red_nether_brick")->setDescriptionId(IDS_TILE_RED_NETHER_BRICK)->setUseDescriptionId(IDS_DESC_STONE); + Tile::bone_block = static_cast((new BoneBlockTile(bone_block_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_stone)->setDestroyTime(1.5f)->setExplodeable(10)->setSoundType(SOUND_STONE)->setIconName(L"bone_block_side")->setDescriptionId(IDS_TILE_BONE_BLOCK)->setUseDescriptionId(IDS_DESC_STONE)->sendTileData()); 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(); @@ -602,6 +621,11 @@ void Tile::staticCtor() Tile::double_plant = static_cast((new TallGrass2(175))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"tallgrass2_tall_grass_upper")->setDescriptionId(IDS_DESC_DOUBLE_TALL_GRASS)->setUseDescriptionId(IDS_DESC_TALL_GRASS)->disableMipmap()->sendTileData(0xFF)); + Tile::standing_banner = static_cast((new BannerTile(176, true))->setDestroyTime(1.0f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"planks_oak")->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_SIGN)); + Tile::wall_banner = static_cast((new BannerTile(177, false))->setDestroyTime(1.0f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"planks_oak")->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_SIGN)); + + Item::items[standing_banner_Id] = (new BannerItem(standing_banner_Id - 256))->setIconName(L"sign")->setDescriptionId(IDS_TILE_BANNER)->setUseDescriptionId(IDS_DESC_SIGN); + // 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); Item::items[stained_hardened_clay_Id]= ( new WoolTileItem(Tile::stained_hardened_clay_Id - 256))->setIconName(L"clayHardenedStained")->setDescriptionId(IDS_TILE_STAINED_CLAY)->setUseDescriptionId(IDS_DESC_STAINED_CLAY); @@ -670,7 +694,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 +1930,11 @@ 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; +const int Tile::end_bricks_Id; +const int Tile::magma_Id; +const int Tile::nether_wart_block_Id; +const int Tile::red_nether_brick_Id; +const int Tile::bone_block_Id; #endif diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index 595815dc..5e2a63d8 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -44,6 +44,12 @@ class HalfSlabTile; class Icon; class IconRegister; class TallGrass2; +class FrostedIceTile; +class GrassPathTile; +class BeetrootTile; +class MagmaTile; +class BoneBlockTile; +class BannerTile; class ChunkRebuildData; @@ -410,8 +416,8 @@ public: static const int coal_block_Id = 173; static const int packed_ice_Id = 174; static const int double_plant_Id = 175; - //176 standing_banner - //177 wall_banner + static const int standing_banner_Id = 176; + static const int wall_banner_Id = 177; static const int daylight_detector_inverted_Id = 178; static const int red_sandstone_Id = 179; static const int red_sandstone_stairs_Id = 180; @@ -440,15 +446,15 @@ public: //purpur_stairs 203 //purpur_double_slab 204 //purpur_slab 205 - //end_bricks 206 - //beetroots 207 - //grass_path 208 + static const int end_bricks_Id = 206; + static const int beetroots_Id = 207; + static const int grass_path_Id = 208; //end_gateway 209 - //frosted_ice 212 - //magma 213 - //nether_wart_block 214 - //red_nether_brick 215 - //bone_block 216 + static const int frosted_ice_Id = 212; + static const int magma_Id = 213; + static const int nether_wart_block_Id = 214; + static const int red_nether_brick_Id = 215; + static const int bone_block_Id = 216; //structure_void 217 // // @@ -662,11 +668,21 @@ public: static HalfSlabTile* stoneSlab2Half; static Tile* log2; static Tile* packedIce; + static FrostedIceTile* frosted_ice; + static GrassPathTile* grass_path; + static BeetrootTile* beetroots; + static Tile* end_bricks; + static MagmaTile* magma; + static Tile* nether_wart_block; + static Tile* red_nether_brick; + static BoneBlockTile* bone_block; static Tile* seaLantern; static Tile* prismarine; static TallGrass2* double_plant; - + + static BannerTile* standing_banner; + static BannerTile* wall_banner; static void staticCtor(); diff --git a/Minecraft.World/TileEntity.cpp b/Minecraft.World/TileEntity.cpp index 1fff44bb..4efc6731 100644 --- a/Minecraft.World/TileEntity.cpp +++ b/Minecraft.World/TileEntity.cpp @@ -32,6 +32,7 @@ void TileEntity::staticCtor() TileEntity::setId(DaylightDetectorTileEntity::create, eTYPE_DAYLIGHTDETECTORTILEENTITY, L"DLDetector"); TileEntity::setId(HopperTileEntity::create, eTYPE_HOPPERTILEENTITY, L"Hopper"); TileEntity::setId(ComparatorTileEntity::create, eTYPE_COMPARATORTILEENTITY, L"Comparator"); + TileEntity::setId(BannerTileEntity::create, eTYPE_BANNERTILEENTITY, L"Banner"); } void TileEntity::setId(tileEntityCreateFn createFn, eINSTANCEOF clas, wstring id) diff --git a/Minecraft.World/TileEntityDataPacket.h b/Minecraft.World/TileEntityDataPacket.h index 6fe3bf89..b6f6f043 100644 --- a/Minecraft.World/TileEntityDataPacket.h +++ b/Minecraft.World/TileEntityDataPacket.h @@ -12,6 +12,7 @@ public: static const int TYPE_ADV_COMMAND = 2; static const int TYPE_BEACON = 3; static const int TYPE_SKULL = 4; + static const int TYPE_BANNER = 5; int x, y, z; int type; diff --git a/Minecraft.World/UntouchingEnchantment.cpp b/Minecraft.World/UntouchingEnchantment.cpp index 1e5a41b7..30f92c3d 100644 --- a/Minecraft.World/UntouchingEnchantment.cpp +++ b/Minecraft.World/UntouchingEnchantment.cpp @@ -29,6 +29,5 @@ bool UntouchingEnchantment::isCompatibleWith(Enchantment *other) const bool UntouchingEnchantment::canEnchant(shared_ptr item) { - if (item->getItem()->id == Item::shears_Id) return true; return Enchantment::canEnchant(item); } \ No newline at end of file diff --git a/Minecraft.World/VillagePieces.cpp b/Minecraft.World/VillagePieces.cpp index 9067506c..23713c98 100644 --- a/Minecraft.World/VillagePieces.cpp +++ b/Minecraft.World/VillagePieces.cpp @@ -555,7 +555,7 @@ bool VillagePieces::Well::postProcess(Level *level, Random *random, BoundingBox { continue; } - placeBlock(level, Tile::gravel_Id, 0, x, height - 4, z, chunkBB); + placeBlock(level, Tile::cobblestone_Id, 0, x, height - 4, z, chunkBB); generateAirColumnUp(level, x, height - 3, z, chunkBB); } } @@ -709,8 +709,8 @@ BoundingBox *VillagePieces::StraightRoad::findPieceBox(StartPiece *startPiece, l bool VillagePieces::StraightRoad::postProcess(Level *level, Random *random, BoundingBox *chunkBB) { - int roadTile = biomeBlock(Tile::gravel_Id, 0); - int baseTile = biomeBlock(Tile::cobblestone_Id, 0); + int roadTile = biomeBlock(Tile::grass_path_Id, 0); + // int baseTile = biomeBlock(Tile::cobblestone_Id, 0); for (int x = boundingBox->x0; x <= boundingBox->x1; x++) { for (int z = boundingBox->z0; z <= boundingBox->z1; z++) @@ -719,7 +719,7 @@ bool VillagePieces::StraightRoad::postProcess(Level *level, Random *random, Boun { int y = level->getTopSolidBlock(x, z) - 1; level->setTileAndData(x, y, z, roadTile, 0, Tile::UPDATE_CLIENTS); - level->setTileAndData(x, y - 1, z, baseTile, 0, Tile::UPDATE_CLIENTS); + // level->setTileAndData(x, y - 1, z, baseTile, 0, Tile::UPDATE_CLIENTS); } } } @@ -1771,6 +1771,8 @@ int VillagePieces::Farmland::selectCrops(Random *random) return Tile::carrots_Id; case 1: return Tile::potatoes_Id; + case 2: + return Tile::beetroots_Id; } } diff --git a/Minecraft.World/cmake/sources/Common.cmake b/Minecraft.World/cmake/sources/Common.cmake index a54e2c99..361c68e3 100644 --- a/Minecraft.World/cmake/sources/Common.cmake +++ b/Minecraft.World/cmake/sources/Common.cmake @@ -792,6 +792,8 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_ENTITY_ANIMAL "${CMAKE_CURRENT_SOURCE_DIR}/Wolf.h" "${CMAKE_CURRENT_SOURCE_DIR}/Rabbit.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Rabbit.h" + "${CMAKE_CURRENT_SOURCE_DIR}/PolarBear.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/PolarBear.h" "${CMAKE_CURRENT_SOURCE_DIR}/net.minecraft.world.entity.animal.h" ) source_group("net/minecraft/world/entity/animal" FILES ${_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_ENTITY_ANIMAL}) @@ -1273,6 +1275,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 +2045,22 @@ 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}/MagmaTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/MagmaTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/BoneBlockTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/BoneBlockTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerTileEntity.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerTileEntity.h" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerItem.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/BannerItem.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.entity.animal.h b/Minecraft.World/net.minecraft.world.entity.animal.h index fc2c4de4..73f660db 100644 --- a/Minecraft.World/net.minecraft.world.entity.animal.h +++ b/Minecraft.World/net.minecraft.world.entity.animal.h @@ -23,4 +23,5 @@ #include "EntityHorse.h" //TU31 -#include "Rabbit.h" \ No newline at end of file +#include "Rabbit.h" +#include "PolarBear.h" \ No newline at end of file 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.item.h b/Minecraft.World/net.minecraft.world.item.h index bd3b6c0a..7055638b 100644 --- a/Minecraft.World/net.minecraft.world.item.h +++ b/Minecraft.World/net.minecraft.world.item.h @@ -44,6 +44,7 @@ // 1.8.2 #include "AuxDataTileItem.h" +#include "BannerItem.h" #include "ColoredTileItem.h" #include "UseAnim.h" diff --git a/Minecraft.World/net.minecraft.world.level.tile.entity.h b/Minecraft.World/net.minecraft.world.level.tile.entity.h index 1d6e7f76..13e66943 100644 --- a/Minecraft.World/net.minecraft.world.level.tile.entity.h +++ b/Minecraft.World/net.minecraft.world.level.tile.entity.h @@ -21,3 +21,4 @@ #include "SkullTileEntity.h" #include "EnderChestTileEntity.h" #include "ItemFrame.h" +#include "BannerTileEntity.h" diff --git a/Minecraft.World/net.minecraft.world.level.tile.h b/Minecraft.World/net.minecraft.world.level.tile.h index f819e761..a4e7787c 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,10 @@ #include "PackedIceTile.h" #include "StoneSlabTile2.h" +#include "GrassPathTile.h" +#include "BeetrootTile.h" +#include "MagmaTile.h" +#include "BoneBlockTile.h" +#include "BannerTile.h" diff --git a/NOTES.md b/NOTES.md index 2c34a056..99f0512e 100644 --- a/NOTES.md +++ b/NOTES.md @@ -1,18 +1,22 @@ -# neoLegacy v1.0.8b +# neoLegacy v1.0.9b -### Bug Fixes -- Game has been heavily optimized; expect more FPS. -- Fullscreen option is now correctly applied on startup. -- `/kill` now kills the player in creative. -- Boat now follows the player correctly when speeding. -- Ocelots can now be tamed. -- Elytras and items are now rendered correctly when on an armor stand. +### Additions +- Slime blocks and sunflowers have been added to the game. +- You can now copy and save various worlds on the LoadCreateJoin menu. +- Controller icons and in-game logos are now modifiable via a slider in 'User Interface' menu. ### Changes -- Added new logo (made by rdust). -- Added TU31 parity changes which include: - - Dye recipes using flowers. - - Prismarine block animation. +- In-game skulls have now been given a 3d effect. +- World gen has now been altered in order to match significantly more with Java Edition. +- Skin Select menu has been updated in order to achieve parity with TU36+ +- Controls menu has been updated. +- Tutorial world has been updated to version TU31. +- Settings menus are now wider to match the ones from TU31+ + +### Bug Fixes +- In-game music now fades when leaving / joining a world. +- World size is now displayed correctly on the worlds-list menu. +- The LoadCreateJoin menu no longer features an infinite spinner. roadmap diff --git a/tools/struct_parse.py b/tools/struct_parse.py new file mode 100644 index 00000000..349097d7 --- /dev/null +++ b/tools/struct_parse.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python3 +import struct, sys, argparse +import xml.etree.ElementTree as ET + +TAG_END = 0 +TAG_BYTE = 1 +TAG_SHORT = 2 +TAG_INT = 3 +TAG_LONG = 4 +TAG_FLOAT = 5 +TAG_DOUBLE = 6 +TAG_BYTE_ARRAY = 7 +TAG_STRING = 8 +TAG_LIST = 9 +TAG_COMPOUND = 10 +TAG_INT_ARRAY = 11 + +class NBTParser: + def __init__(self, filename, endian='>'): + self.stream = open(filename, 'rb') + self.endian = endian + + def read(self, fmt): + size = struct.calcsize(fmt) + data = self.stream.read(size) + if len(data) != size: + raise EOFError("Unexpected end of file") + return struct.unpack(fmt, data)[0] + + def read_byte(self): + return self.read(self.endian + 'b') + def read_unsigned_byte(self): + return self.read(self.endian + 'B') + def read_short(self): + return self.read(self.endian + 'h') + def read_int(self): + return self.read(self.endian + 'i') + def read_long(self): + return self.read(self.endian + 'q') + def read_float(self): + return self.read(self.endian + 'f') + def read_double(self): + return self.read(self.endian + 'd') + + def read_string(self): + length = self.read(self.endian + 'h') # unsigned short + data = self.stream.read(length) + return data.decode('utf-8') + + def read_byte_array(self): + length = self.read(self.endian + 'i') + return self.stream.read(length) + + def read_int_array(self): + length = self.read(self.endian + 'i') + return [self.read_int() for _ in range(length)] + + def read_list(self): + elem_type = self.read_unsigned_byte() + count = self.read(self.endian + 'i') + return [self.read_tag_payload(elem_type) for _ in range(count)] + + def read_compound(self): + compound = {} + while True: + tag_type = self.read_unsigned_byte() + if tag_type == TAG_END: + break + name = self.read_string() + compound[name] = self.read_tag_payload(tag_type) + return compound + + def read_tag_payload(self, tag_type): + if tag_type == TAG_BYTE: + return self.read_byte() + elif tag_type == TAG_SHORT: + return self.read_short() + elif tag_type == TAG_INT: + return self.read_int() + elif tag_type == TAG_LONG: + return self.read_long() + elif tag_type == TAG_FLOAT: + return self.read_float() + elif tag_type == TAG_DOUBLE: + return self.read_double() + elif tag_type == TAG_BYTE_ARRAY: + return self.read_byte_array() + elif tag_type == TAG_STRING: + return self.read_string() + elif tag_type == TAG_LIST: + return self.read_list() + elif tag_type == TAG_COMPOUND: + return self.read_compound() + elif tag_type == TAG_INT_ARRAY: + return self.read_int_array() + else: + raise ValueError(f"Unknown tag type: {tag_type}") + + def parse(self): + root_tag = self.read_unsigned_byte() + if root_tag != TAG_COMPOUND: + raise ValueError("Expected root TAG_Compound (0x0A)") + _ = self.read_string() # root name + data = self.read_compound() + self.stream.close() + return data + +def structure_to_xml(data, xml_root_name="Structure"): + """convert nbt data into xml""" + root = ET.Element(xml_root_name) + root.set("author", str(data.get("author", "Unknown"))) + root.set("version", str(data.get("version", ""))) + # Size + size = data.get("size", [0,0,0]) + ET.SubElement(root, "Size", { + "width": str(size[0]), "height": str(size[1]), "length": str(size[2]) + }) + + # Palette + pal_elem = ET.SubElement(root, "Palette") + palette = data.get("palette", []) + for i, entry in enumerate(palette): + attrs = {"index": str(i)} + if "Name" in entry: + attrs["name"] = entry["Name"] + block_elem = ET.SubElement(pal_elem, "Block", attrs) + # add properties as subelements + props = entry.get("Properties", {}) + for prop_name, prop_value in props.items(): + prop_elem = ET.SubElement(block_elem, "Property") + prop_elem.set("name", prop_name) + prop_elem.text = str(prop_value) + + # Blocks + blocks_elem = ET.SubElement(root, "Blocks") + for blk in data.get("blocks", []): + pos = blk.get("pos", []) + state = blk.get("state", 0) + if pos and len(pos) == 3: + attrs = {"x": str(pos[0]), "y": str(pos[1]), "z": str(pos[2]), + "index": str(state)} + ET.SubElement(blocks_elem, "Block", attrs) + + # Entities + ents = data.get("entities", []) + ents_elem = ET.SubElement(root, "Entities") + for ent in ents: + ent_elem = ET.SubElement(ents_elem, "Entity") + for key, val in ent.items(): + sub = ET.SubElement(ent_elem, key) + sub.text = str(val) + return root + +def main(): + parser = argparse.ArgumentParser(description="Convert NBT structure files to XML") + parser.add_argument("inputs", nargs="+", help="Input NBT file(s)") + parser.add_argument("-l", "--little", action="store_true", + help="Assume little-endian NBT format") + parser.add_argument("-o", "--output", help="Output XML file (or directory)") + args = parser.parse_args() + + endian = '<' if args.little else '>' + for infile in args.inputs: + try: + parser_nbt = NBTParser(infile, endian=endian) + data = parser_nbt.parse() + except Exception as e: + print(f"Error parsing {infile}: {e}", file=sys.stderr) + continue + + xml_root = structure_to_xml(data) + tree = ET.ElementTree(xml_root) + outpath = args.output or infile + ".xml" + if args.output and len(args.inputs) > 1: + import os + os.makedirs(args.output, exist_ok=True) + base = os.path.basename(infile) + outpath = os.path.join(args.output, base + ".xml") + ET.indent(tree, space=" ", level=0) + tree.write(outpath, encoding="utf-8", xml_declaration=True) + print(f"Wrote XML to {outpath}") + +if __name__ == "__main__": + main()