Skip to content

Add configurable cooldown duration for OBSIDIAN_SCOOPING flag#2860

Merged
tastybento merged 2 commits intodevelopfrom
copilot/add-duration-field-config-yml
Mar 14, 2026
Merged

Add configurable cooldown duration for OBSIDIAN_SCOOPING flag#2860
tastybento merged 2 commits intodevelopfrom
copilot/add-duration-field-config-yml

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

The obsidian scooping cooldown (anti-duplication guard) was hardcoded at 5 minutes with no way to configure it. This adds island.obsidian-scooping-cooldown to config.yml, defaulting to 1 minute.

Settings.java

  • New field obsidianScoopingCooldown = 1 (minutes) at path island.obsidian-scooping-cooldown
  • Getter/setter with minimum-1 enforcement via Math.max(1, value)
  • Placed adjacent to obsidianScoopingRadius for logical grouping
# island.obsidian-scooping-cooldown
# The duration of the cooldown (in minutes) applied after a player scoops an obsidian block
# into a lava bucket using the OBSIDIAN_SCOOPING flag. Prevents lava bucket duplication exploits.
# Minimum value is 1 minute. Default is 1 minute.
# Note: Changes to this value require a server restart to take effect.
obsidian-scooping-cooldown: 1

ObsidianScoopingListener.java

  • Replaced hardcoded new ExpiringSet<>(5, TimeUnit.MINUTES) with lazy initialization reading from Settings
  • Lazy init is required because ObsidianScoopingListener is instantiated during Flags static field initialization — which occurs inside new FlagsManager(this), before loadSettings() is called in BentoBox.onEnable()
  • Uses double-checked locking with volatile for correctness
Original prompt

In the BentoBox repository, add a new configuration field for 'duration' in the 'config.yml' file. This field should determine the default duration of a specific feature. Additionally, set the default value of this 'duration' parameter to 1 minute. Ensure thorough documentation is added to explain the purpose of the 'duration' field, and verify that the new configuration does not interfere with existing configurations.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Add the configuration for the duration to BentoBox config.yml and also change the default duration to 1 minute.

Assistant: The issue you referred to, #2839, is titled "Lava bucket duplication by obsidian scooping." This issue involves an exploit where lava buckets can be duplicated using obsidian scooping mechanics in the BentoBox plugin. The primary concern is that lava buckets fill the inventory when rapidly right-clicking on obsidian near water.

Would you like me to proceed with adding a duration configuration to the config.yml file and setting the default duration to 1 minute for this issue?

User: Yes

Assistant: A pull request has been initiated to add the duration configuration to the config.yml file in the BentoBox repository, setting the default duration to 1 minute. Let me know if you need further updates or adjustments!

User: Accepted Confirmation: Are you sure?

Assistant: It appears the base repository or branch may not exist as specified in the BentoBox repository. Could you confirm the main branch or clarify if there is a specific base branch I should use for the pull request?

User: develop is the main branch of

Assistant: The pull request to add a duration configuration to the config.yml file, setting the default duration to 1 minute, has been successfully initiated and is based on the develop branch. Let me know if you need further assistance!

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] Add duration configuration field in config.yml Add configurable cooldown duration for OBSIDIAN_SCOOPING flag Mar 14, 2026
Copilot AI requested a review from tastybento March 14, 2026 20:19
@tastybento tastybento marked this pull request as ready for review March 14, 2026 20:45
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@tastybento tastybento merged commit 67a4b5f into develop Mar 14, 2026
2 of 3 checks passed
@tastybento tastybento deleted the copilot/add-duration-field-config-yml branch March 14, 2026 20:49
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