-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
110 additions
and
31 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- remove reverse charging, it seemed caused more issues than it fixed (fix #230) | ||
- change energy usage when quantum linked to be more like an ae2 quantum bridges energy usage (22.5 ae / tick) (fix #222) | ||
- update russian translations | ||
- update russian translations | ||
- fix "Linked Network cannot be found" message appearing even if the terminal clearly works (#221) |
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
45 changes: 45 additions & 0 deletions
45
src/main/java/de/mari_023/ae2wtlib/terminal/GridResult.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,45 @@ | ||
package de.mari_023.ae2wtlib.terminal; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import net.minecraft.network.chat.Component; | ||
|
||
import de.mari_023.ae2wtlib.TextConstants; | ||
|
||
import appeng.api.networking.IGrid; | ||
import appeng.core.localization.PlayerMessages; | ||
|
||
public record GridResult(@Nullable IGrid grid, GridStatus status) { | ||
|
||
public static GridResult valid(IGrid grid) { | ||
return new GridResult(grid, GridStatus.Valid); | ||
} | ||
|
||
public static GridResult invalid(GridStatus status) { | ||
return new GridResult(null, status); | ||
} | ||
|
||
public enum GridStatus { | ||
Valid(null), | ||
NotServer(null), | ||
NotLinked(PlayerMessages.DeviceNotLinked.text()), | ||
NotPowered(TextConstants.NETWORK_NOT_POWERED), | ||
NotFound(PlayerMessages.LinkedNetworkNotFound.text()); | ||
|
||
@Nullable | ||
private final Component error; | ||
|
||
GridStatus(@Nullable Component error) { | ||
this.error = error; | ||
} | ||
|
||
@Nullable | ||
public Component getError() { | ||
return error; | ||
} | ||
|
||
public boolean isValid() { | ||
return this == Valid; | ||
} | ||
} | ||
} |
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
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