mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Fix smelting vanilla xp boost. Fixes #3270
This commit is contained in:
parent
4c3f3ee4e2
commit
d3cc23f6a0
@ -124,10 +124,8 @@ public class InventoryListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onFurnaceExtractEvent(FurnaceExtractEvent event) {
|
public void onFurnaceExtractEvent(FurnaceExtractEvent event) {
|
||||||
Block furnaceBlock = event.getBlock();
|
Block furnaceBlock = event.getBlock();
|
||||||
BlockState furnaceState = furnaceBlock.getState();
|
|
||||||
ItemStack result = furnaceState instanceof Furnace ? ((Furnace) furnaceState).getInventory().getResult() : null;
|
|
||||||
|
|
||||||
if (!ItemUtils.isSmelted(result)) {
|
if (!ItemUtils.isSmelted(new ItemStack(event.getItemType(), event.getItemAmount()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +135,8 @@ public class InventoryListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setExpToDrop(UserManager.getPlayer(player).getSmeltingManager().vanillaXPBoost(event.getExpToDrop()));
|
int exp = UserManager.getPlayer(player).getSmeltingManager().vanillaXPBoost(event.getExpToDrop());
|
||||||
|
event.setExpToDrop(exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
@ -524,8 +524,8 @@ public final class ItemUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Recipe recipe : mcMMO.p.getServer().getRecipesFor(item)) {
|
for (Recipe recipe : mcMMO.p.getServer().getRecipesFor(item)) {
|
||||||
if (recipe instanceof FurnaceRecipe) {
|
if (recipe instanceof FurnaceRecipe && MaterialUtils.isOre(((FurnaceRecipe) recipe).getInput().getData())) {
|
||||||
return MaterialUtils.isOre(((FurnaceRecipe) recipe).getInput().getData());
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user