Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two new settings to 1.20.1 #285

Open
wants to merge 1 commit into
base: 1.20.1
Choose a base branch
from

Conversation

Martmists-GH
Copy link

@Martmists-GH Martmists-GH commented Jun 7, 2024

Adds two new settings:

  • Reputation decrease on fail
    • Technically decreases when the bounty is taken, but adds 2 when completed to balance out. Figured this was a better solution than storing the original block in bounties and checking when they expire, as this would also cause random chunk loads.
  • Allow multiple copies
    • Allows for disabling the behavior where multiple people can take the same bounty.

Defaults for these settings retain existing behaviour

Signed-off-by: Martmists <[email protected]>
@ejektaflex
Copy link
Owner

ejektaflex commented Jun 7, 2024

  • Allow multiple copies
    • LGTM 👍 Nice!
  • Reputation decrease on fail
    • I understand the rationale behind your solution, though I do not think that this is ideal. This means that if you are just barely at Reputation 5 and then a player takes a bounty, it will go down to Rep 4 until the bounties are turned in, which is an unintended side effect that players would report as a bug
    • Instead, I would recommend that you store a map of Map<String, Long> which stores a map of bounty data hash codes to when they expire. When taking a bounty, add the hash code and expiry time to this map. When a bounty is turned in, the key/value pair is removed from this map. On a regular basis (every few seconds), the board will check to see if there exists an entry that has expired - if so, we reduce the reputation turn-in value by 1 and remove it from the map.
      • A more optimal solution would be to give individual bounties unique IDs instead of hash codes and I plan to do that in a future version. However, that currently does not exist in 1.20.1.
    • This does have the side effect that turning into a different bounty board means that the original bounty board will still lose 1 rep turn-in value. However, it's still better than the proposed solution which will always cause the board to lose 1 rep turn-in value even if future completion might occur.
    • There might be a more optimal solution than this, but this was just me spitballing on my lunch break :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants