Skip to content

Commit 36e0c0a

Browse files
committed
update enchantment target and rework some component impl
1 parent 27f926e commit 36e0c0a

File tree

95 files changed

+341
-467
lines changed

Some content is hidden

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

95 files changed

+341
-467
lines changed

paper-api/src/main/java/co/aikar/timings/TimingHistory.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
import static co.aikar.util.JSONUtil.*;
5252

5353
/**
54-
* Internal.
55-
*
54+
* @hidden
5655
* @deprecated Timings will be removed in the future
5756
*/
5857
@Deprecated(forRemoval = true)

paper-api/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
public class AsyncPlayerSendCommandsEvent<S extends CommandSourceStack> extends PlayerEvent {
3535

3636
private static final HandlerList HANDLER_LIST = new HandlerList();
37+
3738
private final RootCommandNode<S> node;
3839
private final boolean hasFiredAsync;
3940

paper-api/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendSuggestionsEvent.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
public class AsyncPlayerSendSuggestionsEvent extends PlayerEvent implements Cancellable {
1919

2020
private static final HandlerList HANDLER_LIST = new HandlerList();
21-
private boolean cancelled = false;
2221

2322
private Suggestions suggestions;
2423
private final String buffer;
2524

25+
private boolean cancelled;
26+
2627
@ApiStatus.Internal
2728
public AsyncPlayerSendSuggestionsEvent(final Player player, final Suggestions suggestions, final String buffer) {
2829
super(player, !Bukkit.isPrimaryThread());
@@ -57,16 +58,14 @@ public void setSuggestions(final Suggestions suggestions) {
5758
this.suggestions = suggestions;
5859
}
5960

60-
/**
61-
* {@inheritDoc}
62-
*/
6361
@Override
6462
public boolean isCancelled() {
6563
return this.cancelled;
6664
}
6765

6866
/**
6967
* Cancels sending suggestions to the client.
68+
* <p>
7069
* {@inheritDoc}
7170
*/
7271
@Override

paper-api/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@
2424
@Warning(reason = "This event has been superseded by the Commands API and will be removed in a future release. Listen to LifecycleEvents.COMMANDS instead.", value = true)
2525
public class CommandRegisteredEvent<S extends com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource> extends ServerEvent implements Cancellable {
2626

27-
private static final HandlerList handlers = new HandlerList();
27+
private static final HandlerList HANDLER_LIST = new HandlerList();
28+
2829
private final String commandLabel;
2930
private final Command command;
3031
private final com.destroystokyo.paper.brigadier.BukkitBrigadierCommand<S> brigadierCommand;
3132
private final RootCommandNode<S> root;
3233
private final ArgumentCommandNode<S, String> defaultArgs;
3334
private LiteralCommandNode<S> literal;
3435
private boolean rawCommand = false;
35-
private boolean cancelled = false;
36+
37+
private boolean cancelled;
3638

3739
public CommandRegisteredEvent(String commandLabel, com.destroystokyo.paper.brigadier.BukkitBrigadierCommand<S> brigadierCommand, Command command, RootCommandNode<S> root, LiteralCommandNode<S> literal, ArgumentCommandNode<S, String> defaultArgs) {
3840
this.commandLabel = commandLabel;
@@ -137,9 +139,6 @@ public void setRawCommand(final boolean rawCommand) {
137139
this.rawCommand = rawCommand;
138140
}
139141

140-
/**
141-
* {@inheritDoc}
142-
*/
143142
@Override
144143
public boolean isCancelled() {
145144
return this.cancelled;
@@ -148,7 +147,7 @@ public boolean isCancelled() {
148147
/**
149148
* Cancels registering this command to Brigadier, but will remain in Bukkit Command Map. Can be used to hide a
150149
* command from all players.
151-
*
150+
* <p>
152151
* {@inheritDoc}
153152
*/
154153
@Override
@@ -158,11 +157,11 @@ public void setCancelled(boolean cancel) {
158157

159158
@NotNull
160159
public HandlerList getHandlers() {
161-
return handlers;
160+
return HANDLER_LIST;
162161
}
163162

164163
@NotNull
165164
public static HandlerList getHandlerList() {
166-
return handlers;
165+
return HANDLER_LIST;
167166
}
168167
}

paper-api/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,25 +221,21 @@ public void setFailMessage(final String failMessage) {
221221
}
222222

223223
/**
224-
* Determines if this event is cancelled.
224+
* {@inheritDoc}
225225
* <p>
226226
* When this event is cancelled, custom handshake logic will not
227227
* be processed.
228-
*
229-
* @return {@code true} if this event is cancelled, {@code false} otherwise
230228
*/
231229
@Override
232230
public boolean isCancelled() {
233231
return this.cancelled;
234232
}
235233

236234
/**
237-
* Sets if this event is cancelled.
235+
* {@inheritDoc}
238236
* <p>
239237
* When this event is cancelled, custom handshake logic will not
240238
* be processed.
241-
*
242-
* @param cancel {@code true} if this event is cancelled, {@code false} otherwise
243239
*/
244240
@Override
245241
public void setCancelled(final boolean cancel) {

paper-api/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public PlayerJumpEvent(final Player player, final Location from, final Location
4040
* If this event is cancelled, the player will be moved or
4141
* teleported back to the Location as defined by {@link #getFrom()}. This will not
4242
* fire an event
43-
*
44-
* @return {@code true} if this event is cancelled
4543
*/
4644
@Override
4745
public boolean isCancelled() {
@@ -54,8 +52,6 @@ public boolean isCancelled() {
5452
* If this event is cancelled, the player will be moved or
5553
* teleported back to the Location as defined by {@link #getFrom()}. This will not
5654
* fire an event
57-
*
58-
* @param cancel {@code true} if you wish to cancel this event
5955
*/
6056
@Override
6157
public void setCancelled(final boolean cancel) {

paper-api/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import org.jetbrains.annotations.ApiStatus;
44
import org.jspecify.annotations.NullMarked;
55

6+
/**
7+
* @hidden
8+
*/
69
@ApiStatus.Internal
710
@NullMarked
811
public final class SneakyThrow {

paper-api/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ default Component getVersionMessage(String serverVersion) {
4040
return getVersionMessage();
4141
}
4242

43+
/**
44+
* @hidden
45+
*/
4346
@ApiStatus.Internal
4447
class DummyVersionFetcher implements VersionFetcher {
4548

paper-api/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

paper-api/src/main/java/io/papermc/paper/event/block/VaultChangeStateEvent.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.papermc.paper.event.block;
22

3-
import com.google.common.base.Preconditions;
43
import org.bukkit.block.Block;
54
import org.bukkit.block.data.type.Vault;
65
import org.bukkit.entity.Player;
@@ -16,12 +15,14 @@
1615
*/
1716
@NullMarked
1817
public class VaultChangeStateEvent extends BlockEvent implements Cancellable {
18+
1919
private static final HandlerList HANDLER_LIST = new HandlerList();
2020

2121
private final @Nullable Player player;
2222
private final Vault.State currentState;
2323
private final Vault.State newState;
24-
private boolean cancelled = false;
24+
25+
private boolean cancelled;
2526

2627
@ApiStatus.Internal
2728
public VaultChangeStateEvent(final Block vaultBlock, final @Nullable Player player, final Vault.State currentState, final Vault.State newState) {
@@ -46,7 +47,7 @@ public VaultChangeStateEvent(final Block vaultBlock, final @Nullable Player play
4647
* @return The current vault state.
4748
*/
4849
public Vault.State getCurrentState() {
49-
return currentState;
50+
return this.currentState;
5051
}
5152

5253
/**
@@ -55,7 +56,7 @@ public Vault.State getCurrentState() {
5556
* @return The new vault state.
5657
*/
5758
public Vault.State getNewState() {
58-
return newState;
59+
return this.newState;
5960
}
6061

6162
@Override

0 commit comments

Comments
 (0)