Pl3xLamps
Description
Hello all, I wil be taking over this plugin as Billy no longer has the time to keep them going! Look out for updates in the near future, as I intend to try and fix the lag caused by updating the lamps, update and make sure it is working on most major CB versions, as well as add many new features! Watch this space...
Pl3xLamps allows your redstone lamps to stay turned on without power during certain in-game times. Want street lamps that come on at night only? How about lamps that are only on during prime hours? Maybe lamps that stay on all the time? Whatever case it may be, you have complete control over when they are turned on with this plugin.
This will NOT mess with the normal Redstone Lamp's functionality at all, so your redstone contraptions will NOT break!
No dependencies of other plugins, and no NMS calls at all! This is 100% using the Bukkit API so it wont break between CB builds!
Update: Pl3xLamps now utilizes the built in JDBC native to Bukkit. This means no more lamps.yml in your plugins folder! Instead, there will be a Pl3xLamps.db file in there by default. This is an SQLite database that contains all your saved lamp data. If you have configured your Bukkit.yml to use a MySQL server, instead, then you MUST create an empty table where you specified in the Bukkit.yml named "Pl3xLamps" or the plugin will fail to load.
To convert your old lamps.yml data to the new database, use the command /pl3xlamps convert (this is ONLY for users upgrading from v0.0.3 or earlier versions!)
Update: You can now have multiple lamp names that have their own times to be on! Have some street lamps that stay on at night and some indoor lamps that stay on all the time. There is no limit (except maybe your RAM/CPU) to how many different ones you can have. Here is an example of the new config.yml format (starting with v0.0.7) to utilize multiple lamp names:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Enable to spam the console with stuffs debug-mode: false # Enable to spam the console with LOTS of stuffs (can create lag) spammy-debug-mode: false # Enable to have console logs in color color-logs: true # How often to check the time to turn on/off the lamps (ticks) check-interval: 20 # Setup your lamps here. # Lamp '0' will be used as the default lamp (for backwards compatibility) lamps: 0: name: Street Lamp turn-on-condition: 'time > 13000 && time < 23000' 1: name: Indoor Lamp turn-on-condition: 'true' |
Please be aware that you must manually update your config.yml for the plugin to work. If you are a new user just simply uncomment the last few lines. If you are upgrading from an older build you will need to manually replace the old lines with the new ones (see the example) or delete your old file and the plugin will generate a new one on startup.
Upgarders Beware! Your old lamps in v0.0.6 and below will still work. They will automatically assume they are named whatever you specify as lamps.0.name in the config.yml. This is a side effect of not saving the lamp names in older versions of the plugin. However in order to prevent the plugin from crashing out with the old database file you must manually update it with an SQLite viewer program. A simplified procedure has been placed in the FAQ section for you.
Enjoy! ^_^
Commands
- /pl3xlamps (reload) View the plugin version or reload the config.yml values from disk.
- /pl3xlamps (convert) Convert the old lamps.yml data into the new database data. (only for upgrading from v0.0.3 or lower!)
Permissions
- pl3xlamps.pl3xlamps Allows access to the /pl3xlamps command
- pl3xlamps.create Allows to create lamps on an anvil
- pl3xlamps.place Allows to place lamps
- pl3xlamps.break Allows to break lamps
- pl3xlamps.use Same as giving the create, place, AND break perm nodes
F.A.Q.
- When I set a different name in the config.yml it doesnt work!
First, that's not a question. Second, it's because you need to restart the server completely. A simple reload wont do the trick here. Also be very careful about changing the name! All lamps created (but not placed) under the previous name will not work anymore. All those lamps will have to be renamed again to the new name.This is no longer an issue starting with v0.0.7.- After upgrading the plugin it keeps disabling itself on server startup!
- You need to manually modify the config.ym file to setup your default lamps to the new structure. See the example paste above.
- After upgrading the plugin keeps crashing with SQL error of missing column "name"
- This is a limitation with the eBean SQL library used in Bukkit. There is currently no way to modify a database table once its been created (adding the column "name" in this case) so you will have to manually add this yourself. Use an SQLite viewer to do this easily to your Pl3xLamps.db file. I recommend (and have tested it works) using http://sourceforge.net/projects/sqlitebrowser/ for this. Just simply open the .db file, click the alter table button, click the edit button, click add field button, field name is "name" and the field type is "text". Save the .db file and re-upload it to your server and fire up bukkit and the error will be gone.
- Why is there so much lag/CPU cycles?
- You have your check-interval set way too low. Each interval the plugin checks every single lamp, so setting this too low will obviously cause a lot of CPU cycles that could end up lagging your server. I recommend staying at 20 ticks or higher (20 ticks is 1 second), but I Strongly Recommend setting it to 100 ticks (5 seconds). No one is going to notice the light come on or go off 5 seconds early/late, and its going to save your precious server from lagging.
- Why cant my users create/place/break the lamps?
- You have not setup the proper perm nodes. Please see above.
- Pl3xLamps spams my console! How do I make it stop?
- Debug messages are off by default. You had to have turned them on.... Turn them back off in the config.yml file.
- Whats with this Pl3xLamps.db file?
- Don't touch it. Its your saved data of all your lamps on the server. If you delete or modify it, some or all lamps could stop working, requiring them to be re-placed to fix.
Screenshots
TODO
Add perm nodes for placing/creating/breakingAdded v0.0.3Add configurable times to be on/off (currently ON between 13000 [7:00pm] and 23000 [5:00am] ticks)Added v0.0.4Add configurable update check (currently hardcoded to 20 ticks)Added v0.0.3Add configurable name (currently hardcoded to Street Lamp)Added v0.0.3Add ability to have multiple lamps with different names and different time conditionsAdded v0.0.7- I'm up for suggestions..
Metrics
This plugin uses metrics to collect stats! It only collect basic things such as version type, and players online. If you want to see everything, click on the graph. Go into /plugins/PluginMetrics/config.yml to disable stat collecting if you wish.
Updated to v0.0.6 (CB 1.6.2-R1.0) to show that this plugin is still active, even though earlier versions still work fine on the latest CB.
Any chance this plugin is still being updated?
@Whitemanwii
The time is a condition. To have them on all the time, just put "true" without quotes.
This plugin is cool and its nearly what I'm looking for, I messed up on a building and I was using redstone lamps as a lighting, however I accidentally made it where the redstone lamps couldn't be powered and I got to the point where I couldn't simply destroy and restart, what kind of ruins this is the fact the redstone lamps turn off at day, is their anyway to keep them on forever? I did see a timing thing in the config but wasn't sure how to edit that and what not... so yea if you could tell me how to do that this plugin is what I need :)
Version 0.0.5 is now released. Wait for Bukkit approval or grab early from Jenkins (build #22).
Fixed:
Other:
@Stimson
Holy crap, you are correct. I labeled my config variable wrong :S
The condition must be FALSE for the lamps to turn on, not TRUE.. Therefore, its really a "turn-off-condition" variable. Oops.
'time < 0' should work for you also. or even just 'false'
Note: I've fixed this in the latest dev build (#20). In future releases the condition must be TRUE for the lamps to be on (like I originally intended).
I think you meant while 'time < -1'?
My config file has this
and the lamps operate at all times of the day.
While I had it at
The lamps never turned on
@Stimson
The convert command is for those upgrading from earlier version of the plugin, where the data was saved in lamps.yml
The command is /pl3xlamps convert
I highly recommend doing this from the console, as it can be a tedious task with a high number of lamps to be converted. My server had over 5000, and it lagged for about 60 seconds which lagged everyone off util it was done.
I wish there was a cleaner way to convert it, but that old YAML storage method was just a huge headache all around. Which is why I've moved away from it. :P
Also, there are some plugins that have a /rename command (like RoyalCommands) that can rename the stack in your hand. I might end up making a command like that for this, with a special perm node, because I too get tired of having to use the anvil lol
How do you use the convert subcommand? do you just type /convert ingame or from the console? What are the arguments?
Also its too bad you couldnt have a convert command to convert the redstone lamps in your hand to street lamps. But oh well.
@Stimson
You can now change the configured time for the lamps to be on. For them to always be on you can change the condition in the config.yml to 'time > -1'
Pl3xLamps v0.0.4 (jenkins build #18) is finally released. Sorry its taken so long to get this pushed out, other things came up for a few days.
This one is important for upgraders because of the backend storage change!
Fixed:
Added:
Other:
Upgrading? You MUST run the convert command to convert your old lamps.yml file to the new database for them to continue to work!
Could it be possible to add another redstone lamp, call it 'lamp' or something, that stays powered on at all times? Glowstone looks ugly on the default texture packs, and many people dont like it for home decor, but redstone lamps look great on virtually all packs and make great house lights.
Pl3xLamps v0.0.3 is uploaded and waiting for Bukkit approval. To get it early, grab dev build #12 from the Jenkins.
Whats new?
Enjoy! ^_^
Great plugin idea dude, straight forward and to the point il be using it in my survival server, thanks.
hope you can keep it updated and keep it a simple plugin [simple is usually better for this kind of thing ^_^]
-Sam
My server's users found 2 major bugs that I'll be fixing in the next few hours.Bug 1: Breaking street lamps does not honor World Guard protections. The lamp will still break anyways.Bug 2: Duplication is possible by using a piston to move the lamp while it's forced on at night.Edit: Both bugs have been fixed in dev build #5.
Before I make a public release there's one more bug (minor one) that I want to fix first. When lamps are moved with a piston, the plugin loses track of them and they wont stay on at night. Once I fix this, I'll push a public release for v0.0.2
Edit (again): Build #7 now allows lamps to stay functioning when pushed by pistons. I also rebased the entire plugin and it runs smoother with WAY less CPU cycles and MC ticks! ^_^
Posted the build as v0.0.2, just gotta wait for Bukkit staff to approve it (or grab it early from Jenkins #7).
Actually, my request wouldn't be to support different features. It would actually incorporate everything in your to-do list already, but allow for multiple names for Redstone lamps. Exact same function, with each one having a configurable time based on name set for Redstone Lamp (after you fix the hardcoded issue)
If you understood what I meant, apologies for another post.
This whole thing started because I wanted to invert the daylight sensor on top of the redstone lamp (so I wouldn't need to invert it with bulky circuits and torches). Half way through making the base, I decided why even have a daylight sensor on top? Its still more bulky than it needs to be. Thus this way was born.
I do plan on having the name of the redstone lamp configurable sooner or later. As of right now, though, it is hardcoded as "Street Lamp".
I also want to have a configurable time so the admin can set what times he/she wants the lamps to turn on/off. Right now its hardcoded in (time mentioned above in the description).
As for supporting other materials, variable height, or multiple on/off times in a single day/night cycle, that's beyond the scope of my needs so I have to decline such a request. However, my source code is open sourced, so there is nothing from stopping you, or anyone from using it as a base for a bigger plugin like you mention.
This idea sounds amazing. You can use daylight sensors for the same affect, but they often can be bulky and clunky, especially to create a BUD.
Reading about the configuring times, I have to ask and see if it's possible. I have a redstone contraption that I built for a clock that turns on redstone lamps on specific minute/hour hands. With a configurable time, I would be able to do this even easier. Is it possible to create a feature that allows for different configurable times for different names?
Basically, allowing there to be multiple names that could be configured to turn on and off at certain ticks.
Street Lamp (your version) Then I would create in the config file, names and ticks for the different minutes/hours. (10 minute lamp, 20 minute lamp, one clock, two clock, eleven clock, twenty clock, etc., for times of day). But it also could be used for other features. Such as wanting a pathway that lights up at night, but in a specific pattern. Or a redstone light display in a theater that turns on and off at different positions (actually, sounds awesome too)