mirror of
https://github.com/TheWhiteDog9487/ServerAddressSpaceFix.git
synced 2025-09-15 23:16:57 +00: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:
@@ -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"
|
||||
},
|
||||
|
Reference in New Issue
Block a user