1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +01:00

Limiting GlobalBlockTimer to positive numbers only

This commit is contained in:
Zrips 2024-04-16 11:56:23 +03:00
parent a1d4f2ec00
commit 1fb79f4ba2
2 changed files with 5 additions and 0 deletions

View File

@ -40,6 +40,7 @@ import com.gamingmesh.jobs.container.CurrencyType;
import net.Zrips.CMILib.CMILib;
import net.Zrips.CMILib.Container.CMIList;
import net.Zrips.CMILib.Container.CMINumber;
import net.Zrips.CMILib.Enchants.CMIEnchantment;
import net.Zrips.CMILib.Equations.Parser;
import net.Zrips.CMILib.FileHandler.ConfigReader;
@ -900,7 +901,9 @@ public class GeneralConfigManager {
c.addComment("ExploitProtections.General.PlaceAndBreak.GlobalBlockTimer", "All blocks will be protected X sec after player places it on ground.");
useGlobalTimer = c.get("ExploitProtections.General.PlaceAndBreak.GlobalBlockTimer.Use", c.getC().getBoolean("ExploitProtections.General.GlobalBlockTimer.use", true));
c.addComment("ExploitProtections.General.PlaceAndBreak.GlobalBlockTimer.Timer", "Time in seconds. This can only be positive number");
globalblocktimer = c.get("ExploitProtections.General.PlaceAndBreak.GlobalBlockTimer.Timer", c.getC().getInt("ExploitProtections.General.GlobalBlockTimer.timer", 3));
globalblocktimer = CMINumber.clamp(globalblocktimer, 1, 99999);
c.addComment("ExploitProtections.General.PlaceAndBreak.SilkTouchProtection", "Enable silk touch protection.",
"With this enabled players wont get paid for broken blocks from restrictedblocks list with silk touch tool.");

View File

@ -260,10 +260,12 @@ public class ShopManager {
Jobs.getJobsDAO().savePoints(jPlayer);
player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.Paid", "%amount%", item.getPointPrice()));
}
if (item.getVaultPrice() > 0) {
jPlayer.withdraw(item.getVaultPrice());
player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.Paid", "%amount%", Jobs.getEconomy().getEconomy().format(item.getVaultPrice())));
}
openShopGui(player, page);
}
};