Skip to content

Commit

Permalink
Fix array out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
nossr50 committed Jul 13, 2020
1 parent 2dfd7fd commit 039eb0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -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
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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.132</version>
<version>2.1.133-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) {
public void onInventoryClickEvent(InventoryClickEvent event) {
SkillUtils.removeAbilityBuff(event.getCurrentItem());
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()));
}
}
Expand Down

0 comments on commit 039eb0e

Please sign in to comment.