Archived
0

Sonar: double if

This commit is contained in:
2019-02-11 15:24:01 +03:00
parent 96a69f1bca
commit 74f725eec4

View File

@@ -24,14 +24,12 @@ public class CoreEventListener {
for (int cZ = cMinZ; cZ <= cMaxZ; cZ++) { for (int cZ = cMinZ; cZ <= cMaxZ; cZ++) {
for (int cX = cMinX; cX <= cMaxX; cX++) { for (int cX = cMinX; cX <= cMaxX; cX++) {
int compressXZ = CompactedCoords.compressXZ(cX, cZ); int compressXZ = CompactedCoords.compressXZ(cX, cZ);
if (!event.getPlayer().getLoadedChunks().contains(compressXZ)) {
if (!event.getPlayer().getLoadedChunks().contains(compressXZ)) { if (!event.getPlayer().getLoadedChunks().contains(compressXZ)) {
eventChunkLoad.getNeedLoadChunks().add(compressXZ); eventChunkLoad.getNeedLoadChunks().add(compressXZ);
event.getPlayer().getLoadedChunks().add(compressXZ); event.getPlayer().getLoadedChunks().add(compressXZ);
} }
} }
} }
}
if (!eventChunkLoad.getNeedLoadChunks().isEmpty()) { if (!eventChunkLoad.getNeedLoadChunks().isEmpty()) {
EventBus.getInstance().post(eventChunkLoad); EventBus.getInstance().post(eventChunkLoad);