mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-26 20:27:38 +01:00
Improved pull request codestyle
This commit is contained in:
parent
5afeb01acb
commit
152d12a97e
@ -2,6 +2,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.special;
|
||||
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -65,10 +66,11 @@ public class Soulbound extends EcoEnchant {
|
||||
player.setMetadata("soulbound-items", this.getPlugin().getMetadataValueFactory().create(soulboundItems));
|
||||
}
|
||||
|
||||
public boolean hasEmptyInventory(Player p) {
|
||||
for(ItemStack it : p.getInventory().getContents())
|
||||
{
|
||||
if(it != null) return false;
|
||||
public boolean hasEmptyInventory(@NotNull final Player player) {
|
||||
for (ItemStack itemStack : player.getInventory().getContents()) {
|
||||
if (itemStack != null && itemStack.getType() != Material.AIR) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -78,7 +80,6 @@ public class Soulbound extends EcoEnchant {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
this.getPlugin().getScheduler().runLater(() -> {
|
||||
|
||||
if (!hasEmptyInventory(player)) {
|
||||
return;
|
||||
}
|
||||
@ -102,7 +103,6 @@ public class Soulbound extends EcoEnchant {
|
||||
meta.getPersistentDataContainer().remove(this.getPlugin().getNamespacedKeyFactory().create("soulbound"));
|
||||
soulboundItem.setItemMeta(meta);
|
||||
player.getInventory().addItem(soulboundItem);
|
||||
|
||||
}
|
||||
|
||||
player.removeMetadata("soulbound-items", this.getPlugin());
|
||||
|
Loading…
Reference in New Issue
Block a user