1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-06 23:41:21 +01:00
This commit is contained in:
Zrips 2024-06-27 16:44:47 +03:00
parent 06c714b363
commit 4b6db96c1c
4 changed files with 6 additions and 32 deletions

View File

@ -1044,12 +1044,9 @@ public final class Jobs extends JavaPlugin {
List<JobProgression> progression = jPlayer.getJobProgression();
int numjobs = progression.size();
CMIDebug.it();
if (!Jobs.getGCManager().useBlockProtectionBlockTracker && !Jobs.getExploitManager().isProtectionValidAddIfNotExists(jPlayer, info, block, true)) {
CMIDebug.d(CMIDebug.getIT(), "ms");
return;
}
CMIDebug.d(CMIDebug.getIT(), "ms");
// no job
if (numjobs == 0) {

View File

@ -42,20 +42,7 @@ public class bp implements Cmd {
final List<Block> changedBlocks = new ArrayList<>();
if (Jobs.getGCManager().useNewBlockProtection) {
// if (Version.isTestServer()) {
// CMIDebug.d("Filling test blocks");
// for (int x = 0; x < 16; x++) {
// for (int y = 72; y < 150; y++) {
// for (int z = 0; z < 16; z++) {
// Block block = loc.getChunk().getBlock(x, y, z);
// Jobs.getExploitManager().addProtection(block, CMINumber.random(1, 10));
// }
// }
// }
// }
if (Jobs.getGCManager().useNewBlockProtection) {
for (int x = -10; x < 10; x++) {
for (int y = -10; y < 10; y++) {
for (int z = -10; z < 10; z++) {

View File

@ -20,7 +20,6 @@ import net.Zrips.CMILib.ActionBar.CMIActionBar;
import net.Zrips.CMILib.Container.CMIBlock;
import net.Zrips.CMILib.Container.CMIBlock.Bisect;
import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.Logs.CMIDebug;
import net.Zrips.CMILib.PersistentData.CMIChunkPersistentDataContainer;
public class ExploitProtectionManager {
@ -104,7 +103,6 @@ public class ExploitProtectionManager {
}
public ExploitProtection addProtection(Block block, Long protectedUntil, boolean paid) {
// CMIDebug.c("Adding protection ", block.getLocation().toVector());
if (!Jobs.getGCManager().useNewBlockProtection) {
BlockProtection protection = Jobs.getBpManager().addP(block.getLocation(), protectedUntil, paid, true);
@ -183,7 +181,7 @@ public class ExploitProtectionManager {
return getTime(loc.getBlock());
}
@Deprecated
@Deprecated
public Integer getBlockProtectionTime(Block block) {
return getBlockProtectionTime(ActionType.PLACE, block);
}
@ -197,8 +195,8 @@ public class ExploitProtectionManager {
break;
case PLACE:
Integer time = Jobs.getRestrictedBlockManager().restrictedBlocksTimer.get(CMIMaterial.get(block));
if (time == null && Jobs.getGCManager().useGlobalTimer)
return Jobs.getGCManager().globalblocktimer;
if (time == null && Jobs.getGCManager().useGlobalTimer)
return Jobs.getGCManager().globalblocktimer;
return time == null ? 0 : time;
}
@ -210,7 +208,6 @@ public class ExploitProtectionManager {
}
public void setPaid(Block block, boolean paid) {
// CMIDebug.d("Setting to paid", block.getLocation().toVector());
CMIChunkPersistentDataContainer pdc = getPDC(block);
String locString = convertLoc(block.getLocation());
if (!paid)
@ -310,9 +307,8 @@ public class ExploitProtectionManager {
if (!Jobs.getGCManager().useNewBlockProtection)
return;
// CompletableFuture.supplyAsync(() -> {
try {
CMIDebug.it();
CMIChunkPersistentDataContainer pdc = getPDC(chunk);
Set<NamespacedKey> keys = pdc.getKeys();
@ -324,13 +320,9 @@ public class ExploitProtectionManager {
}
}
pdc.save();
CMIDebug.c(CMIDebug.getIT(), "ms chunk cleanup");
} catch (Throwable e) {
e.printStackTrace();
}
// return null;
// });
}
}

View File

@ -148,8 +148,6 @@ public class JobsListener implements Listener {
if (CMIMaterial.isWater(event.getBlock().getType()))
return;
CMIDebug.d(event.getBlock().getType(), event.getToBlock().getType());
Jobs.getExploitManager().remove(event.getToBlock());
}