mirror of
https://github.com/TheWhiteDog9487/ServerAddressSpaceFix.git
synced 2024-11-23 21:27:04 +08:00
0.1.2
时间:2023 10 28 主要内容:融合由 JustAlittleWolf 提交的PR,修复刷新按钮的问题。 [PR链接](https://github.com/TheWhiteDog9487/ServerAddressSpaceFix/pull/1) 然后我把trim方法替换成了更加激进的replace,这样就算是地址中间有空格也没问题。 然后fabric.mod.json中的Homepage属性从Github改成了Modrinth 并且更改了Gradle构造的输出文件名
This commit is contained in:
parent
082c354873
commit
eb72da348e
@ -2,6 +2,10 @@
|
||||
本模组意在修复一个2021年11月26号被报告但一直未修复的Bug
|
||||
[漏洞追踪器链接](https://bugs.mojang.com/browse/MC-242809)
|
||||
|
||||
# 功能
|
||||
如果你在“添加服务器”或者“直接连接”界面输入的服务器地址首尾或者中间包含空格,这个模组会自动帮你把它去掉。
|
||||
以防止上面提到的“未知的主机”Bug的出现。
|
||||
|
||||
# 为什么会有这个模组
|
||||
前几个月吧,我想玩一个服务器。从那个服务器的官网把地址复制下来,粘贴到“服务器地址”中保存之后,居然出现了“未知的主机”。
|
||||
莫慌,这显然是DNS没查找到对应的地址,先Ping一下。
|
||||
@ -21,8 +25,7 @@ Ping能找到域名对应的地址,然后我又怀疑是长城又在搞什么
|
||||
**所以,有了这个模组。**
|
||||
|
||||
# 已知问题
|
||||
- 必须在服务器MOTD被加载出来之后,才能使用刷新按钮,不然被弄掉的空格自己又会回来,我也不知道为什么。
|
||||
|
||||
所有已知问题均被修复,如果有新的欢迎通知我。
|
||||
如果有谁愿意帮我把Bug修了,欢迎提交PR╰(*°▽°*)╯
|
||||
|
||||
# 开源许可
|
||||
|
@ -9,9 +9,9 @@ yarn_mappings=1.20.2+build.4
|
||||
loader_version=0.14.23
|
||||
|
||||
# Mod Properties
|
||||
mod_version=0.1.1
|
||||
mod_version=0.1.2
|
||||
maven_group=xyz.thewhitedog9487
|
||||
archives_base_name=twd-sasf
|
||||
archives_base_name=ServerAddressSpaceFix
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.90.0+1.20.2
|
||||
|
@ -1,15 +0,0 @@
|
||||
package xyz.thewhitedog9487.mixin.client;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(MinecraftClient.class)
|
||||
public class ExampleClientMixin {
|
||||
@Inject(at = @At("HEAD"), method = "run")
|
||||
private void run(CallbackInfo info) {
|
||||
// This code is injected into the start of MinecraftClient.run()V
|
||||
}
|
||||
}
|
@ -9,6 +9,4 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
public class MixinAddServerScreen {
|
||||
@Redirect(method = "addAndClose", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;getText()Ljava/lang/String;", ordinal = 1))
|
||||
private String trimGetText(TextFieldWidget instance) {
|
||||
return instance.getText().trim();
|
||||
}
|
||||
}
|
||||
return instance.getText().replace(" ", "");}}
|
@ -9,8 +9,6 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
public class MixinDirectConnectScreen {
|
||||
@Redirect(method = "saveAndClose", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;getText()Ljava/lang/String;"))
|
||||
private String trimGetText(TextFieldWidget instance) {
|
||||
String trimmedText = instance.getText().trim();
|
||||
String trimmedText = instance.getText().replace(" ", "");
|
||||
((DirectConnectScreenAccessor) this).Mixin_GetAddressField().setText(trimmedText);
|
||||
return trimmedText;
|
||||
}
|
||||
}
|
||||
return trimmedText;}}
|
||||
|
@ -1,15 +0,0 @@
|
||||
package xyz.thewhitedog9487.mixin;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(MinecraftServer.class)
|
||||
public class ExampleMixin {
|
||||
@Inject(at = @At("HEAD"), method = "loadWorld")
|
||||
private void init(CallbackInfo info) {
|
||||
// This code is injected into the start of MinecraftServer.loadWorld()V
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
"TheWhiteDog9487"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://github.com/TheWhiteDog9487/ServerAddressSpaceFix",
|
||||
"homepage": "https://modrinth.com/mod/serveraddressspacefix",
|
||||
"sources": "https://github.com/TheWhiteDog9487/ServerAddressSpaceFix",
|
||||
"issues": "https://github.com/TheWhiteDog9487/ServerAddressSpaceFix/issues"
|
||||
},
|
||||
|
7
更新日志 ChangeLog.md
Normal file
7
更新日志 ChangeLog.md
Normal file
@ -0,0 +1,7 @@
|
||||
# 0.1.2
|
||||
时间:2023 10 28
|
||||
主要内容:融合由 JustAlittleWolf 提交的PR,修复刷新按钮的问题。
|
||||
[PR链接](https://github.com/TheWhiteDog9487/ServerAddressSpaceFix/pull/1)
|
||||
然后我把trim方法替换成了更加激进的replace,这样就算是地址中间有空格也没问题。
|
||||
然后fabric.mod.json中的Homepage属性从Github改成了Modrinth
|
||||
并且更改了Gradle构造的输出文件名
|
Loading…
Reference in New Issue
Block a user