-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow players to reset computers via commands
Signed-off-by: Octol1ttle <[email protected]>
- Loading branch information
1 parent
1393cf8
commit f02e94d
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/ru/octol1ttle/flightassistant/commands/ResetAllComputersCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ru.octol1ttle.flightassistant.commands; | ||
|
||
import com.mojang.brigadier.Command; | ||
import com.mojang.brigadier.context.CommandContext; | ||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; | ||
import ru.octol1ttle.flightassistant.HudRenderer; | ||
|
||
public class ResetAllComputersCommand implements Command<FabricClientCommandSource> { | ||
@Override | ||
public int run(CommandContext<FabricClientCommandSource> context) { | ||
if (HudRenderer.getHost() != null) { | ||
HudRenderer.getHost().resetAll(); | ||
} | ||
return 0; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/ru/octol1ttle/flightassistant/commands/ResetFaultedComputersCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ru.octol1ttle.flightassistant.commands; | ||
|
||
import com.mojang.brigadier.Command; | ||
import com.mojang.brigadier.context.CommandContext; | ||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; | ||
import ru.octol1ttle.flightassistant.HudRenderer; | ||
|
||
public class ResetFaultedComputersCommand implements Command<FabricClientCommandSource> { | ||
@Override | ||
public int run(CommandContext<FabricClientCommandSource> context) { | ||
if (HudRenderer.getHost() != null) { | ||
HudRenderer.getHost().resetFaulted(); | ||
} | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters