Examples of TeleportState


Examples of net.sacredlabyrinth.phaed.simpleclans.TeleportState

    {
        int secs = SimpleClans.getInstance().getSettingsManager().getWaitSecs();

        if (SimpleClans.getInstance().hasUUID())
        {
            waitingPlayers.put(player.getUniqueId().toString(), new TeleportState(player, dest, clanName));
        } else
        {
            waitingPlayers.put(player.getName(), new TeleportState(player, dest, clanName));
        }

        if (secs > 0)
        {
            ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("waiting.for.teleport.stand.still.for.0.seconds"), secs));
View Full Code Here

Examples of net.sacredlabyrinth.phaed.simpleclans.TeleportState

            @Override
            public void run()
            {
                for (Iterator iter = waitingPlayers.values().iterator(); iter.hasNext(); )
                {
                    TeleportState state = (TeleportState) iter.next();

                    if (state.isProcessing())
                    {
                        continue;
                    }
                    state.setProcessing(true);

                    Player player = state.getPlayer();

                    if (player != null)
                    {
                        if (state.isTeleportTime())
                        {
                            if (Helper.isSameBlock(player.getLocation(), state.getLocation()))
                            {
                                Location loc = state.getDestination();

                                int x = loc.getBlockX();
                                int z = loc.getBlockZ();

                                if (plugin.getSettingsManager().isTeleportBlocks()) {
                                    player.sendBlockChange(new Location(loc.getWorld(), x + 1, loc.getBlockY() - 1, z + 1), Material.GLASS, (byte) 0);
                                    player.sendBlockChange(new Location(loc.getWorld(), x - 1, loc.getBlockY() - 1, z - 1), Material.GLASS, (byte) 0);
                                    player.sendBlockChange(new Location(loc.getWorld(), x + 1, loc.getBlockY() - 1, z - 1), Material.GLASS, (byte) 0);
                                    player.sendBlockChange(new Location(loc.getWorld(), x - 1, loc.getBlockY() - 1, z + 1), Material.GLASS, (byte) 0);
                                }
                               
                                if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.keep-items"))
                                {
                                    dropItems(player);
                                }

                                SimpleClans.debug("teleporting");

                                player.teleport(new Location(loc.getWorld(), loc.getBlockX() + .5, loc.getBlockY(), loc.getBlockZ() + .5));

                                ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("now.at.homebase"), state.getClanName()));
                            }
                            else
                            {
                                ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.moved.teleport.cancelled"));
                            }

                            iter.remove();
                        }
                        else
                        {
                            if (!Helper.isSameBlock(player.getLocation(), state.getLocation()))
                            {
                                ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.moved.teleport.cancelled"));
                                iter.remove();
                            }
                            else
                            {
                                ChatBlock.sendMessage(player, ChatColor.AQUA + "" + state.getCounter());
                            }
                        }
                    }
                    else
                    {
                        iter.remove();
                    }

                    state.setProcessing(false);
                }
            }
        }, 0, 20L);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.