Skip to content

Commit 3e84684

Browse files
committed
Updated .editorconfig and reformatted code
1 parent 151b34c commit 3e84684

24 files changed

Lines changed: 328 additions & 323 deletions

.editorconfig

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
root = true
22

3-
[*.java]
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
48
indent_size = 4
5-
indent_style = tab
6-
charset = utf-8
9+
10+
[*.yml]
11+
indent_size = 2

src/main/java/dev/despical/commons/configuration/ConfigUtils.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818

1919
package dev.despical.commons.configuration;
2020

21+
import org.bukkit.configuration.file.FileConfiguration;
22+
import org.bukkit.configuration.file.YamlConfiguration;
23+
import org.bukkit.plugin.java.JavaPlugin;
24+
2125
import java.io.File;
2226
import java.io.IOException;
2327
import java.io.InputStream;
2428
import java.io.InputStreamReader;
2529
import java.util.function.Consumer;
2630

27-
import org.bukkit.configuration.file.FileConfiguration;
28-
import org.bukkit.configuration.file.YamlConfiguration;
29-
import org.bukkit.plugin.java.JavaPlugin;
30-
3131
/**
3232
* @author Despical
3333
* <p>
@@ -38,7 +38,7 @@ public class ConfigUtils {
3838
/**
3939
* Get the config file's configuration
4040
*
41-
* @param plugin to get config file from
41+
* @param plugin to get config file from
4242
* @param fileName name of the config file
4343
* @return file configuration of given file
4444
*/
@@ -65,7 +65,7 @@ public static FileConfiguration getConfig(JavaPlugin plugin, String fileName) {
6565
/**
6666
* Get the config file's configuration, gets the file from the resources.
6767
*
68-
* @param plugin to get config file from
68+
* @param plugin to get config file from
6969
* @param fileName name of the config file
7070
* @return file configuration of given file
7171
*/
@@ -90,7 +90,7 @@ public static FileConfiguration getConfigFromResources(JavaPlugin plugin, String
9090
*
9191
* @param plugin to get config file from
9292
* @param config file to save
93-
* @param name to get config
93+
* @param name to get config
9494
*/
9595
public static void saveConfig(JavaPlugin plugin, FileConfiguration config, String name) {
9696
try {
@@ -107,8 +107,8 @@ public static void saveConfig(JavaPlugin plugin, FileConfiguration config, Strin
107107
* modifications through the specified {@link Consumer} of {@link FileConfiguration}, and
108108
* then saves the modified configuration file.
109109
*
110-
* @param plugin The {@link JavaPlugin} instance from which the configuration is loaded and saved.
111-
* @param fileName The name of the configuration file to be loaded and saved.
110+
* @param plugin The {@link JavaPlugin} instance from which the configuration is loaded and saved.
111+
* @param fileName The name of the configuration file to be loaded and saved.
112112
* @param configConsumer A {@link Consumer} that performs operations on the {@link FileConfiguration}.
113113
* This allows you to modify the configuration before it is saved.
114114
*/
@@ -119,4 +119,4 @@ public static void writeAndSave(JavaPlugin plugin, String fileName, Consumer<Fil
119119

120120
ConfigUtils.saveConfig(plugin, config, fileName);
121121
}
122-
}
122+
}

src/main/java/dev/despical/commons/database/MySQLDatabase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
*/
4040
public class MySQLDatabase {
4141

42-
private Logger logger;
4342
private final HikariDataSource hikariDataSource;
43+
private Logger logger;
4444

4545
/**
4646
* Initializes the database using a custom config file name within a plugin's folder.
@@ -294,4 +294,4 @@ public Connection getConnection() throws SQLException {
294294
public void setLogger(Logger logger) {
295295
this.logger = logger;
296296
}
297-
}
297+
}

src/main/java/dev/despical/commons/engine/ScriptEngine.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818

1919
package dev.despical.commons.engine;
2020

21-
import java.util.logging.Level;
22-
2321
import javax.script.ScriptEngineManager;
2422
import javax.script.ScriptException;
23+
import java.util.logging.Level;
2524

2625
/**
2726
* @author Despical
@@ -52,4 +51,4 @@ public void execute(String executable) {
5251
logger.log(Level.SEVERE, "---- DO NOT REPORT THIS TO AUTHOR THIS IS NOT A BUG OR A CRASH ----");
5352
}
5453
}
55-
}
54+
}

src/main/java/dev/despical/commons/item/ItemUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public static boolean isNamed(ItemStack stack) {
5353
/**
5454
* Checks if the given 2 items have the same display name, lore and amount.
5555
*
56-
* @param first the first item to check
56+
* @param first the first item to check
5757
* @param second the second item to check
5858
* @return {@code true} if the given 2 items are equals and both are same amount,
59-
* otherwise {@code false}
59+
* otherwise {@code false}
6060
*/
6161
public static boolean isSameItems(ItemStack first, ItemStack second) {
6262
return isSameItemsWithoutAmount(first, second) && first.getAmount() == second.getAmount();
@@ -65,7 +65,7 @@ public static boolean isSameItems(ItemStack first, ItemStack second) {
6565
/**
6666
* Checks if the given 2 items have the same display name and lore.
6767
*
68-
* @param first the first item to check
68+
* @param first the first item to check
6969
* @param second the second item to check
7070
* @return {@code true} if the given 2 items are equals, may not be same amount
7171
*/
@@ -103,4 +103,4 @@ public static SkullMeta setPlayerHead(Player player, SkullMeta meta) {
103103

104104
return meta;
105105
}
106-
}
106+
}

src/main/java/dev/despical/commons/miscellaneous/DefaultFontInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
package dev.despical.commons.miscellaneous;
2020

2121
/**
22-
* @see <a href="https://www.spigotmc.org/threads/free-code-sending-perfectly-centered-chat-message.95872">Spigot Thread</a>
2322
* @author Despical
2423
* <p>
2524
* Created at 30.05.2020
25+
* @see <a href="https://www.spigotmc.org/threads/free-code-sending-perfectly-centered-chat-message.95872">Spigot Thread</a>
2626
*/
2727
public enum DefaultFontInfo {
2828

src/main/java/dev/despical/commons/miscellaneous/PlayerUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ private PlayerUtils() {
3737
* Hides given player to given other player to avoid using deprecated
3838
* methods.
3939
*
40-
* @param to player to hide
41-
* @param p player to be hidden
40+
* @param to player to hide
41+
* @param p player to be hidden
4242
* @param plugin instance for method to avoid deprecation
4343
*/
4444
public static void hidePlayer(Player to, Player p, JavaPlugin plugin) {
@@ -57,8 +57,8 @@ public static void hidePlayer(Player to, Player p, JavaPlugin plugin) {
5757
* Shows given player to given other player to avoid using deprecated
5858
* methods.
5959
*
60-
* @param to player to show
61-
* @param p player to be shown
60+
* @param to player to show
61+
* @param p player to be shown
6262
* @param plugin instance for method to avoid deprecation
6363
*/
6464
public static void showPlayer(Player to, Player p, JavaPlugin plugin) {
@@ -72,4 +72,4 @@ public static void showPlayer(Player to, Player p, JavaPlugin plugin) {
7272
to.showPlayer(p);
7373
}
7474
}
75-
}
75+
}

src/main/java/dev/despical/commons/number/NumberUtils.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static int getInt(String string) {
8383
* fails. If the string is null, the default value is returned.
8484
*
8585
* @param string the string to convert, may be null
86-
* @param def the default value
86+
* @param def the default value
8787
* @return the int represented by the string, or the default if conversion fails
8888
*/
8989
public static int getInt(String string, int def) {
@@ -127,7 +127,7 @@ public static double getDouble(String string) {
127127
* fails. If the string is null, the default value is returned.
128128
*
129129
* @param string the string to convert, may be null
130-
* @param def the default value
130+
* @param def the default value
131131
* @return the double represented by the string, or the default if conversion fails
132132
*/
133133
public static double getDouble(String string, double def) {
@@ -141,7 +141,7 @@ public static double getDouble(String string, double def) {
141141
}
142142

143143
/**
144-
* Checks if the String is primitive type long or not.
144+
* Checks if the String is primitive type long or not.
145145
*
146146
* @param str the String to check, may be null
147147
* @return true if long, and is non-null
@@ -171,7 +171,7 @@ public static long getLong(String string) {
171171
* fails. If the string is null, the default value is returned.
172172
*
173173
* @param string the string to convert, may be null
174-
* @param def the default value
174+
* @param def the default value
175175
* @return the long represented by the string, or the default if conversion fails
176176
*/
177177
public static long getLong(String string, long def) {
@@ -215,7 +215,7 @@ public static long getShort(String string) {
215215
* fails. If the string is null, the default value is returned.
216216
*
217217
* @param string the string to convert, may be null
218-
* @param def the default value
218+
* @param def the default value
219219
* @return the short represented by the string, or the default if conversion fails
220220
*/
221221
public static long getShort(String string, short def) {
@@ -259,7 +259,7 @@ public static float getFloat(String string) {
259259
* fails. If the string is null, the default value is returned.
260260
*
261261
* @param string the string to convert, may be null
262-
* @param def the default value
262+
* @param def the default value
263263
* @return the float represented by the string, or the default if conversion fails
264264
*/
265265
public static float getFloat(String string, float def) {
@@ -276,8 +276,8 @@ public static float getFloat(String string, float def) {
276276
* Checks if the given value is between given values.
277277
*
278278
* @param value the Integer to check is between values
279-
* @param min the minimum value to check given Integer
280-
* @param max the maximum value to check given Integer
279+
* @param min the minimum value to check given Integer
280+
* @param max the maximum value to check given Integer
281281
* @return true if value is between min and max values
282282
*/
283283
public static boolean isBetween(int value, int min, int max) {
@@ -292,11 +292,11 @@ public static boolean isBetween(int value, int min, int max) {
292292
* and integer is 13 it will return 9 not 18 because
293293
* remainder between floor and integer is greater.
294294
*
295-
* @param integer int to be rounded
296-
* @param floor int to be rounded multiple of
295+
* @param integer int to be rounded
296+
* @param floor int to be rounded multiple of
297297
* @return rounded integer
298298
*/
299299
public static int roundInteger(int integer, int floor) {
300300
return integer < floor ? floor : (int) (floor * (Math.round((double) integer / floor)));
301301
}
302-
}
302+
}

src/main/java/dev/despical/commons/scoreboard/AutoUpdatable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
*/
2626
public interface AutoUpdatable {
2727

28-
void disableAutoUpdate();
28+
void disableAutoUpdate();
2929

30-
long getUpdateInterval();
30+
long getUpdateInterval();
3131

32-
void setUpdateInterval(long updateInterval);
32+
void setUpdateInterval(long updateInterval);
3333
}

0 commit comments

Comments
 (0)