Fixing Skull generation for 1.14+ #25
@ -1,8 +1,7 @@
|
||||
package de.steamwar.inventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
class SWItem_10 {
|
||||
private SWItem_10(){}
|
||||
@ -15,7 +14,7 @@ class SWItem_10 {
|
||||
return SWItem_8.getDye();
|
||||
}
|
||||
|
||||
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
|
||||
SWItem_8.setSkullOwner(player, meta);
|
||||
static ItemStack setSkullOwner(String player){
|
||||
return SWItem_8.setSkullOwner(player);
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package de.steamwar.inventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
class SWItem_12 {
|
||||
private SWItem_12(){}
|
||||
@ -15,7 +14,7 @@ class SWItem_12 {
|
||||
return SWItem_8.getDye();
|
||||
}
|
||||
|
||||
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
|
||||
meta.setOwningPlayer(player);
|
||||
static ItemStack setSkullOwner(String player){
|
||||
return SWItem_8.setSkullOwner(player);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package de.steamwar.inventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
class SWItem_14 {
|
||||
@ -48,7 +48,13 @@ class SWItem_14 {
|
||||
}
|
||||
}
|
||||
|
||||
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
|
||||
SWItem_12.setSkullOwner(player, meta);
|
||||
static ItemStack setSkullOwner(String player){
|
||||
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
|
||||
SkullMeta headmeta = (SkullMeta) head.getItemMeta();
|
||||
assert headmeta != null;
|
||||
headmeta.setOwner(player);
|
||||
headmeta.setDisplayName(player);
|
||||
head.setItemMeta(headmeta);
|
||||
return head;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package de.steamwar.inventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
class SWItem_15 {
|
||||
private SWItem_15(){}
|
||||
@ -15,7 +14,7 @@ class SWItem_15 {
|
||||
return SWItem_14.getDye(colorCode);
|
||||
}
|
||||
|
||||
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
|
||||
SWItem_12.setSkullOwner(player, meta);
|
||||
static ItemStack setSkullOwner(String player){
|
||||
return SWItem_14.setSkullOwner(player);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package de.steamwar.inventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
class SWItem_8 {
|
||||
@ -15,7 +15,12 @@ class SWItem_8 {
|
||||
return Material.INK_SACK;
|
||||
}
|
||||
|
||||
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
|
||||
meta.setOwner(player.getName());
|
||||
static ItemStack setSkullOwner(String player){
|
||||
ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
|
||||
SkullMeta headmeta = (SkullMeta) head.getItemMeta();
|
||||
headmeta.setOwner(player);
|
||||
headmeta.setDisplayName(player);
|
||||
head.setItemMeta(headmeta);
|
||||
return head;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package de.steamwar.inventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
class SWItem_9 {
|
||||
private SWItem_9(){}
|
||||
@ -15,7 +14,7 @@ class SWItem_9 {
|
||||
return SWItem_8.getDye();
|
||||
}
|
||||
|
||||
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
|
||||
SWItem_8.setSkullOwner(player, meta);
|
||||
static ItemStack setSkullOwner(String player){
|
||||
return SWItem_8.setSkullOwner(player);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -19,30 +18,31 @@ public class SWItem {
|
||||
private InvCallback callback;
|
||||
|
||||
public static SWItem getPlayerSkull(OfflinePlayer player){
|
||||
return getPlayerSkull(player.getName());
|
||||
}
|
||||
|
||||
public static SWItem getPlayerSkull(String playerName){
|
||||
SWItem p = new SWItem();
|
||||
ItemStack head = new ItemStack(getMaterial("SKULL_ITEM"), 1, (short) 3);
|
||||
SkullMeta headmeta = (SkullMeta) head.getItemMeta();
|
||||
ItemStack head;
|
||||
switch(Core.getVersion()){
|
||||
case 8:
|
||||
SWItem_8.setSkullOwner(player, headmeta);
|
||||
head = SWItem_8.setSkullOwner(playerName);
|
||||
break;
|
||||
case 9:
|
||||
SWItem_9.setSkullOwner(player, headmeta);
|
||||
head = SWItem_9.setSkullOwner(playerName);
|
||||
break;
|
||||
case 10:
|
||||
SWItem_10.setSkullOwner(player, headmeta);
|
||||
head = SWItem_10.setSkullOwner(playerName);
|
||||
break;
|
||||
case 14:
|
||||
SWItem_14.setSkullOwner(player, headmeta);
|
||||
head = SWItem_14.setSkullOwner(playerName);
|
||||
break;
|
||||
case 15:
|
||||
SWItem_15.setSkullOwner(player, headmeta);
|
||||
head = SWItem_15.setSkullOwner(playerName);
|
||||
break;
|
||||
default:
|
||||
SWItem_12.setSkullOwner(player, headmeta);
|
||||
head = SWItem_12.setSkullOwner(playerName);
|
||||
}
|
||||
headmeta.setDisplayName(player.getName());
|
||||
head.setItemMeta(headmeta);
|
||||
p.setItemStack(head);
|
||||
return p;
|
||||
}
|
||||
|
53
SpigotCore_Main/src/de/steamwar/sql/FightStatistic.java
Normale Datei
53
SpigotCore_Main/src/de/steamwar/sql/FightStatistic.java
Normale Datei
@ -0,0 +1,53 @@
|
||||
package de.steamwar.sql;
|
||||
|
||||
public class FightStatistic {
|
||||
|
||||
private final int fightID;
|
||||
private final int eventFightID;
|
||||
private final String gamemode;
|
||||
private final String arena;
|
||||
private final int leaderBlue;
|
||||
private final int schematicBlue;
|
||||
private final int leaderRed;
|
||||
private final int schematicRed;
|
||||
private final int winner; // 0: even, 1: blue, 2: red
|
||||
|
||||
public FightStatistic(int fightID, int eventFightID, String gamemode, String arena, int leaderBlue, int schematicBlue, int leaderRed, int schematicRed, int winner){
|
||||
this.fightID = fightID;
|
||||
this.eventFightID = eventFightID;
|
||||
this.gamemode = gamemode;
|
||||
this.arena = arena;
|
||||
this.leaderBlue = leaderBlue;
|
||||
this.schematicBlue = schematicBlue;
|
||||
this.leaderRed = leaderRed;
|
||||
this.schematicRed = schematicRed;
|
||||
this.winner = winner;
|
||||
SQL.update("INSERT INTO FightStatistic (" +
|
||||
"FightID, EventFightID, Gamemode, Arena, LeaderBlue, SchematicBlue, LeaderRed, SchematicRed, Winner" +
|
||||
") VALUES (" +
|
||||
fightID + ", " + eventFightID + ", '" + gamemode + "', '" + arena + "', " + leaderBlue + ", "
|
||||
")");
|
||||
}
|
||||
|
||||
public int getFightID() {
|
||||
return fightID;
|
||||
}
|
||||
|
||||
public static class FightMember{
|
||||
private final int fightID;
|
||||
private final int userID;
|
||||
private final String kit;
|
||||
private final int tntPlaced; //?
|
||||
private final int kills;
|
||||
private final boolean dead;
|
||||
|
||||
public FightMember(int fightID, int userID, String kit, int tntPlaced, int kills, boolean dead) {
|
||||
this.fightID = fightID;
|
||||
this.userID = userID;
|
||||
this.kit = kit;
|
||||
this.tntPlaced = tntPlaced;
|
||||
this.kills = kills;
|
||||
this.dead = dead;
|
||||
}
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren