Skip to content

Commit fd0cce2

Browse files
authored
3.1.6 (#184)
**Changelog:** - Implement more options for the Inventory HUD (closes #173) - Add Skin Manager (#176) - Add profile importing & exporting - Update to 1.21.9/10 - Fix some more bugs - Preserve the current screen on config style change (#179)
2 parents 3180a51 + 549678c commit fd0cce2

File tree

600 files changed

+11070
-3759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

600 files changed

+11070
-3759
lines changed

1.16_combat-6/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ tasks.processResources {
7373

7474
tasks.runClient {
7575
classpath(sourceSets.getByName("test").runtimeClasspath)
76+
jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+IgnoreUnrecognizedVMOptions")
7677
}
7778

7879
tasks.withType(JavaCompile::class).configureEach {

1.16_combat-6/src/main/java/io/github/axolotlclient/api/ChatsSidebar.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import io.github.axolotlclient.api.types.Channel;
3636
import io.github.axolotlclient.api.types.User;
3737
import io.github.axolotlclient.api.util.AlphabeticalComparator;
38+
import lombok.Getter;
3839
import net.minecraft.client.gui.AbstractParentElement;
3940
import net.minecraft.client.gui.Drawable;
4041
import net.minecraft.client.gui.Element;
@@ -50,6 +51,7 @@
5051
import net.minecraft.util.math.MathHelper;
5152
import org.lwjgl.glfw.GLFW;
5253

54+
@SuppressWarnings("deprecation")
5355
public class ChatsSidebar extends Screen implements ContextMenuScreen {
5456

5557
private static final int ANIM_STEP = 8;
@@ -182,6 +184,7 @@ public List<AbstractButtonWidget> getButtons() {
182184
}
183185

184186
private void close() {
187+
//noinspection DataFlowIssue
185188
client.openScreen(parent);
186189
if (chatWidget != null) {
187190
chatWidget.remove();
@@ -219,9 +222,11 @@ private void addChat(Channel channel) {
219222
int w;
220223
if (channel.isDM()) {
221224
User chatUser = ((Channel.DM) channel).getReceiver();
225+
//noinspection DataFlowIssue
222226
w = Math.max(client.textRenderer.getWidth(chatUser.getStatus().getTitle() + ": " + chatUser.getStatus().getDescription()) + 5,
223227
client.textRenderer.getWidth(channel.getName()));
224228
} else {
229+
//noinspection DataFlowIssue
225230
w = client.textRenderer.getWidth(channel.getName());
226231
}
227232
sidebarWidth = Math.min(Math.max(width * 5 / 12, w + 5), width / 2);
@@ -271,6 +276,7 @@ private class ListWidget extends AbstractParentElement implements Drawable, Elem
271276
private final int height;
272277
private final int entryHeight = 25;
273278
protected boolean hovered;
279+
@Getter
274280
private int x;
275281
private int scrollAmount;
276282
private boolean visible;
@@ -330,10 +336,6 @@ public boolean isMouseOver(double mouseX, double mouseY) {
330336
return hovered = visible && mouseX >= (double) this.x && mouseY >= (double) this.y && mouseX < (double) (this.x + this.width) && mouseY < (double) (this.y + this.height);
331337
}
332338

333-
public int getX() {
334-
return x;
335-
}
336-
337339
public void setX(int x) {
338340
this.x = x;
339341
elements.forEach(e -> e.x = x);

1.16_combat-6/src/main/java/io/github/axolotlclient/api/SimpleTextInputScreen.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ public void init() {
5151

5252
addButton(new ButtonWidget(width / 2 - 155, height - 50, 150, 20,
5353
ScreenTexts.CANCEL, button -> client.openScreen(parent)));
54-
addButton(new ButtonWidget(width / 2 + 5, height - 50, 150, 20,
54+
var done = addButton(new ButtonWidget(width / 2 + 5, height - 50, 150, 20,
5555
ScreenTexts.DONE, button -> {
56-
if (!input.getText().isEmpty()) {
56+
if (!input.getText().isBlank()) {
5757
consumer.accept(input.getText());
58-
client.openScreen(parent);
5958
}
59+
client.openScreen(parent);
6060
}));
61+
input.setChangedListener(s -> {
62+
done.active = !s.isBlank();
63+
});
64+
done.active = false;
6165
}
6266

6367
@Override

1.16_combat-6/src/main/java/io/github/axolotlclient/api/chat/ChatScreen.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import net.minecraft.client.gui.widget.ButtonWidget;
3434
import net.minecraft.client.gui.widget.TextFieldWidget;
3535
import net.minecraft.client.util.math.MatrixStack;
36+
import net.minecraft.text.LiteralText;
3637
import net.minecraft.text.TranslatableText;
3738
import org.lwjgl.glfw.GLFW;
3839

@@ -47,7 +48,7 @@ public class ChatScreen extends Screen implements ContextMenuScreen {
4748
private TextFieldWidget input;
4849

4950
public ChatScreen(Screen parent, Channel channel) {
50-
super(new TranslatableText("api.screen.chat"));
51+
super(new LiteralText(channel.getName()));
5152
this.channel = channel;
5253
this.parent = parent;
5354
}
@@ -82,6 +83,7 @@ protected void init() {
8283
users.setUsers(channel.getAllUsers(), channel);
8384
addChild(users);
8485

86+
//noinspection DataFlowIssue
8587
addButton(input = new TextFieldWidget(client.textRenderer, width / 2 - 150, height - 50,
8688
300, 20, new TranslatableText("api.chat.enterMessage")) {
8789

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/impl/Bridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Identifier getFabricId() {
5151
return new Identifier("axolotlclient", "bridge/resource_listener");
5252
}
5353
});
54-
ClientPlayConnectionEvents.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
54+
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, sender, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
5555
ClientPlayConnectionEvents.DISCONNECT.register((clientPlayNetworkHandler, minecraftClient) -> Events.DISCONNECT.invoker().run());
5656
}
5757

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/mixin/MinecraftClientMixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,9 @@ public MinecraftClientMixin(String string) {
156156
public AxoResourceManager br$getResourceManager() {
157157
return getResourceManager();
158158
}
159+
160+
@Override
161+
public Object br$getScreen() {
162+
return currentScreen;
163+
}
159164
}

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/mixin/PlatformDispatchMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
import org.spongepowered.asm.mixin.Unique;
5858

5959
@Mixin(value = PlatformDispatch.class, remap = false)
60-
public class PlatformDispatchMixin {
60+
public abstract class PlatformDispatchMixin {
6161
@Unique
6262
private static void getRealTimeServerPing(ServerInfo server, MutableInt currentServerPing) {
6363
ThreadExecuter.scheduleTask(() -> {
@@ -124,7 +124,7 @@ public ClientConnection getConnection() {
124124
final var minecraft = MinecraftClient.getInstance();
125125
final var serverEntry = minecraft.getCurrentServerEntry();
126126

127-
final var img = NativeImage.read(Objects.requireNonNull(serverEntry == null ? minecraft.getServer().getServerMetadata().getFavicon() : serverEntry.getIcon()));
127+
final var img = NativeImage.read(Objects.requireNonNull(serverEntry == null ? minecraft.getServer().getServerMetadata().getFavicon().substring("data:image/png;base64,".length()) : serverEntry.getIcon()));
128128
final var icon = new NativeImageBackedTexture(img);
129129
final var iconId = new Identifier("axolotlclient",
130130
serverEntry == null ? "worlds/" + Hashing.sha1().hashUnencodedChars(((MinecraftServerAccessor) minecraft.getServer()).getStorageSource().getDirectoryName()) + "/icon" :
@@ -137,7 +137,7 @@ class Impl implements AxoSprite.Dynamic, AxoSpriteImpl {
137137
@Override
138138
public void draw(MinecraftClient client, MatrixStack stack, int sX, int sY, int sW, int sH) {
139139
client.getTextureManager().bindTexture(iconId);
140-
DrawUtil.drawTexture(stack, sX, sY, 0, 0, sW, sH, sW, sH);
140+
DrawUtil.drawTexture(stack, sX, sY, 0, 0, sW, sH, sW, sH);
141141
}
142142

143143
@Override

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/mixin/PlayerListEntryMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.spongepowered.asm.mixin.Shadow;
3333

3434
@Mixin(PlayerListEntry.class)
35-
public class PlayerListEntryMixin implements AxoPlayerListEntry {
35+
public abstract class PlayerListEntryMixin implements AxoPlayerListEntry {
3636
@Shadow
3737
@Final
3838
private GameProfile profile;

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/mixin/entity/LivingEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.spongepowered.asm.mixin.Shadow;
3636

3737
@Mixin(LivingEntity.class)
38-
public class LivingEntityMixin implements AxoLivingEntity {
38+
public abstract class LivingEntityMixin implements AxoLivingEntity {
3939
@Shadow
4040
@Final
4141
private Map<StatusEffect, StatusEffectInstance> activeStatusEffects;

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/mixin/entity/effect/AxoStatusEffectsMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
3535

3636
@Mixin(value = AxoStatusEffects.class, remap = false)
37-
public class AxoStatusEffectsMixin {
37+
public abstract class AxoStatusEffectsMixin {
3838
@Mutable
3939
@Shadow
4040
@Final

0 commit comments

Comments
 (0)