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

http://db.tt/w6qMpncR
http://db.tt/G1ZGco9I
http://db.tt/KVcTlPyh

TODO

  • Add perm nodes for placing/creating/breaking Added v0.0.3
  • Add configurable times to be on/off (currently ON between 13000 [7:00pm] and 23000 [5:00am] ticks) Added v0.0.4
  • Add configurable update check (currently hardcoded to 20 ticks) Added v0.0.3
  • Add configurable name (currently hardcoded to Street Lamp) Added v0.0.3
  • Add ability to have multiple lamps with different names and different time conditions Added 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.

MCStats


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Recent Files