From b63051a79601a20ebe263cc3be5cc9400a6292be Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Sun, 6 Mar 2016 16:36:54 +0100 Subject: [PATCH 1/2] Improve POM and fix dead code --- .gitignore | 117 ++++++++++- .travis.yml | 12 ++ LICENSE | 3 + circle.yml | 11 + pom.xml | 194 +++++++++++++----- .../transformers/OutgoingTransformer.java | 6 +- 6 files changed, 285 insertions(+), 58 deletions(-) create mode 100644 .travis.yml create mode 100644 LICENSE create mode 100644 circle.yml 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..a034ebbb6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,20 +1,107 @@ - + 4.0.0 us.myles - ViaVersion - 0.5.5 + viaversion + 0.5.5-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()); From aec5aa48da694eafefe5cd9a93823f51ac3ee6eb Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Sun, 6 Mar 2016 16:38:58 +0100 Subject: [PATCH 2/2] Bump --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a034ebbb6..855ee5573 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ us.myles viaversion - 0.5.5-SNAPSHOT + 0.5.6-SNAPSHOT jar ViaVersion