Skip to content

Commit 5eb3906

Browse files
Merge branch 'dev/3.0.0' into ping-passthrough-dev
2 parents 71c11a8 + ae31233 commit 5eb3906

File tree

205 files changed

+6078
-1359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+6078
-1359
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Bug Report
2+
description: Report issues with Velocity not working properly.
3+
labels: ["type: bug"]
4+
body:
5+
- type: textarea
6+
attributes:
7+
label: Expected Behavior
8+
description: What you expected to work and how.
9+
validations:
10+
required: true
11+
12+
- type: textarea
13+
attributes:
14+
label: Actual Behavior
15+
description: What actually happens.
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: Steps to Reproduce
22+
description: Information on how we can reproduce this bug on our own, this can be e.g. just an explanation, a video or your Velocity config.
23+
validations:
24+
required: true
25+
26+
- type: textarea
27+
attributes:
28+
label: Plugin List
29+
description: |
30+
All plugins running on your proxy and the backend server you're experiencing this issue on.
31+
Use `/velocity plugins` to list plugins on Velocity and `/plugins` to list plugins on your backend server.
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
attributes:
37+
label: Velocity Version
38+
description: |
39+
The full, unmodified output of running `/velocity info`.
40+
*"Latest"* is not a version. We require you to paste the text, not a screenshot.
41+
<details>
42+
<summary>Example</summary>
43+
44+
```
45+
[17:44:10 INFO]: Velocity 3.3.0-SNAPSHOT (git-9d25d309-b400)
46+
[17:44:10 INFO]: Copyright 2018-2023 Velocity Contributors. Velocity is licensed under the terms of the GNU General Public License v3.
47+
[17:44:10 INFO]: PaperMC - GitHub
48+
```
49+
</details>
50+
validations:
51+
required: true
52+
53+
- type: textarea
54+
attributes:
55+
label: Additional Information
56+
description: Anything else you think is helpful.
57+
validations:
58+
required: false
59+
60+
- type: markdown
61+
attributes:
62+
value: |
63+
Before submitting this issue, please ensure the following:
64+
65+
1. You are running the latest version of Velocity from [our downloads page](https://papermc.io/downloads/velocity).
66+
2. You searched for and ensured there isn't already an open issue regarding this.
67+
68+
If you think you have a bug, but are not sure, feel free to ask in the `#velocity-help` channel on our
69+
[Discord](https://discord.gg/papermc).

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: PaperMC Discord
4+
url: https://discord.gg/papermc
5+
about: If you are having issues with the proxy not connecting to servers or have other minor issues, come ask us on our Discord server!
6+
- name: Exploit Report
7+
url: https://discord.gg/papermc
8+
about: |
9+
Due to GitHub not currently allowing private issues, exploit reports are currently handled via our Discord.
10+
To report an exploit, see the #paper-exploit-report channel.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Feature Request
2+
description: Request for a feature to be implemented into Velocity.
3+
labels: ["type: feature"]
4+
body:
5+
- type: textarea
6+
attributes:
7+
label: Requested Feature
8+
description: |
9+
Please describe as best as you can what you'd like to be added to Velocity.
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
attributes:
15+
label: Why is this needed?
16+
description: |
17+
Please describe why do you need this feature.
18+
Do you think it could be useful? Is it due to another problem?
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
attributes:
24+
label: Alternative Solutions
25+
description: |
26+
Are there any alternative solutions to implementing a new feature?
27+
What have you tried instead?
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
attributes:
33+
label: Additional Information
34+
description: Anything else you want to add.
35+
validations:
36+
required: false
37+
38+
- type: markdown
39+
attributes:
40+
value: |
41+
Before submitting this request, please ensure the following:
42+
43+
1. You are running the latest version of Velocity from [our downloads page](https://papermc.io/downloads/velocity).
44+
2. You searched for and ensured there isn't already an open issue regarding this.
45+
3. The feature you're requesting has to be implemented on Velocity and not on the backend server.
46+
47+
If you are unsure whether your problem can already be fixed in another way, feel free to ask in the `#velocity-help` channel on our
48+
[Discord](https://discord.gg/papermc).

.github/workflows/gradle.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
# For more information see: https://docs.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
33

44
name: Java CI with Gradle
5-
65
on: [push, pull_request]
76

87
jobs:
9-
build-17:
10-
runs-on: ubuntu-latest
8+
build:
9+
runs-on: ubuntu-22.04
1110
steps:
12-
- uses: actions/checkout@v4
13-
- uses: gradle/wrapper-validation-action@v2
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
- name: Set up Gradle
16+
uses: gradle/actions/setup-gradle@v4
1417
- name: Set up JDK 17
1518
uses: actions/setup-java@v4
1619
with:
1720
java-version: 17
1821
distribution: 'temurin'
19-
cache: 'gradle'
2022
- name: Build with Gradle
2123
run: ./gradlew build

api/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ tasks {
6161
o.encoding = "UTF-8"
6262
o.source = "17"
6363

64+
o.use()
6465
o.links(
6566
"https://www.slf4j.org/apidocs/",
6667
"https://guava.dev/releases/${libs.guava.get().version}/api/docs/",
6768
"https://google.github.io/guice/api-docs/${libs.guice.get().version}/javadoc/",
6869
"https://docs.oracle.com/en/java/javase/17/docs/api/",
6970
"https://jd.advntr.dev/api/${libs.adventure.bom.get().version}/",
70-
"https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine"
71+
"https://jd.advntr.dev/text-minimessage/${libs.adventure.bom.get().version}/",
72+
"https://jd.advntr.dev/key/${libs.adventure.bom.get().version}/",
73+
"https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/${libs.caffeine.get().version}/",
7174
)
7275

7376
o.tags(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.velocitypowered.api.plugin.ap.PluginAnnotationProcessor,isolating

api/src/main/java/com/velocitypowered/api/command/CommandManager.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.velocitypowered.api.event.command.CommandExecuteEvent;
1111
import java.util.Collection;
1212
import java.util.concurrent.CompletableFuture;
13+
import java.util.function.Predicate;
1314
import org.checkerframework.checker.nullness.qual.Nullable;
1415

1516
/**
@@ -43,8 +44,10 @@ public interface CommandManager {
4344
* @param otherAliases additional aliases
4445
* @throws IllegalArgumentException if one of the given aliases is already registered, or
4546
* the given command does not implement a registrable {@link Command} subinterface
46-
* @see Command for a list of registrable {@link Command} subinterfaces
47+
* @see Command for a list of registrable Command subinterfaces
48+
* @deprecated use {@link #register(CommandMeta, Command)} instead with a plugin specified
4749
*/
50+
@Deprecated
4851
default void register(String alias, Command command, String... otherAliases) {
4952
register(metaBuilder(alias).aliases(otherAliases).build(), command);
5053
}
@@ -54,7 +57,9 @@ default void register(String alias, Command command, String... otherAliases) {
5457
*
5558
* @param command the command to register
5659
* @throws IllegalArgumentException if the node alias is already registered
60+
* @deprecated use {@link #register(CommandMeta, Command)} instead with a plugin specified
5761
*/
62+
@Deprecated
5863
void register(BrigadierCommand command);
5964

6065
/**
@@ -64,7 +69,7 @@ default void register(String alias, Command command, String... otherAliases) {
6469
* @param command the command to register
6570
* @throws IllegalArgumentException if one of the given aliases is already registered, or
6671
* the given command does not implement a registrable {@link Command} subinterface
67-
* @see Command for a list of registrable {@link Command} subinterfaces
72+
* @see Command for a list of registrable Command subinterfaces
6873
*/
6974
void register(CommandMeta meta, Command command);
7075

@@ -126,4 +131,15 @@ default void register(String alias, Command command, String... otherAliases) {
126131
* @return true if the alias is registered; false otherwise
127132
*/
128133
boolean hasCommand(String alias);
134+
135+
/**
136+
* Returns whether the given alias is registered on this manager
137+
* and can be used by the given {@link CommandSource}.
138+
* See {@link com.mojang.brigadier.builder.ArgumentBuilder#requires(Predicate)}
139+
*
140+
* @param alias the command alias to check
141+
* @param source the command source
142+
* @return true if the alias is registered and usable; false otherwise
143+
*/
144+
boolean hasCommand(String alias, CommandSource source);
129145
}

api/src/main/java/com/velocitypowered/api/command/CommandSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface CommandSource extends Audience, PermissionSubject {
2727
* for more information on the format.
2828
**/
2929
default void sendRichMessage(final @NotNull String message) {
30-
this.sendMessage(MiniMessage.miniMessage().deserialize(message));
30+
this.sendMessage(MiniMessage.miniMessage().deserialize(message, this));
3131
}
3232

3333
/**
@@ -43,7 +43,7 @@ default void sendRichMessage(
4343
final @NotNull String message,
4444
final @NotNull TagResolver @NotNull... resolvers
4545
) {
46-
this.sendMessage(MiniMessage.miniMessage().deserialize(message, resolvers));
46+
this.sendMessage(MiniMessage.miniMessage().deserialize(message, this, resolvers));
4747
}
4848

4949
/**

api/src/main/java/com/velocitypowered/api/event/EventManager.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,28 @@ default <E> void register(Object plugin, Class<E> eventClass, EventHandler<E> ha
4545
* @param postOrder the order in which events should be posted to the handler
4646
* @param handler the handler to register
4747
* @param <E> the event type to handle
48+
* @deprecated use {@link #register(Object, Class, short, EventHandler)} instead
4849
*/
50+
@Deprecated
4951
<E> void register(Object plugin, Class<E> eventClass, PostOrder postOrder,
5052
EventHandler<E> handler);
5153

54+
/**
55+
* Requests that the specified {@code handler} listen for events and associate it with the {@code
56+
* plugin}.
57+
*
58+
* <p>Note that this method will register a non-asynchronous listener by default. If you want to
59+
* use an asynchronous event handler, return {@link EventTask#async(Runnable)} from the handler.</p>
60+
*
61+
* @param plugin the plugin to associate with the handler
62+
* @param eventClass the class for the event handler to register
63+
* @param postOrder the relative order in which events should be posted to the handler
64+
* @param handler the handler to register
65+
* @param <E> the event type to handle
66+
*/
67+
<E> void register(Object plugin, Class<E> eventClass, short postOrder,
68+
EventHandler<E> handler);
69+
5270
/**
5371
* Fires the specified event to the event bus asynchronously. This allows Velocity to continue
5472
* servicing connections while a plugin handles a potentially long-running operation such as a

api/src/main/java/com/velocitypowered/api/event/PostOrder.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
*/
1313
public enum PostOrder {
1414

15-
FIRST, EARLY, NORMAL, LATE, LAST
15+
FIRST, EARLY, NORMAL, LATE, LAST,
16+
17+
/**
18+
* Previously used to specify that {@link Subscribe#priority()} should be used.
19+
*
20+
* @deprecated No longer required, you only need to specify {@link Subscribe#priority()}.
21+
*/
22+
@Deprecated
23+
CUSTOM
1624

1725
}

0 commit comments

Comments
 (0)