[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

    Drei Gyuu

    Is there a way to just light up the area even if you are just holding the torch? or you can throw torches down pits and they will light it like a flare?
  3. Offline


    This is quite awesome.
  4. Offline


    No its just a torch that follows you around. Good for servers that use Towny, and or mods like WorldGuard that prevent players from placing torches everywhere. That way people can still see.

    Although something like that could optionally be added, ill investigate the idea of a lightsource coming off of a thrown torch on the ground.
  5. Offline


    I just downloaded the latest version of Portable Torches, version 1.04 with the default settings. I am using craftbukkit, recomended build 740

    Unfortunately I keep getting two errors that keep repeating over and over when I try to use it:

    The OP says it should would for 740, what's up?
  6. Offline


    Your getting the same errors that people got before there was the new 1.04 version. Are you sure you downloaded the newest jar and put it in there? The jar should be 14,825 bytes. The old one that wont work is 14,835 bytes.
  7. Offline

    Drei Gyuu

    Thanks that'll be great! Hopefully a lightsource from a handheld torch as well :D
  8. Offline


    cliking on your download link gives me a download of the 14,835 bytes version...
  9. Offline


    Ugh stupid forum, i pasted my new link over the top of the old one and it just replaced the text, but kept the actual HTTP link to the old file...fixed it...sorry for the confusion.
  10. Offline


    The new version from the new link works fine, though could you make an option in config.yml, where we could toggle weather the light switches off if another item is equiped in hand (besides the torch), and when you switch back to the torch, the light comes back?
  11. Offline


    This looks fantastic, I do have one request/question though: Is there that nifty health bar for the torch to show how long it will last in this plugin? I honestly thought that was hands down one the coolest features of any plugin when I saw that with Torchburn! If possible, I'd LOVE to see it again!
  12. Offline


    ive found a bug, if you break a torch, light will be there.
  13. Offline


    Thanks for uploading the changed version. Works great =)
  14. Offline


    wicked! thanks for the update!
  15. Offline


    is working... somehow... light was too low for me so i set to intensity 20 falloff 1. now having a dark spot im walkin in, around a circle of light. its also getting dark when i stand in a lit area(the dark spot im standing in). Another thing is i can collect crops from my farm walking through my farm and waving around with the sight.
  16. Offline


    Using CraftBukkit build 740 with default config, I'm getting this error:

    2011-05-02 10:14:39 [SEVERE] Could not pass event PLAYER_MOVE to PortableTorch
    java.lang.NoSuchMethodError: net.minecraft.server.WorldServer.j(III)I
    at com.gmail.fuzzelogicsoftware.PortableTorch.PTorch.lightArea(PTorch.java:221)
    at com.gmail.fuzzelogicsoftware.PortableTorch.PTorchPlayerListener.onPlayerMove(PTorchPlayerListener.java:16)
    at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:242)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:130)
    at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
  17. Offline


    Dont think that its really possible with the way this plugin works compared to TorchBurn.

    That method works in torchburn because you have to keep the torch in your hand, and he calculates how much time you have left on a torch by just slowly breaking it every few seconds which gives the healthbar. This breaks the torch at the end.

    Where as in this mod its not required to keep equipped, so theres no real way to effect the durability and get that health bar. I could however maybe do something else, like the light dimming slowly over time?

    The max is 15 for either attribute, the default settings that i put in are the best values i could find if you want to just simulate the amount of light a regular torch would give.

    I dont think you have the new CB740 version, try redownloading it, i mistakenly had the link setup wrong yesterday.

    Ill take a look, i dont see why this couldnt be done.

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


    Ah very cool, I like the idea of the light dimming a lot! Feels less like a torch, and more like a strange battery powered redstone torch then! Brilliant!

    If possible, I'd love to see it use something other than a torch too, since attaching a torch to your head seems odd when you think about it XD ...perhaps even chain mail which could be created via a recipe plugin - looks a lot like a miners hat :p
    Ideally a setting to change the item and how much it uses for how long would be best, but realistically just making it use redstone torches seems like a really nice solution if you were to add the dimming effect! ...oh or glowstone or glowstone dust - duh... but that is a bit more rare of course.
  19. Offline


    Idea overload here :)

    It does give me some good ideas when you mentioned batteries.
    I may make another mode within this mod that instead supplies light from a redstone torch, and uses redstone dust for battery power.
  20. Offline


    Hello I don't know why but for it isn't working ? I extracted the Map and the File into me Plugin Map but when starting my server nothing happens?
    I did download a recommended build because doing that thing with the Bat.file doesnt work for me.

    I think my problem is that I got build 739 but why doesnt it work ?
  21. Offline


    get build 740
    it is the recommended build
    go to: http://ci.bukkit.org/
    click on dev-craftbukkit
    and in the left side of the screen you will see a list of builds, ones with stars beside them are recommended
    Non-reccomended builds are often buggy with some plugins, so try and stay away from them.
  22. Offline


    Darn it why dont you read ll my post: I cant do that becuase my Bat.file never works and crashes my computer even though I tried all of the weird version there are on internet how to get it running.

    So all im asking is this why the plugin wont work that maybe I got an old build? And if so I cant do much with this or many plugins (First post because I was gonna get many more plugins guess I cant)
  23. Offline


    Thanks! This mod has saved me while mining many times!
  24. Offline


    Hello there,

    I was wondering if you could add group based time limits?
  25. Offline


    it makes everything lag as hell :(
  26. Offline


    Very nice idea, But there are a few faults i dont like.
    1. When i place a torch then destroy it, the actual light is still appearing.
    2. With the portable light on, i cannot go near snow or ice without it melting, which im not sure if you can fix this.

    There are just 2 things im not happy with this plugin. :)
    Thanks anyway.
  27. Offline


    Are you sure its not just you hitting the placed torch with a torch in your hand? Thereby activating the Portable Torch? Ive done that many times ...
  28. Offline


    I tried using the plugin, but I had thre main complaints from users:
    1. It lagged their game when activating and it stayed laggy even after the torch faded. I don't know what would be the cause of this.
    2. It melted snow around them! I know this is because you are basically having a torch follow someone around, but it makes it really inconvenient to traverse a snow realm otherwise.
    3. And then of course the one you are aware of, the turning on and off with block placement made building in the dark almost not that much better with a "headlamp" than just setting up torches everywhere in the first place.
  29. Offline

    Jan Tojnar

    Same problems on my server. I need to build underwater. I have FishPeople for extended air but there is no light. These lags are ugly and whenever i placed block i couldn't see anything for a while. The snow melting thing is not important for me because now it will be covered by snow during storm.
  30. Offline


    I haven't experienced any lag, however, the snow/ice melting is a deal breaker- one of my server users is building a village from ice blocks >.> you can see where this is going.

    It'd be nice to be able to switch the torch off with another left click.
  31. Offline


    it doesnt consume the torch whenever i use it :/

Share This Page