From ad0f02cfa9805e9df0e0aa78fd25f37f564b9b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=ABsFot?= Date: Wed, 18 Nov 2020 00:50:27 +0100 Subject: [PATCH] Add checkstyle gradle plugin --- build.gradle | 7 +- minestom_checks.xml | 303 ++++++++++++++++++ .../net/minestom/server/entity/Player.java | 5 +- 3 files changed, 310 insertions(+), 5 deletions(-) create mode 100644 minestom_checks.xml diff --git a/build.gradle b/build.gradle index ab464fc91..ab70c7eb5 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ plugins { id 'maven-publish' id 'net.ltgt.apt' version '0.10' id 'org.jetbrains.kotlin.jvm' version '1.4.10' + id 'checkstyle' } group 'net.minestom.server' @@ -36,7 +37,7 @@ allprojects { maven { url 'https://jitpack.io' } maven { name 'sponge' - url 'http://repo.spongepowered.org/maven' + url 'https://repo.spongepowered.org/maven' } } javadoc { @@ -72,6 +73,10 @@ sourceSets { } } +tasks.withType(Checkstyle) { + configFile file("${projectDir}/minestom_checks.xml") +} + java { // Minestom uses LWJGL libs as optional dependency if interfacing with a GPU is asked registerFeature("lwjgl") { diff --git a/minestom_checks.xml b/minestom_checks.xml new file mode 100644 index 000000000..142f6229b --- /dev/null +++ b/minestom_checks.xml @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/net/minestom/server/entity/Player.java b/src/main/java/net/minestom/server/entity/Player.java index 31764aa27..682aa9508 100644 --- a/src/main/java/net/minestom/server/entity/Player.java +++ b/src/main/java/net/minestom/server/entity/Player.java @@ -70,7 +70,6 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; - /** * Those are the major actors of the server, * they are not necessary backed by a {@link NettyPlayerConnection} as shown by {@link FakePlayer} @@ -119,7 +118,6 @@ public class Player extends LivingEntity implements CommandSender { private long defaultEatingTime = 1000L; private long eatingTime; private boolean isEating; - // Game state (https://wiki.vg/Protocol#Change_Game_State) private boolean enableRespawnScreen; @@ -1119,8 +1117,7 @@ public class Player extends LivingEntity implements CommandSender { /** * Gets the player display name in the tab-list. * - * @return the player display name, - * null means that {@link #getUsername()} is displayed + * @return the player display name, null means that {@link #getUsername()} is displayed */ @Nullable public ColoredText getDisplayName() {