Skip to content

Commit db8f328

Browse files
committed
For code standard
maybe it's right
1 parent fbe4a3b commit db8f328

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/main/java/systems/kscott/randomspawnplus/spawn/SpawnCacher.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ public static SpawnCacher getInstance() {
3939
}
4040

4141
private void cacheSpawns() {
42-
boolean debugMode = plugin.getConfigManager().getConfig().getBoolean("debug-mode");
4342

4443
FileConfiguration spawns = plugin.getSpawns();
4544
FileConfiguration config = plugin.getConfig();
4645

46+
boolean debugMode = plugin.getConfig().getBoolean("debug-mode");
47+
4748
SpawnFinder finder = SpawnFinder.getInstance();
4849

4950
List<String> locationStrings = spawns.getStringList("spawns");
@@ -82,8 +83,9 @@ public void run() {
8283
public void run() {
8384
/* Wait for all spawns to be cached */
8485
if (newLocations.size() <= missingLocations) {
85-
if (debugMode)
86+
if (debugMode) {
8687
Bukkit.getLogger().info(newLocations.size() + ", " + missingLocations);
88+
}
8789
} else {
8890
cachedSpawns.addAll(newLocations);
8991
/* Save spawns to file */

src/main/java/systems/kscott/randomspawnplus/spawn/SpawnFinder.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ public boolean checkSpawn(Location location) {
188188
isValid = spawnCheckEvent.isValid();
189189

190190
if (!isValid) {
191-
if (debugMode)
191+
if (debugMode) {
192192
plugin.getLogger().info("Invalid spawn: " + spawnCheckEvent.getValidReason());
193+
}
193194
}
194195

195196
if (blockedSpawnRange) {
@@ -244,11 +245,13 @@ public boolean checkSpawn(Location location) {
244245
}
245246

246247
public int getHighestY(World world, int x, int z) {
248+
boolean debugMode = config.getBoolean("debug-mode");
247249
int i = 320;
248250
while (i > -64) {
249251
if (!Blocks.isEmpty(new Location(world, x, i, z).getBlock())) {
250-
if (config.getBoolean("debug-mode"))
252+
if (debugMode) {
251253
plugin.getLogger().info(Integer.toString(i));
254+
}
252255
return i;
253256
}
254257
i--;

0 commit comments

Comments
 (0)