Experimental annotation changes (#12028)

This commit is contained in:
Lulu13022002 2025-01-30 20:02:14 +01:00 committed by GitHub
parent 54b2e9d973
commit d4a957849c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 19 additions and 59 deletions

View File

@ -1,32 +1,32 @@
[*] [*]
charset=utf-8 charset = utf-8
end_of_line=lf end_of_line = lf
insert_final_newline=true insert_final_newline = true
indent_style=space indent_style = space
indent_size=4 indent_size = 4
ij_any_block_comment_add_space = false ij_any_block_comment_add_space = false
ij_any_block_comment_at_first_column = false ij_any_block_comment_at_first_column = false
ij_any_line_comment_at_first_column = false ij_any_line_comment_at_first_column = false
ij_any_line_comment_add_space = true ij_any_line_comment_add_space = true
[*.tiny] [*.tiny]
indent_style=tab indent_style = tab
[*.bat] [*.bat]
end_of_line=crlf end_of_line = crlf
[*.yml] [*.yml]
indent_size=2 indent_size = 2
[*.patch] [*.patch]
trim_trailing_whitespace=false trim_trailing_whitespace = false
[*.java] [*.java]
ij_continuation_indent_size = 4 ij_continuation_indent_size = 4
ij_java_class_count_to_use_import_on_demand = 999999 ij_java_class_count_to_use_import_on_demand = 999999
ij_java_insert_inner_class_imports = false ij_java_insert_inner_class_imports = false
ij_java_names_count_to_use_import_on_demand = 999999 ij_java_names_count_to_use_import_on_demand = 999999
ij_java_imports_layout = *,|,$* ij_java_imports_layout = *, |, $*
ij_java_generate_final_locals = true ij_java_generate_final_locals = true
ij_java_generate_final_parameters = true ij_java_generate_final_parameters = true
ij_java_method_parameters_new_line_after_left_paren = true ij_java_method_parameters_new_line_after_left_paren = true
@ -40,5 +40,5 @@ ij_java_use_fq_class_names = true
[paper-server/src/minecraft/resources/data/**/*.json] [paper-server/src/minecraft/resources/data/**/*.json]
indent_size = 2 indent_size = 2
[paper-api-generator/generated/**/*.java] [paper-api/src/generated/java/**/*.java]
ij_java_imports_layout = $*,|,* ij_java_imports_layout = $*, |, *

View File

@ -208,7 +208,8 @@ required.
with `// Paper end - <COMMIT DESCRIPTION>`. with `// Paper end - <COMMIT DESCRIPTION>`.
- One-line changes should have `// Paper - <COMMIT DESCRIPTION>` at the end of the line. - One-line changes should have `// Paper - <COMMIT DESCRIPTION>` at the end of the line.
> [!NOTE] These comments are incredibly important to be able to keep track of changes > [!NOTE]
> These comments are incredibly important to be able to keep track of changes
> across files and to remember what they are for, even a decade into the future. > across files and to remember what they are for, even a decade into the future.
Here's an example of how to mark changes by Paper: Here's an example of how to mark changes by Paper:

View File

@ -271,7 +271,6 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see JukeboxSong * @see JukeboxSong
* @deprecated use {@link RegistryAccess#getRegistry(RegistryKey)} with {@link RegistryKey#JUKEBOX_SONG} * @deprecated use {@link RegistryAccess#getRegistry(RegistryKey)} with {@link RegistryKey#JUKEBOX_SONG}
*/ */
@ApiStatus.Experimental
@Deprecated(since = "1.21") @Deprecated(since = "1.21")
Registry<JukeboxSong> JUKEBOX_SONG = legacyRegistryFor(JukeboxSong.class); Registry<JukeboxSong> JUKEBOX_SONG = legacyRegistryFor(JukeboxSong.class);
/** /**

View File

@ -1,8 +1,5 @@
package org.bukkit.block; package org.bukkit.block;
import org.bukkit.loot.Lootable;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a captured state of a crafter. * Represents a captured state of a crafter.
*/ */

View File

@ -1,10 +1,7 @@
package org.bukkit.block; package org.bukkit.block;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a captured state of a creaking heart. * Represents a captured state of a creaking heart.
*/ */
@ApiStatus.Experimental
public interface CreakingHeart extends TileState { public interface CreakingHeart extends TileState {
} }

View File

@ -4,7 +4,6 @@ import java.util.Collection;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.spawner.TrialSpawnerConfiguration; import org.bukkit.spawner.TrialSpawnerConfiguration;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**

View File

@ -1,7 +1,5 @@
package org.bukkit.block; package org.bukkit.block;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a captured state of a trial spawner. * Represents a captured state of a trial spawner.
*/ */

View File

@ -1,14 +1,12 @@
package org.bukkit.block.data.type; package org.bukkit.block.data.type;
import org.bukkit.block.data.Orientable; import org.bukkit.block.data.Orientable;
import org.jetbrains.annotations.ApiStatus;
/** /**
* 'active' is whether the block is active. * 'active' is whether the block is active.
* <br> * <br>
* 'natural' is whether this is a naturally generated block. * 'natural' is whether this is a naturally generated block.
*/ */
@ApiStatus.Experimental
public interface CreakingHeart extends Orientable { public interface CreakingHeart extends Orientable {
/** /**

View File

@ -1,12 +1,10 @@
package org.bukkit.block.data.type; package org.bukkit.block.data.type;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.jetbrains.annotations.ApiStatus;
/** /**
* 'tip' indicates whether this block is a tip. * 'tip' indicates whether this block is a tip.
*/ */
@ApiStatus.Experimental
public interface HangingMoss extends BlockData { public interface HangingMoss extends BlockData {
/** /**

View File

@ -2,7 +2,6 @@ package org.bukkit.block.data.type;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
@ -11,7 +10,6 @@ import org.jetbrains.annotations.NotNull;
* *
* 'bottom' denotes whether this is a bottom block. * 'bottom' denotes whether this is a bottom block.
*/ */
@ApiStatus.Experimental
public interface MossyCarpet extends BlockData { public interface MossyCarpet extends BlockData {
/** /**

View File

@ -1,7 +1,5 @@
package org.bukkit.entity; package org.bukkit.entity;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a Wind Charge. * Represents a Wind Charge.
*/ */

View File

@ -1,7 +1,5 @@
package org.bukkit.entity; package org.bukkit.entity;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a Bogged Skeleton. * Represents a Bogged Skeleton.
*/ */

View File

@ -1,7 +1,5 @@
package org.bukkit.entity; package org.bukkit.entity;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a Breeze. Whoosh! * Represents a Breeze. Whoosh!
*/ */

View File

@ -1,7 +1,5 @@
package org.bukkit.entity; package org.bukkit.entity;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a Wind Charge. * Represents a Wind Charge.
*/ */

View File

@ -1,11 +1,8 @@
package org.bukkit.entity; package org.bukkit.entity;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a Creaking. * Represents a Creaking.
*/ */
@ApiStatus.Experimental
public interface Creaking extends Monster { public interface Creaking extends Monster {
} }

View File

@ -1,7 +1,6 @@
package org.bukkit.entity; package org.bukkit.entity;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
/** /**

View File

@ -1,7 +1,5 @@
package org.bukkit.entity; package org.bukkit.entity;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents a Wind Charge. * Represents a Wind Charge.
*/ */

View File

@ -1,11 +1,9 @@
package org.bukkit.entity.boat; package org.bukkit.entity.boat;
import org.bukkit.entity.Boat; import org.bukkit.entity.Boat;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents an pale oak boat. * Represents a pale oak boat.
*/ */
@ApiStatus.Experimental
public interface PaleOakBoat extends Boat { public interface PaleOakBoat extends Boat {
} }

View File

@ -1,11 +1,9 @@
package org.bukkit.entity.boat; package org.bukkit.entity.boat;
import org.bukkit.entity.ChestBoat; import org.bukkit.entity.ChestBoat;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Represents an pale oak chest boat. * Represents a pale oak chest boat.
*/ */
@ApiStatus.Experimental
public interface PaleOakChestBoat extends ChestBoat { public interface PaleOakChestBoat extends ChestBoat {
} }

View File

@ -1,7 +1,5 @@
package org.bukkit.inventory; package org.bukkit.inventory;
import org.jetbrains.annotations.ApiStatus;
/** /**
* Interface to the inventory of a Crafter. * Interface to the inventory of a Crafter.
*/ */

View File

@ -2,11 +2,9 @@ package org.bukkit.inventory.meta;
import java.util.List; import java.util.List;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ApiStatus.Experimental
public interface BundleMeta extends ItemMeta { public interface BundleMeta extends ItemMeta {
/** /**

View File

@ -938,7 +938,7 @@
- player.resetSentInfo(); - player.resetSentInfo();
+ // entityplayer.resetSentInfo(); + // entityplayer.resetSentInfo();
+ player.getBukkitEntity().updateScaledHealth(); // CraftBukkit - Update scaled health on respawn and worldchange + player.getBukkitEntity().updateScaledHealth(); // CraftBukkit - Update scaled health on respawn and worldchange
+ player.refreshEntityData(player); // CraftBukkkit - SPIGOT-7218: sync metadata + player.refreshEntityData(player); // CraftBukkit - SPIGOT-7218: sync metadata
player.connection.send(new ClientboundSetHeldSlotPacket(player.getInventory().selected)); player.connection.send(new ClientboundSetHeldSlotPacket(player.getInventory().selected));
+ // CraftBukkit start - from GameRules + // CraftBukkit start - from GameRules
+ int i = player.serverLevel().getGameRules().getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) ? 22 : 23; + int i = player.serverLevel().getGameRules().getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) ? 22 : 23;

View File

@ -9,7 +9,7 @@
int ageValue = state.getValue(AGE); int ageValue = state.getValue(AGE);
if (ageValue < 2) { if (ageValue < 2) {
- level.setBlock(pos, state.setValue(AGE, Integer.valueOf(ageValue + 1)), 2); - level.setBlock(pos, state.setValue(AGE, Integer.valueOf(ageValue + 1)), 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, pos, state.setValue(CocoaBlock.AGE, ageValue + 1), 2); // CraftBukkkit + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, pos, state.setValue(CocoaBlock.AGE, ageValue + 1), 2); // CraftBukkit
} }
} }
} }

View File

@ -1,11 +1,9 @@
package io.papermc.paper.registry.data; package io.papermc.paper.registry.data;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import io.papermc.paper.registry.PaperRegistryBuilder; import io.papermc.paper.registry.PaperRegistryBuilder;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import io.papermc.paper.registry.data.util.Checks; import io.papermc.paper.registry.data.util.Checks;
import io.papermc.paper.registry.data.util.Conversions; import io.papermc.paper.registry.data.util.Conversions;
import io.papermc.paper.registry.set.PaperRegistrySets; import io.papermc.paper.registry.set.PaperRegistrySets;
@ -189,7 +187,6 @@ public class PaperEnchantmentRegistryEntry implements EnchantmentRegistryEntry {
@Override @Override
public Builder anvilCost(final @Range(from = 0, to = Integer.MAX_VALUE) int anvilCost) { public Builder anvilCost(final @Range(from = 0, to = Integer.MAX_VALUE) int anvilCost) {
Preconditions.checkArgument(anvilCost >= 0, "anvilCost must be non-negative");
this.anvilCost = OptionalInt.of(asArgumentMin(anvilCost, "anvilCost", 0)); this.anvilCost = OptionalInt.of(asArgumentMin(anvilCost, "anvilCost", 0));
return this; return this;
} }

View File

@ -590,7 +590,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
e.getStringUUID() e.getStringUUID()
); );
} else { } else {
// Ensure player flag is not needed // Ensure misc flag is not needed
Preconditions.checkArgument( Preconditions.checkArgument(
nmsEntity.getType().canSerialize() || allowMiscSerialization, nmsEntity.getType().canSerialize() || allowMiscSerialization,
"Cannot serialize misc non-saveable entity %s(%s) without the MISC flag", "Cannot serialize misc non-saveable entity %s(%s) without the MISC flag",