-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
228af67
commit 1bc8b1b
Showing
29 changed files
with
368 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
## New Features 🚀🚀🚀 | ||
|
||
- Fixed a bunch of bugs 😢 | ||
- Fixed the problem that there is a certain chance of JVM crash when starting the Mod version under macOS | ||
- Fixed the issue of UI freeze on the download page | ||
- There is still a bunch of bugs 🤮 | ||
- Added useless "Developer Mode" (preparing for the arrival of the extensions) | ||
- Too many to describe | ||
- Enhanced skin management | ||
- The new file is filled with Minecraft official JVM optimization parameters by default | ||
- Support displaying "Epherome" in the lower left corner of the Minecraft page | ||
- Adjusted some things you won't notice | ||
|
||
## Notice | ||
|
||
-The next version will definitely be downloaded by Forge/Fabric/LiteLoader/Optifine! ! ! | ||
|
||
## 新特性 🚀🚀🚀 | ||
|
||
- 修复了一坨 Bug 😢 | ||
- 修复了在 macOS 下启动 Mod 版本有一定几率 JVM 参数失调的问题 | ||
- 修复了下载页面 UI 卡顿的问题 | ||
- 还有一坨 Bug 🤮 | ||
- 增加了没用的「开发者模式」(为扩展系统的到来做准备) | ||
- 多到无法描述 | ||
- 增强了皮肤管理功能 | ||
- 对新档案默认填充了 Minecraft 官方的 JVM 优化参数 | ||
- 支持在 Minecraft 页面左下角展示「Epherome」 | ||
- 调整了一些你不会注意到的东西 | ||
|
||
## 注意 | ||
|
||
- 下个版本一定会有 Forge/Fabric/LiteLoader/Optifine 下载的!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useState } from "react"; | ||
import { DefaultFn, LoadingStatus, unwrapFunction } from "../tools"; | ||
|
||
export default function Image(props: { | ||
src: string; | ||
className?: string; | ||
rounded?: boolean; | ||
onError?: DefaultFn; | ||
}): JSX.Element { | ||
const [status, setStatus] = useState<LoadingStatus>("pending"); | ||
|
||
return ( | ||
<img | ||
className={`${props.className ?? ""} ${ | ||
props.rounded ? "rounded-lg" : "" | ||
} ${status !== "done" ? "invisible" : ""}`} | ||
src={props.src} | ||
onLoad={() => setStatus("done")} | ||
onError={() => { | ||
setStatus("error"); | ||
unwrapFunction(props.onError)(); | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { spawnSync } from "child_process"; | ||
import findJavaHome from "find-java-home"; | ||
import { nanoid } from "nanoid"; | ||
import path from "path"; | ||
import { Java } from "../struct/java"; | ||
|
||
export function defaultJvmArgs(): string { | ||
return "-Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"; | ||
} | ||
|
||
export function checkJavaVersion(dir: string): Promise<Java | null> { | ||
return new Promise((resolve) => { | ||
try { | ||
const proc = spawnSync(dir, ["-version"]); | ||
if (proc.error) { | ||
resolve(null); | ||
} else { | ||
const data = proc.stderr.toString(); | ||
const name = data.match(/"(.*?)"/)?.pop(); | ||
if (name) { | ||
resolve({ | ||
nanoid: nanoid(), | ||
dir, | ||
name, | ||
is64Bit: data.toLowerCase().includes("64-bit"), | ||
}); | ||
} else { | ||
resolve(null); | ||
} | ||
} | ||
} catch { | ||
resolve(null); | ||
} | ||
}); | ||
} | ||
|
||
export function detectJava(): Promise<Java | null> { | ||
return new Promise((resolve, reject) => | ||
findJavaHome((err, res) => { | ||
if (err) { | ||
resolve(null); | ||
} else { | ||
checkJavaVersion(path.join(res, "bin", "java")) | ||
.then(resolve) | ||
.catch(reject); | ||
} | ||
}) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import path from "path"; | ||
import Image from "../components/Image"; | ||
import { downloadFile } from "../models/files"; | ||
import { userDataPath } from "../struct/config"; | ||
|
||
export const steveId = "MHF_Steve"; | ||
export const alexId = "MHF_Alex"; | ||
|
||
export function Avatar(props: { uuid: string }): JSX.Element { | ||
return ( | ||
<Image | ||
src={`https://mc-heads.net/avatar/${props.uuid}`} | ||
className="w-7 h-7" | ||
rounded | ||
/> | ||
); | ||
} | ||
|
||
export function Body(props: { uuid: string }): JSX.Element { | ||
return ( | ||
<Image | ||
className="w-40" | ||
src={`https://mc-heads.net/body/${props.uuid}`} | ||
rounded | ||
/> | ||
); | ||
} | ||
|
||
export async function downloadSkin(uuid: string): Promise<string> { | ||
const skinsDir = path.join(userDataPath, "skins"); | ||
const target = path.join(skinsDir, `${uuid}.png`); | ||
await downloadFile(`https://mc-heads.net/download/${uuid}`, target); | ||
return target; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.