diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 08f496ad..979c9bd6 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -1,8 +1,8 @@
name: Java CI with Gradle
on:
-# push:
-# branches: [ "master", "v4" ]
+ pull_request:
+ branches: [ "master", "v4" ]
workflow_dispatch:
jobs:
@@ -36,61 +36,3 @@ jobs:
with:
name: v1.8.9
path: v1.8.9/build/libs/
-
- - name: Upload artifact
- run: |
- cd v1.8.9
-
- plain_version=$(awk -F'=' '/^version[[:space:]]*=/ {print $2}' gradle.properties | tr -d '[:space:]')
- sha=$(git rev-parse --short=6 HEAD)
- version="${plain_version}-${sha}"
-
- mkdir -p build/libs
- cd build/libs
-
- export JAR=$(find . -name "*.jar")
- mkdir -p zip
- cp "$JAR" zip/fpsmaster.jar
- cd zip
- zip -r fpsmaster.zip *
-
- # 创建存储目录
- RESPONSE=$(curl --location --request POST "https://api.kstore.space/api/v1/file/create" \
- --header "X-GitHub-Event: workflow_run" \
- --header "User-Agent: Apifox/1.0.0 (https://apifox.com)" \
- --form "access_token=${{ secrets.OSS }}" \
- --form "fileId=0" \
- --form "name=action-${{ github.event.head_commit.id }}")
-
- DIR_ID=$(echo "$RESPONSE" | jq -r '.data.id')
- echo "DirectoryId: $DIR_ID"
-
- # 上传文件
- UPLOAD_RESPONSE=$(curl --location --request POST "https://upload.kstore.space/upload/$DIR_ID?access_token=${{ secrets.OSS }}" \
- -F "file=@fpsmaster.zip")
-
- DOWNLOAD_URL=$(echo "$UPLOAD_RESPONSE" | jq -r '.data.downloadUrl')
- FILE_ID=$(echo "$UPLOAD_RESPONSE" | jq -r '.data.id')
-
- echo "FileId: $FILE_ID"
- echo "URL: $DOWNLOAD_URL"
-
- # 设为直接下载
- RESPONSE=$(curl --location --request POST "https://api.kstore.cc/api/v1/file/direct?access_token=${{ secrets.OSS }}" \
- --form "fileId=$FILE_ID" \
- --form "isDirect=1")
-
- echo "$RESPONSE"
-
- echo "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
-
- # 版本推送
- curl --get \
- --data-urlencode "key=${{ secrets.API_KEY }}" \
- --data-urlencode "commit=${{ github.sha }}" \
- --data-urlencode "branch=${{ github.ref }}" \
- --data-urlencode "version=$version" \
- --data-urlencode "date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
- --data-urlencode "link=$DOWNLOAD_URL" \
- --data-urlencode "release=false" \
- "https://service.fpsmaster.top/api/github/push"
diff --git a/docs/tasks.md b/docs/tasks.md
index f3e8df00..46b9f5c8 100644
--- a/docs/tasks.md
+++ b/docs/tasks.md
@@ -14,7 +14,7 @@ FPSMaster v4将会在此列表任务大部分完成后发布
- [x] 迁移优化代码
- [x] HitMarker
- [ ] 优化代码结构
-- [ ] 重构MusicPlayer界面
+- [x] 重构MusicPlayer界面
- [ ] 支持播放无损/VIP音乐
- [ ] 添加界面自动对齐
- [ ] 添加翻译功能
@@ -22,14 +22,14 @@ FPSMaster v4将会在此列表任务大部分完成后发布
- [ ] 攻击音效
- [ ] 组件更加自定义化(按键显示等)
- [ ] 修改notification,添加更多样式和自定义
-- [ ] RawInput兼容和优化
+- [x] RawInput兼容和优化
- [ ] FPS Hurt Cam
- [ ] World Color
- [ ] 跨版本框架
- [ ] 自定义客户端字体
- [ ] 自定义动画速率、曲线等
- [ ] 全局搜索
-- [ ] 新的OOBE
+- [x] 新的OOBE
- [ ] 功能完整的饰品界面
- [ ] AutoText
- [ ] 饱和度显示
diff --git a/shared/java/top/fpsmaster/Constants.java b/shared/java/top/fpsmaster/Constants.java
new file mode 100644
index 00000000..d59e6c55
--- /dev/null
+++ b/shared/java/top/fpsmaster/Constants.java
@@ -0,0 +1,9 @@
+package top.fpsmaster;
+
+public final class Constants {
+ public static final String EDITION = "1.8.9";
+ public static final String VERSION = "v1.8.9";
+
+ private Constants() {
+ }
+}
diff --git a/shared/java/top/fpsmaster/FPSMaster.java b/shared/java/top/fpsmaster/FPSMaster.java
index ee35cb82..1eaf1e0b 100644
--- a/shared/java/top/fpsmaster/FPSMaster.java
+++ b/shared/java/top/fpsmaster/FPSMaster.java
@@ -7,8 +7,6 @@
import top.fpsmaster.features.impl.interfaces.ClientSettings;
import top.fpsmaster.features.manager.ModuleManager;
import top.fpsmaster.font.FontManager;
-import top.fpsmaster.modules.account.AccountManager;
-import top.fpsmaster.modules.client.ClientUsersManager;
import top.fpsmaster.modules.client.thread.ClientThreadPool;
import top.fpsmaster.modules.config.ConfigManager;
import top.fpsmaster.modules.i18n.Language;
@@ -16,27 +14,17 @@
import top.fpsmaster.modules.lua.LuaManager;
import top.fpsmaster.modules.music.MusicPlayer;
import top.fpsmaster.modules.music.netease.NeteaseApi;
-import top.fpsmaster.ui.click.music.MusicPanel;
-import top.fpsmaster.ui.click.music.NewMusicPanel;
import top.fpsmaster.ui.custom.ComponentsManager;
-import top.fpsmaster.ui.screens.oobe.OOBEScreen;
import top.fpsmaster.utils.GitInfo;
import top.fpsmaster.utils.os.FileUtils;
-import top.fpsmaster.utils.os.HttpRequest;
-import top.fpsmaster.utils.thirdparty.github.UpdateChecker;
-import top.fpsmaster.websocket.client.WsClient;
-import top.fpsmaster.wrapper.Constants;
import java.io.File;
public class FPSMaster {
public boolean hasOptifine;
- public boolean loggedIn;
- public WsClient wsClient;
public static final String phase = "pre-release";
- public static final String SERVICE_API = "https://service.fpsmaster.top";
public static final String EDITION = Constants.EDITION;
public static final String COPYRIGHT = "Copyright ©2020-2025 FPSMaster Team All Rights Reserved.";
@@ -49,9 +37,6 @@ public class FPSMaster {
public static ModuleManager moduleManager = new ModuleManager();
public static FontManager fontManager = new FontManager();
public static ConfigManager configManager = new ConfigManager();
- public static OOBEScreen oobeScreen = new OOBEScreen();
- public static AccountManager accountManager = new AccountManager();
- public static ClientUsersManager clientUsersManager = new ClientUsersManager();
public static GlobalListener submitter = new GlobalListener();
public static CommandManager commandManager = new CommandManager();
public static ComponentsManager componentsManager = new ComponentsManager();
@@ -81,8 +66,7 @@ private void initializeFonts() {
// add more fonts and add fallback font
File file = new File(FileUtils.fonts, "harmony_bold.ttf");
if (!file.exists()) {
- ClientLogger.info("Downloading Fonts...");
- HttpRequest.downloadFile("https://13430.kstore.space/harmony_bold.ttf", file.getAbsolutePath());
+ ClientLogger.warn("Missing font file: " + file.getAbsolutePath());
}
fontManager.load();
@@ -102,9 +86,6 @@ private void initializeConfigures() throws Exception {
configManager.loadConfig("default");
MusicPlayer.setVolume(Float.parseFloat(configManager.configure.getOrCreate("volume", "1")));
NeteaseApi.cookies = FileUtils.readTempValue("cookies");
- MusicPanel.nickname = FileUtils.readTempValue("nickname");
- NewMusicPanel.nickname = FileUtils.readTempValue("nickname");
- accountManager.autoLogin();
}
private void initializeMusic() {
@@ -157,25 +138,9 @@ private void checkOptifine() {
}
private void checkUpdate() {
- if (development) {
- isLatest = true;
- return;
- }
- async.runnable(() -> {
- String s = UpdateChecker.getLatestVersion();
- if (s == null || s.isEmpty()) {
- s = UpdateChecker.getLatestVersion();
- if (s == null || s.isEmpty()) {
- isLatest = false;
- updateFailed = true;
- ClientLogger.error("获取最新版本信息失败");
- return;
- }
- }
- s = s.trim();
- latest = s;
- isLatest = GitInfo.getCommitId().equals(s);
- });
+ isLatest = true;
+ updateFailed = false;
+ latest = GitInfo.getCommitId();
}
public void initialize() {
@@ -200,11 +165,8 @@ public void shutdown() {
try {
ClientLogger.info("Saving configs");
configManager.saveConfig("default");
- if (wsClient != null && wsClient.isOpen()) {
- wsClient.close(200, "Shutdown");
- }
} catch (FileException e) {
throw new RuntimeException(e);
}
}
-}
\ No newline at end of file
+}
diff --git a/shared/java/top/fpsmaster/api/APIProvider.java b/shared/java/top/fpsmaster/api/APIProvider.java
deleted file mode 100644
index 7b45e014..00000000
--- a/shared/java/top/fpsmaster/api/APIProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package top.fpsmaster.api;
-
-import top.fpsmaster.api.domain.client.IClientAPI;
-import top.fpsmaster.api.domain.entity.IEntityAPI;
-import top.fpsmaster.api.domain.world.IWorldAPI;
-import top.fpsmaster.api.domain.render.IRenderAPI;
-import top.fpsmaster.api.domain.network.INetworkAPI;
-import top.fpsmaster.api.domain.gui.IGuiAPI;
-import top.fpsmaster.api.domain.sound.ISoundAPI;
-
-/**
- * API Provider 接口
- * 由各个版本的实现模块提供具体实现
- *
- * 实现类应该位于版本特定的包中:
- * - v1.8.9: top.fpsmaster.impl.APIProviderImpl
- * - v1.12.2: top.fpsmaster.impl.APIProviderImpl
- */
-public interface APIProvider {
-
- /**
- * 获取客户端 API 实现
- */
- IClientAPI getClientAPI();
-
- /**
- * 获取世界 API 实现
- */
- IWorldAPI getWorldAPI();
-
- /**
- * 获取渲染 API 实现
- */
- IRenderAPI getRenderAPI();
-
- /**
- * 获取网络 API 实现
- */
- INetworkAPI getNetworkAPI();
-
- /**
- * 获取 GUI API 实现
- */
- IGuiAPI getGuiAPI();
-
- /**
- * 获取音效 API 实现
- */
- ISoundAPI getSoundAPI();
-
- /**
- * 获取实体 API 实现
- */
- IEntityAPI getEntityAPI();
-}
diff --git a/shared/java/top/fpsmaster/api/MinecraftAPI.java b/shared/java/top/fpsmaster/api/MinecraftAPI.java
deleted file mode 100644
index 81c27c30..00000000
--- a/shared/java/top/fpsmaster/api/MinecraftAPI.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package top.fpsmaster.api;
-
-import top.fpsmaster.api.domain.client.IClientAPI;
-import top.fpsmaster.api.domain.entity.IEntityAPI;
-import top.fpsmaster.api.domain.world.IWorldAPI;
-import top.fpsmaster.api.domain.render.IRenderAPI;
-import top.fpsmaster.api.domain.network.INetworkAPI;
-import top.fpsmaster.api.domain.gui.IGuiAPI;
-import top.fpsmaster.api.domain.sound.ISoundAPI;
-
-/**
- * FPSMaster 跨版本 API 统一访问入口
- * 所有业务代码应该通过此类访问 Minecraft 相关功能
- *
- * 使用示例:
- *
- * IClientPlayer player = MinecraftAPI.client().getPlayer();
- * IWorld world = MinecraftAPI.world().getWorld();
- *
- */
-public final class MinecraftAPI {
-
- private static volatile APIProvider provider;
-
- /**
- * 私有构造函数,防止实例化
- */
- private MinecraftAPI() {
- throw new UnsupportedOperationException("Utility class");
- }
-
- /**
- * 初始化 API Provider (由各版本的入口调用)
- *
- * @param apiProvider API 提供者实现
- * @throws IllegalStateException 如果已经初始化
- */
- public static void initialize(APIProvider apiProvider) {
- if (provider != null) {
- throw new IllegalStateException("MinecraftAPI already initialized");
- }
- if (apiProvider == null) {
- throw new IllegalArgumentException("APIProvider cannot be null");
- }
- provider = apiProvider;
- }
-
- /**
- * 检查 API 是否已初始化
- */
- public static boolean isInitialized() {
- return provider != null;
- }
-
- /**
- * 获取 Provider(内部使用)
- */
- private static APIProvider getProvider() {
- if (provider == null) {
- throw new IllegalStateException("MinecraftAPI not initialized. Call MinecraftAPI.initialize() first.");
- }
- return provider;
- }
-
- /**
- * 客户端相关 API
- * 包括: Minecraft实例、玩家、设置、会话等
- *
- * @return 客户端 API 实例
- */
- public static IClientAPI client() {
- return getProvider().getClientAPI();
- }
-
- /**
- * 世界相关 API
- * 包括: 方块、实体、时间、天气等
- *
- * @return 世界 API 实例
- */
- public static IWorldAPI world() {
- return getProvider().getWorldAPI();
- }
-
- /**
- * 渲染相关 API
- * 包括: RenderManager、粒子效果、字体渲染等
- *
- * @return 渲染 API 实例
- */
- public static IRenderAPI render() {
- return getProvider().getRenderAPI();
- }
-
- /**
- * 网络包相关 API
- * 包括: 数据包解析、发送等
- *
- * @return 网络 API 实例
- */
- public static INetworkAPI network() {
- return getProvider().getNetworkAPI();
- }
-
- /**
- * GUI 相关 API
- * 包括: 主菜单、聊天、游戏内GUI等
- *
- * @return GUI API 实例
- */
- public static IGuiAPI gui() {
- return getProvider().getGuiAPI();
- }
-
- /**
- * 音效相关 API
- * 包括: 声音播放、音效管理等
- *
- * @return 音效 API 实例
- */
- public static ISoundAPI sound() {
- return getProvider().getSoundAPI();
- }
-
- /**
- * 实体相关 API
- * 包括: 实体查找、实体信息等
- *
- * @return 实体 API 实例
- */
- public static IEntityAPI entity() {
- return getProvider().getEntityAPI();
- }
-}
diff --git a/shared/java/top/fpsmaster/api/ProviderManager.java b/shared/java/top/fpsmaster/api/ProviderManager.java
deleted file mode 100644
index caa26acf..00000000
--- a/shared/java/top/fpsmaster/api/ProviderManager.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package top.fpsmaster.api;
-
-import top.fpsmaster.api.provider.client.IConstantsProvider;
-import top.fpsmaster.api.provider.game.*;
-import top.fpsmaster.api.provider.gui.IGuiIngameProvider;
-import top.fpsmaster.api.provider.gui.IGuiMainMenuProvider;
-import top.fpsmaster.api.provider.gui.IGuiNewChatProvider;
-import top.fpsmaster.api.provider.packets.IAddPlayerData;
-import top.fpsmaster.api.provider.packets.IPacketChat;
-import top.fpsmaster.api.provider.packets.IPacketPlayerList;
-import top.fpsmaster.api.provider.packets.IPacketTimeUpdate;
-import top.fpsmaster.api.provider.render.IEffectRendererProvider;
-import top.fpsmaster.api.provider.render.IRenderManagerProvider;
-import top.fpsmaster.api.provider.sound.ISoundProvider;
-import top.fpsmaster.api.wrapper.packets.PlayerListItemAddWrap;
-import top.fpsmaster.wrapper.*;
-import top.fpsmaster.wrapper.packets.SPacketChatProvider;
-import top.fpsmaster.wrapper.packets.SPacketPlayerListProvider;
-import top.fpsmaster.wrapper.packets.SPacketTimeUpdateProvider;
-import top.fpsmaster.wrapper.packets.WrapperAddPlayerData;
-import top.fpsmaster.wrapper.sound.SoundProvider;
-
-import java.util.List;
-
-public class ProviderManager {
- public static final IConstantsProvider constants = new IConstantsProvider() {
- private final Constants impl = new Constants();
- public String getVersion() { return impl.getVersion(); }
- public String getEdition() { return impl.getEdition(); }
- };
-
- public static final IUtilityProvider utilityProvider = new IUtilityProvider() {
- private final UtilityProvider impl = new UtilityProvider();
- public String getResourcePath(net.minecraft.util.ResourceLocation rl) { return impl.getResourcePath(rl); }
- public double getDistanceToEntity(net.minecraft.entity.Entity e1, net.minecraft.entity.Entity e2) { return impl.getDistanceToEntity(e1, e2); }
- public boolean isItemEnhancementEmpty(net.minecraft.item.ItemStack i) { return impl.isItemEnhancementEmpty(i); }
- public int getPotionIconIndex(net.minecraft.potion.PotionEffect effect) { return impl.getPotionIconIndex(effect); }
- public Object makeChatComponent(String msg) { return impl.makeChatComponent(msg); }
- };
-
- public static final ILegacyMinecraftProvider mcProvider = new ILegacyMinecraftProvider() {
- private final MinecraftProvider impl = new MinecraftProvider();
- public Object getCurrentScreen() { return impl.getCurrentScreen(); }
- public java.io.File getGameDir() { return impl.getGameDir(); }
- public net.minecraft.client.gui.FontRenderer getFontRenderer() { return impl.getFontRenderer(); }
- public net.minecraft.client.entity.EntityPlayerSP getPlayer() { return impl.getPlayer(); }
- public boolean isHoveringOverBlock() { return impl.isHoveringOverBlock(); }
- public net.minecraft.item.ItemStack getPlayerHeldItem() { return impl.getPlayerHeldItem(); }
- public net.minecraft.client.multiplayer.WorldClient getWorld() { return impl.getWorld(); }
- public net.minecraft.item.ItemStack[] getArmorInventory() { return impl.getArmorInventory(); }
- public void setSession(net.minecraft.util.Session mojang) { impl.setSession(mojang); }
- public Integer getRespondTime() { return impl.getRespondTime(); }
- public void drawString(String text, float x, float y, int color) { impl.drawString(text, x, y, color); }
- public String getServerAddress() { return impl.getServerAddress(); }
- public void removeClickDelay() { impl.removeClickDelay(); }
- public void printChatMessage(Object message) { impl.printChatMessage(message); }
- public java.util.Collection getPlayerInfoMap() { return impl.getPlayerInfoMap(); }
- };
-
- public static final IGuiMainMenuProvider mainmenuProvider = new IGuiMainMenuProvider() {
- private final GuiMainMenuProvider impl = new GuiMainMenuProvider();
- public void initGui() { impl.initGui(); }
- public void renderSkybox(int mouseX, int mouseY, float partialTicks, int width, int height, float zLevel) { impl.renderSkybox(mouseX, mouseY, partialTicks, width, height, zLevel); }
- public void showSinglePlayer(net.minecraft.client.gui.GuiScreen screen) { impl.showSinglePlayer(screen); }
- };
-
-
- public static final IWorldClientProvider worldClientProvider = new IWorldClientProvider() {
- private final WorldClientProvider impl = new WorldClientProvider();
- public net.minecraft.block.state.IBlockState getBlockState(top.fpsmaster.wrapper.blockpos.WrapperBlockPos pos) { return impl.getBlockState(pos); }
- public net.minecraft.block.Block getBlock(top.fpsmaster.wrapper.blockpos.WrapperBlockPos pos) { return impl.getBlock(pos); }
- public top.fpsmaster.wrapper.util.WrapperAxisAlignedBB getBlockBoundingBox(top.fpsmaster.wrapper.blockpos.WrapperBlockPos pos, net.minecraft.block.state.IBlockState state) { return impl.getBlockBoundingBox(pos, state); }
- public void addWeatherEffect(net.minecraft.entity.effect.EntityLightningBolt entityLightningBolt) { impl.addWeatherEffect(entityLightningBolt); }
- public net.minecraft.client.multiplayer.WorldClient getWorld() { return impl.getWorld(); }
- public void setWorldTime(long l) { impl.setWorldTime(l); }
- };
-
- public static final ITimerProvider timerProvider = new ITimerProvider() {
- private final TimerProvider impl = new TimerProvider();
- public float getRenderPartialTicks() { return impl.getRenderPartialTicks(); }
- };
-
- public static final IRenderManagerProvider renderManagerProvider = new IRenderManagerProvider() {
- private final RenderManagerProvider impl = new RenderManagerProvider();
- public double renderPosX() { return impl.renderPosX(); }
- public double renderPosY() { return impl.renderPosY(); }
- public double renderPosZ() { return impl.renderPosZ(); }
- };
-
- public static final IGameSettings gameSettings = new IGameSettings() {
- private final GameSettingsProvider impl = new GameSettingsProvider();
- public void setKeyPress(net.minecraft.client.settings.KeyBinding key, boolean value) { impl.setKeyPress(key, value); }
- };
-
- // Packets
- public static final IPacketChat packetChat = new IPacketChat() {
- private final SPacketChatProvider impl = new SPacketChatProvider();
- public String getUnformattedText(Object packet) { return impl.getUnformattedText(packet); }
- public net.minecraft.util.IChatComponent getChatComponent(Object packet) { return impl.getChatComponent(packet); }
- public int getType(Object p) { return impl.getType(p); }
- public void appendTranslation(Object p) { impl.appendTranslation(p); }
- public boolean isPacket(Object packet) { return impl.isPacket(packet); }
- };
-
- public static final IPacketPlayerList packetPlayerList = new IPacketPlayerList() {
- private final SPacketPlayerListProvider impl = new SPacketPlayerListProvider();
- public boolean isPacket(Object packet) { return impl.isPacket(packet); }
- public boolean isActionJoin(Object p) { return impl.isActionJoin(p); }
- public boolean isActionLeave(Object p) { return impl.isActionLeave(p); }
- public List getEntries(Object p) {
- List entries = impl.getEntries(p);
- return entries;
- }
- };
-
- public static final IPacketTimeUpdate packetTimeUpdate = new IPacketTimeUpdate() {
- private final SPacketTimeUpdateProvider impl = new SPacketTimeUpdateProvider();
- public boolean isPacket(Object packet) { return impl.isPacket(packet); }
- };
-
- public static final IGuiIngameProvider guiIngameProvider = new IGuiIngameProvider() {
- private final GuiIngameProvider impl = new GuiIngameProvider();
- public void drawHealth(net.minecraft.entity.Entity entityIn) { impl.drawHealth(entityIn); }
- };
-
- public static final ISoundProvider soundProvider = new ISoundProvider() {
- private final SoundProvider impl = new SoundProvider();
- public void playLightning(double posX, double posY, double posZ, float i, float v, boolean b) { impl.playLightning(posX, posY, posZ, i, v, b); }
- public void playExplosion(double posX, double posY, double posZ, float i, float v, boolean b) { impl.playExplosion(posX, posY, posZ, i, v, b); }
- public void playRedStoneBreak(double posX, double posY, double posZ, float i, float v, boolean b) { impl.playRedStoneBreak(posX, posY, posZ, i, v, b); }
- };
-
- public static final IEffectRendererProvider effectManager = new IEffectRendererProvider() {
- private final EffectRendererProvider impl = new EffectRendererProvider();
- public void addRedStoneBreak(top.fpsmaster.wrapper.blockpos.WrapperBlockPos pos) { impl.addRedStoneBreak(pos); }
- };
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/Wrappers.java b/shared/java/top/fpsmaster/api/Wrappers.java
deleted file mode 100644
index 0d4f72f0..00000000
--- a/shared/java/top/fpsmaster/api/Wrappers.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package top.fpsmaster.api;
-
-import top.fpsmaster.api.wrapper.*;
-import top.fpsmaster.api.wrapper.packets.*;
-import top.fpsmaster.wrapper.*;
-import top.fpsmaster.wrapper.packets.*;
-import top.fpsmaster.wrapper.sound.SoundProvider;
-import top.fpsmaster.wrapper.SkinProvider;
-
-/**
- * @deprecated Use {@link MinecraftAPI} instead for better cross-version compatibility.
- * This class is kept for backward compatibility but may be removed in future versions.
- *
- * Migration guide:
- *
- * - {@code Wrappers.minecraft()} → {@code MinecraftAPI.client()}
- * - {@code Wrappers.world()} → {@code MinecraftAPI.world()}
- * - {@code Wrappers.timer()} → {@code MinecraftAPI.render().getPartialTicks()}
- * - {@code Wrappers.renderManager()} → {@code MinecraftAPI.render().getRenderManager()}
- * - {@code Wrappers.sound()} → {@code MinecraftAPI.sound()}
- * - {@code Wrappers.effects()} → {@code MinecraftAPI.render().getParticleManager()}
- *
- */
-@Deprecated
-public final class Wrappers {
- private Wrappers() {}
-
- public static MinecraftWrap minecraft() { return new MinecraftProvider(); }
- public static WorldWrap world() { return new WorldClientProvider(); }
- public static RenderManagerWrap renderManager() { return new RenderManagerProvider(); }
- public static TimerWrap timer() { return new TimerProvider(); }
- public static GameSettingsWrap gameSettings() { return new GameSettingsProvider(); }
- public static GuiIngameWrap guiIngame() { return new GuiIngameProvider(); }
- public static MainMenuWrap mainMenu() { return new GuiMainMenuProvider(); }
- public static SoundWrap sound() { return new SoundProvider(); }
- public static EffectRendererWrap effects() { return new EffectRendererProvider(); }
- public static SkinWrap skin() { return new SkinProvider(); }
-
- public static ChatPacketWrap chatPacket() { return new SPacketChatProvider(); }
- public static PlayerListItemWrap playerListPacket() { return new SPacketPlayerListProvider(); }
- public static TimeUpdatePacketWrap timeUpdatePacket() { return new SPacketTimeUpdateProvider(); }
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/domain/client/IClientAPI.java b/shared/java/top/fpsmaster/api/domain/client/IClientAPI.java
deleted file mode 100644
index b733f119..00000000
--- a/shared/java/top/fpsmaster/api/domain/client/IClientAPI.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package top.fpsmaster.api.domain.client;
-
-import org.jetbrains.annotations.Nullable;
-import top.fpsmaster.api.model.GameMode;
-
-import java.io.File;
-
-/**
- * 客户端 API
- * 提供客户端相关的所有功能
- */
-public interface IClientAPI {
-
- /**
- * 获取 Minecraft 实例接口
- *
- * @return Minecraft 实例
- */
- IMinecraft getMinecraft();
-
- /**
- * 获取当前客户端玩家
- *
- * @return 玩家实例,可能为 null(未加入世界时)
- */
- @Nullable
- IClientPlayer getPlayer();
-
- /**
- * 获取游戏设置
- *
- * @return 游戏设置实例
- */
- IGameSettings getSettings();
-
- /**
- * 移除点击延迟(用于 NoHitDelay 等优化功能)
- * 将 Minecraft 的点击计数器重置为 0
- */
- void removeClickDelay();
-
- /**
- * 获取游戏目录
- *
- * @return 游戏根目录
- */
- File getGameDirectory();
-
- /**
- * 获取当前打开的屏幕
- *
- * @return GUI屏幕对象,可能为 null(没有打开任何界面时)
- */
- @Nullable
- Object getCurrentScreen();
-
- /**
- * 获取服务器地址
- *
- * @return 服务器地址,单人游戏返回 "localhost"
- */
- String getServerAddress();
-
- /**
- * 是否单人游戏
- *
- * @return true 如果是单人游戏
- */
- boolean isSingleplayer();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/client/IClientPlayer.java b/shared/java/top/fpsmaster/api/domain/client/IClientPlayer.java
deleted file mode 100644
index 95412e2a..00000000
--- a/shared/java/top/fpsmaster/api/domain/client/IClientPlayer.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package top.fpsmaster.api.domain.client;
-
-import org.jetbrains.annotations.Nullable;
-import top.fpsmaster.api.model.Vec3;
-
-import java.util.List;
-import java.util.UUID;
-
-/**
- * 客户端玩家接口
- * 注意:不直接返回 Minecraft 的 EntityPlayerSP 等类型
- */
-public interface IClientPlayer {
-
- /**
- * 获取玩家名称
- *
- * @return 玩家名称
- */
- String getName();
-
- /**
- * 获取玩家 UUID
- *
- * @return 玩家唯一 ID
- */
- UUID getUniqueId();
-
- /**
- * 获取玩家 UUID 字符串
- *
- * @return UUID 字符串
- */
- String getUUID();
-
- /**
- * 获取玩家位置
- *
- * @return 位置向量
- */
- Vec3 getPosition();
-
- /**
- * 获取玩家视角方向(Yaw)
- *
- * @return Yaw 角度
- */
- float getYaw();
-
- /**
- * 获取玩家视角俯仰角(Pitch)
- *
- * @return Pitch 角度
- */
- float getPitch();
-
- /**
- * 获取玩家生命值
- *
- * @return 当前生命值
- */
- float getHealth();
-
- /**
- * 获取玩家最大生命值
- *
- * @return 最大生命值
- */
- float getMaxHealth();
-
- /**
- * 获取玩家饥饿值
- *
- * @return 饥饿值 (0-20)
- */
- int getFoodLevel();
-
- /**
- * 是否在地面上
- *
- * @return true 如果在地面上
- */
- boolean isOnGround();
-
- /**
- * 是否在潜行
- *
- * @return true 如果在潜行
- */
- boolean isSneaking();
-
- /**
- * 是否在疾跑
- *
- * @return true 如果在疾跑
- */
- boolean isSprinting();
-
- /**
- * 获取手持物品(使用简化的物品数据)
- *
- * @return 物品数据,可能为 null
- */
- @Nullable
- IItemStack getHeldItem();
-
- /**
- * 获取护甲栏物品列表
- * 索引 0-3 分别对应:靴子、护腿、胸甲、头盔
- *
- * @return 护甲物品列表(固定4个元素,可能包含null)
- */
- List getArmorItems();
-
- /**
- * 获取网络延迟(ms)
- *
- * @return 延迟毫秒数
- */
- int getPing();
-
- /**
- * 发送聊天消息
- *
- * @param message 消息内容
- */
- void sendChatMessage(String message);
-
- /**
- * 获取玩家的移动速度
- *
- * @return 速度向量
- */
- Vec3 getMotion();
-
- /**
- * 获取下落距离(用于摔落伤害计算)
- *
- * @return 下落距离
- */
- float getFallDistance();
-
- /**
- * 获取实体 ID
- *
- * @return 实体 ID
- */
- int getEntityId();
-
- /**
- * 获取原始 Minecraft 玩家实体(用于需要底层访问的功能)
- * 注意:这是版本相关的原生类型,仅在必要时使用(如战斗机制)
- * 返回类型为 EntityPlayerSP 在 1.8.9/1.12.2
- *
- * @return Minecraft 原生玩家实体
- */
- Object getRawPlayer();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/client/IGameSettings.java b/shared/java/top/fpsmaster/api/domain/client/IGameSettings.java
deleted file mode 100644
index 9dcc470a..00000000
--- a/shared/java/top/fpsmaster/api/domain/client/IGameSettings.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package top.fpsmaster.api.domain.client;
-
-/**
- * 游戏设置接口
- * 注意:不直接暴露 KeyBinding 等 Minecraft 内部类
- */
-public interface IGameSettings {
-
- /**
- * 设置按键按下状态(通过按键名称)
- *
- * @param keyName 按键名称,如 "key.forward", "key.attack" 等
- * @param pressed 是否按下
- */
- void setKeyPressed(String keyName, boolean pressed);
-
- /**
- * 获取视距(区块数)
- *
- * @return 渲染距离(区块数)
- */
- int getRenderDistance();
-
- /**
- * 设置视距
- *
- * @param chunks 区块数
- */
- void setRenderDistance(int chunks);
-
- /**
- * 获取鼠标灵敏度 (0.0 - 1.0)
- *
- * @return 灵敏度值
- */
- float getMouseSensitivity();
-
- /**
- * 设置鼠标灵敏度
- *
- * @param sensitivity 灵敏度值 (0.0 - 1.0)
- */
- void setMouseSensitivity(float sensitivity);
-
- /**
- * 是否显示调试信息(F3)
- *
- * @return true 如果显示调试信息
- */
- boolean isShowDebugInfo();
-
- /**
- * 获取 GUI 缩放级别
- *
- * @return GUI 缩放级别
- */
- int getGuiScale();
-
- /**
- * 获取 FOV 设置值
- *
- * @return FOV 值
- */
- float getFov();
-
- /**
- * 是否启用 VSync
- *
- * @return true 如果启用垂直同步
- */
- boolean isVsyncEnabled();
-
- /**
- * 获取帧率限制
- *
- * @return 帧率限制值
- */
- int getFramerateLimit();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/client/IItemStack.java b/shared/java/top/fpsmaster/api/domain/client/IItemStack.java
deleted file mode 100644
index 73074c47..00000000
--- a/shared/java/top/fpsmaster/api/domain/client/IItemStack.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package top.fpsmaster.api.domain.client;
-
-import org.jetbrains.annotations.Nullable;
-
-import java.util.Map;
-
-/**
- * 物品堆接口
- * 使用简化数据结构,不直接暴露 ItemStack
- */
-public interface IItemStack {
-
- /**
- * 获取物品 ID
- *
- * @return 资源位置,如 "minecraft:diamond_sword"
- */
- String getItemId();
-
- /**
- * 获取物品显示名称
- *
- * @return 显示名称
- */
- String getDisplayName();
-
- /**
- * 获取数量
- *
- * @return 物品数量
- */
- int getCount();
-
- /**
- * 获取耐久度(当前/最大)
- *
- * @return 数组 [current, max],如果不可损坏则返回 null
- */
- @Nullable
- int[] getDurability();
-
- /**
- * 是否有附魔
- *
- * @return true 如果物品有附魔
- */
- boolean isEnchanted();
-
- /**
- * 获取附魔列表
- *
- * @return Map<附魔ID, 等级>,如 {"minecraft:sharpness": 5}
- */
- Map getEnchantments();
-
- /**
- * 获取物品标签数据(简化的 NBT)
- *
- * @return 键值对,只包含基础类型
- */
- Map getNbtData();
-
- /**
- * 是否为空
- *
- * @return true 如果物品为空或数量为0
- */
- boolean isEmpty();
-
- /**
- * 是否可堆叠
- *
- * @return true 如果可堆叠
- */
- boolean isStackable();
-
- /**
- * 获取最大堆叠数量
- *
- * @return 最大堆叠数
- */
- int getMaxStackSize();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/client/IMinecraft.java b/shared/java/top/fpsmaster/api/domain/client/IMinecraft.java
deleted file mode 100644
index 385dc1fb..00000000
--- a/shared/java/top/fpsmaster/api/domain/client/IMinecraft.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package top.fpsmaster.api.domain.client;
-
-/**
- * Minecraft 实例接口
- * 提供 Minecraft 客户端的核心功能
- */
-public interface IMinecraft {
-
- /**
- * 是否单人游戏
- *
- * @return true 如果是单人游戏
- */
- boolean isSingleplayer();
-
- /**
- * 获取帧率限制
- *
- * @return 帧率限制值
- */
- int getFramerateLimit();
-
- /**
- * 获取渲染部分刻
- *
- * @return 部分刻值 (0.0 - 1.0)
- */
- float getPartialTicks();
-
- /**
- * 移除左键点击延迟
- */
- void removeLeftClickDelay();
-
- /**
- * 打印聊天消息(使用文本字符串)
- *
- * @param message 消息文本
- */
- void printChatMessage(String message);
-
- /**
- * 获取字体渲染器(渲染文字用)
- * 注意:返回 Minecraft 原生类型,用于渲染功能
- *
- * @return FontRenderer 实例
- */
- Object getFontRenderer();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/entity/IEntity.java b/shared/java/top/fpsmaster/api/domain/entity/IEntity.java
deleted file mode 100644
index 7d49b7a5..00000000
--- a/shared/java/top/fpsmaster/api/domain/entity/IEntity.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package top.fpsmaster.api.domain.entity;
-
-import top.fpsmaster.api.model.Vec3;
-
-import java.util.List;
-
-/**
- * 实体接口
- * 代表游戏中的任意实体(玩家、生物、物品等)
- */
-public interface IEntity {
-
- /**
- * 获取实体唯一ID
- *
- * @return 实体ID
- */
- int getEntityId();
-
- /**
- * 获取实体UUID
- *
- * @return UUID字符串
- */
- String getUUID();
-
- /**
- * 获取实体位置
- *
- * @return 位置向量
- */
- Vec3 getPosition();
-
- /**
- * 获取实体名称
- *
- * @return 实体名称
- */
- String getName();
-
- /**
- * 获取自定义名称
- *
- * @return 自定义名称,如果没有则返回 null
- */
- String getCustomName();
-
- /**
- * 是否有自定义名称
- *
- * @return true 如果有自定义名称
- */
- boolean hasCustomName();
-
- /**
- * 获取实体视角方向(yaw)
- *
- * @return yaw角度
- */
- float getYaw();
-
- /**
- * 获取实体俯仰角(pitch)
- *
- * @return pitch角度
- */
- float getPitch();
-
- /**
- * 获取实体速度
- *
- * @return 速度向量
- */
- Vec3 getMotion();
-
- /**
- * 实体是否在地面上
- *
- * @return true 如果在地面
- */
- boolean isOnGround();
-
- /**
- * 实体是否在水中
- *
- * @return true 如果在水中
- */
- boolean isInWater();
-
- /**
- * 实体是否在岩浆中
- *
- * @return true 如果在岩浆中
- */
- boolean isInLava();
-
- /**
- * 实体是否燃烧
- *
- * @return true 如果燃烧
- */
- boolean isBurning();
-
- /**
- * 实体是否潜行
- *
- * @return true 如果潜行
- */
- boolean isSneaking();
-
- /**
- * 实体是否疾跑
- *
- * @return true 如果疾跑
- */
- boolean isSprinting();
-
- /**
- * 实体是否隐身
- *
- * @return true 如果隐身
- */
- boolean isInvisible();
-
- /**
- * 获取实体到另一个位置的距离
- *
- * @param pos 目标位置
- * @return 距离
- */
- double getDistanceTo(Vec3 pos);
-
- /**
- * 获取实体的眼睛高度
- *
- * @return 眼睛高度
- */
- float getEyeHeight();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/entity/IEntityAPI.java b/shared/java/top/fpsmaster/api/domain/entity/IEntityAPI.java
deleted file mode 100644
index 4dfa0f35..00000000
--- a/shared/java/top/fpsmaster/api/domain/entity/IEntityAPI.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package top.fpsmaster.api.domain.entity;
-
-import top.fpsmaster.api.model.Vec3;
-
-import java.util.List;
-
-/**
- * 实体 API
- * 提供实体相关的所有功能
- */
-public interface IEntityAPI {
-
- /**
- * 获取所有加载的实体
- *
- * @return 实体列表
- */
- List getAllEntities();
-
- /**
- * 根据ID获取实体
- *
- * @param entityId 实体ID
- * @return 实体对象,未找到则返回 null
- */
- IEntity getEntityById(int entityId);
-
- /**
- * 获取玩家附近的实体
- *
- * @param radius 半径
- * @return 实体列表
- */
- List getNearbyEntities(double radius);
-
- /**
- * 获取指定位置附近的实体
- *
- * @param pos 中心位置
- * @param radius 半径
- * @return 实体列表
- */
- List getNearbyEntities(Vec3 pos, double radius);
-}
diff --git a/shared/java/top/fpsmaster/api/domain/gui/IGuiAPI.java b/shared/java/top/fpsmaster/api/domain/gui/IGuiAPI.java
deleted file mode 100644
index 548c8e5b..00000000
--- a/shared/java/top/fpsmaster/api/domain/gui/IGuiAPI.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package top.fpsmaster.api.domain.gui;
-
-/**
- * GUI API
- * 提供 GUI 相关的所有功能
- */
-public interface IGuiAPI {
-
- /**
- * 获取游戏内 GUI 管理器
- *
- * @return GUI Ingame 实例
- */
- IGuiIngame getGuiIngame();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/gui/IGuiIngame.java b/shared/java/top/fpsmaster/api/domain/gui/IGuiIngame.java
deleted file mode 100644
index 950a61e7..00000000
--- a/shared/java/top/fpsmaster/api/domain/gui/IGuiIngame.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package top.fpsmaster.api.domain.gui;
-
-/**
- * 游戏内 GUI 接口
- */
-public interface IGuiIngame {
-
- /**
- * 打印聊天消息
- *
- * @param message 消息文本
- */
- void printChatMessage(String message);
-}
diff --git a/shared/java/top/fpsmaster/api/domain/network/IChatPacketHandler.java b/shared/java/top/fpsmaster/api/domain/network/IChatPacketHandler.java
deleted file mode 100644
index 0c7e3a11..00000000
--- a/shared/java/top/fpsmaster/api/domain/network/IChatPacketHandler.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package top.fpsmaster.api.domain.network;
-
-import org.jetbrains.annotations.NotNull;
-
-/**
- * 聊天包处理器
- */
-public interface IChatPacketHandler {
-
- /**
- * 判断是否为聊天包
- *
- * @param packet 数据包对象
- * @return true 如果是聊天包
- */
- boolean isChatPacket(@NotNull Object packet);
-
- /**
- * 从包中获取未格式化的文本
- *
- * @param packet 数据包对象
- * @return 未格式化的文本
- */
- @NotNull
- String getUnformattedText(@NotNull Object packet);
-
- /**
- * 获取聊天类型
- *
- * @param packet 数据包对象
- * @return 聊天类型(0=聊天,1=系统消息,2=游戏信息)
- */
- int getChatType(@NotNull Object packet);
-}
diff --git a/shared/java/top/fpsmaster/api/domain/network/INetworkAPI.java b/shared/java/top/fpsmaster/api/domain/network/INetworkAPI.java
deleted file mode 100644
index d089c7ed..00000000
--- a/shared/java/top/fpsmaster/api/domain/network/INetworkAPI.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package top.fpsmaster.api.domain.network;
-
-/**
- * 网络 API
- * 提供网络包相关的所有功能
- */
-public interface INetworkAPI {
-
- /**
- * 获取聊天包解析器
- *
- * @return 聊天包处理器
- */
- IChatPacketHandler getChatPacketHandler();
-
- /**
- * 获取玩家列表包处理器
- *
- * @return 玩家列表包处理器
- */
- IPlayerListPacketHandler getPlayerListPacketHandler();
-
- /**
- * 获取时间更新包处理器
- *
- * @return 时间更新包处理器
- */
- ITimeUpdatePacketHandler getTimeUpdatePacketHandler();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/network/IPlayerListPacketHandler.java b/shared/java/top/fpsmaster/api/domain/network/IPlayerListPacketHandler.java
deleted file mode 100644
index 6435fd13..00000000
--- a/shared/java/top/fpsmaster/api/domain/network/IPlayerListPacketHandler.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package top.fpsmaster.api.domain.network;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.util.List;
-
-/**
- * 玩家列表包处理器
- */
-public interface IPlayerListPacketHandler {
-
- /**
- * 判断是否为玩家列表包
- *
- * @param packet 数据包对象
- * @return true 如果是玩家列表包
- */
- boolean isPlayerListPacket(@NotNull Object packet);
-
- /**
- * 判断是否为加入动作
- *
- * @param packet 数据包对象
- * @return true 如果是加入动作
- */
- boolean isActionAdd(@NotNull Object packet);
-
- /**
- * 判断是否为离开动作
- *
- * @param packet 数据包对象
- * @return true 如果是离开动作
- */
- boolean isActionRemove(@NotNull Object packet);
-
- /**
- * 获取玩家名称列表
- *
- * @param packet 数据包对象
- * @return 玩家名称列表
- */
- List getPlayerNames(@NotNull Object packet);
-}
diff --git a/shared/java/top/fpsmaster/api/domain/network/ITimeUpdatePacketHandler.java b/shared/java/top/fpsmaster/api/domain/network/ITimeUpdatePacketHandler.java
deleted file mode 100644
index c71dd2fa..00000000
--- a/shared/java/top/fpsmaster/api/domain/network/ITimeUpdatePacketHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package top.fpsmaster.api.domain.network;
-
-import org.jetbrains.annotations.NotNull;
-
-/**
- * 时间更新包处理器
- */
-public interface ITimeUpdatePacketHandler {
-
- /**
- * 判断是否为时间更新包
- *
- * @param packet 数据包对象
- * @return true 如果是时间更新包
- */
- boolean isTimeUpdatePacket(@NotNull Object packet);
-
- /**
- * 获取世界时间
- *
- * @param packet 数据包对象
- * @return 世界时间
- */
- long getWorldTime(@NotNull Object packet);
-}
diff --git a/shared/java/top/fpsmaster/api/domain/render/IParticleManager.java b/shared/java/top/fpsmaster/api/domain/render/IParticleManager.java
deleted file mode 100644
index ffab4e5b..00000000
--- a/shared/java/top/fpsmaster/api/domain/render/IParticleManager.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package top.fpsmaster.api.domain.render;
-
-import top.fpsmaster.api.model.BlockPos;
-
-/**
- * 粒子管理器接口
- */
-public interface IParticleManager {
-
- /**
- * 添加红石破碎粒子效果
- *
- * @param pos 方块位置
- */
- void addRedstoneBreakParticle(BlockPos pos);
-
- /**
- * 添加方块破坏粒子
- *
- * @param pos 方块位置
- * @param blockId 方块ID
- */
- void addBlockBreakParticle(BlockPos pos, String blockId);
-}
diff --git a/shared/java/top/fpsmaster/api/domain/render/IRenderAPI.java b/shared/java/top/fpsmaster/api/domain/render/IRenderAPI.java
deleted file mode 100644
index 708321c9..00000000
--- a/shared/java/top/fpsmaster/api/domain/render/IRenderAPI.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package top.fpsmaster.api.domain.render;
-
-/**
- * 渲染 API
- * 提供渲染相关的所有功能
- */
-public interface IRenderAPI {
-
- /**
- * 获取渲染管理器
- *
- * @return 渲染管理器实例
- */
- IRenderManager getRenderManager();
-
- /**
- * 获取渲染部分刻
- *
- * @return 部分刻值 (0.0 - 1.0)
- */
- float getPartialTicks();
-
- /**
- * 获取粒子管理器
- *
- * @return 粒子管理器实例
- */
- IParticleManager getParticleManager();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/render/IRenderManager.java b/shared/java/top/fpsmaster/api/domain/render/IRenderManager.java
deleted file mode 100644
index 7f774a68..00000000
--- a/shared/java/top/fpsmaster/api/domain/render/IRenderManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package top.fpsmaster.api.domain.render;
-
-/**
- * 渲染管理器接口
- */
-public interface IRenderManager {
-
- /**
- * 获取渲染位置 X
- *
- * @return 渲染偏移 X 坐标
- */
- double getRenderPosX();
-
- /**
- * 获取渲染位置 Y
- *
- * @return 渲染偏移 Y 坐标
- */
- double getRenderPosY();
-
- /**
- * 获取渲染位置 Z
- *
- * @return 渲染偏移 Z 坐标
- */
- double getRenderPosZ();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/sound/ISoundAPI.java b/shared/java/top/fpsmaster/api/domain/sound/ISoundAPI.java
deleted file mode 100644
index 4e9172b6..00000000
--- a/shared/java/top/fpsmaster/api/domain/sound/ISoundAPI.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package top.fpsmaster.api.domain.sound;
-
-/**
- * 音效 API
- * 提供音效相关的所有功能
- */
-public interface ISoundAPI {
-
- /**
- * 播放雷电音效
- *
- * @param x 位置 X
- * @param y 位置 Y
- * @param z 位置 Z
- * @param volume 音量
- * @param pitch 音调
- */
- void playLightningSound(double x, double y, double z, float volume, float pitch);
-
- /**
- * 播放爆炸音效
- *
- * @param x 位置 X
- * @param y 位置 Y
- * @param z 位置 Z
- * @param volume 音量
- * @param pitch 音调
- */
- void playExplosionSound(double x, double y, double z, float volume, float pitch);
-
- /**
- * 播放红石破碎音效
- *
- * @param x 位置 X
- * @param y 位置 Y
- * @param z 位置 Z
- * @param volume 音量
- * @param pitch 音调
- */
- void playRedstoneBreakSound(double x, double y, double z, float volume, float pitch);
-}
diff --git a/shared/java/top/fpsmaster/api/domain/world/IWorld.java b/shared/java/top/fpsmaster/api/domain/world/IWorld.java
deleted file mode 100644
index cdcf74e0..00000000
--- a/shared/java/top/fpsmaster/api/domain/world/IWorld.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package top.fpsmaster.api.domain.world;
-
-import org.jetbrains.annotations.Nullable;
-import top.fpsmaster.api.model.BlockPos;
-import top.fpsmaster.api.model.WeatherType;
-
-/**
- * 世界接口
- * 注意:完全不依赖 Minecraft 原生类型
- */
-public interface IWorld {
-
- /**
- * 获取世界名称
- *
- * @return 世界名称
- */
- String getWorldName();
-
- /**
- * 获取世界时间(tick)
- *
- * @return 世界时间
- */
- long getWorldTime();
-
- /**
- * 设置世界时间
- *
- * @param time 新的世界时间
- */
- void setWorldTime(long time);
-
- /**
- * 获取方块 ID
- *
- * @param pos 方块位置
- * @return 方块的资源位置,如 "minecraft:stone"
- */
- String getBlockId(BlockPos pos);
-
- /**
- * 检查是否为空气方块
- *
- * @param pos 方块位置
- * @return true 如果是空气
- */
- boolean isAirBlock(BlockPos pos);
-
- /**
- * 获取世界出生点
- *
- * @return 出生点位置
- */
- BlockPos getSpawnPoint();
-
- /**
- * 获取天气状态
- *
- * @return 天气类型
- */
- WeatherType getWeatherType();
-
- /**
- * 获取雨强度
- *
- * @return 雨强度 (0.0 - 1.0)
- */
- float getRainStrength();
-
- /**
- * 获取方块光照等级
- *
- * @param pos 方块位置
- * @return 光照等级 (0-15)
- */
- int getLightLevel(BlockPos pos);
-
- /**
- * 获取天空光照等级
- *
- * @param pos 方块位置
- * @return 天空光照等级 (0-15)
- */
- int getSkyLightLevel(BlockPos pos);
-
- /**
- * 获取方块发出的光照等级
- *
- * @param pos 方块位置
- * @return 方块光照等级 (0-15)
- */
- int getBlockLightLevel(BlockPos pos);
-
- /**
- * 获取原始 Minecraft 世界对象(用于需要底层访问的功能)
- * 注意:这是版本相关的原生类型,仅在必要时使用
- * 返回类型为 WorldClient 在 1.8.9/1.12.2
- *
- * @return Minecraft 原生世界对象
- */
- Object getRawWorld();
-}
diff --git a/shared/java/top/fpsmaster/api/domain/world/IWorldAPI.java b/shared/java/top/fpsmaster/api/domain/world/IWorldAPI.java
deleted file mode 100644
index 046e370f..00000000
--- a/shared/java/top/fpsmaster/api/domain/world/IWorldAPI.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package top.fpsmaster.api.domain.world;
-
-import org.jetbrains.annotations.Nullable;
-
-/**
- * 世界 API
- * 提供世界相关的所有功能
- */
-public interface IWorldAPI {
-
- /**
- * 获取当前客户端世界
- *
- * @return 世界实例,可能为 null(未加入世界时)
- */
- @Nullable
- IWorld getWorld();
-}
diff --git a/shared/java/top/fpsmaster/api/interfaces/IWorld.java b/shared/java/top/fpsmaster/api/interfaces/IWorld.java
deleted file mode 100644
index 2c4e536f..00000000
--- a/shared/java/top/fpsmaster/api/interfaces/IWorld.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package top.fpsmaster.api.interfaces;
-
-public interface IWorld {
-}
diff --git a/shared/java/top/fpsmaster/api/interfaces/client/IClientPlayerEntity.java b/shared/java/top/fpsmaster/api/interfaces/client/IClientPlayerEntity.java
deleted file mode 100644
index 319f5e30..00000000
--- a/shared/java/top/fpsmaster/api/interfaces/client/IClientPlayerEntity.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package top.fpsmaster.api.interfaces.client;
-
-import top.fpsmaster.api.interfaces.entity.IPlayerEntity;
-
-public interface IClientPlayerEntity extends IPlayerEntity {
-}
diff --git a/shared/java/top/fpsmaster/api/interfaces/client/IMinecraft.java b/shared/java/top/fpsmaster/api/interfaces/client/IMinecraft.java
deleted file mode 100644
index c24d0e48..00000000
--- a/shared/java/top/fpsmaster/api/interfaces/client/IMinecraft.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package top.fpsmaster.api.interfaces.client;
-
-import org.jetbrains.annotations.Nullable;
-import top.fpsmaster.api.interfaces.client.settings.IGameSettings;
-import top.fpsmaster.api.interfaces.client.settings.IKeyBinding;
-
-public interface IMinecraft {
- @Nullable IClientPlayerEntity getClientPlayer();
-
- IKeyBinding getKeyBinding();
-
- IGameSettings getGameSettings();
-}
diff --git a/shared/java/top/fpsmaster/api/interfaces/client/settings/IGameSettings.java b/shared/java/top/fpsmaster/api/interfaces/client/settings/IGameSettings.java
deleted file mode 100644
index c8546e6a..00000000
--- a/shared/java/top/fpsmaster/api/interfaces/client/settings/IGameSettings.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package top.fpsmaster.api.interfaces.client.settings;
-
-public interface IGameSettings {
- IKeyBinding getKeyBindSprint();
-}
diff --git a/shared/java/top/fpsmaster/api/interfaces/client/settings/IKeyBinding.java b/shared/java/top/fpsmaster/api/interfaces/client/settings/IKeyBinding.java
deleted file mode 100644
index 5dceca81..00000000
--- a/shared/java/top/fpsmaster/api/interfaces/client/settings/IKeyBinding.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.interfaces.client.settings;
-
-public interface IKeyBinding {
- void setKeyBindState(int keyCode, boolean state);
-
- int getKeyCode();
-}
diff --git a/shared/java/top/fpsmaster/api/interfaces/entity/IPlayerEntity.java b/shared/java/top/fpsmaster/api/interfaces/entity/IPlayerEntity.java
deleted file mode 100644
index 95b143f9..00000000
--- a/shared/java/top/fpsmaster/api/interfaces/entity/IPlayerEntity.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package top.fpsmaster.api.interfaces.entity;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.util.UUID;
-
-public interface IPlayerEntity {
- @NotNull String getName();
-
- @NotNull UUID getUniqueId();
-
- boolean isSprinting();
-
- void setSprinting(boolean sprinting);
-}
diff --git a/shared/java/top/fpsmaster/api/model/AxisAlignedBB.java b/shared/java/top/fpsmaster/api/model/AxisAlignedBB.java
deleted file mode 100644
index 22668a42..00000000
--- a/shared/java/top/fpsmaster/api/model/AxisAlignedBB.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package top.fpsmaster.api.model;
-
-import java.util.Objects;
-
-/**
- * 轴对齐包围盒(值对象)
- * 不可变对象,线程安全
- *
- * 注意: 这是自定义的 AxisAlignedBB,不依赖 Minecraft 的 AxisAlignedBB
- */
-public final class AxisAlignedBB {
- public final double minX;
- public final double minY;
- public final double minZ;
- public final double maxX;
- public final double maxY;
- public final double maxZ;
-
- public AxisAlignedBB(double minX, double minY, double minZ,
- double maxX, double maxY, double maxZ) {
- this.minX = Math.min(minX, maxX);
- this.minY = Math.min(minY, maxY);
- this.minZ = Math.min(minZ, maxZ);
- this.maxX = Math.max(minX, maxX);
- this.maxY = Math.max(minY, maxY);
- this.maxZ = Math.max(minZ, maxZ);
- }
-
- /**
- * 从方块位置创建
- */
- public static AxisAlignedBB fromBlock(BlockPos pos) {
- return new AxisAlignedBB(
- pos.getX(), pos.getY(), pos.getZ(),
- pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1
- );
- }
-
- /**
- * 从两个点创建
- */
- public static AxisAlignedBB fromPoints(Vec3 pos1, Vec3 pos2) {
- return new AxisAlignedBB(pos1.x, pos1.y, pos1.z, pos2.x, pos2.y, pos2.z);
- }
-
- /**
- * 扩展包围盒
- */
- public AxisAlignedBB expand(double x, double y, double z) {
- return new AxisAlignedBB(
- minX - x, minY - y, minZ - z,
- maxX + x, maxY + y, maxZ + z
- );
- }
-
- /**
- * 统一扩展
- */
- public AxisAlignedBB expand(double value) {
- return expand(value, value, value);
- }
-
- /**
- * 收缩包围盒
- */
- public AxisAlignedBB contract(double x, double y, double z) {
- return new AxisAlignedBB(
- minX + x, minY + y, minZ + z,
- maxX - x, maxY - y, maxZ - z
- );
- }
-
- /**
- * 偏移包围盒
- */
- public AxisAlignedBB offset(double x, double y, double z) {
- return new AxisAlignedBB(
- minX + x, minY + y, minZ + z,
- maxX + x, maxY + y, maxZ + z
- );
- }
-
- /**
- * 偏移包围盒
- */
- public AxisAlignedBB offset(Vec3 vec) {
- return offset(vec.x, vec.y, vec.z);
- }
-
- /**
- * 检查是否相交
- */
- public boolean intersects(AxisAlignedBB other) {
- return maxX > other.minX && minX < other.maxX &&
- maxY > other.minY && minY < other.maxY &&
- maxZ > other.minZ && minZ < other.maxZ;
- }
-
- /**
- * 检查是否包含点
- */
- public boolean contains(Vec3 point) {
- return point.x >= minX && point.x <= maxX &&
- point.y >= minY && point.y <= maxY &&
- point.z >= minZ && point.z <= maxZ;
- }
-
- /**
- * 检查是否包含点(带容差)
- */
- public boolean contains(double x, double y, double z) {
- return x >= minX && x <= maxX &&
- y >= minY && y <= maxY &&
- z >= minZ && z <= maxZ;
- }
-
- /**
- * 获取中心点
- */
- public Vec3 getCenter() {
- return new Vec3(
- (minX + maxX) / 2.0,
- (minY + maxY) / 2.0,
- (minZ + maxZ) / 2.0
- );
- }
-
- /**
- * 获取体积
- */
- public double getVolume() {
- return (maxX - minX) * (maxY - minY) * (maxZ - minZ);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- AxisAlignedBB that = (AxisAlignedBB) o;
- return Double.compare(that.minX, minX) == 0 &&
- Double.compare(that.minY, minY) == 0 &&
- Double.compare(that.minZ, minZ) == 0 &&
- Double.compare(that.maxX, maxX) == 0 &&
- Double.compare(that.maxY, maxY) == 0 &&
- Double.compare(that.maxZ, maxZ) == 0;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(minX, minY, minZ, maxX, maxY, maxZ);
- }
-
- @Override
- public String toString() {
- return String.format("AABB{min=(%.2f,%.2f,%.2f), max=(%.2f,%.2f,%.2f)}",
- minX, minY, minZ, maxX, maxY, maxZ);
- }
-}
diff --git a/shared/java/top/fpsmaster/api/model/BlockPos.java b/shared/java/top/fpsmaster/api/model/BlockPos.java
deleted file mode 100644
index 01435c77..00000000
--- a/shared/java/top/fpsmaster/api/model/BlockPos.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package top.fpsmaster.api.model;
-
-import java.util.Objects;
-
-/**
- * 方块位置(值对象)
- * 不可变对象,线程安全
- *
- * 注意: 这是自定义的 BlockPos,不依赖 Minecraft 的 BlockPos
- */
-public final class BlockPos {
- private final int x;
- private final int y;
- private final int z;
-
- public BlockPos(int x, int y, int z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- public int getX() {
- return x;
- }
-
- public int getY() {
- return y;
- }
-
- public int getZ() {
- return z;
- }
-
- /**
- * 创建新的偏移位置
- */
- public BlockPos add(int dx, int dy, int dz) {
- return new BlockPos(x + dx, y + dy, z + dz);
- }
-
- /**
- * 向指定方向偏移
- */
- public BlockPos offset(Direction direction) {
- return add(direction.getOffsetX(), direction.getOffsetY(), direction.getOffsetZ());
- }
-
- /**
- * 向上偏移
- */
- public BlockPos up() {
- return add(0, 1, 0);
- }
-
- /**
- * 向下偏移
- */
- public BlockPos down() {
- return add(0, -1, 0);
- }
-
- /**
- * 向北偏移
- */
- public BlockPos north() {
- return add(0, 0, -1);
- }
-
- /**
- * 向南偏移
- */
- public BlockPos south() {
- return add(0, 0, 1);
- }
-
- /**
- * 向西偏移
- */
- public BlockPos west() {
- return add(-1, 0, 0);
- }
-
- /**
- * 向东偏移
- */
- public BlockPos east() {
- return add(1, 0, 0);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- BlockPos blockPos = (BlockPos) o;
- return x == blockPos.x && y == blockPos.y && z == blockPos.z;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(x, y, z);
- }
-
- @Override
- public String toString() {
- return "BlockPos{x=" + x + ", y=" + y + ", z=" + z + "}";
- }
-}
diff --git a/shared/java/top/fpsmaster/api/model/Difficulty.java b/shared/java/top/fpsmaster/api/model/Difficulty.java
deleted file mode 100644
index d732a1d4..00000000
--- a/shared/java/top/fpsmaster/api/model/Difficulty.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package top.fpsmaster.api.model;
-
-/**
- * 难度枚举
- */
-public enum Difficulty {
- /**
- * 和平
- */
- PEACEFUL(0, "peaceful"),
-
- /**
- * 简单
- */
- EASY(1, "easy"),
-
- /**
- * 普通
- */
- NORMAL(2, "normal"),
-
- /**
- * 困难
- */
- HARD(3, "hard");
-
- private final int id;
- private final String name;
-
- Difficulty(int id, String name) {
- this.id = id;
- this.name = name;
- }
-
- public int getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public static Difficulty fromId(int id) {
- for (Difficulty difficulty : values()) {
- if (difficulty.id == id) {
- return difficulty;
- }
- }
- return NORMAL;
- }
-}
diff --git a/shared/java/top/fpsmaster/api/model/Direction.java b/shared/java/top/fpsmaster/api/model/Direction.java
deleted file mode 100644
index 87541f83..00000000
--- a/shared/java/top/fpsmaster/api/model/Direction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package top.fpsmaster.api.model;
-
-/**
- * 方向枚举
- */
-public enum Direction {
- DOWN(0, -1, 0, "down"),
- UP(0, 1, 0, "up"),
- NORTH(0, 0, -1, "north"),
- SOUTH(0, 0, 1, "south"),
- WEST(-1, 0, 0, "west"),
- EAST(1, 0, 0, "east");
-
- private final int offsetX;
- private final int offsetY;
- private final int offsetZ;
- private final String name;
-
- Direction(int offsetX, int offsetY, int offsetZ, String name) {
- this.offsetX = offsetX;
- this.offsetY = offsetY;
- this.offsetZ = offsetZ;
- this.name = name;
- }
-
- public int getOffsetX() {
- return offsetX;
- }
-
- public int getOffsetY() {
- return offsetY;
- }
-
- public int getOffsetZ() {
- return offsetZ;
- }
-
- public String getName() {
- return name;
- }
-
- /**
- * 获取相反方向
- */
- public Direction getOpposite() {
- switch (this) {
- case DOWN: return UP;
- case UP: return DOWN;
- case NORTH: return SOUTH;
- case SOUTH: return NORTH;
- case WEST: return EAST;
- case EAST: return WEST;
- default: return this;
- }
- }
-}
diff --git a/shared/java/top/fpsmaster/api/model/GameMode.java b/shared/java/top/fpsmaster/api/model/GameMode.java
deleted file mode 100644
index 2f11beb0..00000000
--- a/shared/java/top/fpsmaster/api/model/GameMode.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package top.fpsmaster.api.model;
-
-/**
- * 游戏模式枚举
- */
-public enum GameMode {
- /**
- * 生存模式
- */
- SURVIVAL(0, "survival"),
-
- /**
- * 创造模式
- */
- CREATIVE(1, "creative"),
-
- /**
- * 冒险模式
- */
- ADVENTURE(2, "adventure"),
-
- /**
- * 旁观者模式
- */
- SPECTATOR(3, "spectator");
-
- private final int id;
- private final String name;
-
- GameMode(int id, String name) {
- this.id = id;
- this.name = name;
- }
-
- public int getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public static GameMode fromId(int id) {
- for (GameMode mode : values()) {
- if (mode.id == id) {
- return mode;
- }
- }
- return SURVIVAL;
- }
-}
diff --git a/shared/java/top/fpsmaster/api/model/ParticleType.java b/shared/java/top/fpsmaster/api/model/ParticleType.java
deleted file mode 100644
index 4d840feb..00000000
--- a/shared/java/top/fpsmaster/api/model/ParticleType.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package top.fpsmaster.api.model;
-
-/**
- * 粒子类型枚举
- * 注意: 这是自定义枚举,不依赖 Minecraft 的 EnumParticleTypes
- */
-public enum ParticleType {
- EXPLOSION_NORMAL,
- EXPLOSION_LARGE,
- EXPLOSION_HUGE,
- FIREWORKS_SPARK,
- WATER_BUBBLE,
- WATER_SPLASH,
- WATER_WAKE,
- SUSPENDED,
- SUSPENDED_DEPTH,
- CRIT,
- CRIT_MAGIC,
- SMOKE_NORMAL,
- SMOKE_LARGE,
- SPELL,
- SPELL_INSTANT,
- SPELL_MOB,
- SPELL_MOB_AMBIENT,
- SPELL_WITCH,
- DRIP_WATER,
- DRIP_LAVA,
- VILLAGER_ANGRY,
- VILLAGER_HAPPY,
- TOWN_AURA,
- NOTE,
- PORTAL,
- ENCHANTMENT_TABLE,
- FLAME,
- LAVA,
- FOOTSTEP,
- CLOUD,
- REDSTONE,
- SNOWBALL,
- SNOW_SHOVEL,
- SLIME,
- HEART,
- BARRIER,
- ITEM_CRACK,
- BLOCK_CRACK,
- BLOCK_DUST,
- WATER_DROP,
- ITEM_TAKE,
- MOB_APPEARANCE
-}
diff --git a/shared/java/top/fpsmaster/api/model/Vec3.java b/shared/java/top/fpsmaster/api/model/Vec3.java
deleted file mode 100644
index 71623acc..00000000
--- a/shared/java/top/fpsmaster/api/model/Vec3.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package top.fpsmaster.api.model;
-
-import java.util.Objects;
-
-/**
- * 三维向量(值对象)
- * 不可变对象,线程安全
- *
- * 注意: 这是自定义的 Vec3,不依赖 Minecraft 的 Vec3
- */
-public final class Vec3 {
- public final double x;
- public final double y;
- public final double z;
-
- public Vec3(double x, double y, double z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- /**
- * 零向量
- */
- public static final Vec3 ZERO = new Vec3(0, 0, 0);
-
- /**
- * 向量加法
- */
- public Vec3 add(Vec3 other) {
- return new Vec3(x + other.x, y + other.y, z + other.z);
- }
-
- /**
- * 向量加法
- */
- public Vec3 add(double dx, double dy, double dz) {
- return new Vec3(x + dx, y + dy, z + dz);
- }
-
- /**
- * 向量减法
- */
- public Vec3 subtract(Vec3 other) {
- return new Vec3(x - other.x, y - other.y, z - other.z);
- }
-
- /**
- * 向量缩放
- */
- public Vec3 scale(double factor) {
- return new Vec3(x * factor, y * factor, z * factor);
- }
-
- /**
- * 计算到另一个向量的距离
- */
- public double distanceTo(Vec3 other) {
- double dx = x - other.x;
- double dy = y - other.y;
- double dz = z - other.z;
- return Math.sqrt(dx * dx + dy * dy + dz * dz);
- }
-
- /**
- * 计算距离的平方(避免开方运算,性能更好)
- */
- public double distanceSquared(Vec3 other) {
- double dx = x - other.x;
- double dy = y - other.y;
- double dz = z - other.z;
- return dx * dx + dy * dy + dz * dz;
- }
-
- /**
- * 向量长度
- */
- public double length() {
- return Math.sqrt(x * x + y * y + z * z);
- }
-
- /**
- * 向量长度的平方
- */
- public double lengthSquared() {
- return x * x + y * y + z * z;
- }
-
- /**
- * 归一化(单位向量)
- */
- public Vec3 normalize() {
- double len = length();
- return len < 1e-4 ? ZERO : scale(1.0 / len);
- }
-
- /**
- * 点积
- */
- public double dot(Vec3 other) {
- return x * other.x + y * other.y + z * other.z;
- }
-
- /**
- * 叉积
- */
- public Vec3 cross(Vec3 other) {
- return new Vec3(
- y * other.z - z * other.y,
- z * other.x - x * other.z,
- x * other.y - y * other.x
- );
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- Vec3 vec3 = (Vec3) o;
- return Double.compare(vec3.x, x) == 0 &&
- Double.compare(vec3.y, y) == 0 &&
- Double.compare(vec3.z, z) == 0;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(x, y, z);
- }
-
- @Override
- public String toString() {
- return String.format("Vec3{x=%.2f, y=%.2f, z=%.2f}", x, y, z);
- }
-}
diff --git a/shared/java/top/fpsmaster/api/model/WeatherType.java b/shared/java/top/fpsmaster/api/model/WeatherType.java
deleted file mode 100644
index 9e95d1c2..00000000
--- a/shared/java/top/fpsmaster/api/model/WeatherType.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package top.fpsmaster.api.model;
-
-/**
- * 天气类型枚举
- */
-public enum WeatherType {
- /**
- * 晴天
- */
- CLEAR,
-
- /**
- * 雨天
- */
- RAIN,
-
- /**
- * 雷雨
- */
- THUNDER
-}
diff --git a/shared/java/top/fpsmaster/api/provider/IMinecraftProvider.java b/shared/java/top/fpsmaster/api/provider/IMinecraftProvider.java
deleted file mode 100644
index db3f4740..00000000
--- a/shared/java/top/fpsmaster/api/provider/IMinecraftProvider.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package top.fpsmaster.api.provider;
-
-import org.jetbrains.annotations.NotNull;
-import top.fpsmaster.api.interfaces.client.IMinecraft;
-
-public interface IMinecraftProvider {
- @NotNull IMinecraft getMinecraft();
-}
diff --git a/shared/java/top/fpsmaster/api/provider/IProvider.java b/shared/java/top/fpsmaster/api/provider/IProvider.java
deleted file mode 100644
index 1f4407fb..00000000
--- a/shared/java/top/fpsmaster/api/provider/IProvider.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package top.fpsmaster.api.provider;
-
-public interface IProvider {
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/ProviderRegistry.java b/shared/java/top/fpsmaster/api/provider/ProviderRegistry.java
deleted file mode 100644
index a69467ac..00000000
--- a/shared/java/top/fpsmaster/api/provider/ProviderRegistry.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package top.fpsmaster.api.provider;
-
-import lombok.Getter;
-import lombok.Setter;
-
-public class ProviderRegistry {
- @Getter
- @Setter
- private static IMinecraftProvider minecraftProvider;
-
-}
diff --git a/shared/java/top/fpsmaster/api/provider/client/IConstantsProvider.java b/shared/java/top/fpsmaster/api/provider/client/IConstantsProvider.java
deleted file mode 100644
index f8ff6bd0..00000000
--- a/shared/java/top/fpsmaster/api/provider/client/IConstantsProvider.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package top.fpsmaster.api.provider.client;
-
-import top.fpsmaster.api.provider.IProvider;
-
-public interface IConstantsProvider extends IProvider {
- String getVersion();
- String getEdition();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/game/IGameSettings.java b/shared/java/top/fpsmaster/api/provider/game/IGameSettings.java
deleted file mode 100644
index edb44d78..00000000
--- a/shared/java/top/fpsmaster/api/provider/game/IGameSettings.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package top.fpsmaster.api.provider.game;
-
-import net.minecraft.client.settings.KeyBinding;
-import top.fpsmaster.api.provider.IProvider;
-
-public interface IGameSettings extends IProvider {
- void setKeyPress(KeyBinding key, boolean value);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/game/ILegacyMinecraftProvider.java b/shared/java/top/fpsmaster/api/provider/game/ILegacyMinecraftProvider.java
deleted file mode 100644
index 4ed12357..00000000
--- a/shared/java/top/fpsmaster/api/provider/game/ILegacyMinecraftProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package top.fpsmaster.api.provider.game;
-
-import net.minecraft.client.entity.EntityPlayerSP;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.client.network.NetworkPlayerInfo;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.Session;
-import top.fpsmaster.api.provider.IProvider;
-
-import java.io.File;
-import java.util.Collection;
-
-public interface ILegacyMinecraftProvider extends IProvider {
- Object getCurrentScreen();
- File getGameDir();
- FontRenderer getFontRenderer();
- EntityPlayerSP getPlayer();
- boolean isHoveringOverBlock();
- ItemStack getPlayerHeldItem();
- WorldClient getWorld();
- ItemStack[] getArmorInventory();
- void setSession(Session mojang);
- Integer getRespondTime();
- void drawString(String text, float x, float y, int color);
- String getServerAddress();
- void removeClickDelay();
- void printChatMessage(Object message);
- Collection getPlayerInfoMap();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/game/ISkinProvider.java b/shared/java/top/fpsmaster/api/provider/game/ISkinProvider.java
deleted file mode 100644
index 27e49ac0..00000000
--- a/shared/java/top/fpsmaster/api/provider/game/ISkinProvider.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.provider.game;
-
-import top.fpsmaster.api.provider.IProvider;
-
-public interface ISkinProvider extends IProvider {
- void updateSkin(String name, String uuid, String skin);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/game/ITimerProvider.java b/shared/java/top/fpsmaster/api/provider/game/ITimerProvider.java
deleted file mode 100644
index 42a0ff24..00000000
--- a/shared/java/top/fpsmaster/api/provider/game/ITimerProvider.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.provider.game;
-
-import top.fpsmaster.api.provider.IProvider;
-
-public interface ITimerProvider extends IProvider {
- float getRenderPartialTicks();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/game/IUtilityProvider.java b/shared/java/top/fpsmaster/api/provider/game/IUtilityProvider.java
deleted file mode 100644
index 2a534ba1..00000000
--- a/shared/java/top/fpsmaster/api/provider/game/IUtilityProvider.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package top.fpsmaster.api.provider.game;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.potion.PotionEffect;
-import net.minecraft.util.ResourceLocation;
-import top.fpsmaster.api.provider.IProvider;
-
-public interface IUtilityProvider extends IProvider {
- String getResourcePath(ResourceLocation resourceLocation);
- double getDistanceToEntity(Entity e1, Entity e2);
- boolean isItemEnhancementEmpty(ItemStack i);
- int getPotionIconIndex(PotionEffect effect);
- Object makeChatComponent(String msg);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/game/IWorldClientProvider.java b/shared/java/top/fpsmaster/api/provider/game/IWorldClientProvider.java
deleted file mode 100644
index ff3fe44a..00000000
--- a/shared/java/top/fpsmaster/api/provider/game/IWorldClientProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package top.fpsmaster.api.provider.game;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.entity.effect.EntityLightningBolt;
-import top.fpsmaster.api.provider.IProvider;
-import top.fpsmaster.wrapper.blockpos.WrapperBlockPos;
-import top.fpsmaster.wrapper.util.WrapperAxisAlignedBB;
-
-public interface IWorldClientProvider extends IProvider {
- IBlockState getBlockState(WrapperBlockPos pos);
- Block getBlock(WrapperBlockPos pos);
- WrapperAxisAlignedBB getBlockBoundingBox(WrapperBlockPos pos, IBlockState state);
- void addWeatherEffect(EntityLightningBolt entityLightningBolt);
- WorldClient getWorld();
- void setWorldTime(long l);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/gui/IGuiIngameProvider.java b/shared/java/top/fpsmaster/api/provider/gui/IGuiIngameProvider.java
deleted file mode 100644
index fd5dc1af..00000000
--- a/shared/java/top/fpsmaster/api/provider/gui/IGuiIngameProvider.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package top.fpsmaster.api.provider.gui;
-
-import net.minecraft.entity.Entity;
-import top.fpsmaster.api.provider.IProvider;
-
-public interface IGuiIngameProvider extends IProvider {
- void drawHealth(Entity entityIn);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/gui/IGuiMainMenuProvider.java b/shared/java/top/fpsmaster/api/provider/gui/IGuiMainMenuProvider.java
deleted file mode 100644
index f4a748ba..00000000
--- a/shared/java/top/fpsmaster/api/provider/gui/IGuiMainMenuProvider.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package top.fpsmaster.api.provider.gui;
-
-import net.minecraft.client.gui.GuiScreen;
-import top.fpsmaster.api.provider.IProvider;
-
-public interface IGuiMainMenuProvider extends IProvider {
- void initGui();
- void renderSkybox(int mouseX, int mouseY, float partialTicks, int width, int height, float zLevel);
- void showSinglePlayer(GuiScreen screen);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/gui/IGuiNewChatProvider.java b/shared/java/top/fpsmaster/api/provider/gui/IGuiNewChatProvider.java
deleted file mode 100644
index bcb3dd82..00000000
--- a/shared/java/top/fpsmaster/api/provider/gui/IGuiNewChatProvider.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package top.fpsmaster.api.provider.gui;
-
-import net.minecraft.client.gui.ChatLine;
-import top.fpsmaster.api.provider.IProvider;
-
-import java.util.List;
-
-public interface IGuiNewChatProvider extends IProvider {
- List getChatLines();
- List getDrawnChatLines();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/packets/IAddPlayerData.java b/shared/java/top/fpsmaster/api/provider/packets/IAddPlayerData.java
deleted file mode 100644
index bb53090d..00000000
--- a/shared/java/top/fpsmaster/api/provider/packets/IAddPlayerData.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package top.fpsmaster.api.provider.packets;
-
-public interface IAddPlayerData {
- String getName();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/packets/IPacket.java b/shared/java/top/fpsmaster/api/provider/packets/IPacket.java
deleted file mode 100644
index d76e4770..00000000
--- a/shared/java/top/fpsmaster/api/provider/packets/IPacket.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.provider.packets;
-
-import top.fpsmaster.api.provider.IProvider;
-
-public interface IPacket extends IProvider {
- boolean isPacket(Object packet);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/packets/IPacketChat.java b/shared/java/top/fpsmaster/api/provider/packets/IPacketChat.java
deleted file mode 100644
index 0fd43192..00000000
--- a/shared/java/top/fpsmaster/api/provider/packets/IPacketChat.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package top.fpsmaster.api.provider.packets;
-
-import net.minecraft.util.IChatComponent;
-
-public interface IPacketChat extends IPacket {
- String getUnformattedText(Object packet);
- IChatComponent getChatComponent(Object packet);
- int getType(Object p);
- void appendTranslation(Object p);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/packets/IPacketPlayerList.java b/shared/java/top/fpsmaster/api/provider/packets/IPacketPlayerList.java
deleted file mode 100644
index ce2e4cce..00000000
--- a/shared/java/top/fpsmaster/api/provider/packets/IPacketPlayerList.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package top.fpsmaster.api.provider.packets;
-
-import top.fpsmaster.api.wrapper.packets.PlayerListItemAddWrap;
-
-import java.util.List;
-
-public interface IPacketPlayerList extends IPacket {
- boolean isActionJoin(Object p);
- boolean isActionLeave(Object p);
- List getEntries(Object p);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/packets/IPacketTimeUpdate.java b/shared/java/top/fpsmaster/api/provider/packets/IPacketTimeUpdate.java
deleted file mode 100644
index 9a408286..00000000
--- a/shared/java/top/fpsmaster/api/provider/packets/IPacketTimeUpdate.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package top.fpsmaster.api.provider.packets;
-
-public interface IPacketTimeUpdate extends IPacket {
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/render/IEffectRendererProvider.java b/shared/java/top/fpsmaster/api/provider/render/IEffectRendererProvider.java
deleted file mode 100644
index 235e74ab..00000000
--- a/shared/java/top/fpsmaster/api/provider/render/IEffectRendererProvider.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package top.fpsmaster.api.provider.render;
-
-import top.fpsmaster.api.provider.IProvider;
-import top.fpsmaster.wrapper.blockpos.WrapperBlockPos;
-
-public interface IEffectRendererProvider extends IProvider {
- void addRedStoneBreak(WrapperBlockPos pos);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/render/IRenderManagerProvider.java b/shared/java/top/fpsmaster/api/provider/render/IRenderManagerProvider.java
deleted file mode 100644
index 26baf5e5..00000000
--- a/shared/java/top/fpsmaster/api/provider/render/IRenderManagerProvider.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package top.fpsmaster.api.provider.render;
-
-import top.fpsmaster.api.provider.IProvider;
-
-public interface IRenderManagerProvider extends IProvider {
- double renderPosX();
- double renderPosY();
- double renderPosZ();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/provider/sound/ISoundProvider.java b/shared/java/top/fpsmaster/api/provider/sound/ISoundProvider.java
deleted file mode 100644
index ced03050..00000000
--- a/shared/java/top/fpsmaster/api/provider/sound/ISoundProvider.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package top.fpsmaster.api.provider.sound;
-
-import top.fpsmaster.api.provider.IProvider;
-
-public interface ISoundProvider extends IProvider {
- void playLightning(double posX, double posY, double posZ, float i, float v, boolean b);
- void playExplosion(double posX, double posY, double posZ, float i, float v, boolean b);
- void playRedStoneBreak(double posX, double posY, double posZ, float i, float v, boolean b);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/EffectRendererWrap.java b/shared/java/top/fpsmaster/api/wrapper/EffectRendererWrap.java
deleted file mode 100644
index 88a534cc..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/EffectRendererWrap.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-import top.fpsmaster.wrapper.blockpos.WrapperBlockPos;
-
-public interface EffectRendererWrap {
- void addRedStoneBreak(WrapperBlockPos pos);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/GameSettingsWrap.java b/shared/java/top/fpsmaster/api/wrapper/GameSettingsWrap.java
deleted file mode 100644
index 2f09eb5a..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/GameSettingsWrap.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-import net.minecraft.client.settings.KeyBinding;
-
-public interface GameSettingsWrap {
- void setKeyPress(KeyBinding key, boolean value);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/GuiIngameWrap.java b/shared/java/top/fpsmaster/api/wrapper/GuiIngameWrap.java
deleted file mode 100644
index 2250210c..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/GuiIngameWrap.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-import net.minecraft.entity.Entity;
-
-public interface GuiIngameWrap {
- void drawHealth(Entity entityIn);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/GuiNewChatWrap.java b/shared/java/top/fpsmaster/api/wrapper/GuiNewChatWrap.java
deleted file mode 100644
index e18aec38..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/GuiNewChatWrap.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-import net.minecraft.client.gui.ChatLine;
-
-import java.util.List;
-
-public interface GuiNewChatWrap {
- List getChatLines();
- List getDrawnChatLines();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/MainMenuWrap.java b/shared/java/top/fpsmaster/api/wrapper/MainMenuWrap.java
deleted file mode 100644
index d3123058..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/MainMenuWrap.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-import net.minecraft.client.gui.GuiScreen;
-
-public interface MainMenuWrap {
- void initGui();
- void renderSkybox(int mouseX, int mouseY, float partialTicks, int width, int height, float zLevel);
- void showSinglePlayer(GuiScreen screen);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/MinecraftWrap.java b/shared/java/top/fpsmaster/api/wrapper/MinecraftWrap.java
deleted file mode 100644
index 1a4f3297..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/MinecraftWrap.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-import net.minecraft.client.entity.EntityPlayerSP;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.client.network.NetworkPlayerInfo;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.Session;
-
-import java.io.File;
-import java.util.Collection;
-
-public interface MinecraftWrap {
- Object getCurrentScreen();
- File getGameDir();
- FontRenderer getFontRenderer();
- EntityPlayerSP getPlayer();
- boolean isHoveringOverBlock();
- ItemStack getPlayerHeldItem();
- WorldClient getWorld();
- ItemStack[] getArmorInventory();
- void setSession(Session mojang);
- Integer getRespondTime();
- void drawString(String text, float x, float y, int color);
- String getServerAddress();
- void removeClickDelay();
- void printChatMessage(Object message);
- Collection getPlayerInfoMap();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/RenderManagerWrap.java b/shared/java/top/fpsmaster/api/wrapper/RenderManagerWrap.java
deleted file mode 100644
index 53ce5f40..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/RenderManagerWrap.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-public interface RenderManagerWrap {
- double renderPosX();
- double renderPosY();
- double renderPosZ();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/SkinWrap.java b/shared/java/top/fpsmaster/api/wrapper/SkinWrap.java
deleted file mode 100644
index ca2215d5..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/SkinWrap.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-public interface SkinWrap {
- void updateSkin(String name, String uuid, String skin);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/SoundWrap.java b/shared/java/top/fpsmaster/api/wrapper/SoundWrap.java
deleted file mode 100644
index bc10bda0..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/SoundWrap.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-public interface SoundWrap {
- void playLightning(double posX, double posY, double posZ, float i, float v, boolean b);
- void playExplosion(double posX, double posY, double posZ, float i, float v, boolean b);
- void playRedStoneBreak(double posX, double posY, double posZ, float i, float v, boolean b);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/TimerWrap.java b/shared/java/top/fpsmaster/api/wrapper/TimerWrap.java
deleted file mode 100644
index 87c119d4..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/TimerWrap.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-public interface TimerWrap {
- float getRenderPartialTicks();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/WorldWrap.java b/shared/java/top/fpsmaster/api/wrapper/WorldWrap.java
deleted file mode 100644
index 2ccf5240..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/WorldWrap.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package top.fpsmaster.api.wrapper;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.entity.effect.EntityLightningBolt;
-import top.fpsmaster.wrapper.blockpos.WrapperBlockPos;
-import top.fpsmaster.wrapper.util.WrapperAxisAlignedBB;
-
-public interface WorldWrap {
- IBlockState getBlockState(WrapperBlockPos pos);
- Block getBlock(WrapperBlockPos pos);
- WrapperAxisAlignedBB getBlockBoundingBox(WrapperBlockPos pos, IBlockState state);
- void addWeatherEffect(EntityLightningBolt entityLightningBolt);
- WorldClient getWorld();
- void setWorldTime(long l);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/packets/ChatPacketWrap.java b/shared/java/top/fpsmaster/api/wrapper/packets/ChatPacketWrap.java
deleted file mode 100644
index 71a99128..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/packets/ChatPacketWrap.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package top.fpsmaster.api.wrapper.packets;
-
-import net.minecraft.util.IChatComponent;
-
-public interface ChatPacketWrap {
- boolean isPacket(Object packet);
- String getUnformattedText(Object packet);
- IChatComponent getChatComponent(Object packet);
- int getType(Object p);
- void appendTranslation(Object p);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/packets/PlayerListItemAddWrap.java b/shared/java/top/fpsmaster/api/wrapper/packets/PlayerListItemAddWrap.java
deleted file mode 100644
index 7303c99b..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/packets/PlayerListItemAddWrap.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package top.fpsmaster.api.wrapper.packets;
-
-public interface PlayerListItemAddWrap {
- String getName();
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/packets/PlayerListItemWrap.java b/shared/java/top/fpsmaster/api/wrapper/packets/PlayerListItemWrap.java
deleted file mode 100644
index d25045a6..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/packets/PlayerListItemWrap.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package top.fpsmaster.api.wrapper.packets;
-
-import java.util.List;
-
-public interface PlayerListItemWrap {
- boolean isPacket(Object p);
- boolean isActionJoin(Object p);
- boolean isActionLeave(Object p);
- List getEntries(Object p);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/api/wrapper/packets/TimeUpdatePacketWrap.java b/shared/java/top/fpsmaster/api/wrapper/packets/TimeUpdatePacketWrap.java
deleted file mode 100644
index 55e154be..00000000
--- a/shared/java/top/fpsmaster/api/wrapper/packets/TimeUpdatePacketWrap.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package top.fpsmaster.api.wrapper.packets;
-
-public interface TimeUpdatePacketWrap {
- boolean isPacket(Object packet);
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/features/GlobalListener.java b/shared/java/top/fpsmaster/features/GlobalListener.java
index e62e255c..67601d87 100644
--- a/shared/java/top/fpsmaster/features/GlobalListener.java
+++ b/shared/java/top/fpsmaster/features/GlobalListener.java
@@ -1,17 +1,14 @@
package top.fpsmaster.features;
import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.ChatLine;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
-import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.event.ClickEvent;
import net.minecraft.event.HoverEvent;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;
-import org.java_websocket.enums.ReadyState;
import org.lwjgl.input.Mouse;
import top.fpsmaster.FPSMaster;
import top.fpsmaster.event.EventDispatcher;
@@ -19,24 +16,10 @@
import top.fpsmaster.event.events.*;
import top.fpsmaster.features.impl.interfaces.BetterChat;
import top.fpsmaster.features.impl.interfaces.ClientSettings;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.api.provider.gui.IGuiNewChatProvider;
-import top.fpsmaster.modules.account.AccountManager;
-import top.fpsmaster.modules.account.Cosmetic;
-import top.fpsmaster.modules.client.ClientUser;
import top.fpsmaster.ui.notification.NotificationManager;
import top.fpsmaster.utils.Utility;
import top.fpsmaster.utils.render.StencilUtil;
import top.fpsmaster.utils.render.shader.KawaseBlur;
-import top.fpsmaster.websocket.client.WsClient;
-
-import java.net.URISyntaxException;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
import static top.fpsmaster.utils.Utility.mc;
@@ -62,15 +45,10 @@ public void onChatSend(EventSendChatMessage e) {
}
- PlayerInformation playerInformation = null;
-
-
- Map playerInfos = new ConcurrentHashMap<>();
Thread tickThread;
- Thread accThread;
@Subscribe
- public void onTick(EventTick e) throws URISyntaxException {
+ public void onTick(EventTick e) {
if (tickThread == null || !tickThread.isAlive()) {
tickThread = new Thread(() -> {
try {
@@ -86,112 +64,12 @@ public void onTick(EventTick e) throws URISyntaxException {
// throw new RuntimeException(ex);
// }
// }
- if (MinecraftAPI.client().getMinecraft() != null && MinecraftAPI.world().getWorld() != null) {
+ if (mc != null && mc.theWorld != null) {
Utility.flush();
}
});
tickThread.start();
}
-
-
- if (accThread == null || !accThread.isAlive()) {
- accThread = new Thread(() -> {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- if (FPSMaster.INSTANCE.loggedIn) {
- if (FPSMaster.INSTANCE.wsClient == null) {
- try {
- FPSMaster.INSTANCE.wsClient = WsClient.start("wss://service.fpsmaster.top/");
- } catch (URISyntaxException ex) {
- throw new RuntimeException(ex);
- }
- Utility.sendClientDebug("尝试连接");
- } else if (FPSMaster.INSTANCE.wsClient.isClosed() || FPSMaster.INSTANCE.wsClient.getReadyState() != ReadyState.OPEN) {
- FPSMaster.INSTANCE.wsClient.close();
- FPSMaster.INSTANCE.wsClient.connect();
- playerInformation = null;
- playerInfos.clear();
- Utility.sendClientDebug("尝试重连");
- } else {
- FPSMaster.INSTANCE.wsClient.sendPing();
- }
- if (mc.getNetHandler() == null)
- return;
- if (mc.getNetHandler().getPlayerInfoMap() == null)
- return;
-
- Set currentPlayers = mc.getNetHandler().getPlayerInfoMap().stream()
- .map(info -> info.getGameProfile().getId())
- .collect(Collectors.toSet());
-
- playerInfos.keySet().retainAll(currentPlayers);
-
-
- if (FPSMaster.INSTANCE.wsClient.getReadyState() != ReadyState.OPEN)
- return;
-
- for (NetworkPlayerInfo info : mc.getNetHandler().getPlayerInfoMap()) {
- UUID uuid = info.getGameProfile().getId();
- if (!playerInfos.containsKey(uuid)) {
- playerInfos.put(uuid, info);
- FPSMaster.INSTANCE.wsClient.fetchPlayer(uuid.toString(), info.getGameProfile().getName());
- }
- }
-
- for (ClientUser user : FPSMaster.clientUsersManager.users) {
- FPSMaster.INSTANCE.wsClient.fetchPlayer(user.uuid, user.name);
- }
-
- if (playerInformation == null) {
- playerInformation = new PlayerInformation(MinecraftAPI.client().getPlayer().getName(), MinecraftAPI.client().getPlayer().getUUID(), MinecraftAPI.client().getServerAddress(), AccountManager.cosmeticsUsing, AccountManager.skin);
- FPSMaster.INSTANCE.wsClient.sendInformation(AccountManager.skin, AccountManager.cosmeticsUsing, MinecraftAPI.client().getPlayer().getName(), MinecraftAPI.client().getServerAddress());
- } else if (!playerInformation.serverAddress.equals(MinecraftAPI.client().getServerAddress()) || !playerInformation.name.equals(MinecraftAPI.client().getPlayer().getName()) || !playerInformation.skin.equals(AccountManager.skin) || !playerInformation.uuid.equals(MinecraftAPI.client().getPlayer().getUUID()) || !playerInformation.cosmetics.equals(AccountManager.cosmeticsUsing)) {
- playerInformation = new PlayerInformation(MinecraftAPI.client().getPlayer().getName(), MinecraftAPI.client().getPlayer().getUUID(), MinecraftAPI.client().getServerAddress(), AccountManager.cosmeticsUsing, AccountManager.skin);
- FPSMaster.INSTANCE.wsClient.sendInformation(AccountManager.skin, AccountManager.cosmeticsUsing, MinecraftAPI.client().getPlayer().getName(), MinecraftAPI.client().getServerAddress());
- }
- }
- });
- accThread.start();
- }
- }
-
- @Subscribe
- public void onCape(EventCapeLoading e) {
- String[] cosmetics;
-
- if (e.player == mc.thePlayer) {
- if (AccountManager.cosmeticsUsing.isEmpty())
- return;
- cosmetics = AccountManager.cosmeticsUsing.split(",");
- } else {
- ClientUser clientUser = FPSMaster.clientUsersManager.getClientUser(e.player);
- if (clientUser == null)
- return;
- cosmetics = clientUser.cosmetics.split(",");
- }
-
- for (String cosmetic : cosmetics) {
- if (cosmetic.isEmpty())
- continue;
- Cosmetic cosmetic1 = AccountManager.cosmetics.get(Integer.valueOf(cosmetic));
- if (cosmetic1.resource.endsWith(".gif")) {
- if (cosmetic1.frame < cosmetic1.frames.size() - 1) {
- if (System.currentTimeMillis() - cosmetic1.frameTime > cosmetic1.frames.get(cosmetic1.frame).delay) {
- cosmetic1.frame++;
- cosmetic1.frameTime = System.currentTimeMillis();
- }
- } else {
- cosmetic1.frame = 0;
- cosmetic1.frameTime = System.currentTimeMillis();
- }
- e.setCachedCape("ornaments/" + cosmetic + "_resource_" + cosmetic1.frame);
- } else {
- e.setCachedCape("ornaments/" + cosmetic + "_resource");
- }
- }
}
@Subscribe
@@ -212,19 +90,4 @@ public void onRender(EventRender2D e) {
NotificationManager.drawNotifications();
}
- static class PlayerInformation {
- String name;
- String uuid;
- String serverAddress;
- String cosmetics;
- String skin;
-
- public PlayerInformation(String name, String uuid, String serverAddress, String cosmetics, String skin) {
- this.name = name;
- this.uuid = uuid;
- this.serverAddress = serverAddress;
- this.cosmetics = cosmetics;
- this.skin = skin;
- }
- }
}
diff --git a/shared/java/top/fpsmaster/features/command/CommandManager.java b/shared/java/top/fpsmaster/features/command/CommandManager.java
index afc8dd4b..3ff4da06 100644
--- a/shared/java/top/fpsmaster/features/command/CommandManager.java
+++ b/shared/java/top/fpsmaster/features/command/CommandManager.java
@@ -4,10 +4,7 @@
import top.fpsmaster.event.EventDispatcher;
import top.fpsmaster.event.Subscribe;
import top.fpsmaster.event.events.EventSendChatMessage;
-import top.fpsmaster.features.command.impl.AI;
import top.fpsmaster.features.command.impl.Dev;
-import top.fpsmaster.features.command.impl.IRCChat;
-import top.fpsmaster.features.command.impl.TestNewAPICommand;
import top.fpsmaster.features.impl.interfaces.ClientSettings;
import top.fpsmaster.utils.Utility;
@@ -23,9 +20,6 @@ public class CommandManager {
public void init() {
// add commands
commands.add(new Dev());
- commands.add(new AI());
- commands.add(new IRCChat());
- commands.add(new TestNewAPICommand());
EventDispatcher.registerListener(this);
}
diff --git a/shared/java/top/fpsmaster/features/command/impl/AI.java b/shared/java/top/fpsmaster/features/command/impl/AI.java
deleted file mode 100644
index adc4c095..00000000
--- a/shared/java/top/fpsmaster/features/command/impl/AI.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package top.fpsmaster.features.command.impl;
-
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.exception.FileException;
-import top.fpsmaster.features.command.Command;
-import top.fpsmaster.modules.lua.LuaManager;
-import top.fpsmaster.modules.lua.LuaScript;
-import top.fpsmaster.modules.lua.RawLua;
-import top.fpsmaster.utils.Utility;
-import top.fpsmaster.utils.os.FileUtils;
-import top.fpsmaster.utils.thirdparty.openai.OpenAIClient;
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-public class AI extends Command {
- private final String luaPrompt = "请遵守以下规则:\n" +
- "1. 你的角色:作为代码生成机器人\n" +
- "2. 你的目标:参考下面的lua示例,完成用户所输入的要求,编写相应的lua代码\n" +
- "3. 禁止做:与用户闲聊、生成有危害性的代码\n" +
- "4. 牢记:你所能使用的只有lua自带的语法,以及下面的示例中出现的api,不要自己编造。如果有实现不了的功能,则使用注释在相应位置占位。输出代码时不要加```lua和```,否则会导致lua语法错误。\n" +
- "\n" +
- "```lua\n" +
- "-- 这里的代码最先执行\n" +
- "function load()\n" +
- " -- 在lua加载完成后才执行\n" +
- " putI18n(\"testmodule\", \"测试功能\") -- putI18n函数可以向客户端的多语言系统添加字段\n" +
- " putI18n(\"testmodule.desc\", \"测试功能描述\")\n" +
- "end\n" +
- "\n" +
- "function unload()\n" +
- " -- 在lua卸载后执行\n" +
- "end\n" +
- "\n" +
- "function text(fontSize, text, x, y , color)\n" +
- " -- 使用说明: drawString(fontSize, text, x,y,rgb(red,green,blue,alpha), dropShadow)\n" +
- " drawString(fontSize, text, x+1 , y+1, rgb(115,155,200,255),false)\n" +
- " drawString(fontSize, text, x , y, rgb(255,255,255,255),false)\n" +
- "end\n" +
- "\n" +
- "local module = registerModule(\"TestModule\", \"Optimize\", {\n" +
- " on_enable = function()\n" +
- " notify(\"module enabled\")\n" +
- " end,\n" +
- " on_disable = function()\n" +
- " notify(\"module disabled\")\n" +
- " end,\n" +
- " on_draw = function()\n" +
- " -- 使用说明: drawRect(x,y,width,height,rgb(red,green,blue,alpha))\n" +
- " drawRect(8, 8, 47, 14, 2, rgb(0,0,0,55)) -- 绘制矩形背景\n" +
- " drawRect(8, 8, 2, 14, 2, rgb(55,255,255,255)) -- 绘制矩形背景左侧色块\n" +
- " text(20, \"Test!\", 12 , 9, rgb(115,155,200,255),false) -- 绘制文字:\n" +
- " end\n" +
- "})\n" +
- "\n" +
- "module:toggle() -- 在这里加一个这个可以让lua重载时自动打开功能\n" +
- "\n" +
- "```";
-
- public AI() {
- super("ai");
- }
-
- @Override
- public void execute(String[] args) throws Exception {
- StringBuilder sb = new StringBuilder();
- if (args.length > 0) {
- if (args[0].equals("lua")) {
- for (int i = 2; i < args.length; i++) {
- sb.append(args[i]);
- }
- String fileName = args[1];
- Utility.sendClientNotify("[Intelligence Code] Created lua: " + fileName + ".lua");
- FileUtils.saveFile("plugins/" + fileName + ".lua", sb.toString());
- LuaScript luaScript = new LuaScript(null, new RawLua(fileName + ".lua", ""));
- LuaManager.scripts.add(luaScript);
-
- ArrayList messages = new ArrayList<>();
- messages.add(new OpenAIClient.Message("system", luaPrompt));
- messages.add(new OpenAIClient.Message("user", sb.toString()));
- Utility.sendClientNotify("[Intelligence Code] Started coding...");
- OpenAIClient.getChatResponseAsync(messages, new OpenAIClient.ResponseCallback() {
- @Override
- public void onResponse(String response) {
- String code = response.replace("```lua", "").replace("```", "");
- luaScript.rawLua.code = code;
- luaScript.failedReason = "generating code... (" + code.length() + ")";
- }
-
- @Override
- public void onError(Exception e) {
- Utility.sendClientNotify("Fetching AI error");
- }
-
- @Override
- public void onFinish(String string) throws FileException {
- FileUtils.saveFile("plugins/" + fileName + ".lua", luaScript.rawLua.code);
- luaScript.failedReason = "";
- LuaManager.hotswap();
- }
- });
- } else {
- for (String arg : args) {
- sb.append(arg);
- }
- FPSMaster.async.execute(() -> {
- ArrayList messages = new ArrayList<>();
- messages.add(new OpenAIClient.Message("system", "your name is Ares"));
- messages.add(new OpenAIClient.Message("user", sb.toString()));
- Utility.sendClientNotify("Fetching AI response...");
- try {
- String response = OpenAIClient.getChatResponse(messages);
- Utility.sendClientNotify("[AI] " + response);
- } catch (IOException e) {
- Utility.sendClientNotify("[AI] failed to fetch AI response.");
- }
- return null;
- });
- }
- }
- }
-}
diff --git a/shared/java/top/fpsmaster/features/command/impl/IRCChat.java b/shared/java/top/fpsmaster/features/command/impl/IRCChat.java
deleted file mode 100644
index d9a6cde3..00000000
--- a/shared/java/top/fpsmaster/features/command/impl/IRCChat.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package top.fpsmaster.features.command.impl;
-
-import net.minecraft.client.network.NetworkPlayerInfo;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.features.command.Command;
-import top.fpsmaster.features.impl.utility.IRC;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.modules.account.AccountManager;
-import top.fpsmaster.utils.Utility;
-
-import static top.fpsmaster.utils.Utility.mc;
-
-public class IRCChat extends Command {
-
- public IRCChat() {
- super("irc");
- }
-
- @Override
- public void execute(String[] args) {
- if (!IRC.using) {
- Utility.sendClientNotify("IRC is not using");
- return;
- }
- if (args.length > 0) {
- StringBuilder sb = new StringBuilder();
-
- if ("cmd".equals(args[0])) {
- for (int i = 1; i < args.length; i++) {
- if (i == args.length - 1) {
- sb.append(args[i]);
- } else {
- sb.append(args[i]).append(" ");
- }
- }
- String message = sb.toString();
- FPSMaster.INSTANCE.wsClient.sendCommand(message);
- } else if ("dm".equals(args[0])) {
- for (int i = 2; i < args.length; i++) {
- if (i == args.length - 1) {
- sb.append(args[i]);
- } else {
- sb.append(args[i]).append(" ");
- }
- }
- String message = sb.toString();
- FPSMaster.INSTANCE.wsClient.sendDM(args[1], message);
- } else if ("update".equals(args[0])) {
- FPSMaster.INSTANCE.wsClient.sendInformation(AccountManager.skin, AccountManager.cosmeticsUsing, MinecraftAPI.client().getPlayer().getName(), MinecraftAPI.client().getServerAddress());
- } else if ("fetch".equals(args[0])) {
- for (NetworkPlayerInfo networkPlayerInfo : mc.getNetHandler().getPlayerInfoMap()) {
- FPSMaster.INSTANCE.wsClient.fetchPlayer(networkPlayerInfo.getGameProfile().getId().toString(), networkPlayerInfo.getGameProfile().getName());
- }
- } else {
- for (String arg : args) {
- if (arg.equals(args[args.length - 1])) {
- sb.append(arg);
- } else {
- sb.append(arg).append(" ");
- }
- }
- String message = sb.toString();
- FPSMaster.INSTANCE.wsClient.sendMessage(message);
- }
- } else {
- Utility.sendClientMessage("Usage: #irc ");
- }
- }
-}
diff --git a/shared/java/top/fpsmaster/features/command/impl/TestNewAPICommand.java b/shared/java/top/fpsmaster/features/command/impl/TestNewAPICommand.java
deleted file mode 100644
index 06928724..00000000
--- a/shared/java/top/fpsmaster/features/command/impl/TestNewAPICommand.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package top.fpsmaster.features.command.impl;
-
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.domain.client.IClientPlayer;
-import top.fpsmaster.api.domain.client.IGameSettings;
-import top.fpsmaster.api.domain.client.IItemStack;
-import top.fpsmaster.api.domain.render.IRenderManager;
-import top.fpsmaster.api.domain.world.IWorld;
-import top.fpsmaster.api.model.BlockPos;
-import top.fpsmaster.api.model.Vec3;
-import top.fpsmaster.api.model.WeatherType;
-import top.fpsmaster.features.command.Command;
-
-/**
- * 测试新 API 的命令
- * 使用方法: #testnewapi
- */
-public class TestNewAPICommand extends Command {
-
- public TestNewAPICommand() {
- super("testnewapi");
- }
-
- @Override
- public void execute(String[] args) {
- printMessage("§a========== 测试新 API ==========");
-
- // 测试客户端 API
- testClientAPI();
-
- // 测试世界 API
- testWorldAPI();
-
- // 测试渲染 API
- testRenderAPI();
-
- // 测试设置 API
- testSettingsAPI();
-
- // 测试粒子效果
- testParticles();
-
- // 测试光照系统
- testLightLevel();
-
- // 测试实体 API
- testEntityAPI();
-
- printMessage("§a========== 测试完成 ==========");
- }
-
- private void testClientAPI() {
- printMessage("§e[客户端 API 测试]");
-
- IClientPlayer player = MinecraftAPI.client().getPlayer();
- if (player == null) {
- printMessage("§c玩家为 null(未加入世界)");
- return;
- }
-
- // 测试玩家基本信息
- String name = player.getName();
- Vec3 pos = player.getPosition();
- float health = player.getHealth();
- float maxHealth = player.getMaxHealth();
- int foodLevel = player.getFoodLevel();
- int ping = player.getPing();
-
- printMessage(String.format("§7玩家: §f%s", name));
- printMessage(String.format("§7位置: §f%.2f, %.2f, %.2f", pos.x, pos.y, pos.z));
- printMessage(String.format("§7生命值: §f%.1f/%.1f", health, maxHealth));
- printMessage(String.format("§7饥饿值: §f%d", foodLevel));
- printMessage(String.format("§7延迟: §f%dms", ping));
- printMessage(String.format("§7在地面: §f%s", player.isOnGround()));
- printMessage(String.format("§7潜行: §f%s", player.isSneaking()));
- printMessage(String.format("§7疾跑: §f%s", player.isSprinting()));
-
- // 测试物品
- IItemStack heldItem = player.getHeldItem();
- if (heldItem != null && !heldItem.isEmpty()) {
- printMessage(String.format("§7手持物品: §f%s x%d",
- heldItem.getDisplayName(), heldItem.getCount()));
- printMessage(String.format("§7物品ID: §f%s", heldItem.getItemId()));
- if (heldItem.isEnchanted()) {
- printMessage(String.format("§7附魔: §f%s", heldItem.getEnchantments()));
- }
- } else {
- printMessage("§7手持物品: §f空");
- }
-
- // 测试护甲
- java.util.List armor = player.getArmorItems();
- printMessage(String.format("§7护甲装备: §f%d件",
- armor.stream().filter(a -> a != null && !a.isEmpty()).count()));
- }
-
- private void testWorldAPI() {
- printMessage("§e[世界 API 测试]");
-
- IWorld world = MinecraftAPI.world().getWorld();
- if (world == null) {
- printMessage("§c世界为 null");
- return;
- }
-
- String worldName = world.getWorldName();
- long worldTime = world.getWorldTime();
- BlockPos spawnPoint = world.getSpawnPoint();
- WeatherType weather = world.getWeatherType();
-
- printMessage(String.format("§7世界名称: §f%s", worldName));
- printMessage(String.format("§7世界时间: §f%d", worldTime));
- printMessage(String.format("§7出生点: §f%d, %d, %d",
- spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ()));
- printMessage(String.format("§7天气: §f%s", weather));
-
- // 测试方块检测
- IClientPlayer player = MinecraftAPI.client().getPlayer();
- if (player != null) {
- Vec3 pos = player.getPosition();
- BlockPos playerPos = new BlockPos((int)pos.x, (int)pos.y, (int)pos.z);
- BlockPos feetPos = playerPos.down();
-
- String blockId = world.getBlockId(feetPos);
- boolean isAir = world.isAirBlock(feetPos);
-
- printMessage(String.format("§7脚下方块: §f%s", blockId));
- printMessage(String.format("§7是否为空气: §f%s", isAir));
- }
- }
-
- private void testRenderAPI() {
- printMessage("§e[渲染 API 测试]");
-
- IRenderManager rm = MinecraftAPI.render().getRenderManager();
- float partialTicks = MinecraftAPI.render().getPartialTicks();
-
- printMessage(String.format("§7渲染偏移: §f%.2f, %.2f, %.2f",
- rm.getRenderPosX(), rm.getRenderPosY(), rm.getRenderPosZ()));
- printMessage(String.format("§7部分刻: §f%.3f", partialTicks));
- }
-
- private void testSettingsAPI() {
- printMessage("§e[设置 API 测试]");
-
- IGameSettings settings = MinecraftAPI.client().getSettings();
-
- printMessage(String.format("§7视距: §f%d 区块", settings.getRenderDistance()));
- printMessage(String.format("§7鼠标灵敏度: §f%.2f", settings.getMouseSensitivity()));
- printMessage(String.format("§7GUI 缩放: §f%d", settings.getGuiScale()));
- printMessage(String.format("§7FOV: §f%.0f", settings.getFov()));
- printMessage(String.format("§7VSync: §f%s", settings.isVsyncEnabled()));
- printMessage(String.format("§7帧率限制: §f%d", settings.getFramerateLimit()));
- printMessage(String.format("§7调试信息: §f%s", settings.isShowDebugInfo()));
- }
-
- private void testParticles() {
- printMessage("§e[粒子效果测试]");
-
- IClientPlayer player = MinecraftAPI.client().getPlayer();
- if (player == null) {
- printMessage("§c玩家为 null");
- return;
- }
-
- Vec3 pos = player.getPosition();
- BlockPos particlePos = new BlockPos((int)pos.x, (int)pos.y + 2, (int)pos.z);
-
- // 添加红石粒子效果
- MinecraftAPI.render().getParticleManager().addRedstoneBreakParticle(particlePos);
- printMessage("§7已在头顶生成红石破碎粒子");
- }
-
- private void testLightLevel() {
- printMessage("§e[光照系统测试]");
-
- IClientPlayer player = MinecraftAPI.client().getPlayer();
- IWorld world = MinecraftAPI.world().getWorld();
-
- if (player == null || world == null) {
- printMessage("§c玩家或世界为 null");
- return;
- }
-
- Vec3 pos = player.getPosition();
- BlockPos playerPos = new BlockPos((int)pos.x, (int)pos.y, (int)pos.z);
-
- int lightLevel = world.getLightLevel(playerPos);
- int skyLight = world.getSkyLightLevel(playerPos);
- int blockLight = world.getBlockLightLevel(playerPos);
- float rainStrength = world.getRainStrength();
-
- printMessage(String.format("§7总光照: §f%d", lightLevel));
- printMessage(String.format("§7天空光照: §f%d", skyLight));
- printMessage(String.format("§7方块光照: §f%d", blockLight));
- printMessage(String.format("§7雨强度: §f%.2f", rainStrength));
- }
-
- private void testEntityAPI() {
- printMessage("§e[实体 API 测试]");
-
- // 获取所有实体
- java.util.List allEntities = MinecraftAPI.entity().getAllEntities();
- printMessage(String.format("§7总实体数: §f%d", allEntities.size()));
-
- // 获取附近的实体 (10格内)
- java.util.List nearbyEntities = MinecraftAPI.entity().getNearbyEntities(10.0);
- printMessage(String.format("§710格内实体数: §f%d", nearbyEntities.size()));
-
- // 显示最近3个附近实体的信息
- int count = 0;
- for (top.fpsmaster.api.domain.entity.IEntity entity : nearbyEntities) {
- if (count >= 3) break;
-
- Vec3 ePos = entity.getPosition();
- printMessage(String.format("§7 - %s (ID: %d) 位置: %.1f, %.1f, %.1f",
- entity.getName(), entity.getEntityId(), ePos.x, ePos.y, ePos.z));
- count++;
- }
- }
-
- private void printMessage(String message) {
- MinecraftAPI.gui().getGuiIngame().printChatMessage(message);
- }
-}
diff --git a/shared/java/top/fpsmaster/features/impl/interfaces/BetterChat.java b/shared/java/top/fpsmaster/features/impl/interfaces/BetterChat.java
index b99718ca..cfeb708f 100644
--- a/shared/java/top/fpsmaster/features/impl/interfaces/BetterChat.java
+++ b/shared/java/top/fpsmaster/features/impl/interfaces/BetterChat.java
@@ -1,6 +1,7 @@
package top.fpsmaster.features.impl.interfaces;
import net.minecraft.client.gui.ChatLine;
+import net.minecraft.client.gui.GuiNewChat;
import net.minecraft.event.ClickEvent;
import net.minecraft.event.HoverEvent;
import net.minecraft.network.play.server.S02PacketChat;
@@ -12,7 +13,6 @@
import top.fpsmaster.features.impl.InterfaceModule;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.settings.impl.BooleanSetting;
-import top.fpsmaster.api.provider.gui.IGuiNewChatProvider;
import static top.fpsmaster.utils.Utility.mc;
@@ -22,6 +22,8 @@ public class BetterChat extends InterfaceModule {
private final BooleanSetting copyMessage = new BooleanSetting("CopyMessage", false);
private IChatComponent lastMessage = null;
private int counter = 1;
+ private static java.lang.reflect.Field chatLinesField;
+ private static java.lang.reflect.Field drawnChatLinesField;
public BetterChat() {
@@ -50,19 +52,25 @@ public void onChat(EventPacket e) {
.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "\u0000#COPY" + ((S02PacketChat) e.packet).getChatComponent().getUnformattedText()))
.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(FPSMaster.i18n.get("copy.hover"))));
if (foldMessage.getValue()) {
- IGuiNewChatProvider chatProvider = (IGuiNewChatProvider) mc.ingameGUI.getChatGUI();
- if (chatProvider.getDrawnChatLines().isEmpty()) {
+ GuiNewChat chatProvider = mc.ingameGUI.getChatGUI();
+ java.util.List drawnChatLines = getDrawnChatLines(chatProvider);
+ java.util.List chatLines = getChatLines(chatProvider);
+ if (drawnChatLines.isEmpty()) {
counter = 1;
lastMessage = packet.getChatComponent().createCopy();
} else if (lastMessage.equals(packet.getChatComponent())) {
- ChatLine c = chatProvider.getDrawnChatLines().get(0);
+ ChatLine c = drawnChatLines.get(0);
IChatComponent chatComponent = lastMessage.createCopy().appendSibling(new ChatComponentText("\247r\247f [x" + ++counter + "]"));
if (copyMessage.getValue()) {
chatComponent.appendSibling(copyText);
}
c = new ChatLine(c.getUpdatedCounter(), chatComponent, c.getChatLineID());
- chatProvider.getChatLines().set(0, c);
- chatProvider.getDrawnChatLines().set(0, c);
+ if (!chatLines.isEmpty()) {
+ chatLines.set(0, c);
+ }
+ if (!drawnChatLines.isEmpty()) {
+ drawnChatLines.set(0, c);
+ }
e.cancel();
return;
} else {
@@ -75,4 +83,28 @@ public void onChat(EventPacket e) {
}
}
}
+
+ private static java.util.List getChatLines(GuiNewChat chat) {
+ try {
+ if (chatLinesField == null) {
+ chatLinesField = GuiNewChat.class.getDeclaredField("chatLines");
+ chatLinesField.setAccessible(true);
+ }
+ return (java.util.List) chatLinesField.get(chat);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ return new java.util.ArrayList<>();
+ }
+ }
+
+ private static java.util.List getDrawnChatLines(GuiNewChat chat) {
+ try {
+ if (drawnChatLinesField == null) {
+ drawnChatLinesField = GuiNewChat.class.getDeclaredField("drawnChatLines");
+ drawnChatLinesField.setAccessible(true);
+ }
+ return (java.util.List) drawnChatLinesField.get(chat);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ return new java.util.ArrayList<>();
+ }
+ }
}
diff --git a/shared/java/top/fpsmaster/features/impl/interfaces/ComboDisplay.java b/shared/java/top/fpsmaster/features/impl/interfaces/ComboDisplay.java
index 3d21f711..8a6766c7 100644
--- a/shared/java/top/fpsmaster/features/impl/interfaces/ComboDisplay.java
+++ b/shared/java/top/fpsmaster/features/impl/interfaces/ComboDisplay.java
@@ -7,8 +7,6 @@
import top.fpsmaster.features.impl.InterfaceModule;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.settings.impl.ColorSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
import java.awt.*;
@@ -26,11 +24,9 @@ public ComboDisplay() {
@Subscribe
public void onTick(EventTick e) {
- if (MinecraftAPI.client().getPlayer() == null) return;
-
- // Use raw player for combat mechanics
- net.minecraft.entity.player.EntityPlayer rawPlayer =
- (net.minecraft.entity.player.EntityPlayer) MinecraftAPI.client().getPlayer().getRawPlayer();
+ if (net.minecraft.client.Minecraft.getMinecraft().thePlayer == null) return;
+ net.minecraft.entity.player.EntityPlayer rawPlayer =
+ net.minecraft.client.Minecraft.getMinecraft().thePlayer;
if (rawPlayer.hurtTime == 1 || (target != null && rawPlayer.getDistanceToEntity(target) > 7)) {
combo = 0;
diff --git a/shared/java/top/fpsmaster/features/impl/interfaces/LyricsDisplay.java b/shared/java/top/fpsmaster/features/impl/interfaces/LyricsDisplay.java
deleted file mode 100644
index 4158139f..00000000
--- a/shared/java/top/fpsmaster/features/impl/interfaces/LyricsDisplay.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package top.fpsmaster.features.impl.interfaces;
-
-import top.fpsmaster.features.impl.InterfaceModule;
-import top.fpsmaster.features.manager.Category;
-import top.fpsmaster.features.settings.impl.BooleanSetting;
-import top.fpsmaster.features.settings.impl.ColorSetting;
-
-import java.awt.*;
-
-public class LyricsDisplay extends InterfaceModule {
- public static ColorSetting textColor = new ColorSetting("TextColor", new Color(255, 255, 255));
- public static ColorSetting textBG = new ColorSetting("TextColorBG", new Color(255, 255, 255));
- public BooleanSetting scale = new BooleanSetting("Scale", true);
-
- public LyricsDisplay() {
- super("LyricsDisplay", Category.Interface);
- addSettings(backgroundColor, rounded, betterFont, textColor, textBG, bg, rounded, roundRadius, scale);
- }
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/features/impl/interfaces/MusicOverlay.java b/shared/java/top/fpsmaster/features/impl/interfaces/MusicOverlay.java
deleted file mode 100644
index a9f91f1b..00000000
--- a/shared/java/top/fpsmaster/features/impl/interfaces/MusicOverlay.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package top.fpsmaster.features.impl.interfaces;
-
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.event.Subscribe;
-import top.fpsmaster.event.events.EventRender2D;
-import top.fpsmaster.features.impl.InterfaceModule;
-import top.fpsmaster.features.manager.Category;
-import top.fpsmaster.features.settings.impl.ColorSetting;
-import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.modules.music.IngameOverlay;
-import top.fpsmaster.modules.music.JLayerHelper;
-import top.fpsmaster.utils.math.MathTimer;
-
-import java.awt.*;
-
-public class MusicOverlay extends InterfaceModule {
- public static final NumberSetting amplitude = new NumberSetting("Amplitude", 10, 0, 10, 0.1);
- public static final ColorSetting progressColor = new ColorSetting("ProgressColor", new Color(255, 255, 255, 100));
- public static final ColorSetting color = new ColorSetting("Visual", new Color(255, 255, 255, 100));
-
- private final MathTimer timer = new MathTimer();
-
- public MusicOverlay() {
- super("MusicDisplay", Category.Interface);
- addSettings(amplitude, progressColor, color, betterFont, fontShadow);
- }
-
- Thread updateThread = new Thread(JLayerHelper::updateLoudness);
-
- @Subscribe
- public void onRender(EventRender2D e) {
- if (timer.delay(50) && !updateThread.isAlive()) {
- updateThread = new Thread(JLayerHelper::updateLoudness);
- updateThread.start();
- }
- IngameOverlay.onRender();
- }
-}
diff --git a/shared/java/top/fpsmaster/features/impl/interfaces/ReachDisplay.java b/shared/java/top/fpsmaster/features/impl/interfaces/ReachDisplay.java
index 0b9c0a91..defd4c3a 100644
--- a/shared/java/top/fpsmaster/features/impl/interfaces/ReachDisplay.java
+++ b/shared/java/top/fpsmaster/features/impl/interfaces/ReachDisplay.java
@@ -1,20 +1,11 @@
package top.fpsmaster.features.impl.interfaces;
-import com.google.common.base.Predicates;
import net.minecraft.entity.Entity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EntitySelectors;
-import net.minecraft.util.MovingObjectPosition;
-import net.minecraft.util.Vec3;
import top.fpsmaster.event.Subscribe;
import top.fpsmaster.event.events.EventAttack;
import top.fpsmaster.features.impl.InterfaceModule;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.settings.impl.ColorSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.wrapper.util.WrapperAxisAlignedBB;
-import top.fpsmaster.wrapper.util.WrapperVec3;
import java.awt.*;
import java.util.List;
@@ -34,7 +25,7 @@ public ReachDisplay() {
@Subscribe
public void onAttack(EventAttack e) {
Entity entity = mc.getRenderViewEntity();
- if (entity != null && MinecraftAPI.world().getWorld() != null) {
+ if (entity != null && mc.theWorld != null) {
if (mc.objectMouseOver == null || mc.objectMouseOver.entityHit == null)
return;
reach = Double.parseDouble(String.format("%.2f", distance));
diff --git a/shared/java/top/fpsmaster/features/impl/interfaces/TargetDisplay.java b/shared/java/top/fpsmaster/features/impl/interfaces/TargetDisplay.java
index 5c7374a5..1764097b 100644
--- a/shared/java/top/fpsmaster/features/impl/interfaces/TargetDisplay.java
+++ b/shared/java/top/fpsmaster/features/impl/interfaces/TargetDisplay.java
@@ -1,5 +1,6 @@
package top.fpsmaster.features.impl.interfaces;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,8 +13,8 @@
import top.fpsmaster.features.settings.impl.BooleanSetting;
import top.fpsmaster.features.settings.impl.ColorSetting;
import top.fpsmaster.features.settings.impl.ModeSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
+import top.fpsmaster.forge.api.IMinecraft;
+import top.fpsmaster.forge.api.IRenderManager;
import java.awt.*;
@@ -55,9 +56,12 @@ private void drawCircle(Entity entity, double rad, boolean shade) {
if (shade) GL11.glShadeModel(GL11.GL_SMOOTH);
GlStateManager.disableCull();
GL11.glBegin(GL11.GL_TRIANGLE_STRIP);
- double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * MinecraftAPI.render().getPartialTicks() - MinecraftAPI.render().getRenderManager().getRenderPosX();
- double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * MinecraftAPI.render().getPartialTicks() - MinecraftAPI.render().getRenderManager().getRenderPosY() + Math.sin(System.currentTimeMillis() / 2E+2) + 1;
- double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * MinecraftAPI.render().getPartialTicks() - MinecraftAPI.render().getRenderManager().getRenderPosZ();
+ Minecraft mc = Minecraft.getMinecraft();
+ float partialTicks = ((IMinecraft) mc).arch$getTimer().renderPartialTicks;
+ IRenderManager renderManager = (IRenderManager) mc.getRenderManager();
+ double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - renderManager.renderPosX();
+ double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - renderManager.renderPosY() + Math.sin(System.currentTimeMillis() / 2E+2) + 1;
+ double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks - renderManager.renderPosZ();
Color c;
GL11.glColor4f(1f, 0f, 0f, 0f);
float i = 0f;
diff --git a/shared/java/top/fpsmaster/features/impl/optimizes/NoHitDelay.java b/shared/java/top/fpsmaster/features/impl/optimizes/NoHitDelay.java
index 8d172274..3a05b764 100644
--- a/shared/java/top/fpsmaster/features/impl/optimizes/NoHitDelay.java
+++ b/shared/java/top/fpsmaster/features/impl/optimizes/NoHitDelay.java
@@ -1,6 +1,8 @@
package top.fpsmaster.features.impl.optimizes;
-import top.fpsmaster.api.MinecraftAPI;
+import net.minecraft.client.Minecraft;
+
+import java.lang.reflect.Field;
import top.fpsmaster.event.Subscribe;
import top.fpsmaster.event.events.EventTick;
import top.fpsmaster.features.manager.Category;
@@ -28,7 +30,16 @@ public void onDisable() {
@Subscribe
public void onTick(EventTick e) {
- MinecraftAPI.client().removeClickDelay();
+ resetClickDelay();
+ }
+
+ private void resetClickDelay() {
+ try {
+ Field field = Minecraft.class.getDeclaredField("leftClickCounter");
+ field.setAccessible(true);
+ field.setInt(Minecraft.getMinecraft(), 0);
+ } catch (NoSuchFieldException | IllegalAccessException ignored) {
+ }
}
public static boolean isUsing() {
diff --git a/shared/java/top/fpsmaster/features/impl/optimizes/Performance.java b/shared/java/top/fpsmaster/features/impl/optimizes/Performance.java
index bf093ade..184fc977 100644
--- a/shared/java/top/fpsmaster/features/impl/optimizes/Performance.java
+++ b/shared/java/top/fpsmaster/features/impl/optimizes/Performance.java
@@ -6,7 +6,6 @@
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.BooleanSetting;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.wrapper.mods.WrapperPerformance;
import java.util.ArrayList;
@@ -64,7 +63,7 @@ public static void setUsing(boolean using) {
}
public static boolean isVisible(CheckEntity entity) {
- return WrapperPerformance.isVisible(entity);
+ return true;
}
public static boolean isVisible(
@@ -72,6 +71,6 @@ public static boolean isVisible(
double minX, double minY, double minZ,
double maxX, double maxY, double maxZ,
double cameraX, double cameraY, double cameraZ) {
- return WrapperPerformance.isVisible(world, minX, minY, minZ, maxX, maxY, maxZ, cameraX, cameraY, cameraZ);
+ return true;
}
}
diff --git a/shared/java/top/fpsmaster/features/impl/render/BlockOverlay.java b/shared/java/top/fpsmaster/features/impl/render/BlockOverlay.java
index 45aa2397..67a8a17d 100644
--- a/shared/java/top/fpsmaster/features/impl/render/BlockOverlay.java
+++ b/shared/java/top/fpsmaster/features/impl/render/BlockOverlay.java
@@ -6,6 +6,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.BlockPos;
import org.lwjgl.opengl.GL11;
import top.fpsmaster.event.Subscribe;
import top.fpsmaster.event.events.EventRender3D;
@@ -14,11 +15,7 @@
import top.fpsmaster.features.settings.impl.BooleanSetting;
import top.fpsmaster.features.settings.impl.ColorSetting;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.utils.render.Render3DUtils;
-import top.fpsmaster.wrapper.blockpos.WrapperBlockPos;
-import top.fpsmaster.wrapper.util.WrapperAxisAlignedBB;
import java.awt.*;
@@ -52,13 +49,9 @@ public void onDisable() {
public void onRender3D(EventRender3D e) {
if (Minecraft.getMinecraft().objectMouseOver != null) {
// Use raw world for block state access
- if (MinecraftAPI.world().getWorld() != null && Minecraft.getMinecraft().objectMouseOver != null) {
- // Get raw world through casting (this is a bridge pattern)
- Object rawWorldObj = MinecraftAPI.world().getWorld().getRawWorld();
- net.minecraft.client.multiplayer.WorldClient rawWorld = (net.minecraft.client.multiplayer.WorldClient) rawWorldObj;
-
- net.minecraft.util.BlockPos mcPos = Minecraft.getMinecraft().objectMouseOver.getBlockPos();
- IBlockState state = rawWorld.getBlockState(mcPos);
+ if (Minecraft.getMinecraft().theWorld != null && Minecraft.getMinecraft().objectMouseOver != null) {
+ BlockPos mcPos = Minecraft.getMinecraft().objectMouseOver.getBlockPos();
+ IBlockState state = Minecraft.getMinecraft().theWorld.getBlockState(mcPos);
Block block = state.getBlock();
if (!block.getMaterial().isReplaceable()) {
@@ -75,11 +68,17 @@ public void onRender3D(EventRender3D e) {
GL11.glDisable(2929);
}
GL11.glDepthMask(false);
- WrapperAxisAlignedBB blockBoundingBox = new WrapperAxisAlignedBB(block.getBlockBoundsMinX(), block.getBlockBoundsMinY(), block.getBlockBoundsMinZ(),
- block.getBlockBoundsMaxX(), block.getBlockBoundsMaxY(), block.getBlockBoundsMaxZ());
- double minX = block instanceof BlockStairs ? 0.0 : blockBoundingBox.minX();
- double minY = block instanceof BlockStairs ? 0.0 : blockBoundingBox.minY();
- double minZ = block instanceof BlockStairs ? 0.0 : blockBoundingBox.minZ();
+ AxisAlignedBB blockBoundingBox = new AxisAlignedBB(
+ block.getBlockBoundsMinX(),
+ block.getBlockBoundsMinY(),
+ block.getBlockBoundsMinZ(),
+ block.getBlockBoundsMaxX(),
+ block.getBlockBoundsMaxY(),
+ block.getBlockBoundsMaxZ()
+ );
+ double minX = block instanceof BlockStairs ? 0.0 : blockBoundingBox.minX;
+ double minY = block instanceof BlockStairs ? 0.0 : blockBoundingBox.minY;
+ double minZ = block instanceof BlockStairs ? 0.0 : blockBoundingBox.minZ;
if (fill.getValue()) {
Color color = color1.getValue().getColor();
GL11.glPushMatrix();
@@ -90,13 +89,13 @@ public void onRender3D(EventRender3D e) {
color.getAlpha() / 255.0f
);
Render3DUtils.drawBoundingBox(
- new WrapperAxisAlignedBB(
+ new AxisAlignedBB(
x + minX - 0.01,
y + minY - 0.01,
z + minZ - 0.01,
- x + blockBoundingBox.maxX() + 0.01,
- y + blockBoundingBox.maxY() + 0.01,
- z + blockBoundingBox.maxZ() + 0.01
+ x + blockBoundingBox.maxX + 0.01,
+ y + blockBoundingBox.maxY + 0.01,
+ z + blockBoundingBox.maxZ + 0.01
)
);
GL11.glPopMatrix();
@@ -112,13 +111,13 @@ public void onRender3D(EventRender3D e) {
);
GL11.glLineWidth(width.getValue().floatValue());
Render3DUtils.drawBoundingBoxOutline(
- new WrapperAxisAlignedBB(
+ new AxisAlignedBB(
x + minX - 0.005,
y + minY - 0.005,
z + minZ - 0.005,
- x + blockBoundingBox.maxX() + 0.005,
- y + blockBoundingBox.maxY() + 0.005,
- z + blockBoundingBox.maxZ() + 0.005
+ x + blockBoundingBox.maxX + 0.005,
+ y + blockBoundingBox.maxY + 0.005,
+ z + blockBoundingBox.maxZ + 0.005
)
);
GL11.glPopMatrix();
diff --git a/shared/java/top/fpsmaster/features/impl/render/Crosshair.java b/shared/java/top/fpsmaster/features/impl/render/Crosshair.java
index 176155ea..28c7d788 100644
--- a/shared/java/top/fpsmaster/features/impl/render/Crosshair.java
+++ b/shared/java/top/fpsmaster/features/impl/render/Crosshair.java
@@ -13,8 +13,6 @@
import top.fpsmaster.features.settings.impl.BooleanSetting;
import top.fpsmaster.features.settings.impl.ColorSetting;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.utils.math.animation.AnimationUtils;
import top.fpsmaster.utils.render.Render2DUtils;
@@ -123,14 +121,14 @@ private boolean isEnemy(Object entity) {
}
private boolean isTeammate(EntityPlayer e) {
- if (MinecraftAPI.client().getPlayer() == null) return false;
- EntityPlayer player = (EntityPlayer) MinecraftAPI.client().getPlayer().getRawPlayer();
+ if (Minecraft.getMinecraft().thePlayer == null) return false;
+ EntityPlayer player = Minecraft.getMinecraft().thePlayer;
return player != null && e.getTeam() != null && e.getTeam().isSameTeam(player.getTeam());
}
private boolean isMoving() {
- if (MinecraftAPI.client().getPlayer() == null) return false;
- EntityPlayer player = (EntityPlayer) MinecraftAPI.client().getPlayer().getRawPlayer();
+ if (Minecraft.getMinecraft().thePlayer == null) return false;
+ EntityPlayer player = Minecraft.getMinecraft().thePlayer;
return player != null && player.isSprinting();
}
diff --git a/shared/java/top/fpsmaster/features/impl/render/DamageIndicator.java b/shared/java/top/fpsmaster/features/impl/render/DamageIndicator.java
index 54f36001..7880021c 100644
--- a/shared/java/top/fpsmaster/features/impl/render/DamageIndicator.java
+++ b/shared/java/top/fpsmaster/features/impl/render/DamageIndicator.java
@@ -10,8 +10,7 @@
import top.fpsmaster.event.events.EventUpdate;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
+import top.fpsmaster.forge.api.IRenderManager;
import top.fpsmaster.utils.math.MathTimer;
import java.awt.*;
@@ -83,16 +82,16 @@ public void doRender(Damage indicator) {
GlStateManager.enableBlend();
GL11.glBlendFunc(770, 771);
GL11.glDisable(3553);
- float partialTicks = MinecraftAPI.render().getPartialTicks();
- double x = indicator.x + 1 - MinecraftAPI.render().getRenderManager().getRenderPosX();
- double y = indicator.y - MinecraftAPI.render().getRenderManager().getRenderPosY() + 1;
- double z = indicator.z + 1 - MinecraftAPI.render().getRenderManager().getRenderPosZ();
+ IRenderManager renderManager = (IRenderManager) mc.getRenderManager();
+ double x = indicator.x + 1 - renderManager.renderPosX();
+ double y = indicator.y - renderManager.renderPosY() + 1;
+ double z = indicator.z + 1 - renderManager.renderPosZ();
float scale = 0.065f;
GlStateManager.translate(x, y + 1 + 0.5f - 1 / 2.0f, z);
GL11.glNormal3f(0.0f, 1.0f, 0.0f);
GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0f, 1.0f, 0.0f);
GL11.glScalef(-scale / 2, -scale, -scale);
- float width = ((net.minecraft.client.gui.FontRenderer)MinecraftAPI.client().getMinecraft().getFontRenderer()).getStringWidth(damage) / 2.0f;
+ float width = mc.fontRendererObj.getStringWidth(damage) / 2.0f;
GlStateManager.disableDepth();
GlStateManager.disableBlend();
GlStateManager.disableLighting();
@@ -107,7 +106,7 @@ public void doRender(Damage indicator) {
GL11.glDisable(3042);
GL11.glDisable(2848);
GlStateManager.enableBlend();
- ((net.minecraft.client.gui.FontRenderer)MinecraftAPI.client().getMinecraft().getFontRenderer()).drawStringWithShadow(damage, -width + 5, indicator.animation * 10, color.getRGB());
+ mc.fontRendererObj.drawStringWithShadow(damage, -width + 5, indicator.animation * 10, color.getRGB());
GlStateManager.enableLighting();
GlStateManager.enableDepth();
GlStateManager.disableBlend();
@@ -133,4 +132,4 @@ public Damage(float damage, float x, float y, float z, float animation) {
this.animation = animation;
}
}
-}
\ No newline at end of file
+}
diff --git a/shared/java/top/fpsmaster/features/impl/render/DragonWings.java b/shared/java/top/fpsmaster/features/impl/render/DragonWings.java
index f9a9a1a3..cb1feceb 100644
--- a/shared/java/top/fpsmaster/features/impl/render/DragonWings.java
+++ b/shared/java/top/fpsmaster/features/impl/render/DragonWings.java
@@ -15,8 +15,6 @@
import top.fpsmaster.features.settings.impl.BooleanSetting;
import top.fpsmaster.features.settings.impl.ColorSetting;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
import java.awt.*;
@@ -98,7 +96,7 @@ public RenderWings() {
public void onRenderPlayer(EventRender3D event) {
EntityPlayer player;
- player = (EntityPlayer) MinecraftAPI.client().getPlayer().getRawPlayer();
+ player = Minecraft.getMinecraft().thePlayer;
if (player == null)
return;
if (!player.isInvisible() && mc.gameSettings.thirdPersonView != 0) // Should render wings onto this player?
@@ -155,4 +153,4 @@ private float interpolate(float yaw1, float yaw2, float percent) {
return f;
}
}
-}
\ No newline at end of file
+}
diff --git a/shared/java/top/fpsmaster/features/impl/render/FreeLook.java b/shared/java/top/fpsmaster/features/impl/render/FreeLook.java
index 937057a2..a8470d1c 100644
--- a/shared/java/top/fpsmaster/features/impl/render/FreeLook.java
+++ b/shared/java/top/fpsmaster/features/impl/render/FreeLook.java
@@ -2,14 +2,12 @@
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.Display;
import top.fpsmaster.event.Subscribe;
import top.fpsmaster.event.events.EventRender3D;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.BindSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.wrapper.mods.WrapperFreeLook;
public class FreeLook extends Module {
private final BindSetting bind = new BindSetting("bind", Keyboard.KEY_LMENU);
@@ -36,11 +34,11 @@ public void onRender3D(EventRender3D e) {
if (Minecraft.getMinecraft().currentScreen != null) return;
if (!perspectiveToggled) {
- if (Keyboard.isKeyDown(bind.getValue())) {
- perspectiveToggled = true;
- if (MinecraftAPI.client().getPlayer() != null) {
- cameraYaw = MinecraftAPI.client().getPlayer().getYaw();
- cameraPitch = MinecraftAPI.client().getPlayer().getPitch();
+ if (Keyboard.isKeyDown(bind.getValue())) {
+ perspectiveToggled = true;
+ if (Minecraft.getMinecraft().thePlayer != null) {
+ cameraYaw = Minecraft.getMinecraft().thePlayer.rotationYaw;
+ cameraPitch = Minecraft.getMinecraft().thePlayer.rotationPitch;
}
previousPerspective = Minecraft.getMinecraft().gameSettings.hideGUI;
Minecraft.getMinecraft().gameSettings.thirdPersonView = 1;
@@ -58,22 +56,41 @@ public void onRender3D(EventRender3D e) {
private static boolean previousPerspective = false;
public static float getCameraYaw() {
- return WrapperFreeLook.getCameraYaw();
+ return perspectiveToggled ? cameraYaw : Minecraft.getMinecraft().getRenderViewEntity().rotationYaw;
}
public static float getCameraPitch() {
- return WrapperFreeLook.getCameraPitch();
+ return perspectiveToggled ? cameraPitch : Minecraft.getMinecraft().getRenderViewEntity().rotationPitch;
}
public static float getCameraPrevYaw() {
- return WrapperFreeLook.getCameraPrevYaw();
+ return perspectiveToggled ? cameraYaw : Minecraft.getMinecraft().getRenderViewEntity().prevRotationYaw;
}
public static float getCameraPrevPitch() {
- return WrapperFreeLook.getCameraPrevPitch();
+ return perspectiveToggled ? cameraPitch : Minecraft.getMinecraft().getRenderViewEntity().prevRotationPitch;
}
public static boolean overrideMouse() {
- return WrapperFreeLook.overrideMouse();
+ Minecraft mc = Minecraft.getMinecraft();
+ if (mc.inGameHasFocus && Display.isActive()) {
+ if (!perspectiveToggled) {
+ return true;
+ }
+ mc.mouseHelper.mouseXYChange();
+ float f1 = mc.gameSettings.mouseSensitivity * 0.6f + 0.2f;
+ float f2 = f1 * f1 * f1 * 8.0f;
+ float f3 = mc.mouseHelper.deltaX * f2;
+ float f4 = mc.mouseHelper.deltaY * f2;
+ cameraYaw += f3 * 0.15f;
+ cameraPitch += f4 * 0.15f;
+ if (cameraPitch > 90.0f) {
+ cameraPitch = 90.0f;
+ }
+ if (cameraPitch < -90.0f) {
+ cameraPitch = -90.0f;
+ }
+ }
+ return false;
}
}
diff --git a/shared/java/top/fpsmaster/features/impl/render/Hitboxes.java b/shared/java/top/fpsmaster/features/impl/render/Hitboxes.java
index 01dc27ee..d9d75a9e 100644
--- a/shared/java/top/fpsmaster/features/impl/render/Hitboxes.java
+++ b/shared/java/top/fpsmaster/features/impl/render/Hitboxes.java
@@ -1,11 +1,16 @@
package top.fpsmaster.features.impl.render;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.Entity;
+import net.minecraft.util.AxisAlignedBB;
+import org.lwjgl.opengl.GL11;
import top.fpsmaster.event.Subscribe;
import top.fpsmaster.event.events.EventRender3D;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.ColorSetting;
-import top.fpsmaster.wrapper.mods.WrapperHitboxes;
+import top.fpsmaster.forge.api.IRenderManager;
+import top.fpsmaster.utils.render.Render3DUtils;
import java.awt.*;
@@ -31,6 +36,36 @@ public void onEnable() {
@Subscribe
public void onRender(EventRender3D event) {
- WrapperHitboxes.render(event, color);
+ if (!using) {
+ return;
+ }
+ Minecraft mc = Minecraft.getMinecraft();
+ if (mc.theWorld == null) {
+ return;
+ }
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glLineWidth(1.0f);
+ Color outline = color.getColor();
+ GL11.glColor4f(
+ outline.getRed() / 255f,
+ outline.getGreen() / 255f,
+ outline.getBlue() / 255f,
+ outline.getAlpha() / 255f
+ );
+ IRenderManager renderManager = (IRenderManager) mc.getRenderManager();
+ for (Entity entity : mc.theWorld.loadedEntityList) {
+ if (entity == mc.thePlayer) {
+ continue;
+ }
+ AxisAlignedBB bb = entity.getEntityBoundingBox()
+ .offset(-renderManager.renderPosX(), -renderManager.renderPosY(), -renderManager.renderPosZ());
+ Render3DUtils.drawBoundingBoxOutline(bb);
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glPopMatrix();
}
}
diff --git a/shared/java/top/fpsmaster/features/impl/render/MoreParticles.java b/shared/java/top/fpsmaster/features/impl/render/MoreParticles.java
index fa26cb7a..941ae90e 100644
--- a/shared/java/top/fpsmaster/features/impl/render/MoreParticles.java
+++ b/shared/java/top/fpsmaster/features/impl/render/MoreParticles.java
@@ -12,11 +12,6 @@
import top.fpsmaster.features.settings.impl.BooleanSetting;
import top.fpsmaster.features.settings.impl.ModeSetting;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.api.MinecraftAPI;
-import top.fpsmaster.api.model.BlockPos;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.wrapper.WrapperEntityLightningBolt;
-import top.fpsmaster.wrapper.blockpos.WrapperBlockPos;
import static top.fpsmaster.utils.Utility.mc;
@@ -45,32 +40,38 @@ public void onUpdate(EventUpdate event) {
if (lastEffect != target && (entityLivingBase.getHealth() <= 0 || !entityLivingBase.isEntityAlive())) {
if (killEffect.getValue() == 1) {
// Use raw world for lightning effect
- net.minecraft.client.multiplayer.WorldClient rawWorld =
- (net.minecraft.client.multiplayer.WorldClient) MinecraftAPI.world().getWorld().getRawWorld();
- rawWorld.addWeatherEffect(
- new net.minecraft.entity.effect.EntityLightningBolt(
- rawWorld,
+ if (mc.theWorld != null) {
+ mc.theWorld.addWeatherEffect(
+ new net.minecraft.entity.effect.EntityLightningBolt(
+ mc.theWorld,
+ entityLivingBase.posX,
+ entityLivingBase.posY,
+ entityLivingBase.posZ
+ )
+ );
+ mc.theWorld.playSound(
entityLivingBase.posX,
entityLivingBase.posY,
- entityLivingBase.posZ
- )
- );
- MinecraftAPI.sound().playExplosionSound(
- entityLivingBase.posX,
- entityLivingBase.posY,
- entityLivingBase.posZ,
- 1f,
- 1.0f
- );
+ entityLivingBase.posZ,
+ "random.explode",
+ 1f,
+ 1.0f,
+ false
+ );
+ }
} else if (killEffect.getValue() == 2) {
Minecraft.getMinecraft().effectRenderer.emitParticleAtEntity(target, EnumParticleTypes.EXPLOSION_LARGE);
- MinecraftAPI.sound().playExplosionSound(
- entityLivingBase.posX,
- entityLivingBase.posY,
- entityLivingBase.posZ,
- 1f,
- 1.0f
- );
+ if (mc.theWorld != null) {
+ mc.theWorld.playSound(
+ entityLivingBase.posX,
+ entityLivingBase.posY,
+ entityLivingBase.posZ,
+ "random.explode",
+ 1f,
+ 1.0f,
+ false
+ );
+ }
}
lastEffect = target;
target = null;
@@ -81,18 +82,16 @@ public void onUpdate(EventUpdate event) {
public void onAttack(EventAttack event) {
if (event.target.isEntityAlive()) {
target = event.target;
- if (MinecraftAPI.client().getPlayer().getFallDistance() != 0f || alwaysCrit.getValue()) {
+ if (mc.thePlayer != null && (mc.thePlayer.fallDistance != 0f || alwaysCrit.getValue())) {
for (int i = 0; i < crit.getValue().intValue(); i++) {
Minecraft.getMinecraft().effectRenderer.emitParticleAtEntity(event.target, EnumParticleTypes.CRIT);
}
}
boolean needSharpness = false;
- net.minecraft.entity.player.EntityPlayer rawPlayer =
- (net.minecraft.entity.player.EntityPlayer) MinecraftAPI.client().getPlayer().getRawPlayer();
- if (rawPlayer.inventory.getCurrentItem() != null) {
- needSharpness = rawPlayer.inventory.getCurrentItem().getEnchantmentTagList() != null
- && !rawPlayer.inventory.getCurrentItem().getEnchantmentTagList().hasNoTags()
- && rawPlayer.inventory.getCurrentItem().getEnchantmentTagList().toString().contains("id:16s");
+ if (mc.thePlayer != null && mc.thePlayer.inventory.getCurrentItem() != null) {
+ needSharpness = mc.thePlayer.inventory.getCurrentItem().getEnchantmentTagList() != null
+ && !mc.thePlayer.inventory.getCurrentItem().getEnchantmentTagList().hasNoTags()
+ && mc.thePlayer.inventory.getCurrentItem().getEnchantmentTagList().toString().contains("id:16s");
}
if (needSharpness || alwaysSharpness.getValue()) {
for (int i = 0; i < sharpness.getValue().intValue(); i++) {
@@ -106,20 +105,26 @@ public void onAttack(EventAttack event) {
} else if (special.getValue() == 3) {
if (mc.objectMouseOver.hitVec != null && event.target.hurtResistantTime <= 10) {
System.out.println();
- MinecraftAPI.sound().playRedstoneBreakSound(
- mc.objectMouseOver.hitVec.xCoord,
- mc.objectMouseOver.hitVec.yCoord,
- mc.objectMouseOver.hitVec.zCoord,
- 1f,
- 1f
- );
- MinecraftAPI.render().getParticleManager().addRedstoneBreakParticle(
- new BlockPos(
- (int)mc.objectMouseOver.hitVec.xCoord,
- (int)mc.objectMouseOver.hitVec.yCoord,
- (int)mc.objectMouseOver.hitVec.zCoord
- )
- );
+ if (mc.theWorld != null) {
+ mc.theWorld.playSound(
+ mc.objectMouseOver.hitVec.xCoord,
+ mc.objectMouseOver.hitVec.yCoord,
+ mc.objectMouseOver.hitVec.zCoord,
+ "dig.stone",
+ 1f,
+ 1f,
+ false
+ );
+ mc.theWorld.spawnParticle(
+ EnumParticleTypes.REDSTONE,
+ mc.objectMouseOver.hitVec.xCoord,
+ mc.objectMouseOver.hitVec.yCoord,
+ mc.objectMouseOver.hitVec.zCoord,
+ 0.0,
+ 0.0,
+ 0.0
+ );
+ }
}
}
}
diff --git a/shared/java/top/fpsmaster/features/impl/render/MotionBlur.java b/shared/java/top/fpsmaster/features/impl/render/MotionBlur.java
index b450f1e1..b224fdb4 100644
--- a/shared/java/top/fpsmaster/features/impl/render/MotionBlur.java
+++ b/shared/java/top/fpsmaster/features/impl/render/MotionBlur.java
@@ -6,9 +6,11 @@
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.shader.Framebuffer;
import net.minecraft.client.shader.Shader;
+import net.minecraft.client.shader.ShaderGroup;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import top.fpsmaster.FPSMaster;
@@ -18,11 +20,8 @@
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.ModeSetting;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.forge.api.IShaderGroup;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.utils.OptifineUtil;
import top.fpsmaster.utils.Utility;
-import top.fpsmaster.wrapper.renderEngine.bufferbuilder.WrapperBufferBuilder;
import java.util.List;
@@ -67,7 +66,7 @@ private static void drawTexturedRectNoBlend(float x, float y, float width, float
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filter);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filter);
Tessellator tessellator = Tessellator.getInstance();
- WrapperBufferBuilder worldrenderer = new WrapperBufferBuilder(tessellator);
+ WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(x, y + height, 0.0).tex(uMin, vMax).endVertex();
worldrenderer.pos(x + width, y + height, 0.0).tex(uMax, vMax).endVertex();
@@ -80,7 +79,7 @@ private static void drawTexturedRectNoBlend(float x, float y, float width, float
@Subscribe
public void renderOverlay(EventMotionBlur event) {
- if (Wrappers.minecraft().getWorld() == null)
+ if (mc.theWorld == null)
return;
if (mode.isMode("Old")) {
@@ -97,10 +96,16 @@ public void renderOverlay(EventMotionBlur event) {
mc.entityRenderer.loadShader(new ResourceLocation("shaders/post/motionblur_core.json"));
}
float strength = 0.7f + multiplier.getValue().floatValue() / 100.0f * 3.0f - 0.01f;
- IShaderGroup shaderGroup = (IShaderGroup) mc.entityRenderer.getShaderGroup();
+ ShaderGroup shaderGroup = mc.entityRenderer.getShaderGroup();
if (shaderGroup == null)
return;
- List listShaders = shaderGroup.getListShaders();
+ List listShaders = null;
+ try {
+ java.lang.reflect.Field field = ShaderGroup.class.getDeclaredField("listShaders");
+ field.setAccessible(true);
+ listShaders = (List) field.get(shaderGroup);
+ } catch (NoSuchFieldException | IllegalAccessException ignored) {
+ }
if (listShaders == null)
return;
listShaders.forEach(it -> {
diff --git a/shared/java/top/fpsmaster/features/impl/utility/AutoGG.java b/shared/java/top/fpsmaster/features/impl/utility/AutoGG.java
index 1e70852c..e336c2e8 100644
--- a/shared/java/top/fpsmaster/features/impl/utility/AutoGG.java
+++ b/shared/java/top/fpsmaster/features/impl/utility/AutoGG.java
@@ -1,6 +1,7 @@
package top.fpsmaster.features.impl.utility;
import net.minecraft.event.ClickEvent;
+import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StringUtils;
import top.fpsmaster.FPSMaster;
@@ -12,7 +13,6 @@
import top.fpsmaster.features.settings.impl.ModeSetting;
import top.fpsmaster.features.settings.impl.NumberSetting;
import top.fpsmaster.features.settings.impl.TextSetting;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.utils.Utility;
import top.fpsmaster.utils.math.MathTimer;
@@ -32,8 +32,9 @@ public AutoGG() {
@Subscribe
public void onPacket(EventPacket event) {
- if (event.type == EventPacket.PacketType.RECEIVE && Wrappers.chatPacket().isPacket(event.packet)) {
- IChatComponent componentValue = Wrappers.chatPacket().getChatComponent(event.packet);
+ if (event.type == EventPacket.PacketType.RECEIVE && event.packet instanceof S02PacketChat) {
+ S02PacketChat packet = (S02PacketChat) event.packet;
+ IChatComponent componentValue = packet.getChatComponent();
String chatMessage = componentValue.getUnformattedText();
switch (servers.getValue()) {
case 0:
diff --git a/shared/java/top/fpsmaster/features/impl/utility/ChatBot.java b/shared/java/top/fpsmaster/features/impl/utility/ChatBot.java
deleted file mode 100644
index c4d02955..00000000
--- a/shared/java/top/fpsmaster/features/impl/utility/ChatBot.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package top.fpsmaster.features.impl.utility;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.event.Subscribe;
-import top.fpsmaster.event.events.EventPacket;
-import top.fpsmaster.event.events.EventSendChatMessage;
-import top.fpsmaster.features.manager.Category;
-import top.fpsmaster.features.manager.Module;
-import top.fpsmaster.features.settings.impl.BooleanSetting;
-import top.fpsmaster.features.settings.impl.ModeSetting;
-import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.features.settings.impl.TextSetting;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.ui.notification.NotificationManager;
-import top.fpsmaster.utils.Utility;
-import top.fpsmaster.utils.math.MathTimer;
-import top.fpsmaster.utils.thirdparty.openai.OpenAI;
-
-import java.util.ArrayList;
-import java.util.regex.Pattern;
-
-
-public class ChatBot extends Module {
-
- ModeSetting mode = new ModeSetting("Mode", 0, "Internal", "Custom");
- TextSetting apiKey = new TextSetting("apiKey", "", () -> mode.isMode("Custom"));
- TextSetting apiUrl = new TextSetting("apiUrl", "https://api.openai.com/v1", () -> mode.isMode("Custom"));
- TextSetting prompt = new TextSetting("prompt", "You are a chat bot in a Minecraft server");
- NumberSetting maxContext = new NumberSetting("maxContext", 6, 0, 10, 1);
- NumberSetting cooldown = new NumberSetting("cooldown", 500, 0, 10000, 100);
- String lastMsg = "";
- BooleanSetting ignoreSelf = new BooleanSetting("ignoreself", true);
- TextSetting model = new TextSetting("model", "gpt3.5-turbo");
- TextSetting regex = new TextSetting("regex", "<[^>]+> .*|[^>]+: .*");
- NumberSetting delay = new NumberSetting("responddelay", 500, 0, 5000, 10);
- MathTimer timer = new MathTimer();
-
- private final ArrayList msgs = new ArrayList<>();
-
- public ChatBot() {
- super("ChatBot", Category.Utility);
- addSettings(mode, apiUrl, apiKey, model, maxContext, ignoreSelf, regex, prompt, delay, cooldown);
- }
-
- @Subscribe
- public void onSend(EventSendChatMessage e) {
- if (ignoreSelf.getValue()) {
- String s = e.msg;
- lastMsg = s.length() > 20 ? s.substring(0, 20) : s;
- }
- }
-
- @Subscribe
- public void onChat(EventPacket e) {
- if (Wrappers.chatPacket().isPacket(e.packet) && timer.delay(cooldown.getValue().longValue())) {
- String formattedText = Wrappers.chatPacket().getUnformattedText(e.packet);
- if (formattedText.contains(lastMsg) && lastMsg.length() > 1) {
- System.out.println(lastMsg);
- return;
- }
- FPSMaster.async.runnable(() -> {
- Pattern pattern = Pattern.compile(regex.getValue());
- if (pattern.matcher(formattedText).find()) {
- OpenAI openAi;
- NotificationManager.addNotification("ChatGPT", formattedText, 1f);
- String s;
- JsonObject userRole = new JsonObject();
- userRole.addProperty("role", "user");
- userRole.addProperty("content", formattedText);
- msgs.add(userRole);
- if (mode.isMode("Custom")) {
- openAi = new OpenAI(apiUrl.getValue(), apiKey.getValue(), model.getValue(), prompt.getValue());
- JsonArray msgs1 = new JsonArray();
- msgs.forEach(msgs1::add);
- s = openAi.requestNewAnswer(formattedText, msgs1).replace("\n", "").trim();
- } else {
- JsonArray msgs1 = new JsonArray();
- msgs.forEach(msgs1::add);
- String[] requestClientAI = OpenAI.requestClientAI(prompt.getValue(), model.getValue(), msgs1);
- if ("200".equals(requestClientAI[0])) {
- s = requestClientAI[1];
- } else {
- Utility.sendClientMessage("ChatGPT failed: " + requestClientAI[0]);
- return;
- }
- }
- lastMsg = s.length() > 20 ? s.substring(0, 20) : s;
- JsonObject aiRole = new JsonObject();
- aiRole.addProperty("role", "assistant");
- aiRole.addProperty("content", s);
- msgs.add(aiRole);
- if (msgs.size() > maxContext.getValue().intValue()) {
- // remove the oldest message
- msgs.remove(0);
- }
- try {
- Thread.sleep(delay.getValue().longValue());
- } catch (InterruptedException e1) {
- e1.printStackTrace();
- }
- Utility.sendChatMessage(s);
- }
- });
- }
- }
-}
diff --git a/shared/java/top/fpsmaster/features/impl/utility/IRC.java b/shared/java/top/fpsmaster/features/impl/utility/IRC.java
deleted file mode 100644
index 281f1ee3..00000000
--- a/shared/java/top/fpsmaster/features/impl/utility/IRC.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package top.fpsmaster.features.impl.utility;
-
-import top.fpsmaster.features.manager.Category;
-import top.fpsmaster.features.manager.Module;
-import top.fpsmaster.features.settings.impl.BooleanSetting;
-
-public class IRC extends Module {
- public static boolean using = false;
- public static final BooleanSetting showMates = new BooleanSetting("showMates", true);
-
- public IRC() {
- super("IRC", Category.Utility);
- addSettings(showMates);
- }
-
- @Override
- public void onEnable() {
- super.onEnable();
- using = true;
- }
-
- @Override
- public void onDisable() {
- super.onDisable();
- using = false;
- }
-}
diff --git a/shared/java/top/fpsmaster/features/impl/utility/LevelTag.java b/shared/java/top/fpsmaster/features/impl/utility/LevelTag.java
index fa3781e9..5146d2b0 100644
--- a/shared/java/top/fpsmaster/features/impl/utility/LevelTag.java
+++ b/shared/java/top/fpsmaster/features/impl/utility/LevelTag.java
@@ -9,12 +9,9 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
-import top.fpsmaster.FPSMaster;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.BooleanSetting;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.modules.client.ClientUsersManager;
import top.fpsmaster.utils.render.Render2DUtils;
import static top.fpsmaster.utils.Utility.mc;
@@ -56,7 +53,6 @@ else if (mc.gameSettings.thirdPersonView == 1)
GlStateManager.disableDepth();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
- Wrappers.guiIngame().drawHealth(entityIn);
GlStateManager.disableTexture2D();
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
@@ -96,7 +92,7 @@ else if (mc.gameSettings.thirdPersonView == 1)
i = -10;
}
- boolean isMate = ((entityIn == mc.thePlayer) && str.contains(entityIn.getName())) || FPSMaster.clientUsersManager.getClientUser(entityIn) != null;
+ boolean isMate = entityIn == mc.thePlayer && str.contains(entityIn.getName());
int j = fontRenderer.getStringWidth(str) / 2;
diff --git a/shared/java/top/fpsmaster/features/impl/utility/NameProtect.java b/shared/java/top/fpsmaster/features/impl/utility/NameProtect.java
index 06d2d09d..c8bd3408 100644
--- a/shared/java/top/fpsmaster/features/impl/utility/NameProtect.java
+++ b/shared/java/top/fpsmaster/features/impl/utility/NameProtect.java
@@ -5,7 +5,7 @@
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.TextSetting;
-import top.fpsmaster.api.Wrappers;
+import top.fpsmaster.utils.Utility;
public class NameProtect extends Module {
private static boolean using = false;
@@ -32,14 +32,14 @@ public void onDisable() {
@Subscribe
public void onTick(EventTick e) {
- if (Wrappers.minecraft().getPlayer() != null) {
- playerName = Wrappers.minecraft().getPlayer().getName();
+ if (Utility.mc.thePlayer != null) {
+ playerName = Utility.mc.thePlayer.getName();
replacement = name.getValue().replace("&", "§");
}
}
public static String filter(String s) {
- if (using && Wrappers.minecraft().getPlayer() != null) {
+ if (using && Utility.mc.thePlayer != null) {
if (playerName == null) return s;
if (replacement == null) return s;
return s.replaceAll(playerName, replacement);
diff --git a/shared/java/top/fpsmaster/features/impl/utility/SkinChanger.java b/shared/java/top/fpsmaster/features/impl/utility/SkinChanger.java
deleted file mode 100644
index ec0cf2f8..00000000
--- a/shared/java/top/fpsmaster/features/impl/utility/SkinChanger.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package top.fpsmaster.features.impl.utility;
-
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.network.login.server.S02PacketLoginSuccess;
-import net.minecraft.network.play.server.S0CPacketSpawnPlayer;
-import net.minecraft.world.World;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.event.Subscribe;
-import top.fpsmaster.event.events.EventPacket;
-import top.fpsmaster.event.events.EventTick;
-import top.fpsmaster.features.manager.Category;
-import top.fpsmaster.features.manager.Module;
-import top.fpsmaster.features.settings.impl.TextSetting;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.modules.account.AccountManager;
-
-import static top.fpsmaster.utils.Utility.mc;
-
-public class SkinChanger extends Module {
-
- private final TextSetting skinName = new TextSetting("Skin", "");
- private Thread updateThread = new Thread(() -> {
- while (true) {
- update();
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- }
- });
-
- public static boolean using = false;
- private WorldClient world;
-
- public SkinChanger() {
- super("SkinChanger", Category.Utility);
- addSettings(skinName);
- }
-
- @Override
- public void onEnable() {
- super.onEnable();
- using = true;
- if (Wrappers.minecraft().getPlayer() != null) {
- if (!updateThread.isAlive()) {
- updateThread = new Thread(this::update);
- updateThread.start();
- }
- }
- }
-
-
- @Subscribe
- public void onTick(EventTick e) {
- if (Wrappers.minecraft().getPlayer() != null && Wrappers.minecraft().getPlayer().ticksExisted % 30 == 0) {
- if (AccountManager.skin.equals(skinName.getValue()) && world == mc.theWorld)
- return;
- world = mc.theWorld;
- AccountManager.skin = skinName.getValue();
- FPSMaster.async.runnable(this::update);
- }
- }
-
- public void update() {
- Wrappers.skin().updateSkin(
- Wrappers.minecraft().getPlayer().getName(),
- Wrappers.minecraft().getPlayer().getUniqueID().toString(),
- skinName.getValue()
- );
- }
-
- @Override
- public void onDisable() {
- super.onDisable();
- FPSMaster.async.runnable(() -> Wrappers.skin().updateSkin(
- Wrappers.minecraft().getPlayer().getName(),
- Wrappers.minecraft().getPlayer().getUniqueID().toString(),
- Wrappers.minecraft().getPlayer().getName()
- ));
- using = false;
- }
-}
\ No newline at end of file
diff --git a/shared/java/top/fpsmaster/features/impl/utility/Sprint.java b/shared/java/top/fpsmaster/features/impl/utility/Sprint.java
index a38fdb9a..8765130a 100644
--- a/shared/java/top/fpsmaster/features/impl/utility/Sprint.java
+++ b/shared/java/top/fpsmaster/features/impl/utility/Sprint.java
@@ -1,6 +1,7 @@
package top.fpsmaster.features.impl.utility;
-import top.fpsmaster.api.provider.ProviderRegistry;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.settings.KeyBinding;
import top.fpsmaster.event.Subscribe;
import top.fpsmaster.event.events.EventKey;
import top.fpsmaster.event.events.EventUpdate;
@@ -34,11 +35,11 @@ public void onUpdate(EventUpdate e) {
@Subscribe
public void onKey(EventKey e) {
- if (toggleSprint.getValue() && e.key == ProviderRegistry.getMinecraftProvider().getMinecraft().getGameSettings().getKeyBindSprint().getKeyCode()) {
+ if (toggleSprint.getValue() && e.key == Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode()) {
sprint = !sprint;
if (!sprint) {
- if (ProviderRegistry.getMinecraftProvider().getMinecraft().getClientPlayer() != null) {
- ProviderRegistry.getMinecraftProvider().getMinecraft().getClientPlayer().setSprinting(false);
+ if (Minecraft.getMinecraft().thePlayer != null) {
+ Minecraft.getMinecraft().thePlayer.setSprinting(false);
}
}
}
@@ -47,10 +48,10 @@ public void onKey(EventKey e) {
@Override
public void onDisable() {
super.onDisable();
- ProviderRegistry.getMinecraftProvider().getMinecraft().getKeyBinding().setKeyBindState(ProviderRegistry.getMinecraftProvider().getMinecraft().getGameSettings().getKeyBindSprint().getKeyCode(), false);
- if (ProviderRegistry.getMinecraftProvider().getMinecraft().getClientPlayer() != null) {
- ProviderRegistry.getMinecraftProvider().getMinecraft().getClientPlayer().setSprinting(false);
+ KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode(), false);
+ if (Minecraft.getMinecraft().thePlayer != null) {
+ Minecraft.getMinecraft().thePlayer.setSprinting(false);
}
using = false;
}
-}
\ No newline at end of file
+}
diff --git a/shared/java/top/fpsmaster/features/impl/utility/TNTTimer.java b/shared/java/top/fpsmaster/features/impl/utility/TNTTimer.java
index 330352e5..4cb1391a 100644
--- a/shared/java/top/fpsmaster/features/impl/utility/TNTTimer.java
+++ b/shared/java/top/fpsmaster/features/impl/utility/TNTTimer.java
@@ -7,8 +7,8 @@
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.api.Wrappers;
-import top.fpsmaster.wrapper.entities.EntityTNTPrimedUtil;
+import top.fpsmaster.forge.api.IMinecraft;
+import top.fpsmaster.forge.api.IRenderManager;
import java.awt.*;
import java.text.DecimalFormat;
@@ -46,10 +46,11 @@ public static void doRender(EntityTNTPrimed entity) {
GlStateManager.enableBlend();
GL11.glBlendFunc(770, 771);
GL11.glDisable(3553);
- float partialTicks = Wrappers.timer().getRenderPartialTicks();
- double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - Wrappers.renderManager().renderPosX();
- double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - Wrappers.renderManager().renderPosY();
- double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks - Wrappers.renderManager().renderPosZ();
+ float partialTicks = ((IMinecraft) mc).arch$getTimer().renderPartialTicks;
+ IRenderManager renderManager = (IRenderManager) mc.getRenderManager();
+ double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - renderManager.renderPosX();
+ double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - renderManager.renderPosY();
+ double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks - renderManager.renderPosZ();
float scale = 0.065f;
GlStateManager.translate(x, y + entity.height + 0.5f - entity.height / 2.0f, z);
GL11.glNormal3f(0.0f, 1.0f, 0.0f);
@@ -72,20 +73,20 @@ public static void doRender(EntityTNTPrimed entity) {
}
private static void drawTime(EntityTNTPrimed entity) {
- float width = Wrappers.minecraft().getFontRenderer().getStringWidth("0.00") / 2.0f + 6.0f;
+ float width = Minecraft.getMinecraft().fontRendererObj.getStringWidth("0.00") / 2.0f + 6.0f;
GlStateManager.disableDepth();
GlStateManager.disableBlend();
GlStateManager.disableLighting();
DecimalFormat df = new DecimalFormat("0.00");
Color color = new Color(255, 255, 255);
- float time = (float) (EntityTNTPrimedUtil.getFuse(entity) / 20.0 + duration.getValue().doubleValue() - 4);
+ float time = (float) (entity.fuse / 20.0 + duration.getValue().doubleValue() - 4);
if (time < 2.5) {
color = new Color(255, 255, 0);
}
if (time < 1.0) {
color = new Color(255, 0, 0);
}
- Wrappers.minecraft().getFontRenderer().drawStringWithShadow(df.format(time), -width + 5, -20f, color.getRGB());
+ Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(df.format(time), -width + 5, -20f, color.getRGB());
GlStateManager.enableLighting();
GlStateManager.enableBlend();
GlStateManager.enableDepth();
diff --git a/shared/java/top/fpsmaster/features/impl/utility/TimeChanger.java b/shared/java/top/fpsmaster/features/impl/utility/TimeChanger.java
index 49a75da8..a7fd6596 100644
--- a/shared/java/top/fpsmaster/features/impl/utility/TimeChanger.java
+++ b/shared/java/top/fpsmaster/features/impl/utility/TimeChanger.java
@@ -6,7 +6,8 @@
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.NumberSetting;
-import top.fpsmaster.api.Wrappers;
+import net.minecraft.network.play.server.S03PacketTimeUpdate;
+import top.fpsmaster.utils.Utility;
public class TimeChanger extends Module {
@@ -20,15 +21,15 @@ public TimeChanger() {
@Subscribe
public void onTick(EventTick e) {
- if (Wrappers.world().getWorld() != null) {
- Wrappers.world().setWorldTime(time.getValue().longValue());
+ if (Utility.mc.theWorld != null) {
+ Utility.mc.theWorld.setWorldTime(time.getValue().longValue());
}
}
@Subscribe
public void onPacket(EventPacket e) {
if (e.type == EventPacket.PacketType.RECEIVE) {
- if (Wrappers.timeUpdatePacket().isPacket(e.packet)) {
+ if (e.packet instanceof S03PacketTimeUpdate) {
e.cancel();
}
}
diff --git a/shared/java/top/fpsmaster/features/manager/Category.java b/shared/java/top/fpsmaster/features/manager/Category.java
index db23a378..7f8c4c86 100644
--- a/shared/java/top/fpsmaster/features/manager/Category.java
+++ b/shared/java/top/fpsmaster/features/manager/Category.java
@@ -5,7 +5,6 @@ public enum Category {
RENDER("Render"),
Utility("Utility"),
Interface("Interface"),
- Music("Music"),
;
final String name;
diff --git a/shared/java/top/fpsmaster/features/manager/Module.java b/shared/java/top/fpsmaster/features/manager/Module.java
index 06d77b85..648532e6 100644
--- a/shared/java/top/fpsmaster/features/manager/Module.java
+++ b/shared/java/top/fpsmaster/features/manager/Module.java
@@ -5,7 +5,6 @@
import top.fpsmaster.event.EventDispatcher;
import top.fpsmaster.features.settings.Setting;
import top.fpsmaster.features.settings.impl.*;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.modules.logger.ClientLogger;
import top.fpsmaster.ui.notification.NotificationManager;
@@ -64,7 +63,7 @@ public void set(boolean state) {
if (state && !isEnabled) {
isEnabled = true;
onEnable();
- if (Minecraft.getMinecraft() != null && Wrappers.minecraft().getPlayer() != null) {
+ if (Minecraft.getMinecraft() != null && Minecraft.getMinecraft().thePlayer != null) {
NotificationManager.addNotification(
FPSMaster.i18n.get("notification.module.enable"),
String.format(
@@ -77,7 +76,7 @@ public void set(boolean state) {
} else if (!state && isEnabled){
isEnabled = false;
onDisable();
- if (Minecraft.getMinecraft() != null && Wrappers.minecraft().getPlayer() != null) {
+ if (Minecraft.getMinecraft() != null && Minecraft.getMinecraft().thePlayer != null) {
NotificationManager.addNotification(
FPSMaster.i18n.get("notification.module.disable"),
String.format(
diff --git a/shared/java/top/fpsmaster/features/manager/ModuleManager.java b/shared/java/top/fpsmaster/features/manager/ModuleManager.java
index 7ea1e878..5db68787 100644
--- a/shared/java/top/fpsmaster/features/manager/ModuleManager.java
+++ b/shared/java/top/fpsmaster/features/manager/ModuleManager.java
@@ -80,7 +80,6 @@ public void init() {
modules.add(new MinimizedBobbing());
modules.add(new MoreParticles());
modules.add(new FPSDisplay());
- modules.add(new IRC());
modules.add(new ArmorDisplay());
modules.add(new BetterChat());
modules.add(new BetterFishingRod());
@@ -89,7 +88,6 @@ public void init() {
modules.add(new PotionDisplay());
modules.add(new ReachDisplay());
modules.add(new Scoreboard());
- modules.add(new MusicOverlay());
modules.add(new OldAnimations());
modules.add(new HitColor());
modules.add(new BlockOverlay());
@@ -98,8 +96,6 @@ public void init() {
modules.add(new FireModifier());
modules.add(new FreeLook());
modules.add(new AutoGG());
- modules.add(new LyricsDisplay());
- modules.add(new SkinChanger());
modules.add(new TimeChanger());
modules.add(new TNTTimer());
modules.add(new Hitboxes());
@@ -127,9 +123,7 @@ public void init() {
modules.add(new SoundModifier());
modules.add(new ParticlesModifier());
- if (FPSMaster.EDITION.equals("1.12.2")) {
- modules.add(new HideIndicator());
- }
+ modules.add(new HideIndicator());
for (Module m : FPSMaster.moduleManager.modules) {
mainPanel.mods.add(new ModuleRenderer(m));
diff --git a/shared/java/top/fpsmaster/font/impl/StringCache.java b/shared/java/top/fpsmaster/font/impl/StringCache.java
index c13c70f9..f7a6f1ac 100644
--- a/shared/java/top/fpsmaster/font/impl/StringCache.java
+++ b/shared/java/top/fpsmaster/font/impl/StringCache.java
@@ -6,7 +6,7 @@
import org.jetbrains.annotations.NotNull;
import org.lwjgl.opengl.GL11;
import top.fpsmaster.modules.client.GlobalTextFilter;
-import top.fpsmaster.wrapper.renderEngine.bufferbuilder.WrapperBufferBuilder;
+import net.minecraft.client.renderer.WorldRenderer;
import java.awt.*;
import java.awt.font.GlyphVector;
@@ -463,7 +463,7 @@ public int renderString(String str, float startX, float startY, int initialColor
/* 使用Tessellator将数据排队至顶点数组然后一次性绘制应该比即时模式更快 */
Tessellator tessellator = Tessellator.getInstance();
- WrapperBufferBuilder worldRenderer = new WrapperBufferBuilder(tessellator);
+ WorldRenderer worldRenderer = tessellator.getWorldRenderer();
//GlStateManager.disableTexture2D();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
GlStateManager.color((color >> 16 & 0xff) / 255F, (color >> 8 & 0xff) / 255F, (color & 0xff) / 255F);
@@ -720,7 +720,7 @@ private int applyColorCode(int colorCode, int color, boolean shadowFlag) {
color = colorTable[colorCode] & 0xffffff | color & 0xff000000;
}
- new WrapperBufferBuilder(Tessellator.getInstance()).color(color >> 16 & 0xff, color >> 8 & 0xff, color & 0xff, color >> 24 & 0xff);
+ Tessellator.getInstance().getWorldRenderer().color(color >> 16 & 0xff, color >> 8 & 0xff, color & 0xff, color >> 24 & 0xff);
return color;
}
diff --git a/shared/java/top/fpsmaster/modules/account/AccountManager.java b/shared/java/top/fpsmaster/modules/account/AccountManager.java
deleted file mode 100644
index 0b298c01..00000000
--- a/shared/java/top/fpsmaster/modules/account/AccountManager.java
+++ /dev/null
@@ -1,159 +0,0 @@
-package top.fpsmaster.modules.account;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.exception.AccountException;
-import top.fpsmaster.exception.ExceptionHandler;
-import top.fpsmaster.exception.FileException;
-import top.fpsmaster.exception.NetworkException;
-import top.fpsmaster.modules.logger.ClientLogger;
-import top.fpsmaster.utils.os.FileUtils;
-import top.fpsmaster.utils.os.HttpRequest;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-public class AccountManager {
- private String token = "";
- private String username = "";
- public static String skin = "";
- public static JsonParser parser = new JsonParser();
- public static String cosmeticsHeld = "";
- public static String cosmeticsUsing = "";
- public static HashMap cosmetics = new HashMap<>();
-
- public void autoLogin() {
- FPSMaster.async.runnable(() -> {
- try {
- doAutoLogin();
- } catch (FileException e) {
- ExceptionHandler.handleFileException(e, "尝试自动登录失败");
- } catch (AccountException e) {
- ExceptionHandler.handleAccountException(e, "尝试自动登录失败");
- } catch (NetworkException e) {
- ExceptionHandler.handleNetworkException(e, "尝试自动登录失败");
- } catch (Exception e) {
- ExceptionHandler.handle(e, "尝试自动登录失败");
- }
- });
- }
-
- private void doAutoLogin() throws FileException, AccountException, NetworkException {
- token = FileUtils.readTempValue("token").trim();
- username = FPSMaster.configManager.configure.getOrCreate("username", "").trim();
- if (!token.isEmpty() && !username.isEmpty()) {
- if (attemptLogin(username, token)) {
- ClientLogger.info("自动登录成功! " + username);
- FPSMaster.INSTANCE.loggedIn = true;
- } else {
- ClientLogger.info(username);
- ClientLogger.error("自动登录失败!");
- throw new AccountException("自动登录失败");
- }
- }
- }
-
- private boolean attemptLogin(String username, String token) throws AccountException {
- if (username.isEmpty() || token.isEmpty()) {
- return false;
- }
- try {
- HashMap headers = new HashMap<>();
- headers.put("Authorization", "Bearer " + token);
- HttpRequest.HttpResponseResult s = HttpRequest.get(FPSMaster.SERVICE_API + "/api/auth/validate-jwt", headers);
- JsonObject json = parser.parse(s.getBody()).getAsJsonObject();
- if (!s.isSuccess()) {
- throw new AccountException("Failed to login via token " + s.getStatusCode());
- }
- this.username = username;
- this.token = token;
- return json.get("data").getAsJsonObject().get("success").getAsBoolean();
- } catch (Exception e) {
- throw new AccountException("Failed to login via token");
- }
- }
-
-
- public static JsonObject login(String username, String password) throws AccountException {
- JsonObject body = new JsonObject();
- body.addProperty("username", username);
- body.addProperty("password", password);
- HttpRequest.HttpResponseResult s;
- try {
- s = HttpRequest.post(FPSMaster.SERVICE_API + "/api/auth/login", body.toString());
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- JsonObject jsonObject = parser.parse(s.getBody()).getAsJsonObject();
- if (jsonObject.get("data") == null || !jsonObject.get("data").getAsJsonObject().get("success").getAsBoolean()) {
- throw new AccountException("登录失败: " + jsonObject.get("message").getAsString());
- }
- return jsonObject;
- }
-
- public void refreshUserData() throws AccountException {
- try {
- String token = FileUtils.readTempValue("token").trim();
- HashMap headers = new HashMap<>();
- headers.put("Authorization", "Bearer " + token);
- HttpRequest.HttpResponseResult s = HttpRequest.post(FPSMaster.SERVICE_API + "/api/users", null, headers);
- JsonObject json = parser.parse(s.getBody()).getAsJsonObject();
- if (!s.isSuccess()) {
- throw new AccountException("Failed to login via token " + s.getStatusCode());
- }
- cosmeticsHeld = json.get("data").getAsJsonObject().get("items").getAsString();
- } catch (Exception e) {
- throw new AccountException("Failed to login via token");
- }
- }
-
- public void refreshCosmetics() throws AccountException {
- try {
- String token = FileUtils.readTempValue("token").trim();
- HashMap headers = new HashMap<>();
- headers.put("Authorization", "Bearer " + token);
- HttpRequest.HttpResponseResult s = HttpRequest.get(FPSMaster.SERVICE_API + "/api/store/items", headers);
- JsonObject json = parser.parse(s.getBody()).getAsJsonObject();
- if (!s.isSuccess()) {
- throw new AccountException("Failed to login via token " + s.getStatusCode());
- }
- cosmetics.clear();
- for (JsonElement data : json.get("data").getAsJsonArray()) {
- JsonObject asJsonObject = data.getAsJsonObject();
- Cosmetic cosmetic = new Cosmetic();
- cosmetic.id = asJsonObject.get("id").getAsInt();
- cosmetic.name = asJsonObject.get("name").getAsString();
- cosmetic.img = asJsonObject.get("img").getAsString();
- cosmetic.category = asJsonObject.get("category").getAsString();
- cosmetic.price = asJsonObject.get("price").getAsDouble();
- cosmetic.available = asJsonObject.get("available").getAsBoolean();
- cosmetic.resource = asJsonObject.get("resource").getAsString();
- cosmetics.put(cosmetic.id, cosmetic);
- cosmetic.load();
- }
- } catch (Exception e) {
- throw new AccountException("Failed to login via token");
- }
- }
-
- // Getter and Setter methods
- public String getToken() {
- return token;
- }
-
- public void setToken(String token) {
- this.token = token;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-}
diff --git a/shared/java/top/fpsmaster/modules/account/Cosmetic.java b/shared/java/top/fpsmaster/modules/account/Cosmetic.java
deleted file mode 100644
index e52858ab..00000000
--- a/shared/java/top/fpsmaster/modules/account/Cosmetic.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package top.fpsmaster.modules.account;
-
-import com.google.gson.JsonObject;
-import net.minecraft.client.renderer.ThreadDownloadImageData;
-import net.minecraft.util.ResourceLocation;
-import scala.Int;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.utils.awt.GifUtil;
-import top.fpsmaster.utils.os.HttpRequest;
-
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import static top.fpsmaster.utils.Utility.mc;
-
-public class Cosmetic {
- public int id;
- public String name;
- public String img;
- public String category;
- public double price;
- public boolean available;
- public String resource;
- public boolean loaded;
- public Integer frame = 0;
- public long frameTime = 0;
- public List frames = new ArrayList<>();
-
- public Cosmetic() {
- }
-
- public void load() {
- if (mc.theWorld == null) return;
- FPSMaster.async.runnable(() -> {
- if (resource.endsWith(".png")) {
- ResourceLocation textureLocation = new ResourceLocation("ornaments/" + id + "_resource");
- ThreadDownloadImageData downloadImageData = new ThreadDownloadImageData(null, null, textureLocation, null);
- try {
- downloadImageData.setBufferedImage(HttpRequest.downloadImage(resource));
- mc.getTextureManager().loadTexture(textureLocation, downloadImageData);
- } catch (IOException ignored) {
- }
- } else if (resource.endsWith(".gif")) {
- try {
- InputStream inputStream = HttpRequest.downloadFile(resource);
- frames.clear();
- frames = GifUtil.convertGifToPng(inputStream);
- for (GifUtil.FrameData frame : frames) {
- ResourceLocation textureLocation = new ResourceLocation("ornaments/" + id + "_resource_" + frames.indexOf(frame));
- ThreadDownloadImageData downloadImageData = new ThreadDownloadImageData(null, null, textureLocation, null);
- downloadImageData.setBufferedImage(frame.image);
- mc.getTextureManager().loadTexture(textureLocation, downloadImageData);
- }
- loaded = true;
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- });
- }
-}
diff --git a/shared/java/top/fpsmaster/modules/client/ClientUser.java b/shared/java/top/fpsmaster/modules/client/ClientUser.java
deleted file mode 100644
index 0845666a..00000000
--- a/shared/java/top/fpsmaster/modules/client/ClientUser.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package top.fpsmaster.modules.client;
-
-public class ClientUser {
- public String uid;
- public String name;
- public String uuid;
- public String gameId;
- public String cosmetics;
- public String skin;
- public String rank;
- public String customRank;
- public ClientUser(String uid, String name, String uuid, String gameId, String cosmetics, String skin, String rank, String customRank) {
- this.uid = uid;
- this.name = name;
- this.uuid = uuid;
- this.gameId = gameId;
- this.cosmetics = cosmetics;
- this.skin = skin;
- this.rank = rank;
- this.customRank = customRank;
- }
-}
diff --git a/shared/java/top/fpsmaster/modules/client/ClientUsersManager.java b/shared/java/top/fpsmaster/modules/client/ClientUsersManager.java
deleted file mode 100644
index da19a86d..00000000
--- a/shared/java/top/fpsmaster/modules/client/ClientUsersManager.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package top.fpsmaster.modules.client;
-
-import net.minecraft.entity.Entity;
-import top.fpsmaster.modules.logger.ClientLogger;
-import top.fpsmaster.utils.Utility;
-import top.fpsmaster.websocket.data.message.server.SFetchPlayerPacket;
-
-import java.util.ArrayList;
-
-public class ClientUsersManager {
- public ArrayList users = new ArrayList<>();
-
- public void addFromFetch(SFetchPlayerPacket packet) {
- ClientUser clientUser = new ClientUser(packet.uid, packet.name, packet.uuid, packet.gameId, packet.cosmetics, packet.skin, packet.rank, packet.customRank);
- ClientUser rm = null;
- for (ClientUser user : users) {
- if (user.uid.equals(clientUser.uid))
- rm = user;
- }
- if (rm != null)
- users.remove(rm);
- users.add(clientUser);
- Utility.sendClientDebug("Add user: " + clientUser.name + " " + clientUser.uid + " " + clientUser.uuid + " " + clientUser.gameId + " " + clientUser.rank + " " + clientUser.customRank + " " + clientUser.cosmetics + " " + clientUser.skin);
- }
-
- public ClientUser getClientUser(Entity entityIn) {
- for (ClientUser user : users)
- if (user.gameId.equals(entityIn.getName()) && user.uuid.equals(entityIn.getUniqueID().toString()))
- return user;
- return null;
- }
-
- public ClientUser getClientUser(String name, String uuid) {
- for (ClientUser user : users)
- if (user.gameId.equals(name) && user.uuid.equals(uuid))
- return user;
- return null;
- }
-}
diff --git a/shared/java/top/fpsmaster/modules/client/GlobalTextFilter.java b/shared/java/top/fpsmaster/modules/client/GlobalTextFilter.java
index 3e3d5c20..ff9da978 100644
--- a/shared/java/top/fpsmaster/modules/client/GlobalTextFilter.java
+++ b/shared/java/top/fpsmaster/modules/client/GlobalTextFilter.java
@@ -1,6 +1,5 @@
package top.fpsmaster.modules.client;
-import top.fpsmaster.features.impl.utility.IRC;
import top.fpsmaster.features.impl.utility.NameProtect;
public class GlobalTextFilter {
diff --git a/shared/java/top/fpsmaster/modules/config/ConfigManager.java b/shared/java/top/fpsmaster/modules/config/ConfigManager.java
index fc39a788..16beac96 100644
--- a/shared/java/top/fpsmaster/modules/config/ConfigManager.java
+++ b/shared/java/top/fpsmaster/modules/config/ConfigManager.java
@@ -8,7 +8,6 @@
import top.fpsmaster.features.impl.optimizes.OldAnimations;
import top.fpsmaster.features.impl.optimizes.Performance;
import top.fpsmaster.features.impl.render.ItemPhysics;
-import top.fpsmaster.features.impl.utility.IRC;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.Setting;
import top.fpsmaster.features.settings.impl.*;
@@ -177,6 +176,5 @@ private void openDefaultModules() {
FPSMaster.moduleManager.getModule(Performance.class).set(true);
FPSMaster.moduleManager.getModule(OldAnimations.class).set(true);
FPSMaster.moduleManager.getModule(ItemPhysics.class).set(true);
- FPSMaster.moduleManager.getModule(IRC.class).set(true);
}
}
diff --git a/shared/java/top/fpsmaster/modules/lua/LuaManager.java b/shared/java/top/fpsmaster/modules/lua/LuaManager.java
index 645b6514..2f19f5c2 100644
--- a/shared/java/top/fpsmaster/modules/lua/LuaManager.java
+++ b/shared/java/top/fpsmaster/modules/lua/LuaManager.java
@@ -8,7 +8,6 @@
import top.fpsmaster.FPSMaster;
import top.fpsmaster.exception.FileException;
import top.fpsmaster.features.manager.Module;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.modules.logger.ClientLogger;
import top.fpsmaster.utils.Utility;
import top.fpsmaster.utils.os.FileUtils;
@@ -92,16 +91,16 @@ public static LuaScript loadLua(RawLua rawLua) throws FileException {
lua.push(L -> {
boolean sneak = L.toBoolean(1);
- Wrappers.gameSettings().setKeyPress(Utility.mc.gameSettings.keyBindSneak, sneak);
+ net.minecraft.client.settings.KeyBinding.setKeyBindState(Utility.mc.gameSettings.keyBindSneak.getKeyCode(), sneak);
return 0; // 返回值数量
});
lua.setGlobal("sneak");
lua.push(L -> {
- double posX = Wrappers.minecraft().getPlayer().posX;
- double posY = Wrappers.minecraft().getPlayer().posY;
- double posZ = Wrappers.minecraft().getPlayer().posZ;
- boolean onGround = Wrappers.minecraft().getPlayer().onGround;
+ double posX = Utility.mc.thePlayer.posX;
+ double posY = Utility.mc.thePlayer.posY;
+ double posZ = Utility.mc.thePlayer.posZ;
+ boolean onGround = Utility.mc.thePlayer.onGround;
lua.push(posX);
lua.push(posY);
diff --git a/shared/java/top/fpsmaster/modules/music/IngameOverlay.java b/shared/java/top/fpsmaster/modules/music/IngameOverlay.java
deleted file mode 100644
index 1407c315..00000000
--- a/shared/java/top/fpsmaster/modules/music/IngameOverlay.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package top.fpsmaster.modules.music;
-
-import net.minecraft.client.gui.ScaledResolution;
-import net.minecraft.util.ResourceLocation;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.features.impl.interfaces.MusicOverlay;
-import top.fpsmaster.font.impl.UFontRenderer;
-import top.fpsmaster.modules.music.netease.Music;
-import top.fpsmaster.utils.Utility;
-import top.fpsmaster.utils.math.animation.AnimationUtils;
-import top.fpsmaster.utils.render.Render2DUtils;
-
-import java.awt.*;
-
-public class IngameOverlay {
- private static float songProgress = 0f;
- private static double[] smoothCurve = new double[0];
-
- public static void onRender() {
- if (MusicPlayer.isPlaying) {
- ScaledResolution sr = new ScaledResolution(Utility.mc);
- double[] curve = MusicPlayer.getCurve();
- if (curve.length != 0) {
- int numBars = 60; // 你希望显示的频谱柱条数
- if (smoothCurve.length != numBars) {
- smoothCurve = new double[numBars];
- }
-
- float width = (float) sr.getScaledWidth() / numBars;
-
- float screenWidth = sr.getScaledWidth();
- float screenHeight = sr.getScaledHeight();
-
- int binsPerBar = curve.length / numBars;
-
- for (int bar = 0; bar < numBars; bar++) {
- double sum = 0.0;
- for (int j = 0; j < binsPerBar; j++) {
- int idx = bar * binsPerBar + j;
- sum += Math.max(curve[idx], 0.0);
- }
- double averageMagnitude = sum / binsPerBar;
- averageMagnitude = Math.min(averageMagnitude, 1.0);
- averageMagnitude = Math.sqrt(averageMagnitude);
- smoothCurve[bar] = AnimationUtils.base(smoothCurve[bar], averageMagnitude, 0.1);
- float xPos = (float) bar / numBars * screenWidth;
- float height = (float) (smoothCurve[bar] * 100f * MusicOverlay.amplitude.getValue().floatValue());
-
- Render2DUtils.drawRect(
- xPos,
- screenHeight - height,
- width,
- height,
- MusicOverlay.color.getColor()
- );
- }
- }
- }
- }
-
- public static void drawSong(float x, float y, float width, float height) {
- ScaledResolution sr = new ScaledResolution(Utility.mc);
- Music current = (Music) MusicPlayer.playList.musics.get(MusicPlayer.playList.getCurrent());
- UFontRenderer s18 = FPSMaster.fontManager.s18;
-
- Render2DUtils.drawOptimizedRoundedRect(x, y, width, height, new Color(0, 0, 0, 180));
- Render2DUtils.drawOptimizedRoundedRect(x, y, songProgress, height, MusicOverlay.progressColor.getColor());
-
- songProgress = (float) AnimationUtils.base(songProgress, 6 + (width - 6) * MusicPlayer.curPlayProgress, 0.1);
-
- Render2DUtils.drawImage(
- new ResourceLocation("music/netease/" + current.id),
- x + 5,
- y + 5,
- height - 10,
- height - 10,
- -1
- );
-
- FPSMaster.fontManager.s18.drawString(
- current.name,
- x + 40,
- y + 6,
- new Color(234, 234, 234).getRGB()
- );
-
- FPSMaster.fontManager.s16.drawString(
- current.author,
- x + 40,
- y + 18,
- new Color(162, 162, 162).getRGB()
- );
- }
-}
diff --git a/shared/java/top/fpsmaster/modules/music/netease/Music.java b/shared/java/top/fpsmaster/modules/music/netease/Music.java
index 80aecf4f..3623bf46 100644
--- a/shared/java/top/fpsmaster/modules/music/netease/Music.java
+++ b/shared/java/top/fpsmaster/modules/music/netease/Music.java
@@ -3,7 +3,6 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.util.ResourceLocation;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.modules.logger.ClientLogger;
import top.fpsmaster.modules.music.AbstractMusic;
import top.fpsmaster.modules.music.MusicPlayer;
@@ -32,7 +31,7 @@ public Music(long id, String name, String artists, String picUrl) {
public void loadMusic() {
try {
- if (Wrappers.world().getWorld() == null) return;
+ if (Minecraft.getMinecraft().theWorld == null) return;
File artist = new File(FileUtils.artists, FileUtils.fixName(name + "(" + id + ").png"));
if (!artist.exists()) {
HttpRequest.downloadFile(imgURL + "?param=90y90", artist.getAbsolutePath());
diff --git a/shared/java/top/fpsmaster/ui/Compass.java b/shared/java/top/fpsmaster/ui/Compass.java
index 70b2544d..6523cf18 100644
--- a/shared/java/top/fpsmaster/ui/Compass.java
+++ b/shared/java/top/fpsmaster/ui/Compass.java
@@ -6,7 +6,7 @@
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
import top.fpsmaster.FPSMaster;
-import top.fpsmaster.api.Wrappers;
+import net.minecraft.client.Minecraft;
import top.fpsmaster.utils.render.Render2DUtils;
import java.awt.*;
@@ -55,12 +55,12 @@ public Compass(float i, float o, float s, int a, boolean sh) {
}
public void draw(ScaledResolution sr) {
- if (Wrappers.minecraft().getPlayer() == null)
+ if (Minecraft.getMinecraft().thePlayer == null)
return;
preRender(sr);
float center = Render2DUtils.getFixedBounds()[0] / 2;
int count = 0;
- float yaaahhrewindTime = (Wrappers.minecraft().getPlayer().rotationYaw % 360) * 2 + 360 * 3;
+ float yaaahhrewindTime = (Minecraft.getMinecraft().thePlayer.rotationYaw % 360) * 2 + 360 * 3;
GL11.glPushMatrix();
GL11.glEnable(3089);
int scaleFactor = Render2DUtils.fixScale();
diff --git a/shared/java/top/fpsmaster/ui/ai/AIChatPanel.java b/shared/java/top/fpsmaster/ui/ai/AIChatPanel.java
deleted file mode 100644
index 21c1b702..00000000
--- a/shared/java/top/fpsmaster/ui/ai/AIChatPanel.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package top.fpsmaster.ui.ai;
-
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.ui.click.component.ScrollContainer;
-import top.fpsmaster.ui.common.TextField;
-import top.fpsmaster.utils.Utility;
-import top.fpsmaster.utils.render.Render2DUtils;
-import top.fpsmaster.utils.thirdparty.openai.OpenAIClient;
-
-import java.awt.*;
-import java.util.ArrayList;
-
-public class AIChatPanel {
- int x = 0, y = 0;
- int w = 220, h = 350;
- boolean dragging = false;
- int dragX = 0;
- int dragY = 0;
-
- boolean disabled = false;
-
- ScrollContainer chat = new ScrollContainer();
-
- TextField input;
-
- ArrayList messages = new ArrayList<>();
-
- public void init() {
- input = new TextField(FPSMaster.fontManager.s16, "输入消息", new Color(60, 60, 60).getRGB(), -1, 256);
- }
-
- public void render(int mouseX, int mouseY, int scaleFactor) {
-
- Render2DUtils.drawBlurArea(x, y, w, h, 3, new Color(43, 43, 43, 255));
- Render2DUtils.drawOptimizedRoundedRect(x, y, w, h, 3, new Color(43, 43, 43, 80).getRGB());
-
- Render2DUtils.drawOptimizedRoundedRect(x, y, w, 16, new Color(43, 87, 145));
- FPSMaster.fontManager.s16.drawString("FPS-Chat", x + 2, y + 1, -1);
- input.drawTextBox(x + 2, y + h - 20, w - 4, 18);
-
- GL11.glPushMatrix();
- GL11.glEnable(GL11.GL_SCISSOR_TEST);
- Render2DUtils.doGlScissor(x, y + 24, w, h - 46, scaleFactor);
- chat.draw(x, y + 16, w - 6, h - 40, mouseX, mouseY, () -> {
- int height = (int) (chat.getScroll()) + 22;
- for (OpenAIClient.Message message : messages) {
- FPSMaster.fontManager.s16.drawString(message.getRole() + ":", x + 2, y + height, -1);
- StringBuilder sb = new StringBuilder();
- height += 14;
-
- ArrayList lines = new ArrayList<>();
-
-
- int ic = 0;
- for (char c : message.getContent().toCharArray()) {
- ic++;
- sb.append(c);
- if (c == '\n' || c == '\r' || FPSMaster.fontManager.s16.getStringWidth(sb.toString()) > w - 16 || ic == message.getContent().length()) {
- lines.add(sb.toString());
- sb = new StringBuilder();
- }
- }
-
- for (String line : lines) {
- FPSMaster.fontManager.s16.drawString(line, x + 6, y + height, new Color(207, 207, 207).getRGB());
- height += 16;
- }
- }
-
- chat.setHeight(height - chat.getScroll());
- });
-
- GL11.glDisable(GL11.GL_SCISSOR_TEST);
- GL11.glPopMatrix();
- if (dragging) {
- x = mouseX - dragX;
- y = mouseY - dragY;
- if (!Mouse.isButtonDown(0)) {
- dragging = false;
- }
- }
- }
-
-
- public void click(int mouseX, int mouseY, int button) {
- if (Render2DUtils.isHovered(x, y, w, 16, mouseX, mouseY) && button == 0) {
- dragX = mouseX - x;
- dragY = mouseY - y;
- dragging = true;
- }
- input.mouseClicked(mouseX, mouseY, button);
- }
-
- public void keyTyped(char typedChar, int keyCode) {
- if (keyCode == Keyboard.KEY_RETURN) {
- messages.add(new OpenAIClient.Message("user", input.getText()));
- OpenAIClient.Message msg = new OpenAIClient.Message("assistant", "");
- messages.add(msg);
- getResponse(msg);
- disabled = true;
- input.setText("");
- return;
- }
- input.textboxKeyTyped(typedChar, keyCode);
- }
-
- public void getResponse(OpenAIClient.Message msg) {
- OpenAIClient.getChatResponseAsync(messages, new OpenAIClient.ResponseCallback() {
- @Override
- public void onResponse(String response) {
- //response
- msg.setContent(response);
- }
-
- @Override
- public void onError(Exception e) {
- Utility.sendClientNotify("Fetching AI response error");
- }
-
- @Override
- public void onFinish(String string) {
- disabled = false;
- }
- });
- }
-}
diff --git a/shared/java/top/fpsmaster/ui/click/CosmeticScreen.java b/shared/java/top/fpsmaster/ui/click/CosmeticScreen.java
deleted file mode 100644
index 6fb5419d..00000000
--- a/shared/java/top/fpsmaster/ui/click/CosmeticScreen.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package top.fpsmaster.ui.click;
-
-import org.lwjgl.opengl.GL11;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.exception.AccountException;
-import top.fpsmaster.modules.account.AccountManager;
-import top.fpsmaster.modules.account.Cosmetic;
-import top.fpsmaster.ui.click.component.ScrollContainer;
-import top.fpsmaster.utils.render.Render2DUtils;
-import top.fpsmaster.utils.render.ScaledGuiScreen;
-
-import java.awt.*;
-import java.io.IOException;
-
-public class CosmeticScreen extends ScaledGuiScreen {
- ScrollContainer container = new ScrollContainer();
-
- @Override
- public void render(int mouseX, int mouseY, float partialTicks) {
- super.render(mouseX, mouseY, partialTicks);
- String[] split = AccountManager.cosmeticsHeld.split(",");
- Render2DUtils.drawRoundedRectImage(guiWidth / 2f - 200, guiHeight / 2f - 130, 400, 260, 4, new Color(0, 0, 0, 100));
- GL11.glEnable(GL11.GL_SCISSOR_TEST);
- Render2DUtils.doGlScissor(guiWidth / 2f - 200, guiHeight / 2f - 130, 400, 260, scaleFactor);
- container.draw(guiWidth / 2f - 200, guiHeight / 2f - 130, 400, 260, mouseX, mouseY, () -> {
- int y = 0;
- for (String id : split) {
- if (id.isEmpty())
- continue;
- Cosmetic cosmetic = AccountManager.cosmetics.get(Integer.parseInt(id));
- if (!cosmetic.loaded) {
- cosmetic.load();
- }
- FPSMaster.fontManager.s18.drawString(cosmetic.name, guiWidth / 2f - 190, guiHeight / 2f - 120 + y + container.getScroll(), id.equals(AccountManager.cosmeticsUsing) ? Color.GREEN.getRGB() : Color.WHITE.getRGB());
- y += 20;
- }
- container.setHeight(y);
- });
- GL11.glDisable(GL11.GL_SCISSOR_TEST);
-
-
- }
-
- @Override
- public void initGui() {
- super.initGui();
- FPSMaster.async.runnable(() -> {
- try {
- if (AccountManager.cosmetics.isEmpty())
- FPSMaster.accountManager.refreshCosmetics();
- FPSMaster.accountManager.refreshUserData();
- } catch (AccountException e) {
- throw new RuntimeException(e);
- }
- });
- }
-
- @Override
- public void onClick(int mouseX, int mouseY, int mouseButton) {
- String[] split = AccountManager.cosmeticsHeld.split(",");
- int y = 0;
- for (String id : split) {
- if (id.isEmpty())
- continue;
- Cosmetic cosmetic = AccountManager.cosmetics.get(Integer.parseInt(id));
- if (Render2DUtils.isHovered(guiWidth / 2f - 200, guiHeight / 2f - 120 + y, 400, 20, mouseX, mouseY)) {
- String cosmeticsUsing = String.valueOf(cosmetic.id);
- if (AccountManager.cosmeticsUsing.equals(cosmeticsUsing)) {
- AccountManager.cosmeticsUsing = "";
- } else {
- AccountManager.cosmeticsUsing = cosmeticsUsing;
- }
- }
- y += 20;
- }
- }
-}
diff --git a/shared/java/top/fpsmaster/ui/click/MainPanel.java b/shared/java/top/fpsmaster/ui/click/MainPanel.java
index c1db0d76..e4b69536 100644
--- a/shared/java/top/fpsmaster/ui/click/MainPanel.java
+++ b/shared/java/top/fpsmaster/ui/click/MainPanel.java
@@ -9,10 +9,8 @@
import top.fpsmaster.exception.FileException;
import top.fpsmaster.features.manager.Category;
import top.fpsmaster.features.manager.Module;
-import top.fpsmaster.ui.ai.AIChatPanel;
import top.fpsmaster.ui.click.component.ScrollContainer;
import top.fpsmaster.ui.click.modules.ModuleRenderer;
-import top.fpsmaster.ui.click.music.NewMusicPanel;
import top.fpsmaster.utils.math.animation.Animation;
import top.fpsmaster.utils.math.animation.AnimationUtils;
import top.fpsmaster.utils.math.animation.Type;
@@ -56,8 +54,6 @@ public class MainPanel extends ScaledGuiScreen {
public static Module curModule = null;
public static String dragLock = "null";
- public AIChatPanel aiChatPanel = new AIChatPanel();
-
public MainPanel() {
super();
}
@@ -105,43 +101,39 @@ public void render(int mouseX, int mouseY, float partialTicks) {
moduleListAlpha = (float) AnimationUtils.base(moduleListAlpha, 255.0, 0.1f);
- if (curType == Category.Music) {
- NewMusicPanel.draw(x + leftWidth, y, width - leftWidth, height, mouseX, mouseY, scaleFactor);
- } else {
- GL11.glEnable(GL11.GL_SCISSOR_TEST);
- Render2DUtils.doGlScissor(
- x, y + 10, width,
- (height - 18),
- scaleFactor
- );
- modHeight = 20f;
- float containerWidth = width - leftWidth - 10;
- int finalMouseY = mouseY;
- modsContainer.draw(x + leftWidth, y + 25f, containerWidth, height - 20f, mouseX, mouseY, () -> {
- float modsY = y + 22f;
- for (ModuleRenderer m : mods) {
- if (m.mod.category == curType) {
- float moduleY = modsY + modsContainer.getScroll();
- if (moduleY + 40 + m.height > y && moduleY < y + height) {
- m.render(
- x + leftWidth + 10,
- moduleY,
- containerWidth - 10,
- 40f,
- mouseX,
- finalMouseY,
- curModule == m.mod
- );
- }
- modsY += 45 + m.height;
- modHeight += 45 + m.height;
+ GL11.glEnable(GL11.GL_SCISSOR_TEST);
+ Render2DUtils.doGlScissor(
+ x, y + 10, width,
+ (height - 18),
+ scaleFactor
+ );
+ modHeight = 20f;
+ float containerWidth = width - leftWidth - 10;
+ int finalMouseY = mouseY;
+ modsContainer.draw(x + leftWidth, y + 25f, containerWidth, height - 20f, mouseX, mouseY, () -> {
+ float modsY = y + 22f;
+ for (ModuleRenderer m : mods) {
+ if (m.mod.category == curType) {
+ float moduleY = modsY + modsContainer.getScroll();
+ if (moduleY + 40 + m.height > y && moduleY < y + height) {
+ m.render(
+ x + leftWidth + 10,
+ moduleY,
+ containerWidth - 10,
+ 40f,
+ mouseX,
+ finalMouseY,
+ curModule == m.mod
+ );
}
+ modsY += 45 + m.height;
+ modHeight += 45 + m.height;
}
- modsContainer.setHeight(modHeight);
- });
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_SCISSOR_TEST);
- }
+ }
+ modsContainer.setHeight(modHeight);
+ });
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_SCISSOR_TEST);
if (Render2DUtils.isHovered(x, (int) (y + height / 2 - 70), categoryAnimation, 140, mouseX, mouseY)) {
@@ -232,9 +224,6 @@ public void updateScreen() {
public void initGui() {
super.initGui();
// aiChatPanel.init();
- if (curType == Category.Music)
- NewMusicPanel.init();
-
scaleAnimation.fstart(0.8, 1.0, 0.2f, Type.EASE_IN_OUT_QUAD);
close = false;
@@ -285,21 +274,12 @@ public void keyTyped(char typedChar, int keyCode) throws IOException {
}
}
- NewMusicPanel.keyTyped(typedChar, keyCode);
super.keyTyped(typedChar, keyCode);
}
@Override
public void onClick(int mouseX, int mouseY, int mouseButton) {
// aiChatPanel.click(mouseX, mouseY, mouseButton);
- if (Render2DUtils.isHovered(x + 5,
- y + height - 25,
- 20,
- 20, mouseX, mouseY)) {
- if (mouseButton == 0) {
- mc.displayGuiScreen(new CosmeticScreen());
- }
- }
if (!Render2DUtils.isHovered(x, y, width, height, mouseX, mouseY)) return;
// if (mouseButton == 0 && Render2DUtils.isHoveredWithoutScale(
@@ -328,31 +308,23 @@ public void onClick(int mouseX, int mouseY, int mouseButton) {
if (curType != c) {
moduleListAlpha = 0f;
}
- if (c == Category.Music) {
- NewMusicPanel.init();
- }
curType = c;
}
my += 27f;
}
-
- if (curType == Category.Music) {
- NewMusicPanel.mouseClicked(mouseX, mouseY, mouseButton);
- } else {
- float modsY = y + 22f + modsContainer.getRealScroll();
- for (ModuleRenderer m : mods) {
- if (m.mod.category == curType) {
- m.mouseClick(
- x + leftWidth,
- modsY,
- width - leftWidth,
- 40f,
- mouseX,
- mouseY,
- mouseButton
- );
- modsY += 45 + m.height;
- }
+ float modsY = y + 22f + modsContainer.getRealScroll();
+ for (ModuleRenderer m : mods) {
+ if (m.mod.category == curType) {
+ m.mouseClick(
+ x + leftWidth,
+ modsY,
+ width - leftWidth,
+ 40f,
+ mouseX,
+ mouseY,
+ mouseButton
+ );
+ modsY += 45 + m.height;
}
}
}
diff --git a/shared/java/top/fpsmaster/ui/click/modules/impl/MultipleItemSettingRender.java b/shared/java/top/fpsmaster/ui/click/modules/impl/MultipleItemSettingRender.java
index 527ab07d..e940f585 100644
--- a/shared/java/top/fpsmaster/ui/click/modules/impl/MultipleItemSettingRender.java
+++ b/shared/java/top/fpsmaster/ui/click/modules/impl/MultipleItemSettingRender.java
@@ -4,8 +4,8 @@
import top.fpsmaster.FPSMaster;
import top.fpsmaster.features.manager.Module;
import top.fpsmaster.features.settings.impl.MultipleItemSetting;
-import top.fpsmaster.api.Wrappers;
import top.fpsmaster.ui.click.modules.SettingRender;
+import top.fpsmaster.utils.Utility;
import top.fpsmaster.utils.render.Render2DUtils;
import top.fpsmaster.utils.world.ItemsUtil;
@@ -66,7 +66,7 @@ public void renderButton(float x, float y, float mouseX, float mouseY, String ic
@Override
public void mouseClick(float x, float y, float width, float height, float mouseX, float mouseY, int btn) {
if(Render2DUtils.isHovered(x + 10 + xOffset + itemWidth - 15, y - 3,10,10,(int)mouseX,(int)mouseY) && btn == 0){
- ItemStack heldItem = Wrappers.minecraft().getPlayer().getHeldItem();
+ ItemStack heldItem = Utility.mc.thePlayer.getHeldItem();
if(heldItem != null){
this.setting.addItem(heldItem);
return;
diff --git a/shared/java/top/fpsmaster/ui/click/music/MusicPanel.java b/shared/java/top/fpsmaster/ui/click/music/MusicPanel.java
deleted file mode 100644
index 0098a489..00000000
--- a/shared/java/top/fpsmaster/ui/click/music/MusicPanel.java
+++ /dev/null
@@ -1,432 +0,0 @@
-package top.fpsmaster.ui.click.music;
-
-import com.google.gson.JsonObject;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.ThreadDownloadImageData;
-import net.minecraft.util.ResourceLocation;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.exception.ExceptionHandler;
-import top.fpsmaster.exception.FileException;
-import top.fpsmaster.modules.music.AbstractMusic;
-import top.fpsmaster.modules.music.JLayerHelper;
-import top.fpsmaster.modules.music.MusicPlayer;
-import top.fpsmaster.modules.music.PlayList;
-import top.fpsmaster.modules.music.netease.Music;
-import top.fpsmaster.modules.music.netease.NeteaseApi;
-import top.fpsmaster.modules.music.netease.deserialize.MusicWrapper;
-import top.fpsmaster.ui.click.component.ScrollContainer;
-import top.fpsmaster.ui.common.TextField;
-import top.fpsmaster.utils.os.FileUtils;
-import top.fpsmaster.utils.render.Render2DUtils;
-
-import javax.imageio.ImageIO;
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.util.Base64;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class MusicPanel {
-
- private static PlayList displayList = new PlayList();
- private static PlayList recommendList = new PlayList();
- private static PlayList searchList = new PlayList();
- private static Thread searchThread = null;
-
- private static float playProgress = 0f;
- // private static final SearchBox inputBox = new SearchBox(FPSMaster.i18n.get("music.search"), () -> {
-// searchThread = new Thread(MusicPanel::run);
-// searchThread.start();
-// });
- private static final TextField inputBox = new TextField(FPSMaster.fontManager.s16, FPSMaster.i18n.get("music.search"), new Color(40, 40, 40, 180).getRGB(), -1, 100, () -> {
- searchThread = new Thread(MusicPanel::run);
- searchThread.start();
- });
-
- private static final String[] pages = {"music.name", "music.list", "music.daily"};
- private static int curSearch = 0;
- private static boolean isWaitingLogin = false;
- private static String key = null;
- private static Thread loginThread = null;
- private static final ScrollContainer container = new ScrollContainer();
-
- public static int code = 801;
- public static String nickname = "Unknown";
- public static float x = 0f;
- public static float y = 0f;
- public static float width = 0f;
- public static float height = 0f;
- private static Thread playThread;
-
- public static void mouseClicked(int mouseX, int mouseY, int btn) {
- inputBox.mouseClicked(mouseX, mouseY, btn);
- if (searchThread == null || !searchThread.isAlive()) {
- float dY = y + 50 + container.getRealScroll();
- for (AbstractMusic music : displayList.musics) {
- if (Render2DUtils.isHovered(x, dY, width - 10f, 40f, mouseX, mouseY) && mouseY < y + height - 34 && mouseY > y + 34) {
- if (Mouse.isButtonDown(0)) {
- music.play();
- MusicPlayer.playList.current = MusicPlayer.playList.musics.indexOf(music);
- }
- }
- dY += 40f;
- }
- }
-
- // 搜索
- int xOffset = 0;
- for (int i = 0; i < pages.length; i++) {
- String page = pages[i];
- int width = FPSMaster.fontManager.s16.getStringWidth(FPSMaster.i18n.get(page)) + 10;
- if (Render2DUtils.isHovered(x + 95 + xOffset, y + 8, width, 14f, mouseX, mouseY)) {
- if (Mouse.isButtonDown(0)) {
- curSearch = i;
- if (curSearch == 2) {
- MusicPlayer.playList.pause();
- searchThread = new Thread(() -> {
- recommendList = MusicWrapper.getSongsFromDaily();
- displayList = recommendList;
- setMusicList();
- });
- searchThread.start();
- }
- }
- }
- xOffset += width;
- }
-
- // 操作栏
- AbstractMusic current = MusicPlayer.playList.current();
- if (Render2DUtils.isHovered(x, y + height - 30, width, 4f, mouseX, mouseY)) {
- if (Mouse.isButtonDown(0) && current != null) {
- if (!MusicPlayer.isPlaying) {
- if (playThread != null && playThread.isAlive()) {
- playThread.interrupt();
- }
- playThread = new Thread(
- () -> {
- MusicPlayer.playList.play();
- try {
- Thread.sleep(50);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- current.seek((mouseX - x) / width);
- }
- );
- MusicPlayer.isPlaying = true;
- } else {
- current.seek((mouseX - x) / width);
- }
- }
- }
- if (Render2DUtils.isHovered(x + width / 2 - 35, y + height - 23, 16f, 16f, mouseX, mouseY) && btn == 0) {
- MusicPlayer.playList.previous();
- }
- if (Render2DUtils.isHovered(x + width / 2 + 5, y + height - 23, 16f, 16f, mouseX, mouseY) && btn == 0) {
- MusicPlayer.playList.next();
- }
- if (Render2DUtils.isHovered(x + width / 2 - 15, y + height - 23, 35 / 2f, 35 / 2f, mouseX, mouseY) && btn == 0) {
- if (!MusicPlayer.playList.musics.isEmpty()) {
- if (MusicPlayer.isPlaying) {
- playProgress = MusicPlayer.getPlayProgress();
- MusicPlayer.playList.pause();
- } else {
- FPSMaster.async.runnable(() -> {
- MusicPlayer.playList.current().play();
- try {
- Thread.sleep(50);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- MusicPlayer.playList.current().seek(playProgress);
- });
- MusicPlayer.isPlaying = true;
- }
- }
- }
- if (Render2DUtils.isHovered(x + width / 2 - 55, y + height - 21, 12f, 12f, mouseX, mouseY) && btn == 0) {
- if (MusicPlayer.mode < 2) {
- MusicPlayer.mode++;
- MusicPlayer.playList.setMusicList(displayList.musics);
- } else {
- MusicPlayer.mode = 0;
- }
- }
- }
-
- public static void keyTyped(char c, int keyCode) {
- inputBox.textboxKeyTyped(c, keyCode);
- }
-
- public static void draw(float x, float y, float width, float height, int mouseX, int mouseY, int scaleFactor) {
- if (isWaitingLogin) {
- FPSMaster.fontManager.s18.drawCenteredString("<", x + 20, y + 20, new Color(234, 234, 234).getRGB());
- if (Render2DUtils.isHovered(x + 20, y + 20, 20f, 20f, mouseX, mouseY) && Mouse.isButtonDown(0)) {
- isWaitingLogin = false;
- }
- try {
- ResourceLocation resourceLocation = new ResourceLocation("music/qr");
- Render2DUtils.drawImage(resourceLocation, x + width / 2 - 45, y + height / 2 - 45, 90f, 90f, -1);
- } catch (Exception e) {
- // Handle exception
- }
- String scan = "";
- switch (code) {
- case 801:
- scan = "music.waitscan";
- break;
- case 802:
- scan = "music.waitconfirmation";
- break;
- case 800:
- reloadImg();
- code = 801;
- break;
- case 803:
- isWaitingLogin = false;
- break;
- }
- FPSMaster.fontManager.s18.drawCenteredString(FPSMaster.i18n.get(scan), x + width / 2, y + height / 2 + 60, new Color(234, 234, 234).getRGB());
- return;
- }
- MusicPanel.x = x;
- MusicPanel.y = y;
- MusicPanel.width = width;
- MusicPanel.height = height;
- if (displayList.musics.isEmpty() && searchThread == null) {
- searchThread = new Thread(() -> searchList = MusicWrapper.searchSongs("C418"));
- searchThread.start();
- }
-
- GL11.glEnable(GL11.GL_SCISSOR_TEST);
- Render2DUtils.doGlScissor(x, y, width, height - 30, scaleFactor);
- if (searchThread == null || !searchThread.isAlive()) {
- AtomicReference dY = new AtomicReference<>(y + 50 + container.getScroll());
- AtomicReference musicHeight = new AtomicReference<>(0f);
-
- Render2DUtils.drawRect(x, dY.get() - 6, width - 10, 0.5f, new Color(100, 100, 100, 50));
- FPSMaster.fontManager.s16.drawString("#", x + 12, dY.get() - 20, new Color(234, 234, 234).getRGB());
- FPSMaster.fontManager.s16.drawString("标题", x + 30, dY.get() - 20, new Color(234, 234, 234).getRGB());
-
- // music list
- container.draw(x, y + 50, width - 5, height - 80, mouseX, mouseY, () -> {
- for (int i = 0; i < displayList.musics.size(); i++) {
- Music music = (Music) displayList.musics.get(i);
- if (Render2DUtils.isHovered(x, dY.get(), width - 10f, 40f, mouseX, mouseY) && mouseY > y + 50 && mouseY < y + height - 34) {
- Render2DUtils.drawOptimizedRoundedRect(x, dY.get(), width - 10, 40f, new Color(200, 200, 200, 50));
- }
- FPSMaster.fontManager.s16.drawCenteredString("" + i, x + 15, dY.get() + 15, new Color(234, 234, 234).getRGB());
- if (dY.get() > y && dY.get() < y + height - 10) {
- if (music.isLoadedImage) {
- Render2DUtils.drawImage(new ResourceLocation("music/netease/" + music.id), x + 30, dY.get() + 10, 20f, 20f, -1);
- } else {
- Render2DUtils.drawOptimizedRoundedRect(x + 30, dY.get() + 10, 20f, 20f, new Color(200, 200, 200, 255));
- }
- }
- FPSMaster.fontManager.s16.drawString(music.name + " " + music.author, x + 60, dY.get() + 10, new Color(234, 234, 234).getRGB());
- FPSMaster.fontManager.s16.drawString(music.author, x + 60, dY.get() + 20, new Color(162, 162, 162).getRGB());
- dY.updateAndGet(v -> v + 40f);
- musicHeight.updateAndGet(v -> v + 40f);
- }
- container.setHeight(musicHeight.get());
- });
-
- } else {
- FPSMaster.fontManager.s18.drawCenteredString("...", x + width / 2, y + 60, new Color(234, 234, 234).getRGB());
- }
- GL11.glDisable(GL11.GL_SCISSOR_TEST);
-
- // 搜索
- inputBox.drawTextBox(x + 5, y + 8, 80f, 16f);
-
- // 分页
- int xOffset = 0;
- int pagesWidth = 0;
- for (String page : pages) {
- pagesWidth += FPSMaster.fontManager.s16.getStringWidth(FPSMaster.i18n.get(page)) + 10;
- }
- Render2DUtils.drawOptimizedRoundedRect(x + 90, y + 8, pagesWidth, 16f, new Color(50, 50, 50, 100).getRGB());
- for (String page : pages) {
- int stringWidth = FPSMaster.fontManager.s16.getStringWidth(FPSMaster.i18n.get(page));
- if (page.equals(pages[curSearch])) {
- Render2DUtils.drawOptimizedRoundedRect(x + 90 + xOffset, y + 8, stringWidth + 10, 16f, -1);
- FPSMaster.fontManager.s16.drawString(FPSMaster.i18n.get(page), x + 95 + xOffset, y + 12, new Color(50, 50, 50).getRGB());
- } else {
- FPSMaster.fontManager.s16.drawString(FPSMaster.i18n.get(page), x + 95 + xOffset, y + 12, -1);
- }
- xOffset += stringWidth + 10;
- }
-
- // login
- if (NeteaseApi.cookies.isEmpty()) {
- if (!nickname.isEmpty()) {
- nickname = "Unknown";
- }
- int stringWidth = FPSMaster.fontManager.s16.getStringWidth(FPSMaster.i18n.get("music.notLoggedIn"));
- if (Render2DUtils.isHovered(x + width - stringWidth - 5, y + 10, stringWidth, 16f, mouseX, mouseY)) {
- FPSMaster.fontManager.s16.drawString(FPSMaster.i18n.get("music.notloggedin"), x + width - stringWidth - 5, y + 10, new Color(234, 234, 234).getRGB());
- if (Mouse.isButtonDown(0)) {
- isWaitingLogin = true;
- reloadImg();
- code = 801;
- }
- } else {
- FPSMaster.fontManager.s16.drawString(FPSMaster.i18n.get("music.notloggedin"), x + width - stringWidth - 5, y + 10, new Color(162, 162, 162).getRGB());
- }
- } else {
- int stringWidth = FPSMaster.fontManager.s16.getStringWidth(nickname);
- FPSMaster.fontManager.s16.drawString(nickname, x + width - stringWidth - 5, y + 10, -1);
- if (Render2DUtils.isHovered(x + width - stringWidth - 5, y + 10, stringWidth, 16f, mouseX, mouseY)) {
- if (Mouse.isButtonDown(0)) {
- isWaitingLogin = true;
- reloadImg();
- code = 801;
- }
- }
- }
-
- // 操作栏
- AbstractMusic current = MusicPlayer.playList.current();
- Render2DUtils.drawRect(x, y + height - 30, width, 2f, new Color(58, 58, 58).getRGB());
- Render2DUtils.drawRect(x, y + height - 30, width * MusicPlayer.getPlayProgress(), 2f, -1);
- if (Render2DUtils.isHovered(x, y + height - 32, width, 4f, mouseX, mouseY)) {
- Render2DUtils.drawRect(x, y + height - 31f, width * MusicPlayer.getPlayProgress(), 4f, -1);
- }
-
- // 音量
- Render2DUtils.drawImage(new ResourceLocation("client/textures/ui/volume.png"), x + width - 50, y + height - 16, 7f, 7f, -1);
- Render2DUtils.drawRect(x + width - 40, y + height - 14, 30f, 2f, new Color(58, 58, 58).getRGB());
- Render2DUtils.drawRect(x + width - 40, y + height - 14, 30 * MusicPlayer.getVolume(), 2f, -1);
- if (Render2DUtils.isHovered(x + width - 40, y + height - 14, 30f, 2f, mouseX, mouseY)) {
- Render2DUtils.drawRect(x + width - 40, y + height - 14.5f, 30 * MusicPlayer.getVolume(), 3f, -1);
- if (Mouse.isButtonDown(0)) {
- float newVolume = (mouseX - x - width + 40) / 30f;
- MusicPlayer.setVolume(newVolume);
- }
- }
- int trimWidth = (int) (width / 2 - 100);
- if (!MusicPlayer.playList.musics.isEmpty() && current != null) {
- String name = FPSMaster.fontManager.s18.trimString(current.name + " - " + current.author, trimWidth, false);
- FPSMaster.fontManager.s18.drawString(name, x + 30, y + height - 23, new Color(234, 234, 234).getRGB());
- String progress = "0:00/0:00";
- if (JLayerHelper.clip != null) {
- double duration = JLayerHelper.getDuration();
- int minutes = (int) (duration * MusicPlayer.getPlayProgress());
- int seconds = (int) ((duration * MusicPlayer.getPlayProgress() - minutes) * 60);
- progress = minutes + ":" + seconds + "/" + (int) duration + ":" + (int) ((duration - (int) duration) * 60);
- }
- FPSMaster.fontManager.s16.drawString(progress, x + 30, y + height - 14, new Color(162, 162, 162).getRGB());
- if (MusicPlayer.playList.current() != null && ((Music) MusicPlayer.playList.current()).isLoadedImage) {
- Render2DUtils.drawImage(new ResourceLocation("music/netease/" + ((Music) MusicPlayer.playList.current()).id), x + 5, y + height - 24, 20f, 20f, -1);
- } else {
- Render2DUtils.drawOptimizedRoundedRect(x + 5, y + height - 24, 20f, 20f, new Color(200, 200, 200, 255));
- }
- }
- ResourceLocation res = new ResourceLocation("client/gui/settings/music/loop.png");
- switch (MusicPlayer.mode) {
- case 0:
- res = new ResourceLocation("client/gui/settings/music/shuffle.png");
- break;
- case 1:
- res = new ResourceLocation("client/gui/settings/music/order.png");
- break;
- case 2:
- res = new ResourceLocation("client/gui/settings/music/loop.png");
- break;
- }
- Render2DUtils.drawImage(res, x + width / 2 - 55, y + height - 21, 12f, 12f, new Color(234, 234, 234));
- Render2DUtils.drawImage(new ResourceLocation("client/gui/settings/music/previous.png"), x + width / 2 - 35, y + height - 23, 16f, 16f, new Color(234, 234, 234));
- Render2DUtils.drawImage(MusicPlayer.isPlaying ? new ResourceLocation("client/gui/settings/music/pause.png") : new ResourceLocation("client/gui/settings/music/play.png"), x + width / 2 - 15, y + height - 23, 35 / 2f, 35 / 2f, -1);
- Render2DUtils.drawImage(new ResourceLocation("client/gui/settings/music/next.png"), x + width / 2 + 5, y + height - 23, 16f, 16f, new Color(234, 234, 234));
- }
-
- private static String extractMiddleContent(String input, String prefix, String suffix) {
- int startIndex = input.indexOf(prefix);
- if (startIndex != -1) {
- int endIndex = input.indexOf(suffix, startIndex + prefix.length());
- if (endIndex != -1) {
- return input.substring(startIndex + prefix.length(), endIndex);
- }
- }
- return "";
- }
-
- private static void reloadImg() {
- loginThread = new Thread(() -> {
- while (isWaitingLogin) {
- try {
- JsonObject loginStatus = MusicWrapper.getLoginStatus(key);
- code = loginStatus.get("code").getAsInt();
- if (code == 802) {
- String element = loginStatus.get("nickname").getAsString();
- if (element != null) {
- nickname = element;
- try {
- FileUtils.saveTempValue("nickname", nickname);
- } catch (FileException e) {
- ExceptionHandler.handleFileException(e, "无法保存昵称");
- }
- }
- }
- if (code == 803) {
- // parse cookie
- String asString = loginStatus.get("cookie").getAsString();
- String result = "MUSIC_U=" + extractMiddleContent(asString, "MUSIC_U=", ";") + "; " + "NMTID=" + extractMiddleContent(asString, "NMTID=", ";");
- NeteaseApi.cookies = result;
-
- try {
- FileUtils.saveTempValue("cookies", NeteaseApi.cookies);
- System.out.println("cookies: " + NeteaseApi.cookies);
- } catch (FileException e) {
- ExceptionHandler.handleFileException(e, "无法保存cookies");
- }
- }
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- }
- });
- FPSMaster.async.runnable(() -> {
- key = MusicWrapper.getQRKey();
- if (key == null) return;
- String base64 = MusicWrapper.getQRCodeImg(key);
- // render base64 img data
- net.minecraft.client.renderer.texture.TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
- // base64 decode
- byte[] bytes = Base64.getDecoder().decode(base64);
- // create resource location
- ResourceLocation resourceLocation = new ResourceLocation("music/qr");
- try {
- ThreadDownloadImageData textureArt = new ThreadDownloadImageData(null, null, resourceLocation, null);
- // convert bytes to bufferedimage
- ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
- BufferedImage bufferedImage = ImageIO.read(bis);
- textureArt.setBufferedImage(bufferedImage);
- textureManager.loadTexture(resourceLocation, textureArt);
- loginThread.start();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- });
- }
-
- private static void setMusicList() {
- MusicPlayer.playList.setMusicList(displayList.musics);
- }
-
- private static void run() {
- if (!inputBox.getText().isEmpty()) {
- searchList = curSearch == 0 ? MusicWrapper.searchSongs(inputBox.getText()) : MusicWrapper.searchList(inputBox.getText());
- displayList = searchList;
- MusicPlayer.playList.pause();
- setMusicList();
- searchThread = null;
- }
- }
-}
diff --git a/shared/java/top/fpsmaster/ui/click/music/NewMusicPanel.java b/shared/java/top/fpsmaster/ui/click/music/NewMusicPanel.java
deleted file mode 100644
index ae1e2604..00000000
--- a/shared/java/top/fpsmaster/ui/click/music/NewMusicPanel.java
+++ /dev/null
@@ -1,457 +0,0 @@
-package top.fpsmaster.ui.click.music;
-
-import com.google.gson.JsonObject;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.ThreadDownloadImageData;
-import net.minecraft.client.renderer.texture.TextureManager;
-import net.minecraft.util.ResourceLocation;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-import top.fpsmaster.FPSMaster;
-import top.fpsmaster.exception.ExceptionHandler;
-import top.fpsmaster.exception.FileException;
-import top.fpsmaster.font.impl.UFontRenderer;
-import top.fpsmaster.forge.api.IMinecraft;
-import top.fpsmaster.modules.music.*;
-import top.fpsmaster.modules.music.netease.Music;
-import top.fpsmaster.modules.music.netease.NeteaseApi;
-import top.fpsmaster.modules.music.netease.NeteaseProfile;
-import top.fpsmaster.modules.music.netease.deserialize.MusicWrapper;
-import top.fpsmaster.ui.click.component.ScrollContainer;
-import top.fpsmaster.ui.common.TextField;
-import top.fpsmaster.utils.math.animation.Animation;
-import top.fpsmaster.utils.math.animation.Type;
-import top.fpsmaster.utils.os.FileUtils;
-import top.fpsmaster.utils.render.Render2DUtils;
-
-import java.awt.*;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Base64;
-
-import static top.fpsmaster.utils.Utility.mc;
-
-public class NewMusicPanel {
-
- // Threads
- private static Thread loginThread = null;
- private static Thread songsLoadThread = null;
- private static Thread playThread = null;
-
- // login
- static boolean isWaitingLogin = false;
- static int loginCode;
- public static String nickname = "";
- private static String key;
- private static ArrayList