mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-05 18:32:28 +01:00
VanillaStackingRule style
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
f48199397a
commit
344003f36a
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user