1.15.3
This commit is contained in:
parent
4b90ef76cd
commit
131c242e5c
3 changed files with 32 additions and 1 deletions
|
|
@ -126,6 +126,13 @@ public class KitItemManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(serverVersion.serverVersionGreaterEqualThan(serverVersion,ServerVersion.v1_21_R3)){
|
||||||
|
if(meta.hasItemModel()){
|
||||||
|
NamespacedKey key = meta.getItemModel();
|
||||||
|
kitItem.setModel(key.getNamespace()+":"+key.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(meta instanceof LeatherArmorMeta) {
|
if(meta instanceof LeatherArmorMeta) {
|
||||||
LeatherArmorMeta meta2 = (LeatherArmorMeta) meta;
|
LeatherArmorMeta meta2 = (LeatherArmorMeta) meta;
|
||||||
kitItem.setColor(meta2.getColor().asRGB());
|
kitItem.setColor(meta2.getColor().asRGB());
|
||||||
|
|
@ -269,6 +276,14 @@ public class KitItemManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(serverVersion.serverVersionGreaterEqualThan(serverVersion,ServerVersion.v1_21_R3)){
|
||||||
|
String model = kitItem.getModel();
|
||||||
|
if(model != null){
|
||||||
|
String[] sep = model.split(":");
|
||||||
|
meta.setItemModel(new NamespacedKey(sep[0],sep[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
|
|
||||||
//OTHER META
|
//OTHER META
|
||||||
|
|
@ -374,6 +389,9 @@ public class KitItemManager {
|
||||||
if(item.getTooltipStyle() != null){
|
if(item.getTooltipStyle() != null){
|
||||||
config.set(path+".tooltip_style",item.getTooltipStyle());
|
config.set(path+".tooltip_style",item.getTooltipStyle());
|
||||||
}
|
}
|
||||||
|
if(item.getModel() != null){
|
||||||
|
config.set(path+".model",item.getModel());
|
||||||
|
}
|
||||||
|
|
||||||
if(item.getColor() != 0) {
|
if(item.getColor() != 0) {
|
||||||
config.set(path+".color", item.getColor());
|
config.set(path+".color", item.getColor());
|
||||||
|
|
@ -503,6 +521,7 @@ public class KitItemManager {
|
||||||
|
|
||||||
boolean hideTooltip = config.getBoolean(path+".hide_tooltip");
|
boolean hideTooltip = config.getBoolean(path+".hide_tooltip");
|
||||||
String tooltipStyle = config.contains(path+".tooltip_style") ? config.getString(path+".tooltip_style") : null;
|
String tooltipStyle = config.contains(path+".tooltip_style") ? config.getString(path+".tooltip_style") : null;
|
||||||
|
String model = config.contains(path+".model") ? config.getString(path+".model") : null;
|
||||||
|
|
||||||
KitItemSkullData skullData = null;
|
KitItemSkullData skullData = null;
|
||||||
if(config.contains(path+".skull_data")) {
|
if(config.contains(path+".skull_data")) {
|
||||||
|
|
@ -623,6 +642,7 @@ public class KitItemManager {
|
||||||
kitItem.setCustomModelComponentData(customModelComponentData);
|
kitItem.setCustomModelComponentData(customModelComponentData);
|
||||||
kitItem.setHideTooltip(hideTooltip);
|
kitItem.setHideTooltip(hideTooltip);
|
||||||
kitItem.setTooltipStyle(tooltipStyle);
|
kitItem.setTooltipStyle(tooltipStyle);
|
||||||
|
kitItem.setModel(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
kitItem.setOffhand(offhand);
|
kitItem.setOffhand(offhand);
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ public class KitItem{
|
||||||
|
|
||||||
private boolean hideTooltip; // 1.20.6+
|
private boolean hideTooltip; // 1.20.6+
|
||||||
private String tooltipStyle; // 1.21.2+
|
private String tooltipStyle; // 1.21.2+
|
||||||
|
private String model; // 1.21.4+
|
||||||
|
|
||||||
private boolean offhand;
|
private boolean offhand;
|
||||||
private int previewSlot;
|
private int previewSlot;
|
||||||
|
|
@ -249,6 +250,15 @@ public class KitItem{
|
||||||
public void setTooltipStyle(String tooltipStyle) {
|
public void setTooltipStyle(String tooltipStyle) {
|
||||||
this.tooltipStyle = tooltipStyle;
|
this.tooltipStyle = tooltipStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getModel() {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModel(String model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isOffhand() {
|
public boolean isOffhand() {
|
||||||
return offhand;
|
return offhand;
|
||||||
}
|
}
|
||||||
|
|
@ -318,6 +328,7 @@ public class KitItem{
|
||||||
|
|
||||||
kitItem.setPreviewSlot(previewSlot);
|
kitItem.setPreviewSlot(previewSlot);
|
||||||
kitItem.setOffhand(offhand);
|
kitItem.setOffhand(offhand);
|
||||||
|
kitItem.setModel(model);
|
||||||
|
|
||||||
return kitItem;
|
return kitItem;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
main: pk.ajneb97.PlayerKits2
|
main: pk.ajneb97.PlayerKits2
|
||||||
version: 1.15.2
|
version: 1.15.3
|
||||||
name: PlayerKits2
|
name: PlayerKits2
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
softdepend: [Vault,PlaceholderAPI]
|
softdepend: [Vault,PlaceholderAPI]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue