summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMat <mail@mathias.is>2020-03-23 21:07:08 +0100
committerGitHub <noreply@github.com>2020-03-23 21:07:08 +0100
commit0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd (patch)
tree08767102c2360e78aada2ef3c76bea95ad4a909f /src
parentEnable functional packets in 1.13 (diff)
downloadcuberite-0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd.tar
cuberite-0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd.tar.gz
cuberite-0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd.tar.bz2
cuberite-0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd.tar.lz
cuberite-0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd.tar.xz
cuberite-0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd.tar.zst
cuberite-0d0d019bbe6d7d6ce80056a6f249e69d5bb865bd.zip
Diffstat (limited to 'src')
-rw-r--r--src/Blocks/BlockCauldron.h9
-rw-r--r--src/Blocks/BlockComparator.h9
-rw-r--r--src/Blocks/BlockFarmland.h13
-rw-r--r--src/Blocks/BlockFlowerPot.h13
-rw-r--r--src/Blocks/BlockRedstone.h9
-rw-r--r--src/Blocks/BlockRedstoneRepeater.h10
6 files changed, 51 insertions, 12 deletions
diff --git a/src/Blocks/BlockCauldron.h b/src/Blocks/BlockCauldron.h
index a359533af..5b45b2828 100644
--- a/src/Blocks/BlockCauldron.h
+++ b/src/Blocks/BlockCauldron.h
@@ -8,9 +8,9 @@
class cBlockCauldronHandler :
- public cClearMetaOnDrop<cBlockHandler>
+ public cBlockHandler
{
- using super = cClearMetaOnDrop<cBlockHandler>;
+ using super = cBlockHandler;
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
{
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta({a_BlockX, a_BlockY, a_BlockZ});
diff --git a/src/Blocks/BlockComparator.h b/src/Blocks/BlockComparator.h
index 4103c805e..e4dca5d77 100644
--- a/src/Blocks/BlockComparator.h
+++ b/src/Blocks/BlockComparator.h
@@ -10,9 +10,9 @@
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:
@@ -45,6 +45,11 @@ public:
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(
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
diff --git a/src/Blocks/BlockFarmland.h b/src/Blocks/BlockFarmland.h
index 219f9a654..261103a50 100644
--- a/src/Blocks/BlockFarmland.h
+++ b/src/Blocks/BlockFarmland.h
@@ -17,9 +17,9 @@
class cBlockFarmlandHandler :
- public cClearMetaOnDrop<cBlockHandler>
+ public cBlockHandler
{
- using super = cClearMetaOnDrop<cBlockHandler>;
+ using super = cBlockHandler;
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
{
NIBBLETYPE BlockMeta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
diff --git a/src/Blocks/BlockFlowerPot.h b/src/Blocks/BlockFlowerPot.h
index 36c71df5b..b552e2c81 100644
--- a/src/Blocks/BlockFlowerPot.h
+++ b/src/Blocks/BlockFlowerPot.h
@@ -8,9 +8,9 @@
class cBlockFlowerPotHandler :
- public cClearMetaOnDrop<cBlockEntityHandler>
+ public cBlockEntityHandler
{
- using super = cClearMetaOnDrop<cBlockEntityHandler>;
+ using super = cBlockEntityHandler;
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
{
UNUSED(a_Meta);
diff --git a/src/Blocks/BlockRedstone.h b/src/Blocks/BlockRedstone.h
index d01a40631..c93537d08 100644
--- a/src/Blocks/BlockRedstone.h
+++ b/src/Blocks/BlockRedstone.h
@@ -9,9 +9,9 @@
class cBlockRedstoneHandler :
- public cClearMetaOnDrop<cBlockHandler>
+ public cBlockHandler
{
- using super = cClearMetaOnDrop<cBlockHandler>;
+ using super = cBlockHandler;
public:
@@ -46,6 +46,11 @@ public:
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
{
UNUSED(a_Meta);
diff --git a/src/Blocks/BlockRedstoneRepeater.h b/src/Blocks/BlockRedstoneRepeater.h
index 6e749bd57..de55debf1 100644
--- a/src/Blocks/BlockRedstoneRepeater.h
+++ b/src/Blocks/BlockRedstoneRepeater.h
@@ -12,9 +12,9 @@
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:
@@ -32,6 +32,7 @@ public:
{
a_BlockType = m_BlockType;
a_BlockMeta = RepeaterRotationToMetaData(a_Player.GetYaw());
+
return true;
}
@@ -78,6 +79,11 @@ public:
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)
{
a_Rotation += 90 + 45; // So its not aligned with axis