You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its not possible to get players who join the group via the GroupJoinEvent. Only the first player (the one that creates the group) works, getPlayer for all other players returns null.
DXL 0.18-1020 (from the build server, not spigot)
Reproduce
Create a new dungeon with /dxl create
Place a Group sign for the dungeon
Create a simple test plugin that uses the DXL-API, for example with the code below.
Use the sign. First player works just fine and both messages are displayed.
Use the sign again with another account. Event is triggered, but there is no player and the second message produces an NPE.
Test code
public void joinEvent(GroupPlayerJoinEvent event) {
Bukkit.broadcastMessage("Join event");
Bukkit.broadcastMessage(event.getPlayer().toString());
}
Log output
[01:43:43 INFO]: Join event //first player uses the sign and creates the group
[01:43:43 INFO]: DGlobalPlayer{player=CraftPlayer{name=Malfrador}} // Works fine
[01:43:46 INFO]: Join event // other player uses the sign, error
[01:43:46 ERROR]: Could not pass event GroupPlayerJoinEvent to DRE-DXL v1.0-SNAPSHOT // Error
java.lang.NullPointerException: null
at de.erethon.dredxl.DreDxl.joinEvent(DreDxl.java:25) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor151.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.3.jar:git-Paper-211]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.3.jar:git-Paper-211]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.3.jar:git-Paper-211]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.3.jar:git-Paper-211]
at de.erethon.dungeonsxl.player.DGroup.addMember(DGroup.java:220) ~[?:?]
at de.erethon.dungeonsxl.api.player.PlayerGroup.addMember(PlayerGroup.java:227) ~[?:?]
at de.erethon.dungeonsxl.global.GroupSign.onPlayerInteract(GroupSign.java:162) ~[?:?]
at de.erethon.dungeonsxl.global.GlobalProtectionListener.onInteract(GlobalProtectionListener.java:242) ~[?:?]
The text was updated successfully, but these errors were encountered:
Malfrador
changed the title
[API] GroupPlayerJoinEvent#getPlayer always returns null
[API] GroupPlayerJoinEvent#getPlayer always returns null for players that are not creating a group
Oct 15, 2020
Malfrador
changed the title
[API] GroupPlayerJoinEvent#getPlayer always returns null for players that are not creating a group
[API] GroupPlayerJoinEvent#getPlayer only returns a player when a new group is created
Oct 15, 2020
Description
Its not possible to get players who join the group via the GroupJoinEvent. Only the first player (the one that creates the group) works, getPlayer for all other players returns null.
Reproduce
Test code
Log output
The text was updated successfully, but these errors were encountered: