9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 04:19:27 +00:00

修复图腾语言

This commit is contained in:
XiaoMoMi
2025-04-04 22:11:27 +08:00
parent 77686ab323
commit 995ab5cbbe
8 changed files with 10 additions and 15 deletions

View File

@@ -46,7 +46,7 @@ public class BukkitCommandManager extends AbstractCommandManager<CommandSender>
new DebugSetBlockCommand(this, plugin),
new DebugSpawnFurnitureCommand(this, plugin),
new DebugTargetBlockCommand(this, plugin),
new TotemCommand(this, plugin)
new TotemAnimationCommand(this, plugin)
));
final LegacyPaperCommandManager<CommandSender> manager = (LegacyPaperCommandManager<CommandSender>) getCommandManager();
manager.settings().set(ManagerSetting.ALLOW_UNSAFE_REGISTRATION, true);

View File

@@ -28,9 +28,9 @@ import org.incendo.cloud.suggestion.SuggestionProvider;
import java.util.concurrent.CompletableFuture;
public class TotemCommand extends BukkitCommandFeature<CommandSender> {
public class TotemAnimationCommand extends BukkitCommandFeature<CommandSender> {
public TotemCommand(CraftEngineCommandManager<CommandSender> commandManager, CraftEngine plugin) {
public TotemAnimationCommand(CraftEngineCommandManager<CommandSender> commandManager, CraftEngine plugin) {
super(commandManager, plugin);
}
@@ -49,15 +49,10 @@ public class TotemCommand extends BukkitCommandFeature<CommandSender> {
NamespacedKey namespacedKey = context.get("id");
Key key = Key.of(namespacedKey.namespace(), namespacedKey.value());
CustomItem<ItemStack> item = plugin().itemManager().getCustomItem(key).orElse(null);
if (item == null) {
handleFeedback(context, MessageConstants.COMMAND_ITEM_GET_FAILURE_NOT_EXIST, Component.text(key.toString()));
return;
}
if (MaterialUtils.getMaterial(item.material()) != Material.TOTEM_OF_UNDYING) {
if (item == null || MaterialUtils.getMaterial(item.material()) != Material.TOTEM_OF_UNDYING) {
handleFeedback(context, MessageConstants.COMMAND_TOTEM_NOT_TOTEM, Component.text(key.toString()));
return;
}
ItemStack totem = item.buildItemStack();
MultiplePlayerSelector selector = context.get("players");
for (Player player : selector.values()) {