Fix array out of bounds

This commit is contained in:
nossr50 2020-07-13 07:28:50 -07:00
parent 2dfd7fd5a4
commit 039eb0ee9e
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Version 2.1.133
A fix for an 'array out of bounds' error related to players clicking outside the inventory windows has been fixed
French locale has been updated (thanks Elikill58)
Another fix has been deployed to prevent mobs from having hearts in player death messages (thanks FrankHeijden)
Players no longer ready their tool if they don't have access to the skill (thanks Draycia)
Version 2.1.132 Version 2.1.132
A fix is in place to prevent an exploit from working that is due to a yet to be patched Spigot server software bug A fix is in place to prevent an exploit from working that is due to a yet to be patched Spigot server software bug
Fixed a NPE that could happen when players swapped items from their hotbar Fixed a NPE that could happen when players swapped items from their hotbar

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId> <groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId> <artifactId>mcMMO</artifactId>
<version>2.1.132</version> <version>2.1.133-SNAPSHOT</version>
<name>mcMMO</name> <name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url> <url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm> <scm>

View File

@ -436,7 +436,12 @@ public class InventoryListener implements Listener {
public void onInventoryClickEvent(InventoryClickEvent event) { public void onInventoryClickEvent(InventoryClickEvent event) {
SkillUtils.removeAbilityBuff(event.getCurrentItem()); SkillUtils.removeAbilityBuff(event.getCurrentItem());
if (event.getAction() == InventoryAction.HOTBAR_SWAP) { if (event.getAction() == InventoryAction.HOTBAR_SWAP) {
if(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()) != null) if(event.getHotbarButton() == -1)
return;
PlayerInventory playerInventory = event.getWhoClicked().getInventory();
if(playerInventory.getItem(event.getHotbarButton()) != null)
SkillUtils.removeAbilityBuff(event.getWhoClicked().getInventory().getItem(event.getHotbarButton())); SkillUtils.removeAbilityBuff(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()));
} }
} }