Fix certain item drops (#4536)
* Fix certain item drops * Revert unwanted changes * Revert unwanted changes * Revert change * Style fixes
This commit is contained in:
parent
bff7319622
commit
0d0d019bbe
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
|
|
||||||
class cBlockCauldronHandler :
|
class cBlockCauldronHandler :
|
||||||
public cClearMetaOnDrop<cBlockHandler>
|
public cBlockHandler
|
||||||
{
|
{
|
||||||
using super = cClearMetaOnDrop<cBlockHandler>;
|
using super = cBlockHandler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -19,6 +19,11 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
|
||||||
|
{
|
||||||
|
return cItem(E_ITEM_CAULDRON, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
|
virtual bool OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
|
||||||
{
|
{
|
||||||
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta({a_BlockX, a_BlockY, a_BlockZ});
|
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta({a_BlockX, a_BlockY, a_BlockZ});
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
|
|
||||||
class cBlockComparatorHandler :
|
class cBlockComparatorHandler :
|
||||||
public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>>
|
public cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>
|
||||||
{
|
{
|
||||||
using super = cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>>;
|
using super = cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -45,6 +45,11 @@ public:
|
|||||||
return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR));
|
return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
|
||||||
|
{
|
||||||
|
return cItem(E_ITEM_COMPARATOR, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool GetPlacementBlockTypeMeta(
|
virtual bool GetPlacementBlockTypeMeta(
|
||||||
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
|
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
|
||||||
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
|
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
|
|
||||||
class cBlockFarmlandHandler :
|
class cBlockFarmlandHandler :
|
||||||
public cClearMetaOnDrop<cBlockHandler>
|
public cBlockHandler
|
||||||
{
|
{
|
||||||
using super = cClearMetaOnDrop<cBlockHandler>;
|
using super = cBlockHandler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -32,6 +32,15 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
|
||||||
|
{
|
||||||
|
return cItem(E_BLOCK_DIRT, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
|
virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
|
||||||
{
|
{
|
||||||
NIBBLETYPE BlockMeta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
|
NIBBLETYPE BlockMeta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
|
|
||||||
class cBlockFlowerPotHandler :
|
class cBlockFlowerPotHandler :
|
||||||
public cClearMetaOnDrop<cBlockEntityHandler>
|
public cBlockEntityHandler
|
||||||
{
|
{
|
||||||
using super = cClearMetaOnDrop<cBlockEntityHandler>;
|
using super = cBlockEntityHandler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -23,6 +23,15 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
|
||||||
|
{
|
||||||
|
return cItem(E_ITEM_FLOWER_POT, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
|
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
|
||||||
{
|
{
|
||||||
UNUSED(a_Meta);
|
UNUSED(a_Meta);
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
|
|
||||||
class cBlockRedstoneHandler :
|
class cBlockRedstoneHandler :
|
||||||
public cClearMetaOnDrop<cBlockHandler>
|
public cBlockHandler
|
||||||
{
|
{
|
||||||
using super = cClearMetaOnDrop<cBlockHandler>;
|
using super = cBlockHandler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -46,6 +46,11 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
|
||||||
|
{
|
||||||
|
return cItem(E_ITEM_REDSTONE_DUST, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
|
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
|
||||||
{
|
{
|
||||||
UNUSED(a_Meta);
|
UNUSED(a_Meta);
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
|
|
||||||
|
|
||||||
class cBlockRedstoneRepeaterHandler:
|
class cBlockRedstoneRepeaterHandler:
|
||||||
public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>>
|
public cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>
|
||||||
{
|
{
|
||||||
using super = cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>>;
|
using super = cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -32,6 +32,7 @@ public:
|
|||||||
{
|
{
|
||||||
a_BlockType = m_BlockType;
|
a_BlockType = m_BlockType;
|
||||||
a_BlockMeta = RepeaterRotationToMetaData(a_Player.GetYaw());
|
a_BlockMeta = RepeaterRotationToMetaData(a_Player.GetYaw());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,6 +79,11 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
|
||||||
|
{
|
||||||
|
return cItem(E_ITEM_REDSTONE_REPEATER, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
inline static NIBBLETYPE RepeaterRotationToMetaData(double a_Rotation)
|
inline static NIBBLETYPE RepeaterRotationToMetaData(double a_Rotation)
|
||||||
{
|
{
|
||||||
a_Rotation += 90 + 45; // So its not aligned with axis
|
a_Rotation += 90 + 45; // So its not aligned with axis
|
||||||
|
Loading…
x
Reference in New Issue
Block a user