mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-28 12:55:34 +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("#")) {
|
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) {
|
if (checkType == Material.LECTERN) {
|
||||||
|
@ -75,10 +75,10 @@ public final class BlockFromToListener extends Queue implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (f.startsWith("#")) {
|
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);
|
int timestamp = (int) (System.currentTimeMillis() / 1000L);
|
||||||
Object[] cacheData = CacheHandler.spreadCache.get(location);
|
Object[] cacheData = CacheHandler.spreadCache.get(cacheId);
|
||||||
CacheHandler.spreadCache.put(location, new Object[] { timestamp, type });
|
CacheHandler.spreadCache.put(cacheId, new Object[] { timestamp, type });
|
||||||
if (toBlockState == null && cacheData != null && ((Material) cacheData[1]) == type) {
|
if (toBlockState == null && cacheData != null && ((Material) cacheData[1]) == type) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -82,14 +82,15 @@ public final class BlockSpreadListener extends Queue implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkCacheData(Block block, Material type) {
|
private boolean checkCacheData(Block block, Material type) {
|
||||||
int log = 0;
|
String cacheId = block.getX() + "." + block.getY() + "." + block.getZ() + "." + Util.getWorldId(block.getWorld().getName());
|
||||||
String cacheId = block.getX() + "." + block.getY() + "." + block.getZ() + "." + Util.getWorldId(block.getWorld().getName()) + "." + type.name();
|
Location location = block.getLocation();
|
||||||
if (CacheHandler.spreadCache.get(cacheId) == null) {
|
|
||||||
log = 1;
|
|
||||||
}
|
|
||||||
int timestamp = (int) (System.currentTimeMillis() / 1000L);
|
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