mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-11 09:51:40 +01:00
Minor code smells and code format fixes
This commit is contained in:
parent
bfe059f191
commit
ac4611e66f
@ -35,7 +35,6 @@ public class IslandGoCommand extends CompositeCommand {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, List<String> args) {
|
||||||
|
|
||||||
if (getIslands().getIsland(getWorld(), user.getUniqueId()) == null) {
|
if (getIslands().getIsland(getWorld(), user.getUniqueId()) == null) {
|
||||||
user.sendMessage(ChatColor.RED + "general.errors.no-island");
|
user.sendMessage(ChatColor.RED + "general.errors.no-island");
|
||||||
return false;
|
return false;
|
||||||
@ -43,7 +42,7 @@ public class IslandGoCommand extends CompositeCommand {
|
|||||||
if (!args.isEmpty() && NumberUtils.isDigits(args.get(0))) {
|
if (!args.isEmpty() && NumberUtils.isDigits(args.get(0))) {
|
||||||
int homeValue = Integer.valueOf(args.get(0));
|
int homeValue = Integer.valueOf(args.get(0));
|
||||||
int maxHomes = Util.getPermValue(user.getPlayer(), "island.maxhomes", getIWM().getMaxHomes(getWorld()));
|
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);
|
getIslands().homeTeleport(getWorld(), user.getPlayer(), homeValue);
|
||||||
user.sendMessage("commands.island.go.tip", TextVariables.LABEL, getTopLabel());
|
user.sendMessage("commands.island.go.tip", TextVariables.LABEL, getTopLabel());
|
||||||
return true;
|
return true;
|
||||||
|
@ -43,7 +43,6 @@ public class SafeSpotTeleport {
|
|||||||
// Locations
|
// Locations
|
||||||
private Location bestSpot;
|
private Location bestSpot;
|
||||||
|
|
||||||
|
|
||||||
private BSkyBlock plugin;
|
private BSkyBlock plugin;
|
||||||
private List<Pair<Integer, Integer>> chunksToScan;
|
private List<Pair<Integer, Integer>> chunksToScan;
|
||||||
|
|
||||||
@ -81,7 +80,6 @@ public class SafeSpotTeleport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get chunks to scan
|
// Get chunks to scan
|
||||||
chunksToScan = getChunksToScan();
|
chunksToScan = getChunksToScan();
|
||||||
|
|
||||||
@ -124,7 +122,7 @@ public class SafeSpotTeleport {
|
|||||||
} else if (entity instanceof Player && !failureMessage.isEmpty()) {
|
} else if (entity instanceof Player && !failureMessage.isEmpty()) {
|
||||||
// Failed, no safe spot
|
// Failed, no safe spot
|
||||||
entity.sendMessage(failureMessage);
|
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())) {
|
if (plugin.getIWM().inWorld(entity.getLocation())) {
|
||||||
((Player)entity).setGameMode(plugin.getIWM().getDefaultGameMode(entity.getWorld()));
|
((Player)entity).setGameMode(plugin.getIWM().getDefaultGameMode(entity.getWorld()));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user