Skip to content

Make new air usage setting to make it optional and toggleable for tools and armors.#72

Open
Gytube wants to merge 6 commits into
iglee42:1.21.1from
Gytube:1.21.1
Open

Make new air usage setting to make it optional and toggleable for tools and armors.#72
Gytube wants to merge 6 commits into
iglee42:1.21.1from
Gytube:1.21.1

Conversation

@Gytube
Copy link
Copy Markdown

@Gytube Gytube commented May 2, 2026

Creating a new setting in the config, so the player is able to toggle (enable/disable) the usage of air instead of the classic durability for every armor and tool made with shadow steel, refined radiance and shadow radiance.

use_air = false : tools and armors will behave normally by using their own durability, no air will be used (as if the backtank was empty).
use_air = true : tools will use air from the backtank if available, if backtank is empty, it will behave as usual.

Diving in water and in lava will not be affected by this new setting (will still use backtank air normally).

The only thing that will change is when the air will be consumed from the backtank by the items.

This new setting can solve the problem when mining underwater with shadowradiance pickaxe with digging power enabled, 3x3 mining can empty the backtank very fast and becomes a problem when we need air for underwater breathing. Making this optional (using classic durability) can be more helpful.

Let me know what you think about this.

Demo video : https://youtu.be/WCpgygWecmQ

2026-05-03_00 02 31 2026-05-02_23 54 48 2026-05-02_23 54 42 2026-05-02_23 54 27

Gytube added 4 commits April 24, 2026 02:11
Add a new use_air boolean config to CQOLArmors and CQOLTools with explanatory comments. Update ShadowRadianceAxe to expose a per-item "Use Air" toggle in the tooltip/config GUI and to honor QOLDataComponents.USE_AIR: when enabled the axe will let BacktankUtil absorb damage instead of consuming tool durability, and durability bar visibility/width/color are switched to reflect backtank usage. Also add required imports and minor formatting adjustments.
Introduce a USE_AIR toggle for multiple armors and tools so items can consume air from the backtank instead of their own durability. Updates include: added hover tooltip lines for the "use air" ability, added Configuration.ofBool entries to item configuration lists, changed damage handling to defer to BacktankUtil when USE_AIR is enabled, and made the air/durability bar visibility/width/color conditional on the USE_AIR flag. Also cleaned up a couple of unused imports (removed ConfigBool and some unused event/import lines). This enables per-item control to prefer backtank air usage where configured.
Add English localization entries for the "Use Air" ability to en_us.json. This introduces createqol.ability.tool.use_air and createqol.ability.armor.use_air so the tool and armor abilities have proper labels in the UI.
Copy link
Copy Markdown
Owner

@iglee42 iglee42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea to add config for this but I think in global it should just stay as a global config and not as a config for the item

Comment thread .vscode/launch.json Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this file and add the .vscode folder to github ignore

Comment thread src/main/java/fr/iglee42/createqualityoflife/config/CQOLArmors.java
Comment thread src/main/java/fr/iglee42/createqualityoflife/config/CQOLTools.java
Comment thread src/main/resources/assets/createqol/lang/en_us.json
@Gytube
Copy link
Copy Markdown
Author

Gytube commented May 17, 2026

"This is a good idea to add config for this but I think in global it should just stay as a global config and not as a config for the item"
By global config you mean it should be toggled from the createqol-server.toml config file, or from the backtank in-game config to control all tools/armors from one option (instead of each item) ?

"Also if think you should change the message in tooltip to replace the one with air amount instead of adding a new tooltip line"
Can you give me more details please ? Tools must display the amount of air remaining in the backtank ?

@iglee42
Copy link
Copy Markdown
Owner

iglee42 commented May 17, 2026

By global config you mean it should be toggled from the createqol-server.toml config file, or from the backtank in-game config to control all tools/armors from one option (instead of each item) ?

I meant with the config file createqol-server.toml, not a configuration on each item/only the backtank

Can you give me more details please ? Tools must display the amount of air remaining in the backtank ?

I meant for the backtank not for the tools/helmet/leggings/boots.
I just add the comment in the wrong place

@Gytube
Copy link
Copy Markdown
Author

Gytube commented May 17, 2026

Alright, i've done the changes, check if it's what you waited for.
Some screenshots ingame :

2026-05-17_16 28 16 2026-05-17_16 28 36 image 2026-05-17_16 31 26 2026-05-17_16 34 36


@Override
public void appendHoverText(ItemStack stack, @Nullable TooltipContext p_41422_, List<Component> components, TooltipFlag p_41424_) {
String airTooltip = CreateQOLConfigs.server().equipments.useAir.get() ? " (Powering equipment with air)" : " (Underwater breathing only)";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make it a translated message instead of having a hardcoded string pls


@Override
public void appendHoverText(ItemStack stack, @Nullable TooltipContext p_41422_, List<Component> components, TooltipFlag p_41424_) {
String airTooltip = CreateQOLConfigs.server().equipments.useAir.get() ? " (Powering equipment with air)" : " (Underwater breathing only)";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@Override
public void appendHoverText(ItemStack stack, @Nullable TooltipContext p_41422_, List<Component> components, TooltipFlag p_41424_) {
String airTooltip = CreateQOLConfigs.server().equipments.useAir.get() ? " (Powering equipment with air)" : " (Underwater breathing only)";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants