1
0
Fork 0
Commit Graph

24 Commits

Author SHA1 Message Date
Tiger Wang 3143d6ce67 Remove std::make_unique from redstone handler creation 2020-08-21 00:50:09 +01:00
Tiger Wang 40eba5244d Remove the redstone solid block handler
- Remove cSolidBlockHandler
* Functionality now integrated into simulator dispatcher
* Fix door double open/close issues, arisen due to the top/bottom halves getting different power
+ Small migration to block states for redstone wire
2020-08-08 18:22:16 +01:00
Tiger Wang adb86a75da Do not GetBlock individually in simulators
* Have the simulator manager get the block and pass it on
+ Add new overload for WakeUp, called when the manager wakes face positions
2020-08-04 18:15:18 +01:00
Tiger Wang 225c2fa9f6 Always use relative coordinates in AddBlock
+ Pass block, use relatives
* Fixes everything immediately converting abs back to rel and getting block, when these data were already available
2020-08-02 15:52:06 +01:00
Tiger Wang 99856df686 Add WakeUp/AddBlock distinction
* WakeUp is for singular changes (block breaking for example). The simulator should check blocks around the position and discover other affected blocks as it sees fit
* AddBlock is for when you know a whole area is to be updated; chunk loading, or area wakeups for example
+ Prepares for correct handling of destroyed blocks after removal of SolidBlockHandler in the redstone simulator
2020-08-02 15:52:06 +01:00
Mattes D 46398f4671 Replaced cpp14::make_unique<> with std::make_unique<>. 2020-08-01 20:04:31 +01:00
Tiger Wang 1673c84978 Remove redundant ErasePowerData call
* Also fix a return that should've been continue
2020-07-26 16:08:20 +01:00
Tiger Wang 4e5ab02a58 Use SimulateChunk in redstone simulator
+ Improved performance, reduces bottleneck in chunkmap lookup
* Stop allocating and throwing away lots of small vectors in Update/GetValidSourcePositions return values
- Remove unused GetPowerLevel virtual
2020-07-26 14:16:46 +01:00
Tiger Wang bc01cd5e75 Redstone: check validity of GetBlock 2020-07-24 09:11:40 +01:00
Tiger Wang ede56a5750
ಠ_ಠ (#4660)
+ Provisional handling for observers
2020-04-16 22:27:04 +01:00
peterbell10 19ad96561c
Filter blocks to add to redstone sim's wake queue (#4621) 2020-04-05 19:20:52 +00:00
Bond-009 ea386eaab1
Lock hopper when powered by redstone (#4347)
* Lock hopper when powered by redstone

* Add to manual bindings

* Add hopper API documentation

Co-authored-by: Mat <mail@mathias.is>
2020-03-27 12:03:28 +00:00
peterbell10 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +01:00
peterbell10 950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
peterbell10 60dfaa0967 Allocate redstone component handlers upfront 2017-07-17 21:40:43 +02:00
Bond-009 2a129b01aa Fix fence gates (#3683)
This commit fixes an issue where a pressureplate would only open oak fence gates
2017-04-29 00:15:47 +01:00
Lukas Pioch 2b78fd6227 Revert "Made redstone handlers static" 2016-07-01 23:23:22 +02:00
QUSpilPrgm 33cd7f4e75 - Add a activation flag to droppers and dispensers. Previously droppers and dispensers shot items with every block update.
- Fixes a range check inside cIncrementalRedstoneSimulator::Simulate
2016-06-15 10:33:49 +02:00
QUSpilPrgm a567b36a8a Don't let redstone blocks power adjacent blocks. (#3214)
* Don't let redstone blocks power adjacent blocks.
This fixes issue #2966
2016-05-28 21:48:36 +01:00
Tiger Wang 98cc2a9987 Made redstone handlers static
* Improvements to performance? Maybe. Can't hurt (he says).
2016-05-28 15:06:57 +01:00
Marvin Kopf af514acd8c Update RedstoneSimulator to delete unused cached PowerData
When a new block was placed that has a corresponding RedstoneHandler the PowerData for the position was cached, but never deleted and remained unchanged when the block got destroyed. The RedstoneSimulator now erases all cached PowerData for positions where the block doesn't have a RedstoneHandler (i.e. Air).
2016-02-09 22:19:29 +01:00
Mattes D 78eb4c8ed8 Removed excessive logging in redstone simulator. 2015-12-28 11:06:41 +01:00
Lukas Pioch 50a908fdc9 Fixes for clang-3.7 2015-12-19 22:43:37 +01:00
Tiger Wang 5b62c4c314 Reorganised the redstone simulator
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan!
* Uses classes and inheritance now
* Speed should be improved
2015-12-18 13:17:38 +00:00