Minor codestyle changes
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user