mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-10-05 05:17:29 +02:00
1.14, name class consistency, stop jar-in-a-jar'ing fabric api
https://discordapp.com/channels/507304429255393322/507304986921664533/570200398036467732
This commit is contained in:
parent
bd6b583447
commit
6473f2ef2e
@ -40,8 +40,8 @@ tasks.named<ProcessResources>("processResources") {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// transitive = false, viabackwards-core because Guava is conflicting on runClient
|
// transitive = false, viabackwards-core because Guava is conflicting on runClient
|
||||||
compile("us.myles:viaversion:2.0.0-1.14-pre5") { isTransitive = false }
|
compile("us.myles:viaversion:2.0.1-SNAPSHOT") { isTransitive = false }
|
||||||
include("us.myles:viaversion:2.0.0-1.14-pre5")
|
include("us.myles:viaversion:2.0.1-SNAPSHOT")
|
||||||
compile("de.gerrygames:viarewind-core:1.4.0") { isTransitive = false }
|
compile("de.gerrygames:viarewind-core:1.4.0") { isTransitive = false }
|
||||||
include("de.gerrygames:viarewind-core:1.4.0")
|
include("de.gerrygames:viarewind-core:1.4.0")
|
||||||
compile("nl.matsv:viabackwards-core:3.0.0-19w11b") { isTransitive = false } // todo update
|
compile("nl.matsv:viabackwards-core:3.0.0-19w11b") { isTransitive = false } // todo update
|
||||||
@ -49,12 +49,11 @@ dependencies {
|
|||||||
|
|
||||||
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
|
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
|
||||||
|
|
||||||
minecraft("com.mojang:minecraft:1.14 Pre-Release 5")
|
minecraft("com.mojang:minecraft:1.14")
|
||||||
mappings("net.fabricmc:yarn:1.14 Pre-Release 5+build.6")
|
mappings("net.fabricmc:yarn:1.14+build.1")
|
||||||
modCompile("net.fabricmc:fabric-loader:0.4.2+build.131")
|
modCompile("net.fabricmc:fabric-loader:0.4.2+build.132")
|
||||||
|
|
||||||
modCompile("net.fabricmc:fabric:0.2.7+build.127")
|
modCompile("net.fabricmc:fabric:0.2.7+build.127")
|
||||||
include("net.fabricmc:fabric:0.2.7+build.127")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
|
@ -26,8 +26,8 @@ package com.github.creeper123123321.viafabric;
|
|||||||
|
|
||||||
import com.github.creeper123123321.viafabric.commands.VRCommandHandler;
|
import com.github.creeper123123321.viafabric.commands.VRCommandHandler;
|
||||||
import com.github.creeper123123321.viafabric.platform.*;
|
import com.github.creeper123123321.viafabric.platform.*;
|
||||||
import com.github.creeper123123321.viafabric.protocol.protocol1_7_6_10to1_7_1_5.Protocol1_7_6_10to1_7_1_5;
|
import com.github.creeper123123321.viafabric.protocol.protocol1_7_6_10to1_7_1_5.Protocol1_7_6_10To1_7_1_5;
|
||||||
import com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.Protocol1_8TO1_7_6_10;
|
import com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.Protocol1_8To1_7_6_10;
|
||||||
import com.github.creeper123123321.viafabric.util.JLoggerToLog4j;
|
import com.github.creeper123123321.viafabric.util.JLoggerToLog4j;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import com.mojang.brigadier.CommandDispatcher;
|
import com.mojang.brigadier.CommandDispatcher;
|
||||||
@ -90,8 +90,8 @@ public class ViaFabric implements ModInitializer {
|
|||||||
.commandHandler(new VRCommandHandler())
|
.commandHandler(new VRCommandHandler())
|
||||||
.platform(new VRPlatform()).build());
|
.platform(new VRPlatform()).build());
|
||||||
Via.getManager().init();
|
Via.getManager().init();
|
||||||
ProtocolRegistry.registerProtocol(new Protocol1_7_6_10to1_7_1_5(), Collections.singletonList(ProtocolVersion.v1_7_6.getId()), ProtocolVersion.v1_7_1.getId());
|
ProtocolRegistry.registerProtocol(new Protocol1_7_6_10To1_7_1_5(), Collections.singletonList(ProtocolVersion.v1_7_6.getId()), ProtocolVersion.v1_7_1.getId());
|
||||||
ProtocolRegistry.registerProtocol(new Protocol1_8TO1_7_6_10(), Collections.singletonList(ProtocolVersion.v1_8.getId()), ProtocolVersion.v1_7_6.getId());
|
ProtocolRegistry.registerProtocol(new Protocol1_8To1_7_6_10(), Collections.singletonList(ProtocolVersion.v1_8.getId()), ProtocolVersion.v1_7_6.getId());
|
||||||
new VRRewindPlatform().init();
|
new VRRewindPlatform().init();
|
||||||
// new VRBackwardsPlatform().init(); todo reenable when viabackwards is updated
|
// new VRBackwardsPlatform().init(); todo reenable when viabackwards is updated
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import us.myles.ViaVersion.api.type.Type;
|
|||||||
import us.myles.ViaVersion.packets.State;
|
import us.myles.ViaVersion.packets.State;
|
||||||
|
|
||||||
// Based on https://github.com/Gerrygames/ClientViaVersion
|
// Based on https://github.com/Gerrygames/ClientViaVersion
|
||||||
public class Protocol1_7_6_10to1_7_1_5 extends Protocol {
|
public class Protocol1_7_6_10To1_7_1_5 extends Protocol {
|
||||||
public static final ValueTransformer<String, String> INSERT_DASHES = new ValueTransformer<String, String>(Type.STRING) {
|
public static final ValueTransformer<String, String> INSERT_DASHES = new ValueTransformer<String, String>(Type.STRING) {
|
||||||
@Override
|
@Override
|
||||||
public String transform(PacketWrapper packetWrapper, String s) {
|
public String transform(PacketWrapper packetWrapper, String s) {
|
@ -34,10 +34,6 @@ import de.gerrygames.viarewind.protocol.protocol1_7_6_10to1_8.types.Types1_7_6_1
|
|||||||
import de.gerrygames.viarewind.utils.ChatUtil;
|
import de.gerrygames.viarewind.utils.ChatUtil;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.md_5.bungee.api.chat.TranslatableComponent;
|
|
||||||
import net.md_5.bungee.chat.ComponentSerializer;
|
|
||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
@ -52,7 +48,11 @@ import us.myles.ViaVersion.api.type.types.CustomByteType;
|
|||||||
import us.myles.ViaVersion.api.type.types.VoidType;
|
import us.myles.ViaVersion.api.type.types.VoidType;
|
||||||
import us.myles.ViaVersion.api.type.types.version.Types1_8;
|
import us.myles.ViaVersion.api.type.types.version.Types1_8;
|
||||||
import us.myles.ViaVersion.packets.State;
|
import us.myles.ViaVersion.packets.State;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||||
|
import us.myles.viaversion.libs.bungeecordchat.api.ChatColor;
|
||||||
|
import us.myles.viaversion.libs.bungeecordchat.api.chat.TextComponent;
|
||||||
|
import us.myles.viaversion.libs.bungeecordchat.api.chat.TranslatableComponent;
|
||||||
|
import us.myles.viaversion.libs.bungeecordchat.chat.ComponentSerializer;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.ListTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.ListTag;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.StringTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.StringTag;
|
||||||
@ -64,7 +64,7 @@ import java.util.List;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
// Based on https://github.com/Gerrygames/ClientViaVersion
|
// Based on https://github.com/Gerrygames/ClientViaVersion
|
||||||
public class Protocol1_8TO1_7_6_10 extends Protocol {
|
public class Protocol1_8To1_7_6_10 extends Protocol {
|
||||||
private static ValueReader<Position> xyzToPosition = packetWrapper -> {
|
private static ValueReader<Position> xyzToPosition = packetWrapper -> {
|
||||||
long x = packetWrapper.read(Type.INT);
|
long x = packetWrapper.read(Type.INT);
|
||||||
long y = packetWrapper.read(Type.INT);
|
long y = packetWrapper.read(Type.INT);
|
||||||
@ -289,7 +289,7 @@ public class Protocol1_8TO1_7_6_10 extends Protocol {
|
|||||||
remove.write(Type.VAR_INT, 1);
|
remove.write(Type.VAR_INT, 1);
|
||||||
remove.write(Type.UUID, entryByName == null ? entryByUUID.uuid : entryByName.uuid);
|
remove.write(Type.UUID, entryByName == null ? entryByUUID.uuid : entryByName.uuid);
|
||||||
tablist.remove(entryByName == null ? entryByUUID : entryByName);
|
tablist.remove(entryByName == null ? entryByUUID : entryByName);
|
||||||
remove.send(Protocol1_8TO1_7_6_10.class);
|
remove.send(Protocol1_8To1_7_6_10.class);
|
||||||
}
|
}
|
||||||
PacketWrapper packetPlayerListItem = new PacketWrapper(0x38, null, packetWrapper.user());
|
PacketWrapper packetPlayerListItem = new PacketWrapper(0x38, null, packetWrapper.user());
|
||||||
Tablist.TabListEntry newentry = new Tablist.TabListEntry(name, uuid);
|
Tablist.TabListEntry newentry = new Tablist.TabListEntry(name, uuid);
|
||||||
@ -316,7 +316,7 @@ public class Protocol1_8TO1_7_6_10 extends Protocol {
|
|||||||
if (newentry.displayName != null) {
|
if (newentry.displayName != null) {
|
||||||
packetPlayerListItem.write(Type.STRING, newentry.displayName);
|
packetPlayerListItem.write(Type.STRING, newentry.displayName);
|
||||||
}
|
}
|
||||||
packetPlayerListItem.send(Protocol1_8TO1_7_6_10.class);
|
packetPlayerListItem.send(Protocol1_8To1_7_6_10.class);
|
||||||
|
|
||||||
packetWrapper.cancel();
|
packetWrapper.cancel();
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ public class Protocol1_8TO1_7_6_10 extends Protocol {
|
|||||||
|
|
||||||
Via.getPlatform().runSync(() -> {
|
Via.getPlatform().runSync(() -> {
|
||||||
try {
|
try {
|
||||||
delayedPacket.send(Protocol1_8TO1_7_6_10.class);
|
delayedPacket.send(Protocol1_8To1_7_6_10.class);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -916,7 +916,7 @@ public class Protocol1_8TO1_7_6_10 extends Protocol {
|
|||||||
short slots = packetWrapper.read(Type.UNSIGNED_BYTE);
|
short slots = packetWrapper.read(Type.UNSIGNED_BYTE);
|
||||||
boolean useProvidedWindowTitle = packetWrapper.read(Type.BOOLEAN); //Use provided window title
|
boolean useProvidedWindowTitle = packetWrapper.read(Type.BOOLEAN); //Use provided window title
|
||||||
if (useProvidedWindowTitle) {
|
if (useProvidedWindowTitle) {
|
||||||
title = Protocol1_9TO1_8.fixJson(title);
|
title = Protocol1_9To1_8.fixJson(title);
|
||||||
} else {
|
} else {
|
||||||
title = ComponentSerializer.toString(new TranslatableComponent(title));
|
title = ComponentSerializer.toString(new TranslatableComponent(title));
|
||||||
}
|
}
|
||||||
@ -985,7 +985,7 @@ public class Protocol1_8TO1_7_6_10 extends Protocol {
|
|||||||
@Override
|
@Override
|
||||||
public void handle(PacketWrapper packetWrapper) throws Exception {
|
public void handle(PacketWrapper packetWrapper) throws Exception {
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
packetWrapper.write(Type.STRING, Protocol1_9TO1_8.fixJson(packetWrapper.read(Type.STRING)));
|
packetWrapper.write(Type.STRING, Protocol1_9To1_8.fixJson(packetWrapper.read(Type.STRING)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1576,7 +1576,7 @@ public class Protocol1_8TO1_7_6_10 extends Protocol {
|
|||||||
PacketWrapper newWrapper = new PacketWrapper(0x17, newPacketBuf, packetWrapper.user());
|
PacketWrapper newWrapper = new PacketWrapper(0x17, newPacketBuf, packetWrapper.user());
|
||||||
newWrapper.passthrough(Type.STRING);
|
newWrapper.passthrough(Type.STRING);
|
||||||
newWrapper.write(Type.SHORT, (short) newPacketBuf.readableBytes());
|
newWrapper.write(Type.SHORT, (short) newPacketBuf.readableBytes());
|
||||||
newWrapper.sendToServer(Protocol1_8TO1_7_6_10.class, true, true);
|
newWrapper.sendToServer(Protocol1_8To1_7_6_10.class, true, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
package com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.storage;
|
package com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.storage;
|
||||||
|
|
||||||
import com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.Protocol1_8TO1_7_6_10;
|
import com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.Protocol1_8To1_7_6_10;
|
||||||
import com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.metadata.MetadataRewriter;
|
import com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.metadata.MetadataRewriter;
|
||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.data.StoredObject;
|
import us.myles.ViaVersion.api.data.StoredObject;
|
||||||
@ -74,7 +74,7 @@ public class EntityTracker extends StoredObject {
|
|||||||
MetadataRewriter.transform(this.getClientEntityTypes().get(entityId), this.metadataBuffer.get(entityId));
|
MetadataRewriter.transform(this.getClientEntityTypes().get(entityId), this.metadataBuffer.get(entityId));
|
||||||
if (!this.metadataBuffer.get(entityId).isEmpty()) {
|
if (!this.metadataBuffer.get(entityId).isEmpty()) {
|
||||||
try {
|
try {
|
||||||
wrapper.send(Protocol1_8TO1_7_6_10.class);
|
wrapper.send(Protocol1_8To1_7_6_10.class);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user