Fixing 1.8 Skull issue
Dieser Commit ist enthalten in:
Ursprung
ed452b2856
Commit
ecb8eec074
@ -1,6 +1,8 @@
|
|||||||
package de.steamwar.inventory;
|
package de.steamwar.inventory;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
|
|
||||||
class SWItem_v12 {
|
class SWItem_v12 {
|
||||||
private SWItem_v12(){}
|
private SWItem_v12(){}
|
||||||
@ -12,4 +14,8 @@ class SWItem_v12 {
|
|||||||
static Material getDye(){
|
static Material getDye(){
|
||||||
return Material.INK_SACK;
|
return Material.INK_SACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
|
||||||
|
meta.setOwningPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
12
SpigotCore_8/src/de/steamwar/inventory/SWItem_v8.java
Normale Datei
12
SpigotCore_8/src/de/steamwar/inventory/SWItem_v8.java
Normale Datei
@ -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());
|
||||||
|
}
|
||||||
|
}
|
@ -22,7 +22,13 @@ public class SWItem {
|
|||||||
SWItem p = new SWItem();
|
SWItem p = new SWItem();
|
||||||
ItemStack head = new ItemStack(getMaterial("SKULL_ITEM"), 1, (short) 3);
|
ItemStack head = new ItemStack(getMaterial("SKULL_ITEM"), 1, (short) 3);
|
||||||
SkullMeta headmeta = (SkullMeta) head.getItemMeta();
|
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());
|
headmeta.setDisplayName(player.getName());
|
||||||
head.setItemMeta(headmeta);
|
head.setItemMeta(headmeta);
|
||||||
p.setItemStack(head);
|
p.setItemStack(head);
|
||||||
|
@ -16,7 +16,11 @@ public enum SchematicType {
|
|||||||
CGearUp("CGU", Type.CHECK_TYPE),
|
CGearUp("CGU", Type.CHECK_TYPE),
|
||||||
GearUp("GU", Type.FIGHT_TYPE, CGearUp),
|
GearUp("GU", Type.FIGHT_TYPE, CGearUp),
|
||||||
CEiszeit("CEZ", Type.CHECK_TYPE),
|
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<String, SchematicType> fromDB = new HashMap<>();
|
private static Map<String, SchematicType> fromDB = new HashMap<>();
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren