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

Commit 273f51f

Browse files
committed
(1.8.9) Add skin file drag'n'drop support
improve image clipboard handling
1 parent 5658749 commit 273f51f

File tree

20 files changed

+352
-140
lines changed

20 files changed

+352
-140
lines changed

1.16_combat-6/src/main/java/io/github/axolotlclient/modules/auth/skin/SkinManagementScreen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ private void loadSkinsList() {
305305
var hashes = skins.stream().map(Asset::textureKey).collect(Collectors.toSet());
306306
var defaultSkinHash = Auth.getInstance().getSkinManager().getDefaultSkinHash(account);
307307
var local = new ArrayList<>(loadLocalSkins());
308-
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity()));
308+
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity(), (skin, skin2) -> skin));
309+
local.removeIf(s -> !localHashes.containsValue(s));
309310
skins.replaceAll(s -> {
310311
if (s instanceof MSApi.MCProfile.OnlineSkin online) {
311312
if (localHashes.containsKey(s.textureKey()) && localHashes.get(s.textureKey()) instanceof Skin.Local file) {

1.20/src/main/java/io/github/axolotlclient/modules/auth/skin/SkinManagementScreen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ private void loadSkinsList() {
271271
var hashes = skins.stream().map(Asset::textureKey).collect(Collectors.toSet());
272272
var defaultSkinHash = Auth.getInstance().getSkinManager().getDefaultSkinHash(account);
273273
var local = new ArrayList<>(loadLocalSkins());
274-
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity()));
274+
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity(), (skin, skin2) -> skin));
275+
local.removeIf(s -> !localHashes.containsValue(s));
275276
skins.replaceAll(s -> {
276277
if (s instanceof MSApi.MCProfile.OnlineSkin online) {
277278
if (localHashes.containsKey(s.textureKey()) && localHashes.get(s.textureKey()) instanceof Skin.Local file) {

1.20/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public class HudEditScreen extends Screen {
5454
private static final BooleanOption snapping = new BooleanOption("snapping", true);
5555
private static final OptionCategory hudEditScreenCategory = OptionCategory.create("hudEditScreen");
5656
private static final int GRAB_TOLERANCE = 5;
57-
private static final long MOVE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_ALL_CURSOR);
58-
private static final long DEFAULT_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
59-
private static final long NWSE_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR),
57+
private final long MOVE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_ALL_CURSOR);
58+
private final long DEFAULT_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
59+
private final long NWSE_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR),
6060
NESW_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NESW_CURSOR);
6161

6262
public static boolean isSnappingEnabled() {
@@ -188,6 +188,10 @@ public void removed() {
188188
setCursor(DEFAULT_CURSOR);
189189
mode = ModificationMode.NONE;
190190
super.removed();
191+
GLFW.glfwDestroyCursor(MOVE_CURSOR);
192+
GLFW.glfwDestroyCursor(DEFAULT_CURSOR);
193+
GLFW.glfwDestroyCursor(NESW_RESIZE_CURSOR);
194+
GLFW.glfwDestroyCursor(NWSE_RESIZE_CURSOR);
191195
}
192196

193197
@Override

1.21.7/src/main/java/io/github/axolotlclient/modules/auth/skin/SkinManagementScreen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ private void loadSkinsList() {
247247
var hashes = skins.stream().map(Asset::textureKey).collect(Collectors.toSet());
248248
var defaultSkinHash = Auth.getInstance().getSkinManager().getDefaultSkinHash(account);
249249
var local = new ArrayList<>(loadLocalSkins());
250-
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity()));
250+
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity(), (skin, skin2) -> skin));
251+
local.removeIf(s -> !localHashes.containsValue(s));
251252
skins.replaceAll(s -> {
252253
if (s instanceof MSApi.MCProfile.OnlineSkin online) {
253254
if (localHashes.containsKey(s.textureKey()) && localHashes.get(s.textureKey()) instanceof Skin.Local file) {

1.21.7/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public class HudEditScreen extends Screen {
5454
private static final BooleanOption snapping = new BooleanOption("snapping", true);
5555
private static final OptionCategory hudEditScreenCategory = OptionCategory.create("hudEditScreen");
5656
private static final int GRAB_TOLERANCE = 5;
57-
private static final long MOVE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_ALL_CURSOR);
58-
private static final long DEFAULT_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
59-
private static final long NWSE_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR),
57+
private final long MOVE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_ALL_CURSOR);
58+
private final long DEFAULT_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
59+
private final long NWSE_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR),
6060
NESW_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NESW_CURSOR);
6161

