VanillaStackingRule style

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-09-09 23:14:59 +02:00
parent f48199397a
commit 344003f36a

View File

@ -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();
}
}