File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
src/main/java/fr/xephi/authme/listener Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ public GuiCaptchaHandler(Plugin plugin) {
6161 public void onInventoryClick (InventoryClickEvent event ) {
6262 if (event .getWhoClicked () instanceof Player ) {
6363 Player player = (Player ) event .getWhoClicked ();
64- // 获取点击事件的容器
64+ ItemStack currentItem = event . getCurrentItem ();
6565 if (!authmeApi .isRegistered (player .getName ()) && !closeReasonMap .containsKey (player )) {
6666 if (AuthMe .settings .getProperty (HooksSettings .HOOK_FLOODGATE_PLAYER ) && AuthMe .settings .getProperty (SecuritySettings .GUI_CAPTCHA_BE_COMPATIBILITY ) && org .geysermc .floodgate .api .FloodgateApi .getInstance ().isFloodgateId (event .getWhoClicked ().getUniqueId ()) && (getServer ().getPluginManager ().isPluginEnabled ("floodgate" ) || getServer ().getPluginManager ().getPlugin ("floodgate" ) != null )) {
6767 if (!closeReasonMap .containsKey (player )) {
@@ -70,8 +70,7 @@ public void onInventoryClick(InventoryClickEvent event) {
7070 }
7171 return ;
7272 }
73- /* Line 74 may throw NullPointerException, we can't solve it for now.*/
74- if (Objects .requireNonNull (event .getCurrentItem ()).getType ().equals (Material .REDSTONE_BLOCK )) {
73+ if (currentItem !=null && currentItem .getType ().equals (Material .REDSTONE_BLOCK )){
7574 event .setCancelled (true );
7675 closeReasonMap .put (player , "verified" );
7776 player .closeInventory ();
You can’t perform that action at this time.
0 commit comments