Skip to content

Commit 58bdd63

Browse files
committed
[ci skip] Clean up
1 parent e2a6979 commit 58bdd63

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import systems.kscott.randomspawnplus.RandomSpawnPlus;
1111
import systems.kscott.randomspawnplus.events.SpawnCheckEvent;
1212
import systems.kscott.randomspawnplus.exceptions.FinderTimedOutException;
13-
import systems.kscott.randomspawnplus.util.Blocks;
1413
import systems.kscott.randomspawnplus.util.Numbers;
1514

1615
import java.util.ArrayList;
@@ -120,10 +119,10 @@ private Location getValidLocation(boolean useSpawnCaching) throws FinderTimedOut
120119
if (tries >= 30) {
121120
throw new FinderTimedOutException();
122121
}
123-
if (SpawnCacher.getInstance().getCachedSpawns().size() == 0) {
122+
if (SpawnCacher.getInstance().getCachedSpawns().isEmpty()) {
124123
plugin.getLogger().severe(plugin.getLangManager().getConfig().getString("no-spawns-cached"));
125124
}
126-
if (useCache && useSpawnCaching && SpawnCacher.getInstance().getCachedSpawns().size() != 0) {
125+
if (useCache && useSpawnCaching && !SpawnCacher.getInstance().getCachedSpawns().isEmpty()) {
127126
location = SpawnCacher.getInstance().getRandomSpawn();
128127
} else {
129128
location = getCandidateLocation();
@@ -211,14 +210,14 @@ public boolean checkSpawn(Location location) {
211210
}
212211
}
213212

214-
if (Blocks.isEmpty(block0)) {
213+
if (block0.isEmpty()) {
215214
if (debugMode) {
216215
plugin.getLogger().info("Invalid spawn: block0 isAir");
217216
}
218217
isValid = false;
219218
}
220219

221-
if (!Blocks.isEmpty(block1) || !Blocks.isEmpty(block2)) {
220+
if (!block1.isEmpty() || !block2.isEmpty()) {
222221
if (debugMode) {
223222
plugin.getLogger().info("Invalid spawn: block1 or block2 !isAir");
224223
}
@@ -257,7 +256,7 @@ public int getHighestY(World world, int x, int z) {
257256
boolean debugMode = config.getBoolean("debug-mode");
258257
int i = world.getMaxHeight();
259258
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()) {
261260
if (debugMode) {
262261
plugin.getLogger().info(Integer.toString(i));
263262
}

src/main/java/systems/kscott/randomspawnplus/util/Blocks.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)