-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Highlight devices missing a channel on the network status screen
- Loading branch information
Showing
5 changed files
with
76 additions
and
14 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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/appeng/menu/me/networktool/MachineGroupKey.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,28 @@ | ||
package appeng.menu.me.networktool; | ||
|
||
|
||
import appeng.api.stacks.AEItemKey; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.chat.Component; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Optional; | ||
|
||
/** | ||
* The information by which machines are grouped together. | ||
*/ | ||
record MachineGroupKey(AEItemKey display, boolean missingChannel) { | ||
|
||
public static MachineGroupKey fromPacket(FriendlyByteBuf data) { | ||
var display = AEItemKey.fromPacket(data); | ||
var missingChannel = data.readBoolean(); | ||
return new MachineGroupKey(display, missingChannel); | ||
|
||
} | ||
|
||
public void write(FriendlyByteBuf data) { | ||
display.writeToPacket(data); | ||
data.writeBoolean(missingChannel); | ||
} | ||
|
||
} |
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