Inactive [TP/ADMN] WarpAllHere v2.1 - Warp all players online to a specific player [1.2.5-R1.0]

Discussion in 'Inactive/Unsupported Plugins' started by ItsHarry, Jul 4, 2011.

  1. Offline

    ItsHarry

  2. Offline

    ItsHarry

    Okay I think I found the problem!! Yay.
    I'll upload a new version soon :D
     
  3. Offline

    Yurikoma

    thanks looking forward to it XD
     
  4. Offline

    ItsHarry

    Woohoo v1.4.4 done! Hopefully all the permission problems are now fixed :D

    I uploaded the new version! I hope it fixes the problems =D

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

    Yurikoma


    warpallhere.*: works perfectly now though i would love it if you could allow it to also include all groups (such as warpallhere.admin) just makes it easier for people with a big group list, so they don't need to type up permissions for each of their groups also my group permissions are not working at all, if i say
    • /warpgrouphere Jailed
    • /warpgroupto Jailed yurikoma
    it just tells me i don't have permission to use the command even if i added warpallhere.Jailed: true to my groups permissions or if im op

    permission warpallhere.cantbewarped has a problem where the person is still warped if some one uses the command /warphere or /warpplayer on them
    All the below won't give the group who has them the permission to use the commands

    warpallhere.warpallhere: true
    warpallhere.warpallto: true
    warpallhere.events: true
    warpallhere.manageevents: true
    warpallhere.warpto: true
    warpallhere.warphere: true
    warpallhere.warpplayer: true

    warpallhere.*: true works but /warpgrouphere or /warpgroupto won't work at all

    still getting the the double message brodcast to the world when /warpallhere is used but only 1 message is brodcast when i use /warpallto

    Temporary fix for any1else having my problems:
    warpallhere.*: true can be used to activate all the commands except /warpgrouphere and /warpgroupto
    any group that you don't want to have a certain command add the permission but put false at the end and that group will not be able to use the command but can still use the others EG. warpallhere.warpallhere: false will stop members in that group from being able to use the /warpallhere command

    And I am really sorry about putting you through this. but i am basically testing everything in this when i get it and telling you the problems i am having. i hope it is helping you and I'm not just annoying you
     
  6. Offline

    ItsHarry

    Ah, found out what the error is for warpgroup commands, I forgot to write in the post the permissions nodes:
    warpallhere.warpgroupto
    warpallhere,warpgrouphere

    Add those and you'll be able to use the commands :D

    Version 1.4.5 is up.
    Pretty sure I fixed all the bugs this time :D

    Okay, I'm pretty sure I fixed all the bugs this time.

    The warpgroup commands problem was because I forgot to say that you need to add warpallhere.warpgroupto and warpallhere.warpgrouphere permissions nodes D:

    Also, I fixed the warpallhere.cantbewarped thingy.

    Last, I also found out why it broadcasts the message so many times, I accidentally put it inside the loop instead of after D:

    But it's all fixed now :D

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

    Yurikoma

    Great that solved the double message problem thanks

    warpallhere.cantbewarped tested and working perfectly. though /warpplayer should still allow a person to warp to a person who can't be warped, just not let them warp that person to them.

    Groups permissions now give permissions but when used result in

    /warpgrouphere Jailed i get a message saying /warpgrouphere [group] and the warp doesn't seem to work but my screen jumps slightly
    /warpgrouphere Jailed yurikoma i get a message saying /warpgrouphere [group] [player] and the warp doesn't seem to work but my screen jumps slightly
    NOTE yurikoma is in admin group another character is in Jailed group

     
  8. Offline

    ItsHarry

    v1.4.6. Last try. If it still doesn't work, I'm just gonna leave it for now.
     
  9. Offline

    Yurikoma

    lol i agree.

    ok i had a problem where yurikoma in group admin was calling himself when trying to call Jailed and warped Jailed when calling admin. Problem was i thought warpallhere.admin: true was used to allow that group to call admins when instead this is given to the admin group so that other people can warp the admin group to them

    /warpplayer <player> <player> is resulting in a message saying "CraftPlayer{name=yurikoma}was warped toCraftPlayer{name=zukisa} this only occurs if the warp from player 1 to player 2 can be done. this message appears before the you were warped to player by player message (warp does occur anyway)

    other then that i am happy to say everything is perfectly working everything else i have told you about has been fixed except anything in this post
     
  10. Offline

    ItsHarry

    Okay I'll fix that soon or later :D
     
  11. Offline

    Yurikoma

    thanks just whenever u can is fine it's only minor, so im not in any rush XD.
     
  12. Offline

    ItsHarry

    Thanks to you too btw, you helped me out a lot with all the bugfixes and stuff :D
     
  13. Offline

    Yurikoma

    No problem, im happy to help out with stuff like this, especially seeing it is something I have found very useful on my server. plus it is good to see you are nearly bug free

    I actually wouldn't mind creating some plugins of my own, but i have no idea how to or where to start
     
  14. Offline

    ItsHarry

    Well, you'll need to learn JAVA first. :(
     
  15. Offline

    Yurikoma

    lol yeah, well guess i may as well start experimenting things
     
  16. Offline

    ItsHarry

    K, I fixed the bug. :D
     
  17. Offline

    Yurikoma

    hopfully thats all of them XD ill test it right away

    All go
    all good here, no bugs to report, Congratulations all bugs have been completely removed, making this plugin now bug free.

    but can i make a suggestion. If /warpplayer is used and player1 who can't be warped tries to warp to player 2, it should allow him to warp seeing he is the one using the command. what do you think?

    also with start event i would love it if you can name the events like
    /startevent monster hunt night.
    and it says a message telling people the event monster hunt night has started use /goevent to go to the event.

    idk would just be good maybe this could even allow for multiple events like people could use /goevent <whatever the event is called> to go to the event.
    Only saying this because im running a multiworld server. and each world is owned by a different person, so multi event compatibility would be great

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

    ItsHarry

    Hmmm I'll see what I can do

    Also, /warpplayer is if you want to warp someone to another player.
    Use /warpto if you want to warp yourself =D

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

    Doidle

    When I try to port groups 2 to me or to somebody else I have to enter /warpgroupto [Groupname] [player]
    So I put in /warpgroupto guest anonymous
    and then it says: Group was warped to you.
    So bassicaly.. it doesn't warps Guest to me. It warps Group all the time.
    counts same for /warpgrouphere Guest
     
  20. Offline

    Yurikoma

    Give the group Guest a permission warpallhere.Guest (rember it is case sensitive so if your group is called guest instead of Guest, the permission will be warpallhere.guest instead.)
    and give the other groups a permission that is also named after them. (such as a group called admin will need a permission warpallhere.admin.)

    basically whatever group has the permission warpallhere.guest will be warped when you use /warpgrouphere guest

    hope that helps
     
    ItsHarry likes this.
  21. Offline

    ItsHarry

    "Group was warped to you" message is sent to the person you specified when using warpgroupto..
     
  22. Offline

    Yurikoma

    lolz maybe a future update can make it say the actual group name instead to make it clearer for people XD
     
  23. Offline

    Doidle

    yh well still doesn't works. ports nothing 2 me =)
     
  24. Offline

    Yurikoma

    I hate to ask this, but do you have any actual players in that group (apart form yourself)

    Also do you have the latest version, it has been updated 7 times in the past day after all, so just making sure
     
  25. Offline

    Doidle

    I downloaded it today, no I'm the only guy as a Owner.
    my server is also offline so I tested it out with minecraft SP and real minecraft so.
     
  26. Offline

    Zeroth

    Great plugin, super useful.

    @ItsHarry
    Any chance I could get a look at the source? I'd like to modify it so I can warp factions from the Factions plugin as a group.
     
  27. Offline

    ItsHarry

    Sure, it's only 1 class anyway:
    Code:
    package its.jh.WarpAllHerePlugin;
    
    import java.util.HashMap;
    import java.util.logging.Logger;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class WarpAllHerePlugin extends JavaPlugin {
    
        public Logger log = Logger.getLogger("Minecraft");
        public HashMap<Player, Location> original;
        public boolean event = false;
        public Location eventLoc;
    
        @Override
        public void onDisable() {
            log.warning("[WarpAllHere] WarpAllHere has been disabled.");
        }
    
        @Override
        public void onEnable() {
            original = new HashMap<Player, Location>();
            log.info("[WarpAllHere] WarpAllHere has been enabled!");
        }
    
        @Override
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            Player permPlayer = (Player) sender;
            if (command.getName().equalsIgnoreCase("warpplayer") || command.getName().equalsIgnoreCase("warpperson")) {
                if (!permPlayer.hasPermission("warpallhere.warpplayer") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission");
                    return true;
                }
                if (args.length != 2) {
                    sender.sendMessage("Wrong syntax! Use: /warpplayer [player1] [player2]");
                    return true;
                }
                Player player1 = Bukkit.getServer().getPlayer(args[0]);
                Player player2 = Bukkit.getServer().getPlayer(args[1]);
                if (player1 == null || player2 == null) {
                    sender.sendMessage("One of the players could not be found.");
                    return true;
                }
                if (!player1.isOnline() || !player2.isOnline()) {
                    sender.sendMessage("One of the players could not be found.");
                    return true;
                }
                if (player1.hasPermission("warpallhere.cantbewarped")) {
                    sender.sendMessage("One of the players may not be warped.");
                    return true;
                }
                if (player2.hasPermission("warpallhere.cantbewarpedto")) {
                    sender.sendMessage("One of the players may not be warped.");
                    return true;
                }
                player1.teleport(player2);
                sender.sendMessage(player1.getDisplayName() + "was warped to" + player2.getDisplayName());
                player1.sendMessage("You were warped to " + player2.getDisplayName() + " by " + sender.getName());
                player2.sendMessage(player1.getDisplayName() + " was warped to you by " + sender.getName());
                return true;
            } else if (command.getName().equalsIgnoreCase("warphere")) {
                if (!permPlayer.hasPermission("warpallhere.warphere") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission");
                    return true;
                }
                if (args.length != 1) {
                    sender.sendMessage("Wrong syntax! Use: /warphere [player]");
                    return true;
                }
                Player player = Bukkit.getServer().getPlayer(args[0]);
                if (player == null) {
                    sender.sendMessage("Player not found");
                    return true;
                }
                if (!player.isOnline()) {
                    sender.sendMessage("Player not found");
                    return true;
                }
                if (player.hasPermission("warpallhere.cantbewarped")) {
                    sender.sendMessage("This player may not be warped");
                    return true;
                }
                player.teleport((Player) sender);
                sender.sendMessage(player.getDisplayName() + " was warped to you.");
                player.sendMessage("You were warped to " + ((Player) sender).getName());
                return true;
            } else if (command.getName().equalsIgnoreCase("warpto")) {
                if (!permPlayer.hasPermission("warpallhere.warpto") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission");
                    return true;
                }
                if (args.length != 1) {
                    sender.sendMessage("Wrong Syntax! Use: /warpto [player]");
                    return true;
                }
                Player player = Bukkit.getServer().getPlayer(args[0]);
                if (player == null) {
                    sender.sendMessage("Player not found.");
                    return true;
                }
                if (!player.isOnline()) {
                    sender.sendMessage("Player not found.");
                    return true;
                }
                if (player.hasPermission("warpallhere.cantbewarpedto")) {
                    sender.sendMessage("This player disabled warp-to's");
                    return true;
                }
                Player guy = (Player) sender;
                guy.teleport(player);
                guy.sendMessage("You warped to " + player.getDisplayName());
                player.sendMessage(guy.getDisplayName() + " warped to you.");
                return true;
            } else if (command.getName().equalsIgnoreCase("warphelp")) {
                sender.sendMessage("Commands: ");
                sender.sendMessage("/goevent /returnevent - Warps you to/fro event if there is one.");
                sender.sendMessage("/startevent /stopevent - Starts or stops an event.");
                sender.sendMessage("/warpallhere /warpallto [player] - Warps all the players to you or a player.");
                sender.sendMessage("/warpgroupto [group] /warpgrouphere [group] - Warps a group");
                sender.sendMessage("/warphere [player] /warpto [player] - Warps you or someone else");
                sender.sendMessage("/warpplayer [player1] [player2] - Warps one player to the other.");
                sender.sendMessage("Plugin made by ItsHarry.");
            } else if (command.getName().equalsIgnoreCase("goevent")) {
                if (!permPlayer.hasPermission("warpallhere.events") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission to use this command.");
                    return true;
                }
                if (event) {
                    Player player = (Player) sender;
                    if (!original.containsKey(player)) {
                        original.put(player, player.getLocation());
                    }
                    player.teleport(eventLoc);
                    sender.sendMessage("You were warped to the event.");
                    return true;
                }
                sender.sendMessage("There's no event going on.");
                return true;
            } else if (command.getName().equalsIgnoreCase("returnevent")) {
                if (!permPlayer.hasPermission("warpallhere.events") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission to use this command.");
                    return true;
                }
                Player player = (Player) sender;
                if (original.containsKey(player)) {
                    player.teleport(original.get(player));
                    sender.sendMessage("You were warped from the event.");
                    original.remove(player);
                    return true;
                }
                sender.sendMessage("Your original position is unknown.");
                return true;
            } else if (command.getName().equalsIgnoreCase("startevent")) {
                if (!permPlayer.hasPermission("warpallhere.manageevents") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission to do this.");
                    return true;
                }
                event = true;
                Player sender1 = (Player) sender;
                eventLoc = sender1.getLocation();
                Bukkit.getServer().broadcastMessage(ChatColor.YELLOW + "An event has been started by " + sender1.getDisplayName() + "! Typ /goevent to join!");
                return true;
            } else if (command.getName().equalsIgnoreCase("stopevent")) {
                if (!permPlayer.hasPermission("warpallhere.manageevents") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission to do this.");
                    return true;
                }
                event = false;
                eventLoc = null;
                Bukkit.getServer().broadcastMessage(ChatColor.YELLOW + "The event has been stopped.");
                return true;
            } else if (command.getName().equalsIgnoreCase("warpallhere")) {
                if (!permPlayer.hasPermission("warpallhere.warpallhere") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage(ChatColor.RED + "You don't have permission to use this command.");
                    return true;
                }
                Player warpTo = (Player) sender;
                for (Player player : Bukkit.getServer().getOnlinePlayers()) {
                    if (!player.hasPermission("warpallhere.cantbewarped")) {
                        player.teleport(warpTo);
                    }
                }
                Bukkit.getServer().broadcastMessage(ChatColor.YELLOW + "Everybody was warped to " + warpTo.getDisplayName());
                log.info("[WarpAllHere] Everybody was warped to " + warpTo.getDisplayName());
                return true;
            } else if (command.getName().equalsIgnoreCase("warpallto")) {
                try {
                    if (!permPlayer.hasPermission("warpallhere.warpallto") || !permPlayer.hasPermission("warpallhere.*")) {
                        sender.sendMessage(ChatColor.RED + "You don't have permission to use this command.");
                        return true;
                    }
                    if (args.length != 1) {
                        sender.sendMessage(ChatColor.RED + "Wrong syntax: /warpallto [player]");
                        return true;
                    }
                    if (!Bukkit.getServer().getPlayer(args[0]).isOnline()) {
                        sender.sendMessage(ChatColor.RED + "Player " + args[0] + " could not be found.");
                        return true;
                    }
                    if (!Bukkit.getServer().getPlayer(args[0]).hasPermission("warpallhere.cantbewarpedto")) {
                        Player warpTo = Bukkit.getServer().getPlayer(args[0]);
                        for (Player player : Bukkit.getServer().getOnlinePlayers()) {
                            if (!player.hasPermission("warpallhere.cantbewarped")) {
                                player.teleport(warpTo);
                            }
                        }
                        Bukkit.getServer().broadcastMessage(ChatColor.YELLOW + "Everybody was warped to " + warpTo.getDisplayName());
                        log.info("[WarpAllHere] Everybody was warped to " + warpTo.getDisplayName());
                        return true;
                    }
                } catch (NullPointerException npe) {
                    sender.sendMessage(ChatColor.RED + "Player could not be found.");
                    return true;
                }
            } else if (command.getName().equalsIgnoreCase("warpgrouphere")) {
                if (args.length != 1) {
                    sender.sendMessage(ChatColor.RED + "Wrong syntax! Use: /warpgrouphere [group]");
                    return true;
                }
                if (!permPlayer.hasPermission("warpallhere.warpgrouphere") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission to use this command.");
                    return true;
                }
                Player warpTo = (Player) sender;
                for (Player player : Bukkit.getServer().getOnlinePlayers()) {
                    if (player.hasPermission("warpallhere." + args[0])) {
                        player.teleport(warpTo);
                        player.sendMessage("You were warped to " + sender.getName());
                    }
                }
                sender.sendMessage("Group was warped to you.");
                return true;
            } else if (command.getName().equalsIgnoreCase("warpgroupto")) {
                if (args.length != 2) {
                    sender.sendMessage(ChatColor.RED + "Wrong syntax! Use: /warpgrouphere [group] [targetplayer]");
                    return true;
                }
                if (!permPlayer.hasPermission("warpallhere.warpgroupto") || !permPlayer.hasPermission("warpallhere.*")) {
                    sender.sendMessage("You don't have permission to use this command.");
                    return true;
                }
                if (!Bukkit.getServer().getPlayer(args[1]).isOnline()) {
                    sender.sendMessage(ChatColor.RED + "Player " + args[1] + " could not be found.");
                    return true;
                }
                Player warpTo = Bukkit.getServer().getPlayer(args[1]);
                if (warpTo == null) {
                    sender.sendMessage("Player not found.");
                    return true;
                }
                if (!warpTo.isOnline()) {
                    sender.sendMessage("Player not found.");
                    return true;
                }
                if (warpTo.hasPermission("warpallhere.cantbewarpedto")) {
                    sender.sendMessage("This user disabled warp-to's");
                    return true;
                }
                for (Player player : Bukkit.getServer().getOnlinePlayers()) {
                    if (player.hasPermission("warpallhere." + args[0])) {
                        player.teleport(warpTo);
                        player.sendMessage("You were warped to " + warpTo.getDisplayName());
                    }
                }
                warpTo.sendMessage("Group was warped to you.");
                return true;
            }
            return false;
        }
    }
    
    There you go! :D
    Btw. Sorry if it's a bit messy XD

    Anyways.. The part you're looking for is probably this:
    Code:
    for (Player player : Bukkit.getServer().getOnlinePlayers()) {
    
                    if (player.hasPermission("warpallhere." + args[0])) {
    
                        player.teleport(warpTo);
    
                        player.sendMessage("You were warped to " + warpTo.getDisplayName());
    
                    }
    
                }
    Basically it just loops through the players, and checks if it has the permission used in the command.
    args[0] is the first argument the user used:
    /warpgroupto argument1 argument2
     
  28. Offline

    Zeroth

    Great, I really appreciate it!
     
  29. Offline

    ItsHarry

    No problem :D
     
  30. Offline

    ItsHarry

    Plugin updated to version 2.0
     
  31. Offline

    firefly431

    Hello! Please recompile with JDK 1.6! I'm on Mac OS 10.6 which uses JDK 1.6 - therefore I get: [SEVERE] Could not load 'plugins/WarpAllHere.jar' in folder 'plugins':
    java.lang.UnsupportedClassVersionError: its/jh/WarpAllHerePlugin/WarpAllHerePlugin : Unsupported major.minor version 51.0.
     

Share This Page