Lever
#1
Hi Guys,

I'm new to minecraft, and while surfing the web looking for minecraft servers, I found this project. I am C++ developer and I am really interested in contribute to the project. I download the code from the SVN site to familiarize myself with the code last week. I was able to implement the redstone levers and add it to the redstone simulator. I have attached the patch for it. Please let me know if it looks good and if I followed the code standard that you guys are using.

Also, while familiarizing with the redstone simulator, I was thinking: wouldn't be easier to create for this simulator some sort of event based simulator where all the devices (wires,repeaters,levers,pistons, etc..) are classes that respond to the events and the main function Simulate() will only pass the events that are queue for the current server tick? This way it will be easier to add devices. If you guys want, I can look into it.


Attached Files
.zip   Lever.zip (Size: 2.61 KB / Downloads: 286)
Reply
Thanks given by:
#2
Hello, welcome onboard Smile
Sorry that I can't have a look at your code, I'm leaving for Korea later today so I'm busy packing. But at least I'll try to answer your questions.
Devices would be a great idea, if it weren't for chunk loading and unloading. This makes the device classes very difficult to implement - how do you initialize them when a chunk loads? How about devices going across chunk borders and one chunk unloads? If you can solve these issues, then go ahead.
Also, there's a plan for rewriting the simulators "interface": mostly, instead of ticking in the global world, they should tick for each chunk separately. This might have some collisions with your plans, have a look at this thread for details: https://forum.cuberite.org/showthread.php?tid=617
Reply
Thanks given by:
#3
Hey keyboard, welcome to the forums!
If you eventually feel comfortable enough with the MCServer codebase and would like to have SVN access just send me a PM Smile
Reply
Thanks given by:
#4
Nice job! If you can also make levers placed on walls work I can commit your changes to the SVN. Wink
Reply
Thanks given by:
#5
i can place levers on walls. :O it only doesn't power that block on where it is attached to.
Reply
Thanks given by:
#6
Yeah, that's what I'm talking about.
Reply
Thanks given by:
#7
ohh, i see what you mean. I'll look into it Smile
Reply
Thanks given by:
#8
I finally had a look at the patch, nice work. I just reformatted some of the lengthy conditions, otherwise it's good. Committed as rev 1075.
Reply
Thanks given by:
#9
I haven't done any testing (my laptop alone won't survive MCServer + MC together), but from the code I'm guessing that a lever powers a repeater even when it is in the Off state. I've put a TODO into the cRedstoeSimulator code for someone to actually check this.
Reply
Thanks given by:
#10
it works fine for me    
and ofcourse if i turn the lever on the repeater will be on Smile
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)