mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 23:27:59 +01:00
Grant the player experience when crafting spells
This commit is contained in:
parent
25d9ebba17
commit
89879494df
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ import net.minecraft.inventory.Inventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.screen.slot.CraftingResultSlot;
|
import net.minecraft.screen.slot.CraftingResultSlot;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class OutputSlot extends CraftingResultSlot implements SpellbookSlot {
|
public class OutputSlot extends CraftingResultSlot implements SpellbookSlot {
|
||||||
private final SpellbookScreenHandler handler;
|
private final SpellbookScreenHandler handler;
|
||||||
|
@ -54,7 +55,7 @@ public class OutputSlot extends CraftingResultSlot implements SpellbookSlot {
|
||||||
InventoryUtil.stream(input).forEach(s -> {
|
InventoryUtil.stream(input).forEach(s -> {
|
||||||
pony.getDiscoveries().unlock(s.getItem());
|
pony.getDiscoveries().unlock(s.getItem());
|
||||||
});
|
});
|
||||||
//gemSlot.setStack(ItemStack.EMPTY);
|
pony.getMagicalReserves().getXp().add(MathHelper.clamp(player.world.getRandom().nextFloat() / 10F, 0.001F, 0.3F));
|
||||||
super.onTakeItem(player, stack);
|
super.onTakeItem(player, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue