mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Inventory NPE fix
This commit is contained in:
parent
ce03e6613f
commit
900a534edb
@ -1,3 +1,6 @@
|
|||||||
|
Version 2.1.132
|
||||||
|
Fixed a NPE that could happen when players swapped items from their hotbar
|
||||||
|
|
||||||
Version 2.1.131
|
Version 2.1.131
|
||||||
|
|
||||||
New permission node 'mcmmo.ability.repair.netheriterepair' which is included in the mcmmo.defaults permission package
|
New permission node 'mcmmo.ability.repair.netheriterepair' which is included in the mcmmo.defaults permission package
|
||||||
|
@ -435,8 +435,9 @@ public class InventoryListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
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) {\
|
||||||
SkillUtils.removeAbilityBuff(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()));
|
if(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()) != null)
|
||||||
|
SkillUtils.removeAbilityBuff(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user