[Suggestion] Add option to toggle back to offhand item after Auto Totem
Describe the feature
When Auto Totem equips a totem for you, for example when you fall and there is water at the bottom, there could be an option that when Auto Totem thinks it's safe again it then toggles back to what you previously held in the offhand.
Before submitting a suggestion
-
[x] This feature doesn't already exist in the client. (I have checked every module and their settings on the latest dev build)
-
[x] This wasn't already suggested. (I have searched suggestions on GitHub and read the FAQ)
I just skimmed through the code of the code of AutoTotem and the used PlayerUtils function possibleHealthReductions() and there it says it scans for water:
// Check for fall distance with water check
if (fall) {
if (!Modules.get().isActive(NoFall.class) && mc.player.fallDistance > 3) {
float damage = DamageUtils.fallDamage(mc.player);
if (damage > damageTaken && !EntityUtils.isAboveWater(mc.player)) {
damageTaken = damage;
}
}
}
This is done using the isAboveWater() function:
@SuppressWarnings("deprecation") // Use of AbstractBlock.AbstractBlockState#blocksMovement
public static boolean isAboveWater(Entity entity) {
BlockPos.Mutable blockPos = entity.getBlockPos().mutableCopy();
for (int i = 0; i < 64; i++) {
BlockState state = mc.world.getBlockState(blockPos);
if (state.blocksMovement()) break;
Fluid fluid = state.getFluidState().getFluid();
if (fluid == Fluids.WATER || fluid == Fluids.FLOWING_WATER) {
return true;
}
blockPos.move(0, -1, 0);
}
return false;
}
And I guess the bug is that it only checks for the next 64 blocks below a player, not more, which is not enough when falling for example from y = 60 to y = -20.
I still think that the option to switch back to the previous item is a thing to consider, so I wont rename / change this Issue but create a new one about the bug.