mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Compiles on java 8
This commit is contained in:
parent
b53a21dbe5
commit
6650527584
@ -27,8 +27,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>16</source>
|
||||
<target>16</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user