summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-04-27Redstone simulator now directly accesses cChunkTiger Wang1-34/+34
* Redstone simulator performance improvements * Added return values to some functions * Minor fixes
2014-04-17Compile fix?Tiger Wang1-2/+2
2014-04-17Implemented weighted pressure platesTiger Wang1-4/+6
2014-04-15Rewrote redstone powering to use power levelsTiger Wang1-15/+16
2014-04-06Added support for redstone latchingTycho1-0/+2
fixes #856
2014-03-01g_BlockXXX => cBlockInfo::XXXandrew1-1/+1
2014-02-15A fix and an improvementTiger Wang1-1/+2
* 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 Wang1-12/+23
+ 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 Fence Gate to Redstone SimulatorHowaner1-0/+2
2014-02-12Improved pressure platesTiger Wang1-0/+4
+ 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).STRWarrior1-6/+6
2014-02-07Implemented an easy way of adding new redstone simulators.STRWarrior1-3/+3
Also added a "noop" redstone simulator that does the same as the fluid version.
2014-01-29Fixed redstone simulator crash found in #570Tiger Wang1-1/+1
2014-01-18Basic command block implementationandrew1-0/+4
2014-01-11Fixed rails poweringTiger Wang1-0/+2
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-10Major refactoring of redstoneTiger Wang1-39/+40
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-24Implemented stone and wooden pressure platesTiger Wang1-2/+4
2013-12-22merged in warnings changesTycho Bickerstaff1-2/+2
2013-12-22converted commneted paramater names to the unused macroTycho Bickerstaff1-1/+1
2013-12-21Piston is now warnings cleanTycho Bickerstaff1-2/+2
2013-12-20Fixed repeaters delay, maybeTiger Wang1-4/+5
Also added basic daylight sensors, though because GetBlockSkylight always is 15, it doesn't work.
2013-12-18Fixed bad repeater power queuing in corner caseTiger Wang1-0/+3
Repeaters remain queued to power even if their original source has since unpowered. Also functionised and cleaned up code.
2013-12-14Implemented note block playing and fixed wireTiger Wang1-0/+2
Game of Thrones music in Minecraft, here I come!
2013-12-14Fixes to redstone wire and torchesTiger Wang1-1/+5
+ 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-11Fixed pistons being viable middle blockTiger Wang1-0/+3
Also an excuse to update submodules
2013-12-10Added repeater delaysTiger Wang1-0/+9
They DO sometimes get stuck though :P
2013-12-07Fixed trapdoors not togglingTiger Wang1-0/+12
The redstone simulator kept on resetting them.
2013-11-30Pistons no longer accept power through front faceTiger Wang1-0/+2
This fixes #60.
2013-11-29Implemented trapdoors, fixes #43 and #105Tiger Wang1-0/+2
Also updated redstone simulator to support it
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-21Multiple enhancements [SEE DESC]Tiger Wang1-1/+26
+ Added lever location checking * Fixed button location checking * Fixed button pressing/unpressing * Fixed repeaters updating * Minor enhancements
2013-11-20Multiple bugfixes [SEE DESC]Tiger Wang1-1/+15
* Fixed compilation on VC2013 * Fixed redstone self powering - still one more scenario to go + Redstone now powers block beneath * Improved code: functionized stuff, and reduced unneeded GetBlockMetas; also utilised direct chunk access, as recommended by xoft + Added torches powering blocks above it * Fixed repeaters getting power when they shouldn't - Stopped wires getting power from another wire through a block, which could lead to wire-powering loops (vanilla behaviour)
2013-11-18Redstone Megacommit [SEE DESC]Tiger Wang1-52/+165
+ Updated BlockID - look for yourself * Improved button, repeater, lever, and comparator code -> simplification and splitting of some stuff from the redstone simulator file * Fixed buttons not breaking when in an invalid game state * Fixed QueueSetBlock -> improved (AGAIN) piston code + Rewrote redstone simulator Fixes: #57, #58, #205, and part of #131. Fixes FS issues: 281, 116, and 102
2013-05-26Implemented droppersmadmaxoft@gmail.com1-1/+1
Added a common ancestor class "DropSpenser" that has the common code for dropper and dispenser and is Lua-accessible, too. The Debuggers plugin now triggers both droppers and dispensers when rclking them with a redstone torch. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1514 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-09Pickups are now being saved into Anvil.madmaxoft@gmail.com1-1/+1
Also changed cEntity rotation datatype to double git-svn-id: http://mc-server.googlecode.com/svn/trunk@1262 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-28Converted simulators to take cWorld reference instead of a pointermadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1228 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-28Simulators now have direct access to the cChunk object in the WakeUp() callmadmaxoft@gmail.com1-2/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1227 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-26Dispensers can dispense items and liquids nowluksor111@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1105 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-16RedstoneSimulator refactoring to use cWorld::GetBlockTypeMeta() as much as possiblemadmaxoft@gmail.com1-5/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1076 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-16Levers (patch contributed by Keyboard)madmaxoft@gmail.com1-0/+2
http://forum.mc-server.org/showthread.php?tid=649 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1075 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-13Preparation for multiple fluid simulators.madmaxoft@gmail.com1-1/+0
Moved all simulators into a subfolder. Replaced cWaterSimulator and cLavaSimulator with a generic cFluidSimulator. Moved original fluid simulation into cClassicFluidSimulator. Fluid simulator parameters (MaxHeight, Falloff) are read from the world.ini file (can have nether-like lava with lower falloff) git-svn-id: http://mc-server.googlecode.com/svn/trunk@956 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-06Completely removed the old (buggy) redstone simulator.madmaxoft@gmail.com1-29/+21
git-svn-id: http://mc-server.googlecode.com/svn/trunk@937 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-03Moved blockticking into blockhandler classes.madmaxoft@gmail.com1-1/+1
Also slightly refactored the variable / argument names (BlockID is deprecated, use BlockType instead) git-svn-id: http://mc-server.googlecode.com/svn/trunk@921 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-30Added falling block entities. Sand and gravel now properly fall downfaketruth1-3/+3
Implemented the PACKET_SPAWN_OBJECT packet Made some things use BLOCKTYPE instead of char Android: Requests WebAdmin port when pressing the configure button git-svn-id: http://mc-server.googlecode.com/svn/trunk@915 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-89/+89
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-06Yay redstone repeaters!faketruth1-1/+41
git-svn-id: http://mc-server.googlecode.com/svn/trunk@374 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-01New redstone simulator. Should work without crashes!faketruth1-0/+50
git-svn-id: http://mc-server.googlecode.com/svn/trunk@345 0a769ca7-a7f5-676a-18bf-c427514a06d6