Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Fix compile errors
Dieser Commit ist enthalten in:
Ursprung
ee2870aafb
Commit
07f8980f82
@ -1,3 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Velocity Contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.velocitypowered.annotationprocessor;
|
package com.velocitypowered.annotationprocessor;
|
||||||
|
|
||||||
class AnnotationProcessorConstants {
|
class AnnotationProcessorConstants {
|
||||||
|
@ -88,7 +88,8 @@ public class ApiAnnotationProcessor extends AbstractProcessor {
|
|||||||
msg.printMessage(Diagnostic.Kind.ERROR,
|
msg.printMessage(Diagnostic.Kind.ERROR,
|
||||||
"method must not be abstract", method);
|
"method must not be abstract", method);
|
||||||
}
|
}
|
||||||
if (method.getEnclosingElement().getKind().isInterface()) {
|
Element enclosing = method.getEnclosingElement();
|
||||||
|
if (enclosing != null && enclosing.getKind().isInterface()) {
|
||||||
msg.printMessage(Diagnostic.Kind.ERROR,
|
msg.printMessage(Diagnostic.Kind.ERROR,
|
||||||
"interfaces cannot declare listeners", method);
|
"interfaces cannot declare listeners", method);
|
||||||
}
|
}
|
||||||
@ -97,7 +98,8 @@ public class ApiAnnotationProcessor extends AbstractProcessor {
|
|||||||
msg.printMessage(Kind.ERROR, "method must return void or EventTask", method);
|
msg.printMessage(Kind.ERROR, "method must return void or EventTask", method);
|
||||||
}
|
}
|
||||||
final List<? extends VariableElement> parameters = method.getParameters();
|
final List<? extends VariableElement> parameters = method.getParameters();
|
||||||
if (parameters.isEmpty() || !this.isTypeSubclass(parameters.get(0), SUBSCRIBE_ANNOTATION_CLASS)) {
|
if (parameters.isEmpty()
|
||||||
|
|| !this.isTypeSubclass(parameters.get(0), SUBSCRIBE_ANNOTATION_CLASS)) {
|
||||||
msg.printMessage(Diagnostic.Kind.ERROR,
|
msg.printMessage(Diagnostic.Kind.ERROR,
|
||||||
"method must have an Event as its first parameter", method);
|
"method must have an Event as its first parameter", method);
|
||||||
}
|
}
|
||||||
@ -116,9 +118,9 @@ public class ApiAnnotationProcessor extends AbstractProcessor {
|
|||||||
if (Objects.equals(pluginClassFound, qualifiedName.toString())) {
|
if (Objects.equals(pluginClassFound, qualifiedName.toString())) {
|
||||||
if (!warnedAboutMultiplePlugins) {
|
if (!warnedAboutMultiplePlugins) {
|
||||||
processingEnv.getMessager()
|
processingEnv.getMessager()
|
||||||
.printMessage(Diagnostic.Kind.WARNING, "Velocity does not yet currently support "
|
.printMessage(Diagnostic.Kind.WARNING,
|
||||||
+ "multiple plugins. We are using " + pluginClassFound
|
"Velocity does not yet currently support multiple plugins. "
|
||||||
+ " for your plugin's main class.");
|
+ "We are using " + pluginClassFound + " for your plugin's main class.");
|
||||||
warnedAboutMultiplePlugins = true;
|
warnedAboutMultiplePlugins = true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -126,10 +128,10 @@ public class ApiAnnotationProcessor extends AbstractProcessor {
|
|||||||
|
|
||||||
Plugin plugin = element.getAnnotation(Plugin.class);
|
Plugin plugin = element.getAnnotation(Plugin.class);
|
||||||
if (!SerializedPluginDescription.ID_PATTERN.matcher(plugin.id()).matches()) {
|
if (!SerializedPluginDescription.ID_PATTERN.matcher(plugin.id()).matches()) {
|
||||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Invalid ID for plugin "
|
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR,
|
||||||
+ qualifiedName
|
"Invalid ID for plugin " + qualifiedName + ". "
|
||||||
+ ". IDs must start alphabetically, have alphanumeric characters, and can "
|
+ "IDs must start alphabetically, have alphanumeric characters, and can "
|
||||||
+ "contain dashes or underscores.");
|
+ "contain dashes or underscores.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Velocity Contributors
|
||||||
|
*
|
||||||
|
* The Velocity API is licensed under the terms of the MIT License. For more details,
|
||||||
|
* reference the LICENSE file in the api top-level directory.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.velocitypowered.api.event;
|
package com.velocitypowered.api.event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +20,7 @@ package com.velocitypowered.proxy.event;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
import com.velocitypowered.api.event.Event;
|
||||||
import com.velocitypowered.api.event.EventTask;
|
import com.velocitypowered.api.event.EventTask;
|
||||||
import com.velocitypowered.api.event.PostOrder;
|
import com.velocitypowered.api.event.PostOrder;
|
||||||
import com.velocitypowered.api.event.Subscribe;
|
import com.velocitypowered.api.event.Subscribe;
|
||||||
@ -41,7 +42,7 @@ public class EventTest {
|
|||||||
eventManager.shutdown();
|
eventManager.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class TestEvent {
|
static final class TestEvent implements Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void assertAsyncThread(final Thread thread) {
|
static void assertAsyncThread(final Thread thread) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren