[INACTIVE][MECH] FairSpawn v1.2 - Balanced individual spawn locations [450]

Discussion in 'Inactive/Unsupported Plugins' started by Exitlights, Feb 17, 2011.

  1. Offline

    Exitlights

    FairSpawn
    Version: v1.2

    FairSpawn allows players to set their own spawn location once every half hour using the compass.

    By default, players spawn points will be at the server's initial spawn location. To change your spawn location, you must equip a compass, stand in the location/orientation of your desired spawn point, and right click while the compass is equipped. If you attempt to set your spawn before the 30 minute cooldown has expired, the spawn location change will fail and the plugin will tell you how long until you can set your spawn elsewhere. I'm calling it "fair" because the 30 minute spawn change cooldown is enough to keep people from setting their spawns willy-nilly, and there's a minor resource sink with requiring the use of a compass.

    On the server end, a file called spawnLocs will be created where spawn location, orientation, and time of last spawn location set are stored. I've done my best to make this file resilient to server crashing, so players shouldn't lose their last set spawn location if the server crashes.

    I put this together for use on my own server as a way to incorporate changing spawn locations as a legitimate mechanic without any need of typed user commands. I don't intend to add any additional features at the moment, I just want to make this available to others who are looking for an individual spawn plugin that fits better into the vanilla game. So, this plugin is basically as-is, but as I update it to reflect the needs of my own server, I'll make it available in this thread.

    Features:
    • Individual spawn points per player using compass
    • Compass points toward the player's individual spawn point
    • 30 minute default cooldown on resetting your spawn location
    • Able to set for entire server whether setting spawn consumes the player's compass
    • Able to set for entire server the cooldown on players changing their spawn location
    Download FairSpawn Plugin
    Source Code

    Changelog:
    Version 1.2
    • Added options inside of spawnLocs file that set whether you consume the compass when you set your spawn, and the length of the cooldown (in minutes)... the default is to not consume, and 30 minutes
    To manually add one or both of these options, create a line that says 'consume true' or 'consume false', and a line that says 'cooldown #' where # is the number of minutes for the cooldown. Alternately, start then stop your server, and your spawnLocs file will have these options already, and you can just change the true/false or number value on the lines that will have been created. Obviously, your server needs to be shut down while you make changes to these values since the spawnLocs is only read once on server startup.

    Don't expect that using a non true/false value or a negative won't break the mod: it probably will.


    Version 1.1
    • Fixed null pointer error when users who had never set their spawn location died
    • Changed namespace from com.bukkit to us.exitlights
    Version 1.0
    • Initial release
     
  2. Offline

    przerwap

    cool stuff, but I will ask you to refrain from using com.bukkit as you don't own the domain
     
  3. Offline

    Exitlights

    Sure, I can change that. I'm not up on the package naming protocol though, what should I use if I don't have any intuition about what to use?
     
  4. Offline

    Cogito

    Do a quick search of the forums on namespace and you should pull up the post that explains what is going on.

    In regards to your plugin, would be a nice feature to be able to make it so the compass is consumed when setting the spawn. This would encourage thoughtful spawn placement even more.
     
  5. Offline

    GhandPivot

    Which program do I use to create plugins and where can I download it :D ?
     
  6. Offline

    Krispy

    I would love if there was someway to add an in game equivalent of a hearthstone such that pulling it out and using it started a warmup to teleport back to your custom spawn. The compass would be ideal for this, but then there would be no convenient way for setting your spawn. A conundrum. You mentioned not caring to program alternate functionality which is fine, but I thought I'd throw the idea out there in case you liked it for your server too.
     
  7. Offline

    Exitlights

    I'll definitely kick the idea around. I think my ideal way to have this all work would be to craft a custom waypoint block that you can change your spawn to as many times as you want, but you can't move the waypoint block without destroying it. Then, you could use the compass on a hearthstone-like cooldown to return to your last chosen waypoint block.

    I'll kick around the idea of the the hearthstone with the current functionality, though. Maybe I could have the clock's right click do that. In a week or so when I get some time, I'm considering adding in settings in the spawnLocs file that control the length of the cooldown (from 30 minutes to however many minutes you choose), and whether setting your spawn will consume the compass or not. And also get rid of the com.bukkit namespace thing.
     
  8. Offline

    Krispy

  9. Offline

    th3sarg

    Any chance of a update, throwing back a error when respawning in the server console (but still works) and getting the "stupidly long constructor" error (yes I know it's cosmetic but it's the only mod throwing back this error now)
     
  10. Offline

    Exitlights

    I meant to update this sooner, but I just got around to it. Just updated the OP to reflect version 1.1. This version fixes the null pointer error, and the stupidly long constructor error. Let me know if they're still appearing, or if there's any other bizarre behavior going on.

    Also, you'll notice that my repository is all nasty now since I added a new folder and couldn't delete the original one. Does anyone know a good way to fix this? :p

    Edit: Just as a note, I still intend to make whether the compass is consumed configurable, as well as configuring how long you get between spawn changes. I've got some time this week, so it may go in tomorrow.
     
  11. Offline

    th3sarg

    Great thanks, just tested it out on #458 and everything is fine.
    As for the duration between setting the spawn as a option, this would be a nice addition.

    Thanks again for the update :)
     
  12. Offline

    Fluff

    Thanks for the update! We're looking forward to those changes.

    One other feature request: maybe add Permissions support so that only certain groups/people can set their own spawn points?
     
  13. Offline

    Exitlights

    Updated OP to reflect version 1.2. I added lines in the spawnLocs file that will set whether the compass is consumed, and how long the cooldown on setting spawn should be. Existing spawnLocs files will work fine with this change, and will just have the default values ('consume false' and 'cooldown 30'). To have your spawnLocs file automatically changed, stop your server, install the new plugin, start the server, then stop the server again. You will now see the spawnLocs file including those two extra lines, and you can set them to some number of minutes and 'true' or 'false'.

    Make sure to let me know about any weirdness: this is the first version I'll have pushed out that hasn't hit my server before I'm putting it out to everyone else.
    --- merged: Mar 3, 2011 7:14 AM ---
    I'll look into this next... it might be a bit though, I've got a real bad week coming up.
     
    Fluff likes this.
  14. Offline

    th3sarg

    Great stuff, just tried both the spawn time and consume and they are working perfectly. (using #458)

    Great update! :)
     
  15. Offline

    letmedl

    Suggestion: Make sleeping in a bed set your spawn point
     
  16. Offline

    MicroDark

    I like this plugin but it isn't compatible with the new version of Craftbukkit.
    Update soon ?

    Thanks !
     

Share This Page