diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-12-21 14:54:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 14:54:04 +0100 |
commit | 9518a273570e8d38438c2a29aa10f987e7d44ce1 (patch) | |
tree | 11806582f5e27bad01ae96705f75f431ec3e9caf /src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h | |
parent | Improve Enderman targeting (diff) | |
download | cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.gz cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.bz2 cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.lz cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.xz cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.zst cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.zip |
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h index c97f37aa5..66709293a 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h @@ -2,7 +2,7 @@ #pragma once #include "RedstoneHandler.h" -#include "../../Registries/Blocks.h" +#include "Registries/BlockStates.h" @@ -20,7 +20,7 @@ namespace RedstoneWireHandler /** Invokes Callback with the wire's left, front, and right direction state corresponding to Offset. Returns a new block constructed from the directions that the callback may have modified. */ template <class OffsetCallback> - inline short DoWithDirectionState(const Vector3i Offset, short Block, OffsetCallback Callback) + inline BlockState DoWithDirectionState(const Vector3i Offset, BlockState Block, OffsetCallback Callback) { auto North = Block::RedstoneWire::North(Block); auto South = Block::RedstoneWire::South(Block); @@ -49,7 +49,7 @@ namespace RedstoneWireHandler } /** Adjusts a given wire block so that the direction represented by Offset has state Direction. */ - inline void SetDirectionState(const Vector3i Offset, short & Block, TemporaryDirection Direction) + inline void SetDirectionState(const Vector3i Offset, BlockState & Block, TemporaryDirection Direction) { Block = DoWithDirectionState(Offset, Block, [Direction](auto, auto & Front, auto) { @@ -189,7 +189,7 @@ namespace RedstoneWireHandler return; } - DataForChunk(Chunk).WireStates[Position] = Block; + DataForChunk(Chunk).WireStates.emplace(Position, Block); } inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) |