Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Plugin/src/main/java/dev/lrxh/neptune/utils/ItemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,26 +206,22 @@ public void applyArmorTrim(Profile profile) {
ItemStack chestplate = player.getInventory().getChestplate();
ItemStack leggings = player.getInventory().getLeggings();
ItemStack boots = player.getInventory().getBoots();
if (helmet != null) {
ArmorMeta helmetMeta = (ArmorMeta) helmet.getItemMeta();
if (helmet != null && (helmet.getItemMeta() instanceof ArmorMeta helmetMeta)) {
if (trimPackage.getHelmetTrim() != null) helmetMeta.setTrim(trimPackage.getHelmetTrim());
helmet.setItemMeta(helmetMeta);
player.getInventory().setHelmet(helmet);
}
if (chestplate != null) {
ArmorMeta chestplateMeta = (ArmorMeta) chestplate.getItemMeta();
if (chestplate != null && (chestplate.getItemMeta() instanceof ArmorMeta chestplateMeta)) {
if (trimPackage.getHelmetTrim() != null) chestplateMeta.setTrim(trimPackage.getChestplateTrim());
chestplate.setItemMeta(chestplateMeta);
player.getInventory().setChestplate(chestplate);
}
if (leggings != null) {
ArmorMeta leggingsMeta = (ArmorMeta) leggings.getItemMeta();
if (leggings != null && (leggings.getItemMeta() instanceof ArmorMeta leggingsMeta)) {
if (trimPackage.getHelmetTrim() != null) leggingsMeta.setTrim(trimPackage.getLeggingsTrim());
leggings.setItemMeta(leggingsMeta);
player.getInventory().setLeggings(leggings);
}
if (boots != null) {
ArmorMeta bootsMeta = (ArmorMeta) boots.getItemMeta();
if (boots != null && (boots.getItemMeta() instanceof ArmorMeta bootsMeta)) {
if (trimPackage.getHelmetTrim() != null) bootsMeta.setTrim(trimPackage.getBootsTrim());
boots.setItemMeta(bootsMeta);
player.getInventory().setBoots(boots);
Expand Down