[MECH] Portable Torches v1.04 - Portable Headlamp Lighting [740]

Discussion in 'Inactive/Unsupported Plugins' started by FuzzeWuzze, Mar 23, 2011.

  1. Offline

    FuzzeWuzze

    Portable Torches:
    Version: v1.04

    This is a plugin to allow a player to have a headlamp type torch light that lasts for some set amount of time following them around and lighting up their surrounding area for them to work deep in the mines or out in the wilderness at night.

    I got the idea and some of the lighting code from Ryan Carretta's TorchBurn plugin(mucho props)
    I needed something like this for my new hardcore world that uses Towny, because i didnt want people building outside of towns, and i didnt want the entire landscape to be scattered with torches as they always do, thus making the survival part of the game trivial. This allows people to go mining deep underground with a stack of torches and still be able to see.

    How it works
    -Player equips a torch and left clicks.
    -1 torch is removed from the stack and the player is lit up
    -After the server set lightTime expires, their light will turn off

    Features:
    • Allows players to create a torchlight that will follow them around while mining or out in the wilderness
    • The ability to alter how long the torches last, as well as how bright and far they radiate(default is good ive found). Intensity = light brightness, falloff = rate the light falls off. The radius the light will spread from the player is intensity/falloff.
    • Permissions Support
      • PortableTorch.Allow, without this permission a player cannot use this mod. If Permissions is not installed, everyone can.
      • PortableTorch.Permanent, allows a player to have permanent light. Also does not consume a torch. Light still dies if you place a torch to prevent possible lighting bugs.
    Config File



    • Intensity Limits 0 - 15
    • Falloff Limits 0 - 15
    • lightTime: 400 = About 20 seconds
    Download The Plugin



    Be sure to extract the PortableTorch folder into your Plugins folder as well, theres no code to create the config if its not there
    For CB740
    http://dl.dropbox.com/u/2798684/PortableTorchV1.04_CB740.zip

    Changelog:
    Version 1.04
    • There was a bug in those that had Permanent torch abilities, the torches werent moving with the player! This has been fixed.
    • Updated CraftBukkit
    Version 1.03

    • Added Permission PortableTorch.Permanent to allow a player to have light always. Lights still turn off upon placing a torch to prevent possible lighting bugs.
    Version 1.02


    • Bukkit made changes to how player interaction is done, fixed those.
    • Players now left click to use torches, and it will go off thanks to new Bukkit hooks. No more right clicking and accidentally placing a torch.
    • Trying a fix for block placement bug, when someone places a block their light may still flicker off but it should immediately turn back on. Need to see if there's some way i can block the client from updating lighting on block placement.
    • Fixed bug related to players having queued tasks to kill their current torch triggering after they already used a new one(causing it to go out quicker than it should).
    Version 1.01



    • Code Cleanup
    • Permissions Support - PortableTorch.Allow, without this permission a player cannot use this mod. If Permissions is not installed, everyone can.
    Version 1.0



    • Initial Release
    TODO:



    • Permissions Support
    • Add more settings to config file
    • Fix bugs related to blocks moving(sand/gravel falling) killing the torch.
    • Fix bug related to placing a block killing the light
      • Taking Feedback if players like the relighting when blocks are placed method. Right now it should immediately attempt to relight the area after placing a block. I'm not sold on it right now and almost prefer to just keep it to relight on move, when in really dark areas placing blocks can make the light flicker on and off in a seizure inducing event if your placing blocks fast. Until i can find a way to block the client from redoing the light calculations.
    BUGS:



    • Upon placing a block your light turns off until you move - Needs to get fixed asap
     
  2. Offline

    oleerik

    I love this idea! Will give it a shot a bit later :)
     
  3. Offline

    anon

    Nice, but again, same request I did on Ryan's thread, can we have permissions support on this? I would like to restrict it to only one group of players on my server.
     
  4. Offline

    FuzzeWuzze

    I have it added, ill test it and post the updated version later tonight.
     
  5. Offline

    Lolmewn

  6. Offline

    Swoosh Bear

    Does this lag the server much? Like if a few people were using this plugin at once, would it lag for everyone a little?

    This looks like a great plugin.
     
  7. Offline

    anon

    What I experience is a little lag sometimes IF 2 or more players use that at the same time and one near the other. But its a client side lag, dut to the lights calculations, and not server sided. If client have a powerfull enought computer, he wont lag, if its a crappy computer he will have LOW FPS, but not lag as we know. But anyone that is not seing it shouldnt even notice.
     
  8. Offline

    Swoosh Bear

    Ok. Thanks. I'll give this plugin a go.
     
  9. Offline

    FuzzeWuzze

    I havent had anybody complain about lag with it before, as mentioned above if they do lag make your players turn off the new lighting Notch added in their settings as their machine has to have some pretty low specs to begin with...

    New version added in main post, Permissions added and you can now config your settings. Although the default IMO works best.
     
  10. Offline

    FuzzeWuzze

    I assume the lack of posts means that for those using it that its working fine? :)
     
  11. Offline

    Afforess

    I suspect all of these are related to the light levels automatically updating. I think a new hook would need to be added, "onLightLevelChange" for this to be fixed. I tried looking for where exactly such a hook should go, but was unsuccessful.
     
  12. Offline

    narrowtux

  13. Offline

    FuzzeWuzze

    Yea it would be nice if such a hook got added in.
    Although i am not quite sure why my onBlockPlace hook isnt working for the block placement?
    Im pretty sure its getting triggered before the game resets the light as it immediately turns it back off....maybe just a small delayed sync call....

    So whats a person gotta do now adays to get pushed into Released plugins and get tagged as a Dev...its been like a week and im pretty sure i meet all the requirements? Lol.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  14. Offline

    webkiller8

    add what craftbook version it works with.
     
  15. Offline

    Plague

    Easy, you have to edit the thread title to conform with guidelines ;) I would do such a trivial edit but I do not know the CB version it works with. So please update to latest RB too.
    http://forums.bukkit.org/threads/plugin-release-submission-guidelines.1755/
     
  16. Offline

    FuzzeWuzze

    Fine done, need to get it up to #602 it seems.
     
  17. Offline

    Plague

    Well the thread title says 531, that'S not the latest RB (602)...
     
  18. Offline

    FuzzeWuzze

    Man your fast before i could even get the edit in ;)

    Alright its all up to date with some various fixes, let me know if i am missing anything Plague.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  19. Offline

    Major

    Think you could add a permission node to make headlamps never run out for people with that?
     
  20. Offline

    FuzzeWuzze

    Good idea
    Done
     
  21. Offline

    hiphopgamer

    Can you upload the version for 556?
     
  22. Offline

    FuzzeWuzze

    Is there really a need for a 556 version with 1.4 coming out today? If anything im going to have to rebuild it for 60x that comes out today.

    Ill make sure to keep previous versions posted from now on.
     
  23. Offline

    PlannedBoredom

    Is there a feature for unlimited time and underwater use such as in TorchBurn? I love the idea, but I would like to see those functions because TorchBurn lags people even on amazing computers.
     
  24. Offline

    FuzzeWuzze

    Yes, but keep in mind that this has the same lighting code as Torchburn. Honestly i have never heard of it lagging people, if it is they need to turn the new smooth lighting system Notch added to the game off.

    I know people with all ranges of computers from crappy to high end like mine and ive never experienced lag.

    New update 1.04

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  25. Offline

    hiphopgamer

    thanks for the reply, and the most important plugins in my server (worldedit/worldguard) havnt been updated to 1.4 so im not upgrading yet. Yes it would be nice if you could reup 556. Pretty pleasE?
     
  26. Offline

    FuzzeWuzze

    You can try this older one
    http://dl.dropbox.com/u/2798684/PortableTorchV1.01.zip

    I think that should be for v531, but it wont have Permissions. Which should also work for 556. The problem is somewhere around 556 they totally changed the API and i had to rewrite a bunch of code to get it to work properly. So if that above doesnt work no luck sorry as i dont wanna go back and undo everything ive done to make it work now so it works with 556 again.
     
  27. Offline

    hiphopgamer

    it worked, thanks alot!
     
  28. Offline

    B0necracker

    Hi!
    I've got a problem with the Plugin..
    It works, a left click turn the Player in a moving light. But, it does not take away one torch and the light does not turn of, no matter how long I am waiting.
    I'm using the latest Recommend Version oft Bukkit
     
  29. Offline

    Thyraxxx

    yeah im having some issue too with the build 617, as he said light does not turn off, and sometime It bug and an area stay lgihted for ever, was flying around today and spoted many area that were super bright during the night.
     
  30. Offline

    FuzzeWuzze

    Are you guys admins on your server? Its probably because you have * permissions which enables the Permanent permission.
     

Share This Page