[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

    CorneliousJD

    Works amazing, but would it be possible to make it that any user holding a torch gets this effect, and if you take the torch out of your hand (switch to pickaxe) it shuts the light off? This would be great for our server!

    This way you'd only use torches to put them on the wall, and you'd still need to put your torch up on the wall to mine!

    Also, when a torch is "lit" in a snow area with this plugin it melts the snow, normal torches on wall do not?
     
  3. Offline

    The PC Tech Guy

    This has to do with light calculations, I've experienced this with the plugin this plugin's code was borrowed from. Apparently, the only way to fix this is either add a torch/lightsource or add/remove a block in the area. Or, you could use a map editor and have it recalculate light values for you.
     
  4. Offline

    thepackett

    I have a very strange problem :O
    instead of the light following me around it stays in one place.
    and also to light the ground i simply left click it and it acts as if torch was placed there except it disappears after the set amount of time. also, when i do this no torches are consumed. i'm also not getting any errors in the server window either.
     
  5. Offline

    Coupon

    This doesn't work. I have a stack of torches, left click, and nothing happens.
     
  6. Offline

    FuzzeWuzze

    Are you using 1.04? There was a bug with admins that had all permissions have the "Always on" permission by default and it wasnt following properly but i thought i fixed that in 1.04.

    As for areas getting stuck with lights on yea, i have tried to minimize that the best i can. Bukkit has some limited ways to set lighting on blocks right now, need to see if i can find a better way to do it.

    As for torches that you hold onto thats more or less what the mod i got this from does(TorchBurn), so take a look at that if hes still updating it, i hate to duplicate his work. If that mod is dead ill think about adding that functionality back in.

    Also new version for CB670 uploaded.
     
  7. Offline

    godman

    Is there any way from preventing ice or snow block melting with the torch? I have a winter biome and a dungeon made from snow block, and since worldguard does not protect from this exact block attack, any user would be able to destroy everything....
     
  8. Offline

    FuzzeWuzze

    Interesting, never really thought of that.
    I'll see if i can do some magic to check if a block is ice or snow, but i think its the game itself that removes the block as i am definitely not doing it.
     
  9. Offline

    godman

    Well the weird thing is that placed torches don't melt snow blocks, you can place the torch on or near the snow block and it will not melt it, but as soon as i light up the torch from this or the other plugin it melts them :(
     
  10. Offline

    thepackett

    i am using 1.4
    and the light isn't really getting stuck, it just never moved from the beginning
    also you didn't say anything about torches not being used when i do this :O
     
  11. Offline

    FuzzeWuzze

    I mean 1.04 of my plugin, not 1.4 minecraft.
    This was exactly what happened in 1.03 that i fixed in 1.04 for anybody with PortableTorch.Permanent permission. Which would be all admins.
     
  12. Offline

    Keyjin

    i use the premission plugin and this plugin will not go
     
  13. Offline

    Imaginarydud

    I was just thinking about the block placement/removal bug, and thought of a possible fix.
    What if you have the torch placed on the block the player's standing on? If the block's destroyed/placed, the player pretty much automatically moves.
    I don't know if that's how your plugin works, or if it's easy to set that in a plugin. I'm just assuming that's how it works, since when a block is changed, the torch "falls off", like a regular torch.
     
  14. Offline

    manura133

    @FuzzeWuzze
    Thank you for the great plugin! I'm using this from now on as TorchBurn could possibly be abandoned in the near future. And because you can use other items while the light stays on. Great Work!

    Two suggestions:
    1. Would it be possible to put "permatent light" as a general setting (true/false) in the properties? I am a server admin, so I have permission to all commands. But I also would like to "cheat" as little as possible.

    2. One thing I miss since TorchBurn is the "sneak+right click" function (could also be left click of course) to inflame the torch. I'm missing this because I all too often activate the torch by accident. That is annoying. Maybe you can change this, too?
     
  15. Offline

    FuzzeWuzze

    The problem is bigger than that unfortunately, every time a block falls or is removed the game(client i believe) recalculates all the light for its visible blocks. Because of this if your deep down in the dark and have my torch on(which has forced new light modifiers), when you break the block the game recalculates it as dark again. This doesnt operate as an "actual" torch object, it simulates it by getting and modifying the light values around the player as they move.

    Yea i planned on doing something like this for the next version when i get some time to work on it. Dont like how the permanent thing is working right now.
    Not sure about the activation thing, either type is gonna have people that want something else. Besides torches are ridiculously over crafted in most worlds ;)
     
  16. Offline

    Unscrewed

    Uhm, when I delete an existing torch with torches in my inventory, the torch goes away but the light stays
     
  17. Offline

    BioRage

    Is there a video or picture?
     
  18. Offline

    compgurusteve

    Anyway to negate the Ice melting effect with the same brightness intensity?
     
  19. Offline

    compgurusteve

    anyway to add an Admin on/off command?
     
  20. Offline

    DrBowe

    Two bug reports, one I'm sure you probably know of, the other I'm not so sure:

    This plugin can cause chunks to 'permanently light' themselves, atleast until a block is placed/destroyed in these bug areas, then it returns to normal.

    Also, I'm 99% sure that your plugin causes torches placed around a mobspawner to not 'deactivate' the hostile mobs.
    This error has just recently started to occur, right after I installed this plugin.

    Hopefully you'll look into these :D
     
  21. Offline

    Mikor

    Feature request:

    Assign the ability to set a flag in the config to use Redstone Torches instead of regular ones. I couple this plugin with TorchMissile on my server, and whenever a player activates TorchMissile (left+right click), it turns on the portable torch as well, causing a severe performance dip on the client end for a few moments. If I could have redstone torches activate Portable Torch instead, conflicts such as these would be resolved.
     
  22. Offline

    DrBowe

    Feature Request:

    Add a command to disable/enable torches for those that have the 'allow' node in permissions.
    I have some people who love this, and others who hate it, so I'd love a way for them to simply type
    /Ptorches [off|on]
     
  23. Offline

    thepackett

    i get the error:
    15:06:50 [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:240)
    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:129)
    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:73)
    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)


    whenever i try to use this.
    I have one plugin that may conflict with this called oddlight that makes placed torches expire, but i think it probably has to do with me using a craftbukkit build for 1.5.
     
  24. I get the same error as thepackett. Is it possible to release a source so I may investigate this issue?
     
  25. Offline

    jedimaster0

    I have placed the permissions and i have installed the mod. when i right left click i swing a torch and nothing else happens.
     
  26. Offline

    casso

    sorry to be the one to ask, but is there plans for 7XX update (MC1.5)? only asks as this thread is quiet....
    FYI: I have CB733 with Permissions and this plugin appears to do nothing anymore.
     
  27. Offline

    thepackett

    I think he may be on vacation or something :O
     
  28. Offline

    casso

    good stuff :)
     
  29. Offline

    m5k

    Sadly 733 did break this great plugin. I was using torchburn before, but this seems nice. Hope you're not very busy and will be able to update it soon. ;)
     
    Elaeth likes this.
  30. Offline

    Kartus

    request also update on newest bukkit
     
    Elaeth likes this.
  31. Offline

    FuzzeWuzze

    Updated, sorry for the delay!
     

Share This Page