Allow console scripted commands

This commit is contained in:
Kam committed 2025-10-06 20:15:08 -04:00
1 parent 3d0c814861
commit afe0e8106e
2 files changed
+11 -9

No files matched your search

@@ -2,7 +2,6 @@ package kamkeel.npcs.command;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.math.BlockPos;
import noppes.npcs.EventHooks;
@@ -43,13 +42,11 @@ public class CommandCommand extends CommandKamkeelBase {
ChunkCoordinates senderCoords = sender.getPlayerCoordinates();
IPos senderPos = NpcAPI.Instance().getIPos(new BlockPos(senderCoords.posX, senderCoords.posY, senderCoords.posZ));
if (sender instanceof EntityPlayer) {
CustomNPCsEvent.ScriptedCommandEvent event = new CustomNPCsEvent.ScriptedCommandEvent(senderWorld, senderPos, sender.getCommandSenderName(), commandId, commandArgs);
EventHooks.onScriptedCommand((EntityPlayer) sender, event);
CustomNPCsEvent.ScriptedCommandEvent event = new CustomNPCsEvent.ScriptedCommandEvent(senderWorld, senderPos, sender.getCommandSenderName(), commandId, commandArgs);
EventHooks.onScriptedCommand(sender, event);
if (!event.replyMessage.isEmpty()) {
sendMessage(sender, event.replyMessage);
}
if (!event.replyMessage.isEmpty()) {
sendMessage(sender, event.replyMessage);
}
}
}