diff --git a/SpigotCore_12/src/de/steamwar/inventory/SWItem_v12.java b/SpigotCore_12/src/de/steamwar/inventory/SWItem_v12.java index fc6c33b..f852bca 100644 --- a/SpigotCore_12/src/de/steamwar/inventory/SWItem_v12.java +++ b/SpigotCore_12/src/de/steamwar/inventory/SWItem_v12.java @@ -1,6 +1,8 @@ package de.steamwar.inventory; import org.bukkit.Material; +import org.bukkit.OfflinePlayer; +import org.bukkit.inventory.meta.SkullMeta; class SWItem_v12 { private SWItem_v12(){} @@ -12,4 +14,8 @@ class SWItem_v12 { static Material getDye(){ return Material.INK_SACK; } + + static void setSkullOwner(OfflinePlayer player, SkullMeta meta){ + meta.setOwningPlayer(player); + } } diff --git a/SpigotCore_8/src/de/steamwar/inventory/SWItem_v8.java b/SpigotCore_8/src/de/steamwar/inventory/SWItem_v8.java new file mode 100644 index 0000000..88fd025 --- /dev/null +++ b/SpigotCore_8/src/de/steamwar/inventory/SWItem_v8.java @@ -0,0 +1,12 @@ +package de.steamwar.inventory; + +import org.bukkit.OfflinePlayer; +import org.bukkit.inventory.meta.SkullMeta; + +class SWItem_v8 { + private SWItem_v8(){} + + static void setSkullOwner(OfflinePlayer player, SkullMeta meta){ + meta.setOwner(player.getName()); + } +} diff --git a/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java b/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java index d956c00..43f5dfe 100644 --- a/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java +++ b/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java @@ -22,7 +22,13 @@ public class SWItem { SWItem p = new SWItem(); ItemStack head = new ItemStack(getMaterial("SKULL_ITEM"), 1, (short) 3); SkullMeta headmeta = (SkullMeta) head.getItemMeta(); - headmeta.setOwningPlayer(player); + switch(Core.getVersion()){ + case 8: + SWItem_v8.setSkullOwner(player, headmeta); + break; + default: + SWItem_v12.setSkullOwner(player, headmeta); + } headmeta.setDisplayName(player.getName()); head.setItemMeta(headmeta); p.setItemStack(head); diff --git a/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java b/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java index 367f806..9860c27 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SchematicType.java @@ -16,7 +16,11 @@ public enum SchematicType { CGearUp("CGU", Type.CHECK_TYPE), GearUp("GU", Type.FIGHT_TYPE, CGearUp), CEiszeit("CEZ", Type.CHECK_TYPE), - Eiszeit("EZ", Type.FIGHT_TYPE); + Eiszeit("EZ", Type.FIGHT_TYPE), + CWarShip1_8("CWS1.8", Type.CHECK_TYPE), + CWarGear1_7("CWG1.7", Type.CHECK_TYPE), + WarShip1_8("WS1.8", Type.CHECK_TYPE), + WarGear1_7("WG1.7", Type.FIGHT_TYPE, CWarGear1_7); private static Map fromDB = new HashMap<>();