#831: Add a standard of annotations for Minecraft experimental things and API

By: Doc <nachito94@msn.com>
Also-by: 2008Choco <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot
2023-04-07 09:41:58 +10:00
parent 0bf4318605
commit bec81a9aff
40 changed files with 559 additions and 36 deletions

View File

@@ -1,7 +1,9 @@
package org.bukkit.entity;
import org.bukkit.Material;
import org.bukkit.MinecraftExperimental;
import org.bukkit.TreeSpecies;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -141,9 +143,13 @@ public interface Boat extends Vehicle {
BIRCH(Material.BIRCH_PLANKS),
JUNGLE(Material.JUNGLE_PLANKS),
ACACIA(Material.ACACIA_PLANKS),
@MinecraftExperimental
@ApiStatus.Experimental
CHERRY(Material.CHERRY_PLANKS),
DARK_OAK(Material.DARK_OAK_PLANKS),
MANGROVE(Material.MANGROVE_PLANKS),
@MinecraftExperimental
@ApiStatus.Experimental
BAMBOO(Material.BAMBOO_PLANKS),
;

View File

@@ -1,8 +1,16 @@
package org.bukkit.entity;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Camel.
*
* @apiNote This entity is part of an experimental feature of Minecraft and
* hence subject to change.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface Camel extends AbstractHorse, Sittable {
/**

View File

@@ -19,6 +19,7 @@ import org.bukkit.metadata.Metadatable;
import org.bukkit.persistence.PersistentDataHolder;
import org.bukkit.util.BoundingBox;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -528,9 +529,9 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* will need to be called before the entity is visible to a given player.
*
* @param visible default visibility status
* @deprecated draft API
* @apiNote draft API
*/
@Deprecated
@ApiStatus.Experimental
public void setVisibleByDefault(boolean visible);
/**
@@ -541,9 +542,9 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* will need to be called before the entity is visible to a given player.
*
* @return default visibility status
* @deprecated draft API
* @apiNote draft API
*/
@Deprecated
@ApiStatus.Experimental
public boolean isVisibleByDefault();
/**

View File

@@ -6,6 +6,7 @@ import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Keyed;
import org.bukkit.Location;
import org.bukkit.MinecraftExperimental;
import org.bukkit.NamespacedKey;
import org.bukkit.Translatable;
import org.bukkit.World;
@@ -18,6 +19,7 @@ import org.bukkit.entity.minecart.SpawnerMinecart;
import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -278,10 +280,14 @@ public enum EntityType implements Keyed, Translatable {
FROG("frog", Frog.class, -1),
TADPOLE("tadpole", Tadpole.class, -1),
WARDEN("warden", Warden.class, -1),
@MinecraftExperimental
@ApiStatus.Experimental
CAMEL("camel", Camel.class, -1),
BLOCK_DISPLAY("block_display", BlockDisplay.class, -1),
INTERACTION("interaction", Interaction.class, -1),
ITEM_DISPLAY("item_display", ItemDisplay.class, -1),
@MinecraftExperimental
@ApiStatus.Experimental
SNIFFER("sniffer", Sniffer.class, -1),
TEXT_DISPLAY("text_display", TextDisplay.class, -1),
/**

View File

@@ -33,6 +33,7 @@ import org.bukkit.map.MapView;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.messaging.PluginMessageRecipient;
import org.bukkit.scoreboard.Scoreboard;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -959,9 +960,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param plugin Plugin that wants to hide the entity
* @param entity Entity to hide
* @deprecated draft API
* @apiNote draft API
*/
@Deprecated
@ApiStatus.Experimental
public void hideEntity(@NotNull Plugin plugin, @NotNull Entity entity);
/**
@@ -971,9 +972,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param plugin Plugin that wants to show the entity
* @param entity Entity to show
* @deprecated draft API
* @apiNote draft API
*/
@Deprecated
@ApiStatus.Experimental
public void showEntity(@NotNull Plugin plugin, @NotNull Entity entity);
/**
@@ -982,9 +983,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param entity Entity to check
* @return True if the provided entity is not being hidden from this
* player
* @deprecated draft API
* @apiNote draft API
*/
@Deprecated
@ApiStatus.Experimental
public boolean canSee(@NotNull Entity entity);
/**

View File

@@ -2,6 +2,7 @@ package org.bukkit.entity;
import java.util.Collection;
import org.bukkit.Location;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -9,15 +10,16 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a Sniffer.
*
* <b>Note: This entity is part of an experimental feature of Minecraft and
* hence subject to change.</b>
* @apiNote This entity is part of an experimental feature of Minecraft and
* hence subject to change.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface Sniffer extends Animals {
/**
* Gets the locations explored by the sniffer.
*
* <br>
* <b>Note:</b> the returned locations use sniffer's current world.
*
* @return a collection of locations
@@ -27,11 +29,10 @@ public interface Sniffer extends Animals {
/**
* Remove a location of the explored locations.
*
* <br>
* <b>Note:</b> the location must be in the sniffer's current world for this
* method to have any effect.
*
*
* @param location the location to remove
* @see #getExploredLocations()
*/
@@ -39,11 +40,10 @@ public interface Sniffer extends Animals {
/**
* Add a location to the explored locations.
*
* <br>
* <b>Note:</b> the location must be in the sniffer's current world for this
* method to have any effect.
*
*
* @param location the location to add
* @see #getExploredLocations()
*/

View File

@@ -7,7 +7,9 @@ import java.util.Set;
import java.util.UUID;
import org.bukkit.Keyed;
import org.bukkit.Location;
import org.bukkit.MinecraftExperimental;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -69,6 +71,8 @@ public final class MemoryKey<T> implements Keyed {
public static final MemoryKey<Location> LIKED_NOTEBLOCK_POSITION = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock"), Location.class);
public static final MemoryKey<Integer> LIKED_NOTEBLOCK_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock_cooldown_ticks"), Integer.class);
public static final MemoryKey<Integer> ITEM_PICKUP_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("item_pickup_cooldown_ticks"), Integer.class);
@MinecraftExperimental
@ApiStatus.Experimental
public static final MemoryKey<Location> SNIFFER_EXPLORED_POSITIONS = new MemoryKey<>(NamespacedKey.minecraft("sniffer_explored_positions"), Location.class);
/**