mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 21:20:04 +00:00
Allow console scripted commands
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user