Skip to content

Commit

Permalink
fix: Fixed NPE in event transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeGodSRC committed Sep 10, 2024
1 parent 78ae7c9 commit fa5eb16
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion framework/modules/bukkit/bukkit-xseries/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")

api("io.fairyproject:core-command")
api("com.github.cryptomorin:XSeries:11.2.0.1")
api("com.github.cryptomorin:XSeries:11.2.1")

implementation("com.google.code.findbugs:jsr305:3.0.2")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ public void onPreInitialize() {
this.bukkitToMC = new ConcurrentHashMap<>();
this.register(AsyncPlayerPreLoginEvent.class, AsyncLoginEvent.class, this::transformAsyncLoginEvent);
this.register(PlayerJoinEvent.class, NativePlayerLoginEvent.class, EventPriority.LOWEST, this::transformNativeLoginEvent);
this.register(PlayerJoinEvent.class, MCPlayerJoinEvent.class, event -> new MCPlayerJoinEvent(playerRegistry.getByPlatform(event.getPlayer())));
this.register(PlayerJoinEvent.class, MCPlayerJoinEvent.class, event -> {
MCPlayer mcPlayer = playerRegistry.findByPlatform(event.getPlayer());
if (mcPlayer == null)
return null;

return new MCPlayerJoinEvent(mcPlayer);
});
this.register(PlayerQuitEvent.class, MCPlayerQuitEvent.class, event -> {
MCPlayer player = playerRegistry.findByPlatform(event.getPlayer());
if (player == null) {
Expand Down
2 changes: 1 addition & 1 deletion global.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = 0.7.8b7-SNAPSHOT
version = 0.7.8b8-SNAPSHOT

0 comments on commit fa5eb16

Please sign in to comment.