mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Fix issue where the vanilla XP boost for smelting would be called
regardless of who took the item out of the furnace. Not only does this fix the exploit, it also fixes an NPE that could occur if the player who lit the furnance was offline when someone else extracted the items from it.
This commit is contained in:
parent
2762a9d1fd
commit
8c7fd7b1a6
@ -17,6 +17,7 @@ import org.bukkit.inventory.FurnaceInventory;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
||||||
import com.gmail.nossr50.util.ItemChecks;
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
@ -118,9 +119,13 @@ public class InventoryListener implements Listener{
|
|||||||
ItemStack result = inventory.getResult();
|
ItemStack result = inventory.getResult();
|
||||||
|
|
||||||
if (plugin.furnaceIsTracked(furnaceBlock) && result != null && ItemChecks.isSmelted(result)) {
|
if (plugin.furnaceIsTracked(furnaceBlock) && result != null && ItemChecks.isSmelted(result)) {
|
||||||
SmeltingManager smeltingManager = new SmeltingManager(Users.getPlayer(plugin.getFurnacePlayer(furnaceBlock)));
|
McMMOPlayer mcMMOPlayer = Users.getPlayer(plugin.getFurnacePlayer(furnaceBlock));
|
||||||
|
|
||||||
|
if (event.getPlayer().equals(mcMMOPlayer.getPlayer())) {
|
||||||
|
SmeltingManager smeltingManager = new SmeltingManager(mcMMOPlayer);
|
||||||
smeltingManager.vanillaXPBoost(event);
|
smeltingManager.vanillaXPBoost(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user