Minor codestyle changes

This commit is contained in:
Auxilor
2021-12-13 11:49:46 +00:00
parent 52d77d7861
commit db7ac55eb2
8 changed files with 43 additions and 28 deletions

View File

@@ -46,10 +46,10 @@ public interface ConfigFactory {
* @return The config implementation.
*/
LoadableConfig createLoadableConfig(@NotNull String configName,
@NotNull PluginLike plugin,
@NotNull String subDirectoryPath,
@NotNull Class<?> source,
@NotNull ConfigType type);
@NotNull PluginLike plugin,
@NotNull String subDirectoryPath,
@NotNull Class<?> source,
@NotNull ConfigType type);
/**
* Create config.

View File

@@ -60,7 +60,7 @@ public final class Display {
* @return The ItemStack.
*/
public static ItemStack displayAndFinalize(@NotNull final ItemStack itemStack,
@Nullable final Player player) {
@Nullable final Player player) {
return finalize(display(itemStack, player));
}

View File

@@ -24,7 +24,7 @@ public final class AnticheatManager {
* @param anticheat The anticheat to register.
*/
public static void register(@NotNull final EcoPlugin plugin,
@NotNull final AnticheatWrapper anticheat) {
@NotNull final AnticheatWrapper anticheat) {
if (anticheat instanceof Listener) {
plugin.getEventManager().registerListener((Listener) anticheat);
}

View File

@@ -41,7 +41,7 @@ public final class EconomyManager {
* @return If the player has the amount.
*/
public static boolean hasAmount(@NotNull final OfflinePlayer player,
final double amount) {
final double amount) {
for (EconomyWrapper wrapper : REGISTERED) {
return wrapper.hasAmount(player, amount);
}
@@ -57,7 +57,7 @@ public final class EconomyManager {
* @return If the transaction was a success.
*/
public static boolean giveMoney(@NotNull final OfflinePlayer player,
final double amount) {
final double amount) {
for (EconomyWrapper wrapper : REGISTERED) {
return wrapper.giveMoney(player, amount);
}
@@ -73,7 +73,7 @@ public final class EconomyManager {
* @return If the transaction was a success.
*/
public static boolean removeMoney(@NotNull final OfflinePlayer player,
final double amount) {
final double amount) {
for (EconomyWrapper wrapper : REGISTERED) {
return wrapper.removeMoney(player, amount);
}

View File

@@ -33,7 +33,7 @@ public final class HologramManager {
* @return The hologram.
*/
public static Hologram createHologram(@NotNull final Location location,
@NotNull final List<String> contents) {
@NotNull final List<String> contents) {
for (HologramWrapper wrapper : REGISTERED) {
return wrapper.createHologram(location, contents);
}

View File

@@ -92,7 +92,7 @@ public class Paste {
conn.setRequestMethod("GET");
try (var reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()))) {
for (String line; (line = reader.readLine()) != null;) {
for (String line; (line = reader.readLine()) != null; ) {
result.append(line);
}
}

View File

@@ -16,30 +16,45 @@ public final class PotionUtils {
public static int getDuration(@NotNull final PotionData data) {
if (data.isExtended()) {
return switch (data.getType()) {
case INSTANT_DAMAGE, INSTANT_HEAL: yield 0;
case POISON, REGEN: yield 1800;
case SLOW_FALLING, WEAKNESS, SLOWNESS: yield 4800;
case TURTLE_MASTER: yield 800;
default: yield 9600;
case INSTANT_DAMAGE, INSTANT_HEAL:
yield 0;
case POISON, REGEN:
yield 1800;
case SLOW_FALLING, WEAKNESS, SLOWNESS:
yield 4800;
case TURTLE_MASTER:
yield 800;
default:
yield 9600;
};
}
if (data.isUpgraded()) {
return switch (data.getType()) {
case INSTANT_DAMAGE, INSTANT_HEAL: yield 0;
case POISON, REGEN: yield 420;
case SLOW_FALLING, WEAKNESS, SLOWNESS: yield 440;
case TURTLE_MASTER: yield 400;
default: yield 1800;
case INSTANT_DAMAGE, INSTANT_HEAL:
yield 0;
case POISON, REGEN:
yield 420;
case SLOW_FALLING, WEAKNESS, SLOWNESS:
yield 440;
case TURTLE_MASTER:
yield 400;
default:
yield 1800;
};
}
return switch (data.getType()) {
case INSTANT_DAMAGE, INSTANT_HEAL: yield 0;
case POISON, REGEN: yield 900;
case SLOW_FALLING, WEAKNESS, SLOWNESS: yield 400;
case TURTLE_MASTER: yield 1800;
default: yield 3600;
case INSTANT_DAMAGE, INSTANT_HEAL:
yield 0;
case POISON, REGEN:
yield 900;
case SLOW_FALLING, WEAKNESS, SLOWNESS:
yield 400;
case TURTLE_MASTER:
yield 1800;
default:
yield 3600;
};
}

View File

@@ -35,7 +35,7 @@ public final class SkullUtils {
* @param base64 The base64 texture.
*/
public static void setSkullTexture(@NotNull final SkullMeta meta,
@NotNull final String base64) {
@NotNull final String base64) {
Validate.isTrue(initialized, "Must be initialized!");
Validate.notNull(metaSetConsumer, "Must be initialized!");
@@ -64,7 +64,7 @@ public final class SkullUtils {
*/
@ApiStatus.Internal
public static void initialize(@NotNull final BiConsumer<SkullMeta, String> function,
@NotNull final Function<SkullMeta, String> function2) {
@NotNull final Function<SkullMeta, String> function2) {
Validate.isTrue(!initialized, "Already initialized!");
metaSetConsumer = function;