StreetLights - Automatic redstone lamps

#StreetLights[API v4]
##Doesn’t work anymore: Click here to see why

##Usage & Description

  • Place a redstone lamp
  • Click on appeared message [CLICK] to add as Light
  • Wait for night or rain to see it in action

##Nice to know

  • Added redstone lamps can be used with redstone when turned off, so you can even turn lamps on manually when it is day.

##Permission

  • streelights.create

##Download
Download plugin
Source

##Idea
Thanks to @Chimera: Thread


WIP plugin, please report errors and unintended behavior
Suggestions are welcome!

RandomByte

4 Likes

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!

1 Like

##v0.1.2 released

Changes:

  • Fixed bugs

Suggestions:

  1. Add worldedit support to change all redstone lamps in the region defined into automatic.
  2. To be able to make it an automatic redstone lamp use shift click.

@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.

Edit: Ähh, I think the problem is only for 2.
Edit: I can’t find up to date information for the world edit api http://wiki.sk89q.com/wiki/WorldEdit/API

1 Like

You can modify the idea to work. My thoughts are not perfect. I am no developer just a person who has ideas and wants to share them.

1 Like

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.

What’s preventing you from doing that? I’d be interested in looking into a way to fix it.

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 :slight_smile: