Compare commits
No commits in common. "4737ad1cfaa5fe55ce97acd927663ea54e1df94f" and "0464cf61d3c48b5e1f5a73ba5eaf663ce094363d" have entirely different histories.
4737ad1cfa
...
0464cf61d3
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
|
|
@ -16,14 +16,5 @@ pipeline {
|
||||||
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Copy to /mnt/updates/plugins') {
|
|
||||||
when {
|
|
||||||
branch 'main'
|
|
||||||
branch 'master'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'cp build/libs/*.jar /mnt/updates/plugins/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ public class PlayerShop {
|
||||||
playerShop.server = server;
|
playerShop.server = server;
|
||||||
playerShop.price = price;
|
playerShop.price = price;
|
||||||
playerShop.amount = amount;
|
playerShop.amount = amount;
|
||||||
playerShop.balance = EconomyUtils.round(balance);
|
playerShop.balance = balance;
|
||||||
playerShop.itemStack = item;
|
playerShop.itemStack = item;
|
||||||
playerShop.lastTransaction = lastTransaction;
|
playerShop.lastTransaction = lastTransaction;
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ public class PlayerShop {
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getPricePerItem() {
|
public double getPricePerItem() {
|
||||||
return EconomyUtils.round(this.getPrice() / this.getAmount());
|
return this.getPrice() / this.getAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean removeBalance(double amount) {
|
public boolean removeBalance(double amount) {
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@ import com.alttd.playershops.shop.PlayerShop;
|
||||||
import net.milkbowl.vault.economy.EconomyResponse;
|
import net.milkbowl.vault.economy.EconomyResponse;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
|
|
||||||
// TODO document
|
// TODO document
|
||||||
public class EconomyUtils {
|
public class EconomyUtils {
|
||||||
|
|
||||||
|
|
@ -58,11 +55,4 @@ public class EconomyUtils {
|
||||||
// if we ever need to limit the maximum balance a shop can have this is the place
|
// if we ever need to limit the maximum balance a shop can have this is the place
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double round(double value) {
|
|
||||||
BigDecimal bd = BigDecimal.valueOf(value);
|
|
||||||
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
|
||||||
return bd.doubleValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user