mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 12:10:30 +00:00
Fix counts in /computercraft {turn-on,shutdown}
We were using the size of the selectors (which is normally 1) rather than the number of computers.
This commit is contained in:
parent
f5f0c7990a
commit
78334c4cb1
@ -141,9 +141,10 @@ public final class CommandComputerCraft
|
||||
.then( command( "shutdown" )
|
||||
.requires( UserLevel.OWNER_OP )
|
||||
.argManyValue( "computers", manyComputers(), s -> ComputerCraft.serverComputerRegistry.getComputers() )
|
||||
.executes( ( context, computers ) -> {
|
||||
.executes( ( context, computerSelectors ) -> {
|
||||
int shutdown = 0;
|
||||
for( ServerComputer computer : unwrap( context.getSource(), computers ) )
|
||||
Set<ServerComputer> computers = unwrap( context.getSource(), computerSelectors );
|
||||
for( ServerComputer computer : computers )
|
||||
{
|
||||
if( computer.isOn() ) shutdown++;
|
||||
computer.shutdown();
|
||||
@ -155,9 +156,10 @@ public final class CommandComputerCraft
|
||||
.then( command( "turn-on" )
|
||||
.requires( UserLevel.OWNER_OP )
|
||||
.argManyValue( "computers", manyComputers(), s -> ComputerCraft.serverComputerRegistry.getComputers() )
|
||||
.executes( ( context, computers ) -> {
|
||||
.executes( ( context, computerSelectors ) -> {
|
||||
int on = 0;
|
||||
for( ServerComputer computer : unwrap( context.getSource(), computers ) )
|
||||
Set<ServerComputer> computers = unwrap( context.getSource(), computerSelectors );
|
||||
for( ServerComputer computer : computers )
|
||||
{
|
||||
if( !computer.isOn() ) on++;
|
||||
computer.turnOn();
|
||||
|
Loading…
Reference in New Issue
Block a user