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>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>

View File

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