19w13b - Rebuild this when ViaBackwards#103 and ViaRewind#109 are merged

This commit is contained in:
creeper123123321 2019-03-30 17:47:01 -03:00
parent 16519d6f35
commit 16929d5e2e
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
3 changed files with 15 additions and 32 deletions

View File

@ -31,7 +31,7 @@ repositories {
}
tasks.getByName<ProcessResources>("processResources").apply {
tasks.named<ProcessResources>("processResources") {
filter<ReplaceTokens>("tokens" to mapOf(
"version" to project.property("version"),
"description" to project.property("description")
@ -43,17 +43,17 @@ configurations.getByName("compile").extendsFrom(shade)
dependencies {
// transitive = false, viabackwards-core because Guava is conflicting on runClient
shade("us.myles:viaversion:2.0.0-19w12b") { isTransitive = false }
shade("us.myles:viaversion:2.0.0-19w13b") { isTransitive = false }
shade("de.gerrygames:viarewind-core:1.4.0") { isTransitive = false }
shade("nl.matsv:viabackwards-core:3.0.0-19w11b") { isTransitive = false }
shade("nl.matsv:viabackwards-core:3.0.0-19w13b") { isTransitive = false }
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
minecraft("com.mojang:minecraft:19w12b")
mappings("net.fabricmc:yarn:19w12b.3")
minecraft("com.mojang:minecraft:19w13b")
mappings("net.fabricmc:yarn:19w13b.2")
modCompile("net.fabricmc:fabric-loader:0.3.7.109")
modCompile("net.fabricmc:fabric:0.2.5.114")
modCompile("net.fabricmc:fabric:0.2.6.117")
}
tasks.named<Jar>("jar") {

View File

@ -63,9 +63,9 @@ public abstract class MixinMultiplayerScreen extends Screen {
throw e;
}
@Inject(method = "method_2540", at = @At("TAIL"))
private void onInitWidgets(CallbackInfo ci) {
protocolVersion = new TextFieldWidget(fontRenderer, this.screenWidth / 2 + 88, 13, 65, 15);
@Inject(method = "init", at = @At("TAIL"))
private void onInit(CallbackInfo ci) {
protocolVersion = new TextFieldWidget(font, this.width / 2 + 88, 13, 65, 15);
protocolVersion.method_1890(new VersionFormatFilter());
protocolVersion.setChangedListener((text) -> {
protocolVersion.setSuggestion(null);
@ -101,9 +101,9 @@ public abstract class MixinMultiplayerScreen extends Screen {
protocolVersion.setText(ProtocolVersion.isRegistered(clientSideVersion)
? ProtocolVersion.getProtocol(clientSideVersion).getName()
: Integer.toString(clientSideVersion));
this.listeners.add(protocolVersion);
this.children.add(protocolVersion);
enableClientSideViaVersion = new ButtonWidget(this.screenWidth / 2 + 48, 13, 105, 15,
enableClientSideViaVersion = new ButtonWidget(this.width / 2 + 48, 13, 105, 15,
I18n.translate("gui.enable_client_side_button"), button ->
MinecraftClient.getInstance().openScreen(new YesNoScreen(
(answer, id) -> {
@ -129,18 +129,13 @@ public abstract class MixinMultiplayerScreen extends Screen {
addButton(enableClientSideViaVersion);
}
@Inject(method = "render",
at = {
@At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Screen;render(IIF)V"),
@At(value = "INVOKE", target = "Lnet/minecraft/class_437;render(IIF)V") // Generated refmap doesn't have it
},
remap = false)
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Screen;render(IIF)V"))
private void onRender(int int_1, int int_2, float float_1, CallbackInfo ci) {
protocolVersion.render(int_1, int_2, float_1);
}
@Inject(method = "update", at = @At("TAIL"))
private void onUpdate(CallbackInfo ci) {
@Inject(method = "tick", at = @At("TAIL"))
private void onTick(CallbackInfo ci) {
protocolVersion.tick();
}

View File

@ -1575,19 +1575,7 @@ public class Protocol1_8TO1_7_6_10 extends Protocol {
packetWrapper.writeToBuffer(newPacketBuf);
PacketWrapper newWrapper = new PacketWrapper(0x17, newPacketBuf, packetWrapper.user());
newWrapper.passthrough(Type.STRING);
final int[] length = new int[1];
newWrapper.read(new Type<Void>(Void.class) {
@Override
public Void read(ByteBuf byteBuf) {
length[0] = byteBuf.readableBytes();
return null;
}
@Override
public void write(ByteBuf byteBuf, Void aVoid) {
}
});
newWrapper.write(Type.SHORT, (short) length[0]);
newWrapper.write(Type.SHORT, (short) newPacketBuf.readableBytes());
newWrapper.sendToServer(Protocol1_8TO1_7_6_10.class, true, true);
}
});