-
Notifications
You must be signed in to change notification settings - Fork 77
Fix mod list #592
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
Merged
Merged
Fix mod list #592
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e1ec80f
fix(mod-list): layout and search
RuiXuqi 71d5393
fix(config): hasConfigForMod for class configs
RuiXuqi 9d10d88
fix(mod-list): supress warning
RuiXuqi 18fe255
fix(mod-list): zh_cn.lang
RuiXuqi 999840e
refactor: Standardize logos
RuiXuqi 6ea4f05
fix(mod-list): GuiModList loaded before late mixins
RuiXuqi 5d48a7b
fix(mod-list): cache not loaded when icon failed
RuiXuqi db46ea1
fix(mod-list): remove mod id check to align
RuiXuqi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
patches/minecraft/net/minecraft/client/gui/GuiListExtended.java.patch
This file contains hidden or 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,20 @@ | ||
| --- before/net/minecraft/client/gui/GuiListExtended.java | ||
| +++ after/net/minecraft/client/gui/GuiListExtended.java | ||
| @@ -59,7 +59,7 @@ | ||
|
|
||
| if (i >= 0) | ||
| { | ||
| - int j = this.left + this.width / 2 - this.getListWidth() / 2 + 2; | ||
| + int j = this.getListEntryLeft(); | ||
| int k = this.top + 4 - this.getAmountScrolled() + i * this.slotHeight + this.headerPadding; | ||
| int l = mouseX - j; | ||
| int i1 = mouseY - k; | ||
| @@ -79,7 +79,7 @@ | ||
| { | ||
| for (int i = 0; i < this.getSize(); i++) | ||
| { | ||
| - int j = this.left + this.width / 2 - this.getListWidth() / 2 + 2; | ||
| + int j = this.getListEntryLeft(); | ||
| int k = this.top + 4 - this.getAmountScrolled() + i * this.slotHeight + this.headerPadding; | ||
| int l = x - j; | ||
| int i1 = y - k; |
This file contains hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
src/main/java/com/cleanroommc/client/modlist/LegacyModListScreen.java
This file contains hidden or 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,7 @@ | ||
| package com.cleanroommc.client.modlist; | ||
|
|
||
| import net.minecraft.client.gui.GuiScreen; | ||
|
|
||
| public interface LegacyModListScreen { | ||
| GuiScreen getParent(); | ||
| } |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ | |
| import java.util.Set; | ||
|
|
||
| /// <h1>Experimental</h1> | ||
| /// | ||
| public interface IModData { | ||
| Type getType(); | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一定要在patches加那麼多方法?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原版是固定卡位置在中间的,不 patch 没法控制 layout,就会像当前这样左边空出来一点,很丑。
Override 也是可以的,但是你在 refactor 的时候把这些删了,就不考虑了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
每個用
GuiSlot的不會突然出錯嗎?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GuiTextField也是There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的计算方法是和原版一致的,除非真的有人 mixin 这个特定的赋值,不然一般不会出错。
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个确实可以考虑继续写在 Override,看你了。
我觉得可以当作原版的 Bug 处理,在更新一点的 MC 版本这几个地方都补上 callback 了。