summaryrefslogtreecommitdiffstats
path: root/source/Blocks
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Blocks/BlockGlass.h26
-rw-r--r--source/Blocks/BlockHandler.cpp2
-rw-r--r--source/Blocks/BlockOre.h2
-rw-r--r--source/Blocks/BlockRail.h3
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));
}