Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 4bfe8a8

Browse files
committed
fix profile renaming
1 parent a72869e commit 4bfe8a8

File tree

8 files changed

+47
-3
lines changed

8 files changed

+47
-3
lines changed

1.16_combat-6/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public class ProfileEntry extends Entry {
128128
this.profile = profile;
129129
profileName = new TextFieldWidget(textRenderer, 0, 0, 150, 20, LiteralText.EMPTY);
130130
profileName.setText(profile.name());
131+
profileName.setChangedListener(profile::setName);
131132
loadButton = new ButtonWidget(0, 0, 50, 20, LOAD_BUTTON_TITLE, btn ->
132133
Profiles.getInstance().switchTo(profile));
133134
duplicateButton = new ButtonWidget(0, 0, 50, 20, DUPLICATE_BUTTON_TITLE, b -> {

1.20/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public class ProfileEntry extends Entry {
143143
this.profile = profile;
144144
profileName = new TextFieldWidget(textRenderer, 0, 0, 150, 20, Text.empty());
145145
profileName.setText(profile.name());
146+
profileName.setChangedListener(profile::setName);
146147
loadButton = ButtonWidget.builder(LOAD_BUTTON_TITLE, btn ->
147148
Profiles.getInstance().switchTo(profile)).positionAndSize(0, 0, 50, 20).build();
148149
duplicateButton = ButtonWidget.builder(DUPLICATE_BUTTON_TITLE, b -> {

1.21.7/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public class ProfileEntry extends Entry {
157157
this.profile = profile;
158158
profileName = new EditBox(getFont(), 0, 0, 150, 20, Component.empty());
159159
profileName.setValue(profile.name());
160+
profileName.setResponder(profile::setName);
160161
loadButton = Button.builder(LOAD_BUTTON_TITLE, btn ->
161162
Profiles.getInstance().switchTo(profile)).bounds(0, 0, 50, 20).build();
162163
duplicateButton = Button.builder(DUPLICATE_BUTTON_TITLE, b -> {

1.21/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public class ProfileEntry extends Entry {
148148
this.profile = profile;
149149
profileName = new TextFieldWidget(textRenderer, 0, 0, 150, 20, Text.empty());
150150
profileName.setText(profile.name());
151+
profileName.setChangedListener(profile::setName);
151152
loadButton = ButtonWidget.builder(LOAD_BUTTON_TITLE, btn ->
152153
Profiles.getInstance().switchTo(profile)).positionAndSize(0, 0, 50, 20).build();
153154
duplicateButton = ButtonWidget.builder(DUPLICATE_BUTTON_TITLE, b -> {

1.8.9/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public class ProfileEntry extends Entry {
130130
this.profile = profile;
131131
profileName = new TextFieldWidget(textRenderer, 0, 0, 150, 20, "");
132132
profileName.setText(profile.name());
133+
profileName.setChangedListener(profile::setName);
133134
loadButton = new VanillaButtonWidget(0, 0, 50, 20, LOAD_BUTTON_TITLE, btn ->
134135
Profiles.getInstance().switchTo(profile));
135136
duplicateButton = new VanillaButtonWidget(0, 0, 50, 20, DUPLICATE_BUTTON_TITLE, b -> {

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Changelog:
22

3-
### *3.1.5*
3+
### 3.1.5
44

55
- fix a few bugs (#154, #155)
66
- add Bedwars StatsOverlay (#145)

common/src/main/java/io/github/axolotlclient/config/profiles/Profiles.java

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import io.github.axolotlclient.AxolotlClientCommon;
4040
import io.github.axolotlclient.bridge.util.AxoI18n;
4141
import io.github.axolotlclient.util.GsonHelper;
42+
import lombok.Setter;
4243

4344
public class Profiles {
4445
private static final Path PROFILES_CONFIG = AxolotlClientCommon.resolveConfigFile("profiles").resolve("profiles.json");
@@ -128,10 +129,48 @@ public Profile duplicate(Profile profile) {
128129
return duplicate;
129130
}
130131

131-
public record Profile(String name, String id) {
132+
public static final class Profile {
133+
@Setter
134+
private String name;
135+
private final String id;
136+
137+
public Profile(String name, String id) {
138+
this.name = name;
139+
this.id = id;
140+
}
141+
132142
public Path getPath() {
133143
return AxolotlClientCommon.resolveConfigFile("profiles").resolve(id());
134144
}
145+
146+
public String name() {
147+
return name;
148+
}
149+
150+
public String id() {
151+
return id;
152+
}
153+
154+
@Override
155+
public boolean equals(Object obj) {
156+
if (obj == this) return true;
157+
if (obj == null || obj.getClass() != this.getClass()) return false;
158+
var that = (Profile) obj;
159+
return Objects.equals(this.name, that.name) &&
160+
Objects.equals(this.id, that.id);
161+
}
162+
163+
@Override
164+
public int hashCode() {
165+
return Objects.hash(name, id);
166+
}
167+
168+
@Override
169+
public String toString() {
170+
return "Profile[" +
171+
"name=" + name + ", " +
172+
"id=" + id + ']';
173+
}
135174
}
136175

137176
@JsonAdapter(ProfileStorageLoader.class)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fabric.loom.disableMinecraftVerification=true
77
axolotlclient.modules.all=true
88

99
# Mod Properties
10-
version=3.1.5-beta.1
10+
version=3.1.5-beta.2
1111

1212
maven_group=io.github.axolotlclient
1313

0 commit comments

Comments
 (0)