hotfixes; split up public and private list;
Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
d9b6c124eb
Commit
fac373b5be
@ -173,8 +173,18 @@ public class AkCommand implements CommandExecutor {
|
|||||||
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
||||||
if(fightTeam != null) {
|
if(fightTeam != null) {
|
||||||
if(fightTeam.getFightPlayer(player).isLeader()) {
|
if(fightTeam.getFightPlayer(player).isLeader()) {
|
||||||
Fight.getPlayerTeam(player).sendPlayerSchematicList(Integer.parseInt(args[1]), 15, player, Config.SchematicType);
|
if(args[0].equalsIgnoreCase("public")) {
|
||||||
|
Fight.getPlayerTeam(player).sendPlayerSchematicList(false, Integer.parseInt(args[1]), 15, player, Config.SchematicType);
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
int page;
|
||||||
|
try {
|
||||||
|
page = Integer.parseInt(args[1]);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Fight.getPlayerTeam(player).sendPlayerSchematicList(false, page, 15, player, Config.SchematicType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
|
@ -205,9 +205,16 @@ public class FightTeam {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void sendPlayerSchematicList(int currentPage, int filesPerPage, Player player, SchematicType schematicType) {
|
public void sendPlayerSchematicList(boolean publicSchematics, int currentPage, int filesPerPage, Player player, SchematicType schematicType) {
|
||||||
List<Schematic> preSchematicList = Schematic.getSchemsAccessibleByUser(player.getUniqueId());
|
|
||||||
|
List<Schematic> preSchematicList;
|
||||||
List<Schematic> schematicList = new ArrayList<>();
|
List<Schematic> schematicList = new ArrayList<>();
|
||||||
|
if(publicSchematics) {
|
||||||
|
preSchematicList = Schematic.getSchemsOfType(0, schematicType);
|
||||||
|
} else {
|
||||||
|
preSchematicList = Schematic.getSchemsAccessibleByUser(player.getUniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
for(Schematic s : preSchematicList) {
|
for(Schematic s : preSchematicList) {
|
||||||
if(s.getSchemType() == schematicType)
|
if(s.getSchemType() == schematicType)
|
||||||
schematicList.add(s);
|
schematicList.add(s);
|
||||||
|
@ -10,6 +10,11 @@ import me.yaruma.fightsystem.utils.countdown.Countdown;
|
|||||||
import me.yaruma.fightsystem.utils.countdown.CountdownType;
|
import me.yaruma.fightsystem.utils.countdown.CountdownType;
|
||||||
import me.yaruma.fightsystem.utils.countdown.FinishSetupOver;
|
import me.yaruma.fightsystem.utils.countdown.FinishSetupOver;
|
||||||
import me.yaruma.fightsystem.utils.inventory.SetupItems;
|
import me.yaruma.fightsystem.utils.inventory.SetupItems;
|
||||||
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -32,14 +37,32 @@ public class PlayerJoinListener implements Listener {
|
|||||||
player.getInventory().clear();
|
player.getInventory().clear();
|
||||||
|
|
||||||
if (Fight.getPlayerTeam(player) == null) {
|
if (Fight.getPlayerTeam(player) == null) {
|
||||||
|
|
||||||
|
//TEXT COMPONENTS
|
||||||
|
TextComponent publicList = new TextComponent("public");
|
||||||
|
publicList.setColor(ChatColor.GOLD);
|
||||||
|
publicList.setBold(true);
|
||||||
|
publicList.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§ePublic Liste...").create()));
|
||||||
|
publicList.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schemlist public"));
|
||||||
|
|
||||||
|
TextComponent privateList = new TextComponent("private");
|
||||||
|
publicList.setColor(ChatColor.GOLD);
|
||||||
|
publicList.setBold(true);
|
||||||
|
publicList.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§ePrivate Liste...").create()));
|
||||||
|
publicList.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schemlist 0"));
|
||||||
|
|
||||||
|
publicList.addExtra(privateList);
|
||||||
|
player.spigot().sendMessage(publicList);
|
||||||
|
//TEXT COMPONENTS
|
||||||
|
|
||||||
if(!Fight.getRedTeam().hasTeamLeader()) {
|
if(!Fight.getRedTeam().hasTeamLeader()) {
|
||||||
Fight.getRedTeam().setLeader(new FightPlayer(player, false));
|
Fight.getRedTeam().setLeader(new FightPlayer(player, false));
|
||||||
Fight.getRedTeam().sendPlayerSchematicList(0, 15, player, Config.SchematicType);
|
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
|
player.spigot().sendMessage(publicList);
|
||||||
} else if(!Fight.getBlueTeam().hasTeamLeader()) {
|
} else if(!Fight.getBlueTeam().hasTeamLeader()) {
|
||||||
Fight.getBlueTeam().setLeader(new FightPlayer(player, false));
|
Fight.getBlueTeam().setLeader(new FightPlayer(player, false));
|
||||||
Fight.getBlueTeam().sendPlayerSchematicList(0, 15, player, Config.SchematicType);
|
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
|
player.spigot().sendMessage(publicList);
|
||||||
} else {
|
} else {
|
||||||
player.setGameMode(GameMode.SPECTATOR);
|
player.setGameMode(GameMode.SPECTATOR);
|
||||||
player.teleport(Config.SpecSpawn);
|
player.teleport(Config.SpecSpawn);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren