mirror of
https://github.com/CarmJos/ScriptItems
synced 2026-06-05 04:42:31 +08:00
修复 apply 无法使用的问题
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package cc.carm.plugin.scriptitems.command;
|
||||
|
||||
import cc.carm.plugin.scriptitems.Main;
|
||||
import cc.carm.plugin.scriptitems.ScriptItemsAPI;
|
||||
import cc.carm.plugin.scriptitems.configuration.PluginMessages;
|
||||
import cc.carm.plugin.scriptitems.item.ScriptConfiguration;
|
||||
@@ -64,14 +63,10 @@ public class ScriptItemsCommand implements CommandExecutor, TabCompleter {
|
||||
return true;
|
||||
}
|
||||
|
||||
player.getInventory().setItemInMainHand(null);
|
||||
ItemStack after = settings.applyItem(item.clone());
|
||||
Main.getInstance().getScheduler().runLater(10L, () -> {
|
||||
if (player.isOnline()) {
|
||||
player.getInventory().setItemInMainHand(after);
|
||||
PluginMessages.APPLIED.send(sender, item.getType().name(), settings.getName());
|
||||
}
|
||||
});
|
||||
player.getInventory().setItemInMainHand(after);
|
||||
PluginMessages.APPLIED.send(sender, item.getType().name(), settings.getName());
|
||||
|
||||
return true;
|
||||
} else if (aim.equalsIgnoreCase("give")) {
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ public class ItemsManager {
|
||||
}
|
||||
|
||||
public ItemStack applyTag(@NotNull ItemStack originalItem, String identifier, UUID uuid) {
|
||||
if (!originalItem.hasItemMeta()) return originalItem;
|
||||
ItemMeta meta = originalItem.getItemMeta();
|
||||
if (meta == null) return originalItem;
|
||||
CustomItemTagContainer container = meta.getCustomTagContainer();
|
||||
|
||||
Reference in New Issue
Block a user