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/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/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index d3e41d58..09201999 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -311,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 @@ -379,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()) 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/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/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/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index d9f94edf..d5ad2eb4 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -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/Textures.cpp b/Minecraft.Client/Textures.cpp index 06918fde..31fb714d 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -195,6 +195,7 @@ const wchar_t *Textures::preLoaded[TN_COUNT] = 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 74e2aea5..6b2fb973 100644 --- a/Minecraft.Client/Textures.h +++ b/Minecraft.Client/Textures.h @@ -181,6 +181,7 @@ typedef enum _TEXTURE_NAME 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/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index 7121162b..62ae7dd7 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -9694,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/cmake/sources/Common.cmake b/Minecraft.Client/cmake/sources/Common.cmake index 98119931..4017f32e 100644 --- a/Minecraft.Client/cmake/sources/Common.cmake +++ b/Minecraft.Client/cmake/sources/Common.cmake @@ -971,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.Server/cmake/sources/Common.cmake b/Minecraft.Server/cmake/sources/Common.cmake index b6497ca4..52b0e9a9 100644 --- a/Minecraft.Server/cmake/sources/Common.cmake +++ b/Minecraft.Server/cmake/sources/Common.cmake @@ -415,6 +415,8 @@ set(_MINECRAFT_SERVER_COMMON_ROOT "${_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/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/Class.h b/Minecraft.World/Class.h index 83bb538e..e7128086 100644 --- a/Minecraft.World/Class.h +++ b/Minecraft.World/Class.h @@ -319,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, @@ -546,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/GrassPathTile.cpp b/Minecraft.World/GrassPathTile.cpp index a39d1616..153208ef 100644 --- a/Minecraft.World/GrassPathTile.cpp +++ b/Minecraft.World/GrassPathTile.cpp @@ -5,7 +5,7 @@ #include "Facing.h" #include "GrassPathTile.h" -GrassPathTile::GrassPathTile(int id) : Tile(id, Material::dirt), iconTop(nullptr) +GrassPathTile::GrassPathTile(int id) : Tile(id, Material::dirt), iconTop(nullptr), iconBottom(nullptr) { } @@ -26,13 +26,15 @@ bool GrassPathTile::isCubeShaped() void GrassPathTile::registerIcons(IconRegister *iconRegister) { - iconTop = iconRegister->registerIcon(L"grass_path_top"); - icon = iconRegister->registerIcon(L"grass_path_side"); + 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; } diff --git a/Minecraft.World/GrassPathTile.h b/Minecraft.World/GrassPathTile.h index cb748f50..cbabc8da 100644 --- a/Minecraft.World/GrassPathTile.h +++ b/Minecraft.World/GrassPathTile.h @@ -4,6 +4,7 @@ class GrassPathTile : public Tile { Icon *iconTop; + Icon *iconBottom; public: GrassPathTile(int id); diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index a929a380..0a8db3a9 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -277,6 +277,8 @@ 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(); @@ -619,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); diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index 5e57055a..5e2a63d8 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -49,6 +49,7 @@ class GrassPathTile; class BeetrootTile; class MagmaTile; class BoneBlockTile; +class BannerTile; class ChunkRebuildData; @@ -415,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; @@ -679,7 +680,9 @@ public: 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/cmake/sources/Common.cmake b/Minecraft.World/cmake/sources/Common.cmake index 3c240fed..361c68e3 100644 --- a/Minecraft.World/cmake/sources/Common.cmake +++ b/Minecraft.World/cmake/sources/Common.cmake @@ -2055,6 +2055,12 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_LEVEL_TILE "${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.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 de065ea7..a4e7787c 100644 --- a/Minecraft.World/net.minecraft.world.level.tile.h +++ b/Minecraft.World/net.minecraft.world.level.tile.h @@ -149,5 +149,6 @@ #include "BeetrootTile.h" #include "MagmaTile.h" #include "BoneBlockTile.h" +#include "BannerTile.h"