diff --git a/.gitignore b/.gitignore
index ca7acaf..60fbfa6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ bin
run
.skidfuscator
+.idea
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 359bb53..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# 默认忽略的文件
-/shelf/
-/workspace.xml
diff --git a/.idea/MarsCodeWorkspaceAppSettings.xml b/.idea/MarsCodeWorkspaceAppSettings.xml
deleted file mode 100644
index d4a52f0..0000000
--- a/.idea/MarsCodeWorkspaceAppSettings.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index b86273d..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index 8b8d44e..0000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 7d3b3e8..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index e754f00..0000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
deleted file mode 100644
index 4cc5492..0000000
--- a/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/migrateChatHistory.xml b/.idea/migrateChatHistory.xml
deleted file mode 100644
index 94b2914..0000000
--- a/.idea/migrateChatHistory.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 61b50dc..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index a02bf5b..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/SoarClient-CN.iml b/.idea/modules/SoarClient-CN.iml
deleted file mode 100644
index 2c92d42..0000000
--- a/.idea/modules/SoarClient-CN.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/SoarClient-CN.main.iml b/.idea/modules/SoarClient-CN.main.iml
deleted file mode 100644
index 750b879..0000000
--- a/.idea/modules/SoarClient-CN.main.iml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/SoarClient-CN.test.iml b/.idea/modules/SoarClient-CN.test.iml
deleted file mode 100644
index 0fee84f..0000000
--- a/.idea/modules/SoarClient-CN.test.iml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/cn.pupperclient.SoarClient-CN.main.iml b/.idea/modules/cn.pupperclient.SoarClient-CN.main.iml
deleted file mode 100644
index 0fee84f..0000000
--- a/.idea/modules/cn.pupperclient.SoarClient-CN.main.iml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/cn.pupperclient.SoarClient-CN.test.iml b/.idea/modules/cn.pupperclient.SoarClient-CN.test.iml
deleted file mode 100644
index 0fee84f..0000000
--- a/.idea/modules/cn.pupperclient.SoarClient-CN.test.iml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/Minecraft_Client.xml b/.idea/runConfigurations/Minecraft_Client.xml
deleted file mode 100644
index d5eb21a..0000000
--- a/.idea/runConfigurations/Minecraft_Client.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/Minecraft_Server.xml b/.idea/runConfigurations/Minecraft_Server.xml
deleted file mode 100644
index c3a8521..0000000
--- a/.idea/runConfigurations/Minecraft_Server.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
deleted file mode 100644
index 2b63946..0000000
--- a/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 355267f..3d6815b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,5 @@
plugins {
- id 'fabric-loom' version '1.14-SNAPSHOT'
+ id 'fabric-loom' version "1.14-SNAPSHOT"
}
project.ext.lwjglVersion = "3.3.3"
@@ -35,18 +35,18 @@ dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
- modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
-
- modImplementation "com.viaversion:viafabricplus-api:4.0.2"
- modRuntimeOnly "maven.modrinth:sodium:mc1.21.4-0.6.6-fabric"
- modRuntimeOnly "maven.modrinth:iris:1.8.5+1.21.4-fabric"
- modRuntimeOnly "maven.modrinth:sodium-extra:mc1.21.4-0.6.1+fabric"
- modRuntimeOnly "maven.modrinth:lithium:mc1.21.4-0.14.7-fabric"
- modImplementation "maven.modrinth:in-game-account-switcher:WBbjirJP"
- modImplementation "com.viaversion:viafabricplus:4.0.2"
- modRuntimeOnly "maven.modrinth:immediatelyfast:1.3.3+1.21.4-fabric"
- modRuntimeOnly "maven.modrinth:entityculling:NkBXk0Ye"
- modImplementation "maven.modrinth:modmenu:13.0.3"
+ modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
+
+ modImplementation "com.viaversion:viafabricplus-api:4.1.5"
+ modRuntimeOnly "maven.modrinth:sodium:mc1.21.5-0.6.13-fabric"
+ modRuntimeOnly "maven.modrinth:iris:1.8.11+1.21.5-fabric"
+ modRuntimeOnly "maven.modrinth:sodium-extra:mc1.21.5-0.6.3+fabric"
+ modRuntimeOnly "maven.modrinth:lithium:mc1.21.5-0.16.3-fabric"
+ modImplementation "maven.modrinth:in-game-account-switcher:Rqmwlwr6"
+ modImplementation "com.viaversion:viafabricplus:4.1.5"
+ modRuntimeOnly "maven.modrinth:immediatelyfast:1.9.7+1.21.5-fabric"
+ // modRuntimeOnly "maven.modrinth:entityculling:ldvBBWG2"
+ modImplementation "maven.modrinth:modmenu:14.0.0"
jij 'io.github.smartboot.socket:aio-core:1.7.1'
jij 'com.github.ben-manes.caffeine:caffeine:3.1.8'
@@ -64,10 +64,10 @@ dependencies {
jij 'com.googlecode.soundlibs:jlayer:1.0.1.4'
jij "net.lenni0451:MCPing:1.4.2"
jij "net.lenni0451:Reflect:1.4.0"
- modImplementation 'net.java.dev.jna:jna:5.12.1'
- modImplementation 'net.java.dev.jna:jna-platform:5.12.1'
+ modImplementation 'net.java.dev.jna:jna:5.18.1'
+ modImplementation 'net.java.dev.jna:jna-platform:5.18.1'
- modJij 'com.github.CCBlueX:mcef:3.0.0-1.21.4'
+ modJij 'com.github.CCBlueX:mcef:3.1.3-1.21.5'
def lwjglNfdDeps = [
"org.lwjgl:lwjgl-nfd:$lwjglVersion",
diff --git a/gradle.properties b/gradle.properties
index a842401..28c9d88 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,14 +4,15 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
-minecraft_version=1.21.4
-yarn_mappings=1.21.4+build.8
-loader_version=0.18.2
+minecraft_version=1.21.5
+yarn_mappings=1.21.5+build.1
+loader_version=0.18.4
+
+# Fabric API
+fabric_api_version=0.128.2+1.21.5
# Mod Properties
-mod_version=25.12.3
+mod_version=26.1.1
maven_group=cn.pupperclient
archives_base_name=pupper
-# Dependencies
-fabric_version=0.119.4+1.21.4
diff --git a/src/main/java/cn/pupperclient/PupperClient.java b/src/main/java/cn/pupperclient/PupperClient.java
index 36f9ef7..7215137 100644
--- a/src/main/java/cn/pupperclient/PupperClient.java
+++ b/src/main/java/cn/pupperclient/PupperClient.java
@@ -26,6 +26,7 @@
import com.viaversion.viafabricplus.api.ViaFabricPlusBase;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
+import net.minecraft.util.Identifier;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
@@ -37,7 +38,7 @@ public class PupperClient implements IMinecraft {
private static final String CONFIG_FILE_NAME = "pupper.ok";
private static final String ICON_PATH = "assets/pupper/logo.png";
private static final String CLIENT_NAME = "Pupper Client";
- private static final String CLIENT_VERSION = "25.12.3";
+ private static final String CLIENT_VERSION = "26.1.1";
private static final PupperClient INSTANCE = new PupperClient();
@@ -240,4 +241,8 @@ public enum MusicToolStatus {
FAILED,
DONE
}
+
+ public static Identifier identifier(String path) {
+ return Identifier.of("pupper", path);
+ }
}
diff --git a/src/main/java/cn/pupperclient/PupperLogger.java b/src/main/java/cn/pupperclient/PupperLogger.java
index 05cd4e5..8d0479e 100644
--- a/src/main/java/cn/pupperclient/PupperLogger.java
+++ b/src/main/java/cn/pupperclient/PupperLogger.java
@@ -8,19 +8,19 @@ public class PupperLogger {
private static final Logger logger = LogManager.getLogger("PupperClient Client");
public static void info(String prefix, String message) {
- logger.info("[SC/INFO] [" + prefix + "] " + message);
+ logger.info("[PupperClient/INFO] [{}] {}", prefix, message);
}
public static void warn(String prefix, String message) {
- logger.warn("[SC/WARN] [" + prefix + "] " + message);
+ logger.warn("[PupperClient/WARN] [{}] {}", prefix, message);
}
public static void error(String prefix, String message) {
- logger.error("[SC/ERROR] [" + prefix + "] " + message);
+ logger.error("[PupperClient/ERROR] [{}] {}", prefix, message);
}
public static void error(String prefix, String message, Exception e) {
- logger.error("[SC/ERROR] [" + prefix + "] " + message, e);
+ logger.error("[PupperClient/ERROR] [{}] {}", prefix, message, e);
}
public static Logger getLogger() {
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/SimpleSoarGui.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/SimpleSoarGui.java
deleted file mode 100644
index 92ecb06..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/SimpleSoarGui.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api;
-
-import cn.pupperclient.skia.Skia;
-import cn.pupperclient.skia.context.SkiaContext;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.DrawContext;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.text.Text;
-
-public class SimpleSoarGui {
- public MinecraftClient client = MinecraftClient.getInstance();
- private final boolean mcScale;
-
- public SimpleSoarGui(boolean mcScale) {
- this.mcScale = mcScale;
- }
-
- public void init() {
- }
-
- public void draw(double mouseX, double mouseY) {
- }
-
- public void mousePressed(double mouseX, double mouseY, int button) {
- }
-
- public void mouseReleased(double mouseX, double mouseY, int button) {
- }
-
- public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
- }
-
- public void charTyped(char chr, int modifiers) {
- }
-
- public void keyPressed(int keyCode, int scanCode, int modifiers) {
- }
-
- public Screen build() {
- return new Screen(Text.empty()) {
-
- @Override
- public void init() {
- SimpleSoarGui.this.init();
- }
-
- @Override
- public void render(DrawContext context, int mouseX, int mouseY, float delta) {
-
- SkiaContext.draw((skiaContext) -> {
-
- Skia.save();
-
- if (mcScale) {
- if (client != null) {
- Skia.scale((float) client.getWindow().getScaleFactor());
- }
- }
-
- if (client != null) {
- SimpleSoarGui.this.draw(mcScale ? mouseX : client.mouse.getX(),
- mcScale ? mouseY : client.mouse.getY());
- }
- Skia.restore();
- });
- }
-
- @Override
- public boolean mouseClicked(double mouseX, double mouseY, int button) {
- if (client != null) {
- SimpleSoarGui.this.mousePressed(mcScale ? mouseX : client.mouse.getX(),
- mcScale ? mouseY : client.mouse.getY(), button);
- }
- return true;
- }
-
- @Override
- public boolean mouseReleased(double mouseX, double mouseY, int button) {
- if (client != null) {
- SimpleSoarGui.this.mouseReleased(mcScale ? mouseX : client.mouse.getX(),
- mcScale ? mouseY : (int) client.mouse.getY(), button);
- }
- return true;
- }
-
- @Override
- public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
- if (client != null) {
- SimpleSoarGui.this.mouseScrolled(mcScale ? mouseX : client.mouse.getX(),
- mcScale ? mouseY : (int) client.mouse.getY(), horizontalAmount, verticalAmount);
- }
- return true;
- }
-
- @Override
- public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
- SimpleSoarGui.this.keyPressed(keyCode, scanCode, modifiers);
- return true;
- }
-
- @Override
- public boolean charTyped(char chr, int modifiers) {
- SimpleSoarGui.this.charTyped(chr, modifiers);
- return true;
- }
-
- @Override
- public boolean shouldPause() {
- return false;
- }
- };
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/SoarGui.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/SoarGui.java
deleted file mode 100644
index 9781682..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/SoarGui.java
+++ /dev/null
@@ -1,264 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api;
-
-import cn.pupperclient.PupperClient;
-import cn.pupperclient.animation.Animation;
-import cn.pupperclient.animation.Duration;
-import cn.pupperclient.animation.cubicbezier.impl.EaseEmphasizedDecelerate;
-import cn.pupperclient.gui.api.page.impl.api.page.GuiTransition;
-import cn.pupperclient.gui.api.page.impl.api.page.SimplePage;
-import cn.pupperclient.management.color.api.ColorPalette;
-import cn.pupperclient.management.config.ConfigType;
-import cn.pupperclient.management.mod.impl.settings.ModMenuSettings;
-import cn.pupperclient.shader.impl.Kawaseblur;
-import cn.pupperclient.skia.Skia;
-import cn.pupperclient.ui.component.Component;
-import cn.pupperclient.utils.Multithreading;
-import io.github.humbleui.skija.SurfaceOrigin;
-import net.minecraft.client.gui.screen.Screen;
-import org.lwjgl.glfw.GLFW;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class SoarGui extends SimpleSoarGui {
-
- protected List components = new ArrayList<>();
- protected List pages;
-
- protected SimplePage currentPage;
- protected SimplePage lastPage;
-
- private Animation inOutAnimation;
- private boolean closable;
- private Screen nextScreen;
-
- public SoarGui(boolean mcScale) {
- super(mcScale);
-
- this.pages = createPages();
-
- if (!pages.isEmpty()) {
- this.currentPage = pages.getFirst();
- }
- }
-
- @Override
- public void init() {
- setPageSize(currentPage);
- inOutAnimation = new EaseEmphasizedDecelerate(Duration.EXTRA_LONG_1, 0, 1);
- closable = true;
- currentPage.init();
- }
-
- public void setPageSize(SimplePage p) {
- p.setX(getX());
- p.setY(getY());
- p.setWidth(getWidth());
- p.setHeight(getHeight());
- }
-
- @Override
- public void draw(double mouseX, double mouseY) {
-
- ColorPalette palette = PupperClient.getInstance().getColorManager().getPalette();
-
- if (ModMenuSettings.getInstance().getBlurSetting().isEnabled()) {
- Skia.drawImage(Kawaseblur.GUI_BLUR.getTexture(), 0, 0, client.getWindow().getWidth(),
- client.getWindow().getHeight(), inOutAnimation.getValue(), SurfaceOrigin.BOTTOM_LEFT);
- }
-
- Skia.save();
- Skia.setAlpha((int) (inOutAnimation.getValue() * 255));
- Skia.scale(getX(), getY(), getWidth(), getHeight(), 2 - inOutAnimation.getValue());
-
- Skia.clip(getX(), getY(), getWidth(), getHeight(), 35);
- Skia.drawRoundedRect(getX(), getY(), getWidth(), getHeight(), 35, palette.getSurfaceContainer());
-
- if (currentPage != null && lastPage == null) {
- currentPage.draw(mouseX, mouseY);
- }
-
- if (lastPage != null) {
-
- GuiTransition transition = lastPage.getTransition();
-
- if (currentPage.getTransition().isConsecutive()) {
-
- Skia.save();
-
- if (transition != null) {
- float[] result = transition.onTransition(lastPage.getAnimation());
- Skia.translate(result[0] * getWidth(), result[1] * getHeight());
- }
-
- lastPage.draw(mouseX, mouseY);
- Skia.restore();
- }
-
- Skia.save();
- transition = currentPage.getTransition();
-
- if (transition != null) {
- float[] result = transition.onTransition(currentPage.getAnimation());
- Skia.translate(result[0] * getWidth(), result[1] * getHeight());
- }
-
- currentPage.draw(mouseX, mouseY);
- Skia.restore();
-
- if (lastPage.getAnimation().isFinished()) {
- lastPage = null;
- }
- }
-
- for (Component c : components) {
- c.draw(mouseX, mouseY);
- }
-
- Skia.restore();
-
- if (inOutAnimation.getEnd() == 0 && inOutAnimation.isFinished()) {
- client.setScreen(nextScreen);
- nextScreen = null;
- }
- }
-
- @Override
- public void mousePressed(double mouseX, double mouseY, int button) {
-
- if (currentPage != null) {
- currentPage.mousePressed(mouseX, mouseY, button);
- }
-
- for (Component c : components) {
- c.mousePressed(mouseX, mouseY, button);
- }
- }
-
- @Override
- public void mouseReleased(double mouseX, double mouseY, int button) {
-
- if (currentPage != null) {
- currentPage.mouseReleased(mouseX, mouseY, button);
- }
-
- for (Component c : components) {
- c.mouseReleased(mouseX, mouseY, button);
- }
- }
-
- @Override
- public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
- if (currentPage != null) {
- currentPage.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
- }
- }
-
- @Override
- public void charTyped(char chr, int modifiers) {
-
- if (currentPage != null) {
- currentPage.charTyped(chr, modifiers);
- }
-
- for (Component c : components) {
- c.charTyped(chr, modifiers);
- }
- }
-
- @Override
- public void keyPressed(int keyCode, int scanCode, int modifiers) {
-
- if (keyCode == GLFW.GLFW_KEY_ESCAPE && inOutAnimation.getEnd() == 1 && closable) {
- close();
- }
-
- if (currentPage != null) {
- currentPage.keyPressed(keyCode, scanCode, modifiers);
- }
-
- for (Component c : components) {
- c.keyPressed(keyCode, scanCode, modifiers);
- }
- }
-
- public void close(Screen nextScreen) {
- if (inOutAnimation.getEnd() == 1) {
- this.nextScreen = nextScreen;
- inOutAnimation = new EaseEmphasizedDecelerate(Duration.EXTRA_LONG_1, 1, 0);
- Multithreading.runAsync(() -> {
- PupperClient.getInstance().getConfigManager().save(ConfigType.MOD);
- });
- }
- }
-
- public void close() {
- close(null);
- }
-
- public SimplePage getCurrentPage() {
- return currentPage;
- }
-
- public void setCurrentPage(SimplePage page) {
-
- if (currentPage != null) {
- lastPage = currentPage;
- currentPage.onClosed();
- }
-
- this.currentPage = page;
- currentPage.setAnimation(new EaseEmphasizedDecelerate(Duration.MEDIUM_1, 0, 1));
- lastPage.setAnimation(new EaseEmphasizedDecelerate(Duration.MEDIUM_1, 1, 0));
-
- if (currentPage != null) {
- setPageSize(currentPage);
- currentPage.init();
- }
- }
-
- public void setCurrentPage(Class extends SimplePage> clazz) {
-
- SimplePage page = getPage(clazz);
-
- if (page != null) {
- setCurrentPage(page);
- }
- }
-
- public SimplePage getPage(Class extends SimplePage> clazz) {
-
- SimplePage page = null;
-
- for (SimplePage p : pages) {
- if (p.getClass().equals(clazz)) {
- page = p;
- break;
- }
- }
-
- return page;
- }
-
- public List getPages() {
- return pages;
- }
-
- public boolean isClosable() {
- return closable;
- }
-
- public void setClosable(boolean closable) {
- this.closable = closable;
- }
-
- public abstract List createPages();
-
- public abstract float getX();
-
- public abstract float getY();
-
- public abstract float getWidth();
-
- public abstract float getHeight();
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/GuiTransition.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/GuiTransition.java
deleted file mode 100644
index f56b2e9..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/GuiTransition.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api.page;
-
-import cn.pupperclient.animation.Animation;
-
-public abstract class GuiTransition {
-
- private final boolean consecutive;
-
- public GuiTransition(boolean consecutive) {
- this.consecutive = consecutive;
- }
-
- public abstract float[] onTransition(Animation animation);
-
- public boolean isConsecutive() {
- return consecutive;
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/Page.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/Page.java
deleted file mode 100644
index 31fffc0..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/Page.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api.page;
-
-import cn.pupperclient.gui.api.page.impl.api.SoarGui;
-import cn.pupperclient.skia.Skia;
-import cn.pupperclient.ui.component.impl.text.SearchBar;
-import cn.pupperclient.utils.mouse.ScrollHelper;
-
-public class Page extends SimplePage {
-
- protected ScrollHelper scrollHelper = new ScrollHelper();
- protected SearchBar searchBar;
-
- public Page(SoarGui parent, String title, String icon, GuiTransition transition) {
- super(parent, title, icon, transition);
- }
-
- @Override
- public void init() {
-
- String text = "";
-
- if (searchBar != null) {
- text = searchBar.getText();
- }
-
- searchBar = new SearchBar(x + width - 260 - 32, y + 32, 260, text, () -> {
- scrollHelper.reset();
- });
- }
-
- @Override
- public void draw(double mouseX, double mouseY) {
-
- scrollHelper.onUpdate();
-
- Skia.save();
- Skia.translate(0, scrollHelper.getValue());
-
- mouseY = (int) (mouseY - scrollHelper.getValue());
- searchBar.draw(mouseX, mouseY);
-
- Skia.restore();
- }
-
- @Override
- public void mousePressed(double mouseX, double mouseY, int button) {
- mouseY = mouseY - scrollHelper.getValue();
- searchBar.mousePressed(mouseX, mouseY, button);
- }
-
- @Override
- public void mouseReleased(double mouseX, double mouseY, int button) {
- mouseY = mouseY - scrollHelper.getValue();
- searchBar.mouseReleased(mouseX, mouseY, button);
- }
-
- @Override
- public void charTyped(char chr, int modifiers) {
- searchBar.charTyped(chr, modifiers);
- }
-
- @Override
- public void keyPressed(int keyCode, int scanCode, int modifiers) {
- searchBar.keyPressed(keyCode, scanCode, modifiers);
- }
-
- @Override
- public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
- scrollHelper.onScroll(verticalAmount);
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/SimplePage.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/SimplePage.java
deleted file mode 100644
index b0ce1d6..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/SimplePage.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api.page;
-
-import cn.pupperclient.animation.Animation;
-import cn.pupperclient.animation.other.DummyAnimation;
-import cn.pupperclient.gui.api.page.impl.api.SoarGui;
-
-public class SimplePage {
-
- protected float x, y, width, height;
- private String title, icon;
- protected SoarGui parent;
- private Animation animation;
- private GuiTransition transition;
-
- public SimplePage(SoarGui parent, String title, String icon, GuiTransition transition) {
- this.parent = parent;
- this.title = title;
- this.icon = icon;
- this.x = 0;
- this.y = 0;
- this.width = 0;
- this.height = 0;
- this.transition = transition;
- this.animation = new DummyAnimation(1);
- }
-
- public void init() {
- }
-
- public void draw(double mouseX, double mouseY) {
- }
-
- public void mousePressed(double mouseX, double mouseY, int button) {
- }
-
- public void mouseReleased(double mouseX, double mouseY, int button) {
- }
-
- public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
- }
-
- public void charTyped(char chr, int modifiers) {
- }
-
- public void keyPressed(int keyCode, int scanCode, int modifiers) {
- }
-
- public void onClosed() {
- }
-
- public float getX() {
- return x;
- }
-
- public void setX(float x) {
- this.x = x;
- }
-
- public float getY() {
- return y;
- }
-
- public void setY(float y) {
- this.y = y;
- }
-
- public float getWidth() {
- return width;
- }
-
- public void setWidth(float width) {
- this.width = width;
- }
-
- public float getHeight() {
- return height;
- }
-
- public void setHeight(float height) {
- this.height = height;
- }
-
- public String getTitle() {
- return title;
- }
-
- public String getIcon() {
- return icon;
- }
-
- public GuiTransition getTransition() {
- return transition;
- }
-
- public void setTransition(GuiTransition transition) {
- this.transition = transition;
- }
-
- public Animation getAnimation() {
- return animation;
- }
-
- public void setAnimation(Animation animation) {
- this.animation = animation;
- }
-
- public SoarGui getParent() {
- return parent;
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/LeftRightTransition.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/LeftRightTransition.java
deleted file mode 100644
index b082c09..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/LeftRightTransition.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api.page.impl;
-
-import cn.pupperclient.animation.Animation;
-import cn.pupperclient.gui.api.page.impl.api.page.GuiTransition;
-
-public class LeftRightTransition extends GuiTransition {
-
- public LeftRightTransition(boolean consecutive) {
- super(consecutive);
- }
-
- @Override
- public float[] onTransition(Animation animation) {
-
- float progress = animation.getValue();
- float x = 0;
-
- if (animation.getEnd() == 1) {
- x = -1 + progress;
- } else {
- x = -1 + progress;
- }
-
- return new float[] { x, 0 };
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/LeftTransition.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/LeftTransition.java
deleted file mode 100644
index 8042623..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/LeftTransition.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api.page.impl;
-
-import cn.pupperclient.animation.Animation;
-import cn.pupperclient.gui.api.page.impl.api.page.GuiTransition;
-
-public class LeftTransition extends GuiTransition {
-
- public LeftTransition(boolean consecutive) {
- super(consecutive);
- }
-
- @Override
- public float[] onTransition(Animation animation) {
-
- float progress = animation.getValue();
- float x = 0;
-
- if (animation.getEnd() == 1) {
- x = -1 + progress;
- } else {
- x = -1 + progress;
- }
-
- return new float[] { x, 0 };
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/RightLeftTransition.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/RightLeftTransition.java
deleted file mode 100644
index 9c3efc7..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/RightLeftTransition.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api.page.impl;
-
-import cn.pupperclient.animation.Animation;
-import cn.pupperclient.gui.api.page.impl.api.page.GuiTransition;
-
-public class RightLeftTransition extends GuiTransition {
-
- public RightLeftTransition(boolean consecutive) {
- super(consecutive);
- }
-
- @Override
- public float[] onTransition(Animation animation) {
-
- float progress = animation.getValue();
- float x = 0;
-
- if (animation.getEnd() == 1) {
- x = 1 - progress;
- } else {
- x = -1 + progress;
- }
-
- return new float[] { x, 0 };
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/RightTransition.java b/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/RightTransition.java
deleted file mode 100644
index 38d9164..0000000
--- a/src/main/java/cn/pupperclient/gui/api/page/impl/api/page/impl/RightTransition.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package cn.pupperclient.gui.api.page.impl.api.page.impl;
-
-import cn.pupperclient.animation.Animation;
-import cn.pupperclient.gui.api.page.impl.api.page.GuiTransition;
-
-public class RightTransition extends GuiTransition {
-
- public RightTransition(boolean consecutive) {
- super(consecutive);
- }
-
- @Override
- public float[] onTransition(Animation animation) {
-
- float progress = animation.getValue();
- float x = 0;
-
- if (animation.getEnd() == 1) {
- x = 1 - progress;
- } else {
- x = 1 + -progress;
- }
-
- return new float[] { x, 0 };
- }
-}
diff --git a/src/main/java/cn/pupperclient/gui/modmenu/pages/MusicPage.java b/src/main/java/cn/pupperclient/gui/modmenu/pages/MusicPage.java
index 91445bd..bd55c4b 100644
--- a/src/main/java/cn/pupperclient/gui/modmenu/pages/MusicPage.java
+++ b/src/main/java/cn/pupperclient/gui/modmenu/pages/MusicPage.java
@@ -264,12 +264,10 @@ private void refreshMusicList() {
isRefreshing = true;
- // 在后台线程中刷新音乐列表
new Thread(() -> {
try {
PupperClient.getInstance().getMusicManager().load();
- // 在主线程中更新UI
cn.pupperclient.utils.Multithreading.runMainThread(() -> {
this.init();
isRefreshing = false;
@@ -324,12 +322,12 @@ private void drawRoundedImage(File file, float x, float y, float width, float he
Skia.restore();
}
- private class Item {
+ private static class Item {
- private Music music;
- private SimpleAnimation xAnimation = new SimpleAnimation();
- private SimpleAnimation yAnimation = new SimpleAnimation();
- private SimpleAnimation focusAnimation = new SimpleAnimation();
+ private final Music music;
+ private final SimpleAnimation xAnimation = new SimpleAnimation();
+ private final SimpleAnimation yAnimation = new SimpleAnimation();
+ private final SimpleAnimation focusAnimation = new SimpleAnimation();
private Item(Music music) {
this.music = music;
diff --git a/src/main/java/cn/pupperclient/libraries/browser/JCefBrowser.java b/src/main/java/cn/pupperclient/libraries/browser/JCefBrowser.java
index 4756451..7cfe24d 100644
--- a/src/main/java/cn/pupperclient/libraries/browser/JCefBrowser.java
+++ b/src/main/java/cn/pupperclient/libraries/browser/JCefBrowser.java
@@ -11,6 +11,7 @@
import net.ccbluex.liquidbounce.mcef.MCEFDownloadManager;
import net.ccbluex.liquidbounce.mcef.MCEFPlatform;
import net.ccbluex.liquidbounce.mcef.cef.MCEFBrowser;
+import net.ccbluex.liquidbounce.mcef.cef.MCEFBrowserSettings;
public class JCefBrowser {
@@ -24,7 +25,7 @@ public static void init() {
if(browser == null) {
String url = "https://cn.bing.com";
boolean transparent = true;
- browser = MCEF.INSTANCE.createBrowser(url, transparent, 60);
+ browser = MCEF.INSTANCE.createBrowser(url, transparent, null);
browser.resize(1280, 720);
}
}
diff --git a/src/main/java/cn/pupperclient/management/auth/AuthManager.java b/src/main/java/cn/pupperclient/management/auth/AuthManager.java
deleted file mode 100644
index 2fa18f5..0000000
--- a/src/main/java/cn/pupperclient/management/auth/AuthManager.java
+++ /dev/null
@@ -1,266 +0,0 @@
-package cn.pupperclient.management.auth;
-
-import cn.pupperclient.PupperClient;
-import cn.pupperclient.utils.file.FileLocation;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-
-import java.io.File;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardOpenOption;
-import java.security.MessageDigest;
-import java.util.HashMap;
-import java.util.Map;
-
-public class AuthManager {
- private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
- private static final String SECRET_KEY = "pupper";
- private static AuthManager instance;
-
- private Map users = new HashMap<>();
- private UserData currentUser;
-
- public static AuthManager getInstance() {
- if (instance == null) {
- instance = new AuthManager();
- }
- return instance;
- }
-
- private AuthManager() {
- loadUserData();
- }
-
- public static class UserData {
- private String username;
- private String passwordHash;
- private long createdAt;
- private long lastLogin;
-
- public UserData() {}
-
- public UserData(String username, String password) {
- this.username = username;
- this.passwordHash = hashPassword(password);
- this.createdAt = System.currentTimeMillis();
- this.lastLogin = System.currentTimeMillis();
- }
-
- // Getters and Setters
- public String getUsername() { return username; }
- public void setUsername(String username) { this.username = username; }
- public String getPasswordHash() { return passwordHash; }
- public void setPasswordHash(String passwordHash) { this.passwordHash = passwordHash; }
- public long getCreatedAt() { return createdAt; }
- public void setCreatedAt(long createdAt) { this.createdAt = createdAt; }
- public long getLastLogin() { return lastLogin; }
- public void setLastLogin(long lastLogin) { this.lastLogin = lastLogin; }
- }
-
- private static String hashPassword(String password) {
- try {
- String data = password + SECRET_KEY;
- MessageDigest digest = MessageDigest.getInstance("SHA-256");
- byte[] hash = digest.digest(data.getBytes(StandardCharsets.UTF_8));
-
- // 转换为十六进制字符串
- StringBuilder hexString = new StringBuilder();
- for (byte b : hash) {
- String hex = Integer.toHexString(0xff & b);
- if (hex.length() == 1) hexString.append('0');
- hexString.append(hex);
- }
- return hexString.toString();
- } catch (Exception e) {
- PupperClient.LOGGER.error("Failed to hash password", e);
- throw new RuntimeException("Password hashing failed", e);
- }
- }
-
- /**
- * 加载用户数据
- */
- private void loadUserData() {
- try {
- File userDataFile = FileLocation.USER_DATA_DIR;
- Path userDataPath = userDataFile.toPath();
-
- PupperClient.LOGGER.info("Attempting to load user data from: {}", userDataPath);
-
- // 如果文件不存在,创建空的数据文件
- if (!userDataFile.exists()) {
- PupperClient.LOGGER.info("No existing user data found, creating new file");
- users = new HashMap<>();
-
- // 确保目录存在
- File parentDir = userDataFile.getParentFile();
- if (parentDir != null && !parentDir.exists()) {
- boolean dirsCreated = parentDir.mkdirs();
- if (!dirsCreated) {
- PupperClient.LOGGER.warn("Failed to create parent directories: {}", parentDir.getAbsolutePath());
- }
- }
-
- // 创建空文件
- boolean fileCreated = userDataFile.createNewFile();
- if (!fileCreated) {
- PupperClient.LOGGER.warn("Failed to create user data file: {}", userDataPath);
- }
-
- saveUserData(); // 保存空的用户数据
- return;
- }
-
- // 检查是否是文件而不是目录
- if (userDataFile.isDirectory()) {
- PupperClient.LOGGER.error("User data path is a directory, not a file: {}", userDataPath);
- users = new HashMap<>();
- return;
- }
-
- // 读取并解析用户数据
- String json = new String(Files.readAllBytes(userDataPath));
- if (json.trim().isEmpty()) {
- users = new HashMap<>();
- PupperClient.LOGGER.info("User data file is empty, starting fresh");
- } else {
- java.lang.reflect.Type type = new TypeToken