diff --git a/.gitignore b/.gitignore index ec1055155..607894b51 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,116 @@ -target/ -.idea/ +### Java files ### +*.class + +# Package Files +#*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm +# Ignore project files *.iml + +# Ignore IDEA directory +.idea/* + +# Include the project's code style settings file +!.idea/codeStyleSettings.xml + +# Include the project's dictionary +!.idea/dictionaries/ +!.idea/dictionaries/* + +# File-based project format: +*.ipr +*.iws + +### Plugin-specific files: ### +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + + + +### Eclipse ### +*.pydevproject +.metadata +.gradle +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath + +# Eclipse Core +.project + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# PDT-specific +.buildpath + +# sbteclipse plugin +.target + +# TeXlipse plugin +.texlipse + + + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties + + + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +nbactions.xml +nb-configuration.xml +.nb-gradle/ + + + +### Git ### +# Don't exclude the .gitignore itself +!.gitignore diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..74e44a99b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +sudo: false + +language: java +jdk: oraclejdk7 + +cache: + directories: + - '$HOME/.m2/repository' + +script: + - mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false + - mvn clean install -B -U diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..de9899a9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,3 @@ +License: +-------- +You may modify this work, all rights are still owned by myself excluding any files in the spacebase package as they belong to the respected contributors. Please credit the original author (myself) when forking etc. (or if it helped you understand the new protocol or netty!) diff --git a/circle.yml b/circle.yml new file mode 100644 index 000000000..7201d9d1f --- /dev/null +++ b/circle.yml @@ -0,0 +1,11 @@ +machine: + java: + version: oraclejdk7 +general: + artifacts: + - "target/*.jar" +test: + override: + - mvn clean install -B + post: + - cp ./target/*.jar $CIRCLE_ARTIFACTS diff --git a/pom.xml b/pom.xml index 33e0d047b..855ee5573 100644 --- a/pom.xml +++ b/pom.xml @@ -1,20 +1,107 @@ - + 4.0.0 us.myles - ViaVersion - 0.5.5 + viaversion + 0.5.6-SNAPSHOT + jar + + ViaVersion + Allow 1.8 clients to join 1.9 bukkit servers! + 2016 + https://www.spigotmc.org/resources/viaversion.19254/ + + + 3.3.3 + + + + + UTF-8 + ${projectEncoding} + ${projectEncoding} + 1.7 + + + + 1.8.8-R0.1-SNAPSHOT + + - ViaVersion-${project.version} + ${project.name}-${project.version} + src/main/java + + + + + . + false + . + + LICENSE + + + + . + true + src/main/resources/ + + * + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + ${jdkVersion} + ${jdkVersion} + + + + + + + org.apache.maven.plugins maven-shade-plugin - 1.4 + 2.4.3 false + false + + + org.spacehq.opennbt + us.myles.viaversion.libs.opennbt + + @@ -25,62 +112,63 @@ - - org.apache.maven.plugins - 3.5.1 - maven-compiler-plugin - - 1.7 - 1.7 - - - - - src/main/resources - true - - - - - org.spacehq - opennbt - 1.0 - - - org.bukkit - bukkit - 1.8.8-R0.1-SNAPSHOT - provided - - - io.netty - netty-all - 4.0.20.Final - provided - - - com.google.code.gson - gson - 2.4 - provided - - - com.google.guava - guava - 18.0 - provided - - + + spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + https://hub.spigotmc.org/nexus/content/repositories/snapshots + + spacehq-repo https://repo.spacehq.org/content/repositories/releases/ + + + + + org.bukkit + bukkit + ${bukkitVersion} + provided + true + + + junit + junit + + + gson + com.google.code.gson + + + persistence-api + javax.persistence + + + + + + + org.spacehq + opennbt + 1.0 + compile + true + + + + + io.netty + netty-all + 4.0.20.Final + provided + true + + diff --git a/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java b/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java index 968ff4ffc..77544fc1a 100644 --- a/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java +++ b/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java @@ -53,12 +53,12 @@ public class OutgoingTransformer { PacketType packet = PacketType.getOutgoingPacket(info.getState(), packetID); int original = packetID; - if (packet.getPacketID() != -1) { - packetID = packet.getNewPacketID(); - } if (packet == null) { throw new RuntimeException("Outgoing Packet not found? " + packetID + " State: " + info.getState() + " Version: " + info.getProtocol()); } + if (packet.getPacketID() != -1) { + packetID = packet.getNewPacketID(); + } if (ViaVersion.getInstance().isDebug()) { if (packet != PacketType.PLAY_CHUNK_DATA && packet != PacketType.PLAY_KEEP_ALIVE && packet != PacketType.PLAY_TIME_UPDATE && (!packet.name().toLowerCase().contains("move") && !packet.name().toLowerCase().contains("look"))) { System.out.println("Direction " + packet.getDirection().name() + " Packet Type: " + packet + " New ID: " + packetID + " Original: " + original + " Size: " + input.readableBytes());