Pistons
#1
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.
Reply
Thanks given by:
#2
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.
Reply
Thanks given by:
#3
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.
Reply
Thanks given by:
#4
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.
Reply
Thanks given by:
#5
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.
Reply
Thanks given by:
#6
Pistons work now. time for bed.Big Grin
Reply
Thanks given by:
#7
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
Reply
Thanks given by:




Users browsing this thread: 4 Guest(s)