+ fix some bug
This commit is contained in:
parent
962bfa5256
commit
e6c7e8cbed
@ -1,6 +1,8 @@
|
||||
package io.izzel.taboolib.module.nms.nbt;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import io.izzel.taboolib.module.nms.NMS;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
@ -24,6 +26,10 @@ public class NBTCompound extends NBTBase implements Map<String, NBTBase> {
|
||||
this.data = this;
|
||||
}
|
||||
|
||||
public void saveTo(ItemStack item) {
|
||||
item.setItemMeta(NMS.handle().saveNBT(item, this).getItemMeta());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return value.size();
|
||||
|
@ -36,8 +36,8 @@ class ClickListener implements Listener {
|
||||
@EventHandler
|
||||
public void e(InventoryOpenEvent e) {
|
||||
if (e.getInventory().getHolder() instanceof MenuHolder) {
|
||||
Bukkit.getScheduler().runTask(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().getBuildTask().run(e.getInventory()));
|
||||
Bukkit.getScheduler().runTaskAsynchronously(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().getBuildTaskAsync().run(e.getInventory()));
|
||||
Bukkit.getScheduler().runTaskLater(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().getBuildTask().run(e.getInventory()), 1);
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().getBuildTaskAsync().run(e.getInventory()), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user