summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorluksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-24 10:50:38 +0100
committerluksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-24 10:50:38 +0100
commiteed6f9bb7bd2553a509a7bba7be32436aa96659b (patch)
tree65894528e1dc06d872a6bd916538b221874111c3 /source
parentByteBuffer: Fixed buffer overrun possibility. (diff)
downloadcuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar
cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.gz
cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.bz2
cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.lz
cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.xz
cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.tar.zst
cuberite-eed6f9bb7bd2553a509a7bba7be32436aa96659b.zip
Diffstat (limited to 'source')
-rw-r--r--source/BlockID.h4
-rw-r--r--source/Blocks/BlockHandler.cpp3
-rw-r--r--source/Blocks/BlockMycelium.h29
-rw-r--r--source/Blocks/BlockStone.h2
-rw-r--r--source/Items/ItemSpawnEgg.h7
-rw-r--r--source/JukeboxEntity.cpp2
6 files changed, 41 insertions, 6 deletions
diff --git a/source/BlockID.h b/source/BlockID.h
index 6dd30a069..11392c509 100644
--- a/source/BlockID.h
+++ b/source/BlockID.h
@@ -246,8 +246,8 @@ enum ENUM_ITEM_ID
E_ITEM_WOODEN_PRESSURE_PLATE = 72,
E_ITEM_REDSTONE_ORE = 73,
E_ITEM_REDSTONE_ORE_GLOWING = 74,
- E_ITEM_REDSTONE_TORCH_ON = 75,
- E_ITEM_REDSTONE_TORCH_OFF = 76,
+ E_ITEM_REDSTONE_TORCH_OFF = 75,
+ E_ITEM_REDSTONE_TORCH_ON = 76,
E_ITEM_STONE_BUTTON = 77,
E_ITEM_SNOW = 78,
E_ITEM_ICE = 79,
diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp
index 848a70a19..88f279ff5 100644
--- a/source/Blocks/BlockHandler.cpp
+++ b/source/Blocks/BlockHandler.cpp
@@ -44,6 +44,7 @@
#include "BlockNote.h"
#include "BlockBed.h"
#include "BlockFarmland.h"
+#include "BlockMycelium.h"
@@ -117,6 +118,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_LOG: return new cBlockWoodHandler (a_BlockType);
case E_BLOCK_MELON: return new cBlockMelonHandler (a_BlockType);
case E_BLOCK_MELON_STEM: return new cBlockStemsHandler (a_BlockType);
+ case E_BLOCK_MYCELIUM: return new cBlockMyceliumHandler (a_BlockType);
case E_BLOCK_NETHER_BRICK_STAIRS: return new cBlockStairsHandler (a_BlockType);
case E_BLOCK_NOTE_BLOCK: return new cBlockNoteHandler (a_BlockType);
case E_BLOCK_PISTON: return new cBlockPistonHandler (a_BlockType);
@@ -132,6 +134,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_RED_MUSHROOM: return new cBlockMushroomHandler (a_BlockType);
case E_BLOCK_RED_ROSE: return new cBlockFlowerHandler (a_BlockType);
case E_BLOCK_SAND: return new cBlockSandHandler (a_BlockType);
+ case E_ITEM_SANDSTONE_STAIRS: return new cBlockStairsHandler (a_BlockType);
case E_BLOCK_SAPLING: return new cBlockSaplingHandler (a_BlockType);
case E_BLOCK_SIGN_POST: return new cBlockSignHandler (a_BlockType);
case E_BLOCK_SNOW: return new cBlockSnowHandler (a_BlockType);
diff --git a/source/Blocks/BlockMycelium.h b/source/Blocks/BlockMycelium.h
new file mode 100644
index 000000000..57b45dfe1
--- /dev/null
+++ b/source/Blocks/BlockMycelium.h
@@ -0,0 +1,29 @@
+
+#pragma once
+
+#include "BlockHandler.h"
+#include "../MersenneTwister.h"
+#include "../World.h"
+
+
+
+
+
+class cBlockMyceliumHandler :
+ public cBlockHandler
+{
+public:
+ cBlockMyceliumHandler(BLOCKTYPE a_BlockType)
+ : cBlockHandler(a_BlockType)
+ {
+ }
+
+ virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+ {
+ a_Pickups.push_back(cItem(E_BLOCK_DIRT, 1, 0));
+ }
+} ;
+
+
+
+
diff --git a/source/Blocks/BlockStone.h b/source/Blocks/BlockStone.h
index 69809c078..89bef5969 100644
--- a/source/Blocks/BlockStone.h
+++ b/source/Blocks/BlockStone.h
@@ -20,7 +20,7 @@ public:
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
- a_Pickups.push_back(cItem(E_BLOCK_STONE, 1, 0));
+ a_Pickups.push_back(cItem(E_BLOCK_COBBLESTONE, 1, 0));
}
} ;
diff --git a/source/Items/ItemSpawnEgg.h b/source/Items/ItemSpawnEgg.h
index f3018075b..33a1e1d55 100644
--- a/source/Items/ItemSpawnEgg.h
+++ b/source/Items/ItemSpawnEgg.h
@@ -35,8 +35,11 @@ public:
if (a_World->SpawnMob(a_BlockX + 0.5, a_BlockY, a_BlockZ + 0.5, a_Item->m_ItemDamage) >= 0)
{
- // The mob was spawned, "use" the item:
- a_Player->UseEquippedItem();
+ if(a_Player->GetGameMode() != 1)
+ {
+ // The mob was spawned, "use" the item:
+ a_Player->GetInventory().RemoveItem(a_Player->GetInventory().GetEquippedItem());
+ }
return true;
}
diff --git a/source/JukeboxEntity.cpp b/source/JukeboxEntity.cpp
index c190ffa11..3b4c8e1d9 100644
--- a/source/JukeboxEntity.cpp
+++ b/source/JukeboxEntity.cpp
@@ -40,7 +40,7 @@ void cJukeboxEntity::UsedBy( cPlayer * a_Player )
if (HeldItem.m_ItemType >= 2256 && HeldItem.m_ItemType <= 2267)
{
m_Record = HeldItem.m_ItemType;
- a_Player->UseEquippedItem();
+ a_Player->GetInventory().RemoveItem(a_Player->GetInventory().GetEquippedItem());
PlayRecord();
}
}