mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-31 03:25:28 +02:00
Tree Feller now partially destroys trees if the whole tree is too big
Fixes #4811
This commit is contained in:
@@ -85,6 +85,9 @@ public class WoodcuttingManager extends SkillManager {
|
||||
}
|
||||
|
||||
public void processWoodcuttingBlockXP(@NotNull BlockState blockState) {
|
||||
if(mcMMO.getPlaceStore().isTrue(blockState))
|
||||
return;
|
||||
|
||||
int xp = getExperienceFromLog(blockState);
|
||||
applyXpGain(xp, XPGainReason.PVE);
|
||||
}
|
||||
@@ -102,19 +105,6 @@ public class WoodcuttingManager extends SkillManager {
|
||||
|
||||
processTree(blockState, treeFellerBlocks);
|
||||
|
||||
// If the player is trying to break too many blocks
|
||||
if (treeFellerReachedThreshold) {
|
||||
treeFellerReachedThreshold = false;
|
||||
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Threshold");
|
||||
|
||||
//Tree feller won't be activated for this block, award normal xp.
|
||||
processWoodcuttingBlockXP(blockState);
|
||||
processHarvestLumber(blockState);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// If the tool can't sustain the durability loss
|
||||
if (!handleDurabilityLoss(treeFellerBlocks, player.getInventory().getItemInMainHand(), player)) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Splinter");
|
||||
@@ -352,6 +342,9 @@ public class WoodcuttingManager extends SkillManager {
|
||||
* @return Amount of experience
|
||||
*/
|
||||
private static int processTreeFellerXPGains(BlockState blockState, int woodCount) {
|
||||
if(mcMMO.getPlaceStore().isTrue(blockState))
|
||||
return 0;
|
||||
|
||||
int rawXP = ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType());
|
||||
|
||||
if(rawXP <= 0)
|
||||
|
Reference in New Issue
Block a user