|
10 | 10 | import systems.kscott.randomspawnplus.RandomSpawnPlus; |
11 | 11 | import systems.kscott.randomspawnplus.events.SpawnCheckEvent; |
12 | 12 | import systems.kscott.randomspawnplus.exceptions.FinderTimedOutException; |
13 | | -import systems.kscott.randomspawnplus.util.Blocks; |
14 | 13 | import systems.kscott.randomspawnplus.util.Numbers; |
15 | 14 |
|
16 | 15 | import java.util.ArrayList; |
@@ -120,10 +119,10 @@ private Location getValidLocation(boolean useSpawnCaching) throws FinderTimedOut |
120 | 119 | if (tries >= 30) { |
121 | 120 | throw new FinderTimedOutException(); |
122 | 121 | } |
123 | | - if (SpawnCacher.getInstance().getCachedSpawns().size() == 0) { |
| 122 | + if (SpawnCacher.getInstance().getCachedSpawns().isEmpty()) { |
124 | 123 | plugin.getLogger().severe(plugin.getLangManager().getConfig().getString("no-spawns-cached")); |
125 | 124 | } |
126 | | - if (useCache && useSpawnCaching && SpawnCacher.getInstance().getCachedSpawns().size() != 0) { |
| 125 | + if (useCache && useSpawnCaching && !SpawnCacher.getInstance().getCachedSpawns().isEmpty()) { |
127 | 126 | location = SpawnCacher.getInstance().getRandomSpawn(); |
128 | 127 | } else { |
129 | 128 | location = getCandidateLocation(); |
@@ -211,14 +210,14 @@ public boolean checkSpawn(Location location) { |
211 | 210 | } |
212 | 211 | } |
213 | 212 |
|
214 | | - if (Blocks.isEmpty(block0)) { |
| 213 | + if (block0.isEmpty()) { |
215 | 214 | if (debugMode) { |
216 | 215 | plugin.getLogger().info("Invalid spawn: block0 isAir"); |
217 | 216 | } |
218 | 217 | isValid = false; |
219 | 218 | } |
220 | 219 |
|
221 | | - if (!Blocks.isEmpty(block1) || !Blocks.isEmpty(block2)) { |
| 220 | + if (!block1.isEmpty() || !block2.isEmpty()) { |
222 | 221 | if (debugMode) { |
223 | 222 | plugin.getLogger().info("Invalid spawn: block1 or block2 !isAir"); |
224 | 223 | } |
@@ -257,7 +256,7 @@ public int getHighestY(World world, int x, int z) { |
257 | 256 | boolean debugMode = config.getBoolean("debug-mode"); |
258 | 257 | int i = world.getMaxHeight(); |
259 | 258 | while (i > world.getMinHeight()) { |
260 | | - if (!Blocks.isEmpty(new Location(world, x, i, z).getBlock())) { |
| 259 | + if (!(new Location(world, x, i, z).getBlock()).isEmpty()) { |
261 | 260 | if (debugMode) { |
262 | 261 | plugin.getLogger().info(Integer.toString(i)); |
263 | 262 | } |
|
0 commit comments