AppleCore

AppleCore

56M Downloads

Add way to handle exhaustion values on block break/walk/sprint/jump etc.

zcaliptium opened this issue ยท 7 comments

commented

Hello! I am using AppleCore and... Making complex mod which enhances survival aspects of Minecraft.
Seems like AC doesn't provide functionality to tweak some hardcoded values related to hunger defined by Mojang. In my opinion AC should provide full and fancy control over all stuff related to hunger.

Like:

  • Jump (while sprinting and just jump)
  • Movement (Swimming/Walking/Sprinting)
  • Attack Entity (0.1)
  • Block Harversing (0.005)
    • There are 3 places (harvestBlock method at classes Block, BlockIce, BlockContainer)

For example exhaunstion value on jump.
Code at EntityPlayer:

    public void jump()
    {
        super.jump();
        this.addStat(StatList.JUMP);

        if (this.isSprinting())
        {
            this.addExhaustion(0.2F);
        }
        else
        {
            this.addExhaustion(0.05F);
        }
    }

I really need this functionality.
But I don't really want to make own coremod to tweak these values.
There also option for some cases make ugly hack through Forge event handlers for LivingUpdateEvent and or AttackEntityEvent and add back wasted amount of exhaustion, and then add my value. But how to be in case of jumping?

commented

Let me know what you think of this:

EDIT: Also, just to make sure, you need this for Minecraft 1.12.2, right? Might not backport this unless I need to.

commented

Seems reasonable. ๐Ÿ‘

commented

@zcaliptium how much context do you want provided for this sort of thing? For example, would it be good enough to just know that the exhaustion is coming from a block being broken, or do you expect to also know which block was broken?

commented

Correct. I need it only for 1.12.2.
And... I think don't need information about broken block.

Thank you. I will check out new event ASAP.

commented

Wow! Compiled AppleCore out of recent commit. I tested it out - It works fine! <3
Thank you again! I think you may close this Issue.

commented

Glad to hear it. Will close once I release a version with this change in it.

commented

Released in v3.2.0.