Minor code smells and code format fixes

This commit is contained in:
Florian CUNY 2018-07-14 00:55:00 +02:00
parent bfe059f191
commit ac4611e66f
2 changed files with 2 additions and 5 deletions

View File

@ -35,7 +35,6 @@ public class IslandGoCommand extends CompositeCommand {
*/
@Override
public boolean execute(User user, List<String> args) {
if (getIslands().getIsland(getWorld(), user.getUniqueId()) == null) {
user.sendMessage(ChatColor.RED + "general.errors.no-island");
return false;
@ -43,7 +42,7 @@ public class IslandGoCommand extends CompositeCommand {
if (!args.isEmpty() && NumberUtils.isDigits(args.get(0))) {
int homeValue = Integer.valueOf(args.get(0));
int maxHomes = Util.getPermValue(user.getPlayer(), "island.maxhomes", getIWM().getMaxHomes(getWorld()));
if (homeValue > 1 && homeValue <= maxHomes) {
if (homeValue > 1 && homeValue <= maxHomes) {
getIslands().homeTeleport(getWorld(), user.getPlayer(), homeValue);
user.sendMessage("commands.island.go.tip", TextVariables.LABEL, getTopLabel());
return true;

View File

@ -43,7 +43,6 @@ public class SafeSpotTeleport {
// Locations
private Location bestSpot;
private BSkyBlock plugin;
private List<Pair<Integer, Integer>> chunksToScan;
@ -81,7 +80,6 @@ public class SafeSpotTeleport {
}
}
// Get chunks to scan
chunksToScan = getChunksToScan();
@ -124,7 +122,7 @@ public class SafeSpotTeleport {
} else if (entity instanceof Player && !failureMessage.isEmpty()) {
// Failed, no safe spot
entity.sendMessage(failureMessage);
if (entity instanceof Player && ((Player)entity).getGameMode().equals(GameMode.SPECTATOR)) {
if (((Player)entity).getGameMode().equals(GameMode.SPECTATOR)) {
if (plugin.getIWM().inWorld(entity.getLocation())) {
((Player)entity).setGameMode(plugin.getIWM().getDefaultGameMode(entity.getWorld()));
} else {