Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
1cc57539e4
Commit
6ee276ca82
@ -24,11 +24,11 @@ import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.listener.Recording;
|
||||
import de.steamwar.fightsystem.record.GlobalRecorder;
|
||||
import de.steamwar.fightsystem.record.REntity;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.minecraft.server.v1_8_R3.*;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
import net.royawesome.jlibnoise.MathHelper;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -56,18 +56,6 @@ public class BountifulWrapper8 implements BountifulWrapper.IBountifulWrapper {
|
||||
return p.getInventory().getItemInHand().getType() == Material.BOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toActionbar(Player player, BaseComponent... components) {
|
||||
PacketPlayOutChat packet = new PacketPlayOutChat(new ChatComponentText(BaseComponent.toLegacyText(components)), (byte)2);
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toChat(Player player, BaseComponent... components) {
|
||||
PacketPlayOutChat packet = new PacketPlayOutChat(new ChatComponentText(BaseComponent.toLegacyText(components)), (byte)0);
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttackSpeed(Player player) {
|
||||
// nothing to do
|
||||
|
@ -25,8 +25,6 @@ import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.listener.Recording;
|
||||
import de.steamwar.fightsystem.record.GlobalRecorder;
|
||||
import de.steamwar.fightsystem.record.REntity;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeInstance;
|
||||
@ -69,16 +67,6 @@ public class BountifulWrapper9 implements BountifulWrapper.IBountifulWrapper {
|
||||
return (mainHand ? p.getInventory().getItemInMainHand() : p.getInventory().getItemInOffHand()).getType() == Material.BOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toActionbar(Player player, BaseComponent... components) {
|
||||
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toChat(Player player, BaseComponent... components) {
|
||||
player.spigot().sendMessage(ChatMessageType.CHAT, components);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttackSpeed(Player player) {
|
||||
AttributeInstance attribute = player.getAttribute(Attribute.GENERIC_ATTACK_SPEED);
|
||||
|
@ -113,6 +113,56 @@ SPECTATE_COUNTDOWN=bis die Arena zur
|
||||
|
||||
# Fight
|
||||
SCHEMATIC_UNLOADABLE=§cSchematic konnte nicht geladen werden
|
||||
SCHEMATIC_CHOSEN=§7{0} §e{1} §7gewählt
|
||||
TEAM_READY=§aTeam bereit
|
||||
TEAM_NOT_READY=§c§mTeam bereit
|
||||
SKIP_READY=§aBeschleunigung zum nächsten Event
|
||||
SKIP_NOT_READY=§c§mBeschleunigung zum nächsten Event
|
||||
TEAM_CHAT={0}{1}§8» {0}{2}
|
||||
CHOOSE_KIT=§eKit wählen
|
||||
RESPAWN=§eRespawn
|
||||
INVITE_PLAYERS=§eSpieler einladen
|
||||
REMOVE_PLAYERS=§cSpieler rauswerfen
|
||||
CHOOSE_SCHEMATIC=§e{0} wählen
|
||||
SCHEMATIC_REQUIRED=§cZuerst muss eine Schematic gewählt sein
|
||||
|
||||
KIT_PREVIEW_EDIT=§7Kit bearbeiten
|
||||
KIT_PREVIEW_CHOOSE=§aKit wählen
|
||||
KIT_PREVIEW_BACK=§cZurück
|
||||
KIT_PREVIEW_DELETE=§cKit löschen
|
||||
KIT_DELETION_CONFIRMATION=Kit wirklich löschen?
|
||||
KIT_DELETION_ABORT=§cAbbrechen
|
||||
KIT_DELETION_DELETE=§aLöschen
|
||||
|
||||
|
||||
# Listener
|
||||
NO_ARENA_LEAVING=§cDu darfst die Arena nicht verlassen
|
||||
CHECK_JOIN_DENIED=§cAuf diesem Server wird momentan eine Schematic geprüft!
|
||||
CHECK_COMMAND_LOCKED=§cDieser Befehl ist beim Prüfen gesperrt! Admin wird benachrichtigt.
|
||||
NO_BLOCK_BREAK=§cDu darfst derzeit keine Blöcke abbauen
|
||||
NO_BLOCK_PLACE=§cDu darfst derzeit keine Blöcke setzen
|
||||
NO_BOW_USAGE=§cDu darfst den Bogen erst nach Kampfbeginn nutzen
|
||||
NO_PARTICIPANT=§cDu bist kein Kampfteilnehmer
|
||||
NO_FRIENDLY_FIRE=§cDu darfst deinen Teamkollegen keinen Schaden zufügen
|
||||
NO_TNT_PLACE=§cDu darfst kein TNT setzen
|
||||
NO_TELEPORT=§cDu darfst diese Teleportfunktion nicht benutzen
|
||||
OPEN_INVENTORY_TO_CUSTOMIZE=§eInventar zum Anpassen des Kits öffnen
|
||||
RESOURCEPACK_REQUIRED=§cAuf Eventserver kann nur mit dem SteamWar-Resourcepack beigetreten werden\n§cDa du abgelehnt hast, musst du nun in der Serverliste erst einmal wieder Ressourcenpakete von SteamWar aktivieren
|
||||
NO_ENTERN=§cDu darfst nicht entern
|
||||
NO_TEAMAREA=§cDu darfst nicht zu den Teams
|
||||
TEST_BECOME_LEADER=§7Werde zum Teamleader mit §8/§eleader
|
||||
|
||||
|
||||
# Replay
|
||||
REPLAY_ENDS=§cReplay beendet
|
||||
|
||||
|
||||
# States
|
||||
COMMAND_CURRENTLY_UNAVAILABLE=§cDieser Befehl ist zu diesem Kampfzeitpunkt nicht verfügbar
|
||||
|
||||
|
||||
# Utils
|
||||
TPS_WARNING=§c{0} §7TPS
|
||||
|
||||
|
||||
# Winconditions
|
||||
|
@ -35,8 +35,6 @@ import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.sql.Schematic;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -45,7 +43,6 @@ import org.bukkit.scoreboard.NameTagVisibility;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
||||
public class FightTeam {
|
||||
@ -195,10 +192,8 @@ public class FightTeam {
|
||||
players.forEach((player, fp) -> FightSystem.getMessage().send(message, player, params));
|
||||
}
|
||||
|
||||
public void broadcastChat(String message) {
|
||||
FightSystem.getPlugin().getLogger().log(Level.INFO, message);
|
||||
BaseComponent[] msg = TextComponent.fromLegacyText(message);
|
||||
players.forEach((player, fp) -> BountifulWrapper.impl.toChat(player, msg));
|
||||
public void broadcastChat(Player sender, String message) {
|
||||
players.forEach((player, fp) -> FightSystem.getMessage().sendPrefixless("TEAM_CHAT", player, ChatMessageType.CHAT, prefix, sender.getName(), message));
|
||||
}
|
||||
|
||||
public void addMember(Player player) {
|
||||
@ -215,8 +210,8 @@ public class FightTeam {
|
||||
BountifulWrapper.impl.setAttackSpeed(player);
|
||||
player.teleport(spawn);
|
||||
if(Kit.getAvailableKits(false).size() > 1 || Config.PersonalKits)
|
||||
player.getInventory().setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§eKit wählen").build());
|
||||
player.getInventory().setItem(7, new ItemBuilder(Material.BEACON).removeAllAttributs().setDisplayName("§eRespawn").build());
|
||||
player.getInventory().setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName(FightSystem.getMessage().parse("CHOOSE_KIT", player)).build());
|
||||
player.getInventory().setItem(7, new ItemBuilder(Material.BEACON).removeAllAttributs().setDisplayName(FightSystem.getMessage().parse("RESPAWN", player)).build());
|
||||
if(ArenaMode.NotOnBau.contains(Config.mode))
|
||||
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> new TablistNamePacket(SteamwarUser.get(player.getUniqueId()).getId(), prefix + player.getName()).send(player), 5);
|
||||
GlobalRecorder.getInstance().playerJoins(player);
|
||||
@ -293,23 +288,22 @@ public class FightTeam {
|
||||
if(!Config.PersonalKits)
|
||||
leader.setKit(Kit.getKitByName(Config.LeaderDefault));
|
||||
|
||||
Player player = leader.getPlayer();
|
||||
Inventory inventory = leader.getPlayer().getInventory();
|
||||
if (Kit.getAvailableKits(true).size() > 1)
|
||||
inventory.setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§eKit wählen").build());
|
||||
else if(Config.PersonalKits)
|
||||
inventory.setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§eKit bearbeiten").build());
|
||||
if (Kit.getAvailableKits(true).size() > 1 || Config.PersonalKits)
|
||||
inventory.setItem(1, new ItemBuilder(Material.LEATHER_CHESTPLATE).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName(FightSystem.getMessage().parse("CHOOSE_KIT", player)).build());
|
||||
else
|
||||
inventory.setItem(1, new ItemBuilder(Material.AIR).build());
|
||||
|
||||
if(!ArenaMode.RankedEvent.contains(Config.mode)){
|
||||
inventory.setItem(2, new ItemBuilder(Material.PAPER).removeAllAttributs().setDisplayName("§eSpieler einladen").build());
|
||||
inventory.setItem(3, new ItemBuilder(SWItem.getMaterial("FIREWORK_CHARGE")).removeAllAttributs().setDisplayName("§cSpieler rauswerfen").build());
|
||||
inventory.setItem(2, new ItemBuilder(Material.PAPER).removeAllAttributs().setDisplayName(FightSystem.getMessage().parse("INVITE_PLAYERS", player)).build());
|
||||
inventory.setItem(3, new ItemBuilder(SWItem.getMaterial("FIREWORK_CHARGE")).removeAllAttributs().setDisplayName(FightSystem.getMessage().parse("REMOVE_PLAYERS", player)).build());
|
||||
}
|
||||
|
||||
inventory.setItem(4, new ItemBuilder(SWItem.getDye(10), (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build());
|
||||
inventory.setItem(4, new ItemBuilder(SWItem.getDye(10), (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName(FightSystem.getMessage().parse("TEAM_NOT_READY", player)).build());
|
||||
|
||||
if(Config.test() || FightState.getFightState() != FightState.POST_SCHEM_SETUP)
|
||||
inventory.setItem(0, new ItemBuilder(SWItem.getMaterial("CAULDRON_ITEM")).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§e" + Config.GameName + " wählen").build());
|
||||
inventory.setItem(0, new ItemBuilder(SWItem.getMaterial("CAULDRON_ITEM")).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName(FightSystem.getMessage().parse("CHOOSE_SCHEMATIC", player, Config.GameName)).build());
|
||||
|
||||
if(FightState.getFightState() == FightState.PRE_LEADER_SETUP && !Fight.getOpposite(this).isLeaderless()){
|
||||
FightSystem.setPreSchemState();
|
||||
@ -348,40 +342,40 @@ public class FightTeam {
|
||||
|
||||
public void setSchem(Schematic schematic){
|
||||
this.schematic.setSchematic(schematic);
|
||||
broadcast("§e" + Config.GameName + " " + schematic.getSchemName() + " §7gewählt");
|
||||
broadcast("SCHEMATIC_CHOSEN", Config.GameName, schematic.getSchemName());
|
||||
}
|
||||
|
||||
public void setReady(boolean ready) {
|
||||
Player l = leader.getPlayer();
|
||||
|
||||
if(!schematic.hasSchematic()){
|
||||
BountifulWrapper.impl.toActionbar(l, TextComponent.fromLegacyText("§cZuerst muss eine Schematic gewählt sein!"));
|
||||
FightSystem.getMessage().sendPrefixless("SCHEMATIC_REQUIRED", l, ChatMessageType.ACTION_BAR);
|
||||
return;
|
||||
}
|
||||
|
||||
this.ready = ready;
|
||||
if(ready) {
|
||||
l.getInventory().setItem(4, new ItemBuilder(SWItem.getDye(8), (short) 8).removeAllAttributs().addEnchantment(Enchantment.DURABILITY,1 ).setDisplayName("§aBereit").build());
|
||||
broadcast("§aTeam bereit");
|
||||
l.getInventory().setItem(4, new ItemBuilder(SWItem.getDye(8), (short) 8).removeAllAttributs().addEnchantment(Enchantment.DURABILITY,1 ).setDisplayName(FightSystem.getMessage().parse("TEAM_READY", l)).build());
|
||||
broadcast("TEAM_READY");
|
||||
if(Fight.getOpposite(this).isReady() || ArenaMode.SoloLeader.contains(Config.mode))
|
||||
FightSystem.setPreRunningState();
|
||||
} else {
|
||||
l.getInventory().setItem(4, new ItemBuilder(SWItem.getDye(10), (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build());
|
||||
broadcast("§c§mTeam bereit");
|
||||
l.getInventory().setItem(4, new ItemBuilder(SWItem.getDye(10), (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName(FightSystem.getMessage().parse("TEAM_NOT_READY", l)).build());
|
||||
broadcast("TEAM_NOT_READY");
|
||||
}
|
||||
}
|
||||
|
||||
public void skip(){
|
||||
this.skip = !skip;
|
||||
if(skip){
|
||||
broadcast("§aBeschleunigung zum nächsten Event");
|
||||
broadcast("SKIP_READY");
|
||||
if(Fight.getOpposite(this).skip || Config.test()){
|
||||
skip = false;
|
||||
Fight.getOpposite(this).skip = false;
|
||||
Countdown.skip();
|
||||
}
|
||||
}else{
|
||||
broadcast("§c§mBeschleunigung zum nächsten Event");
|
||||
broadcast("SKIP_NOT_READY");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,12 +287,12 @@ public class Kit {
|
||||
|
||||
inv.setCallback(-999, click -> player.closeInventory());
|
||||
if(Config.PersonalKits){
|
||||
inv.setItem(49, SWItem.getMaterial("WOOD_AXE"), "§7Kit bearbeiten", clickType -> PersonalKitCreator.openKitCreator(player, PersonalKit.get(SteamwarUser.get(player.getUniqueId()).getId(), Config.SchematicType.toDB(), name)));
|
||||
inv.setItem(53, Material.BARRIER, "§cKit löschen", clickType -> {
|
||||
inv.setItem(49, SWItem.getMaterial("WOOD_AXE"), FightSystem.getMessage().parse("KIT_PREVIEW_EDIT", player), clickType -> PersonalKitCreator.openKitCreator(player, PersonalKit.get(SteamwarUser.get(player.getUniqueId()).getId(), Config.SchematicType.toDB(), name)));
|
||||
inv.setItem(53, Material.BARRIER, FightSystem.getMessage().parse("KIT_PREVIEW_DELETE", player), clickType -> {
|
||||
player.closeInventory();
|
||||
SWInventory conf = new SWInventory(player, 9, "Kit wirklich löchen?");
|
||||
conf.setItem(8, SWItem.getDye(1), "§cAbbrechen", click -> player.closeInventory());
|
||||
conf.setItem(0, SWItem.getDye(10), "§aLöschen", click -> {
|
||||
SWInventory conf = new SWInventory(player, 9, FightSystem.getMessage().parse("KIT_DELETION_CONFIRMATION", player));
|
||||
conf.setItem(8, SWItem.getDye(1), FightSystem.getMessage().parse("KIT_DELETION_ABORT", player), click -> player.closeInventory());
|
||||
conf.setItem(0, SWItem.getDye(10), FightSystem.getMessage().parse("KIT_DELETION_DELETE", player), click -> {
|
||||
player.closeInventory();
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
PersonalKit kit = PersonalKit.get(user.getId(), Config.SchematicType.toDB(), name);
|
||||
@ -311,11 +311,11 @@ public class Kit {
|
||||
conf.open();
|
||||
});
|
||||
}
|
||||
inv.setItem(45, SWItem.getDye(10), (byte)10, "§aKit wählen", click -> {
|
||||
inv.setItem(45, SWItem.getDye(10), (byte)10, FightSystem.getMessage().parse("KIT_PREVIEW_CHOOSE", player), click -> {
|
||||
Commands.kit(player, name);
|
||||
player.closeInventory();
|
||||
});
|
||||
inv.setItem(53, SWItem.getDye(1), (byte)1, "§cZurück", click -> GUI.kitSelection(player, ""));
|
||||
inv.setItem(53, SWItem.getDye(1), (byte)1, FightSystem.getMessage().parse("KIT_PREVIEW_BACK", player), click -> GUI.kitSelection(player, ""));
|
||||
inv.open();
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,12 @@ package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -70,6 +71,6 @@ public class ArenaBorder implements Listener {
|
||||
private void reset(PlayerMoveEvent event){
|
||||
Player player = event.getPlayer();
|
||||
player.teleport(event.getFrom());
|
||||
BasicListener.toActionbar(player, TextComponent.fromLegacyText("§cDu darfst die Arena nicht verlassen"));
|
||||
FightSystem.getMessage().sendPrefixless("NO_ARENA_LEAVING", player, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
}
|
||||
|
@ -20,8 +20,6 @@
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.utils.BountifulWrapper;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class BasicListener {
|
||||
@ -30,8 +28,4 @@ public class BasicListener {
|
||||
public static boolean notFighting(Player p){
|
||||
return Fight.getFightPlayer(p) == null;
|
||||
}
|
||||
|
||||
public static void toActionbar(Player player, BaseComponent... components){
|
||||
BountifulWrapper.impl.toActionbar(player, components);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.core.BountifulWrapper;
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
@ -27,7 +28,7 @@ import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.record.GlobalRecorder;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.fightsystem.utils.BountifulWrapper;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -49,11 +50,12 @@ public class Chat implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
String message = event.getMessage();
|
||||
|
||||
FightSystem.getPlugin().getLogger().log(Level.INFO, player.getName() + "» " + message);
|
||||
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
||||
if(fightTeam != null) {
|
||||
String teamName = fightTeam.getColoredName();
|
||||
if(message.startsWith(Config.TeamChatDetection)) {
|
||||
fightTeam.broadcastChat(teamName + " " + player.getName() + "» " + message.substring(1));
|
||||
fightTeam.broadcastChat(player, message.substring(1));
|
||||
} else {
|
||||
broadcastChat(teamName + " " + player.getName() + "§8» §7" + message);
|
||||
}
|
||||
@ -68,9 +70,7 @@ public class Chat implements Listener {
|
||||
|
||||
private void broadcastChat(String message) {
|
||||
GlobalRecorder.getInstance().chat(message);
|
||||
FightSystem.getPlugin().getLogger().log(Level.INFO, message);
|
||||
BaseComponent[] msg = TextComponent.fromLegacyText(message);
|
||||
for(Player p : Bukkit.getOnlinePlayers())
|
||||
BountifulWrapper.impl.toChat(p, msg);
|
||||
Bukkit.getOnlinePlayers().forEach(p -> BountifulWrapper.impl.sendMessage(p, ChatMessageType.CHAT, msg));
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.sql.Schematic;
|
||||
@ -53,7 +54,7 @@ public class Check implements Listener {
|
||||
if(user.getId() == schem.getSchemOwner())
|
||||
return;
|
||||
|
||||
player.sendMessage("§cAuf diesem Server wird momentan eine Schematic geprüft!");
|
||||
FightSystem.getMessage().send("CHECK_JOIN_DENIED", player);
|
||||
player.kickPlayer("");
|
||||
}
|
||||
|
||||
@ -64,7 +65,7 @@ public class Check implements Listener {
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
player.sendMessage("§cDieser Befehl ist beim Prüfen gesperrt! Admin wird benachrichtigt.");
|
||||
FightSystem.getMessage().send("CHECK_COMMAND_LOCKED", player);
|
||||
Bukkit.getLogger().log(Level.SEVERE, player.getName() + " tried to use a copy command!");
|
||||
}
|
||||
|
||||
|
@ -20,10 +20,11 @@
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.fightsystem.utils.BountifulWrapper;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -50,14 +51,14 @@ public class DenyWorldInteraction implements Listener {
|
||||
public void handleBlockBreak(BlockBreakEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
event.setCancelled(true);
|
||||
BasicListener.toActionbar(player, TextComponent.fromLegacyText("§cDu darfst derzeit keine Blöcke abbauen!"));
|
||||
FightSystem.getMessage().sendPrefixless("NO_BLOCK_BREAK", player, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void handleBlockPlace(BlockPlaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
event.setCancelled(true);
|
||||
BasicListener.toActionbar(player, TextComponent.fromLegacyText("§cDu darfst derzeit keine Blöcke setzen!"));
|
||||
FightSystem.getMessage().sendPrefixless("NO_BLOCK_PLACE", player, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -88,7 +89,7 @@ public class DenyWorldInteraction implements Listener {
|
||||
event.setCancelled(true);
|
||||
if(event.getEntity().getShooter() instanceof Player){
|
||||
Player player = (Player) event.getEntity().getShooter();
|
||||
BasicListener.toActionbar(player, TextComponent.fromLegacyText("§cDu darfst den Bogen erst nach Kampfbeginn nutzen!"));
|
||||
FightSystem.getMessage().sendPrefixless("NO_BOW_USAGE", player, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class EventJoin implements Listener {
|
||||
user.getId() == FightSystem.getEventFight().getKampfleiter())
|
||||
return;
|
||||
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "§cDu bist kein Kampfteilnehmer");
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, FightSystem.getMessage().parse("NO_PARTICIPANT", player));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -90,7 +90,7 @@ public class EventJoin implements Listener {
|
||||
return;
|
||||
}
|
||||
if(Config.LiveReplay)
|
||||
player.kickPlayer("§cDu bist kein Kampfteilnehmer");
|
||||
player.kickPlayer(FightSystem.getMessage().parse("NO_PARTICIPANT", player));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -21,6 +21,7 @@ package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.commands.GUI;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
@ -59,32 +60,17 @@ public class HotbarGUI implements Listener {
|
||||
if(displayName == null)
|
||||
return;
|
||||
|
||||
if(displayName.equals("§e" + Config.GameName + " wählen")){
|
||||
GUI.preSchemDialog(player);
|
||||
return;
|
||||
onMatch(player, displayName, "CHOOSE_SCHEMATIC", () -> GUI.preSchemDialog(player), Config.GameName);
|
||||
onMatch(player, displayName, "INVITE_PLAYERS", () -> GUI.chooseInvitation(player));
|
||||
onMatch(player, displayName, "REMOVE_PLAYERS", () -> GUI.chooseRemove(player));
|
||||
onMatch(player, displayName, "TEAM_NOT_READY", () -> fightTeam.setReady(true));
|
||||
onMatch(player, displayName, "TEAM_READY", () -> fightTeam.setReady(false));
|
||||
onMatch(player, displayName, "CHOOSE_KIT", () -> GUI.kitSelection(player, ""));
|
||||
onMatch(player, displayName, "RESPAWN", () -> player.teleport(fightTeam.getSpawn()));
|
||||
}
|
||||
|
||||
switch (displayName) {
|
||||
case "§cSpieler rauswerfen":
|
||||
GUI.chooseRemove(player);
|
||||
break;
|
||||
case "§eSpieler einladen":
|
||||
GUI.chooseInvitation(player);
|
||||
break;
|
||||
case "§cNicht bereit":
|
||||
fightTeam.setReady(true);
|
||||
break;
|
||||
case "§aBereit":
|
||||
fightTeam.setReady(false);
|
||||
break;
|
||||
case "§eKit bearbeiten":
|
||||
case "§eKit wählen":
|
||||
GUI.kitSelection(player, "");
|
||||
break;
|
||||
case "§eRespawn":
|
||||
player.teleport(fightTeam.getSpawn());
|
||||
break;
|
||||
|
||||
}
|
||||
private void onMatch(Player player, String displayName, String message, Runnable run, Object... params) {
|
||||
if(displayName.equals(FightSystem.getMessage().parse(message, player, params)))
|
||||
run.run();
|
||||
}
|
||||
}
|
||||
|
@ -20,10 +20,11 @@
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -83,7 +84,7 @@ public class InFightDamage implements Listener {
|
||||
event.getDamager().setFireTicks(0);
|
||||
player.setFireTicks(0);
|
||||
}
|
||||
BasicListener.toActionbar(damager, TextComponent.fromLegacyText("§cDu darfst deinen Teamkollegen keinen Schaden zufügen!"));
|
||||
FightSystem.getMessage().sendPrefixless("NO_FRIENDLY_FIRE", damager, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
|
||||
if(player.getHealth() - event.getFinalDamage() <= 0){
|
||||
|
@ -20,12 +20,13 @@
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightPlayer;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.fightsystem.utils.FlatteningWrapper;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -111,7 +112,7 @@ public class InFightInventory implements Listener {
|
||||
public void onBlockPlace(BlockPlaceEvent e) {
|
||||
FightPlayer fp = Fight.getFightPlayer(e.getPlayer());
|
||||
if(fp != null && !fp.getKit().isTnt() && e.getBlockPlaced().getType() == Material.TNT){
|
||||
BasicListener.toActionbar(e.getPlayer(), TextComponent.fromLegacyText("§cDu darfst kein TNT setzen!"));
|
||||
FightSystem.getMessage().sendPrefixless("NO_TNT_PLACE", e.getPlayer(), ChatMessageType.ACTION_BAR);
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import de.steamwar.fightsystem.record.REntity;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -64,8 +64,8 @@ public class Permanent implements Listener {
|
||||
public void onTpGM3(PlayerTeleportEvent e) {
|
||||
if (e.getCause() == PlayerTeleportEvent.TeleportCause.SPECTATE) {
|
||||
e.setCancelled(true);
|
||||
BasicListener.toActionbar(e.getPlayer(), TextComponent.fromLegacyText("§cDu darfst diese Teleportfunktion nicht benutzen!"));
|
||||
e.getPlayer().kickPlayer("§cDu darfst diese Teleportfunktion nicht benutzen!");
|
||||
FightSystem.getMessage().sendPrefixless("NO_TELEPORT", e.getPlayer(), ChatMessageType.ACTION_BAR);
|
||||
e.getPlayer().kickPlayer(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ import de.steamwar.fightsystem.fight.Kit;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.sql.PersonalKit;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
@ -58,7 +58,7 @@ public class PersonalKitCreator implements Listener {
|
||||
new InventoryBackup(player, kit);
|
||||
new Kit(kit).loadToPlayer(player);
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
BasicListener.toActionbar(player, TextComponent.fromLegacyText("§eInventar zum Anpassen des Kits öffnen§8!"));
|
||||
FightSystem.getMessage().sendPrefixless("OPEN_INVENTORY_TO_CUSTOMIZE", player, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
|
||||
public static boolean inKitCreator(HumanEntity player){
|
||||
|
@ -29,8 +29,7 @@ public class ResourcePack implements Listener {
|
||||
return;
|
||||
|
||||
Player player = e.getPlayer();
|
||||
player.sendMessage(FightSystem.PREFIX + "§cAuf Eventserver kann nur mit dem SteamWar-Resourcepack beigetreten werden");
|
||||
player.sendMessage(FightSystem.PREFIX + "§cDa du abgelehnt hast, musst du nun in der Serverliste erst einmal wieder Ressourcenpakete von SteamWar aktivieren.");
|
||||
FightSystem.getMessage().sendPrefixless("RESOURCEPACK_REQUIRED", player);
|
||||
player.kickPlayer(null);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.fightsystem.utils.Region;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -42,9 +42,6 @@ import java.util.logging.Level;
|
||||
|
||||
public class TeamArea implements Listener {
|
||||
|
||||
private static final String DENY_TEAM = "§cDu darfst nicht zu den Teams";
|
||||
private static final String DENY_ENTERN = "§cDu darfst nicht entern";
|
||||
|
||||
private static final Set<Player> realSpectator = new HashSet<>();
|
||||
|
||||
public TeamArea() {
|
||||
@ -78,16 +75,16 @@ public class TeamArea implements Listener {
|
||||
if(spectator) {
|
||||
realSpectator(inRegion, player);
|
||||
} else if (!playerTeam.canPlayerEntern(player) && !inRegion) {
|
||||
reset(event, DENY_ENTERN); // Leaving prior to entern
|
||||
reset(event, "NO_ENTERN"); // Leaving prior to entern
|
||||
}
|
||||
return; // Always allowed in own region
|
||||
}
|
||||
|
||||
if(inRegion) {
|
||||
reset(event, DENY_TEAM); // Not allowed in region
|
||||
reset(event, "NO_TEAMAREA"); // Not allowed in region
|
||||
if(team.getSchemRegion().playerInRegion(event.getTo()) && Config.PreperationArea >= 5){ // Preventing false positives due to small extension
|
||||
player.kickPlayer(null);
|
||||
Bukkit.getLogger().log(Level.INFO, player.getName() + " ist in einen Teambereich eingedrungen.");
|
||||
Bukkit.getLogger().log(Level.INFO, player.getName() + " has entered a team area");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -105,6 +102,6 @@ public class TeamArea implements Listener {
|
||||
private void reset(PlayerMoveEvent event, String message){
|
||||
Player player = event.getPlayer();
|
||||
player.teleport(event.getFrom());
|
||||
BasicListener.toActionbar(player, TextComponent.fromLegacyText(message));
|
||||
FightSystem.getMessage().sendPrefixless(message, player, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class TestJoin implements Listener {
|
||||
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
||||
|
||||
if (fightTeam == null && (Fight.getRedTeam().isLeaderless() || Fight.getBlueTeam().isLeaderless())) {
|
||||
player.sendMessage(FightSystem.PREFIX + "§7Werde zum Teamleader mit §8/§eleader");
|
||||
FightSystem.getMessage().send("TEST_BECOME_LEADER", player);
|
||||
}
|
||||
|
||||
player.setOp(true);
|
||||
|
@ -29,7 +29,6 @@ import de.steamwar.fightsystem.countdown.EventSpectateCountdown;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.fight.FreezeWorld;
|
||||
import de.steamwar.fightsystem.listener.BasicListener;
|
||||
import de.steamwar.fightsystem.listener.FightScoreboard;
|
||||
import de.steamwar.fightsystem.utils.*;
|
||||
import de.steamwar.sql.Schematic;
|
||||
@ -235,19 +234,7 @@ public class PacketProcessor {
|
||||
String message = source.readUTF();
|
||||
|
||||
BaseComponent[] text = TextComponent.fromLegacyText(message);
|
||||
Bukkit.getOnlinePlayers().forEach(p -> {
|
||||
switch(type){
|
||||
case CHAT:
|
||||
BountifulWrapper.impl.toChat(p, text);
|
||||
break;
|
||||
case SYSTEM:
|
||||
p.spigot().sendMessage(text);
|
||||
break;
|
||||
case ACTION_BAR:
|
||||
BasicListener.toActionbar(p, text);
|
||||
break;
|
||||
}
|
||||
});
|
||||
Bukkit.getOnlinePlayers().forEach(p -> de.steamwar.core.BountifulWrapper.impl.sendMessage(p, type, text));
|
||||
}
|
||||
|
||||
private void countdown() throws IOException {
|
||||
@ -411,7 +398,7 @@ public class PacketProcessor {
|
||||
if(Config.replayserver() || ArenaMode.AntiReplay.contains(Config.mode)) {
|
||||
FightSystem.setSpectateState(null, "Replay ends", null);
|
||||
}else{
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cReplay beendet");
|
||||
FightSystem.getMessage().broadcast("REPLAY_ENDS");
|
||||
new EventSpectateCountdown().enable();
|
||||
}
|
||||
replaying = false;
|
||||
|
@ -21,6 +21,7 @@ package de.steamwar.fightsystem.states;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
|
||||
@ -29,7 +30,7 @@ import java.util.Set;
|
||||
public class StateDependentCommand extends StateDependent {
|
||||
|
||||
private static final CommandExecutor unavailable = (sender, cmd, s, strings) -> {
|
||||
sender.sendMessage(FightSystem.PREFIX + "§cDieser Befehl ist zu diesem Kampfzeitpunkt nicht verfügbar.");
|
||||
FightSystem.getMessage().sendPrefixless("COMMAND_CURRENTLY_UNAVAILABLE", sender, ChatMessageType.ACTION_BAR);
|
||||
return false;
|
||||
};
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.fightsystem.VersionDependent;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -37,9 +36,6 @@ public class BountifulWrapper {
|
||||
boolean mainHand(Object packet);
|
||||
boolean bowInHand(boolean mainHand, Player p);
|
||||
|
||||
void toActionbar(Player player, BaseComponent... components);
|
||||
void toChat(Player player, BaseComponent... components);
|
||||
|
||||
void setAttackSpeed(Player player);
|
||||
|
||||
void setNametagVisibility(Team team);
|
||||
|
@ -30,8 +30,6 @@ import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
||||
import de.steamwar.fightsystem.states.StateDependentTask;
|
||||
import de.steamwar.fightsystem.winconditions.Wincondition;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -138,10 +136,8 @@ public class FightUI {
|
||||
|
||||
private void tpsWatcher() {
|
||||
double tps = TPSWatcher.getTPS();
|
||||
if(tps < 15.0) {
|
||||
BaseComponent[] message = TextComponent.fromLegacyText("§c" + tps + " §7TPS");
|
||||
Bukkit.getOnlinePlayers().forEach(player -> BountifulWrapper.impl.toActionbar(player, message));
|
||||
}
|
||||
if(tps < 15.0)
|
||||
FightSystem.getMessage().broadcastActionbar("TPS_WARNING", tps);
|
||||
}
|
||||
|
||||
public enum BossBarType {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren