Fixed merge conflicts

This commit is contained in:
AlexTheCoder 2017-09-23 03:48:03 -04:00
parent 8fcf821092
commit e76c9e55d2
2 changed files with 55 additions and 58 deletions

View File

@ -79,8 +79,34 @@ public class ClansServerPage extends ShopPageBase<ClansTransferManager, ClansSer
private void buildNoClanPage() private void buildNoClanPage()
{ {
Collection<ServerInfo> servers = UtilAlg.sortSet(getPlugin().getServers(true), (o1, o2) -> Collection<ServerInfo> servers = UtilAlg.sortSet(getPlugin().getServers(true), (o1, o2) ->
{
try
{
Integer server1;
Integer server2;
if (o1.Name.contains("-"))
{
server1 = Integer.parseInt(o1.Name.substring(o1.Name.lastIndexOf('-') + 1));
}
else
{
server1 = Integer.parseInt(o1.Name);
}
if (o2.Name.contains("-"))
{
server2 = Integer.parseInt(o2.Name.substring(o2.Name.lastIndexOf('-') + 1));
}
else
{
server2 = Integer.parseInt(o2.Name);
}
return server1.compareTo(server2);
}
catch (NumberFormatException ex)
{ {
return o1.Name.compareTo(o2.Name); return o1.Name.compareTo(o2.Name);
}
}); });
int currentSlot = 9; int currentSlot = 9;
@ -155,8 +181,34 @@ public class ClansServerPage extends ShopPageBase<ClansTransferManager, ClansSer
} }
Collection<ServerInfo> servers = UtilAlg.sortSet(getPlugin().getServers(true), (o1, o2) -> Collection<ServerInfo> servers = UtilAlg.sortSet(getPlugin().getServers(true), (o1, o2) ->
{
try
{
Integer server1;
Integer server2;
if (o1.Name.contains("-"))
{
server1 = Integer.parseInt(o1.Name.substring(o1.Name.lastIndexOf('-') + 1));
}
else
{
server1 = Integer.parseInt(o1.Name);
}
if (o2.Name.contains("-"))
{
server2 = Integer.parseInt(o2.Name.substring(o2.Name.lastIndexOf('-') + 1));
}
else
{
server2 = Integer.parseInt(o2.Name);
}
return server1.compareTo(server2);
}
catch (NumberFormatException ex)
{ {
return o1.Name.compareTo(o2.Name); return o1.Name.compareTo(o2.Name);
}
}); });
int currentSlot = 27; int currentSlot = 27;

View File

@ -7,10 +7,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityPortalEnterEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
@ -19,10 +17,6 @@ import mineplex.core.MiniDbClientPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.account.permissions.Permission; import mineplex.core.account.permissions.Permission;
import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.npc.event.NpcDamageByEntityEvent; import mineplex.core.npc.event.NpcDamageByEntityEvent;
@ -190,55 +184,6 @@ public class ClansTransferManager extends MiniDbClientPlugin<SimpleClanToken>
}); });
} }
@EventHandler
public void onEnterPortal(EntityPortalEnterEvent event)
{
if (!(event.getEntity() instanceof Player))
{
UtilAction.velocity(event.getEntity(), UtilAlg.getTrajectory(event.getEntity().getLocation(), _hub.GetSpawn()), 1, true, 0.5, 0, 1.0, true);
return;
}
Player player = (Player) event.getEntity();
if (!_hub.CanPortal(player))
{
UtilAction.velocity(player, UtilAlg.getTrajectory(player.getLocation(), _hub.GetSpawn()), 1, true, 0.5, 0, 1.0, true);
return;
}
if (_party.getPartyByPlayer(player) != null)
{
player.playSound(player.getLocation(), Sound.ITEM_BREAK, 1, .6f);
player.sendMessage(F.main("Party", "You cannot join Clans while in a party."));
UtilAction.velocity(player, UtilAlg.getTrajectory(player.getLocation(), _hub.GetSpawn()), 1, true, 0.5, 0, 1.0, true);
return;
}
if (!Recharge.Instance.use(player, "Transfer Portal", 5000, false, false))
{
return;
}
if (Get(player) == null || Get(player).getHomeServer() == null || Get(player).getHomeServer().isEmpty())
{
player.teleport(_hub.GetSpawn());
runSyncLater(() ->
{
_serverShop.attemptShopOpen(player);
}, 20L);
return;
}
if (getServer(Get(player).getHomeServer()) != null)
{
UtilPlayer.message(player, F.main(getName(), "You are being transferred to your Clan's home server!"));
selectServer(player, getServer(Get(player).getHomeServer()));
}
else
{
UtilPlayer.message(player, F.main(getName(), "Your Clan's home server is not online!"));
}
}
@EventHandler @EventHandler
public void onUseNPC(NpcInteractEntityEvent event) public void onUseNPC(NpcInteractEntityEvent event)
{ {