Is there a plugin that lets you remove all placed torches on the map? Is there any way to make it so that when someone logs off from a server all torches they placed are removed?
I don't think there is such a plugin yet. Would be pretty heavy though since you'd have to go through every block and check if it's a torch. Still possible though. The latter would be easier to do.
If you want to do this 1 time, you can use the worldeditor MCEdit (not a bukkit-plugin). Select all block, replace torch with air, wait some minutes.
WorldEdit or VoxelSniper (or maybe other from the voxel family) but maybe it doesn't do it for the whole map but oly chunks around you, check it out but I use MCEdit for this too.
Well, Im not too worried about existing torches but I want a way to keep people from torching the whole world so monsters no longer spawn. That kind of defeats the purpose IMHO.
Actually, this is a good use for the filesystem. Make files for each user in a /usr/ directory or something. Inside that file, do the following: Code: 340:420:12 430:543:2 120:324:22 -130:-164:-12 and then 'Split' the files colons, so if you called the strings Locations[], it would look like this: Locations [0] = "340", Locations[1] = "420", Locations[2] = "12"... Code: Pseudo Code: if(player places torch){ if(player + ".torchlocations" does not exist){ try and make a new one... } props.load(player + ".torchlocations"); props.editProperty("amount_of_torches", ++); props.put("Torch"+props.getProperty("amount_of_torches"), x + ":" + z + ":" + y ); } if(player logs off) { props.load(player + ".torchlocations"); //The files = playername.torchlocations for(var i = 0; i < props.getProperty("amount_of_torches"); i++){ String Locations[] = props.getProperty("Torch" + i).split(":"); Xpos = parseInt(Locations[0]); Ypos = parseInt(Locations[2]); Zpos = parseInt(Locations[1]); RemoveBlockAt(Xpos,Ypos,Zpos); } } I EXPECT THERE TO BE ERRORS IN THIS. I WROTE IT WITH NO REFERENCES.
Looping through all tiles would be stupid, however why not just store the placed blocks into a map and then iterate through those.....
Just make sure you check that the torch being deleted exists first. For instance if a player places a torch and another remove it that could cause a problem.
Delete your whole map (hehe ) -- will result in some loss of world (actually all of it), but you won't have torches
How about ExpiringTorches ... I believe that is the plugin name. You can set it to remove torches when their time runs out.
The problem with expiring torches is that it if the server gets reloaded any placed torches become permanent. They also only count down while in a chunk that is currently loaded. The plugin is a start but it does not work 90% of the time. I ran it for 2 weeks with a 4hr time limit and only one in a hundred torches went out. It would just be easier to tie all torches placed to a db of users and when that user logs out or in it clears that database and removes all torches from the world placed by that player.