altaiiiir / Viner

Welcome to Viner, a mod inspired by the classic Veinminer! With Viner, you can mine blocks in veins, saving you precious time from digging into walls. It's all about efficiency!
https://modrinth.com/mod/viner
3 stars 5 forks source link

Mining Blocks does not give XP #13

Closed TheJaysH closed 11 months ago

TheJaysH commented 11 months ago

Originally reported by KizXii on discord https://discord.com/channels/1135099149658890340/1135099150405480525/1168441808926281789

TheJaysH commented 11 months ago

@altaiiiir Let me know if you want to work through this.

branch here: https://github.com/altaiiiir/Viner/tree/bugfix/0013-no-mining-exp

TheJaysH commented 11 months ago

@altaiiiir If you take a look in ForgeHooks.java. Lines: 486-489

int silkTouchLevel = stack.getEnchantmentLevel(Enchantments.SILK_TOUCH);
int exp = state.getExpDrop(level, level.random, pos, fortuneLevel, silkTouchLevel);
    if (exp > 0)
        state.getBlock().popExperience(level, pos, exp);

This should be a good starting point