6262
public static boolean isSnappingEnabled() {
@@ -157,6 +157,10 @@ public void removed() {
157157
setCursor(DEFAULT_CURSOR);
158158
mode = ModificationMode.NONE;
159159
super.removed();
160+
GLFW.glfwDestroyCursor(MOVE_CURSOR);
161+
GLFW.glfwDestroyCursor(DEFAULT_CURSOR);
162+
GLFW.glfwDestroyCursor(NESW_RESIZE_CURSOR);
163+
GLFW.glfwDestroyCursor(NWSE_RESIZE_CURSOR);
160164
}
161165

162166
@Override

1.21/src/main/java/io/github/axolotlclient/modules/auth/skin/SkinManagementScreen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ private void loadSkinsList() {
245245
var hashes = skins.stream().map(Asset::textureKey).collect(Collectors.toSet());
246246
var defaultSkinHash = Auth.getInstance().getSkinManager().getDefaultSkinHash(account);
247247
var local = new ArrayList<>(loadLocalSkins());
248-
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity()));
248+
var localHashes = local.stream().collect(Collectors.toMap(Asset::textureKey, Function.identity(), (skin, skin2) -> skin));
249+
local.removeIf(s -> !localHashes.containsValue(s));
249250
skins.replaceAll(s -> {
250251
if (s instanceof MSApi.MCProfile.OnlineSkin online) {
251252
if (localHashes.containsKey(s.textureKey()) && localHashes.get(s.textureKey()) instanceof Skin.Local file) {

1.21/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public class HudEditScreen extends Screen {
5454
private static final BooleanOption snapping = new BooleanOption("snapping", true);
5555
private static final OptionCategory hudEditScreenCategory = OptionCategory.create("hudEditScreen");
5656
private static final int GRAB_TOLERANCE = 5;
57-
private static final long MOVE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_ALL_CURSOR);
58-
private static final long DEFAULT_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
59-
private static final long NWSE_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR),
57+
private final long MOVE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_ALL_CURSOR);
58+
private final long DEFAULT_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR);
59+
private final long NWSE_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR),
6060
NESW_RESIZE_CURSOR = GLFW.glfwCreateStandardCursor(GLFW.GLFW_RESIZE_NESW_CURSOR);
6161

