mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-24 12:16:36 +01:00
Fixed broken commit 32688c5
This commit is contained in:
parent
32688c55cf
commit
b1598a022a
@ -42,7 +42,8 @@ public class BlockBreakLogger {
|
||||
}
|
||||
|
||||
if (!user.startsWith("#")) {
|
||||
CacheHandler.spreadCache.remove(location);
|
||||
String cacheId = location.getBlockX() + "." + location.getBlockY() + "." + location.getBlockZ() + "." + Util.getWorldId(location.getWorld().getName());
|
||||
CacheHandler.spreadCache.remove(cacheId);
|
||||
}
|
||||
|
||||
if (checkType == Material.LECTERN) {
|
||||
|
@ -75,10 +75,10 @@ public final class BlockFromToListener extends Queue implements Listener {
|
||||
}
|
||||
|
||||
if (f.startsWith("#")) {
|
||||
Location location = toBlock.getLocation();
|
||||
String cacheId = toBlock.getX() + "." + toBlock.getY() + "." + toBlock.getZ() + "." + Util.getWorldId(toBlock.getWorld().getName());
|
||||
int timestamp = (int) (System.currentTimeMillis() / 1000L);
|
||||
Object[] cacheData = CacheHandler.spreadCache.get(location);
|
||||
CacheHandler.spreadCache.put(location, new Object[] { timestamp, type });
|
||||
Object[] cacheData = CacheHandler.spreadCache.get(cacheId);
|
||||
CacheHandler.spreadCache.put(cacheId, new Object[] { timestamp, type });
|
||||
if (toBlockState == null && cacheData != null && ((Material) cacheData[1]) == type) {
|
||||
return;
|
||||
}
|
||||
|
@ -82,14 +82,15 @@ public final class BlockSpreadListener extends Queue implements Listener {
|
||||
}
|
||||
|
||||
private boolean checkCacheData(Block block, Material type) {
|
||||
int log = 0;
|
||||
String cacheId = block.getX() + "." + block.getY() + "." + block.getZ() + "." + Util.getWorldId(block.getWorld().getName()) + "." + type.name();
|
||||
if (CacheHandler.spreadCache.get(cacheId) == null) {
|
||||
log = 1;
|
||||
}
|
||||
String cacheId = block.getX() + "." + block.getY() + "." + block.getZ() + "." + Util.getWorldId(block.getWorld().getName());
|
||||
Location location = block.getLocation();
|
||||
int timestamp = (int) (System.currentTimeMillis() / 1000L);
|
||||
CacheHandler.spreadCache.put(cacheId, new Object[] { timestamp });
|
||||
Object[] cacheData = CacheHandler.spreadCache.get(cacheId);
|
||||
CacheHandler.spreadCache.put(cacheId, new Object[] { timestamp, type });
|
||||
if (cacheData != null && ((Material) cacheData[1]) == type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (log == 0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user