summaryrefslogtreecommitdiffstats
path: root/source/cBlockToPickup.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-25 02:40:31 +0100
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-25 02:40:31 +0100
commitf419ec2fe783ddf4252f50f475c2a5cf9e70038e (patch)
tree901c83eef4027c90c768df2de7cbae2f4e84e1e5 /source/cBlockToPickup.cpp
parentChunks are generated in a separate thread allowing players to keep on playing and chatting while chunks are generated. This means, however, that cWorld::GetChunk() does not always return a chunk and is something you need to be aware of. I am not entirely sure if all this is completely stable, but I think so :O (diff)
downloadcuberite-f419ec2fe783ddf4252f50f475c2a5cf9e70038e.tar
cuberite-f419ec2fe783ddf4252f50f475c2a5cf9e70038e.tar.gz
cuberite-f419ec2fe783ddf4252f50f475c2a5cf9e70038e.tar.bz2
cuberite-f419ec2fe783ddf4252f50f475c2a5cf9e70038e.tar.lz
cuberite-f419ec2fe783ddf4252f50f475c2a5cf9e70038e.tar.xz
cuberite-f419ec2fe783ddf4252f50f475c2a5cf9e70038e.tar.zst
cuberite-f419ec2fe783ddf4252f50f475c2a5cf9e70038e.zip
Diffstat (limited to 'source/cBlockToPickup.cpp')
-rw-r--r--source/cBlockToPickup.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/cBlockToPickup.cpp b/source/cBlockToPickup.cpp
index 6e59e6573..c0597d005 100644
--- a/source/cBlockToPickup.cpp
+++ b/source/cBlockToPickup.cpp
@@ -50,7 +50,27 @@ ENUM_ITEM_ID cBlockToPickup::ToPickup( unsigned char a_BlockID, ENUM_ITEM_ID a_U
return E_ITEM_REDSTONE_TORCH_ON;
case E_BLOCK_MELON:
return E_ITEM_MELON_SLICE;
+ case E_BLOCK_WOODEN_DOOR:
+ return E_ITEM_WOODEN_DOOR;
+ case E_BLOCK_IRON_DOOR:
+ return E_ITEM_IRON_DOOR;
default:
return (ENUM_ITEM_ID)a_BlockID;
}
}
+
+char cBlockToPickup::PickupCount(unsigned char a_BlockID)
+{
+ switch(a_BlockID)
+ {
+ case E_BLOCK_REDSTONE_ORE_GLOWING:
+ case E_BLOCK_REDSTONE_ORE:
+ return rand() % 2 + 4;
+ case E_BLOCK_MELON:
+ return rand() % 8 + 3;
+ case E_BLOCK_LAPIS_ORE:
+ return rand() % 5 + 4;
+ default:
+ return 1;
+ }
+} \ No newline at end of file