1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 19:55:48 +00:00

Some formatting

This commit is contained in:
TheBusyBiscuit 2020-10-30 22:57:27 +01:00 committed by GitHub
parent 192258fb74
commit 21d6281ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,6 +188,7 @@ public class TalismanListener implements Listener {
// Prevents duplication of handheld items or armor // Prevents duplication of handheld items or armor
EntityEquipment equipment = entity.getEquipment(); EntityEquipment equipment = entity.getEquipment();
if (equipment != null) { if (equipment != null) {
for (ItemStack item : equipment.getArmorContents()) { for (ItemStack item : equipment.getArmorContents()) {
items.remove(item); items.remove(item);
@ -252,9 +253,7 @@ public class TalismanListener implements Listener {
} }
} }
if (!e.getEnchantsToAdd().containsKey(Enchantment.SILK_TOUCH) if (!e.getEnchantsToAdd().containsKey(Enchantment.SILK_TOUCH) && Enchantment.LOOT_BONUS_BLOCKS.canEnchantItem(e.getItem()) && Talisman.tryActivate(e, SlimefunItems.TALISMAN_WIZARD)) {
&& Enchantment.LOOT_BONUS_BLOCKS.canEnchantItem(e.getItem())
&& Talisman.tryActivate(e, SlimefunItems.TALISMAN_WIZARD)) {
Set<Enchantment> enchantments = e.getEnchantsToAdd().keySet(); Set<Enchantment> enchantments = e.getEnchantsToAdd().keySet();
for (Enchantment enchantment : enchantments) { for (Enchantment enchantment : enchantments) {
@ -271,6 +270,7 @@ public class TalismanListener implements Listener {
public void onBlockDropItems(BlockDropItemEvent e) { public void onBlockDropItems(BlockDropItemEvent e) {
// We only want to double ores // We only want to double ores
Material type = e.getBlockState().getType(); Material type = e.getBlockState().getType();
if (type.name().endsWith("_ORE")) { if (type.name().endsWith("_ORE")) {
ItemStack item = e.getPlayer().getInventory().getItemInMainHand(); ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
@ -341,7 +341,7 @@ public class TalismanListener implements Listener {
} }
Location bedSpawn = player.getBedSpawnLocation(); Location bedSpawn = player.getBedSpawnLocation();
return (bedSpawn != null) ? bedSpawn : player.getLocation().getWorld().getSpawnLocation(); return bedSpawn != null ? bedSpawn : player.getLocation().getWorld().getSpawnLocation();
} }
private int getAmountWithFortune(@Nonnull Material type, int fortuneLevel) { private int getAmountWithFortune(@Nonnull Material type, int fortuneLevel) {