Passable Leaves

Passable Leaves

576k Downloads

Updating to 1.11.2

whichonespink44 opened this issue ยท 2 comments

commented

As far as I can tell, the following needs to be ASM'ed into BlockLeaves:

    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
    {
        return NULL_AABB;
    }
    public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
    {
        return true;
    }

And the following method also needs to be added, but in such a way that it references a static method that we can change without having to rewrite any of the ASM:

    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
    {
        onEntityCollidedWithLeaves(worldIn, pos, state, entityIn);
    }

where onEntityCollidedWithLeaves would look something like this, pulling in config values, etc:

    //ONLY modify the name of this method if you rename it in the ASM above too.
    //This method is called by its exact name.
    public static void onEntityCollidedWithLeaves(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
        entity.motionX *= Double.valueOf(ConfigPL.motionX); // 0.75D
        entity.motionY *= Double.valueOf(ConfigPL.motionY); // 0.75D
        entity.motionZ *= Double.valueOf(ConfigPL.motionZ); // 0.75D
        entity.fallDistance = Float.valueOf(ConfigPL.fallDistance); // 0f
    }
commented

Was/Is that directed at me?

commented

@HellFirePvP nope, just created an issue for reference because @superckl mentioned in the RTG Discord that he might take a stab at updating the ASM to make it compatible with 1.11.2

@srs-bsns also mentioned that he might try writing a Sponge mixin for it, which might be the better way to go long-term, but... either way, just putting up the details for reference for whoever ends up working their ASM wizardry :)