diff options
author | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-26 11:03:34 +0100 |
---|---|---|
committer | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-26 11:03:34 +0100 |
commit | eb7131bd126b06c348313de6ab07d5d59f7c79c0 (patch) | |
tree | 87516638a71e7105b318fd17c15b2be143f622c0 /source/Blocks | |
parent | CryptoPP patches from xcb567 (diff) | |
download | cuberite-eb7131bd126b06c348313de6ab07d5d59f7c79c0.tar cuberite-eb7131bd126b06c348313de6ab07d5d59f7c79c0.tar.gz cuberite-eb7131bd126b06c348313de6ab07d5d59f7c79c0.tar.bz2 cuberite-eb7131bd126b06c348313de6ab07d5d59f7c79c0.tar.lz cuberite-eb7131bd126b06c348313de6ab07d5d59f7c79c0.tar.xz cuberite-eb7131bd126b06c348313de6ab07d5d59f7c79c0.tar.zst cuberite-eb7131bd126b06c348313de6ab07d5d59f7c79c0.zip |
Diffstat (limited to 'source/Blocks')
-rw-r--r-- | source/Blocks/BlockGlass.h | 26 | ||||
-rw-r--r-- | source/Blocks/BlockHandler.cpp | 2 | ||||
-rw-r--r-- | source/Blocks/BlockOre.h | 2 | ||||
-rw-r--r-- | source/Blocks/BlockRail.h | 3 |
4 files changed, 31 insertions, 2 deletions
diff --git a/source/Blocks/BlockGlass.h b/source/Blocks/BlockGlass.h new file mode 100644 index 000000000..d5147af96 --- /dev/null +++ b/source/Blocks/BlockGlass.h @@ -0,0 +1,26 @@ +
+#pragma once
+
+#include "BlockHandler.h"
+
+
+
+
+
+class cBlockGlassHandler :
+ public cBlockHandler
+{
+public:
+ cBlockGlassHandler(BLOCKTYPE a_BlockType)
+ : cBlockHandler(a_BlockType)
+ {
+ }
+
+ virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+ {
+ }
+} ;
+
+
+
+
diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp index 53e9c4a06..3f63de89f 100644 --- a/source/Blocks/BlockHandler.cpp +++ b/source/Blocks/BlockHandler.cpp @@ -46,6 +46,7 @@ #include "BlockFarmland.h"
#include "BlockMycelium.h"
#include "BlockRail.h"
+#include "BlockGlass.h"
@@ -104,6 +105,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_FURNACE: return new cBlockFurnaceHandler (a_BlockType);
case E_BLOCK_GLOWSTONE: return new cBlockGlowstoneHandler (a_BlockType);
case E_BLOCK_GOLD_ORE: return new cBlockOreHandler (a_BlockType);
+ case E_BLOCK_GLASS: return new cBlockGlassHandler (a_BlockType);
case E_BLOCK_GRASS: return new cBlockDirtHandler (a_BlockType);
case E_BLOCK_GRAVEL: return new cBlockGravelHandler (a_BlockType);
case E_BLOCK_ICE: return new cBlockIceHandler (a_BlockType);
diff --git a/source/Blocks/BlockOre.h b/source/Blocks/BlockOre.h index 50f5a88e2..1bfd8d17c 100644 --- a/source/Blocks/BlockOre.h +++ b/source/Blocks/BlockOre.h @@ -20,7 +20,7 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
- short ItemType = E_ITEM_EMPTY;
+ short ItemType = m_BlockType;
char Count = 1;
short Meta = 0;
diff --git a/source/Blocks/BlockRail.h b/source/Blocks/BlockRail.h index fb2000884..24947c0bc 100644 --- a/source/Blocks/BlockRail.h +++ b/source/Blocks/BlockRail.h @@ -58,7 +58,8 @@ public: virtual void OnNeighborChanged(cWorld *a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
- if(IsUnstable(a_World, a_BlockX, a_BlockY, a_BlockZ))
+ char Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
+ if(IsUnstable(a_World, a_BlockX, a_BlockY, a_BlockZ) && Meta != FindMeta(a_World, a_BlockX, a_BlockY, a_BlockZ))
a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, FindMeta(a_World, a_BlockX, a_BlockY, a_BlockZ));
}
|