1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

optimize: no need display enchant item

This commit is contained in:
StarWishsama 2021-02-03 12:43:20 +08:00
parent f0d427a19c
commit bc3b61ed90
3 changed files with 3 additions and 5 deletions

View File

@ -88,8 +88,7 @@ public class AutoDisenchanter extends AContainer {
amount++; amount++;
} else if (!menu.toInventory().getViewers().isEmpty()) { } else if (!menu.toInventory().getViewers().isEmpty()) {
String notice = SlimefunPlugin.getLocalization().getMessage("messages.above-limit-level") String notice = SlimefunPlugin.getLocalization().getMessage("messages.above-limit-level")
.replace("%level%", enchantLevelLimit.getValue().toString()) .replace("%level%", enchantLevelLimit.getValue().toString());
.replace("%item%", item.hasItemMeta() && item.getItemMeta().hasDisplayName() ? item.getItemMeta().getDisplayName() : item.getType().name());
ItemStack progressBar = getProgressBar().clone(); ItemStack progressBar = getProgressBar().clone();
progressBar.setType(Material.BARRIER); progressBar.setType(Material.BARRIER);

View File

@ -67,8 +67,7 @@ public class AutoEnchanter extends AContainer {
enchantments.put(e.getKey(), e.getValue()); enchantments.put(e.getKey(), e.getValue());
} else if (!menu.toInventory().getViewers().isEmpty()) { } else if (!menu.toInventory().getViewers().isEmpty()) {
String notice = SlimefunPlugin.getLocalization().getMessage("messages.above-limit-level") String notice = SlimefunPlugin.getLocalization().getMessage("messages.above-limit-level")
.replace("%level%", enchantLevelLimit.getValue().toString()) .replace("%level%", enchantLevelLimit.getValue().toString());
.replace("%item%", item.hasItemMeta() && item.getItemMeta().hasDisplayName() ? item.getItemMeta().getDisplayName() : item.getType().name());
ItemStack progressBar = getProgressBar().clone(); ItemStack progressBar = getProgressBar().clone();
progressBar.setType(Material.BARRIER); progressBar.setType(Material.BARRIER);

View File

@ -208,7 +208,7 @@ messages:
- '&7This one was actually a Biscuit and not a Cookie' - '&7This one was actually a Biscuit and not a Cookie'
- '&7Neon signs are LIT!' - '&7Neon signs are LIT!'
above-limit-level: '&c%item% can''t be enchant with a level higher than %level%' above-limit-level: '&cCannot enchant a enchantment level higher than %level%'
machines: machines:
pattern-not-found: '&eSorry, I could not recognize this Recipe. Please place the Items in the correct pattern into the Dispenser.' pattern-not-found: '&eSorry, I could not recognize this Recipe. Please place the Items in the correct pattern into the Dispenser.'