Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
7 additions
and
1 deletion.
-
+7
−1
src/main/java/dan200/computercraft/ComputerCommand.java
|
@@ -25,9 +25,15 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args |
|
|
if( args.length < 2 ){ |
|
|
throw new CommandException( "Usage: /computer <id> <value1> [value2]..." ); |
|
|
} |
|
|
int id; |
|
|
try { |
|
|
id = Integer.valueOf(args[0]); |
|
|
}catch( NumberFormatException e ){ |
|
|
throw new CommandException( "Invalid ID" ); |
|
|
} |
|
|
boolean found_valid_computer = false; |
|
|
for( ServerComputer computer : ComputerCraft.serverComputerRegistry.getComputers() ){ |
|
|
if( computer.getID() == Integer.valueOf( args[0] ) && computer.getFamily() == ComputerFamily.Command ){ |
|
|
if( computer.getID() == id && computer.getFamily() == ComputerFamily.Command ){ |
|
|
computer.queueEvent("computer_command", ArrayUtils.remove(args, 0)); |
|
|
found_valid_computer = true; |
|
|
} |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.