1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-08 08:21:41 +01:00
This commit is contained in:
montlikadani 2020-08-14 11:48:20 +02:00
parent c01a56759a
commit 57fef613d4
3 changed files with 13 additions and 12 deletions

View File

@ -1132,15 +1132,11 @@ public class Jobs extends JavaPlugin {
return true;
if (info.getType() == ActionType.BREAK) {
if (GconfigManager.allowBreakPaymentForOreGenerators) {
getBpManager().remove(block);
return true;
}
if (block.hasMetadata("JobsExploit")) {
//player.sendMessage("This block is protected using Rukes' system!");
return false;
}
BlockProtection bp = getBpManager().getBp(block.getLocation());
if (bp != null) {
Long time = bp.getTime();
@ -1150,22 +1146,27 @@ public class Jobs extends JavaPlugin {
getBpManager().remove(block);
return false;
}
if ((time < System.currentTimeMillis()) && (bp.getAction() != DBAction.DELETE)) {
getBpManager().remove(block);
return true;
}
if (time > System.currentTimeMillis() || bp.isPaid() && bp.getAction() != DBAction.DELETE) {
int sec = Math.round((time - System.currentTimeMillis()) / 1000L);
if (inform) {
if (player.canGetPaid(info))
ActionBarManager.send(player.getPlayer(), lManager.getMessage("message.blocktimer", "[time]", sec));
if (inform && player.canGetPaid(info)) {
ActionBarManager.send(player.getPlayer(), lManager.getMessage("message.blocktimer", "[time]", sec));
}
return false;
}
getBpManager().add(block, cd);
if ((cd == null || cd == 0) && GconfigManager.useGlobalTimer) {
getBpManager().add(block, GconfigManager.globalblocktimer);
}
} else if (GconfigManager.useGlobalTimer) {
getBpManager().add(block, GconfigManager.globalblocktimer);
}

View File

@ -101,7 +101,7 @@ public class GeneralConfigManager {
hideJobsInfoWithoutPermission, UseTaxes, TransferToServerAccount, TakeFromPlayersPayment, AutoJobJoinUse, AllowDelevel,
BossBarEnabled, BossBarShowOnEachAction, BossBarsMessageByDefault, ExploreCompact, DBCleaningJobsUse, DBCleaningUsersUse,
DisabledWorldsUse, UseAsWhiteListWorldList, PaymentMethodsMoney, PaymentMethodsPoints, PaymentMethodsExp, MythicMobsEnabled,
LoggingUse, allowBreakPaymentForOreGenerators;
LoggingUse;
public ItemStack guiBackButton, guiNextButton, guiFiller;
@ -803,9 +803,9 @@ public class GeneralConfigManager {
BlockProtectionDays = c.get("ExploitProtections.General.KeepDataFor", 14);
BlockProtectionDays = BlockProtectionDays > 14 ? 14 : BlockProtectionDays;
c.addComment("ExploitProtections.General.AllowBreakPaymentForOreGenerators", "It allows you to pay for ore generator plugins continuously"
/*c.addComment("ExploitProtections.General.AllowBreakPaymentForOreGenerators", "It allows you to pay for ore generator plugins continuously"
+ " once you have broken the block in one place.");
allowBreakPaymentForOreGenerators = c.get("ExploitProtections.General.AllowBreakPaymentForOreGenerators", false);
allowBreakPaymentForOreGenerators = c.get("ExploitProtections.General.AllowBreakPaymentForOreGenerators", false);*/
c.addComment("ExploitProtections.General.GlobalBlockTimer", "All blocks will be protected X sec after player places it on ground.");
useGlobalTimer = c.get("ExploitProtections.General.GlobalBlockTimer.use", true);

View File

@ -43,7 +43,7 @@ public class Util {
ItemStack item = CMIMaterial.PLAYER_HEAD.newItemStack();
SkullMeta skullMeta = (SkullMeta) item.getItemMeta();
if (skullOwner.length() == 36) {
OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(skullOwner);
OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(UUID.fromString(skullOwner));
Jobs.getNms().setSkullOwner(skullMeta, offPlayer);
} else
skullMeta.setOwner(skullOwner);