summaryrefslogtreecommitdiffstats
path: root/src/Simulator (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-03-15Remove DoesDropOnUnsuitableTiger Wang1-4/+1
This is only overridden false in Vines and Snow. It is called when a CanBeAt check fails, to determine whether DropBlockAsPickups is called. However, Vines and Snow already drop nothing without the right tool, so this function is superfluous.
2021-03-15Properly deprecate more XYZ parameter'd functions (#5147)Tiger Wang2-4/+4
* Fixes #5144
2021-03-07Some emplace_back replacements (#5149)12xx123-3/+3
* replace push_back with emplace_back when a new object was created in the function call
2021-03-05Prepare ChunkData for BlockState storage (#5105)Tiger Wang1-0/+1
* Rename ChunkData Creatable test * Add missing Y-check in RedstoneWireHandler * Remove ChunkDef.h dependency in Scoreboard * Prepare ChunkData for BlockState storage + Split chunk block, meta, block & sky light storage + Load the height map from disk - Reduce duplicated code in ChunkData - Remove saving MCSBiomes, there aren't any - Remove the allocation pool, ref #4315, #3864 * fixed build * fixed test * fixed the debug compile Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2021-02-11Clang 7?Tiger Wang1-10/+0
2021-01-22Redstone: inline -> staticTiger Wang21-89/+89
2021-01-18cChunk: don't inherit from cChunkDef (#5106)Tiger Wang1-2/+2
2021-01-11Convert most calls to blocking GetHeight/GetBiomeAt to direct chunk accessesTiger Wang1-5/+8
* Hopefully fixes #5094
2020-12-26Daylight Sensor: remove redundant delayTiger Wang1-3/+0
Daylight Sensors are already always ticked.
2020-12-21Prepare for 1.15+ (#4856)Tiger Wang2-7/+8
+ Add type-safe container for states * Split registry Blocks into BlockTypes, BlockStates so the block types enumeration can be #included without too much penalty * Ensure Registry uses type-safe container
2020-12-19New pull request for daylight sensor (#5066)Aiden Neill5-53/+127
* Fixes #4918 Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-12-18Warnings improvementsTiger Wang1-4/+5
* Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality * Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already * Reduced GetStackValue verbosity + Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness + Give SettingsRepositoryInterface a move constructor to simplify main.cpp code - Remove do {} while (false) construction in redstone handler
2020-10-05Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)peterbell1012-74/+89
* Fix cmake not adding Werror on clang, and _lots_ of warnings * WIP: Build fixes * Cannot make intermediate blockhandler instance * Tiger's changes * Fix BitIndex check * Handle invalid NextState values in cMultiVersionProtocol Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-29Doors: check power & toggle correctlyTiger Wang1-20/+55
* Fixed upper half ignoring its updates * Fixes #4945 * Fixed doors playing sound effects when they didn't actually toggle
2020-09-25Deleted BiomeDef.h and ChunkDef.h from Globals.h (#4885)KingCol131-0/+2
* Removed BiomeDef.h * Removed ChunkDef.h from Globals.h * Added to CONTRIBUTORS. * Re-added empty last line to Globals.h * Included stddef and StringUtils in BiomeDef.h * Fixed build tools compiling. It compiles, but at what cost? * Added include to src/Generating/Trees.h * Include added in ChunkGeneratorThread.h * Moved rearranged includes in LineBlockTracer.cpp * Re-arrange headers in ChunkInterface.cpp * Included ChunkDef.h in Path.h * Included ChunkDef.h in NBTChunkSerializer.h * Rearranged included and added required includes to headers. * Removed unnecessary included in StringUtils.h.
2020-09-21Implement redstone quasi-connectivity (#4889)Tiger Wang5-28/+76
2020-09-20BlockHandler initialisation is a constant expression (#4891)Tiger Wang1-2/+1
* BlockHandler initialisation is a constant expression If we can't make it all namespaces, this is the next best I guess. + Tag handlers constexpr, const as needed + Inherit constructors * Privatise handler functions * More constexpr Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-12Use tracing for explosions (#4845)Tiger Wang3-27/+26
* TNT: Implement tracing algorithm + Add intensity tracing * Fix iterating over all players to SendExplosion, even those not in range * Implemented TNT entity interaction * Fixed misaligned destruction tracing * Finalise TNT algorithm - Remove BlockArea and just use chunks Using SetBlock makes it so that we can update everything properly, and does appear to be faster. * BlockInfo learns about explosion attentuation * Rename Explodinator parameters * TNT: pull block destruction into common function Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-08-28Minor style fixesTiger Wang2-0/+12
2020-08-28ChunkMap: do not wantonly make empty chunksTiger Wang1-7/+0
- Removed calls that constructed an empty chunk, found it was invalid, and did nothing with said chunk Partially addresses #2324
2020-08-25Fix doors and trapdoors closing on server restartPeter Bell2-2/+6
2020-08-21Replace PowerData struct with PowerLevelTiger Wang25-189/+171
* We no longer need to track the powering block with the removal of SolidBlockHandler. PowerLevel is now just an unsigned char
2020-08-21Remove std::make_unique from redstone handler creationTiger Wang28-545/+494
2020-08-08Remove the redstone solid block handlerTiger Wang31-534/+725
- 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-05WakeUpSimulators correct Y computationTiger Wang1-1/+5
+ Add Y validity check to SimulatorManager
2020-08-04Corrected wakeup sequencesTiger Wang2-2/+2
* Pistons/Ice no longer need to FastSetBlock first (#4600), and the former don't drop items when broken in creative - Begin migration away from stationary fluids * Tick the chunk after applying a client's changed * Broadcast pending blocks at the end of a tick
2020-08-04Do not GetBlock individually in simulatorsTiger Wang7-75/+93
* 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-02Always use relative coordinates in AddBlockTiger Wang15-147/+83
+ Pass block, use relatives * Fixes everything immediately converting abs back to rel and getting block, when these data were already available
2020-08-02Add WakeUp/AddBlock distinctionTiger Wang17-117/+138
* 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-02Ensure updating relatives calls the correct base caseTiger Wang9-14/+15
* Fixed recursive base unintentionally scheduling the origin position for an update because it called the wrong function
2020-08-01Replaced cpp14::make_unique<> with std::make_unique<>.Mattes D1-22/+22
2020-07-26Remove redundant ErasePowerData callTiger Wang1-7/+5
* Also fix a return that should've been continue
2020-07-26Clang Tidy fixTiger Wang1-11/+11
2020-07-26Comparators: use <= in comparison modeTiger Wang1-1/+1
2020-07-26Use SimulateChunk in redstone simulatorTiger Wang26-816/+759
+ 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-25Reduce unnecessary wakeupsTiger Wang1-12/+0
- cSimulator no longer wakes up positions already woken by cChunk::SetBlock
2020-07-24Redstone: check validity of GetBlockTiger Wang1-1/+5
2020-07-19Precompile unordered_map/setTiger Wang1-1/+0
+ Add inclusions to Globals.h * Sort Globals.h - Remove sys/stat.h from Globals.h
2020-05-31Fire sim: Handle fuel block being destroyed (#4751)peterbell101-9/+25
2020-05-16Upgrade to C++17 [CMake] (#4717)Tiger Wang2-17/+4
* Make our CMake slightly less insane
2020-05-10Cleanup some workarounds and warnings (#4735)peterbell101-12/+3
* Cleanup thread_local usage in FastRandom * Use constexpr to avoid clang warning * Fix more Wglobal-constructor warnings * Make MSVC happy?
2020-05-09Enable C++17 in buildPeter Bell1-1/+1
2020-05-09Update submodules (#4727)peterbell101-1/+1
Closes #4708 This updates jsoncpp, mbedtls, TCLAP and SQLiteCpp to their latest stable release. A few additional changes were needed: * jsoncpp deprecated Reader, FastWriter and StyledWriter which I've replaced with some helper functions in JsonUtils.cpp * SQLiteCpp changed how it builds with external sqlite libraries, now expecting them to be installed. The simplest path was to remove sqlite from cuberite's submodule and just use SQLiteCpp's internal version.
2020-05-08Add some comments about terracingTiger Wang1-17/+43
2020-05-08Update RedstoneWireHandler styleTiger Wang1-11/+9
2020-05-08Fix SetBlockMeta call in observer handler (#4728)peterbell101-2/+2
2020-05-03Buttons can now be triggered by arrows. (#4670)DrButcher1-3/+3
* Buttons can now be triggered by arrows.
2020-05-03Update src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.hmBornand1-8/+1
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-05-03Update src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.hmBornand1-8/+1
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-05-03Made some style update and add commentsMarc_Bornand1-4/+9
2020-05-03Fix the connexion to the side of the repeaterMarc_Bornand1-3/+25
2020-04-21Vector3 in Handlers (#4680)Mattes D1-1/+13
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-18Re-implement repeater lockingTiger Wang1-5/+85
2020-04-17Fixing washing away of redstone mechanisms (#4665)DrButcher1-0/+1
2020-04-16ಠ_ಠ (#4660)Tiger Wang4-0/+112
+ Provisional handling for observers
2020-04-16Using Super.Mattes D32-68/+123
2020-04-14Pressure plate sounds and delay (#4643)DrButcher1-7/+141
+ Added sounds on depress and release + Added correct delay times
2020-04-09Falling blocks can now be spawned at any position. (#4620)Mattes D1-6/+1
* Falling blocks can now be spawned at any position. * Added a /cake command to Debuggers that throws a cake in a nice slow arc. * Fixed regular falling blocks.
2020-04-05Filter blocks to add to redstone sim's wake queue (#4621)peterbell102-6/+62
2020-04-05Add potatoes to washed away list alsoAlexander Harkness1-1/+2
2020-04-05FluidSimulator: Carrots should be also washable (#4619)metiu071-0/+1
2020-04-03Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D6-1/+7
The BlockID.h file was removed from Globals.h and renamed to BlockType.h (main change) The BlockInfo.h file was removed from Globals.h (main change) The ENUM_BLOCK_ID and ENUM_ITEM_ID enum names were replaced with ENUM_BLOCK_TYPE and ENUM_ITEM_TYPE (cosmetics) The various enums, such as eDimension, eDamageType and eExplosionSource were moved from BlockType.h to Defines.h, together with the helper functions for converting between them and strings (StringToDimension et al.) (minor) Many inline functions were moved from headers to their respective cpp files, so that BlockType.h could be included only into the cpp file, rather than the header. That broke our tests a bit, since they pick bits and pieces out of the main code and provide stubs for the rest; they had to be re-stubbed and re-verified. eMonsterType values are no longer tied to E_ITEM_SPAWN_EGG_META_* values
2020-03-27 Lock hopper when powered by redstone (#4347)Bond-0093-0/+65
* Lock hopper when powered by redstone * Add to manual bindings * Add hopper API documentation Co-authored-by: Mat <mail@mathias.is>
2020-03-22TNT position fixes (#4519)Mat2-3/+2
* 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
2019-10-28Moved growing from cWorld / cChunk to cBlockHandler descendants.Mattes D4-97/+80
2019-10-16Refactored block-to-pickup conversion. (#4417)Mattes D4-34/+23
2019-08-11Fix building with clang 8.0 (#4346)Bond-0092-2/+2
2018-09-24Add a formatting function for Vector3 (#4282)peterbell103-41/+36
* Vector3: Add custom fmt compatible formatter. * cLuaState: Add fmt version of ApiParamError * Use vector formatting in manual bindings * Always log vectors with FLOG
2018-08-29Force all headers other than "Globals.h" to be included with relative paths (#4269)peterbell1017-22/+16
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-07-27Add new flow direction calculating algorithm (#4160)bionext032-75/+36
2018-07-27cWorld: Manually bind deprecated broadcast functions (#4265)peterbell102-2/+2
Ref: https://github.com/cuberite/cuberite/pull/4264#discussion_r204769193
2018-07-26CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell103-2/+1
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-25At long last... Piston animations!Tiger Wang2-27/+12
* Fixes #3198 * Fixes #57 (again lol)
2018-07-24Broadcast refactor (#4264)peterbell102-8/+6
* Move Broadcast functions from cChunkMap to cBroadcaster - Remove cBroadcastInterface in favour of cBroadcaster. - cChunk: Remove broadcast functions. * resurect broadcast interface * Absorb cBroadcaster into cWorld. Removes the need for forwarding the function calls. * Improve const-correctness * Use Int8 instead of char + Comment `ForClients` functions * Improve comments * Broadcaster: Rename ForClients functions
2018-01-03Add the fmt library (#4065)peterbell104-26/+29
* 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-03Concrete mixing (#4096)Zach DeCook1-0/+5
Adds a block handler for concrete powder and implements hardening to concrete. Concrete powder turns into concrete when: * It is next to water when it receives a block update * It falls onto a water block (even with Physics SandInstantFall=1)
2017-12-26improve rain simulation (#4017)Alexander Harkness2-23/+45
* Uses vanilla logic to decide which blocks rain falls through. * Rain falls infinitely above the world, and stops at y=0. * Entities will now be extinguished if they are under rain-blocking blocks, and fire will now be extinguished by rain similarly. * Create IsWeatherWetAtXYZ to identify wetness at a particular location. * Use new code for enderman rain detection. * Fixes issue #916 * Disable warnings for global constructors in the fire simulator.
2017-09-25cPressurePlateHandler: Fix uninitialised variables. (#4047)peterbell101-2/+2
2017-09-19Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)Lane Kolbly3-10/+8
* 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-19Removed UTF-8 BOM (#4033)Lukas Pioch1-1/+1
2017-09-11Replace ItemCallbacks with lambdas (#3993)peterbell107-116/+36
2017-09-07Changed some int parameters to vector parameters (#3937)Bond-00921-93/+93
2017-09-02Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot7-36/+116
This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
2017-09-01Replace ItemCallbacks with lambdas (#3948)peterbell107-116/+36
2017-08-17Changed int parameters to vector parameters in cCuboid and simulators (#3874)Lane Kolbly17-64/+59
2017-08-07Changed entity ownership model to use smart pointersTiger Wang1-4/+4
2017-08-06Removed unneeded includes (#3902)Lukas Pioch3-4/+0
2017-08-03Remove double includes part 2 (#3890)peterbell106-6/+0
2017-08-03Removed unused forward declarations (#3888)Lukas Pioch3-15/+0
2017-07-21Increment fire block iteratorTiger Wang1-0/+1
* Resolves potential deadlock
2017-07-17Allocate redstone component handlers upfrontpeterbell1022-299/+264
2017-07-16Simulators: Added area-based wakeup.Mattes D4-3/+87
2017-06-30Added 1.12 blocks (#3760)Bond-0091-3/+7
2017-06-13FastRandom rewrite (#3754)peterbell101-3/+3
2017-05-21Clang 5.0 fixesLukas Pioch2-2/+2
- Added override keyword - Removed inherited member variables
2017-05-08Added missing checks for Initialize function and updated APIDocLukas Pioch1-1/+6
2017-04-29Fix fence gates (#3683)Bond-0091-0/+5
This commit fixes an issue where a pressureplate would only open oak fence gates
2017-03-21Added blocks that can be washed away by water (#3637)Bond-0091-0/+10
2017-02-15Updated sounds and effect IDs (#3422)mathiascode4-5/+5
2017-02-14Added some blocks and items (#3503)mathiascode2-0/+10
2016-12-06Fix comparator segfaultsMarvin Kopf1-1/+8
The handler would get called for any BlockEntity, but not every BlockEntity is a BlockEntityWithItems. Downcasting with static_cast is UB on fail.
2016-08-24Fixed type-casting-related warnings.Mattes D2-13/+10
2016-07-31Redstone fixes (#3285)Tiger Wang2-52/+86
* 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-29Revert "Redstone fixes"Mattes D2-86/+52
2016-07-29Consolidated comparator codeTiger Wang1-46/+37
* As a result, fixed an issue where GetPowerLevel didn't consider block entities behind it (only GetFrontPowerLevel did)
2016-07-29Comparators and pistons no longer update instantlyTiger Wang2-12/+55
* Fixes #3168.
2016-07-18CMake: Remove needless minimum version specifications.Mattes D2-3/+0
2016-07-01Revert "Made redstone handlers static"Lukas Pioch2-93/+31
2016-06-15- Add a activation flag to droppers and dispensers. Previously droppers and dispensers shot items with every block update.QUSpilPrgm2-5/+28
- Fixes a range check inside cIncrementalRedstoneSimulator::Simulate
2016-05-28Don't let redstone blocks power adjacent blocks. (#3214)QUSpilPrgm2-3/+2
* Don't let redstone blocks power adjacent blocks. This fixes issue #2966
2016-05-28Made redstone handlers staticTiger Wang2-31/+93
* Improvements to performance? Maybe. Can't hurt (he says).
2016-02-09Update RedstoneSimulator to delete unused cached PowerDataMarvin Kopf2-1/+10
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-05Bulk clearing of whitespaceLogicParrot18-83/+83
2016-01-31Updated old forum linksMathias2-2/+2
2016-01-11Fixed issue #2218Austin Martin1-3/+5
2016-01-01Renamed leftover strings to Cuberite / Server, as needed.Mattes D2-2/+2
Also upgraded the user setting file for MSVC to 2013.
2015-12-28Removed excessive logging in redstone simulator.Mattes D1-7/+0
2015-12-24Silenced the Redstone Simulator console spamSafwat Halaby17-20/+20
2015-12-24PF - "Special blocks" handlingSafwat Halaby4-4/+4
2015-12-19Fixes for clang-3.7Lukas Pioch4-6/+6
2015-12-18Reorganised the redstone simulatorTiger Wang29-2729/+2213
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan! * Uses classes and inheritance now * Speed should be improved
2015-12-17Moved variables into scope, removed unused variables and fixed variablesLukas Pioch1-1/+1
2015-11-24Add enum for Sound and Particle EffectsDave Tucker2-5/+6
Fixes #2603 Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-11-08add sound to stone pressure platesGargaj1-0/+9
add sound to stone pressure plates
2015-11-07Refactored code to use vectors in the cPistonHandler classbibo381-2/+2
2015-11-07fix pressure plate power levelsGargaj1-4/+4
2015-11-07fix pressure plate power levelsGargaj1-4/+4
2015-10-29Revert "Pressure plate fix"Mattes D1-45/+14
2015-10-28fixed pressure plate bugsSchwertspize1-14/+45
2015-07-31Unified the doxy-comment format.Mattes D6-40/+46
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney4-22/+22
2015-07-17Fixed redstone issuescribblemaniac1-2/+4
Fixed issue where glowstone blocks would block power transmission in some situations.
2015-07-15Now Water sources will also be created on top of existing water sources.bibo381-3/+6
See also on http://minecraft.gamepedia.com/Water#Source_blocks Fixes #2097
2015-07-14Improved mapsTiger Wang3-10/+10
2015-06-07Added moar commentsTiger Wang2-13/+13
2015-06-07Vector hasher is now a separate classTiger Wang1-5/+7
2015-06-06Use emplace to construct structuresTiger Wang2-54/+61
2015-06-06Improved link unpowering speedTiger Wang1-48/+41
Also fixed compile errors
2015-06-06Changed appropriate containers to unordered_mapTiger Wang2-158/+85
Thanks to @worktycho for guidance! * Potential speed improvements
2015-06-06Improved link power behaviourTiger Wang2-163/+119
2015-06-06Improved wires and repeatersTiger Wang2-73/+152
* Fixed repeater cross-chunk power detection + Re-implemented horizontal wire cut-off checking
2015-06-06Fixed wire consuming much resourcesTiger Wang1-7/+17
2015-06-06Redstone wire and trapdoor fixesTiger Wang2-310/+309
* Fixes #1887 * Fixes #1763 * Fixes #1083
2015-06-06Provides improvements to redstone wireTiger Wang2-94/+70
Intermediary commit that fixes #1763.
2015-06-06ComparatorsTiger Wang2-78/+180
2015-05-28Fix commentstycho4-9/+16
2015-05-24Made -Weverything an error.tycho5-10/+29
2015-05-19Make -Werror disabling file onlytycho2-1/+8
Ad fix a load of warnings
2015-05-09More style checking.Mattes D2-6/+6
Spaces around some operators are checked.
2015-03-20Correct world height validations.Tommy Santerre2-3/+3
Unify the way we test block above the current one (Height - 1 instead of a_RelY + 1). Allow generation of world of flat height = 255
2015-03-19Removed wrong else clause, which caused that the following if-Statement got only executed in rare cases. This has blocked the creation of new Fluid-Sources. Bugfix #1783bibo381-1/+2
2015-01-18Fixed type conversion warnings.Mattes D1-1/+1
2015-01-11Initial convertion of a_Dt to std::chronoTycho12-13/+13
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2014-12-25Fixed basic style.Mattes D2-21/+69
2014-12-18Fix repeater unpoweringTiger Wang1-2/+4
2014-12-17Removed unneeded newlinesIvan Đorđević1-6/+0
2014-12-17NULL -> nullptrTiger Wang2-14/+18
2014-12-16Fixed water from spreading on bottom of worldgushromp1-7/+11
2014-12-16Fixed water from spreading on bottom of worldgushromp1-5/+8
2014-12-05BasicStyle: Added missing braces to control statements.Mattes D1-0/+2
2014-12-05Fixed reported parentheses around comparisons.Mattes D1-1/+3
2014-10-29Improved redstone simulatorTiger Wang2-818/+808
* Fixed style inconsistencies * Used more C++11 features * Improved speed perhaps
2014-10-25Cleaned up simulatorsTiger Wang13-2671/+2634
2014-10-23Merged IniFile into main MCS sources.Mattes D1-1/+1
2014-10-23Fixed a crash in redstone simulator.Mattes D1-1/+0
2014-10-23En masse NULL -> nullptr replaceTiger Wang8-11/+11
2014-10-20En masse NULL -> nullptr replaceTiger Wang8-11/+11
2014-10-15Functions in cPluginManager get references instead of pointers.Mattes D1-2/+2
2014-09-30Fixed iron trapdoorsHowaner1-0/+1
2014-09-28Use factory method to construct redstone simulator dataTycho3-0/+12
2014-09-27Fixed another redstone crash.madmaxoft1-1/+6
2014-09-27Wrapped clang-specific pragma into an #ifdef block.madmaxoft1-1/+6
MSVC was complaining about an unknown pragma.
2014-09-27Update IncrementalRedstoneSimulator.incworktycho1-1/+1
2014-09-27Update IncrementalRedstoneSimulator.incworktycho1-1/+1
2014-09-27Correct method name.worktycho1-1/+1
2014-09-27Set chunk dataworktycho1-0/+5
2014-09-26Re-added 1.8 blocks to the redstone simulatorMasy981-9/+46
2014-09-26Removed more unessicary includesTycho1-0/+1
2014-09-26Fixed issue with castingtycho1-1/+3
2014-09-25Redstone: Fixed a crash with repeaters on a chunk border.madmaxoft1-13/+22
2014-09-17Added first test to show the object can be createdTycho6-30/+40
2014-09-16IncrementalRedstoneSimulator now has no dependencies on cChunkTycho4-364/+382
2014-09-11Don't include IncrementalRedsonteSimulator.inc when in SELF_TEST modeTycho1-5/+0
2014-09-11Possibly decoupled IncrementalRedstoneSimulator from the rest of the serverTycho15-2318/+2324
THis wil hopefully allow for unit testing
2014-09-11Added blocks to the fire simulatorMasy981-0/+11
2014-09-10Added iron trapdoor, fence gates and doors to the redstone simulatorMasy981-0/+11
2014-08-29VanillaFluidSimulator: Fixed an invalid Y-coord query.Mattes D1-1/+1
This was causing a spam of console messages, along with possible server crash, when liquids passed below the world: http://forum.mc-server.org/showthread.php?tid=1508&pid=15632#pid15632
2014-08-05Removed dependecy of redstone simulator on NoteBlockTycho1-11/+6
2014-08-05Refactored Redstone simulator not to depend on TNTEntity or DropSpenserENtity DirectlyTycho1-5/+4
2014-08-04CheckBasicStyle: multi-level indent change.madmaxoft1-3/+3
2014-08-01Added missing HOOK_BLOCK_SPREAD call.Howaner1-6/+14
2014-07-24Removed redundant semicolons and re-added warningarchshift1-1/+1
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft2-4/+4
2014-07-21Style: Normalized spaces after if, for and while.madmaxoft2-4/+4
2014-07-19Fixed style: spaces after commas.madmaxoft2-6/+6
2014-07-19Subdirs: Only add_library if not using MSVCarchshift1-1/+3
2014-07-19Simulator/CMakeLists.txt: Replaced glob with list of filesarchshift1-5/+28
2014-07-18Fixed spaces before commas.madmaxoft1-2/+2
2014-07-17Fixed tabs used for alignment.madmaxoft4-4/+4
2014-07-17More trailing whitespace fixes.madmaxoft1-4/+4
2014-07-17Basic style fixes.madmaxoft10-21/+21
2014-07-17Normalized comments.madmaxoft6-84/+84
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-16Fixed another redstone simulator crashTiger Wang1-0/+7
2014-07-15Fixed redstone simulator crashTiger Wang2-8/+31
* Fixes #1176 * Fixed #1186
2014-07-13Changed BroadcastSoundEffect function to take floating pos.Howaner3-10/+10
2014-07-12Suggestions and bug fixTiger Wang1-1/+1
* Fixed hoppers pushing/pulling to/from (trapped)chests that do not form a double-chest with the chest type directly connected to said hopper; thank you, @madmaxoft
2014-07-11SuggestionsTiger Wang1-0/+3
2014-07-11SuggestionsTiger Wang1-1/+4
2014-07-11Improved LinkedPowering speedTiger Wang1-15/+15
* Additionally fixed wires powering other wires through blocks
2014-07-07Fixed compilation and pressure platesTiger Wang1-8/+4
2014-07-07Implemented trapped chests & othersTiger Wang2-83/+150
+ Added trapped chests * Fixed a bunch of bugs in the redstone simulator concerning wires and repeaters * Other potential bugfixes
2014-07-04Fixed c1deda5d8f01811efa5094e9375166acb69d50edTiger Wang1-2/+2
I keep on breaking stuff :P
2014-06-28Implemented tripwire(s) (hooks)Tiger Wang2-15/+156
* Fixes #944
2014-06-28Fixed bad water/redstone simulator communicationTiger Wang1-32/+22
* Fixes #713
2014-06-22Changed 0xFFFFFFFB to ~0x04Howaner1-1/+1
2014-06-22Fixed another daylight sensor bugTiger Wang1-20/+23
Additionally fixed unpowering across chunks.
2014-06-22Fixed missing breakworktycho1-0/+1
Fixes CID 68409
2014-06-22Fixed invalid iteratorworktycho1-2/+3
Fixes CID 60408
2014-06-19Nullify deleted pointers.archshift1-1/+3
2014-06-17Fix fence gate sound (Redstone simulator).Howaner1-4/+10
2014-06-17Fix fence gate redstone simulator.Howaner1-2/+1
2014-06-16FIxed second weird enumTycho1-20/+1
2014-06-16Refactored reversing logic into seperate functionTycho1-14/+3
2014-06-16Fixed tigers weird enumsTycho1-14/+6
2014-06-16Merge branch 'master' of github.com:mc-server/MCServerTycho1-8/+30
2014-06-16Moved repeater handling to seperate passTycho2-97/+64
2014-06-15Fixed bad comparison crashTiger Wang1-2/+2
* Fixes #1095
2014-06-15Fixed daylight sensor unpoweringTiger Wang1-6/+28
* Fixes #1094
2014-06-14Fixed a repeater issueTiger Wang2-17/+16
* Repeaters now properly continuously update their powering * Minor cosmetic improvements
2014-06-12Fixed two redstone bugsTiger Wang1-0/+6
* Fixed chunk border powering * Fixed quick place-replace powering
2014-06-08Fixed deadlock when moving players to other worlds.Mattes D1-1/+1
Fixes #1039, fixes #851
2014-06-07Further improvements on redstone speedTiger Wang2-67/+80
Based on suggestions of @worktycho * Repeaters now walk their data structure only when needed * Fixed a bug with cChunkData returning an incorrect value for whether a meta had changed
2014-06-06Further reduced redstone idle CPU consumptionTiger Wang1-7/+27
* Repeaters and wires are no longer unnecessarily ticked * Fixed #1063, likely addressed #1062 * Fixed bugs regarding duplicate values
2014-06-05Redstone fixes and improvements [SEE DESC]Tiger Wang1-60/+87
Haha, see desc. * Improved redstone speed through a marking dirty system. Only a select few devices are still continuously simulated * Fixed redstone crashing with recent piston changes
2014-06-04Update IncrementalRedstoneSimulator.cppJulian Laubstein1-8/+8
2014-05-29Add SetOpen() and IsOpen() to BlockDoor.h and fix door redstone bug.Howaner1-4/+10
2014-05-29Fixed piston power checkingTiger Wang1-11/+6
2014-05-25Hopefully fixed piston duplication issuesTiger Wang1-5/+4
* Fixes #879 * Fixes #714
2014-05-19Fixed warnings in IncrementalRedstoneSimulatorJulian Laubstein1-1/+7
2014-05-19Rolled some changes backJulian Laubstein1-12/+2
2014-05-19Fixed some warningsJulian Laubstein1-2/+12
2014-05-09Fixed MSVC 64-bit build warnings.Mattes D2-2/+2
2014-05-08Fixed MSVC 64-bit build warnings.Mattes D2-2/+2
2014-05-07Fixed wires powering wires diagonally below themTiger Wang1-5/+1
2014-05-05Add clicks, exp subtraction, item check, ...Howaner1-0/+4
2014-05-05Fixed formattingTiger Wang1-4/+5
2014-05-04Fixed 027efe09ea3d3222c3cbf169643e57773c1614aeTiger Wang1-3/+49
2014-05-04Fixed lever and button powering directionTiger Wang1-16/+8
2014-05-04Fixed pressure plate oversightsTiger Wang1-2/+8
* Fixed stone pressure plates not checking for the correct distance for players * Fixed pressure plates in general not link powering the blocks beneath them
2014-05-03Fixed vanilla fluid simulator.madmaxoft1-4/+1
Fixes #919.
2014-05-02Fixed vanilla fluid simulator.madmaxoft4-14/+20
Fixes #919.
2014-04-27Redstone simulator now directly accesses cChunkTiger Wang2-438/+556
* Redstone simulator performance improvements * Added return values to some functions * Minor fixes
2014-04-26Implemented Chunk Sparsing with segmentsTycho1-4/+6
2014-04-25Cmake generated projects for IDEs include headers in project files.archshift1-0/+1
2014-04-18Did some static analysis, fixed some bugs and optimized a lot of codejfhumann2-2/+2
2014-04-18Removed unsupported C++11 features.madmaxoft1-13/+19
2014-04-17Compile fix?Tiger Wang1-2/+2
2014-04-17Implemented weighted pressure platesTiger Wang2-29/+171
2014-04-15Rewrote redstone powering to use power levelsTiger Wang2-180/+149
2014-04-08cRedstoneSimulator.cpp style improvementsTiger Wang1-40/+41
2014-04-08Uppercased Zwiseoldman951-3/+3
Minor, no code changed.
2014-04-08Comments: Inverted Z axis.wiseoldman951-9/+10
-Comments fix, No code has been changed. -Inverted the Z axis in the comments and changed all dependent comments accordingly. -Added NORTH/SOUTH/EAST/WEST in addition to LEFT/RIGHT/UP/DOWN.
2014-04-08Added comments regarding latching and orientationwiseoldman951-9/+31
No real code was changed.
2014-04-08Fixed the thing properly.Alexander Harkness1-8/+8
2014-04-07Fixed IsOnwiseoldman951-3/+2
2014-04-07Removed stray IsLockedwiseoldman951-2/+2
2014-04-07Removed unneeded spacingswiseoldman951-6/+3
2014-04-07Slight cleanupwiseoldman951-13/+17
It is more efficient and readable if we do nothing unless we're not locked.
2014-04-07Fixed some more minor issues with the redstone simulator.Alexander Harkness1-34/+39
2014-04-07Improved the speed a little more.Alexander Harkness1-1/+1
2014-04-07Fixed the redstone simulator.Alexander Harkness1-49/+40
2014-04-07Fixed #859Tiger Wang1-23/+3
2014-04-07Fix some of the comments in the PR tycho just did.Alexander Harkness1-8/+6
2014-04-06Added support for redstone latchingTycho2-2/+65
fixes #856
2014-03-28Some fixes to lilypadsTiger Wang1-0/+1
* Fixed placement on lava * Fixed placement on side of blocks * Fixed placement through blocks + Added washing-away of pads + Added ice as a block that fully occupies its voxel
2014-03-28Fixed compilation after last PR merge.madmaxoft1-1/+1
2014-03-27Change SpreadSource prefix to ssHowaner1-1/+1
2014-03-27Add SpreadSourceHowaner1-1/+1
2014-03-27Add HOOK_BLOCK_SPREADHowaner1-3/+11
2014-03-16Fixed double to float conversions.madmaxoft1-1/+1
2014-03-11Unified Vector classesandrew2-2/+1
2014-03-10Fixed compileTiger Wang1-1/+2
2014-03-09Removed uneeded meta obtainTiger Wang1-3/+1
2014-03-09TNT explodes when consumed by fireTiger Wang1-6/+19
Fixed FS#406
2014-03-08Fixed issues with int vs size_t and a few other warningsTycho1-1/+1
2014-03-08Change TNT Fuse to ticksHowaner1-1/+1
2014-03-07Added some commentsandrew2-1/+6
2014-03-07Fixed water/lava interactionandrew3-4/+69
2014-03-05Added extra awesomeness to TNTTiger Wang1-1/+1
+ TNT now has a chance of flinging FallingBlock entities around * Improved TNT damage * Improved TNT spawning visuals * Possible fix for 'SetSwimState failure' messages in debug
2014-03-05Implemented vanilla-like fluid simulatorandrew4-8/+219
2014-03-02Add Trapdoor Functions to cWorld and fix Trapdoor Redstone BugsHowaner1-5/+3
2014-03-01g_BlockXXX => cBlockInfo::XXXandrew3-4/+4
2014-02-28Fix Double Slabs, fix Slab Meta and add more things to burnableHowaner1-0/+13
2014-02-20Removed problematic utf8.madmaxoft1-2/+2
2014-02-20Bad UTF-8 o.OHowaner1-2/+2
2014-02-20Remove typeinfo import in IncrementalRedstoneSimulatorHowaner1-2/+0
2014-02-20Add Pressure Plate SoundHowaner1-0/+9
2014-02-20Add Light weighted pressure platesHowaner2-10/+20
2014-02-20Add Hay Bale to BurnableHowaner1-0/+1
2014-02-16Fixed a glaring bug with chunk cross-simulatingTiger Wang1-9/+17
* A chunk's redstone blocks list is no longer touched if AddBlock was being called with another chunk's coordinates * Fixed chunk boundary checks
2014-02-15Added a 'default:' for SimChunk()'s switchTiger Wang1-0/+1
2014-02-15A fix and an improvementTiger Wang2-23/+43
* Fixed a special case with the wrong ChunkX/Z values being used to calculate a relative position * Simplified data structure adding and removing operations (no more pointers!) - Removed one character of whitespace :D
2014-02-15Sizeable speed improvements to redstoneTiger Wang2-81/+115
+ Moved all simulator data into individual chunks * Cleaned up parameters for functions and some code * Fixed repeaters powering off faster than they power on The main issue before was that, although the redstone simulator stored blocks to be simulated in individual cChunks, other data, such as powered lists, and etcetera, were global regardless of which chunk was being simulated. Therefore, with worlds with lots of redstone, each tick saw the ticking of chunks, which themselves iterated through the entire dataset needlessly, creating LOTS of lag. Should be better now :)
2014-02-15Add more Sounds to Redstone SimulatorHowaner1-1/+23
2014-02-15Add Fence Gate to Redstone SimulatorHowaner2-0/+31
2014-02-12Improved pressure platesTiger Wang2-1/+5
+ Two (or more) pressure plates can be triggered at the same time * Fixed issues caused by pressure plates not being in the sources list
2014-02-07Renamed cRedstoneManager to cRedstoneSimulator and renamed cRedstoneSimulator to cIncrementalRedstoneSimulator (Might change later).STRWarrior7-1809/+1809
2014-02-07Fixed some end of linesSTRWarrior2-2/+2
2014-02-07Implemented an easy way of adding new redstone simulators.STRWarrior4-3/+79
Also added a "noop" redstone simulator that does the same as the fluid version.
2014-02-05Fixed most of the reordering warningsTycho1-3/+3
2014-02-04Improved Type safety of eBlockFaceTycho1-2/+3
May Fix #640
2014-02-03Removed unused lookupsTycho1-2/+0
2014-02-02Changed Signiture of OnUpdateTycho1-1/+7
2014-02-01Split cCoord template into one and two data typesTiger Wang1-2/+2
2014-02-01Changed pointers to referencesTycho1-2/+2
2014-02-01Changed signitures of Several BLockHandler MethodsTycho1-2/+4
Changed the signitures of the following to use interfaces: GetPlacementBlockTypeMeta OnPlaced OnPlacedByPlayer OnDestroyed OnNeighbourChanged NeighbourChanged OnUse CanBeAt Check
2014-01-29Fixed redstone simulator crash found in #570Tiger Wang2-13/+14
2014-01-18Basic command block implementationandrew2-1/+30
2014-01-13Fixed wire, rail, and pressure plate unpoweringTiger Wang1-3/+4
2014-01-11Fixed rails poweringTiger Wang1-0/+2
2014-01-11Did some stuff with the vectorsTiger Wang1-32/+17
2014-01-11Fixed a door bug and reduced codeTiger Wang1-19/+1
Doors wouldn't get powered by repeaters, and some blocks, like glass, were viable middle blocks when they shouldn't have been.
2014-01-10Fixed doors, fixes #453Tiger Wang1-38/+8
2014-01-10Major refactoring of redstoneTiger Wang2-185/+178
This commit is a refactoring of the redstone code, mainly the functions handling the removal of invalid blocks from power supplier data structures. Its aim is to improve performance and potentially reduce the memory footprint of the data structures. It works to reduce the amount of GetBlock()s triggered every tick. Before, a GetBlock() was requested for every single item in the data lists, as well as for every single redstone block in a chunk. Following these changes, the AddBlock() event is utilised more effectively to only update the lists when needed (a block is changed), as well as to insert the block type (and update it when needed) alongside the coordinates into the main redstone simulator chunkdata list. In short, a single GetBlock() is now cached, with this cache being updated when the simulator is awoken due to a block change. At least, I *hope* that this is what it does :P
2013-12-31fixed warnings in World.cppTycho Bickerstaff1-2/+8
2013-12-26Moved increment operator to back of variablesTiger Wang1-9/+9
2013-12-24Implemented stone and wooden pressure platesTiger Wang2-3/+105
2013-12-23Provides an enhancement to daylight sensorsTiger Wang1-2/+27
2013-12-23Daylight sensor sensing enhancementTiger Wang1-9/+11
2013-12-22A fix for daylight sensorsTiger Wang1-2/+3
2013-12-22merged in warnings changesTycho Bickerstaff4-5/+12
2013-12-22converted commneted paramater names to the unused macroTycho Bickerstaff4-5/+11
2013-12-22Daylight sensorsTiger Wang1-2/+1
2013-12-22Fixed them again, confound itTiger Wang1-9/+21
2013-12-21Piston is now warnings cleanTycho Bickerstaff3-4/+4
2013-12-21ChunkSender is now warnings cleanTycho Bickerstaff1-1/+2
2013-12-20Fixed repeaters delay, maybeTiger Wang2-12/+38
Also added basic daylight sensors, though because GetBlockSkylight always is 15, it doesn't work.
2013-12-20Fixed compiler warning when iterating over a fixed array of items (ARRAYCOUNT).madmaxoft3-6/+6
2013-12-19Fixed repeaters not updating powerTiger Wang1-11/+41
2013-12-18Fixed wire powering blocks beneathTiger Wang1-1/+1
2013-12-18Fixed bad repeater power queuing in corner caseTiger Wang2-83/+76
Repeaters remain queued to power even if their original source has since unpowered. Also functionised and cleaned up code.
2013-12-15Implemented xoft's suggestionsTiger Wang1-3/+16
2013-12-15Fixed wire repeater checkingTiger Wang1-1/+1
2013-12-15Wires now power repeaters properlyTiger Wang1-0/+7
2013-12-15Fixed the hopefully final wire self-powering bugTiger Wang1-1/+13
2013-12-14Potentially fixed debug assertsTiger Wang1-5/+5
2013-12-14Wires no longer power if a block cuts them offTiger Wang1-23/+32
Also reduced more unneeded code.
2013-12-14Implemented note block playing and fixed wireTiger Wang2-4/+50
Game of Thrones music in Minecraft, here I come!
2013-12-14Fixed compilating!Tiger Wang1-5/+5
2013-12-14Fixes to redstone wire and torchesTiger Wang2-20/+36
+ Wires now power blocks around the block beneath * Torches no longer power off if it is on a linked powered block * Enhanced code, split functions, etc.
2013-12-14Removed loads of unneeded code againTiger Wang1-86/+60
2013-12-14Reduced loads of unneeded codeTiger Wang1-188/+44
Merged wire powering detection code into a single function.
2013-12-11Fixed pistons being viable middle blockTiger Wang1-0/+3
Also an excuse to update submodules
2013-12-11moved simulor to globsTycho Bickerstaff1-1/+5
2013-12-10more cmakeTycho Bickerstaff1-0/+7
2013-12-10Provides a possible fix for repeater timingsTiger Wang1-1/+1
Not completely reliable, but at least some types of clock work.
2013-12-10Readded initial lineTiger Wang1-0/+1
2013-12-10Fixed compile (alas, no more goto)Tiger Wang1-11/+14
2013-12-10Fixed Floody lava to stone fizzleTiger Wang1-2/+16
2013-12-10Added repeater delaysTiger Wang2-1/+62
They DO sometimes get stuck though :P
2013-12-10Slight redstone wire performance improvementTiger Wang1-1/+6
2013-12-10Changed more FastSetBlocks to SetBlocksTiger Wang1-3/+3
Fixes duplication bugs.
2013-12-09Fix Unused Variable Warning at FluidSimulator.cpp line 169 and 176worktycho1-4/+3
2013-12-07Changed some FastSetBlocks to SetBlockTiger Wang1-3/+3
Should fix some duplication glitches.
2013-12-07Fixed trapdoors not togglingTiger Wang2-16/+102
The redstone simulator kept on resetting them.
2013-12-06Re-implemented redstone duplicate checkingTiger Wang1-0/+29
2013-12-05Merged if statements.Samuel Barney1-7/+1
2013-12-05Finished MergeSamuel Barney1-2/+2
2013-12-04Lava can spawn fire.madmaxoft1-2/+2
Settable in world.ini, lava can spawn fire to fuel blocks near it. Fix #65.
2013-12-04Made suggested changesSamuel Barney2-6/+11
2013-12-02Fire no longer goes out when on top of nether rackSamuel Barney1-1/+6
2013-12-01Fixed linux compile errors and formatting in RedstoneSimulator.cppmadmaxoft1-14/+26
2013-11-30Fixed pistons extendingTiger Wang1-0/+10
They didn't when a source was in front, but now they do! Yay!
2013-11-30Removed redstone duplicate power checkingTiger Wang1-2/+0
There was no need for it, and it introduced some bugs.
2013-11-30Improved piston direction checkingTiger Wang1-62/+8
Now uses AddFaceDirection, as suggested by xoft.
2013-11-30Pistons no longer accept power through front faceTiger Wang2-3/+96
This fixes #60.
2013-11-30Improved redstone speed and fixed a wire bugTiger Wang1-73/+83
The redstone simulator no longer goes through the Powered and LinkedPowered blocks lists for EVERY item in the chunk data, instead, only at every tick. Also, wires powering each other that had the same data value is now fixed.
2013-11-29Implemented trapdoors, fixes #43 and #105Tiger Wang2-0/+19
Also updated redstone simulator to support it
2013-11-27Fixed the remaining derpsAlexander Harkness1-1/+1
2013-11-25Further attempts to fix compileTiger Wang1-1/+1
2013-11-24Attempt to fix compilationTiger Wang1-1/+1
2013-11-24Moved source to srcAlexander Harkness19-0/+3347