SteamWar/FightSystem
Archiviert
13
1

WIP: Starting 1.14 support #58

Manuell gemergt
Lixfel hat 7 Commits von 1_14-support nach master 2019-12-09 14:32:30 +01:00 zusammengeführt
9 geänderte Dateien mit 97 neuen und 15 gelöschten Zeilen
Nur Änderungen aus Commit ab9e32a7ca werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -0,0 +1,11 @@
package de.steamwar.fightsystem.utils;
import org.bukkit.DyeColor;
class ColorConverter_12 {
private ColorConverter_12(){}
static DyeColor getSilver(){
return DyeColor.SILVER;
}
}

42
FightSystem_14/pom.xml Normale Datei
Datei anzeigen

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>steamwar</groupId>
<artifactId>FightSystem</artifactId>
<version>1.0</version>
</parent>
<artifactId>FightSystem_14</artifactId>
<version>1.0</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.kt</exclude>
</excludes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>steamwar</groupId>
<artifactId>Spigot</artifactId>
<version>1.14</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>FightSystem_API</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -0,0 +1,11 @@
package de.steamwar.fightsystem.utils;
import org.bukkit.DyeColor;
class ColorConverter_14 {
private ColorConverter_14(){}
static DyeColor getSilver(){
return DyeColor.LIGHT_GRAY;
}
}

Datei anzeigen

@ -48,7 +48,7 @@
<dependency> <dependency>
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>Spigot</artifactId> <artifactId>Spigot</artifactId>
<version>1.8</version> <version>1.14</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -63,6 +63,12 @@
<version>1.0</version> <version>1.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>FightSystem_14</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>FightSystem_API</artifactId> <artifactId>FightSystem_API</artifactId>

Datei anzeigen

