1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2026-02-07 11:20:16 +00:00

Merge branch 'mc-1.16.x' into mc-1.18.x

This commit is contained in:
Jonathan Coates
2022-05-22 15:03:01 +01:00
80 changed files with 1413 additions and 461 deletions

View File

@@ -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();