Cuberite Forum
Pistons - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Pistons (/thread-202.html)



Pistons - rs2k - 11-02-2011

Shouldn't be too hard. When activated, the piston should extend and move every block in front of it by one. If it's a sticky piston it would then pull back the first block it's hatched to.


RE: Pistons - rs2k - 11-06-2011

I added a piston class with pseudo code in the functions. I'll change change the pseudo code to actual code later.

The plan is to have the redstone class activate the piston functions when it find a piston as one of the device it is giving power to.

When the redstone class finds a device to power, it needs to put that code into a queue that will be executed during the next world tick. Any ideas on how to do this? I think there might already be code that does something similar to this in the source.


RE: Pistons - rs2k - 11-06-2011

I uploaded some more piston code. They should expand, push and retract, but the code has bugs. right now they only expand if placed straight up on the ground. Trying to extend one into a solid object causes the server to lock up at 100% CPU. I'm pretty sure I know where the bugs are, I just need to find them. I'm probably do that tomorrow.


RE: Pistons - rs2k - 11-06-2011

Pistons are working. I removed the bugs from the file. They do everything they should but don't animate or make noise yet. I also don't validate much of what can or can't be pushed. That can be changed later.


RE: Pistons - rs2k - 11-07-2011

Started work on adding the sounds and animations by sending the blockaction packet. I don't really understand why the client needs to be told the piston is extending or retracting twice with two different sets of data describe the same thing, but oh well.


RE: Pistons - rs2k - 11-07-2011

Pistons work now. time for bed.Big Grin


RE: Pistons - NiLSPACE - 06-12-2012

piston isn't completely working. pistons don't push players like in singleplayer. (no other server does it) maybe can it be implented in MC-Server becouse then i could try to make this: http://www.youtube.com/watch?v=cqkF6Ax-Pr4