@ -28,11 +28,11 @@ public class GUI {
static void invitation(Player p, Player target){ static void invitation(Player p, Player target){
SWInventory inv = new SWInventory(target, 9, "Einladung von " + p.getName()); SWInventory inv = new SWInventory(target, 9, "Einladung von " + p.getName());
inv.setItem(0, Material.INK_SACK, (byte)10, "§aAnnehmen", (ClickType click) ->{ inv.setItem(0, SWItem.getDye(10), (byte)10, "§aAnnehmen", (ClickType click) ->{
Commands.acceptInvitation(target); Commands.acceptInvitation(target);
target.closeInventory(); target.closeInventory();
}); });
inv.setItem(8, Material.INK_SACK, (byte)1, "§cAblehnen", (ClickType click) ->{ inv.setItem(8, SWItem.getDye(1), (byte)1, "§cAblehnen", (ClickType click) ->{
Commands.declineInvitation(target); Commands.declineInvitation(target);
target.closeInventory(); target.closeInventory();
}); });
@ -94,11 +94,11 @@ public class GUI {
SWInventory inv = new SWInventory(p, 9, Config.GameName + "-Auswahl"); SWInventory inv = new SWInventory(p, 9, Config.GameName + "-Auswahl");
inv.setItem(8, Material.REDSTONE, "§eÖffentliches " + Config.GameName, (ClickType click) -> schemDialog(p, true)); inv.setItem(8, Material.REDSTONE, "§eÖffentliches " + Config.GameName, (ClickType click) -> schemDialog(p, true));
if(Config.OnlyPublicSchematics){ if(Config.OnlyPublicSchematics){
inv.setItem(0, Material.INK_SACK, (byte)8, "§7Keine privaten Schematics erlaubt", (ClickType click)->{}); inv.setItem(0, SWItem.getDye(8), (byte)8, "§7Keine privaten Schematics erlaubt", (ClickType click)->{});
}else if(Schematic.getSchemsOfType(p.getUniqueId(), Config.SchematicType).isEmpty() && !Config.test()){ }else if(Schematic.getSchemsOfType(p.getUniqueId(), Config.SchematicType).isEmpty() && !Config.test()){
inv.setItem(0, Material.INK_SACK, (byte)8, "§7Kein privates " + Config.GameName + " vorhanden", (ClickType click)->{}); inv.setItem(0, SWItem.getDye(8), (byte)8, "§7Kein privates " + Config.GameName + " vorhanden", (ClickType click)->{});
}else{ }else{
inv.setItem(0, Material.CAULDRON_ITEM, "§ePrivates " + Config.GameName, (ClickType click) -> schemDialog(p, false)); inv.setItem(0, SWItem.getMaterial("CAULDRON_ITEM"), "§ePrivates " + Config.GameName, (ClickType click) -> schemDialog(p, false));
} }
inv.setCallback(-999, (ClickType click) -> p.closeInventory()); inv.setCallback(-999, (ClickType click) -> p.closeInventory());
inv.open(); inv.open();

Datei anzeigen

@ -7,7 +7,11 @@ import de.steamwar.core.Core;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.kit.KitManager; import de.steamwar.fightsystem.kit.KitManager;
import de.steamwar.fightsystem.utils.*; import de.steamwar.fightsystem.utils.ColorConverter;
import de.steamwar.fightsystem.utils.FightScoreboard;
import de.steamwar.fightsystem.utils.ItemBuilder;
import de.steamwar.fightsystem.utils.TechHider;
import de.steamwar.inventory.SWItem;
import de.steamwar.sql.Schematic; import de.steamwar.sql.Schematic;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
import javafx.util.Pair; import javafx.util.Pair;
@ -188,10 +192,10 @@ public class FightTeam implements IFightTeam{
inventory.setItem(1, new ItemBuilder(Material.AIR).build()); inventory.setItem(1, new ItemBuilder(Material.AIR).build());
if(!Config.event()){ if(!Config.event()){
inventory.setItem(2, new ItemBuilder(Material.PAPER).removeAllAttributs().setDisplayName("§eSpieler einladen").build()); inventory.setItem(2, new ItemBuilder(Material.PAPER).removeAllAttributs().setDisplayName("§eSpieler einladen").build());
inventory.setItem(3, new ItemBuilder(Material.FIREWORK_CHARGE).removeAllAttributs().setDisplayName("§cSpieler rauswerfen").build()); inventory.setItem(3, new ItemBuilder(Material.getMaterial("FIREWORK_CHARGE")).removeAllAttributs().setDisplayName("§cSpieler rauswerfen").build());
inventory.setItem(4, new ItemBuilder(Material.INK_SACK, (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build()); inventory.setItem(4, new ItemBuilder(Material.getMaterial("INK_SACK"), (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build());
} }
inventory.setItem(0, new ItemBuilder(Material.CAULDRON_ITEM).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§e" + Config.GameName + " wählen").build()); inventory.setItem(0, new ItemBuilder(Material.getMaterial("CAULDRON_ITEM")).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§e" + Config.GameName + " wählen").build());
} }
public Set<FightPlayer> getPlayers() { public Set<FightPlayer> getPlayers() {
@ -270,13 +274,13 @@ public class FightTeam implements IFightTeam{
this.ready = ready; this.ready = ready;
if(ready) { if(ready) {
l.getInventory().setItem(4, new ItemBuilder(Material.INK_SACK, (short) 8).removeAllAttributs().addEnchantment(Enchantment.DURABILITY,1 ).setDisplayName("§aBereit").build()); l.getInventory().setItem(4, new ItemBuilder(SWItem.getDye(8), (short) 8).removeAllAttributs().addEnchantment(Enchantment.DURABILITY,1 ).setDisplayName("§aBereit").build());
broadcast(FightSystem.PREFIX + "§aEuer Team ist nun bereit!"); broadcast(FightSystem.PREFIX + "§aEuer Team ist nun bereit!");
if(Fight.getOpposite(this).isReady() || Config.test()) { if(Fight.getOpposite(this).isReady() || Config.test()) {
FightSystem.setPreRunningState(); FightSystem.setPreRunningState();
} }
} else { } else {
l.getInventory().setItem(4, new ItemBuilder(Material.INK_SACK, (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build()); l.getInventory().setItem(4, new ItemBuilder(SWItem.getDye(10), (short) 10).removeAllAttributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build());
broadcast(FightSystem.PREFIX + "§cEuer Team ist nicht mehr bereit!"); broadcast(FightSystem.PREFIX + "§cEuer Team ist nicht mehr bereit!");
} }
} }

Datei anzeigen

@ -1,5 +1,6 @@
package de.steamwar.fightsystem.utils; package de.steamwar.fightsystem.utils;
import de.steamwar.core.Core;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
@ -20,7 +21,6 @@ public class ColorConverter {
chat2dye.put(ChatColor.GREEN, DyeColor.LIME); chat2dye.put(ChatColor.GREEN, DyeColor.LIME);
chat2dye.put(ChatColor.RED, DyeColor.RED); chat2dye.put(ChatColor.RED, DyeColor.RED);
chat2dye.put(ChatColor.DARK_GRAY, DyeColor.GRAY); chat2dye.put(ChatColor.DARK_GRAY, DyeColor.GRAY);
chat2dye.put(ChatColor.GRAY, DyeColor.SILVER);
chat2dye.put(ChatColor.DARK_AQUA, DyeColor.CYAN); chat2dye.put(ChatColor.DARK_AQUA, DyeColor.CYAN);
chat2dye.put(ChatColor.DARK_PURPLE, DyeColor.PURPLE); chat2dye.put(ChatColor.DARK_PURPLE, DyeColor.PURPLE);
chat2dye.put(ChatColor.DARK_BLUE, DyeColor.BLUE); chat2dye.put(ChatColor.DARK_BLUE, DyeColor.BLUE);
@ -28,8 +28,15 @@ public class ColorConverter {
chat2dye.put(ChatColor.DARK_GREEN, DyeColor.GREEN); chat2dye.put(ChatColor.DARK_GREEN, DyeColor.GREEN);
chat2dye.put(ChatColor.DARK_RED, DyeColor.RED); chat2dye.put(ChatColor.DARK_RED, DyeColor.RED);
chat2dye.put(ChatColor.BLACK, DyeColor.BLACK); chat2dye.put(ChatColor.BLACK, DyeColor.BLACK);
//Rosa 9pink, Braun 3brown //Rosa 9pink, Braun 3brown
switch(Core.getVersion()){
case 14:
chat2dye.put(ChatColor.GRAY, ColorConverter_14.getSilver());
break;
default:
chat2dye.put(ChatColor.GRAY, ColorConverter_12.getSilver());
}
} }
public static DyeColor chat2dye(ChatColor color){ public static DyeColor chat2dye(ChatColor color){

Datei anzeigen

@ -80,7 +80,7 @@ public class WaterRemover {
if (anchor.getType() == Material.STATIONARY_WATER) if (anchor.getType() == Material.STATIONARY_WATER)
collected.add(anchor); collected.add(anchor);
if(visitedBlocks.size() > 50) { if(visitedBlocks.size() > 100) {
collected.clear(); collected.clear();
return; return;
} }

Datei anzeigen

@ -39,6 +39,7 @@
<module>FightSystem_API</module> <module>FightSystem_API</module>
<module>FightSystem_8</module> <module>FightSystem_8</module>
<module>FightSystem_12</module> <module>FightSystem_12</module>
<module>FightSystem_14</module>
<module>FightSystem_Main</module> <module>FightSystem_Main</module>
</modules> </modules>