Skip to content

Commit

Permalink
Rename client -> minecraft
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Apr 20, 2023
1 parent 8a69ede commit a633622
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/github/gaming32/worldhost/WorldHost.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static void saveConfig() {
}
}

public static void tickHandler(Minecraft client) {
public static void tickHandler(Minecraft minecraft) {
if (protoClient == null || protoClient.isClosed()) {
protoClient = null;
connectingFuture = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ protected void init() {
}

@Override
public void resize(@NotNull Minecraft client, int width, int height) {
public void resize(@NotNull Minecraft minecraft, int width, int height) {
final String oldUsername = usernameField.getValue();
super.resize(client, width, height);
super.resize(minecraft, width, height);
usernameField.setValue(oldUsername);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ public int addEntry(@NotNull FriendsEntry entry) {
}

public class FriendsEntry extends ObjectSelectionList.Entry<FriendsEntry> {
private final Minecraft client;
private final Minecraft minecraft;
private GameProfile profile;

public FriendsEntry(GameProfile profile) {
client = Minecraft.getInstance();
minecraft = Minecraft.getInstance();
this.profile = profile;
Util.backgroundExecutor().execute(
() -> this.profile = client.getMinecraftSessionService().fillProfileProperties(profile, false)
() -> this.profile = minecraft.getMinecraftSessionService().fillProfileProperties(profile, false)
);
}

Expand All @@ -162,23 +162,23 @@ public void render(@NotNull PoseStack matrices, int index, int y, int x, int ent
GuiComponent.blit(matrices, x, y, 32, 32, 8, 8, 8, 8, 64, 64);
GuiComponent.blit(matrices, x, y, 32, 32, 40, 8, 8, 8, 64, 64);
RenderSystem.disableBlend();
drawCenteredString(matrices, client.font, getName(), x + 110, y + 16 - client.font.lineHeight / 2, 0xffffff);
drawCenteredString(matrices, minecraft.font, getName(), x + 110, y + 16 - minecraft.font.lineHeight / 2, 0xffffff);
}

public String getName() {
return WorldHost.getName(profile);
}

public void maybeRemove() {
assert client != null;
client.setScreen(new ConfirmScreen(
assert minecraft != null;
minecraft.setScreen(new ConfirmScreen(
yes -> {
if (yes) {
WorldHost.CONFIG.getFriends().remove(profile.getId());
WorldHost.saveConfig();
FriendsScreen.this.list.updateEntries();
}
client.setScreen(FriendsScreen.this);
minecraft.setScreen(FriendsScreen.this);
},
Components.translatable("world-host.friends.remove.title"),
Components.translatable("world-host.friends.remove.message")
Expand Down

0 comments on commit a633622

Please sign in to comment.