1
0
Fork 0
mirror of https://github.com/kaboomserver/commandspy.git synced 2025-05-30 03:57:42 +00:00

Set maximum line length to 100 characters

This commit is contained in:
kaboom 2022-05-20 05:15:47 +03:00
parent 7762bd56f5
commit 2c43271355
4 changed files with 66 additions and 56 deletions
checkstyle.xmlpom.xml
src/main/java/pw/kaboom/commandspy
suppressions.xml

10
checkstyle.xml Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="LineLength">
<property name="max" value="100"/>
</module>
</module>

View file

@ -41,9 +41,8 @@
<goal>check</goal> <goal>check</goal>
</goals> </goals>
<configuration> <configuration>
<suppressionsLocation> <configLocation>checkstyle.xml</configLocation>
suppressions.xml <suppressionsLocation>suppressions.xml</suppressionsLocation>
</suppressionsLocation>
<failOnViolation>true</failOnViolation> <failOnViolation>true</failOnViolation>
</configuration> </configuration>
</execution> </execution>

View file

@ -41,7 +41,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
} }
@Override @Override
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) { public boolean onCommand(final CommandSender sender, final Command cmd, final String label,
final String[] args) {
if (sender instanceof ConsoleCommandSender) { if (sender instanceof ConsoleCommandSender) {
sender.sendMessage("Command has to be run by a player"); sender.sendMessage("Command has to be run by a player");
return true; return true;
@ -72,7 +73,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
} }
Set<String> uuids = config.getKeys(false); Set<String> uuids = config.getKeys(false);
ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString())) ? ChatColor.YELLOW : ChatColor.AQUA; ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString()))
? ChatColor.YELLOW : ChatColor.AQUA;
for (String uuidString : uuids) { for (String uuidString : uuids) {
UUID uuid = UUID.fromString(uuidString); UUID uuid = UUID.fromString(uuidString);
@ -91,7 +93,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
@EventHandler @EventHandler
void onSignChange(final SignChangeEvent event) { void onSignChange(final SignChangeEvent event) {
Set<String> uuids = config.getKeys(false); Set<String> uuids = config.getKeys(false);
ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString())) ? ChatColor.YELLOW : ChatColor.AQUA; ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString()))
? ChatColor.YELLOW : ChatColor.AQUA;
for (String uuidString : uuids) { for (String uuidString : uuids) {
UUID uuid = UUID.fromString(uuidString); UUID uuid = UUID.fromString(uuidString);

View file

@ -1,10 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC <!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN" "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> "https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions> <suppressions>
<suppress checks="Javadoc" files="."/> <suppress checks="Javadoc" files="."/>
<suppress checks="LineLength" files="."/>
</suppressions> </suppressions>