mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +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 net.minestom.server.utils.MathUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class VanillaStackingRule implements StackingRule {
|
public final class VanillaStackingRule implements StackingRule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canBeStacked(@NotNull ItemStack item1, @NotNull ItemStack item2) {
|
public boolean canBeStacked(@NotNull ItemStack item1, @NotNull ItemStack item2) {
|
||||||
@ -19,8 +19,7 @@ public class VanillaStackingRule implements StackingRule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull ItemStack apply(@NotNull ItemStack item, int amount) {
|
public @NotNull ItemStack apply(@NotNull ItemStack item, int amount) {
|
||||||
if (amount > 0)
|
if (amount > 0) return item.withAmount(amount);
|
||||||
return item.withAmount(amount);
|
|
||||||
return ItemStack.AIR;
|
return ItemStack.AIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +36,6 @@ public class VanillaStackingRule implements StackingRule {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) return true;
|
if (this == obj) return true;
|
||||||
|
|
||||||
return obj != null && getClass() == obj.getClass();
|
return obj != null && getClass() == obj.getClass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user