add current Clan Outpost to travel shop

This commit is contained in:
Ben 2016-03-26 23:20:03 +00:00
parent 2070f0925d
commit a8bd0e4406
5 changed files with 37 additions and 2 deletions

View File

@ -99,6 +99,7 @@ import mineplex.game.clans.clans.redis.ClanLoadCommandHandler;
import mineplex.game.clans.clans.regions.ClansRegions;
import mineplex.game.clans.clans.scoreboard.ClansScoreboardManager;
import mineplex.game.clans.clans.siege.SiegeManager;
import mineplex.game.clans.clans.siege.outpost.OutpostManager;
import mineplex.game.clans.clans.staff.SilentChestOpen;
import mineplex.game.clans.clans.supplyDrop.SupplyDropManager;
import mineplex.game.clans.clans.tntGenerator.TntGeneratorManager;

View File

@ -621,4 +621,9 @@ public class Outpost implements Listener
return token;
}
public Location getCoreLocation()
{
return _core;
}
}

View File

@ -58,6 +58,11 @@ public class TravelButton implements IButton
return;
}
if (_location == null)
{
return;
}
if (player.getLocation().distance(_location) <= 64)
{
return;

View File

@ -12,7 +12,6 @@ import org.bukkit.inventory.meta.ItemMeta;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemBuilder;
@ -23,6 +22,8 @@ import mineplex.game.clans.clans.ClanInfo;
import mineplex.game.clans.clans.ClanRole;
import mineplex.game.clans.clans.ClansManager;
import mineplex.game.clans.clans.gui.ClanIcon;
import mineplex.game.clans.clans.siege.outpost.Outpost;
import mineplex.game.clans.shop.ClansShopItem;
import mineplex.game.clans.spawn.Spawn;
public class TravelPage extends ShopPageBase<ClansManager, TravelShop>
@ -73,9 +74,18 @@ public class TravelPage extends ShopPageBase<ClansManager, TravelShop>
C.cWhite + "as they are Safe Zones.",
}, 22 + 9 + 9, ClanIcon.CASTLE.getData());
final ClanInfo clan = _plugin.getClan(getPlayer());
Outpost outpost = _plugin.getSiegeManager().getOutpostManager().Get(clan);
addTravelLocation(outpost == null ? null : outpost.getCoreLocation().clone().add(0, 1, 0), ClansShopItem.OUTPOST.getMaterial(), (outpost == null ? C.cRedB : C.cDGreenB) + "Outpost", new String[] {
C.cWhite + "Teleport to your Clan's currently",
C.cWhite + "active Outpost.",
" ",
(outpost == null ? C.cRed + "Your Clan does not have an Outpost." : ""),
}, 8, ClanIcon.CASTLE.getData());
final ClanInfo clan = getPlugin().getClan(getPlayer());
final ItemStack item = new ItemStack(Material.BED, 1);
ItemMeta meta = item.getItemMeta();

View File

@ -17,7 +17,10 @@ import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.hologram.HologramManager;
import mineplex.core.npc.NpcManager;
import mineplex.core.updater.UpdateType;
@ -73,6 +76,17 @@ public class ClansMainTutorial extends Tutorial
getMessage().removePlayer(player);
player.teleport(Spawn.getNorthSpawn());
ClansManager.getInstance().getClanDataAccess().delete(ClansManager.getInstance().getClan(player), new Callback<Boolean>()
{
@Override
public void run(Boolean data)
{
if (data.booleanValue())
{
UtilPlayer.message(player, F.main("Clans", "Your Clan has been deleted."));
}
}
});
}
@Override