Mekanism

Mekanism

111M Downloads

[1.20.1] Meka suit Grav Module will not re-enable creative flight if turned off by another mod previously

TelepathicGrunt opened this issue ยท 4 comments

commented

Issue description

If you have Creative Flight on by Meka Suit and it gets disabled by another mod, you cannot re-enable the flight without unequipping and re-equipping the suit.

Steps to reproduce

Using latest Bumblezone mod on 1.20.1 Forge, use fill command to place Heavy Air block across an area:
/fill ~ ~ ~ ~20 ~40 ~20 the_bumblezone:heavy_air

Put on a Meka Suit with Grav Module for Creative Flight.

Enable the Creative Flight and fly into the Heavy Air. The Heavy Air block will detect the Creative Flight and turn it off and send packet to client like so:
https://github.com/TelepathicGrunt/Bumblezone/blob/97d975e74904f6388ad4c1d8d8f32aaac7a67964/common/src/main/java/com/telepathicgrunt/the_bumblezone/blocks/HeavyAir.java#L106-L110

Meka Suit will then stop flying which is intended. Now exit the Heavy Air space and try to activate Creative Flight again. It will fail despite Bumblezone no longer touching the fly/mayFly fields.

Unequip and re-equip the chestplate and flight can be activated again.

Note: If you do not enable flight while wearing the suit and enter/exit Heavy Air, you can still activate flight outside the space. Meaning the meka flight might still think it is still flying despite flight being forcibly turned off by another mod. Might need a check for if state of suit matches the creative flight booleans and correct whichever one is outdated.

Minecraft version

1.20.1 (Latest)

(Neo)Forge version

47.1.47 Forge

Mekanism version

10.4.0 (Latest)

Other relevant versions

No response

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

commented

Extra note: I did check the grav module after exiting Heavy Air and it says it is still enabled when I cannot activate Creative Flight with it anymore

image

commented

Weird I will definitely need to look into it as that should be handled by this line

commented

Mods can set a cooldown by doing:
player.getCooldowns().addCooldown(jetpack.getItem(), 40);

This will send a packet to clients as well so both sides will know about the cooldown.

You can then query to see if the cooldown is active by doing
if (player.getCooldowns().isOnCooldown(jetpack.getItem())) {

commented

I am going to go ahead and close this, given I suspect it isn't really an issue anymore in 1.21 now that it uses Neo's creative flight attribute