Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dmulloy2/ProtocolLib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.5.1
Choose a base ref
...
head repository: dmulloy2/ProtocolLib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.6.0
Choose a head ref

Commits on Jun 6, 2020

  1. Copy the full SHA
    c203fda View commit details
  2. Copy the full SHA
    7ac4ac6 View commit details
  3. Remove a bunch of legacy (<1.8) code

    Shouldn't break any servers running 1.8+, but this version is all about code cleanup baby
    dmulloy2 committed Jun 6, 2020
    Copy the full SHA
    fdd30a7 View commit details

Commits on Jun 16, 2020

  1. Add MCP packet names for Bukkit-Forge hybrid server (#862)

    Adds mappings to support MCP packets
    
    Fixes #858
    NewbieOrange authored Jun 16, 2020
    Copy the full SHA
    5183bd5 View commit details

Commits on Jun 21, 2020

  1. StreamSerializer: Reduce duplicated code and allow (de)serialization …

    …to and from byte arrays. (#875)
    seyfahni authored Jun 21, 2020
    Copy the full SHA
    5f204d7 View commit details

Commits on Jun 23, 2020

  1. Cache perm gen bean (#876)

    xxDark authored Jun 23, 2020
    Copy the full SHA
    77feaa8 View commit details

Commits on Jun 28, 2020

  1. Initial support for 1.16 (#880)

    Note that things may not initially work as expected. There are known issues (see #880) relating to dimensions, chat packets, and tile entities. There were also internal changes to attributes, though hopefully those are fixed. As always, report issues on GitHub.
    dmulloy2 committed Jun 28, 2020
    Copy the full SHA
    658da31 View commit details
  2. Update tile entities for 1.16 (#880)

    Ended up being simpler than I thought
    dmulloy2 committed Jun 28, 2020
    Copy the full SHA
    b2f6a56 View commit details
  3. Copy the full SHA
    fd93c1c View commit details

Commits on Jun 30, 2020

  1. Copy the full SHA
    fbe46f7 View commit details

Commits on Jul 1, 2020

  1. Copy the full SHA
    deb192b View commit details
  2. Copy the full SHA
    a7e7028 View commit details

Commits on Jul 5, 2020

  1. Copy the full SHA
    f19bfc6 View commit details

Commits on Jul 6, 2020

  1. Support dimensions in 1.16 (#893)

    Fixes #893
    dmulloy2 committed Jul 6, 2020
    Copy the full SHA
    8d991ad View commit details
  2. Copy the full SHA
    8c51b17 View commit details

Commits on Jul 26, 2020

  1. Support for MerchantRecipeList (#894)

    * Added support for MerchantRecipeList found in OPEN_WINDOW_MERCHANT of MC versions 1.13+
    Warren1001 authored Jul 26, 2020
    Copy the full SHA
    80f4c7b View commit details

Commits on Aug 4, 2020

  1. 1
    Copy the full SHA
    0512215 View commit details
  2. Copy the full SHA
    8c5fbe3 View commit details

Commits on Aug 6, 2020

  1. Remove stray debug

    dmulloy2 committed Aug 6, 2020
    2
    Copy the full SHA
    12e3a89 View commit details
  2. Fix data watcher cloning in 1.16

    Fixes #925
    dmulloy2 committed Aug 6, 2020
    Copy the full SHA
    b871eb3 View commit details

Commits on Aug 24, 2020

  1. Copy the full SHA
    13f5c14 View commit details
  2. Update to 1.16.2

    Fixes #941
    Fixes #944
    Fixes #934
    dmulloy2 committed Aug 24, 2020
    Copy the full SHA
    bdaa843 View commit details

Commits on Oct 19, 2020

  1. Update to 1.16.3

    dmulloy2 committed Oct 19, 2020
    Copy the full SHA
    553e4b6 View commit details
  2. Fix multi block change cloning

    Fixes #990
    dmulloy2 committed Oct 19, 2020
    Copy the full SHA
    f381f0a View commit details
  3. Fix a class cast exception with array wrappers

    (Kinda surprised there isn't an issue to link here)
    dmulloy2 committed Oct 19, 2020
    Copy the full SHA
    4bc9e8b View commit details

Commits on Nov 9, 2020

  1. Copy the full SHA
    7bac4ec View commit details

Commits on Dec 23, 2020

  1. Fix Java 15 (#1025)

    - Implemented a fix for the incompatibility with Java 15. This incompatibility was caused by the fact that the lambda generated in the NMS.NetworkManager is a hidden class in J15. Starting in Java 15, final fields in hidden classes can no longer be modified regardless of the 'accessible' flag. (see https://openjdk.java.net/jeps/371 "Using a hidden class", point 3). To circumvent this issue, this retrieves the data from the existing fields in the hidden class (a runnable or a callable) other than the packet. It then retrieves the constructor of the hidden class and instantiates it using the previously-retrieved data and the modified packet instance (this code is only used if the packet instance changed).
    - Introduced a new ObjectReconstructor class that does all the fields/constructor discovering/accessing etc. The Runnable and Callable methods each get one instance of this class so that we can avoid having to get the fields/constructors and set them accessible every time we want to replace a packet.
    
    Co-authored-by: Mark Vainomaa <mikroskeem@mikroskeem.eu>
    PimvanderLoos and mikroskeem authored Dec 23, 2020
    Copy the full SHA
    bbb053a View commit details
  2. Fixed "protocollib_encoder" attempting to read non-nms packets (#959)

    Added an override to the encoder as such would process any non-wire packets as NMS packets. In the case of the use of different APIs, such as Artemis Packet API, such would cause a conflict and would spit out casting exceptions. It is quite easy to resolve by exclusively accepting Wire Packets and packets which are assignable to the packet class. This solves the issue and tada happy ending.
    terminalsin authored Dec 23, 2020
    Copy the full SHA
    2b22999 View commit details
  3. Bump junit from 4.13 to 4.13.1 (#989)

    Bumps [junit](https://github.com/junit-team/junit4) from 4.13 to 4.13.1.
    - [Release notes](https://github.com/junit-team/junit4/releases)
    - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
    - [Commits](junit-team/junit4@r4.13...r4.13.1)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Dec 23, 2020
    Copy the full SHA
    1545a88 View commit details

Commits on Dec 27, 2020

  1. Update ChatExtensions for 1.16.4

    Fixes #1044
    dmulloy2 committed Dec 27, 2020
    Copy the full SHA
    13b3d86 View commit details

Commits on Dec 30, 2020

  1. Update funding info

    dmulloy2 authored Dec 30, 2020
    Copy the full SHA
    eb54b99 View commit details

Commits on Jan 3, 2021

  1. Fix ChatExtensions exception

    Fixes #1045
    dmulloy2 committed Jan 3, 2021
    Copy the full SHA
    b713219 View commit details
  2. Copy the full SHA
    0d50905 View commit details
  3. Copy the full SHA
    aa555f7 View commit details
  4. ✨backwards compat✨

    dmulloy2 committed Jan 3, 2021
    Copy the full SHA
    26274fe View commit details

Commits on Jan 4, 2021

  1. Replace CGLib with ByteBuddy (#984)

    - The gclib dependency in the EnchancerFactory has been removed. All classes that used the actual factory part of it have been updated to use bytebuddy instead. This class will have to be removed at some point, but at the moment it is still used for accessing its class loader.
    - Renamed EnhancerFactory to ByteBuddyFactory. All ByteBuddy actions should go through this now. Every subclass created here implements the ByteBuddyGenerated interface. This makes it possible to recognize classes generated using ByteBuddy (by default, it doesn't leave such a trace).
    - Removed the method DefaultInstances#forEnhancer(Enhancer). This method isn't used anywhere; the last trace of usage of the method I could find was in 2013 (in the NetworkServerInjector). External plugins (I couldn't find any that used it), they should really have their own implementation, given that they already require an instance of an Enchancer. As such, I feel it is safe to remove rather than update it.
    PimvanderLoos authored Jan 4, 2021
    Copy the full SHA
    b54dd49 View commit details
  2. Copy the full SHA
    30fe81d View commit details

Commits on Jan 24, 2021

  1. Tested with 1.16.5

    dmulloy2 committed Jan 24, 2021
    Copy the full SHA
    8f7b530 View commit details

Commits on Feb 3, 2021

  1. Copy the full SHA
    765fd9e View commit details

Commits on Feb 15, 2021

  1. Copy the full SHA
    ab0faab View commit details
Showing with 4,189 additions and 11,024 deletions.
  1. +2 −0 .github/FUNDING.yml
  2. +4 −4 Readme.md
  3. +18 −24 pom.xml
  4. +16 −36 src/main/java/com/comphenix/protocol/AsynchronousManager.java
  5. +0 −170 src/main/java/com/comphenix/protocol/CleanupStaticMembers.java
  6. +3 −71 src/main/java/com/comphenix/protocol/CommandPacket.java
  7. +201 −319 src/main/java/com/comphenix/protocol/PacketType.java
  8. +0 −10 src/main/java/com/comphenix/protocol/PacketTypeLookup.java
  9. +0 −300 src/main/java/com/comphenix/protocol/Packets.java
  10. +11 −26 src/main/java/com/comphenix/protocol/ProtocolLib.java
  11. +7 −34 src/main/java/com/comphenix/protocol/ProtocolLibrary.java
  12. +24 −80 src/main/java/com/comphenix/protocol/ProtocolManager.java
  13. +7 −18 src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java
  14. +6 −125 src/main/java/com/comphenix/protocol/events/ListeningWhitelist.java
  15. +8 −21 src/main/java/com/comphenix/protocol/events/MonitorAdapter.java
  16. +5 −208 src/main/java/com/comphenix/protocol/events/PacketAdapter.java
  17. +107 −106 src/main/java/com/comphenix/protocol/events/PacketContainer.java
  18. +1 −1 src/main/java/com/comphenix/protocol/events/PacketEvent.java
  19. +86 −39 src/main/java/com/comphenix/protocol/events/SerializedOfflinePlayer.java
  20. +0 −518 src/main/java/com/comphenix/protocol/injector/DelayedPacketManager.java
  21. +4 −42 src/main/java/com/comphenix/protocol/injector/ListenerInvoker.java
  22. +0 −92 src/main/java/com/comphenix/protocol/injector/LoginPackets.java
  23. +1 −17 src/main/java/com/comphenix/protocol/injector/PacketConstructor.java
  24. +3 −68 src/main/java/com/comphenix/protocol/injector/PacketFilterBuilder.java
  25. +30 −158 src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java
  26. +2 −40 src/main/java/com/comphenix/protocol/injector/StructureCache.java
  27. +1 −1 src/main/java/com/comphenix/protocol/injector/{spigot → netty}/AbstractPacketInjector.java
  28. +1 −1 src/main/java/com/comphenix/protocol/injector/{spigot → netty}/AbstractPlayerHandler.java
  29. +91 −22 src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java
  30. +1 −6 src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java
  31. +0 −2 src/main/java/com/comphenix/protocol/injector/netty/ProtocolInjector.java
  32. +0 −64 src/main/java/com/comphenix/protocol/injector/packet/CaptureInputStream.java
  33. +0 −154 src/main/java/com/comphenix/protocol/injector/packet/InterceptWritePacket.java
  34. +0 −66 src/main/java/com/comphenix/protocol/injector/packet/InverseMaps.java
  35. +0 −65 src/main/java/com/comphenix/protocol/injector/packet/LegacyNetworkMarker.java
  36. +0 −334 src/main/java/com/comphenix/protocol/injector/packet/LegacyPacketRegistry.java
  37. +0 −96 src/main/java/com/comphenix/protocol/injector/packet/PacketInjectorBuilder.java
  38. +4 −127 src/main/java/com/comphenix/protocol/injector/packet/PacketRegistry.java
  39. +0 −372 src/main/java/com/comphenix/protocol/injector/packet/ProxyPacketInjector.java
  40. +0 −186 src/main/java/com/comphenix/protocol/injector/packet/ReadPacketModifier.java
  41. +0 −130 src/main/java/com/comphenix/protocol/injector/packet/WritePacketModifier.java
  42. +0 −193 src/main/java/com/comphenix/protocol/injector/player/InjectedArrayList.java
  43. +0 −442 src/main/java/com/comphenix/protocol/injector/player/InjectedServerConnection.java
  44. +0 −162 src/main/java/com/comphenix/protocol/injector/player/NetLoginInjector.java
  45. +0 −221 src/main/java/com/comphenix/protocol/injector/player/NetworkFieldInjector.java
  46. +0 −230 src/main/java/com/comphenix/protocol/injector/player/NetworkObjectInjector.java
  47. +0 −367 src/main/java/com/comphenix/protocol/injector/player/NetworkServerInjector.java
  48. +0 −760 src/main/java/com/comphenix/protocol/injector/player/PlayerInjector.java
  49. +0 −143 src/main/java/com/comphenix/protocol/injector/player/PlayerInjectorBuilder.java
  50. +0 −763 src/main/java/com/comphenix/protocol/injector/player/ProxyPlayerInjectionHandler.java
  51. +0 −370 src/main/java/com/comphenix/protocol/injector/player/ReplacedArrayList.java
  52. +0 −64 src/main/java/com/comphenix/protocol/injector/player/UnsupportedListener.java
  53. +79 −56 src/main/java/com/comphenix/protocol/injector/server/TemporaryPlayerFactory.java
  54. +0 −45 src/main/java/com/comphenix/protocol/injector/spigot/DummyPacketInjector.java
  55. +0 −92 src/main/java/com/comphenix/protocol/injector/spigot/DummyPlayerHandler.java
  56. +0 −672 src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java
  57. +0 −34 src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketListener.java
  58. +2 −2 src/main/java/com/comphenix/protocol/metrics/Metrics.java
  59. +16 −13 src/main/java/com/comphenix/protocol/reflect/ClassAnalyser.java
  60. +33 −8 src/main/java/com/comphenix/protocol/reflect/StructureModifier.java
  61. +1 −0 src/main/java/com/comphenix/protocol/reflect/cloning/BukkitCloner.java
  62. +10 −2 src/main/java/com/comphenix/protocol/reflect/cloning/ImmutableDetector.java
  63. +16 −4 src/main/java/com/comphenix/protocol/reflect/compiler/BackgroundCompiler.java
  64. +81 −81 src/main/java/com/comphenix/protocol/reflect/compiler/BoxingHelper.java
  65. +8 −8 src/main/java/com/comphenix/protocol/reflect/compiler/MethodDescriptor.java
  66. +93 −99 src/main/java/com/comphenix/protocol/reflect/compiler/StructureCompiler.java
  67. +8 −23 src/main/java/com/comphenix/protocol/reflect/instances/DefaultInstances.java
  68. +1 −1 src/main/java/com/comphenix/protocol/timing/TimingReportGenerator.java
  69. +65 −0 src/main/java/com/comphenix/protocol/utility/ByteBuddyFactory.java
  70. +9 −0 src/main/java/com/comphenix/protocol/utility/ByteBuddyGenerated.java
  71. +30 −84 src/main/java/com/comphenix/protocol/utility/ChatExtensions.java
  72. +2 −2 src/main/java/com/comphenix/protocol/utility/Constants.java
  73. +0 −44 src/main/java/com/comphenix/protocol/utility/EnhancerFactory.java
  74. +70 −0 src/main/java/com/comphenix/protocol/utility/HexDumper.java
  75. +56 −24 src/main/java/com/comphenix/protocol/utility/MinecraftMethods.java
  76. +21 −0 src/main/java/com/comphenix/protocol/utility/MinecraftProtocolVersion.java
  77. +5 −3 src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java
  78. +17 −2 src/main/java/com/comphenix/protocol/utility/MinecraftVersion.java
  79. +75 −0 src/main/java/com/comphenix/protocol/utility/ObjectReconstructor.java
  80. +34 −41 src/main/java/com/comphenix/protocol/utility/StreamSerializer.java
  81. +2 −2 src/main/java/com/comphenix/protocol/wrappers/AutoWrapper.java
  82. +322 −35 src/main/java/com/comphenix/protocol/wrappers/BukkitConverters.java
  83. +49 −2 src/main/java/com/comphenix/protocol/wrappers/Converters.java
  84. +111 −9 src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java
  85. +102 −0 src/main/java/com/comphenix/protocol/wrappers/MovingObjectPositionBlock.java
  86. +0 −36 src/main/java/com/comphenix/protocol/wrappers/MultiBlockChangeInfo.java
  87. +43 −0 src/main/java/com/comphenix/protocol/wrappers/Pair.java
  88. +89 −15 src/main/java/com/comphenix/protocol/wrappers/WrappedAttribute.java
  89. +1 −1 src/main/java/com/comphenix/protocol/wrappers/WrappedAttributeModifier.java
  90. +10 −19 src/main/java/com/comphenix/protocol/wrappers/WrappedBlockData.java
  91. +9 −2 src/main/java/com/comphenix/protocol/wrappers/WrappedDataWatcher.java
  92. +0 −1 src/main/java/com/comphenix/protocol/wrappers/WrappedIntHashMap.java
  93. +104 −82 src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java
  94. +118 −46 src/main/java/com/comphenix/protocol/wrappers/nbt/TileEntityAccessor.java
  95. +115 −93 src/test/java/com/comphenix/protocol/BukkitInitialization.java
  96. +296 −266 src/test/java/com/comphenix/protocol/PacketTypeTest.java
  97. +712 −651 src/test/java/com/comphenix/protocol/events/PacketContainerTest.java
  98. +72 −0 src/test/java/com/comphenix/protocol/events/SerializedOfflinePlayerTest.java
  99. +7 −7 src/test/java/com/comphenix/protocol/injector/EntityUtilitiesTest.java
  100. +24 −7 src/test/java/com/comphenix/protocol/injector/WirePacketTest.java
  101. +42 −0 src/test/java/com/comphenix/protocol/injector/server/TemporaryPlayerFactoryTest.java
  102. +47 −47 src/test/java/com/comphenix/protocol/reflect/cloning/AggregateClonerTest.java
  103. +17 −0 src/test/java/com/comphenix/protocol/utility/MinecraftMethodsTest.java
  104. +13 −13 src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java
  105. +32 −32 src/test/java/com/comphenix/protocol/wrappers/ChunkCoordIntPairTest.java
  106. +73 −61 src/test/java/com/comphenix/protocol/wrappers/EnumWrappersTest.java
  107. +7 −4 src/test/java/com/comphenix/protocol/wrappers/MultiBlockChangeTest.java
  108. +100 −96 src/test/java/com/comphenix/protocol/wrappers/WrappedAttributeTest.java
  109. +74 −74 src/test/java/com/comphenix/protocol/wrappers/WrappedBlockDataTest.java
  110. +117 −107 src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java
  111. +1 −4 src/test/java/com/comphenix/protocol/wrappers/WrappedParticleTest.java
  112. +104 −104 src/test/java/com/comphenix/protocol/wrappers/nbt/NbtFactoryTest.java
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [dmulloy2]
custom: ["https://paypal.me/dmulloy2"]
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ You can also add ProtocolLib as a Maven dependency:
<repositories>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
...
</repositories>
@@ -53,7 +53,7 @@ You can also add ProtocolLib as a Maven dependency:
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.5.0</version>
<version>4.6.0</version>
</dependency>
</dependencies>
````
@@ -62,11 +62,11 @@ Or use the maven dependency with gradle:

```gradle
repositories {
maven { url "https://repo.dmulloy2.net/nexus/repository/public/" }
maven { url "https://repo.dmulloy2.net/repository/public/" }
}
dependencies {
compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.5.0";
compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.6.0";
}
```

42 changes: 18 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<name>ProtocolLib</name>
<version>4.5.1</version>
<version>4.6.0</version>

<description>Provides read/write access to the Minecraft protocol.</description>
<url>https://github.com/dmulloy2/ProtocolLib</url>
@@ -16,8 +16,8 @@
<project.build.number></project.build.number>
<project.fullVersion>${project.version}</project.fullVersion>

<powermock.version>2.0.4</powermock.version>
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
<powermock.version>2.0.7</powermock.version>
<spigot.version>1.16.4-R0.1-SNAPSHOT</spigot.version>
</properties>

<build>
@@ -38,7 +38,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
@@ -51,8 +51,8 @@

<relocations>
<relocation>
<pattern>net.sf</pattern>
<shadedPattern>com.comphenix.net.sf</shadedPattern>
<pattern>net.bytebuddy</pattern>
<shadedPattern>com.comphenix.net.bytebuddy</shadedPattern>
</relocation>
</relocations>

@@ -98,8 +98,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<version>3.0.0-M5</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<useFile>false</useFile>
<systemProperties>
<property>
<name>projectVersion</name>
@@ -111,7 +113,7 @@

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
<configuration>
<failOnError>false</failOnError>
<encoding>ISO-8859-1</encoding>
@@ -166,7 +168,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -180,7 +182,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
@@ -291,32 +293,24 @@
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>3.2.5</version>
<scope>compile</scope>
</dependency>

<!-- TODO fold BukkitExecutors into ProtocolLib -->
<dependency>
<groupId>com.comphenix.executors</groupId>
<artifactId>BukkitExecutors</artifactId>
<version>1.1-SNAPSHOT</version>
<scope>compile</scope>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.10.16</version>
</dependency>

<!-- Testing dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.2.0</version>
<version>3.5.10</version>
<scope>test</scope>
</dependency>
<dependency>
52 changes: 16 additions & 36 deletions src/main/java/com/comphenix/protocol/AsynchronousManager.java
Original file line number Diff line number Diff line change
@@ -42,83 +42,63 @@ public interface AsynchronousManager {
* @param listener - the packet listener that will receive these asynchronous events.
* @return An asynchronous handler.
*/
public abstract AsyncListenerHandler registerAsyncHandler(PacketListener listener);
AsyncListenerHandler registerAsyncHandler(PacketListener listener);

/**
* Unregisters and closes the given asynchronous handler.
* @param handler - asynchronous handler.
*/
public abstract void unregisterAsyncHandler(AsyncListenerHandler handler);
void unregisterAsyncHandler(AsyncListenerHandler handler);

/**
* Unregisters and closes the first asynchronous handler associated with the given listener.
* @param listener - asynchronous listener
*/
public abstract void unregisterAsyncHandler(PacketListener listener);
void unregisterAsyncHandler(PacketListener listener);

/**
* Unregisters every asynchronous handler associated with this plugin.
* @param plugin - the original plugin.
*/
public void unregisterAsyncHandlers(Plugin plugin);

/**
* Retrieves a immutable set containing the ID of the sent server packets that will be
* observed by the asynchronous listeners.
* <p>
* Deprecated: Use {@link #getSendingTypes()} instead.
* @return Every filtered server packet.
*/
@Deprecated
public abstract Set<Integer> getSendingFilters();
void unregisterAsyncHandlers(Plugin plugin);

/**
* Retrieves a immutable set containing the types of the sent server packets that will be
* observed by the asynchronous listeners.
* @return Every filtered server packet.
*/
public abstract Set<PacketType> getSendingTypes();

/**
* Retrieves a immutable set containing the ID of the recieved client packets that will be
* <p>
* Deprecated: Use {@link #getReceivingTypes()} instead.
* observed by the asynchronous listeners.
* @return Every filtered client packet.
*/
@Deprecated
public abstract Set<Integer> getReceivingFilters();

Set<PacketType> getSendingTypes();

/**
* Retrieves a immutable set containing the types of the received client packets that will be
* observed by the asynchronous listeners.
* @return Every filtered client packet.
*/
public abstract Set<PacketType> getReceivingTypes();
Set<PacketType> getReceivingTypes();

/**
* Determine if a given synchronous packet has asynchronous listeners.
* @param packet - packet to test.
* @return TRUE if it does, FALSE otherwise.
*/
public abstract boolean hasAsynchronousListeners(PacketEvent packet);
boolean hasAsynchronousListeners(PacketEvent packet);

/**
* Retrieve the default packet stream.
* @return Default packet stream.
*/
public abstract PacketStream getPacketStream();
PacketStream getPacketStream();

/**
* Retrieve the default error reporter.
* @return Default reporter.
*/
public abstract ErrorReporter getErrorReporter();
ErrorReporter getErrorReporter();

/**
* Remove listeners, close threads and transmit every delayed packet.
*/
public abstract void cleanupAll();
void cleanupAll();

/**
* Signal that a packet is ready to be transmitted.
@@ -127,29 +107,29 @@ public interface AsynchronousManager {
* has been called previously.
* @param packet - packet to signal.
*/
public abstract void signalPacketTransmission(PacketEvent packet);
void signalPacketTransmission(PacketEvent packet);

/**
* Register a synchronous listener that handles packets when they time out.
* @param listener - synchronous listener that will handle timed out packets.
*/
public abstract void registerTimeoutHandler(PacketListener listener);
void registerTimeoutHandler(PacketListener listener);

/**
* Unregisters a given timeout listener.
* @param listener - the timeout listener to unregister.
*/
public abstract void unregisterTimeoutHandler(PacketListener listener);
void unregisterTimeoutHandler(PacketListener listener);

/**
* Get a immutable set of every registered timeout handler.
* @return Set of every registered timeout handler.
*/
public abstract Set<PacketListener> getTimeoutHandlers();
Set<PacketListener> getTimeoutHandlers();

/**
* Get an immutable set of every registered asynchronous packet listener.
* @return Set of every asynchronous packet listener.
*/
public abstract Set<PacketListener> getAsyncHandlers();
Set<PacketListener> getAsyncHandlers();
}
Loading