adding new stuff

This commit is contained in:
Naman
2018-03-26 16:43:15 -05:00
parent 382f4c4b0c
commit 44b3de91dd
84 changed files with 1830 additions and 481 deletions

View File

@@ -50,30 +50,30 @@ public class AsciiCompass {
}
}
public static AsciiCompass.Point getCompassPointForDirection(double inDegrees) {
public static Point getCompassPointForDirection(double inDegrees) {
double degrees = (inDegrees - 180) % 360;
if (degrees < 0) {
degrees += 360;
}
if (0 <= degrees && degrees < 22.5) {
return AsciiCompass.Point.N;
return Point.N;
} else if (22.5 <= degrees && degrees < 67.5) {
return AsciiCompass.Point.NE;
return Point.NE;
} else if (67.5 <= degrees && degrees < 112.5) {
return AsciiCompass.Point.E;
return Point.E;
} else if (112.5 <= degrees && degrees < 157.5) {
return AsciiCompass.Point.SE;
return Point.SE;
} else if (157.5 <= degrees && degrees < 202.5) {
return AsciiCompass.Point.S;
return Point.S;
} else if (202.5 <= degrees && degrees < 247.5) {
return AsciiCompass.Point.SW;
return Point.SW;
} else if (247.5 <= degrees && degrees < 292.5) {
return AsciiCompass.Point.W;
return Point.W;
} else if (292.5 <= degrees && degrees < 337.5) {
return AsciiCompass.Point.NW;
return Point.NW;
} else if (337.5 <= degrees && degrees < 360.0) {
return AsciiCompass.Point.N;
return Point.N;
} else {
return null;
}

View File

@@ -156,4 +156,4 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
return null;
}
}
}

View File

@@ -85,6 +85,7 @@ public class MiscUtil {
public static Iterable<FPlayer> rankOrder(Iterable<FPlayer> players) {
List<FPlayer> admins = new ArrayList<>();
List<FPlayer> coleaders = new ArrayList<>();
List<FPlayer> moderators = new ArrayList<>();
List<FPlayer> normal = new ArrayList<>();
List<FPlayer> recruit = new ArrayList<>();
@@ -102,6 +103,10 @@ public class MiscUtil {
admins.add(player);
break;
case COLEADER:
admins.add(player);
break;
case MODERATOR:
moderators.add(player);
break;
@@ -118,6 +123,7 @@ public class MiscUtil {
List<FPlayer> ret = new ArrayList<>();
ret.addAll(admins);
ret.addAll(coleaders);
ret.addAll(moderators);
ret.addAll(normal);
ret.addAll(recruit);

View File

@@ -98,4 +98,3 @@ public class PermissionsMapTypeAdapter implements JsonDeserializer<Map<Permissab
}
}

View File

@@ -36,7 +36,7 @@ public class WarmUpUtil {
}
public enum Warmup {
HOME, WARP, FLIGHT;
HOME, WARP, FLIGHT, BANNER;
}
}

View File

@@ -104,7 +104,17 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
doWarmup(warp);
}
} else {
fme.setEnteringPassword(true, warp);
fme.msg(TL.COMMAND_FWARP_PASSWORD_REQUIRED);
Bukkit.getScheduler().runTaskLater(P.p, new Runnable() {
@Override
public void run() {
if (fme.isEnteringPassword()) {
fme.msg(TL.COMMAND_FWARP_PASSWORD_TIMEOUT);
fme.setEnteringPassword(false, "");
}
}
}, P.p.getConfig().getInt("fwarp-gui.password-timeout", 5)*20);
}
}
}
@@ -252,4 +262,4 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
return itemStack;
}
}
}