Skip to content

Commit

Permalink
Fixed broken commit 32688c5
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelli committed Apr 21, 2024
1 parent 32688c5 commit b1598a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ else if (checkType.equals(Material.AIR) || checkType.equals(Material.CAVE_AIR))
}

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ else if (type.equals(Material.LAVA)) {
}

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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ else if (Config.getConfig(event.getBlock().getWorld()).SCULK_SPREAD && BlockGrou
}

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;
}
}

0 comments on commit b1598a0

Please sign in to comment.