Carpet

Carpet

2M Downloads

Setting absorption amount casts the argument to an integer before applying it as a float.

James103 opened this issue ยท 1 comments

commented

put("absorption", (e, v) -> {
if (e instanceof PlayerEntity) ((PlayerEntity) e).setAbsorptionAmount((float) NumericValue.asNumber(v, "absorbtion").getLong());
});

In the above code, even though absorption should be a float as indicated by the (float) cast, it is retrieved as a long using Scarpet methods. This restricts the domain to just integers and does not allow fractional absorption to be set with Scarpet alone.

You can get fractional absorption in the game by giving yourself the Absorption effect, putting on full armor, taking damage once from a cactus, then checking your AbsorptionAmount.

commented

Oops... I may or may not have checked that code thouroughly...