Closed ProfHugo closed 7 years ago
Woops, did overlook that. One question, does FTB Utilities uses canHarvestBlock and/or canSilkHarvest? Because if so, I can just put a check to see if the player (caster) can indeed harvest the block at pos, instead of relying on the premade harvestBlock method.
edit: nvm I'm stupid
@Growlith1223 Is it a good idea to use fireBlockHarvesting from forgeEventFactory? It does go through onBlockBreakEvent (which many chunkclaimer uses) and seems very appealing
edit: lul the old code uses world.destoryBlock() anyways (I dun get it, doesn't harvestblock also set the block to air, or am I missing something here?
code from current state dig:
if (hardness != -1 && state.getBlock().getHarvestLevel(state) <= SpellUtils.getModifiedInt_Add(2, stack, caster, null, world, SpellModifiers.MINING_POWER)) {
state.getBlock().harvestBlock(world, (EntityPlayer)caster, blockPos, state, null, stack);
world.destroyBlock(blockPos, false);
EntityExtension.For(caster).deductMana(hardness * 1.28f);
}
One question @Growlith1223, are there any other methods that destroys the block and passes thru onBlockBreak (and have player parameter for canceling purposes)?
Should probably move 354840b to its own branch.
woops yeah completely forgot about this pull request. I guess ur right, for now imma close this because this has been left untouched for way too long
For some reason "modified add" was miscounting ONLY radius modifiers (see #143). Here's a bootleg fix that fixes the calculation for it, it just adds 1 more block of radius if there are any radius modifiers in the spell. It's more preferable if the root cause for this could be found and fixed instead of bootleg fixing this, but this should work for now.
Fixes #143