mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Failsafe for Elytras in Anvils
This commit is contained in:
parent
31c86d47fe
commit
4daffec161
@ -290,7 +290,8 @@ public class ItemListener implements Listener {
|
||||
@EventHandler
|
||||
public void onAnvil(InventoryClickEvent e) {
|
||||
if (e.getRawSlot() == 2 && e.getWhoClicked() instanceof Player && e.getInventory().getType() == InventoryType.ANVIL) {
|
||||
if (SlimefunItem.getByItem(e.getInventory().getContents()[0]) != null && !SlimefunItem.isDisabled(e.getInventory().getContents()[0]) && e.getInventory().getContents()[0].getType() != Material.ELYTRA) {
|
||||
if (SlimefunItem.getByItem(e.getInventory().getContents()[0]) != null && !SlimefunItem.isDisabled(e.getInventory().getContents()[0])) {
|
||||
if (SlimefunManager.isItemSimiliar(e.getInventory().getContents()[0], new ItemStack(Material.ELYTRA))) return;
|
||||
e.setCancelled(true);
|
||||
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user