summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockLever.h
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-10 08:28:27 +0200
committerarchshift <admin@archshift.com>2014-07-10 08:28:27 +0200
commite824cd09b369c47a7f316fccc7577cd923164466 (patch)
treed8efa178a29955525458a38b1351ea0b609a2a09 /src/Blocks/BlockLever.h
parentEntityEffects.x -> EntityEffect.x, Object-Oriented effects (diff)
parentMerge pull request #1157 from Howaner/Window (diff)
downloadcuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.gz
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.bz2
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.lz
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.xz
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.zst
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.zip
Diffstat (limited to 'src/Blocks/BlockLever.h')
-rw-r--r--src/Blocks/BlockLever.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Blocks/BlockLever.h b/src/Blocks/BlockLever.h
index ad2ae29e5..4e745d413 100644
--- a/src/Blocks/BlockLever.h
+++ b/src/Blocks/BlockLever.h
@@ -7,12 +7,13 @@
class cBlockLeverHandler :
- public cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false>
+ public cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, false>
{
- typedef cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false> super;
+ typedef cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, false> super;
+
public:
- cBlockLeverHandler(BLOCKTYPE a_BlockType)
- : cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false>(a_BlockType)
+ cBlockLeverHandler(BLOCKTYPE a_BlockType) :
+ super(a_BlockType)
{
}
@@ -21,7 +22,8 @@ public:
// Flip the ON bit on/off using the XOR bitwise operation
NIBBLETYPE Meta = (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) ^ 0x08);
- a_ChunkInterface.SetBlock(a_WorldInterface, a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_LEVER, Meta); // SetMeta doesn't work for unpowering levers, so setblock
+ a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta);
+ a_WorldInterface.WakeUpSimulators(a_BlockX, a_BlockY, a_BlockZ);
a_WorldInterface.GetBroadcastManager().BroadcastSoundEffect("random.click", a_BlockX * 8, a_BlockY * 8, a_BlockZ * 8, 0.5f, (Meta & 0x08) ? 0.6f : 0.5f);
}
@@ -103,7 +105,7 @@ public:
AddFaceDirection(a_RelX, a_RelY, a_RelZ, BlockMetaDataToBlockFace(Meta), true);
BLOCKTYPE BlockIsOn; a_Chunk.UnboundedRelGetBlockType(a_RelX, a_RelY, a_RelZ, BlockIsOn);
- return (a_RelY > 0) && cBlockInfo::IsSolid(BlockIsOn);
+ return (a_RelY > 0) && cBlockInfo::FullyOccupiesVoxel(BlockIsOn);
}
@@ -132,7 +134,7 @@ public:
case 0x05: return 0x06; // Ground rotation
case 0x06: return 0x05;
- default: return super::MetaRotateCCW(a_Meta); // Wall Rotation
+ default: return super::MetaRotateCW(a_Meta); // Wall Rotation
}
}
} ;