summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author12xx12 <44411062+12xx12@users.noreply.github.com>2020-08-04 20:01:36 +0200
committerGitHub <noreply@github.com>2020-08-04 20:01:36 +0200
commit781d6485719a0122133db9b6f1e6a50aa82360b6 (patch)
tree0471b73cadd6b422af493ece14d3981b07a7d012
parentFixup test block handler stubs (diff)
downloadcuberite-781d6485719a0122133db9b6f1e6a50aa82360b6.tar
cuberite-781d6485719a0122133db9b6f1e6a50aa82360b6.tar.gz
cuberite-781d6485719a0122133db9b6f1e6a50aa82360b6.tar.bz2
cuberite-781d6485719a0122133db9b6f1e6a50aa82360b6.tar.lz
cuberite-781d6485719a0122133db9b6f1e6a50aa82360b6.tar.xz
cuberite-781d6485719a0122133db9b6f1e6a50aa82360b6.tar.zst
cuberite-781d6485719a0122133db9b6f1e6a50aa82360b6.zip
-rw-r--r--src/Chunk.cpp31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 25af8d6fb..17c41acec 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1278,33 +1278,10 @@ void cChunk::SetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_Blo
}
// If the new block is a block entity, create the entity object:
- switch (a_BlockType)
- {
- case E_BLOCK_BEACON:
- case E_BLOCK_BED:
- case E_BLOCK_TRAPPED_CHEST:
- case E_BLOCK_CHEST:
- case E_BLOCK_COMMAND_BLOCK:
- case E_BLOCK_DISPENSER:
- case E_BLOCK_DROPPER:
- case E_BLOCK_ENDER_CHEST:
- case E_BLOCK_LIT_FURNACE:
- case E_BLOCK_FURNACE:
- case E_BLOCK_HOPPER:
- case E_BLOCK_SIGN_POST:
- case E_BLOCK_WALLSIGN:
- case E_BLOCK_HEAD:
- case E_BLOCK_NOTE_BLOCK:
- case E_BLOCK_JUKEBOX:
- case E_BLOCK_FLOWER_POT:
- case E_BLOCK_MOB_SPAWNER:
- case E_BLOCK_BREWING_STAND:
- {
- // Fast set block has already marked dirty
- AddBlockEntityClean(cBlockEntity::CreateByBlockType(a_BlockType, a_BlockMeta, RelativeToAbsolute(a_RelPos), m_World));
- break;
- }
- } // switch (a_BlockType)
+ if (cBlockEntity::IsBlockEntityBlockType(a_BlockType))
+ {
+ AddBlockEntityClean(cBlockEntity::CreateByBlockType(a_BlockType, a_BlockMeta, RelativeToAbsolute(a_RelPos), m_World));
+ }
}