From 99ef96d91e67d324cbb5401e1c80f2bf5754040c Mon Sep 17 00:00:00 2001 From: MrMicky Date: Sun, 28 Jun 2020 17:06:42 +0200 Subject: [PATCH] Simplify code --- README.md | 1 - src/main/java/fr/mrmicky/fastinv/FastInv.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 6ab1840..a963782 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,6 @@ import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryOpenEvent; import org.bukkit.inventory.ItemStack; - public class ExampleInventory extends FastInv { private boolean preventClose = false; diff --git a/src/main/java/fr/mrmicky/fastinv/FastInv.java b/src/main/java/fr/mrmicky/fastinv/FastInv.java index 3aef2ac..72ca8d1 100644 --- a/src/main/java/fr/mrmicky/fastinv/FastInv.java +++ b/src/main/java/fr/mrmicky/fastinv/FastInv.java @@ -286,7 +286,7 @@ public int[] getBorders() { */ public int[] getCorners() { int size = inventory.getSize(); - return IntStream.range(0, size).filter(i -> i % 9 == 0 && (i < 10 || i > size - 19) || (i - 1) % 9 == 0 && (i < 2 || i > size - 9) || (i - 7) % 9 == 0 && (i < 9 || i > size - 3) || (i - 8) % 9 == 0 && (i < 18 || i > size - 11)).toArray(); + return IntStream.range(0, size).filter(i -> i < 2 || (i > 6 && i < 10) || i == 17 || i == size - 18 || (i > size - 11 && i < size - 7) || i > size - 3).toArray(); } /**