Skip to content

Commit f2e7f44

Browse files
committed
simplify
1 parent 3459b68 commit f2e7f44

File tree

182 files changed

+705
-1224
lines changed

Some content is hidden

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

182 files changed

+705
-1224
lines changed

Diff for: build-data/paper.at

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket xRot
3838
public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket y
3939
public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket yRot
4040
public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket z
41+
public net.minecraft.network.syncher.SynchedEntityData getItem(Lnet/minecraft/network/syncher/EntityDataAccessor;)Lnet/minecraft/network/syncher/SynchedEntityData$DataItem;
4142
public net.minecraft.resources.RegistryOps lookupProvider
4243
public net.minecraft.resources.RegistryOps$HolderLookupAdapter
4344
public net.minecraft.server.Main forceUpgrade(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lnet/minecraft/world/level/storage/WorldData;Lcom/mojang/datafixers/DataFixer;ZLjava/util/function/BooleanSupplier;Lnet/minecraft/core/RegistryAccess;Z)V
@@ -84,6 +85,7 @@ public net.minecraft.server.level.ServerBossEvent broadcast(Ljava/util/function/
8485
public net.minecraft.server.level.ServerBossEvent visible
8586
public net.minecraft.server.level.ServerChunkCache mainThread
8687
public net.minecraft.server.level.ServerChunkCache mainThreadProcessor
88+
public net.minecraft.server.level.ServerChunkCache runDistanceManagerUpdates()Z
8789
public net.minecraft.server.level.ServerChunkCache spawnEnemies
8890
public net.minecraft.server.level.ServerChunkCache spawnFriendlies
8991
public net.minecraft.server.level.ServerChunkCache$MainThreadExecutor
@@ -107,6 +109,7 @@ public net.minecraft.server.level.ServerPlayer wardenSpawnTracker
107109
public net.minecraft.server.level.ServerPlayer$RespawnPosAngle
108110
public net.minecraft.server.level.ServerPlayerGameMode level
109111
public net.minecraft.server.level.Ticket key
112+
public net.minecraft.server.level.TicketType register(Ljava/lang/String;JZLnet/minecraft/server/level/TicketType$TicketUse;)Lnet/minecraft/server/level/TicketType;
110113
public net.minecraft.server.network.ServerGamePacketListenerImpl isChatMessageIllegal(Ljava/lang/String;)Z
111114
public net.minecraft.server.network.ServerLoginPacketListenerImpl authenticatedProfile
112115
public net.minecraft.server.network.ServerLoginPacketListenerImpl connection
@@ -571,6 +574,7 @@ public net.minecraft.world.level.BaseSpawner spawnPotentials
571574
public net.minecraft.world.level.BaseSpawner spawnRange
572575
public net.minecraft.world.level.GameRules$Value deserialize(Ljava/lang/String;)V
573576
public net.minecraft.world.level.GameRules$Value onChanged(Lnet/minecraft/server/MinecraftServer;)V
577+
public net.minecraft.world.level.Level blockEntityTickers
574578
public net.minecraft.world.level.Level getEntities()Lnet/minecraft/world/level/entity/LevelEntityGetter;
575579
public net.minecraft.world.level.Level levelData
576580
public net.minecraft.world.level.Level rainLevel
@@ -602,6 +606,7 @@ public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity cooking
602606
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity getTotalCookTime(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity;)I
603607
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity litTimeRemaining
604608
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipesUsed
609+
public net.minecraft.world.level.block.entity.BannerBlockEntity name
605610
public net.minecraft.world.level.block.entity.BarrelBlockEntity openersCounter
606611
public net.minecraft.world.level.block.entity.BarrelBlockEntity playSound(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/sounds/SoundEvent;)V
607612
public net.minecraft.world.level.block.entity.BarrelBlockEntity updateBlockState(Lnet/minecraft/world/level/block/state/BlockState;Z)V
@@ -689,6 +694,7 @@ public net.minecraft.world.level.chunk.LevelChunk level
689694
public net.minecraft.world.level.chunk.LevelChunk loaded
690695
public net.minecraft.world.level.chunk.LevelChunkSection states
691696
public net.minecraft.world.level.chunk.PalettedContainer registry
697+
public net.minecraft.world.level.chunk.status.ChunkStatusTasks postLoadProtoChunk(Lnet/minecraft/server/level/ServerLevel;Ljava/util/List;)V
692698
public net.minecraft.world.level.chunk.storage.EntityStorage entityDeserializerQueue
693699
public net.minecraft.world.level.chunk.storage.EntityStorage level
694700
public net.minecraft.world.level.chunk.storage.RegionFileStorage regionCache
@@ -753,7 +759,6 @@ public-f net.minecraft.server.ReloadableServerResources commands
753759
public-f net.minecraft.server.dedicated.DedicatedServer serverLinks
754760
public-f net.minecraft.server.dedicated.DedicatedServer settings
755761
public-f net.minecraft.server.dedicated.DedicatedServerProperties pauseWhenEmptySeconds
756-
public-f net.minecraft.server.level.TicketType timeout
757762
public-f net.minecraft.server.players.PlayerList maxPlayers
758763
public-f net.minecraft.world.entity.LivingEntity combatTracker
759764
public-f net.minecraft.world.entity.LivingEntity invulnerableDuration

Diff for: paper-api/src/main/java/com/destroystokyo/paper/NamespacedTag.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public final class NamespacedTag implements com.destroystokyo.paper.Namespaced {
3131
* compatibility measures.
3232
*/
3333
public static final String BUKKIT = "bukkit";
34-
//
34+
3535
private static final Pattern VALID_NAMESPACE = Pattern.compile("[a-z0-9._-]+");
3636
private static final Pattern VALID_KEY = Pattern.compile("[a-z0-9/._-]+");
37-
//
37+
3838
private final String namespace;
3939
private final String key;
4040

Diff for: paper-api/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class BeaconEffectEvent extends BlockEvent implements Cancellable {
2424
private boolean cancelled;
2525

2626
@ApiStatus.Internal
27-
public BeaconEffectEvent(final Block block, final PotionEffect effect, final Player player, final boolean primary) {
28-
super(block);
27+
public BeaconEffectEvent(final Block beacon, final PotionEffect effect, final Player player, final boolean primary) {
28+
super(beacon);
2929
this.effect = effect;
3030
this.player = player;
3131
this.primary = primary;

Diff for: paper-api/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* Fired anytime the server intends to 'destroy' a block through some triggering reason.
1313
* This does not fire anytime a block is set to air, but only with more direct triggers such
14-
* as physics updates, pistons, Entities changing blocks, commands set to "Destroy".
14+
* as physics updates, pistons, entities changing blocks, commands set to "Destroy".
1515
* <p>
1616
* This event is associated with the game playing a sound effect at the block in question, when
1717
* something can be described as "intend to destroy what is there",
@@ -39,7 +39,7 @@ public BlockDestroyEvent(final Block block, final BlockData newState, final Bloc
3939
}
4040

4141
/**
42-
* Get the effect that will be played when the block is broken.
42+
* Gets the effect that will be played when the block is broken.
4343
*
4444
* @return block break effect
4545
*/

Diff for: paper-api/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public class TNTPrimeEvent extends BlockEvent implements Cancellable {
3333
private boolean cancelled;
3434

3535
@ApiStatus.Internal
36-
public TNTPrimeEvent(@NotNull Block theBlock, @NotNull PrimeReason reason, @Nullable Entity primerEntity) {
37-
super(theBlock);
36+
public TNTPrimeEvent(@NotNull Block block, @NotNull PrimeReason reason, @Nullable Entity primerEntity) {
37+
super(block);
3838
this.reason = reason;
3939
this.primerEntity = primerEntity;
4040
}

Diff for: paper-api/src/main/java/com/destroystokyo/paper/event/player/PlayerClientOptionsChangeEvent.java

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class PlayerClientOptionsChangeEvent extends PlayerEvent {
3131
private final ParticleVisibility particleVisibility;
3232

3333
@Deprecated
34+
@ApiStatus.Internal
3435
public PlayerClientOptionsChangeEvent(final Player player, final String locale, final int viewDistance, final ChatVisibility chatVisibility, final boolean chatColors, final SkinParts skinParts, final MainHand mainHand) {
3536
super(player);
3637
this.locale = locale;

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

+26-26
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,6 @@ public PlayerHandshakeEvent(final String originalHandshake, final String origina
5050
this.cancelled = cancelled;
5151
}
5252

53-
/**
54-
* Determines if this event is cancelled.
55-
* <p>
56-
* When this event is cancelled, custom handshake logic will not
57-
* be processed.
58-
*
59-
* @return {@code true} if this event is cancelled, {@code false} otherwise
60-
*/
61-
@Override
62-
public boolean isCancelled() {
63-
return this.cancelled;
64-
}
65-
66-
/**
67-
* Sets if this event is cancelled.
68-
* <p>
69-
* When this event is cancelled, custom handshake logic will not
70-
* be processed.
71-
*
72-
* @param cancel {@code true} if this event is cancelled, {@code false} otherwise
73-
*/
74-
@Override
75-
public void setCancelled(final boolean cancel) {
76-
this.cancelled = cancel;
77-
}
78-
7953
/**
8054
* Gets the original handshake string.
8155
*
@@ -246,6 +220,32 @@ public void setFailMessage(final String failMessage) {
246220
this.failMessage(LegacyComponentSerializer.legacySection().deserialize(failMessage));
247221
}
248222

223+
/**
224+
* Determines if this event is cancelled.
225+
* <p>
226+
* When this event is cancelled, custom handshake logic will not
227+
* be processed.
228+
*
229+
* @return {@code true} if this event is cancelled, {@code false} otherwise
230+
*/
231+
@Override
232+
public boolean isCancelled() {
233+
return this.cancelled;
234+
}
235+
236+
/**
237+
* Sets if this event is cancelled.
238+
* <p>
239+
* When this event is cancelled, custom handshake logic will not
240+
* be processed.
241+
*
242+
* @param cancel {@code true} if this event is cancelled, {@code false} otherwise
243+
*/
244+
@Override
245+
public void setCancelled(final boolean cancel) {
246+
this.cancelled = cancel;
247+
}
248+
249249
@Override
250250
public HandlerList getHandlers() {
251251
return HANDLER_LIST;

Diff for: paper-api/src/main/java/io/papermc/paper/event/block/BeaconActivatedEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public class BeaconActivatedEvent extends BlockEvent {
1717
private static final HandlerList HANDLER_LIST = new HandlerList();
1818

1919
@ApiStatus.Internal
20-
public BeaconActivatedEvent(final Block block) {
21-
super(block);
20+
public BeaconActivatedEvent(final Block beacon) {
21+
super(beacon);
2222
}
2323

2424
/**

Diff for: paper-api/src/main/java/io/papermc/paper/event/block/BeaconDeactivatedEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class BeaconDeactivatedEvent extends BlockEvent {
1818
private static final HandlerList HANDLER_LIST = new HandlerList();
1919

2020
@ApiStatus.Internal
21-
public BeaconDeactivatedEvent(final Block block) {
22-
super(block);
21+
public BeaconDeactivatedEvent(final Block beacon) {
22+
super(beacon);
2323
}
2424

2525
/**

Diff for: paper-api/src/main/java/io/papermc/paper/event/block/BellRevealRaiderEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public class BellRevealRaiderEvent extends BlockEvent implements Cancellable {
2222
private boolean cancelled;
2323

2424
@ApiStatus.Internal
25-
public BellRevealRaiderEvent(@NotNull Block theBlock, @NotNull Raider raider) {
26-
super(theBlock);
25+
public BellRevealRaiderEvent(@NotNull Block bell, @NotNull Raider raider) {
26+
super(bell);
2727
this.raider = raider;
2828
}
2929

Diff for: paper-api/src/main/java/io/papermc/paper/event/block/BlockFailedDispenseEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public class BlockFailedDispenseEvent extends BlockEvent {
1717
private boolean shouldPlayEffect = true;
1818

1919
@ApiStatus.Internal
20-
public BlockFailedDispenseEvent(final Block theBlock) {
21-
super(theBlock);
20+
public BlockFailedDispenseEvent(final Block block) {
21+
super(block);
2222
}
2323

2424
/**

Diff for: paper-api/src/main/java/io/papermc/paper/event/entity/EntityFertilizeEggEvent.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public class EntityFertilizeEggEvent extends EntityEvent implements Cancellable
3131

3232
private static final HandlerList HANDLER_LIST = new HandlerList();
3333

34-
private final LivingEntity mother;
3534
private final LivingEntity father;
3635
private final @Nullable Player breeder;
3736
private final @Nullable ItemStack bredWith;
@@ -42,7 +41,6 @@ public class EntityFertilizeEggEvent extends EntityEvent implements Cancellable
4241
@ApiStatus.Internal
4342
public EntityFertilizeEggEvent(final LivingEntity mother, final LivingEntity father, final @Nullable Player breeder, final @Nullable ItemStack bredWith, final int experience) {
4443
super(mother);
45-
this.mother = mother;
4644
this.father = father;
4745
this.breeder = breeder;
4846
this.bredWith = bredWith;
@@ -61,7 +59,7 @@ public LivingEntity getEntity() {
6159
* @return The "mother" entity.
6260
*/
6361
public LivingEntity getMother() {
64-
return this.mother;
62+
return this.getEntity();
6563
}
6664

6765
/**

Diff for: paper-api/src/main/java/io/papermc/paper/event/player/AbstractChatEvent.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public abstract class AbstractChatEvent extends PlayerEvent implements Cancellab
3939

4040
/**
4141
* Gets a set of {@link Audience audiences} that this chat message will be displayed to.
42-
*
43-
* <p>The set returned may auto-populate on access. Any listener accessing the returned set should be aware that
44-
* it may reduce performance for a lazy set implementation.</p>
42+
* <p>
43+
* The set returned may auto-populate on access. Any listener accessing the returned set should be aware that
44+
* it may reduce performance for a lazy set implementation.
4545
*
4646
* @return a mutable set of {@link Audience audiences} who will receive the chat message
4747
*/

Diff for: paper-api/src/main/java/io/papermc/paper/event/player/AsyncChatDecorateEvent.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public AsyncChatDecorateEvent(final @Nullable Player player, final Component ori
4242
* Gets the player (if available) associated with this event.
4343
* <p>
4444
* Certain commands request decorations without a player context
45-
* which is why this is possibly null.
45+
* which is why this is possibly {@code null}.
4646
*
4747
* @return the player or {@code null}
4848
*/

Diff for: paper-api/src/main/java/io/papermc/paper/event/player/PlayerClientLoadedWorldEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public class PlayerClientLoadedWorldEvent extends PlayerEvent {
2020
private final boolean timeout;
2121

2222
@ApiStatus.Internal
23-
public PlayerClientLoadedWorldEvent(final Player who, final boolean timeout) {
24-
super(who);
23+
public PlayerClientLoadedWorldEvent(final Player player, final boolean timeout) {
24+
super(player);
2525
this.timeout = timeout;
2626
}
2727

Diff for: paper-api/src/main/java/org/bukkit/Nameable.java

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
public interface Nameable {
99

10-
// Paper start
1110
/**
1211
* Gets the custom name.
1312
*
@@ -29,7 +28,6 @@ public interface Nameable {
2928
* @param customName the custom name to set
3029
*/
3130
void customName(final net.kyori.adventure.text.@Nullable Component customName);
32-
// Paper end
3331

3432
/**
3533
* Gets the custom name on a mob or block. If there is no name this method

Diff for: paper-api/src/main/java/org/bukkit/NamespacedKey.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key, com.des
3030
* compatibility measures.
3131
*/
3232
public static final String BUKKIT = "bukkit";
33-
//
33+
3434
private final String namespace;
3535
private final String key;
3636

Diff for: paper-api/src/main/java/org/bukkit/block/CommandBlock.java

+9-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
1010

1111
/**
1212
* Gets the command that this CommandBlock will run when powered.
13-
* This will never return null. If the CommandBlock does not have a
13+
* This will never return null. If the CommandBlock does not have a
1414
* command, an empty String will be returned instead.
1515
*
1616
* @return Command that this CommandBlock will run when powered.
@@ -28,8 +28,8 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
2828
public void setCommand(@Nullable String command);
2929

3030
/**
31-
* Gets the name of this CommandBlock. The name is used with commands
32-
* that this CommandBlock executes. This name will never be null, and
31+
* Gets the name of this CommandBlock. The name is used with commands
32+
* that this CommandBlock executes. This name will never be null, and
3333
* by default is "@".
3434
*
3535
* @return Name of this CommandBlock.
@@ -40,8 +40,8 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
4040
public String getName();
4141

4242
/**
43-
* Sets the name of this CommandBlock. The name is used with commands
44-
* that this CommandBlock executes. Setting the name to null is the
43+
* Sets the name of this CommandBlock. The name is used with commands
44+
* that this CommandBlock executes. Setting the name to null is the
4545
* same as setting it to "@".
4646
*
4747
* @param name New name for this CommandBlock.
@@ -50,23 +50,21 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
5050
@Deprecated // Paper
5151
public void setName(@Nullable String name);
5252

53-
// Paper start
5453
/**
55-
* Gets the name of this CommandBlock. The name is used with commands
56-
* that this CommandBlock executes. This name will never be null, and
54+
* Gets the name of this CommandBlock. The name is used with commands
55+
* that this CommandBlock executes. This name will never be null, and
5756
* by default is a {@link net.kyori.adventure.text.TextComponent} containing {@code @}.
5857
*
5958
* @return Name of this CommandBlock.
6059
*/
6160
public net.kyori.adventure.text.@NotNull Component name();
6261

6362
/**
64-
* Sets the name of this CommandBlock. The name is used with commands
65-
* that this CommandBlock executes. Setting the name to null is the
63+
* Sets the name of this CommandBlock. The name is used with commands
64+
* that this CommandBlock executes. Setting the name to null is the
6665
* same as setting it to a {@link net.kyori.adventure.text.TextComponent} containing {@code @}.
6766
*
6867
* @param name New name for this CommandBlock.
6968
*/
7069
public void name(net.kyori.adventure.text.@Nullable Component name);
71-
// Paper end
7270
}

Diff for: paper-api/src/main/java/org/bukkit/entity/memory/MemoryKey.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public Class<T> getMemoryClass() {
4545
}
4646

4747
private static final Map<NamespacedKey, MemoryKey> MEMORY_KEYS = new HashMap<>();
48-
//
48+
4949
public static final MemoryKey<Location> HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class);
5050
public static final MemoryKey<Location> POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class);
5151
public static final MemoryKey<Location> JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("job_site"), Location.class);

Diff for: paper-api/src/main/java/org/bukkit/event/block/BellResonateEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class BellResonateEvent extends BlockEvent {
1515
private static final HandlerList handlers = new HandlerList();
1616
private final List<LivingEntity> resonatedEntities;
1717

18-
public BellResonateEvent(@NotNull Block theBlock, @NotNull List<LivingEntity> resonatedEntities) {
19-
super(theBlock);
18+
public BellResonateEvent(@NotNull Block bell, @NotNull List<LivingEntity> resonatedEntities) {
19+
super(bell);
2020
this.resonatedEntities = resonatedEntities;
2121
}
2222

Diff for: paper-api/src/main/java/org/bukkit/event/block/BellRingEvent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class BellRingEvent extends BlockEvent implements Cancellable {
1818
private final Entity entity;
1919
private boolean cancelled;
2020

21-
public BellRingEvent(@NotNull Block theBlock, @NotNull BlockFace direction, @Nullable Entity entity) {
22-
super(theBlock);
21+
public BellRingEvent(@NotNull Block block, @NotNull BlockFace direction, @Nullable Entity entity) {
22+
super(block);
2323
this.direction = direction;
2424
this.entity = entity;
2525
}

0 commit comments

Comments
 (0)