Inactive [MECH/INFO] Clans v1.8.2 -Team Chat, Organization, Optional Area Defenses + More [1185]

Discussion in 'Inactive/Unsupported Plugins' started by Satros, Jun 4, 2011.

  1. Offline

    Satros

    Clans - Team Chat, Organization, Optional Area Defenses + More!
    Version: v1.8.2
    Works with bukkit release [1185], [1060], [860], [818]

    This plugin aims to make PVP more fun by adding a team/faction/clan type aspect to the game, while only making minimal and optional restrictions to normal minecraft gameplay. (Semi-Vanilla). Clans is extremely configurable as to not impose any features on server admins that they may not want. Teams are simple to use but also very customizable.

    Features:
    • Team Chat
    • Easy Team Organization (Saves teams when server goes offline, team lists, etc)
    • Customizable ranks within teams
    • Optional use of Team Area Defenses
    • Optional clan tags and colors in chat
    • Optionally turn Friendly-Fire off or on
    • Permissions support (Optional)
    • --Permissions Prefix/Suffix Chat Support (Optional)
    • iConomy support (Optional)
    Download Clans v1.8.2:
    Clans v1.8.2
    1.8 Source Code

    Old Versions:
    (Clans v1.8.1)(Clans v1.8 | src)(Clans v1.7 | src)(Clans v1.6 | src)

    Conflicts:
    **May Conflict with plugins that modify Chat, if this is the case set "use-chat-tags: " to false in the config file or disable the conflicting plugin.
    **Will also conflict with any plugins that have /t or /team commands.
    KNOWN CONFLICTING PLUGINS
    • iChat (Chat Related, set use-chat-tags: false or disable iChat)
    • HeroicChat (Chat Related, set use-chat-tags: false)
    • Essentials (Not sure why, probably multiple reasons)
    • War (uses /team)
    Config (config.cfg)

    Show Spoiler

    use-chat-tags: true
    use-clans-chat: true
    inc-permissions-prefixandsuffix: false
    max-tag-characters: 6
    tag-orientation: right

    min-teamlist-teamsize: 3
    min-color-teamsize: 3
    min-area-teamsize: 15

    team-kill-default: true
    allow-tk-toggle: false

    use-team-areas: true
    max-team-area: 210
    allow-guardian: true
    guardian-damage: 1
    allow-alerter: true
    alert-time-buffer: 25

    #Costs
    use-iconomy: false

    #Recommend increasing these if using iConomy
    create-team-cost: 0
    team-area-cost: 10
    guardian-cost: 50
    alerter-cost: 25

    #These are not used if using iConomy
    create-team-currency: 41
    team-area-currency: 41
    guardian-currency: 41
    alerter-currency: 41
    Config Meanings
    Show Spoiler

    use chat tags - use to disable clan tags in chat.
    use clans chat - disable if you plan on using another chat plugin such as Heroic chat, iChat, or Essentials Chat.
    inc permissions prefixandsuffix - if using clans chat, whether or not to include the suffixes and prefixes from permissions, also if a prefix is only a color it will be applied to the playername otherwise the tag (if on the left) would make it do nothing.
    max tag characters - the max characters in a clan tag
    tag orientation - whether the clan tag is displaed before or after a players name in chat

    min teamlist teamsize - minimum number of team members a team must have to show up on /team list
    min color teamsize - minimum number of team members a team must have to set their color
    min area teamsize: - minimum number of team members a team must have to use team area commands

    team kill default - whether friendly fire is on or off be default
    allow tk toggle - whether players can toggle friendly fire on and off

    use team areas - whether or not teams have have areas, if set to false will not take any extra resources for areas
    max team area - the maximum size a team area can grow to
    allow guardian - whether or not teams can buy and use offline area protection
    guardian damage - the amount of damage offline area protection does to those who place or destroy blocks, 1 = half a heart
    allow alerter - whether or not teams can buy and use intruder alerts for their area
    alert time buffer - how long between intruder alerts are received in chat, in seconds

    use iconomy - whether or not you want to use iConomoy for area and team creation purchases

    create team cost - the cost of creating a team, either for iConomy or in items below
    team area cost - the cost of claiming a team area, either for iConomy or in items below
    guardian cost - the cost of getting offline area protection, either for iConomy or in items below
    alerter cost - the cost of getting intruder alerts, either for iConomy or in items below

    #These are not used if using iConomy
    create team currency - item number used for purchasing the above, not used if using iConomy
    team area currency - item number used for purchasing the above, not used if using iConomy
    guardian currency - item number used for purchasing the above, not used if using iConomy
    alerter currency - item number used for purchasing the above, not used if using iConomy


    Commands:
    Show Spoiler

    Team Chat
    /t <MESSAGE> Message your entire team.

    Team General Commands
    /team help <1/2/3/4> Lists commands and what they do.
    /team create <teamname> Creates a team.

    /team invite <playername> Invites a player to your team. **CASE SENSITIVE**
    /team accept Accept your most recent invite to join a team.
    /team reject Reject your most recent invite to join a team.
    /team leave Quit a team.
    /team disband Deletes a team if you are the last one in it.
    /team info Lists players and rankings of your own team.
    /team info <teamname> Lists players and rankings of a specified team.
    /team online Lists team members that are online.
    /team list Lists all teams with more than the configured number of members and how many members they have.
    /team kick <playername> Kicks a player from the team **CASE SENSITIVE**
    /team motd Displays the team's Message of the Day (Also displays at login).
    /team motd <message> Sets a team's Message of the Day **LEADER ONLY**
    /team tag <tag> Sets a team's tag **LEADER ONLY**
    /team color <color> Sets the color of the team's tag. **LEADER ONLY**
    Possible Color Values: DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, GOLD, GRAY(Default), BLUE, GREEN, AQUA, LIGHT_PURPLE, YELLOW
    /team tk <on/off> Turns friendly fire/team killing on or off.


    Team Ranks
    /team rankcreate <rankname> Creates a new rank at the bottom of your team's ranks.
    /team rankname <ranknumber> <rankname> Renames a rank.
    /team setrank <playername> <ranknumber> Sets the rank of a player in the team.
    /team rankmoveall <oldranknumber> <newranknumber> Moves all players in a rank to a new rank **LEADER ONLY**
    /team rankflag <ranknumber> <kick/teamchat/rankedit/invite/promote> <true/false> Sets the permissions for a specified rank.
    /team rankinfo <ranknumber> Gives the rank name and rank's permissions for a specified rank.
    /team rankdelete <ranknumber> Deletes a rank from the team structure, rank must be empty.


    Team Area Defenses (Can be disabled in config)
    /team BuyArea <areaname>
    This sets an area based on the origin of the user. The radius of the area is based on team size with a max radius that can be configured. Costs a configured amount of items to use, default is 10 gold blocks, (must have in inventory). Must have at least the configured minimum area team size (default 15) members in your team to use. LEADER ONLY COMMAND. THIS IS A REQUIREMENT TO BUY THE BELOW DEFENSES:
    /team BuyAlert
    This will add intruder alerts to your area. If a player who is not on your team places or destroys within your team's area all online players will be alerted. (Does not alert if the last alert was within 20 seconds as to not spam chat). Costs a configured amount of items (Default 25 gold blocks). LEADER ONLY.
    /team BuyGuardian
    This will add offline protection to your base as described by the following: If an entire team is offline and they have guardian, if a player not in that team tries to break or place a block in the team's area the player will lose half a heart of health IF AND ONLY IF that player was not already inside the team's area when the team became offline. This is to protect from people logging off explicitly to protect their base. (This means if someone is in your base and you log off they wont get hurt and can destroy all they want). Costs a configured amount of items (Default 50 gold blocks). LEADER ONLY.


    Permission Nodes (Optional)
    Show Spoiler

    To allow all Commands:
    Code:
                - 'clans.all'
    Else use these nodes:
    Code:
                - 'clans.create'
                - 'clans.invite'
                - 'clans.list'
                - 'clans.accept'
                - 'clans.info.self'
                - 'clans.info.other'
                - 'clans.kick'
                - 'clans.leave'
                - 'clans.disband'
                - 'clans.color'
                - 'clans.buyarea'
                - 'clans.buyalert'
                - 'clans.buyguardian'
                - 'clans.motd'
                - 'clans.tag'
                - 'clans.rank.create'
                - 'clans.rank.name'
                - 'clans.rank.set'
                - 'clans.rank.moveall'
                - 'clans.rank.flag'
                - 'clans.rank.info'
                - 'clans.rank.delete'
                - 'clans.teamchat'
                - 'clans.tktoggle'
    


    API
    Show Spoiler

    You can use the Clans API for chat plugins that want to display the proper clans tags with their plug-in;
    First you will need to add Clans.jar to the list of External Jars for your project.

    Next you will need to hook into Clans from the Server Listener, replace [YOURPLUGIN] in the example with the name of your plugin:
    Code:
    import org.bukkit.event.server.PluginDisableEvent;
    import org.bukkit.event.server.PluginEnableEvent;
    import org.bukkit.event.server.ServerListener;
    import org.bukkit.plugin.Plugin;
    
    import com.bukkit.Satros.Clans.Clans;
    
    public class [YOURPLUGIN]ServListener extends ServerListener {
        private [YOURPLUGIN] plugin;
    
        public [YOURPLUGIN]ServListener([YOURPLUGIN] plugin) {
            this.plugin = plugin;
        }
    
        @Override
        public void onPluginDisable(PluginDisableEvent event) {
            if ([YOURPLUGIN].Clans != null) {
                if (event.getPlugin().getDescription().getName().equals("Clans")) {
                    plugin.Clans = null;
                    System.out.println("[[YOURPLUGIN]] un-hooked from Clans.");
                }
            }
        }
    
        @Override
        public void onPluginEnable(PluginEnableEvent event) {
            if (plugin.Clans == null) {
                Plugin Clans = plugin.getServer().getPluginManager().getPlugin("Clans");
    
                if (Clans != null) {
                    if (Clans.isEnabled())
                    {
                        plugin.Clans = (Clans)Clans;
                        System.out.println("[[YOURPLUGIN]] hooked into Clans.");
                    }
                }
            }
        }
    }
    Next in your main plugin class:
    Import:
    Code:
    import com.bukkit.Satros.Clans.Clans;
    In your main plugin class declare:
    Code:
    public static Clans Clans = null;
    Once you do this you are able to use the 3 functions provided.
    Functions:
    Clans.useTags()
    //returns true or false on whether or not tags should be displayed at all. This should be checked first, if this is false then you essentially don't need to do anything.

    Clans.getColorAndTag(String playername)
    //Returns a string, colored tag given a player in the [Tag] form (with brackets and color pre-applied).

    Clans.LeftOrRight()
    //Returns a string "right" or "left" whether the tag should be displayed on the right or left side of a name.

    Here is example code of how clans should work with Chat Plugins within your PlayerListener.
    Code:
        public void onPlayerChat(PlayerChatEvent event)
        {
            String msg = event.getMessage();
            Player player = event.getPlayer();
            event.setCancelled(true);
            if ( [YOURPLUGIN].Clans.UseTags() ) //If clans allows the use of tags
            {
                    //Get pre-assembled tag
                    String tag = [YOURPLUGIN].Clans.getColorAndTag(player.getDisplayName());
                    if ( [YOURPLUGIN].Clans.LeftOrRight().equals("left") //if tag should be on the left
                           plugin.getServer().broadcastMessage(tag + " " + player.getDisplayName() + ": " + msg);
                    else //tag should be on the right
                           plugin.getServer().broadcastMessage(player.getDisplayName() + " " + tag  +  ": " + msg);
            }
            else //do whatever you would normally do
    
      }


    Screenshots:
    Teamchat and Clan Tags
    http://i.imgur.com/vmjvr.png
    Team List
    http://i.imgur.com/9oJ6q.png
    Team Info Command (My Own Team)
    http://i.imgur.com/VUbQc.png
    Team Info Command (Another Team)
    http://i.imgur.com/l4g7N.png
    Team Online Command
    http://i.imgur.com/OobGn.png

    To-Do (In Next Version)
    Change the internal structure
    Blacklisted Areas
    Area List and Area Info
    Area Info Rank Flag
    Optional Capture System
    --Optional Rewards System
    --Optional Score Sytem
    Fixing Rare Ranks Issue

    Planned for the Future
    MySQL Support
    Multiworld Support

    Demo
    Connect to Play.Kingdom-SMP.com:25565

    [​IMG]
    Like my work? Feel free to donate
    Donate

    Changelog:
    Show Spoiler

    Version 1.8.2
    • Fixed bug where people not on in a team wouldn't be able to kill each other with teamkill off by default
    Version 1.8.1
    • Fixed an issue with rank promotion
    • Fixed a bug where setting the team kill default to false wasn't working correctly
    Version 1.8
    • Added Permissions Prefix and Suffix Support for Clans Chat
    • Added API for Chat Plugin Developers to get players Clan Tags and related Config Options
    • No longer allows you to purchase defenses that have already been purchased.
    Version 1.7
    • Added iConomy Support
    • Added Anti-Friendly Fire Configs and Commands
    • Added /team help
    • More config options for clan tags
    • Team info now has rank numbers next to the rank name
    • Revamped the config file and made it less ambiguous
    • Small formatting changes for some errors
    • Creating a tag and color now gives feedback when successful
    • Teams.txt renamed to Teams.dat
    Version 1.6
    • Added config file
    Version 1.5
    • Added Permissions Support.
    Version 1.4
    • Added optional team area defenses for protecting bases.
    • Changed where the team data file is saved
    • Small miscellaneous bug fixes.
    Version 1.2
    • Changed the formatting and colors of the info, list, and t commands.
    • /team list now only displays teams with 2 or more members.
    • Added /team online, to see which members of your team are online.
    • Added a team MOTDs
    Version 1.1
    • Added more frequent saving of Teams
    Version 1
    • Initial Beta Release
     
  2. Offline

    LSky

    A system similar to the clans.invite permission node sounds like the solution to this. The leader can decide who can turn TK on or off, and the permission node can prevent this flag from being changed by non-admins.
     
  3. Offline

    Sleelin

    @Satros: use the onEnable function (mandatory for all plugins) to call a function which registers players in your plugin the same way they are registered when they log in, except you would iterate through "this.getServer().getOnlinePlayers()" which returns an array of online players of object type "Player".

    Looking forward to seeing this completed! (I too was about to program a mod called Guilds, similar to the factions mod, since it didn't do what I wanted it to do, and then I came across your plugin, which has all the functionality I had planned for mine, so thanks for that :D)

    Also, could you add a permissions node for whether or not clan tags will be displayed? That way you at least have partial multiworld support.

    Also also, feature request: multiworld support :D
     
  4. Offline

    thepackett

    is the only conflict with the war plugin the /team command?
     
  5. Great plugin, though I have a couple suggestions.

    1) A command to change the team name (e.g. /team name <name>)
    2) The ability to have spaces in team names (Perhaps by using ""?)

    I hope you read and consider these suggestions and thanks for your time making this plugin :).
     
  6. Offline

    WillTroll

    ..Why does it tell me I dont have permission to create a clan if Im the op/admin/owner of the server...
     
  7. Offline

    Joshprobert

    /team top

    statics of top clans would be very nice,
    eg - kills ect
    and can you add alliances and enemys?
     
  8. Offline

    Satros

    Yeah I believe so but I have not tested it myself.

    Sounds like a bug I must of forgotten to test. I will fix that up and release a 1.8.1 tomorrow. Sorry!

    Just set allow-tk-toggle to false, when I release 1.8.1 tomorrow team-kill-default will be fixed, or alternatively use permissions and don't include
    - 'clans.tktoggle'

    Just use permissions
    Perhaps I'll think about it

    1. I've been thinking about whether or not to add this, I may add this in the next version, if not I will add it in a later version most likely. For now if you really need it an admin can edit the Teams.dat file and restart the server
    2. Going to add this in 1.9, because ill be restructuring how the internals of the plugin works it shouldn't be that hard to do

    If you are admin it should work fine, that is if you are running permissions and you are listed in the admin group with -'*'. If you are running permissions and not in that category then that might be the reason. Also you can try adding under admin.
    - 'clans.all'

    Kill stats and a score system (all optional) will be added in 1.9, it is going to be a big release for the plugin.

    Anyways to all interested:
    1.8.1 - will be released tomorrow - Fixes team-kill-default: false and an issue with rank promotion flags
    1.9 - will be released in a week or so, revamped internal structure, hopefully will fix any problems with server reloading, new score/rewards system, kill stats, top teams, blacklisted areas, etc.
     
  9. Offline

    WillTroll

    Have done so, still did not work. Heh
     
  10. Offline

    Satros

    1.8.1 Has been released.
    Fixes the team-kill-default flag so that it works correctly
    also fixes a bug with rank promotion that would happen now and then.

    Thanks I'll look into that, also I've never used multiworlds, what does it need to do to support that?


    Are you using permissions 3.0 or the old version?
     
  11. Offline

    WillTroll

    I had been using essentials group managers, however I moved over to permissions 2.7. I gave myself permissions, but I get an internal server error when I try to create a team.
     
  12. Offline

    Pencil

    Use permissions 3.something, 2.7 doesn't work.

    Also @ Satros

    Now the tk on default works like it should, BUT there is a GIANT problem, people that don't have a team can't hit each other :/ using 1.81
     
  13. Offline

    WillTroll

    I shall permissions 3! Away!
     
  14. Offline

    kahlilnc

    In API my plugin would be herochat right? Caps sensitive?\
    NVM but is there a way to make this work with HeroChat?


    Permissions 2.7 works for me now on this new update. :D I am so happy.

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

    Sleelin

    @Satros: basically it's just gotta store one config and one clan file per world, so that people can have different clans in different worlds. Do some googling on world handling in the Bukkit API, should show up eventually.
     
  16. Offline

    Satros

    I've fixed it, 1.8.2 released, sorry I didn't catch that, that has probably been around since 1.8

    Okay ill add it to my list of stuff to do, thanks
     
  17. Offline

    Brody Romhanyi

    im getting that same silly msg everone else is getting when they try to create a clan. the on where you type /team create <name> then it says An internal error occured while attempting to perform this command. and i read what ppl wrote to other ppl having this problem and still didnt make sense why it is doing this plz help ASAP :D
     
  18. Offline

    j4ke002

    Can this work hand in hand with GroupSpawns? I want to be able to build Towns and villages that are owned by certain clans, and only members of that clan will be able to spawn in the town.
     
  19. Offline

    Satros

    1. Are you running Essentials or any other plugin listed under the conflicting plugins list
    2. Are you using Permissions 3.0?
    3. Test running it alone without any other plugins, does it work correctly? If so another plugin is conflicting with it
     
  20. Could you perhaps make a way to ally/enemy other clans :)?
     
  21. Offline

    Pencil

    Uhh, I was wondering if you could implement a max member config ^^
     
  22. Offline

    Bonkerz

    omg.. remove thoses conflicts..
     
  23. Offline

    Satros

    Sure should be easy enough
     
  24. Offline

    Pencil

    Awesome :) How is 1.9 coming along? Any ETA? If it still takes a while I will dl ur source and add that max member thing myself XD
     
  25. Offline

    llaraet

    hi when players have brought Gurdian protection , and all gropd is offline ,a player attacks a proteced block will the block be destryed too? or will the block be unbreakable and the player loses health for trying to destroy it.

    Thank You
     
  26. Offline

    MineFreakz

    I cant leave or create a team, i get this internal error:


    Code:
    2011-06-23 14:17:16 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'team' in plugin Clans v1.7
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:128)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:287)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:712)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:678)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:671)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NullPointerException
        at com.bukkit.Satros.Clans.Clans.onCommand(Clans.java:198)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    I am using permissions 3
     
  27. Offline

    noahstauff

    hey guys i have a problem. no one can kill eachother because when they do it says they are on your team friendly fire is off. but yet no one is on a team. please help.
    Noah
     
  28. Offline

    Satros

    Still awhile, it should be easy though, in your case you could just hardcode it even, in the /team invite section of Clans.java just add a check. If Teams.get(TeamUsers.get(Player.getDisplayName())).getTeamSize() < YOURNUMBER then go through with the invite, else send a message saying that the max is whatever you set it to.
    Kinda confusing on how to get team data in 1.8.2, 1.9 makes it a lot clearer, but thats how you would do it ^

    It will be destroyed but they will lose health for it, I will be adding full protection as an option later on

    What other plugins are you using? Also did you restart the server or only reload it because right now reloading doesnt always work for the plugin

    Are you using 1.8.2 and not 1.8.1? This was an issue in 1.8.1, try updating
     
  29. Offline

    Pencil

    Thanks for the update! I already hardcoded it but thanks anyways! :)
     
  30. Offline

    GmK

    @Satros

    You might want to change the download link actually leading to 1.8.2 ;)

    Also, seems to have some troubles on the recommended build, but not sure.
     
  31. Offline

    Satros

    Update: I'm sorry to say that my computer is fried at the moment. Because of this I can't do any coding and even support will be hard. I will resume once I get it fixed up, but it could be a few days to a week or more. Hopefully no 1.9 progress was lost...



    That would help wouldn't it >.<, fixed that thanks for pointing it out
     

Share This Page