Add customModelData to Velocity SWItem

This commit is contained in:
2025-05-31 08:51:56 +02:00
parent 37f6723542
commit 7b059cde0e
2 changed files with 12 additions and 0 deletions
@@ -42,6 +42,7 @@ public class SWItem {
@Getter
private InvCallback callback;
private int color = 0;
private int customModelData = 0;
public SWItem(String material, Message title) {
this.material = material.toUpperCase();
@@ -64,6 +65,11 @@ public class SWItem {
return this;
}
public SWItem setCustomModelData(int customModelData) {
this.customModelData = customModelData;
return this;
}
public JsonObject writeToString(Chatter player, int position) {
JsonObject object = new JsonObject();
object.addProperty("material", material);
@@ -84,6 +90,9 @@ public class SWItem {
}
object.add("lore", array);
}
if (customModelData > 0) {
object.addProperty("customModelData", customModelData);
}
return object;
}