Skip to content
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

Support MC 1.13+ #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ build/
in/
out/
.idea
.gradle
*.iml
.project
.settings
.classpath

*.iml
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jar {
dependencies {
compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
compile group: 'com.mojang', name: 'authlib', version: '1.5.16'
compile group: 'io.netty', name: 'netty-all', version: '4.0.10.Final'
compile group: 'io.netty', name: 'netty-all', version: '4.1.13.Final'
compile group: 'org.ow2.asm', name: 'asm-debug-all', version: '5.0.2'
compile group: 'com.google.guava', name: 'guava', version: '17.0'
testCompile group: 'junit', name: 'junit', version: '4.11'
Expand Down
19 changes: 4 additions & 15 deletions src/main/java/uk/co/thinkofdeath/vanillacord/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,15 @@ public class Main {

public static void main(String[] args) throws IOException {
if (args.length != 1) {
System.out.println("Args: <version>");
System.out.println("Args: <server file>");
return;
}

String version = args[0];

String url = String.format("http://s3.amazonaws.com/Minecraft.Download/versions/%1$s/minecraft_server.%1$s.jar", version);

File in = new File("in/" + version + ".jar");
in.getParentFile().mkdirs();
if (!in.exists()) {
System.out.println("Downloading");
try (FileOutputStream fin = new FileOutputStream(in)) {
Resources.copy(new URL(url), fin);
}
}
String filename = args[0];
File in = new File(filename);
addURL(in.toURI().toURL());

File out = new File("out/" + version + "-bungee.jar");
out.getParentFile().mkdirs();
File out = new File(in.getName().replace(".jar","")+"-bungee.jar");
if (out.exists()) out.delete();

try (ZipInputStream zip = new ZipInputStream(new FileInputStream(in));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public MethodVisitor visitMethod(int access, final String name, final String des

@Override
public void visitLdcInsn(Object cst) {
if (cst instanceof String && ((String) cst).startsWith("Outdated client! Please use")) {
if (cst instanceof String && ((String) cst).startsWith("multiplayer.disconnect.outdated_server")) {
handshakeListener = true;
hsName = name;
hsDesc = desc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
public class BungeeHelper {

private static final Gson gson = new Gson();
public static AttributeKey<UUID> UUID_KEY = new AttributeKey<>("spoofed-uuid");
public static AttributeKey<Property[]> PROPERTIES_KEY = new AttributeKey<>("spoofed-props");
public static AttributeKey<UUID> UUID_KEY = AttributeKey.valueOf("spoofed-uuid");
public static AttributeKey<Property[]> PROPERTIES_KEY = AttributeKey.valueOf("spoofed-props");

public static void parseHandshake(Object networkManager, Object handshake) {
try {
Expand Down