Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
8406FDD32AF182E700B09C1D /* WindowsIncludes.h in Headers */ = {isa = PBXBuildFile; fileRef = 840DD8432AC810630006A435 /* WindowsIncludes.h */; };
8406FDD42AF182E700B09C1D /* WSAStartupSingleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 840DD8452AC810630006A435 /* WSAStartupSingleton.h */; };
8406FDD52AF182E700B09C1D /* XBox360Includes.h in Headers */ = {isa = PBXBuildFile; fileRef = 840DD8462AC810630006A435 /* XBox360Includes.h */; };
840823DA2F4FF4B80097F6A5 /* CoalItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840823D72F4FF4B80097F6A5 /* CoalItem.cpp */; };
840823DB2F4FF4B80097F6A5 /* CoalItem.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 840823D82F4FF4B80097F6A5 /* CoalItem.hpp */; };
840823DC2F4FF4B80097F6A5 /* Tool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 840823D92F4FF4B80097F6A5 /* Tool.hpp */; };
84171E812B1A6227008B82E6 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C4D86E2A872C0100323E33 /* OpenAL.framework */; };
841DD8772AF8AA7A00AA3B66 /* AppPlatform_sdl2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841DD8722AF8AA7A00AA3B66 /* AppPlatform_sdl2.cpp */; };
841DD8782AF8AA7A00AA3B66 /* AppPlatform_sdl2_desktop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841DD8752AF8AA7A00AA3B66 /* AppPlatform_sdl2_desktop.cpp */; };
Expand Down Expand Up @@ -1605,6 +1608,9 @@
/* Begin PBXFileReference section */
8400360F2E89DADB00C14213 /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = "<group>"; };
8406FD292AF1814500B09C1D /* libRenderer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRenderer.a; sourceTree = BUILT_PRODUCTS_DIR; };
840823D72F4FF4B80097F6A5 /* CoalItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoalItem.cpp; sourceTree = "<group>"; };
840823D82F4FF4B80097F6A5 /* CoalItem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CoalItem.hpp; sourceTree = "<group>"; };
840823D92F4FF4B80097F6A5 /* Tool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Tool.hpp; sourceTree = "<group>"; };
840DD5792AC810620006A435 /* KeyCodes.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = KeyCodes.hpp; sourceTree = "<group>"; };
840DD57A2AC810620006A435 /* SDLKeyCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLKeyCodes.h; sourceTree = "<group>"; };
840DD57E2AC810620006A435 /* App.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = App.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3850,31 +3856,29 @@
840DD66F2AC810620006A435 /* item */ = {
isa = PBXGroup;
children = (
84B9D8962F3BE0A900FD67C4 /* ArmorItem.hpp */,
84B9D8972F3BE0A900FD67C4 /* ArmorItem.cpp */,
84B9D8982F3BE0A900FD67C4 /* HoeItem.hpp */,
84B9D8992F3BE0A900FD67C4 /* HoeItem.cpp */,
84B9D89A2F3BE0A900FD67C4 /* SeedItem.hpp */,
84B9D89B2F3BE0A900FD67C4 /* SeedItem.cpp */,
848CCB482F3A974000031D1F /* FoodItem.hpp */,
848CCB492F3A974000031D1F /* FoodItem.cpp */,
848AA3132F34E897007E9A3E /* DyePowderItem.hpp */,
848AA3142F34E897007E9A3E /* DyePowderItem.cpp */,
84C614242F323602008AC5BE /* BowItem.hpp */,
84C614252F323602008AC5BE /* BowItem.cpp */,
84C614262F323602008AC5BE /* WeaponItem.hpp */,
84C614272F323602008AC5BE /* WeaponItem.cpp */,
84B9D8962F3BE0A900FD67C4 /* ArmorItem.hpp */,
84E1C9DF2E7FDC72007D2F5D /* AuxTileItem.cpp */,
84E1C9E02E7FDC72007D2F5D /* AuxTileItem.hpp */,
84C614252F323602008AC5BE /* BowItem.cpp */,
84C614242F323602008AC5BE /* BowItem.hpp */,
840DD6702AC810620006A435 /* CameraItem.cpp */,
840DD6712AC810620006A435 /* CameraItem.hpp */,
84E1C9E12E7FDC72007D2F5D /* ClothItem.cpp */,
84E1C9E22E7FDC72007D2F5D /* ClothItem.hpp */,
840823D72F4FF4B80097F6A5 /* CoalItem.cpp */,
840823D82F4FF4B80097F6A5 /* CoalItem.hpp */,
84DED19E2F309611004001C5 /* crafting */,
840DD6722AC810620006A435 /* DoorItem.cpp */,
840DD6732AC810620006A435 /* DoorItem.hpp */,
84E023022F2A0255003C8FFE /* DyeColor.cpp */,
84E023032F2A0255003C8FFE /* DyeColor.hpp */,
848AA3142F34E897007E9A3E /* DyePowderItem.cpp */,
848AA3132F34E897007E9A3E /* DyePowderItem.hpp */,
848CCB492F3A974000031D1F /* FoodItem.cpp */,
848CCB482F3A974000031D1F /* FoodItem.hpp */,
84B9D8992F3BE0A900FD67C4 /* HoeItem.cpp */,
84B9D8982F3BE0A900FD67C4 /* HoeItem.hpp */,
840DD6742AC810620006A435 /* Inventory.cpp */,
840DD6752AC810620006A435 /* Inventory.hpp */,
840DD6762AC810620006A435 /* Item.cpp */,
Expand All @@ -3883,14 +3887,19 @@
84E7BF352F286A6A002D3936 /* ItemStack.hpp */,
84E78C812B58B5FB00D515EF /* RocketItem.cpp */,
84E78C822B58B5FB00D515EF /* RocketItem.hpp */,
84B9D89B2F3BE0A900FD67C4 /* SeedItem.cpp */,
84B9D89A2F3BE0A900FD67C4 /* SeedItem.hpp */,
84E1C9E32E7FDC72007D2F5D /* SlabItem.cpp */,
84E1C9E42E7FDC72007D2F5D /* SlabItem.hpp */,
840DD67A2AC810620006A435 /* TileItem.cpp */,
840DD67B2AC810620006A435 /* TileItem.hpp */,
840DD67C2AC810620006A435 /* TilePlanterItem.cpp */,
840DD67D2AC810620006A435 /* TilePlanterItem.hpp */,
840823D92F4FF4B80097F6A5 /* Tool.hpp */,
845BBCB42F2EA81700C7232C /* ToolItem.cpp */,
845BBCB32F2EA81700C7232C /* ToolItem.hpp */,
84C614272F323602008AC5BE /* WeaponItem.cpp */,
84C614262F323602008AC5BE /* WeaponItem.hpp */,
);
path = item;
sourceTree = "<group>";
Expand Down Expand Up @@ -5961,13 +5970,15 @@
84BF63C92AF186C9008A9995 /* SandTile.hpp in Headers */,
84E1C9D82E7FDC26007D2F5D /* PumpkinTile.hpp in Headers */,
84BF63CA2AF186C9008A9995 /* Sapling.hpp in Headers */,
840823DC2F4FF4B80097F6A5 /* Tool.hpp in Headers */,
84CCBC942E61880600E251AF /* EntityFactory.hpp in Headers */,
84BF63CB2AF186C9008A9995 /* SpongeTile.hpp in Headers */,
84BF63CC2AF186C9008A9995 /* StairTile.hpp in Headers */,
84E1C9D22E7FDC26007D2F5D /* DeadBush.hpp in Headers */,
84BF63CD2AF186C9008A9995 /* StoneSlabTile.hpp in Headers */,
84BF63CE2AF186C9008A9995 /* StoneTile.hpp in Headers */,
84E7BF1D2F286A08002D3936 /* ContainerMenu.hpp in Headers */,
840823DB2F4FF4B80097F6A5 /* CoalItem.hpp in Headers */,
848AA3162F34E897007E9A3E /* DyePowderItem.hpp in Headers */,
84BF63CF2AF186C9008A9995 /* Tile.hpp in Headers */,
84BF63D02AF186C9008A9995 /* TntTile.hpp in Headers */,
Expand Down Expand Up @@ -7132,6 +7143,7 @@
84AA8B7C2B32F3B5003F5B82 /* Cow.cpp in Sources */,
84AA8B7E2B32F3B5003F5B82 /* Creeper.cpp in Sources */,
84AA8B8A2B32F3B5003F5B82 /* Monster.cpp in Sources */,
840823DA2F4FF4B80097F6A5 /* CoalItem.cpp in Sources */,
84E7BF242F286A08002D3936 /* ResultSlot.cpp in Sources */,
84E7BF202F286A08002D3936 /* InventoryMenu.cpp in Sources */,
84AA8B8C2B32F3B5003F5B82 /* PathfinderMob.cpp in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion platforms/windows/projects/World/World.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
<ClCompile Include="$(MC_ROOT)\source\world\item\BowItem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\WeaponItem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\DyePowderItem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\CoalItem.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Entity.hpp" />
Expand Down Expand Up @@ -398,6 +399,7 @@
<ClInclude Include="$(MC_ROOT)\source\world\item\BowItem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\WeaponItem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\DyePowderItem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\CoalItem.hpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NBT\NBT.vcxproj">
Expand All @@ -408,4 +410,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
8 changes: 7 additions & 1 deletion platforms/windows/projects/World/World.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@
<ClCompile Include="$(MC_ROOT)\source\world\item\DyePowderItem.cpp">
<Filter>Source Files\Item</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\world\item\CoalItem.cpp">
<Filter>Source Files\Item</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Entity.hpp">
Expand Down Expand Up @@ -1174,5 +1177,8 @@
<ClInclude Include="$(MC_ROOT)\source\world\item\DyePowderItem.hpp">
<Filter>Header Files\Item</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\world\item\CoalItem.hpp">
<Filter>Header Files\Item</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ add_library(reminecraftpe-core STATIC
world/item/ArmorItem.cpp
world/item/HoeItem.cpp
world/item/DyePowderItem.cpp
world/item/CoalItem.cpp
world/item/ToolItem.cpp
world/item/WeaponItem.cpp
world/item/BowItem.cpp
Expand Down
1 change: 1 addition & 0 deletions source/client/renderer/entity/EntityRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ void EntityRenderer::renderFlat(const AABB& aabb)

void EntityRenderer::postRender(const Entity& entity, const Vec3& pos, float rot, float a)
{
// Java had a rendering bug in the original, caused by the heightOffset being applied to the y position
if (m_pDispatcher->m_pOptions && m_pDispatcher->m_pOptions->m_fancyGraphics.get() && areShadowsAvailable() && m_shadowRadius > 0.0f)
{
float dist = m_pDispatcher->distanceToSqr(entity.m_pos);
Expand Down
6 changes: 6 additions & 0 deletions source/client/renderer/entity/HumanoidMobRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,9 @@ void HumanoidMobRenderer::renderHand(const Entity& entity, float a)
}
#endif
}

void HumanoidMobRenderer::scale(const Mob &mob, Matrix &matrix, float a)
{
// players are actually 15/16ths the size than any other bipedal mob
matrix.scale((mob.isPlayer()) ? (15.0f / 16.0f) : 1.0f);
}
1 change: 1 addition & 0 deletions source/client/renderer/entity/HumanoidMobRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class HumanoidMobRenderer : public MobRenderer
virtual void onGraphicsReset() override;

void renderHand(const Entity& entity, float a);
void scale(const Mob& mob, Matrix& matrix, float a);

public:
HumanoidModel* m_pHumanoidModel;
Expand Down
1 change: 1 addition & 0 deletions source/common/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
********************************************************************/

#include <stdio.h>
#include <cstdlib>
#include "Util.hpp"

const std::string Util::EMPTY_STRING = "";
Expand Down
1 change: 1 addition & 0 deletions source/common/threading/AsyncTask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <exception>
#include <algorithm>
#include <stdlib.h>

#include "CThread.hpp"
#include "compat/LegacyCPP.hpp"
Expand Down
12 changes: 12 additions & 0 deletions source/world/item/CoalItem.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "CoalItem.hpp"

CoalItem::CoalItem(int id) : Item(id)
{
m_maxDamage = 0;
m_bStackedByData = true;
}

std::string CoalItem::getDescriptionId(ItemStack* inst) const
{
return (inst->getAuxValue() == 1) ? "item.charcoal" : "item.coal";
}
12 changes: 12 additions & 0 deletions source/world/item/CoalItem.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "Item.hpp"

class CoalItem : public Item
{
public:
CoalItem(int id);

std::string getDescriptionId(ItemStack* inst) const override;

};
17 changes: 9 additions & 8 deletions source/world/item/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
#include "common/Logger.hpp"
#include "common/Util.hpp"

#include "ArmorItem.hpp"
#include "BowItem.hpp"
#include "CameraItem.hpp"
#include "CoalItem.hpp"
#include "DoorItem.hpp"
#include "TileItem.hpp"
#include "TilePlanterItem.hpp"
#include "RocketItem.hpp"
#include "ToolItem.hpp"
#include "BowItem.hpp"
#include "DyePowderItem.hpp"
#include "WeaponItem.hpp"
#include "FoodItem.hpp"
#include "ArmorItem.hpp"
#include "HoeItem.hpp"
#include "RocketItem.hpp"
#include "SeedItem.hpp"
#include "TileItem.hpp"
#include "ToolItem.hpp"
#include "TilePlanterItem.hpp"
#include "WeaponItem.hpp"

#define ITEM(x) ((x) - 256)

Expand Down Expand Up @@ -339,7 +340,7 @@ void Item::initItems()
->setIcon(5, 2)
->setDescriptionId("arrow");

Item::coal = NEW_ITEM(ITEM_COAL)
Item::coal = NEW_X_ITEMN(CoalItem, ITEM_COAL)
->setIcon(7, 0)
->setDescriptionId("coal");

Expand Down