Fixed onDisable throwing an error.

This commit is contained in:
KrewsOrg 2019-06-15 22:22:48 +01:00
parent 8967d5dfd4
commit ff7caf015e
2 changed files with 9 additions and 11 deletions

View File

@ -13,8 +13,8 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>7</source> <source>8</source>
<target>7</target> <target>8</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -44,15 +44,13 @@ public class Main extends HabboPlugin implements EventListener {
Field f = PacketManager.class.getDeclaredField("incoming"); Field f = PacketManager.class.getDeclaredField("incoming");
f.setAccessible(true); f.setAccessible(true);
THashMap<Integer, Class<? extends MessageHandler>> incoming = (THashMap<Integer, Class<? extends MessageHandler>>)f.get(packetManager); THashMap<Integer, Class<? extends MessageHandler>> incoming = (THashMap<Integer, Class<? extends MessageHandler>>)f.get(packetManager);
incoming.remove(Incoming.CameraRoomThumbnailEvent); incoming.remove(Incoming.CameraRoomPictureEvent, CameraRoomPictureEvent.class);
incoming.remove(Incoming.CameraPublishToWebEvent); incoming.remove(Incoming.CameraPublishToWebEvent, CameraPublishToWebEvent.class);
incoming.remove(Incoming.CameraPurchaseEvent); incoming.remove(Incoming.CameraPurchaseEvent, CameraPurchaseEvent.class);
incoming.remove(Incoming.CameraRoomThumbnailEvent); incoming.remove(Incoming.CameraRoomThumbnailEvent, CameraRoomThumbnailEvent.class);
packetManager.registerHandler(Incoming.CameraRoomPictureEvent, CameraRoomPictureEvent.class); Emulator.getLogging().logStart("[Apollyon] Bye Bye.");
packetManager.registerHandler(Incoming.CameraPublishToWebEvent, CameraPublishToWebEvent.class);
packetManager.registerHandler(Incoming.CameraPurchaseEvent, CameraPurchaseEvent.class); }
packetManager.registerHandler(Incoming.CameraRoomThumbnailEvent, CameraRoomThumbnailEvent.class);
}
@EventHandler @EventHandler