-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.9.0 - GDP command, admin commands and other improvements
Features: + Added /gdp to view GDP and per capita GDP + Added /increase and /decrease to easily increase and decrease the prices of items + Improved player UI and feedback + Added server name to more areas of the plugin + Improved data search algorithim for temporary data Fixes: + Fixed a lot of plugin incompatiblity issues + Fixed intrest rate being too high on startup + Improved code quality + Removed unneeded lines and comments + Fixed autotune not apperaing in some log messages + Fixed random debug messages + Fixed /at command frequently throwing an error + Fixed some commands throwing usage info when used correctly Other + Some grammatical improvements + More info and coherent README.MD + Updated to 0.9.0
- Loading branch information
1 parent
cd4cd66
commit e79df89
Showing
23 changed files
with
265 additions
and
105 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ email: '[email protected]' | |
## Enable//Disable integrated Web Server. | ||
web-server-enabled: true | ||
|
||
## Port for integrated Web Server (If enabled and on correct plan) | ||
## Port for integrated Web Server (If enabled) | ||
port: 8123 | ||
|
||
## The maximum length in data points that the trade-short.html will show (this doesn't affect data) | ||
|
@@ -90,7 +90,7 @@ currency-symbol: '$' | |
## Enable sell price difference variation to ease out sell price varition | ||
sell-price-difference-variation-enabled: false | ||
## Starting percententage sell price difference for sell price varition | ||
sell-price-differnence-variation-start: 25.0 | ||
sell-price-difference-variation-start: 25.0 | ||
## Time in minutes until sell price reaches sell-price-difference set in pricing model settings (default 7 days) | ||
sell-price-variation-time-period: 10080 | ||
## Time in minutes that the sell-price-difference updates | ||
|
@@ -113,7 +113,7 @@ static-inflation-value: 0.1 | |
|
||
## Intrest rate per intrest-rate-update-period | ||
## Info: This is the increase in the current debt payment per-time period | ||
intrest-rate: 0.01 | ||
intrest-rate: 0.001 | ||
## Time period in ticks between updates of the intrest rate for users loans | ||
intrest-rate-update-period: 1200 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
Auto-Tune/src/unprotesting/com/github/Commands/AutoTuneGDPCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package unprotesting.com.github.Commands; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.OfflinePlayer; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import net.md_5.bungee.api.ChatColor; | ||
import unprotesting.com.github.Main; | ||
import unprotesting.com.github.util.TextHandler; | ||
|
||
public class AutoTuneGDPCommand implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String gdp, String[] args) { | ||
Player p = (Player) sender; | ||
if (command.getName().equalsIgnoreCase("gdp")){ | ||
if (p.hasPermission("at.gdp") || p.isOp()){ | ||
String GDP = AutoTuneGUIShopUserCommand.df2.format(Main.tempdatadata.get("GDP")); | ||
double returnedGDP = Double.parseDouble(GDP); | ||
double[] serverBalance = getServerBalance(); | ||
double loanBalance = getLoanBalance(); | ||
returnedGDP += serverBalance[0]; | ||
returnedGDP -= loanBalance; | ||
p.sendMessage(ChatColor.GOLD + "The Current GDP is: " + ChatColor.GREEN + AutoTuneGUIShopUserCommand.df2.format(returnedGDP)); | ||
p.sendMessage(ChatColor.GOLD + "The Current GDP per capita is: " + ChatColor.GREEN + AutoTuneGUIShopUserCommand.df2.format(returnedGDP/serverBalance[1])); | ||
} | ||
else if (!(p.hasPermission("at.gdp")) && !(p.isOp())){ | ||
TextHandler.noPermssion(p); | ||
return true; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public double[] getServerBalance(){ | ||
double [] output = new double[2]; | ||
output[0] = 0.0; | ||
output[1] = 0.0; | ||
for (OfflinePlayer player : Bukkit.getOfflinePlayers()){ | ||
double x = Main.getEconomy().getBalance(player); | ||
output[0] += x; | ||
output[1] += 1; | ||
} | ||
return output; | ||
} | ||
|
||
public double getLoanBalance(){ | ||
double output = 0.0; | ||
for (String str : Main.loanMap.keySet()){ | ||
double[] arr = Main.loanMap.get(str); | ||
output += arr[0]; | ||
} | ||
return output; | ||
} | ||
|
||
} |
Oops, something went wrong.