Commit Graph
64 Commits
Author SHA1 Message Date
Tiger Wang 6c47f46c31 Ensure updating relatives calls the correct base case
* Fixed recursive base unintentionally scheduling the origin position for an update because it called the wrong function
2020-08-02 15:52:06 +01:00
Mattes DandTiger Wang 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 7d93742498 Clang Tidy fix 2020-07-26 16:06:57 +01:00
Tiger Wang 2e18e4f51c Comparators: use <= in comparison mode 2020-07-26 14:16:46 +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 3f712ca9cf Precompile unordered_map/set
+ Add inclusions to Globals.h
* Sort Globals.h
- Remove sys/stat.h from Globals.h
2020-07-19 19:58:53 +01:00
Tiger WangandGitHub 9e8598fb1c Upgrade to C++17 [CMake] (#4717)
* Make our CMake slightly less insane
2020-05-16 20:59:10 +01:00
Tiger Wang a9e06d33c5 Add some comments about terracing 2020-05-08 10:52:35 +01:00
Tiger Wang 6ac11925f1 Update RedstoneWireHandler style 2020-05-08 10:52:35 +01:00
peterbell10andGitHub c4ca11b372 Fix SetBlockMeta call in observer handler (#4728) 2020-05-08 09:46:03 +01:00
DrButcherandGitHub 258318ab98 Buttons can now be triggered by arrows. (#4670)
* Buttons can now be triggered by arrows.
2020-05-03 21:05:32 +01:00
5b92e6654f Update src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-05-03 11:51:11 +01:00
1c579f58aa Update src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-05-03 11:51:11 +01:00
Marc_BornandandTiger Wang 83193f132c Made some style update and add comments 2020-05-03 11:51:11 +01:00
Marc_BornandandTiger Wang 055c9ef90e Fix the connexion to the side of the repeater 2020-05-03 11:51:11 +01:00
Mattes DandGitHub 487f9a2aa9 Vector3 in Handlers (#4680)
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-21 22:19:22 +02:00
Tiger Wang c1ea5f982d Re-implement repeater locking 2020-04-18 16:51:29 +01:00
DrButcherandGitHub 3591be50b2 Fixing washing away of redstone mechanisms (#4665) 2020-04-17 21:01:21 +01:00
Tiger WangandGitHub ede56a5750 ಠ_ಠ (#4660)
+ Provisional handling for observers
2020-04-16 22:27:04 +01:00
Mattes DandAlexander Harkness 9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
DrButcherandGitHub 35299b8509 Pressure plate sounds and delay (#4643)
+ Added sounds on depress and release
+ Added correct delay times
2020-04-13 23:23:43 +01:00
peterbell10andGitHub 19ad96561c Filter blocks to add to redstone sim's wake queue (#4621) 2020-04-05 19:20:52 +00:00
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
MatandGitHub c968f1f7da TNT position fixes (#4519)
* TNT position fixes

* Don't add offset to explosion spawn coords

* Don't make other entities push TNT

* Correct initial TNT speed

* Fix typo

* Improvements

* Revert unwanted change

* Style fixes

* Update format
2020-03-22 17:33:36 +02:00
Bond-009andpeterbell10 e0ca4d8399 Fix building with clang 8.0 (#4346) 2019-08-11 10:39:43 +01:00
peterbell10andGitHub 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
peterbell10andGitHub cdd8e42587 cWorld: Manually bind deprecated broadcast functions (#4265)
Ref: https://github.com/cuberite/cuberite/pull/4264#discussion_r204769193
2018-07-27 00:12:41 +01:00
peterbell10andGitHub 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
Tiger Wang b8ab03bc6b At long last... Piston animations!
* Fixes #3198
* Fixes #57 (again lol)
2018-07-25 15:29:53 +01:00
peterbell10andGitHub 757231cc6e Add the fmt library (#4065)
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
2018-01-03 17:41:16 +00:00
peterbell10andAlexander Harkness 4b14a5b4c1 cPressurePlateHandler: Fix uninitialised variables. (#4047) 2017-09-25 21:41:11 +01:00
Lane Kolblyandpeterbell10 30c8470a52 Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)
* Made BroadcastSoundEffect take vector parameters.

* Added docs for new vectored methods

* Removed old code

* Fixed lua warnings

* Made old BroadcastSoundEffect not an override.

* m_Block to m_BlockPos, used Vector3d constructor where prettier.

* a_Block to a_BlockPos

* Changed thunderbolt a_Block to a_BlockPos
2017-09-19 15:12:54 +01:00
Lukas PiochandMattes D c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02:00
peterbell10andMattes D e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
Bond-009andMattes D 104f9e127b Changed some int parameters to vector parameters (#3937) 2017-09-07 10:25:34 +02:00
LogicParrotandAlexander Harkness 49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
peterbell10andMattes D 496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02:00
Lane KolblyandMattes D 7bdbfad1bb Changed int parameters to vector parameters in cCuboid and simulators (#3874) 2017-08-17 15:48:38 +02:00
Lukas Piochandworktycho 07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
peterbell10andLukas Pioch 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
peterbell10andLukas Pioch 60dfaa0967 Allocate redstone component handlers upfront 2017-07-17 21:40:43 +02:00
Lukas Pioch e35ac1bfb9 Clang 5.0 fixes
- Added override keyword
- Removed inherited member variables
2017-05-21 12:19:06 +02:00
Bond-009andworktycho 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
mathiascodeandMattes D dae2adde65 Updated sounds and effect IDs (#3422) 2017-02-15 06:05:24 +01:00
Marvin Kopf d394042694 Fix comparator segfaults
The handler would get called for any BlockEntity, but not every BlockEntity is a BlockEntityWithItems. Downcasting with static_cast is UB on fail.
2016-12-06 19:40:00 +01:00
Tiger WangandGitHub d46f7ce2c8 Redstone fixes (#3285)
* Comparators and pistons no longer update instantly
* Fixes #3168.
* Consolidated comparator code
* As a result, fixed an issue where GetPowerLevel didn't consider block
entities behind it (only GetFrontPowerLevel did)
2016-07-31 21:54:35 +01:00
Mattes DandGitHub a3112cdc45 Revert "Redstone fixes" 2016-07-29 07:56:50 +02:00
Tiger Wang 62090e7bed Consolidated comparator code
* As a result, fixed an issue where GetPowerLevel didn't consider block
entities behind it (only GetFrontPowerLevel did)
2016-07-28 23:20:53 +01:00