From 456036c0d26185465174b6bfaf51746ad69e716c Mon Sep 17 00:00:00 2001 From: austin Date: Fri, 23 May 2025 17:54:40 -0400 Subject: [PATCH] code cleanup --- .../client/block/BlockChunkCache.java | 20 +++++++++---------- .../server/macro/town/TownLayout.java | 9 --------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/main/java/electrosphere/client/block/BlockChunkCache.java b/src/main/java/electrosphere/client/block/BlockChunkCache.java index 1cfeb824..308d0808 100644 --- a/src/main/java/electrosphere/client/block/BlockChunkCache.java +++ b/src/main/java/electrosphere/client/block/BlockChunkCache.java @@ -25,52 +25,52 @@ public class BlockChunkCache { /** * The size of the cache */ - int cacheSize = CACHE_SIZE; + private int cacheSize = CACHE_SIZE; /** * The map of full res chunk key -> chunk data */ - Map cacheMapFullRes = new HashMap(); + private Map cacheMapFullRes = new HashMap(); /** * The map of half res chunk key -> chunk data */ - Map cacheMapHalfRes = new HashMap(); + private Map cacheMapHalfRes = new HashMap(); /** * The map of quarter res chunk key -> chunk data */ - Map cacheMapQuarterRes = new HashMap(); + private Map cacheMapQuarterRes = new HashMap(); /** * The map of eighth res chunk key -> chunk data */ - Map cacheMapEighthRes = new HashMap(); + private Map cacheMapEighthRes = new HashMap(); /** * The map of sixteenth res chunk key -> chunk data */ - Map cacheMapSixteenthRes = new HashMap(); + private Map cacheMapSixteenthRes = new HashMap(); /** * Tracks how recently a chunk has been queries for (used for evicting old chunks from cache) */ - List queryRecencyQueue = new LinkedList(); + private List queryRecencyQueue = new LinkedList(); /** * Tracks what chunks are already queued to be asynchronously loaded. Used so we don't have two threads generating/fetching the same chunk */ - Map queuedChunkMap = new HashMap(); + private Map queuedChunkMap = new HashMap(); /** * The lock for thread safety */ - ReentrantLock lock = new ReentrantLock(); + private ReentrantLock lock = new ReentrantLock(); /** * The disk map */ - ServerBlockChunkDiskMap chunkDiskMap; + private ServerBlockChunkDiskMap chunkDiskMap; /** * Constructor diff --git a/src/main/java/electrosphere/server/macro/town/TownLayout.java b/src/main/java/electrosphere/server/macro/town/TownLayout.java index 805337e6..f970c37f 100644 --- a/src/main/java/electrosphere/server/macro/town/TownLayout.java +++ b/src/main/java/electrosphere/server/macro/town/TownLayout.java @@ -125,13 +125,6 @@ public class TownLayout { Road.createRoad(macroData, leftNodeLoc, centerNodeLoc); Road.createRoad(macroData, downNodeLoc, centerNodeLoc); - // - //place structures along roads - // TownLayout.generateStructuresAlongRoad(realm, town, upRoad, allowedStructures); - // TownLayout.generateStructuresAlongRoad(realm, town, rightRoad, allowedStructures); - // TownLayout.generateStructuresAlongRoad(realm, town, leftRoad, allowedStructures); - // TownLayout.generateStructuresAlongRoad(realm, town, downRoad, allowedStructures); - // @@ -169,7 +162,6 @@ public class TownLayout { //build road and structures between curr and next node if(closedSet.contains(newHash)){ Road.createRoad(macroData, nearPoint, currPoint); - // TownLayout.generateStructuresAlongRoad(realm, town, newRoad, allowedStructures); } } } @@ -212,7 +204,6 @@ public class TownLayout { //build road and structures between curr and next node if(closedSet.contains(newHash)){ - // Road newRoad = Road.createRoad(macroData, nearPoint, currPoint); TownLayout.generateStructuresAlongRoad(realm, town, nearPoint, currPoint, Road.DEFAULT_RADIUS, allowedStructures); } }