From 344003f36a8d33100ce5cdeb6be6d430cb13e50a Mon Sep 17 00:00:00 2001 From: TheMode Date: Thu, 9 Sep 2021 23:14:59 +0200 Subject: [PATCH] VanillaStackingRule style Signed-off-by: TheMode --- .../net/minestom/server/item/rule/VanillaStackingRule.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minestom/server/item/rule/VanillaStackingRule.java b/src/main/java/net/minestom/server/item/rule/VanillaStackingRule.java index 2c741ed7b..a9bc105ba 100644 --- a/src/main/java/net/minestom/server/item/rule/VanillaStackingRule.java +++ b/src/main/java/net/minestom/server/item/rule/VanillaStackingRule.java @@ -5,7 +5,7 @@ import net.minestom.server.item.StackingRule; import net.minestom.server.utils.MathUtils; import org.jetbrains.annotations.NotNull; -public class VanillaStackingRule implements StackingRule { +public final class VanillaStackingRule implements StackingRule { @Override public boolean canBeStacked(@NotNull ItemStack item1, @NotNull ItemStack item2) { @@ -19,8 +19,7 @@ public class VanillaStackingRule implements StackingRule { @Override public @NotNull ItemStack apply(@NotNull ItemStack item, int amount) { - if (amount > 0) - return item.withAmount(amount); + if (amount > 0) return item.withAmount(amount); return ItemStack.AIR; } @@ -37,7 +36,6 @@ public class VanillaStackingRule implements StackingRule { @Override public boolean equals(Object obj) { if (this == obj) return true; - return obj != null && getClass() == obj.getClass(); } }