diff --git a/MMOItems-API/pom.xml b/MMOItems-API/pom.xml index 6b4eaab5..ea159c41 100644 --- a/MMOItems-API/pom.xml +++ b/MMOItems-API/pom.xml @@ -27,8 +27,8 @@ maven-compiler-plugin 3.8.1 - 16 - 16 + 1.8 + 1.8 UTF-8 diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationPreview.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationPreview.java index 1e6ab742..4c91ebcd 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationPreview.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationPreview.java @@ -154,19 +154,21 @@ public class CraftingStationPreview extends PluginInventory { NBTItem nbtItem = MythicLib.plugin.getVersion().getWrapper().getNBTItem(event.getCurrentItem()); switch (nbtItem.getString("ItemId")) { - case "CONFIRM" -> { + case "CONFIRM": previous.processRecipe(recipe); previous.open(); - } - case "PREVIOUS_PAGE" -> { + return; + case "PREVIOUS_PAGE": page--; open(); - } - case "NEXT_PAGE" -> { + return; + case "NEXT_PAGE": page++; open(); - } - case "BACK" -> previous.open(); + return; + case "BACK": + previous.open(); + return; } } } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/EntityManager.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/EntityManager.java index 37b29347..4c8a6bea 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/EntityManager.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/EntityManager.java @@ -126,9 +126,10 @@ public class EntityManager implements Listener { @EventHandler(ignoreCancelled = true) public void onHitEffects(PlayerAttackEvent event) { - if (!(event.getAttack() instanceof ProjectileAttackMetadata projAttack)) + if (!(event.getAttack() instanceof ProjectileAttackMetadata)) return; + final ProjectileAttackMetadata projAttack = (ProjectileAttackMetadata) event.getAttack(); final ProjectileData data = projectiles.get(projAttack.getProjectile().getEntityId()); if (data == null) return; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/util/RepairUtils.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/util/RepairUtils.java index 6793a482..1add6041 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/util/RepairUtils.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/util/RepairUtils.java @@ -38,7 +38,7 @@ public class RepairUtils { final Player player = playerData.getPlayer(); if (target.getBoolean("Unbreakable") || !target.getItem().hasItemMeta() - || !(target.getItem().getItemMeta() instanceof Damageable meta) + || !(target.getItem().getItemMeta() instanceof Damageable) || ((Damageable) target.getItem().getItemMeta()).getDamage() <= 0) return false; @@ -48,6 +48,7 @@ public class RepairUtils { return false; repairAmount = called.getRepaired(); + final Damageable meta = (Damageable) target.getItem().getItemMeta(); meta.setDamage(Math.max(0, meta.getDamage() - repairAmount)); target.getItem().setItemMeta(meta); Message.REPAIRED_ITEM.format(ChatColor.YELLOW, diff --git a/pom.xml b/pom.xml index 1dc6f684..ac242c36 100644 --- a/pom.xml +++ b/pom.xml @@ -62,8 +62,8 @@ maven-compiler-plugin 3.8.1 - 10 - 10 + 1.8 + 1.8 UTF-8