mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Fixed an issue with Unstackable (would disappear after any item update)
This commit is contained in:
parent
b35719869c
commit
1908022380
@ -1,26 +1,27 @@
|
||||
package net.Indyuce.mmoitems.stat;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import net.Indyuce.mmoitems.api.item.build.MMOItemBuilder;
|
||||
import net.Indyuce.mmoitems.stat.data.BooleanData;
|
||||
import net.Indyuce.mmoitems.stat.data.type.StatData;
|
||||
import net.Indyuce.mmoitems.stat.type.BooleanStat;
|
||||
import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class Unstackable extends BooleanStat {
|
||||
public Unstackable() {
|
||||
super("UNSTACKABLE", new ItemStack(Material.CHEST_MINECART), "Unstackable",
|
||||
new String[] { "This will make the item unable", "to be stacked with itself." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
public Unstackable() {
|
||||
super("UNSTACKABLE", new ItemStack(Material.CHEST_MINECART), "Unstackable", new String[] { "This will make the item unable", "to be stacked with itself."}, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void whenApplied(MMOItemBuilder item, StatData data) {
|
||||
if (((BooleanData) data).isEnabled()) {
|
||||
item.addItemTag(new ItemTag("UNSTACKABLE", true));
|
||||
item.addItemTag(new ItemTag("UNSTACKABLE_UUID", UUID.randomUUID().toString()));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void whenApplied(MMOItemBuilder item, StatData data) {
|
||||
if (((BooleanData) data).isEnabled()) {
|
||||
item.addItemTag(new ItemTag("MMOITEMS_UNSTACKABLE", true));
|
||||
item.addItemTag(new ItemTag("MMOITEMS_UNSTACKABLE_UUID", UUID.randomUUID().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user