mirror of
https://github.com/tomasff/BeesPlus.git
synced 2024-06-29 07:44:46 +02:00
Extract upgrade to separate method
This commit is contained in:
parent
1abf7570bf
commit
0fb9f945f4
|
@ -103,6 +103,12 @@ public class BeeHiveUpgrade implements CustomItem, Listener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
upgradeBeehive(player, beehive, handItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void upgradeBeehive(Player player, Beehive beehive, ItemStack handItem) {
|
||||||
if (beehive.getMaxEntities() >= maxPopulation) {
|
if (beehive.getMaxEntities() >= maxPopulation) {
|
||||||
Localization.sendMessage(player, Localization.BEEHIVE_UPGRADE_MAX);
|
Localization.sendMessage(player, Localization.BEEHIVE_UPGRADE_MAX);
|
||||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||||
|
@ -121,6 +127,4 @@ public class BeeHiveUpgrade implements CustomItem, Listener {
|
||||||
|
|
||||||
player.getInventory().removeItem(upgradeAmountRemove);
|
player.getInventory().removeItem(upgradeAmountRemove);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user