Skip to content

Commit

Permalink
Add tax option to config.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Jun 17, 2020
1 parent 3a5589f commit 95138af
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/world/bentobox/visit/configs/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ public class Settings implements ConfigObject
@ConfigEntry(path = "island-icon")
private Material islandIcon = Material.PLAYER_HEAD;

@ConfigComment("")
@ConfigComment("Allows to define tax amount (not %) that must be payed extra for visiting.")
@ConfigComment("Example:")
@ConfigComment(" Island payment is set to 10, and tax is set to 5, then visitor will need to pay 15.")
@ConfigComment(" 10 will go to island owner, while 5 will be erased from existence.")
@ConfigEntry(path = "traveling-tax")
private double taxAmount = 0.0;

@ConfigComment("")
@ConfigComment("Allows to define default payment for visiting the island.")
@ConfigComment("Setting 0 or less will mean that default value is free.")
Expand Down Expand Up @@ -207,4 +215,25 @@ public void setIslandIcon(Material islandIcon)
{
this.islandIcon = islandIcon;
}


/**
* This method returns the taxAmount value.
* @return the value of taxAmount.
*/
public double getTaxAmount()
{
return this.taxAmount;
}


/**
* This method sets the taxAmount value.
* @param taxAmount the taxAmount new value.
*
*/
public void setTaxAmount(double taxAmount)
{
this.taxAmount = taxAmount;
}
}
6 changes: 6 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ show-gamemode-header: true
# PLAYER_HEAD will be transformed to island owner head.
island-icon: PLAYER_HEAD

# Allows to define tax amount (not %) that must be payed extra for visiting.
# Example:
# Island payment is set to 10, and tax is set to 5, then visitor will need to pay 15.
# 10 will go to island owner, while 5 will be erased from existence.
traveling-tax: 0

default-settings:
# Allows to define default payment for visiting the island.
# Setting 0 or less will mean that default value is free.
Expand Down

0 comments on commit 95138af

Please sign in to comment.