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

Nation tax percent #6262

Merged
merged 5 commits into from
Oct 28, 2022
Merged

Conversation

PainOchoco
Copy link
Contributor

@PainOchoco PainOchoco commented Oct 24, 2022

Description:

Adds Tax percentage for nations


New Nodes/Commands/ConfigOptions:

Commands
  - New Commands:
    - `/nation toggle taxpercent` - Toggle percentage nationtax on or off.
    - `/nation set taxpercentcap` - Sets the max amount of money which can be gotten via percent nationtax, from a town.
Permissions
  - New Permission Nodes:
    - `towny.command.nation.toggle.taxpercent` - Child node of towny.command.nation.toggle.*.
    - ` towny.command.nation.set.taxpercentcap` - Child node of towny.command.nation.set.*.
    - No changes to townyperms.yml required.
Config options
  - New Config Options:
    - nation.default_taxes.tax
      - Default: 0.0
      - Default amount of tax of a new nation. This must be lower than the economy.daily_taxes.max_nation_tax_amount setting.
    - nation.default_taxes.taxpercentage
      - Default: false
      - Default status of new nation's taxpercentage. True means that the default_tax is treated as a percentage instead of a fixed amount.
    - nation.default_taxes.minimumtax
      - Default: 0.0
      - A required minimum tax amount for the default_tax, will not change any nations which already have a tax set.
      - Do not forget to set the default_tax to more than 0 or new nations will still begin with a tax of zero.
    - economy.daily_taxes.max_nation_tax_percent
      - Default: 25
      - Maximum tax percentage allowed when taxing by percentages for nations.
    - economy.daily_taxes.max_nation_tax_percent_amount
      - Default: 10000
      - The maximum amount of money that can be taken from a balance when using a percent tax, this is the default for all new nations.

Relevant Towny Issue ticket:

Closes #6106


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

Copy link
Member

@LlmDl LlmDl left a comment

Choose a reason for hiding this comment

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

Spotted a couple of small things, lookin' good so far though.

src/com/palmergames/bukkit/config/ConfigNodes.java Outdated Show resolved Hide resolved
src/com/palmergames/bukkit/towny/TownySettings.java Outdated Show resolved Hide resolved
src/com/palmergames/bukkit/towny/db/SQL_Schema.java Outdated Show resolved Hide resolved
@PainOchoco PainOchoco marked this pull request as ready for review October 24, 2022 19:33
@PainOchoco
Copy link
Contributor Author

I think I've tested everything, (except the save to sql because it's a bit complicated to setup but there should not be any problem as I followed the same methods as the town) but make sure to double check just in case I missed something.

(Also please add the hacktoberfest-accepted :P)

@LlmDl LlmDl force-pushed the nation_tax_percent branch from b8c8258 to f88f2b4 Compare October 26, 2022 21:36
@LlmDl LlmDl added this to the 0.98.4.0 milestone Oct 28, 2022
@LlmDl LlmDl merged commit b15bd11 into TownyAdvanced:master Oct 28, 2022
@LlmDl LlmDl deleted the nation_tax_percent branch October 28, 2022 14:25
LlmDl added a commit that referenced this pull request Oct 28, 2022
PainOchoco with PR #6263.
  - New Placeholders:
    - %townyadvanced_town_balance_unformatted% - Shows the town's raw
cached bank balance.
    - %townyadvanced_nation_balance_unformatted% - Shows the nation's
raw cached bank balance.
  - Added max residents per nation, courtesy of PainOchoco with
PR #6264.
  - New Config Option: global_nation_settings.max_residents_per_nation
    - Default: 0
    - If higher than 0, it will limit how many residents can join a
nation. Does not affect existing nations that are already over the
limit.
  - Added Nation tax percent, courtesy of PainOchoco with PR #6262.
    - It is possible for nations to use /n toggle taxpercent, and tax
their towns a percent of the town bank, instead of a flat rate.
    - This prevents towns being kicked for non-payment, as the amount
just shrinks as the town gets poorer.
  - New Config Options:
    - nation.default_taxes.tax
      - Default: 0.0
      - Default amount of tax of a new nation. This must be lower than
the economy.daily_taxes.max_nation_tax_amount setting.
    - nation.default_taxes.taxpercentage
      - Default: false
      - Default status of new nation's taxpercentage. True means that
the default_tax is treated as a percentage instead of a fixed amount.
    - nation.default_taxes.minimumtax
      - Default: 0.0
      - A required minimum tax amount for the default_tax, will not
change any nations which already have a tax set.
      - Do not forget to set the default_tax to more than 0 or new
nations will still begin with a tax of zero.
    - economy.daily_taxes.max_nation_tax_percent
      - Default: 25
      - Maximum tax percentage allowed when taxing by percentages for
nations.
    - economy.daily_taxes.max_nation_tax_percent_amount
      - Default: 10000
      - The maximum amount of money that can be taken from a balance
when using a percent tax, this is the default for all new nations.
  - New Commands:
    - `/nation toggle taxpercent` - Toggle percentage nationtax on or
off.
    - `/nation set taxpercentcap` - Sets the max amount of money which
can be gotten via percent nationtax, from a town.
  - New Permission Nodes:
    - `towny.command.nation.toggle.taxpercent` - Child node of
towny.command.nation.toggle.*.
    - ` towny.command.nation.set.taxpercentcap` - Child node of
towny.command.nation.set.*.
    - No changes to townyperms.yml required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Toggle tax percentage for nations as well as towns
2 participants