From 22d2225b9c0f5c65e6939393c289157edb3af990 Mon Sep 17 00:00:00 2001 From: Disy Date: Mon, 1 Jul 2024 22:30:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20respawn=E6=8C=87=E4=BB=A4=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../github/zly2006/carpetslsaddition/command/BotCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/zly2006/carpetslsaddition/command/BotCommand.java b/src/main/java/com/github/zly2006/carpetslsaddition/command/BotCommand.java index fc61e9b..a1c1d13 100644 --- a/src/main/java/com/github/zly2006/carpetslsaddition/command/BotCommand.java +++ b/src/main/java/com/github/zly2006/carpetslsaddition/command/BotCommand.java @@ -82,7 +82,7 @@ public class BotCommand { .then(argument("slot", IntegerArgumentType.integer(1, 9)) .executes(c -> manipulate(c, ap -> ap.setSlot(IntegerArgumentType.getInteger(c, "slot")))))) .then(literal("kill").executes(BotCommand::kill)) - .then(literal("respawn")).executes(BotCommand::respawn) + .then(literal("respawn").executes(BotCommand::respawn)) .then(literal("mount").executes(manipulation(ap -> ap.mount(true))) .then(literal("anything").executes(manipulation(ap -> ap.mount(false))))) .then(literal("dismount").executes(manipulation(EntityPlayerActionPack::dismount))) @@ -248,7 +248,7 @@ public class BotCommand { private static int respawn(CommandContext context) { var player = getPlayer(context); - if (((SLSBotAccessor)player).carpet_SLS_Addition$isBot()) { + if (player instanceof EntityPlayerMPFake && ((SLSBotAccessor)player).carpet_SLS_Addition$isBot()) { ((SLSBotAccessor)player).carpet_SLS_Addition$setSpawnTime(System.currentTimeMillis()); context.getSource().sendMessage( Text.translatable("carpet.slsa.bot.respawned", player.getNameForScoreboard())