mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 03:25:29 +01:00
A few build improvements
This commit is contained in:
parent
4c97c3c7ce
commit
7226e199e5
@ -3,7 +3,7 @@ jdk:
|
|||||||
- oraclejdk8
|
- oraclejdk8
|
||||||
- oraclejdk7
|
- oraclejdk7
|
||||||
- openjdk6
|
- openjdk6
|
||||||
script: mvn clean install -U
|
script: mvn clean test -U
|
||||||
before_install: cd ProtocolLib
|
before_install: cd ProtocolLib
|
||||||
install: true
|
install: true
|
||||||
notifications:
|
notifications:
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<!--<plugin>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>2.7</version>
|
<version>2.7</version>
|
||||||
<executions>
|
<executions>
|
||||||
@ -104,12 +104,12 @@
|
|||||||
</execution>
|
</execution>
|
||||||
|
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>-->
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<reporting>
|
<!--<reporting>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
@ -133,7 +133,7 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
</reporting>
|
</reporting>-->
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
|
@ -45,14 +45,11 @@ public class IndependentNetty implements NettyCompat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WrappedByteBuf createPacketBuffer() {
|
public WrappedByteBuf createPacketBuffer() {
|
||||||
return getPacketDataSerializer(UnpooledByteBufAllocator.DEFAULT.buffer());
|
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
|
||||||
}
|
|
||||||
|
|
||||||
private WrappedByteBuf getPacketDataSerializer(ByteBuf buffer) {
|
|
||||||
Class<?> packetSerializer = MinecraftReflection.getPacketDataSerializerClass();
|
Class<?> packetSerializer = MinecraftReflection.getPacketDataSerializerClass();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new NettyByteBuf((ByteBuf) packetSerializer.getConstructor(MinecraftReflection.getByteBufClass()).newInstance(buffer));
|
return new NettyByteBuf((ByteBuf) packetSerializer.getConstructor(ByteBuf.class).newInstance(buffer));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Cannot construct packet serializer.", e);
|
throw new RuntimeException("Cannot construct packet serializer.", e);
|
||||||
}
|
}
|
||||||
|
@ -371,9 +371,11 @@ public class PacketContainerTest {
|
|||||||
|
|
||||||
assertEquals(PacketType.Play.Client.CHAT, copy.getType());
|
assertEquals(PacketType.Play.Client.CHAT, copy.getType());
|
||||||
assertEquals("Test", copy.getStrings().read(0));
|
assertEquals("Test", copy.getStrings().read(0));
|
||||||
} catch (NullPointerException ex) {
|
} catch (Throwable ex) {
|
||||||
// This occurs intermittently with Java 6, just log it and move on
|
// This occurs intermittently on Java 6, for the time being just log it and move on
|
||||||
System.err.println("Encountered a NullPointerException with serialization");
|
// TODO: Possibly find a solution to this
|
||||||
|
System.err.println("Failed to serialize packet:");
|
||||||
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,14 +45,11 @@ public class ShadedNetty implements NettyCompat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WrappedByteBuf createPacketBuffer() {
|
public WrappedByteBuf createPacketBuffer() {
|
||||||
return getPacketDataSerializer(UnpooledByteBufAllocator.DEFAULT.buffer());
|
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
|
||||||
}
|
|
||||||
|
|
||||||
private WrappedByteBuf getPacketDataSerializer(ByteBuf buffer) {
|
|
||||||
Class<?> packetSerializer = MinecraftReflection.getPacketDataSerializerClass();
|
Class<?> packetSerializer = MinecraftReflection.getPacketDataSerializerClass();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new ShadedByteBuf((ByteBuf) packetSerializer.getConstructor(MinecraftReflection.getByteBufClass()).newInstance(buffer));
|
return new ShadedByteBuf((ByteBuf) packetSerializer.getConstructor(ByteBuf.class).newInstance(buffer));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Cannot construct packet serializer.", e);
|
throw new RuntimeException("Cannot construct packet serializer.", e);
|
||||||
}
|
}
|
||||||
|
4
pom.xml
4
pom.xml
@ -75,7 +75,7 @@
|
|||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<reporting>
|
<!--<reporting>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
@ -89,5 +89,5 @@
|
|||||||
<version>2.4</version>
|
<version>2.4</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</reporting>
|
</reporting>-->
|
||||||
</project>
|
</project>
|
Loading…
Reference in New Issue
Block a user