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

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

  1. Offline


    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

    • 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

    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

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

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


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


    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


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


  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


    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


    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


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


    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


  13. Offline


    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


    add what craftbook version it works with.
  15. Offline


    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.
  16. Offline


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


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


    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


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


    Good idea
  21. Offline


    Can you upload the version for 556?
  22. Offline


    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


    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


    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


    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


    You can try this older one

    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


    it worked, thanks alot!
  28. Offline


    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


    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


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

Share This Page