Skip to content

Commit

Permalink
添加魔鬼税率开关
Browse files Browse the repository at this point in the history
  • Loading branch information
Tining123 committed Jun 24, 2023
1 parent b4ee153 commit e2f4268
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Set diamond block with $440.
+ OP: The tax beneficiary. If you don't want to use it, just leave it blank.
+ BasicProperty: The average balance of single player in mathematical expectation.
+ Round: Enable and make the numbers approximate(shorter and easier to read)
+ enable-demon-tax: Enable progressive tax rate, the most basic function of this plugin
+ Fitler: For SlimeFun Plugin. Enable this option to block any items with lore being sold. Attention, this might cause the NBT support disable
+ disable-pay: Enable this option to prevent user from paying others by using ess or others plugin.
+ disable-pay-list: Set the paying command you want to block.
Expand All @@ -67,6 +68,7 @@ Set diamond block with $440.
+ payer-tax: whether the payer pays the transfer tax (the tax payed by the receiver in default)
+ auto-refresh: Enable to auto refresh the price in gui
+ auto-refresh-gap: Refresh interval (second per time)
+ disable-shop: Disable mt shop command.
## Mathematical Theory
+ TAX=(1 - TaxRate)

Expand Down
7 changes: 6 additions & 1 deletion README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
+ /mt sell all 卖掉背包里和手中同样的所有东西
+ /mt price 预估手中物品的出售收益
+ /mt help 查看帮助
+ /mt shop 打开商店进行购买

可用别名:dm,dmt,demonmarket

Expand All @@ -22,7 +23,9 @@
+ /mtadmin name 查看手中物品在配置中的名称
+ /mtadmin nbt 查看手中物品在配置中的nbt明细
+ /mtadmin reload 重载插件配置

+ /mtadmin shopset [price] - 将手中的物品添加到商店
+ /mtadmin shopnbtset [price] - 将手中的nbt物品添加到商店
+ /mtadmin shop - 打开商店管理面板
可用别名:dmadmin,dmtadmin,demonmarketadmin

## 使用效果
Expand All @@ -40,6 +43,7 @@
+ TaxRate: 税率,是经过收敛公式之后,在进行一次税率收取。默认千分之5,
+ OP: 服主,或者指定税率受益人。所有税收会打入这个玩家的账户。不想使用可以留空。
+ BasicProperty: 资产基线,最重要的配置。指定期望平均单个玩家持有的储蓄金额。可以根据服务器自身情况增加或者降低。当前默认50万。
+ enable-demon-tax: 禁用恶魔税率
+ Round: 是否开启小数点后两位近似功能
+ Fitler: 此功能针对粘液科技等其他插件,这些插件可能发放带有功能性的原版物品,启用该功能将禁止销售手中的这些特殊物品。
+ disable-pay: 默认开启,禁止试用其他插件的pay.
Expand All @@ -51,6 +55,7 @@
+ payer-tax: 是否由付款人支付转账税款(默认由接收人所受金额扣除)
+ auto-refresh: 是否开启自动刷新结算价格
+ auto-refresh-gap: 自动刷间隔(秒)
+ disable-shop: 禁用商店
## 理论支持
以下为计算价格的实际公式。 其中
+ price=物品设定价格
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public static double getSellingPrice(double value, int count, double money) {

while (count > 0) {
count--;
onePrice = MathUtil.priceDownByProperty(value, money, ConfigReader.getBasicProperty());
if(ConfigReader.getEnableDemonTax()){
onePrice = MathUtil.priceDownByProperty(value, money, ConfigReader.getBasicProperty());
}else{
onePrice = value;
}
price += onePrice;
money += onePrice;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,16 @@ public static double getPayUnit(){
*/
public static int getAutoRefreshInterval(){return ConfigReader.config.getInt("auto-refresh-gap") * 20;}


/**
* 获取是否禁用商品
* @return
*/
public static boolean getDisableShop(){return ConfigReader.config.getBoolean("disable-shop");}


/**
* 获取是否启用恶魔税率
* @return
*/
public static boolean getEnableDemonTax(){return ConfigReader.config.getBoolean("enable-demon-tax");}
}
3 changes: 3 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ BasicProperty: 500000
#Enable and make the numbers approximate(shorter and easier to read)
Round: true

#Enable progressive tax rate
enable-demon-tax: true

# For SlimeFun Plugin
# Enable this option to block any items with lore being sold
# Attention, this might cause the NBT support disable
Expand Down

0 comments on commit e2f4268

Please sign in to comment.