Ah, wow! Thank you so much-I can’t wait to test this out. Now Sponge servers will look beautiful too c:
EDIT: I just tested it, and I’ve gotta say I’m blown away. I’m no where near considered a Dev, so the things Sponge Devs can do with their plugins has me very amazed! It works excellently, thank you so much!
@SuperMarioCraft_Gam Thanks for the suggestions. The problem for both suggestions is that the plugin can’t know if the lamp you clicked can be modified by you. I opened an issue for this(region api) but there seems to be no progress on that.
I will close this project because in the newer versions of Minecraft I can’t prevent Minecraft setting an unpowered lit redstone lamp to an unlit redstone lamp.
You are welcome to try to get it to work. I don’t close this thread yet.
This is the method that should regulate which lit lamps should be updated (or not) to unlit lamps. I want to prevent those updates at a location where a lamp is registered in the database and when the world has lights turned on(which is at night). A task which is called every 10 seconds updates the world light status by checking if the world time is in a hard coded range.
I created debug messages(but not pushed to GitHub) directly after the event cancelling in the above linked method. I output the original and the final transaction state and observed that everything is ok.
For more comfortable testing: Set the time to night(you see the critical range in the same class) and place a redstone block/torch next to a registered lamp and remove the redstone again. This lit lamp should stay lit when the event cancelling would work.
If you have questions, ask! Thank you for your time