6262
public static boolean isSnappingEnabled() {
@@ -157,6 +157,10 @@ public void removed() {
157157
setCursor(DEFAULT_CURSOR);
158158
mode = ModificationMode.NONE;
159159
super.removed();
160+
GLFW.glfwDestroyCursor(MOVE_CURSOR);
161+
GLFW.glfwDestroyCursor(DEFAULT_CURSOR);
162+
GLFW.glfwDestroyCursor(NESW_RESIZE_CURSOR);
163+
GLFW.glfwDestroyCursor(NWSE_RESIZE_CURSOR);
160164
}
161165

162166
@Override

1.8.9/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ dependencies {
5959
localRuntime("org.slf4j:slf4j-jdk14:1.7.36")
6060

6161
compileOnly("org.lwjgl:lwjgl-glfw:${lwjglVersion}")
62+
compileOnly("org.lwjgl:lwjgl-sdl:3.4.0-SNAPSHOT")
6263

63-
modCompileOnly("io.github.moehreag:legacy-lwjgl3:${project.property("legacy_lwgjl3")}")
64-
modLocalRuntime("io.github.moehreag:legacy-lwjgl3:${project.property("legacy_lwgjl3")}:all-remapped")
64+
modImplementation("io.github.moehreag:legacy-lwjgl3:${project.property("legacy_lwgjl3")}")
65+
//modLocalRuntime("io.github.moehreag:legacy-lwjgl3:${project.property("legacy_lwgjl3")}:all-remapped")
6566

6667
include(implementation("org.lwjgl", "lwjgl-tinyfd", lwjglVersion))
6768
include(runtimeOnly("org.lwjgl", "lwjgl-tinyfd", lwjglVersion, classifier = "natives-linux"))
@@ -79,6 +80,7 @@ dependencies {
7980
}
8081

8182
configurations.configureEach {
83+
exclude("org.lwjgl.lwjgl")
8284
resolutionStrategy {
8385
dependencySubstitution {
8486
substitute(module("io.netty:netty-all:4.0.23.Final")).using(module("io.netty:netty-all:4.0.56.Final"))

1.8.9/src/main/java/io/github/axolotlclient/config/AxolotlClientConfig.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@
3636
import io.github.axolotlclient.config.screen.CreditsScreen;
3737
import io.github.axolotlclient.config.screen.ProfilesScreen;
3838
import io.github.axolotlclient.modules.Module;
39-
import io.github.axolotlclient.util.GLFWUtil;
39+
import io.github.axolotlclient.util.WindowAccess;
4040
import io.github.axolotlclient.util.options.ForceableBooleanOption;
4141
import io.github.axolotlclient.util.options.GenericOption;
4242
import lombok.Getter;
4343
import net.minecraft.client.Minecraft;
4444
import net.minecraft.client.options.KeyBinding;
4545
import net.ornithemc.osl.keybinds.api.KeyBindingEvents;
4646
import net.ornithemc.osl.lifecycle.api.client.MinecraftClientEvents;
47-
import org.lwjgl.glfw.GLFW;
4847

4948
public class AxolotlClientConfig extends AxolotlClientConfigCommon {
5049

@@ -73,7 +72,7 @@ public class AxolotlClientConfig extends AxolotlClientConfigCommon {
7372
public final ColorOption loadingScreenColor = new ColorOption("loadingBgColor", new Color(-1));
7473
public final BooleanOption nightMode = new BooleanOption("nightMode", false);
7574
public final BooleanOption rawMouseInput = new BooleanOption("rawMouseInput", false, v ->
76-
GLFWUtil.runUsingGlfwHandle(h -> GLFW.glfwSetInputMode(h, GLFW.GLFW_RAW_MOUSE_MOTION, v ? 1 : 0)));
75+
WindowAccess.getInstance().setRawMouseMotion(v));
7776

7877
public final BooleanOption enableCustomOutlines = new BooleanOption("enabled", false);
7978
public final ColorOption outlineColor = new ColorOption("color", Color.parse("#DD000000"));
@@ -175,10 +174,15 @@ public AxolotlClientConfig() {
175174
AxolotlClient.getInstance().modules.add(new Module() {
176175
@Override
177176
public void lateInit() {
178-
if (System.getProperty("org.lwjgl.input.Mouse.disableRawInput") == null) {
179-
System.setProperty("org.lwjgl.input.Mouse.disableRawInput", "true");
177+
if (WindowAccess.getInstance().rawMouseMotionAvailable()) {
178+
179+
if (System.getProperty("org.lwjgl.input.Mouse.disableRawInput") == null) {
180+
System.setProperty("org.lwjgl.input.Mouse.disableRawInput", "true");
181+
}
182+
WindowAccess.getInstance().setRawMouseMotion(rawMouseInput.get());
183+
} else {
184+
AxolotlClient.getInstance().getConfigManager().suppressName(rawMouseInput.getName());
180185
}
181-
GLFWUtil.runUsingGlfwHandle(h -> GLFW.glfwSetInputMode(h, GLFW.GLFW_RAW_MOUSE_MOTION, rawMouseInput.get() ? 1 : 0));
182186
}
183187
});
184188

1.8.9/src/main/java/io/github/axolotlclient/mixin/GameRendererMixin.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
import org.spongepowered.asm.mixin.Mixin;
5959
import org.spongepowered.asm.mixin.Shadow;
6060
import org.spongepowered.asm.mixin.injection.At;
61-
import org.spongepowered.asm.mixin.injection.At.Shift;
6261
import org.spongepowered.asm.mixin.injection.Inject;
6362
import org.spongepowered.asm.mixin.injection.Redirect;
6463
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -94,7 +93,7 @@ public abstract class GameRendererMixin {
9493
this.viewDistance = (float) (this.viewDistance * 2 + Minecraft.getInstance().player.getSourcePos().y);
9594
Entity entity = this.minecraft.getCamera();
9695

97-
GL11.glFog(2918, this.setFogColor(this.fogRed, this.fogGreen, this.fogBlue, 1.0F));
96+
GL11.glFogfv(2918, this.setFogColor(this.fogRed, this.fogGreen, this.fogBlue, 1.0F));
9897
GL11.glNormal3f(0.0F, -1.0F, 0.0F);
9998
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
10099
Block block = Camera.getBlockInside(this.minecraft.world, entity, tickDelta);
@@ -197,7 +196,7 @@ public abstract class GameRendererMixin {
197196
}
198197
}
199198

200-
@Inject(method = "render(FJ)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/pipeline/RenderTarget;bindWrite(Z)V", shift = Shift.BEFORE))
199+
@Inject(method = "render(FJ)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/pipeline/RenderTarget;bindWrite(Z)V"))
201200
public void axolotlclient$worldMotionBlur(float tickDelta, long nanoTime, CallbackInfo ci) {
202201
MenuBlur.getInstance().updateBlur();
203202
axolotlclient$postRender(tickDelta, nanoTime, null);

0 commit comments

Comments
 (0)