Skip to content

Commit 82cf3af

Browse files
committed
Move the CheckSubcommand to the common module
1 parent 2752a4b commit 82cf3af

File tree

2 files changed

+5
-145
lines changed

2 files changed

+5
-145
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
import io.github.communityradargg.forgemod.radarlistmanager.RadarListEntry;
1919
import io.github.communityradargg.forgemod.util.CommonHandler;
2020
import io.github.communityradargg.forgemod.util.Messages;
21+
import io.github.communityradargg.forgemod.util.PlayerInfo;
2122
import io.github.communityradargg.forgemod.util.RadarMessage;
22-
import net.minecraft.client.Minecraft;
23-
import net.minecraft.client.network.NetworkPlayerInfo;
24-
import org.jetbrains.annotations.NotNull;
2523
import java.util.Optional;
24+
import org.jetbrains.annotations.NotNull;
2625

2726
/**
2827
* Holds the logic of the check subcommand.
@@ -99,13 +98,13 @@ private void handleCheckPlayerSubcommand(final @NotNull String[] args) {
9998
*/
10099
private void handleCheckAllSubcommand() {
101100
boolean anyPlayerFound = false;
102-
for (final NetworkPlayerInfo networkPlayer : Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap()) {
103-
if (networkPlayer.getGameProfile().getId() == null) {
101+
for (final PlayerInfo playerInfo : commonHandler.getWorldPlayers()) {
102+
if (playerInfo.getUuid() == null) {
104103
continue;
105104
}
106105

107106
final Optional<RadarListEntry> listEntryOptional = commonHandler.getListManager()
108-
.getRadarListEntry(networkPlayer.getGameProfile().getId());
107+
.getRadarListEntry(playerInfo.getUuid());
109108
if (!listEntryOptional.isPresent()) {
110109
// player uuid is on no list
111110
continue;

versions/1.12.2/src/main/java/io/github/communityradargg/forgemod/command/CheckSubcommand.java

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)