diff options
author | Aiden Neill <aidenneill@gmail.com> | 2020-12-19 02:42:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-19 02:42:34 +0100 |
commit | a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876 (patch) | |
tree | 926f6dbc58ba7decf902d4f86bc72690e30337a3 /src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp | |
parent | Added dimension check to nether portal (#5068) (diff) | |
download | cuberite-a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876.tar cuberite-a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876.tar.gz cuberite-a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876.tar.bz2 cuberite-a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876.tar.lz cuberite-a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876.tar.xz cuberite-a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876.tar.zst cuberite-a7e9f88ff3dba3b99b58d2bf9ed2350e6154d876.zip |
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp | 107 |
1 files changed, 55 insertions, 52 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp b/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp index ff109c824..63da4c0dc 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneHandler.cpp @@ -6,6 +6,7 @@ #include "ForEachSourceCallback.h" #include "CommandBlockHandler.h" +#include "DaylightSensorHandler.h" #include "DoorHandler.h" #include "RedstoneTorchHandler.h" #include "RedstoneWireHandler.h" @@ -30,58 +31,60 @@ -#define INVOKE_FOR_HANDLERS(Callback) \ - do \ - { \ - switch (BlockType) \ - { \ - case E_BLOCK_ACTIVATOR_RAIL: \ - case E_BLOCK_DETECTOR_RAIL: \ - case E_BLOCK_POWERED_RAIL: return PoweredRailHandler::Callback; \ - case E_BLOCK_ACTIVE_COMPARATOR: \ - case E_BLOCK_INACTIVE_COMPARATOR: return RedstoneComparatorHandler::Callback; \ - case E_BLOCK_DISPENSER: \ - case E_BLOCK_DROPPER: return DropSpenserHandler::Callback; \ - case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: \ - case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: \ - case E_BLOCK_STONE_PRESSURE_PLATE: \ - case E_BLOCK_WOODEN_PRESSURE_PLATE: return PressurePlateHandler::Callback; \ - case E_BLOCK_ACACIA_FENCE_GATE: \ - case E_BLOCK_BIRCH_FENCE_GATE: \ - case E_BLOCK_DARK_OAK_FENCE_GATE: \ - case E_BLOCK_FENCE_GATE: \ - case E_BLOCK_IRON_TRAPDOOR: \ - case E_BLOCK_JUNGLE_FENCE_GATE: \ - case E_BLOCK_SPRUCE_FENCE_GATE: \ - case E_BLOCK_TRAPDOOR: return SmallGateHandler::Callback; \ - case E_BLOCK_REDSTONE_LAMP_OFF: \ - case E_BLOCK_REDSTONE_LAMP_ON: return RedstoneLampHandler::Callback; \ - case E_BLOCK_REDSTONE_REPEATER_OFF: \ - case E_BLOCK_REDSTONE_REPEATER_ON: return RedstoneRepeaterHandler::Callback; \ - case E_BLOCK_REDSTONE_TORCH_OFF: \ - case E_BLOCK_REDSTONE_TORCH_ON: return RedstoneTorchHandler::Callback; \ - case E_BLOCK_OBSERVER: return ObserverHandler::Callback; \ - case E_BLOCK_PISTON: \ - case E_BLOCK_STICKY_PISTON: return PistonHandler::Callback; \ - case E_BLOCK_LEVER: \ - case E_BLOCK_STONE_BUTTON: \ - case E_BLOCK_WOODEN_BUTTON: return RedstoneToggleHandler::Callback; \ - case E_BLOCK_BLOCK_OF_REDSTONE: return RedstoneBlockHandler::Callback; \ - case E_BLOCK_COMMAND_BLOCK: return CommandBlockHandler::Callback; \ - case E_BLOCK_HOPPER: return HopperHandler::Callback; \ - case E_BLOCK_NOTE_BLOCK: return NoteBlockHandler::Callback; \ - case E_BLOCK_REDSTONE_WIRE: return RedstoneWireHandler::Callback; \ - case E_BLOCK_TNT: return TNTHandler::Callback; \ - case E_BLOCK_TRAPPED_CHEST: return TrappedChestHandler::Callback; \ - case E_BLOCK_TRIPWIRE_HOOK: return TripwireHookHandler::Callback; \ - default: \ - { \ - if (cBlockDoorHandler::IsDoorBlockType(BlockType)) \ - { \ - return DoorHandler::Callback; \ - } \ - } \ - } \ +#define INVOKE_FOR_HANDLERS(Callback) \ + do \ + { \ + switch (BlockType) \ + { \ + case E_BLOCK_ACTIVATOR_RAIL: \ + case E_BLOCK_DETECTOR_RAIL: \ + case E_BLOCK_POWERED_RAIL: return PoweredRailHandler::Callback; \ + case E_BLOCK_ACTIVE_COMPARATOR: \ + case E_BLOCK_INACTIVE_COMPARATOR: return RedstoneComparatorHandler::Callback; \ + case E_BLOCK_DISPENSER: \ + case E_BLOCK_DROPPER: return DropSpenserHandler::Callback; \ + case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: \ + case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: \ + case E_BLOCK_STONE_PRESSURE_PLATE: \ + case E_BLOCK_WOODEN_PRESSURE_PLATE: return PressurePlateHandler::Callback; \ + case E_BLOCK_ACACIA_FENCE_GATE: \ + case E_BLOCK_BIRCH_FENCE_GATE: \ + case E_BLOCK_DARK_OAK_FENCE_GATE: \ + case E_BLOCK_FENCE_GATE: \ + case E_BLOCK_IRON_TRAPDOOR: \ + case E_BLOCK_JUNGLE_FENCE_GATE: \ + case E_BLOCK_SPRUCE_FENCE_GATE: \ + case E_BLOCK_TRAPDOOR: return SmallGateHandler::Callback; \ + case E_BLOCK_REDSTONE_LAMP_OFF: \ + case E_BLOCK_REDSTONE_LAMP_ON: return RedstoneLampHandler::Callback; \ + case E_BLOCK_REDSTONE_REPEATER_OFF: \ + case E_BLOCK_REDSTONE_REPEATER_ON: return RedstoneRepeaterHandler::Callback; \ + case E_BLOCK_REDSTONE_TORCH_OFF: \ + case E_BLOCK_REDSTONE_TORCH_ON: return RedstoneTorchHandler::Callback; \ + case E_BLOCK_OBSERVER: return ObserverHandler::Callback; \ + case E_BLOCK_PISTON: \ + case E_BLOCK_STICKY_PISTON: return PistonHandler::Callback; \ + case E_BLOCK_DAYLIGHT_SENSOR: \ + case E_BLOCK_INVERTED_DAYLIGHT_SENSOR: return DaylightSensorHandler::Callback; \ + case E_BLOCK_LEVER: \ + case E_BLOCK_STONE_BUTTON: \ + case E_BLOCK_WOODEN_BUTTON: return RedstoneToggleHandler::Callback; \ + case E_BLOCK_BLOCK_OF_REDSTONE: return RedstoneBlockHandler::Callback; \ + case E_BLOCK_COMMAND_BLOCK: return CommandBlockHandler::Callback; \ + case E_BLOCK_HOPPER: return HopperHandler::Callback; \ + case E_BLOCK_NOTE_BLOCK: return NoteBlockHandler::Callback; \ + case E_BLOCK_REDSTONE_WIRE: return RedstoneWireHandler::Callback; \ + case E_BLOCK_TNT: return TNTHandler::Callback; \ + case E_BLOCK_TRAPPED_CHEST: return TrappedChestHandler::Callback; \ + case E_BLOCK_TRIPWIRE_HOOK: return TripwireHookHandler::Callback; \ + default: \ + { \ + if (cBlockDoorHandler::IsDoorBlockType(BlockType)) \ + { \ + return DoorHandler::Callback; \ + } \ + } \ + } \ } while (false) |