SpaceManiac/Glowstone — pull request #215 by iamgreaser (2014-09-08 08:42:36+00:00)
Title: [WIP] Redstone framework

This is just the start of the framework as I gradually transplant my prototype (https://github.com/iamgreaser/rsproto) to the actual Glowstone framework. (At this stage you should look at RSWorld.java to see how the prototype implements it, because it'll end up looking very similar.)

This is for issue #116 Redstone Support. I will probably drop the WIP tag once the subset I'm focused on is stable enough, and do a separate pull request for the finer aspects of Redstone.

Current status:
* **DONE** - RSManager class tied to world to handle the redstone network
* **DONE** - Chunks are dirtied, updated and unloaded by GlowWorld and GlowChunk
* **DONE** - pulse() method hooked up to GlowWorld
* **needs glue** - Actually load chunk data into RSManager
* **unimplemented** - Redstone torch blocks
* **unimplemented** - Prevent placement of redstone dust ("wires") on a lot of things (mostly RS dust, RS torches)
* **needs transplant/glue** - Redstone network block access
* **needs transplant** - Basic redstone logic
* **bug** - There's something that's *not quite right* with the XOR test in the prototype - it works as an XOR but the initial state flashes wrong.

To be implemented in later pull requests:
* Proper framework for blocks of certain types (e.g. doors, levers, buttons) - note, this may be implemented before I take this out of WIP
* Block diagonal-down/up when blocked by, well, a block
* Faster deregistering of chunks
* Redstone wire "injection" into solids
* Proper network creation which doesn't require tracing wires every pulse (prototype uses HashSets to mark positions of "sources", torches, and charged wires - it's not going to hit *every* block each frame!)
* Repeaters
* Proper analogue values for wires
* Comparators