Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add neofetch in Minecraft #108

Closed
wants to merge 10 commits into from
Closed

Add neofetch in Minecraft #108

wants to merge 10 commits into from

Conversation

zly2006
Copy link
Owner

@zly2006 zly2006 commented Apr 13, 2024

Description/描述

Neofetch is a command-line system information tool, with an ascii logo of your system distro.

This PR add this in Minecraft

Related Issues/相关的 issue

n/a

Checklist/清单

  • My changes generate no new warnings/我的修改没有产生新的警告
  • My code builds and runs on my machine/我的代码在我的电脑上可以编译和运行
  • I documented my code/我已经为我的代码添加了注释/文档

Screenshots

Screenshot

Signed-off-by: Liyan Zhao <return65535@qq.com>
Signed-off-by: Liyan Zhao <return65535@qq.com>
Signed-off-by: Liyan Zhao <return65535@qq.com>
Signed-off-by: Liyan Zhao <return65535@qq.com>
Signed-off-by: Liyan Zhao <return65535@qq.com>
@zly2006 zly2006 self-assigned this Apr 13, 2024
@zly2006 zly2006 requested a review from Cubik65536 April 13, 2024 03:29
Signed-off-by: Liyan Zhao <return65535@qq.com>
Signed-off-by: Liyan Zhao <return65535@qq.com>
@Cubik65536
Copy link
Collaborator

Um... just call it "info fetch" or similar stuff, don't directly use neofetch if possible, it is sometimes great not to refer to another software.

@zly2006
Copy link
Owner Author

zly2006 commented Apr 13, 2024

Um... just call it "info fetch" or similar stuff, don't directly use neofetch if possible, it is sometimes great not to refer to another software.

how about minefetch?

@Cubik65536
Copy link
Collaborator

Um... just call it "info fetch" or similar stuff, don't directly use neofetch if possible, it is sometimes great not to refer to another software.

how about minefetch?

sure

@Cubik65536
Copy link
Collaborator

and do rename files in the code according to the new name

Signed-off-by: Liyan Zhao <return65535@qq.com>
Comment on lines +163 to +174
literal("chars").executes {
val renderer = MinecraftClient.getInstance().textRenderer
val width = renderer.getWidth(" ")
(0x20..0x7E)
.map { it.toChar() }
.groupBy { renderer.getWidth(it.toString()) }
.forEach {
println("${it.key}: ${it.value.joinToString("")}")
}
1
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this command used for?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get chars that have the same width to generate ascii art

@zly2006
Copy link
Owner Author

zly2006 commented Apr 19, 2024

Minecraft font is not in the same width, we can only get the width from the client, and the algorithm to compute width would be so complicated and problematic.

I think we should use network packets to compute on the client side, or use a monospaced font and add it to Minecraft using resourcepacks.

But there are still some problems:

  1. mojang does not support rtf fonts well: https://forums.minecraftforge.net/topic/107600-possible-to-use-ttf-file-format-for-custom-font/
  2. Try to find a pixelated monospaced font (i have no idea)
  3. use mod

@zly2006
Copy link
Owner Author

zly2006 commented Apr 19, 2024

2024-04-20 02 40 23

totally broken(font: hack nerd mono)......

@zly2006
Copy link
Owner Author

zly2006 commented Apr 22, 2024

Minecraft font is not in the same width, we can only get the width from the client, and the algorithm to compute width would be so complicated and problematic.

I think we should use network packets to compute on the client side, or use a monospaced font and add it to Minecraft using resourcepacks.

But there are still some problems:

  1. mojang does not support rtf fonts well: https://forums.minecraftforge.net/topic/107600-possible-to-use-ttf-file-format-for-custom-font/
  2. Try to find a pixelated monospaced font (i have no idea)
  3. use mod

@lovexyn0827 @wafarm 两位有没有什么建议?关于等宽字符

# Conflicts:
#	build.gradle.kts
#	src/main/java/com/github/zly2006/reden/Reden.kt
Signed-off-by: Liyan Zhao <return65535@qq.com>
@zly2006 zly2006 deleted the branch 1.20.4 July 15, 2024 10:29
@zly2006 zly2006 closed this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants