mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Fixes possible NPE when a furnace is destroyed while someone is still
viewing it.
This commit is contained in:
parent
ab677e941d
commit
9dac898c1c
@ -32,6 +32,11 @@ public class InventoryListener implements Listener{
|
|||||||
if (inventoryType == InventoryType.FURNACE) {
|
if (inventoryType == InventoryType.FURNACE) {
|
||||||
FurnaceInventory inventory = (FurnaceInventory) event.getInventory();
|
FurnaceInventory inventory = (FurnaceInventory) event.getInventory();
|
||||||
Furnace furnace = inventory.getHolder();
|
Furnace furnace = inventory.getHolder();
|
||||||
|
|
||||||
|
if (furnace == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Block furnaceBlock = furnace.getBlock();
|
Block furnaceBlock = furnace.getBlock();
|
||||||
|
|
||||||
if (furnace.getBurnTime() == 0 && !plugin.furnaceIsTracked(furnaceBlock)) {
|
if (furnace.getBurnTime() == 0 && !plugin.furnaceIsTracked(furnaceBlock)) {
|
||||||
@ -47,6 +52,11 @@ public class InventoryListener implements Listener{
|
|||||||
if (inventoryType == InventoryType.FURNACE) {
|
if (inventoryType == InventoryType.FURNACE) {
|
||||||
FurnaceInventory inventory = (FurnaceInventory) event.getInventory();
|
FurnaceInventory inventory = (FurnaceInventory) event.getInventory();
|
||||||
Furnace furnace = inventory.getHolder();
|
Furnace furnace = inventory.getHolder();
|
||||||
|
|
||||||
|
if (furnace == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Block furnaceBlock = furnace.getBlock();
|
Block furnaceBlock = furnace.getBlock();
|
||||||
|
|
||||||
if (furnace.getBurnTime() == 0 && plugin.furnaceIsTracked(furnaceBlock)) {
|
if (furnace.getBurnTime() == 0 && plugin.furnaceIsTracked(furnaceBlock)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user