Compare commits
2 Commits
46d4f583ba
...
09170f6d51
Author | SHA1 | Date |
---|---|---|
Phoenix616 | 09170f6d51 | |
Phoenix616 | 488cd2e9d5 |
8
pom.xml
8
pom.xml
|
@ -49,6 +49,10 @@
|
|||
<id>NyaaCat</id>
|
||||
<url>https://ci.nyaacat.com/maven/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>redprotect-repo</id>
|
||||
<url>https://raw.githubusercontent.com/FabioZumbi12/RedProtect/mvn-repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
@ -255,13 +259,13 @@
|
|||
<dependency>
|
||||
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
|
||||
<artifactId>RedProtect-Spigot</artifactId>
|
||||
<version>7.6.2</version>
|
||||
<version>7.7.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
|
||||
<artifactId>RedProtect-Core</artifactId>
|
||||
<version>7.6.2</version>
|
||||
<version>7.7.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
|
|
@ -190,10 +190,10 @@ public class Properties {
|
|||
public static UUID SERVER_ECONOMY_ACCOUNT_UUID = new UUID(0, 0);
|
||||
|
||||
@ConfigurationComment("Percent of the price that should go to the server's account. (100 = 100 percent)")
|
||||
public static int TAX_AMOUNT = 0;
|
||||
public static double TAX_AMOUNT = 0;
|
||||
|
||||
@ConfigurationComment("Percent of the price that should go to the server's account when buying from an Admin Shop.")
|
||||
public static int SERVER_TAX_AMOUNT = 0;
|
||||
public static double SERVER_TAX_AMOUNT = 0;
|
||||
|
||||
@ConfigurationComment("Amount of money player must pay to create a shop")
|
||||
public static BigDecimal SHOP_CREATION_PRICE = BigDecimal.valueOf(0);
|
||||
|
|
|
@ -20,8 +20,8 @@ public class TaxModule implements Listener {
|
|||
private static final String TAX_RECEIVED_MESSAGE = "Applied a tax of %1$f percent (%2$.2f) to the received amount for a resulting price of %3$.2f";
|
||||
private static final String TAX_SENT_MESSAGE = "Reduced buy price by tax of %1$f percent (%2$.2f) for a resulting price of %3$.2f as the buyer has the buy tax bypass permission";
|
||||
|
||||
private static float getTax(UUID partner) {
|
||||
float taxAmount = NameManager.isAdminShop(partner) || NameManager.isServerEconomyAccount(partner)
|
||||
private static double getTax(UUID partner) {
|
||||
double taxAmount = NameManager.isAdminShop(partner) || NameManager.isServerEconomyAccount(partner)
|
||||
? Properties.SERVER_TAX_AMOUNT : Properties.TAX_AMOUNT;
|
||||
|
||||
if (taxAmount == 0) {
|
||||
|
@ -31,7 +31,7 @@ public class TaxModule implements Listener {
|
|||
return taxAmount;
|
||||
}
|
||||
|
||||
private static BigDecimal getTaxAmount(BigDecimal price, float taxAmount) {
|
||||
private static BigDecimal getTaxAmount(BigDecimal price, double taxAmount) {
|
||||
return price.multiply(BigDecimal.valueOf(taxAmount)).divide(BigDecimal.valueOf(100), Properties.PRICE_PRECISION, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class TaxModule implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
float taxAmount = getTax(event.getPartner());
|
||||
double taxAmount = getTax(event.getPartner());
|
||||
if (taxAmount == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue