summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-06-17Fix fence gate redstone simulator.Howaner1-2/+1
2014-06-16Merge branch 'master' of github.com:mc-server/MCServerTycho1-8/+30
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 Wang1-16/+15
* 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-07Further improvements on redstone speedTiger Wang1-64/+77
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-07Fixed wires powering wires diagonally below themTiger Wang1-5/+1
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-04-27Redstone simulator now directly accesses cChunkTiger Wang1-404/+522
* Redstone simulator performance improvements * Added return values to some functions * Minor fixes
2014-04-18Removed unsupported C++11 features.madmaxoft1-13/+19
2014-04-17Implemented weighted pressure platesTiger Wang1-25/+165
2014-04-15Rewrote redstone powering to use power levelsTiger Wang1-165/+133
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 latchingTycho1-2/+63
fixes #856
2014-03-16Fixed double to float conversions.madmaxoft1-1/+1
2014-03-08Change TNT Fuse to ticksHowaner1-1/+1
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-02Add Trapdoor Functions to cWorld and fix Trapdoor Redstone BugsHowaner1-5/+3
2014-03-01g_BlockXXX => cBlockInfo::XXXandrew1-2/+2
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 platesHowaner1-10/+18
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 Wang1-22/+41
* 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-69/+92
+ 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 SimulatorHowaner1-0/+29
2014-02-12Improved pressure platesTiger Wang1-1/+1
+ 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-44/+44
2014-02-05Fixed most of the reordering warningsTycho1-3/+3
2014-02-04Improved Type safety of eBlockFaceTycho1-2/+3
May Fix #640
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 Wang1-12/+13
2014-01-18Basic command block implementationandrew1-1/+26
2014-01-13Fixed wire, rail, and pressure plate unpoweringTiger Wang1-3/+4
2014-01-11Did some stuff with the vectorsTiger Wang1-32/+17
2014-01-10Fixed doors, fixes #453Tiger Wang1-38/+8
2014-01-10Major refactoring of redstoneTiger Wang1-146/+138
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-26Moved increment operator to back of variablesTiger Wang1-9/+9
2013-12-24Implemented stone and wooden pressure platesTiger Wang1-1/+101
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-22Daylight sensorsTiger Wang1-2/+1
2013-12-22Fixed them again, confound itTiger Wang1-9/+21
2013-12-20Fixed repeaters delay, maybeTiger Wang1-8/+33
Also added basic daylight sensors, though because GetBlockSkylight always is 15, it doesn't work.
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 Wang1-83/+73
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 Wang1-4/+48
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 Wang1-19/+31
+ 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-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-10Added repeater delaysTiger Wang1-1/+53
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-07Changed some FastSetBlocks to SetBlockTiger Wang1-3/+3
Should fix some duplication glitches.
2013-12-07Fixed trapdoors not togglingTiger Wang1-16/+90
The redstone simulator kept on resetting them.
2013-12-06Re-implemented redstone duplicate checkingTiger Wang1-0/+29
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 Wang1-3/+94
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 Wang1-0/+17
Also updated redstone simulator to support it
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-23Properly fixed piston bugsTiger Wang1-4/+9
2013-11-21Multiple enhancements [SEE DESC]Tiger Wang1-57/+34
+ 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-125/+263
* 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-19Possible compile fixTiger Wang1-1/+1
Also removed unneeded variables.
2013-11-18Redstone Megacommit [SEE DESC]Tiger Wang1-866/+761
+ 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-08-25Redstone fixes [SEE DESC]Tiger Wang1-0/+24
Fixed pistons not correctly powering down Fixed dispensers not correctly powering down Fixed droppers not correctly power down Fixed TNT not correctly powering up Fixed redstone lamps not correctly powering up Fixed redstone lamps not correctly powering down
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-1/+1
2013-06-22Made redstone lamps turn on when powered and turn off when not powered.nielsbreu@gmail.com1-0/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1620 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-22TNT changes to primed TNT when powered by redstone.nielsbreu@gmail.com1-0/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1618 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-04Removed cLadder, cSign, cStairs, cTorch and cVine classes, moved their functionality into the appropriate BlockHandlers / ItemHandlersmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1555 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-28Moved BlockEntities to a separate foldermadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1527 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-28More dropspenser redstone interaction fixes.madmaxoft@gmail.com1-0/+7
Now the dropspensers are correctly powered off, unless they had been powered by a redstone torch directly next to them. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1525 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-28Added a forgotten change to make dropspensers activate only once on redstone activationmadmaxoft@gmail.com1-1/+1
Fixes rev 1521 functionality git-svn-id: http://mc-server.googlecode.com/svn/trunk@1524 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-27DropSpensers: Fixed activation when receiving redstone signal. Now only one item is dropspensed.madmaxoft@gmail.com1-12/+12
Fix for FS #378, http://www.mc-server.org/support/index.php?do=details&task_id=378 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1521 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-26Implemented droppersmadmaxoft@gmail.com1-16/+12
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-4/+4
Also changed cEntity rotation datatype to double git-svn-id: http://mc-server.googlecode.com/svn/trunk@1262 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-03Redstone simulator: adding a block now checks if the neighbors are redstone-related; if not, the block is ignored.madmaxoft@gmail.com1-107/+144
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1247 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-28Converted simulators to take cWorld reference instead of a pointermadmaxoft@gmail.com1-35/+35
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-3/+2
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/+37
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1105 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-20Fixed a crash in redstone simulator when destroying blocks in Y < 2madmaxoft@gmail.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1084 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-16RedstoneSimulator refactoring to use cWorld::GetBlockTypeMeta() as much as possiblemadmaxoft@gmail.com1-294/+383
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-12/+93
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-11-16Fixed boolean comparison.madmaxoft@gmail.com1-4/+4
Don't compare booleans to false / true, use them directly. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1048 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-13Preparation for multiple fluid simulators.madmaxoft@gmail.com1-4/+4
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-51/+236
git-svn-id: http://mc-server.googlecode.com/svn/trunk@937 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-5/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: OSSupport-related files in a separate subfolder, renamed.madmaxoft@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@885 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-701/+701
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-06Sticky pistons should work as well nowfaketruth1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@379 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-06Yay redstone repeaters!faketruth1-48/+224
git-svn-id: http://mc-server.googlecode.com/svn/trunk@374 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04Removed redstone debugging: powered dirt blocks change into stonefaketruth1-8/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@364 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-01New redstone simulator. Should work without crashes!faketruth1-0/+523
git-svn-id: http://mc-server.googlecode.com/svn/trunk@345 0a769ca7-a7f5-676a-18bf-c427514a06d6