Skip to content

Commit

Permalink
[CI SKIP] Fixed some warnings from IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Oct 8, 2022
1 parent c733f58 commit f129ab3
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions src/main/java/com/bgsoftware/superiorskyblock/island/SIsland.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.bgsoftware.superiorskyblock.core.LocationKey;
import com.bgsoftware.superiorskyblock.core.SBlockPosition;
import com.bgsoftware.superiorskyblock.core.SequentialListBuilder;
import com.bgsoftware.superiorskyblock.core.collections.CompletableFutureList;
import com.bgsoftware.superiorskyblock.core.database.bridge.IslandsDatabaseBridge;
import com.bgsoftware.superiorskyblock.core.events.EventResult;
import com.bgsoftware.superiorskyblock.core.events.EventsBus;
Expand Down Expand Up @@ -122,7 +121,6 @@
public class SIsland implements Island {

private static final UUID CONSOLE_UUID = new UUID(0, 0);
private static final BigInteger MAX_INT = BigInteger.valueOf(Integer.MAX_VALUE);
private static final BigDecimal SYNCED_BANK_LIMIT_VALUE = BigDecimal.valueOf(-2);
private static final SuperiorSkyblockPlugin plugin = SuperiorSkyblockPlugin.getPlugin();
private static int blocksUpdateCounter = 0;
Expand Down Expand Up @@ -155,8 +153,8 @@ public class SIsland implements Island {
/*
* Island Time-Trackers
*/
private volatile long lastTimeUpdate = -1;
private volatile long lastInterest = -1L;
private volatile long lastTimeUpdate;
private volatile long lastInterest;
private volatile long lastUpgradeTime = -1L;
private volatile boolean giveInterestFailed = false;

Expand Down Expand Up @@ -643,7 +641,7 @@ public List<SuperiorPlayer> getCoopPlayers() {

@Override
public int getCoopLimit() {
return this.coopLimit.readAndGet(coopLimit -> coopLimit.get());
return this.coopLimit.readAndGet(Value::get);
}

@Override
Expand Down Expand Up @@ -774,7 +772,7 @@ public Location getIslandHome(World.Environment environment) {

@Override
public Map<World.Environment, Location> getIslandHomes() {
return islandHomes.readAndGet(islandHomes -> Collections.unmodifiableMap(islandHomes));
return islandHomes.readAndGet(Collections::unmodifiableMap);
}

@Override
Expand Down Expand Up @@ -1449,7 +1447,7 @@ public int getIslandSize() {
if (plugin.getSettings().isBuildOutsideIsland())
return (int) Math.round(plugin.getSettings().getMaxIslandSize() * 1.5);

return this.islandSize.readAndGet(islandSize -> islandSize.get());
return this.islandSize.readAndGet(Value::get);
}

@Override
Expand Down Expand Up @@ -1721,7 +1719,7 @@ public IslandBank getIslandBank() {

@Override
public BigDecimal getBankLimit() {
return this.bankLimit.readAndGet(bankLimit -> bankLimit.get());
return this.bankLimit.readAndGet(Value::get);
}

@Override
Expand Down Expand Up @@ -1970,9 +1968,6 @@ public void handleBlockBreak(Key key, BigInteger amount, boolean save) {
plugin.getGrid().getIslandsContainer().notifyChange(SortingTypes.BY_LEVEL, this);
}

boolean hasBlockLimit = blockLimits.containsKey(key),
valuesMenu = plugin.getBlockValues().isValuesMenu(key);

updateLastTime();

if (save)
Expand Down Expand Up @@ -2167,7 +2162,7 @@ public boolean hasActiveUpgradeCooldown() {

@Override
public double getCropGrowthMultiplier() {
return this.cropGrowth.readAndGet(cropGrowth -> cropGrowth.get());
return this.cropGrowth.readAndGet(Value::get);
}

@Override
Expand Down Expand Up @@ -2196,7 +2191,7 @@ public double getCropGrowthRaw() {

@Override
public double getSpawnerRatesMultiplier() {
return this.spawnerRates.readAndGet(spawnerRates -> spawnerRates.get());
return this.spawnerRates.readAndGet(Value::get);
}

@Override
Expand All @@ -2216,7 +2211,7 @@ public double getSpawnerRatesRaw() {

@Override
public double getMobDropsMultiplier() {
return this.mobDrops.readAndGet(mobDrops -> mobDrops.get());
return this.mobDrops.readAndGet(Value::get);
}

@Override
Expand Down Expand Up @@ -2397,7 +2392,6 @@ public CompletableFuture<Boolean> hasReachedEntityLimit(EntityType entityType, i
public CompletableFuture<Boolean> hasReachedEntityLimit(Key key, int amount) {
Preconditions.checkNotNull(key, "key parameter cannot be null.");

CompletableFutureList<Chunk> chunks = new CompletableFutureList<>();
int entityLimit = getEntityLimit(key);

if (entityLimit < 0)
Expand All @@ -2413,7 +2407,7 @@ public IslandEntitiesTrackerAlgorithm getEntitiesTracker() {

@Override
public int getTeamLimit() {
return this.teamLimit.readAndGet(teamLimit -> teamLimit.get());
return this.teamLimit.readAndGet(Value::get);
}

@Override
Expand All @@ -2433,7 +2427,7 @@ public int getTeamLimitRaw() {

@Override
public int getWarpsLimit() {
return this.warpsLimit.readAndGet(warpsLimit -> warpsLimit.get());
return this.warpsLimit.readAndGet(Value::get);
}

@Override
Expand Down

0 comments on commit f129ab3

Please sign in to comment.