From 82854b7bd7e4f3adc4ffcd0a7fe1734458bdc7c9 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 28 Apr 2019 11:37:52 +1000 Subject: [PATCH] Add Override annotations where appropriate By: md_5 --- paper-api/src/main/java/org/bukkit/Color.java | 1 + .../src/main/java/org/bukkit/Location.java | 1 + .../main/java/org/bukkit/OfflinePlayer.java | 2 + .../java/org/bukkit/block/DoubleChest.java | 1 + .../org/bukkit/command/PluginCommand.java | 1 + .../org/bukkit/command/SimpleCommandMap.java | 8 +++ .../bukkit/configuration/Configuration.java | 1 + .../configuration/MemoryConfiguration.java | 5 ++ .../bukkit/configuration/MemorySection.java | 58 +++++++++++++++++++ .../conversations/ConversationFactory.java | 1 + .../ExactMatchConversationCanceller.java | 3 + .../InactivityConversationCanceller.java | 4 ++ ...anuallyAbandonedConversationCanceller.java | 3 + .../bukkit/conversations/MessagePrompt.java | 2 + .../conversations/NullConversationPrefix.java | 1 + .../PluginNameConversationPrefix.java | 1 + .../bukkit/conversations/StringPrompt.java | 1 + .../conversations/ValidatingPrompt.java | 2 + .../org/bukkit/entity/EnderDragonPart.java | 1 + .../main/java/org/bukkit/entity/Entity.java | 1 + .../main/java/org/bukkit/entity/Player.java | 1 + .../main/java/org/bukkit/entity/Vehicle.java | 2 + .../bukkit/event/block/BlockBreakEvent.java | 2 + .../bukkit/event/block/BlockBurnEvent.java | 2 + .../bukkit/event/block/BlockDamageEvent.java | 2 + .../event/block/BlockDispenseEvent.java | 2 + .../org/bukkit/event/block/BlockExpEvent.java | 1 + .../bukkit/event/block/BlockExplodeEvent.java | 2 + .../bukkit/event/block/BlockFadeEvent.java | 2 + .../bukkit/event/block/BlockFromToEvent.java | 2 + .../bukkit/event/block/BlockGrowEvent.java | 3 + .../bukkit/event/block/BlockIgniteEvent.java | 2 + .../bukkit/event/block/BlockPhysicsEvent.java | 2 + .../bukkit/event/block/BlockPistonEvent.java | 2 + .../bukkit/event/block/BlockPlaceEvent.java | 2 + .../bukkit/event/block/LeavesDecayEvent.java | 2 + .../org/bukkit/event/block/NotePlayEvent.java | 2 + .../bukkit/event/block/SignChangeEvent.java | 2 + .../event/enchantment/EnchantItemEvent.java | 2 + .../event/entity/CreeperPowerEvent.java | 2 + .../event/entity/EntityChangeBlockEvent.java | 2 + .../event/entity/EntityCombustEvent.java | 2 + .../event/entity/EntityCreatePortalEvent.java | 2 + .../event/entity/EntityDamageEvent.java | 2 + .../event/entity/EntityExplodeEvent.java | 2 + .../event/entity/EntityInteractEvent.java | 2 + .../event/entity/EntityPickupItemEvent.java | 2 + .../event/entity/EntityShootBowEvent.java | 2 + .../bukkit/event/entity/EntityTameEvent.java | 2 + .../event/entity/EntityTargetEvent.java | 2 + .../entity/EntityTargetLivingEntityEvent.java | 2 + .../event/entity/EntityTeleportEvent.java | 2 + .../event/entity/ExplosionPrimeEvent.java | 2 + .../event/entity/FoodLevelChangeEvent.java | 2 + .../bukkit/event/entity/HorseJumpEvent.java | 2 + .../bukkit/event/entity/ItemDespawnEvent.java | 2 + .../org/bukkit/event/entity/PigZapEvent.java | 2 + .../event/entity/PlayerLeashEntityEvent.java | 2 + .../event/entity/PotionSplashEvent.java | 2 + .../event/entity/ProjectileLaunchEvent.java | 2 + .../event/entity/SheepDyeWoolEvent.java | 2 + .../event/entity/SheepRegrowWoolEvent.java | 2 + .../bukkit/event/entity/SlimeSplitEvent.java | 2 + .../event/hanging/HangingBreakEvent.java | 2 + .../event/hanging/HangingPlaceEvent.java | 2 + .../org/bukkit/event/inventory/BrewEvent.java | 2 + .../event/inventory/FurnaceBurnEvent.java | 2 + .../inventory/InventoryCreativeEvent.java | 2 + .../inventory/InventoryInteractEvent.java | 2 + .../inventory/InventoryMoveItemEvent.java | 2 + .../event/inventory/InventoryOpenEvent.java | 2 + .../inventory/InventoryPickupItemEvent.java | 2 + .../event/player/AsyncPlayerChatEvent.java | 2 + .../player/PlayerAchievementAwardedEvent.java | 2 + .../event/player/PlayerAnimationEvent.java | 2 + .../event/player/PlayerBucketEvent.java | 2 + .../bukkit/event/player/PlayerChatEvent.java | 2 + .../player/PlayerCommandPreprocessEvent.java | 2 + .../event/player/PlayerDropItemEvent.java | 2 + .../event/player/PlayerEditBookEvent.java | 2 + .../bukkit/event/player/PlayerFishEvent.java | 2 + .../player/PlayerGameModeChangeEvent.java | 2 + .../player/PlayerInteractEntityEvent.java | 2 + .../event/player/PlayerInteractEvent.java | 1 + .../event/player/PlayerItemConsumeEvent.java | 2 + .../event/player/PlayerItemHeldEvent.java | 2 + .../bukkit/event/player/PlayerKickEvent.java | 2 + .../bukkit/event/player/PlayerMoveEvent.java | 2 + .../event/player/PlayerPickupItemEvent.java | 2 + .../event/player/PlayerShearEntityEvent.java | 2 + .../player/PlayerStatisticIncrementEvent.java | 2 + .../event/player/PlayerToggleFlightEvent.java | 2 + .../event/player/PlayerToggleSneakEvent.java | 2 + .../event/player/PlayerToggleSprintEvent.java | 2 + .../player/PlayerUnleashEntityEvent.java | 2 + .../event/player/PlayerVelocityEvent.java | 2 + .../event/vehicle/VehicleDamageEvent.java | 2 + .../event/vehicle/VehicleDestroyEvent.java | 2 + .../event/vehicle/VehicleEnterEvent.java | 2 + .../vehicle/VehicleEntityCollisionEvent.java | 2 + .../event/vehicle/VehicleExitEvent.java | 2 + .../event/weather/LightningStrikeEvent.java | 2 + .../event/weather/ThunderChangeEvent.java | 2 + .../event/weather/WeatherChangeEvent.java | 2 + .../bukkit/event/world/PortalCreateEvent.java | 2 + .../event/world/StructureGrowEvent.java | 2 + .../bukkit/event/world/WorldUnloadEvent.java | 2 + .../bukkit/help/GenericCommandHelpTopic.java | 1 + .../org/bukkit/help/HelpTopicComparator.java | 2 + .../java/org/bukkit/help/IndexHelpTopic.java | 2 + .../org/bukkit/inventory/BrewerInventory.java | 1 + .../inventory/DoubleChestInventory.java | 1 + .../bukkit/inventory/FurnaceInventory.java | 1 + .../java/org/bukkit/inventory/ItemStack.java | 1 + .../org/bukkit/inventory/PlayerInventory.java | 1 + .../org/bukkit/inventory/ShapedRecipe.java | 1 + .../org/bukkit/inventory/ShapelessRecipe.java | 1 + .../org/bukkit/inventory/meta/BookMeta.java | 1 + .../meta/EnchantmentStorageMeta.java | 1 + .../inventory/meta/FireworkEffectMeta.java | 1 + .../bukkit/inventory/meta/FireworkMeta.java | 1 + .../inventory/meta/LeatherArmorMeta.java | 1 + .../org/bukkit/inventory/meta/MapMeta.java | 1 + .../org/bukkit/inventory/meta/SkullMeta.java | 1 + .../meta/TropicalFishBucketMeta.java | 1 + .../main/java/org/bukkit/material/Banner.java | 3 + .../main/java/org/bukkit/material/Bed.java | 2 + .../main/java/org/bukkit/material/Button.java | 3 + .../java/org/bukkit/material/CocoaPlant.java | 3 + .../java/org/bukkit/material/Command.java | 1 + .../org/bukkit/material/DetectorRail.java | 1 + .../bukkit/material/DirectionalContainer.java | 2 + .../java/org/bukkit/material/Dispenser.java | 2 + .../main/java/org/bukkit/material/Door.java | 4 ++ .../main/java/org/bukkit/material/Dye.java | 2 + .../main/java/org/bukkit/material/Gate.java | 4 ++ .../main/java/org/bukkit/material/Ladder.java | 2 + .../main/java/org/bukkit/material/Lever.java | 3 + .../material/PistonExtensionMaterial.java | 3 + .../java/org/bukkit/material/PoweredRail.java | 1 + .../org/bukkit/material/PressurePlate.java | 1 + .../java/org/bukkit/material/Pumpkin.java | 2 + .../org/bukkit/material/RedstoneTorch.java | 1 + .../org/bukkit/material/RedstoneWire.java | 1 + .../main/java/org/bukkit/material/Sign.java | 3 + .../SimpleAttachableMaterialData.java | 1 + .../main/java/org/bukkit/material/Skull.java | 2 + .../main/java/org/bukkit/material/Stairs.java | 2 + .../main/java/org/bukkit/material/Torch.java | 2 + .../java/org/bukkit/material/TrapDoor.java | 4 ++ .../org/bukkit/material/TripwireHook.java | 3 + .../main/java/org/bukkit/material/Wool.java | 2 + .../bukkit/metadata/LazyMetadataValue.java | 2 + .../bukkit/metadata/MetadataValueAdapter.java | 9 +++ .../bukkit/permissions/PermissibleBase.java | 14 +++++ .../java/org/bukkit/plugin/PluginBase.java | 1 + .../plugin/RegisteredServiceProvider.java | 1 + .../bukkit/plugin/SimplePluginManager.java | 29 ++++++++++ .../bukkit/plugin/SimpleServicesManager.java | 10 ++++ .../bukkit/plugin/java/JavaPluginLoader.java | 7 +++ .../plugin/messaging/StandardMessenger.java | 19 ++++++ .../java/org/bukkit/potion/PotionEffect.java | 1 + .../java/org/bukkit/util/BlockIterator.java | 3 + .../src/main/java/org/bukkit/util/Vector.java | 1 + .../src/test/java/org/bukkit/TestServer.java | 7 +++ .../conversations/ConversationTest.java | 3 + .../bukkit/conversations/FakeConversable.java | 6 ++ .../conversations/ValidatingPromptTest.java | 4 ++ .../metadata/LazyMetadataValueTest.java | 5 ++ .../bukkit/metadata/MetadataStoreTest.java | 2 + .../metadata/MetadataValueAdapterTest.java | 2 + .../org/bukkit/plugin/PluginManagerTest.java | 4 ++ .../java/org/bukkit/plugin/TestPlugin.java | 20 +++++++ .../plugin/TimedRegisteredListenerTest.java | 1 + .../plugin/messaging/TestMessageListener.java | 1 + .../bukkit/plugin/messaging/TestPlayer.java | 1 + 176 files changed, 503 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Color.java b/paper-api/src/main/java/org/bukkit/Color.java index e7aa3d1b9e..78be0f3b9f 100644 --- a/paper-api/src/main/java/org/bukkit/Color.java +++ b/paper-api/src/main/java/org/bukkit/Color.java @@ -317,6 +317,7 @@ public final class Color implements ConfigurationSerializable { return asRGB() ^ Color.class.hashCode(); } + @Override @NotNull public Map serialize() { return ImmutableMap.of( diff --git a/paper-api/src/main/java/org/bukkit/Location.java b/paper-api/src/main/java/org/bukkit/Location.java index 39e57fe1dd..30f0e9298f 100644 --- a/paper-api/src/main/java/org/bukkit/Location.java +++ b/paper-api/src/main/java/org/bukkit/Location.java @@ -599,6 +599,7 @@ public class Location implements Cloneable, ConfigurationSerializable { return NumberConversions.floor(loc); } + @Override @Utility @NotNull public Map serialize() { diff --git a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java index 11eedda633..ffc8ad3733 100644 --- a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java +++ b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java @@ -25,6 +25,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return Player name or null if we have not seen a name for this player yet */ + @Override @Nullable public String getName(); @@ -33,6 +34,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return Player UUID */ + @Override @NotNull public UUID getUniqueId(); diff --git a/paper-api/src/main/java/org/bukkit/block/DoubleChest.java b/paper-api/src/main/java/org/bukkit/block/DoubleChest.java index 97153adfad..83a4642119 100644 --- a/paper-api/src/main/java/org/bukkit/block/DoubleChest.java +++ b/paper-api/src/main/java/org/bukkit/block/DoubleChest.java @@ -18,6 +18,7 @@ public class DoubleChest implements InventoryHolder { inventory = chest; } + @Override @NotNull public Inventory getInventory() { return inventory; diff --git a/paper-api/src/main/java/org/bukkit/command/PluginCommand.java b/paper-api/src/main/java/org/bukkit/command/PluginCommand.java index 30597d30ff..7f153000ee 100644 --- a/paper-api/src/main/java/org/bukkit/command/PluginCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/PluginCommand.java @@ -102,6 +102,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * * @return Plugin that owns this command */ + @Override @NotNull public Plugin getPlugin() { return owningPlugin; diff --git a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java index 906734ec1a..95bfced676 100644 --- a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -45,6 +45,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Override public void registerAll(@NotNull String fallbackPrefix, @NotNull List commands) { if (commands != null) { for (Command c : commands) { @@ -56,6 +57,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Override public boolean register(@NotNull String fallbackPrefix, @NotNull Command command) { return register(command.getName(), fallbackPrefix, command); } @@ -63,6 +65,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Override public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) { label = label.toLowerCase(java.util.Locale.ENGLISH).trim(); fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim(); @@ -125,6 +128,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Override public boolean dispatch(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException { String[] args = commandLine.split(" "); @@ -152,6 +156,7 @@ public class SimpleCommandMap implements CommandMap { return true; } + @Override public synchronized void clearCommands() { for (Map.Entry entry : knownCommands.entrySet()) { entry.getValue().unregister(this); @@ -160,17 +165,20 @@ public class SimpleCommandMap implements CommandMap { setDefaultCommands(); } + @Override @Nullable public Command getCommand(@NotNull String name) { Command target = knownCommands.get(name.toLowerCase(java.util.Locale.ENGLISH)); return target; } + @Override @Nullable public List tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine) { return tabComplete(sender, cmdLine, null); } + @Override @Nullable public List tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) { Validate.notNull(sender, "Sender cannot be null"); diff --git a/paper-api/src/main/java/org/bukkit/configuration/Configuration.java b/paper-api/src/main/java/org/bukkit/configuration/Configuration.java index cfa63e8fb7..f12a98b1be 100644 --- a/paper-api/src/main/java/org/bukkit/configuration/Configuration.java +++ b/paper-api/src/main/java/org/bukkit/configuration/Configuration.java @@ -22,6 +22,7 @@ public interface Configuration extends ConfigurationSection { * @param value Value to set the default to. * @throws IllegalArgumentException Thrown if path is null. */ + @Override public void addDefault(@NotNull String path, @Nullable Object value); /** diff --git a/paper-api/src/main/java/org/bukkit/configuration/MemoryConfiguration.java b/paper-api/src/main/java/org/bukkit/configuration/MemoryConfiguration.java index df1e076dc0..010a97fee2 100644 --- a/paper-api/src/main/java/org/bukkit/configuration/MemoryConfiguration.java +++ b/paper-api/src/main/java/org/bukkit/configuration/MemoryConfiguration.java @@ -41,6 +41,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration defaults.set(path, value); } + @Override public void addDefaults(@NotNull Map defaults) { Validate.notNull(defaults, "Defaults may not be null"); @@ -49,18 +50,21 @@ public class MemoryConfiguration extends MemorySection implements Configuration } } + @Override public void addDefaults(@NotNull Configuration defaults) { Validate.notNull(defaults, "Defaults may not be null"); addDefaults(defaults.getValues(true)); } + @Override public void setDefaults(@NotNull Configuration defaults) { Validate.notNull(defaults, "Defaults may not be null"); this.defaults = defaults; } + @Override @Nullable public Configuration getDefaults() { return defaults; @@ -72,6 +76,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration return null; } + @Override @NotNull public MemoryConfigurationOptions options() { if (options == null) { diff --git a/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java b/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java index 6fdd75e7b3..89ea0e5d79 100644 --- a/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java @@ -69,6 +69,7 @@ public class MemorySection implements ConfigurationSection { this.fullPath = createPath(parent, path); } + @Override @NotNull public Set getKeys(boolean deep) { Set result = new LinkedHashSet(); @@ -87,6 +88,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public Map getValues(boolean deep) { Map result = new LinkedHashMap(); @@ -105,14 +107,17 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override public boolean contains(@NotNull String path) { return contains(path, false); } + @Override public boolean contains(@NotNull String path, boolean ignoreDefault) { return ((ignoreDefault) ? get(path, null) : get(path)) != null; } + @Override public boolean isSet(@NotNull String path) { Configuration root = getRoot(); if (root == null) { @@ -124,26 +129,31 @@ public class MemorySection implements ConfigurationSection { return get(path, null) != null; } + @Override @NotNull public String getCurrentPath() { return fullPath; } + @Override @NotNull public String getName() { return path; } + @Override @Nullable public Configuration getRoot() { return root; } + @Override @Nullable public ConfigurationSection getParent() { return parent; } + @Override public void addDefault(@NotNull String path, @Nullable Object value) { Validate.notNull(path, "Path cannot be null"); @@ -157,6 +167,7 @@ public class MemorySection implements ConfigurationSection { root.addDefault(createPath(this, path), value); } + @Override @Nullable public ConfigurationSection getDefaultSection() { Configuration root = getRoot(); @@ -171,6 +182,7 @@ public class MemorySection implements ConfigurationSection { return null; } + @Override public void set(@NotNull String path, @Nullable Object value) { Validate.notEmpty(path, "Cannot set to an empty path"); @@ -210,11 +222,13 @@ public class MemorySection implements ConfigurationSection { } } + @Override @Nullable public Object get(@NotNull String path) { return get(path, getDefault(path)); } + @Override @Nullable public Object get(@NotNull String path, @Nullable Object def) { Validate.notNull(path, "Path cannot be null"); @@ -248,6 +262,7 @@ public class MemorySection implements ConfigurationSection { return section.get(key, def); } + @Override @NotNull public ConfigurationSection createSection(@NotNull String path) { Validate.notEmpty(path, "Cannot create section at empty path"); @@ -280,6 +295,7 @@ public class MemorySection implements ConfigurationSection { return section.createSection(key); } + @Override @NotNull public ConfigurationSection createSection(@NotNull String path, @NotNull Map map) { ConfigurationSection section = createSection(path); @@ -296,101 +312,120 @@ public class MemorySection implements ConfigurationSection { } // Primitives + @Override @Nullable public String getString(@NotNull String path) { Object def = getDefault(path); return getString(path, def != null ? def.toString() : null); } + @Override @Nullable public String getString(@NotNull String path, @Nullable String def) { Object val = get(path, def); return (val != null) ? val.toString() : def; } + @Override public boolean isString(@NotNull String path) { Object val = get(path); return val instanceof String; } + @Override public int getInt(@NotNull String path) { Object def = getDefault(path); return getInt(path, (def instanceof Number) ? toInt(def) : 0); } + @Override public int getInt(@NotNull String path, int def) { Object val = get(path, def); return (val instanceof Number) ? toInt(val) : def; } + @Override public boolean isInt(@NotNull String path) { Object val = get(path); return val instanceof Integer; } + @Override public boolean getBoolean(@NotNull String path) { Object def = getDefault(path); return getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false); } + @Override public boolean getBoolean(@NotNull String path, boolean def) { Object val = get(path, def); return (val instanceof Boolean) ? (Boolean) val : def; } + @Override public boolean isBoolean(@NotNull String path) { Object val = get(path); return val instanceof Boolean; } + @Override public double getDouble(@NotNull String path) { Object def = getDefault(path); return getDouble(path, (def instanceof Number) ? toDouble(def) : 0); } + @Override public double getDouble(@NotNull String path, double def) { Object val = get(path, def); return (val instanceof Number) ? toDouble(val) : def; } + @Override public boolean isDouble(@NotNull String path) { Object val = get(path); return val instanceof Double; } + @Override public long getLong(@NotNull String path) { Object def = getDefault(path); return getLong(path, (def instanceof Number) ? toLong(def) : 0); } + @Override public long getLong(@NotNull String path, long def) { Object val = get(path, def); return (val instanceof Number) ? toLong(val) : def; } + @Override public boolean isLong(@NotNull String path) { Object val = get(path); return val instanceof Long; } // Java + @Override @Nullable public List getList(@NotNull String path) { Object def = getDefault(path); return getList(path, (def instanceof List) ? (List) def : null); } + @Override @Nullable public List getList(@NotNull String path, @Nullable List def) { Object val = get(path, def); return (List) ((val instanceof List) ? val : def); } + @Override public boolean isList(@NotNull String path) { Object val = get(path); return val instanceof List; } + @Override @NotNull public List getStringList(@NotNull String path) { List list = getList(path); @@ -410,6 +445,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getIntegerList(@NotNull String path) { List list = getList(path); @@ -438,6 +474,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getBooleanList(@NotNull String path) { List list = getList(path); @@ -463,6 +500,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getDoubleList(@NotNull String path) { List list = getList(path); @@ -491,6 +529,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getFloatList(@NotNull String path) { List list = getList(path); @@ -519,6 +558,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getLongList(@NotNull String path) { List list = getList(path); @@ -547,6 +587,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getByteList(@NotNull String path) { List list = getList(path); @@ -575,6 +616,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getCharacterList(@NotNull String path) { List list = getList(path); @@ -602,6 +644,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List getShortList(@NotNull String path) { List list = getList(path); @@ -630,6 +673,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Override @NotNull public List> getMapList(@NotNull String path) { List list = getList(path); @@ -677,62 +721,75 @@ public class MemorySection implements ConfigurationSection { return getObject(path, clazz, def); } + @Override @Nullable public Vector getVector(@NotNull String path) { return getSerializable(path, Vector.class); } + @Override @Nullable public Vector getVector(@NotNull String path, @Nullable Vector def) { return getSerializable(path, Vector.class, def); } + @Override public boolean isVector(@NotNull String path) { return getSerializable(path, Vector.class) != null; } + @Override @Nullable public OfflinePlayer getOfflinePlayer(@NotNull String path) { return getSerializable(path, OfflinePlayer.class); } + @Override @Nullable public OfflinePlayer getOfflinePlayer(@NotNull String path, @Nullable OfflinePlayer def) { return getSerializable(path, OfflinePlayer.class, def); } + @Override public boolean isOfflinePlayer(@NotNull String path) { return getSerializable(path, OfflinePlayer.class) != null; } + @Override @Nullable public ItemStack getItemStack(@NotNull String path) { return getSerializable(path, ItemStack.class); } + @Override @Nullable public ItemStack getItemStack(@NotNull String path, @Nullable ItemStack def) { return getSerializable(path, ItemStack.class, def); } + @Override public boolean isItemStack(@NotNull String path) { return getSerializable(path, ItemStack.class) != null; } + @Override @Nullable public Color getColor(@NotNull String path) { return getSerializable(path, Color.class); } + @Override @Nullable public Color getColor(@NotNull String path, @Nullable Color def) { return getSerializable(path, Color.class, def); } + @Override public boolean isColor(@NotNull String path) { return getSerializable(path, Color.class) != null; } + @Override @Nullable public ConfigurationSection getConfigurationSection(@NotNull String path) { Object val = get(path, null); @@ -744,6 +801,7 @@ public class MemorySection implements ConfigurationSection { return (val instanceof ConfigurationSection) ? createSection(path) : null; } + @Override public boolean isConfigurationSection(@NotNull String path) { Object val = get(path); return val instanceof ConfigurationSection; diff --git a/paper-api/src/main/java/org/bukkit/conversations/ConversationFactory.java b/paper-api/src/main/java/org/bukkit/conversations/ConversationFactory.java index ec8129def4..58009e1e7a 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/ConversationFactory.java +++ b/paper-api/src/main/java/org/bukkit/conversations/ConversationFactory.java @@ -225,6 +225,7 @@ public class ConversationFactory { private class NotPlayerMessagePrompt extends MessagePrompt { + @Override @NotNull public String getPromptText(@NotNull ConversationContext context) { return playerOnlyMessage; diff --git a/paper-api/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java b/paper-api/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java index 2eeae26b36..6b54ee877a 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java +++ b/paper-api/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java @@ -19,12 +19,15 @@ public class ExactMatchConversationCanceller implements ConversationCanceller { this.escapeSequence = escapeSequence; } + @Override public void setConversation(@NotNull Conversation conversation) {} + @Override public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) { return input.equals(escapeSequence); } + @Override @NotNull public ConversationCanceller clone() { return new ExactMatchConversationCanceller(escapeSequence); diff --git a/paper-api/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java b/paper-api/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java index cfe2b69f68..fd8daa0206 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java +++ b/paper-api/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java @@ -24,11 +24,13 @@ public class InactivityConversationCanceller implements ConversationCanceller { this.timeoutSeconds = timeoutSeconds; } + @Override public void setConversation(@NotNull Conversation conversation) { this.conversation = conversation; startTimer(); } + @Override public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) { // Reset the inactivity timer stopTimer(); @@ -36,6 +38,7 @@ public class InactivityConversationCanceller implements ConversationCanceller { return false; } + @Override @NotNull public ConversationCanceller clone() { return new InactivityConversationCanceller(plugin, timeoutSeconds); @@ -46,6 +49,7 @@ public class InactivityConversationCanceller implements ConversationCanceller { */ private void startTimer() { taskId = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { + @Override public void run() { if (conversation.getState() == Conversation.ConversationState.UNSTARTED) { startTimer(); diff --git a/paper-api/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java b/paper-api/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java index 2c351a0651..0a289564a5 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java +++ b/paper-api/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java @@ -8,14 +8,17 @@ import org.jetbrains.annotations.NotNull; * abandoned by programmatically calling the abandon() method on it. */ public class ManuallyAbandonedConversationCanceller implements ConversationCanceller { + @Override public void setConversation(@NotNull Conversation conversation) { throw new UnsupportedOperationException(); } + @Override public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) { throw new UnsupportedOperationException(); } + @Override @NotNull public ConversationCanceller clone() { throw new UnsupportedOperationException(); diff --git a/paper-api/src/main/java/org/bukkit/conversations/MessagePrompt.java b/paper-api/src/main/java/org/bukkit/conversations/MessagePrompt.java index 69b19b9204..e066166e5d 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/MessagePrompt.java +++ b/paper-api/src/main/java/org/bukkit/conversations/MessagePrompt.java @@ -19,6 +19,7 @@ public abstract class MessagePrompt implements Prompt { * @param context Context information about the conversation. * @return Always false. */ + @Override public boolean blocksForInput(@NotNull ConversationContext context) { return false; } @@ -31,6 +32,7 @@ public abstract class MessagePrompt implements Prompt { * @param input Ignored. * @return The next prompt in the prompt graph. */ + @Override @Nullable public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) { return getNextPrompt(context); diff --git a/paper-api/src/main/java/org/bukkit/conversations/NullConversationPrefix.java b/paper-api/src/main/java/org/bukkit/conversations/NullConversationPrefix.java index ce1b20cdea..6ee8ebb1e5 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/NullConversationPrefix.java +++ b/paper-api/src/main/java/org/bukkit/conversations/NullConversationPrefix.java @@ -14,6 +14,7 @@ public class NullConversationPrefix implements ConversationPrefix { * @param context Context information about the conversation. * @return An empty string. */ + @Override @NotNull public String getPrefix(@NotNull ConversationContext context) { return ""; diff --git a/paper-api/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java b/paper-api/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java index 28443b6abe..5911944fe2 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java +++ b/paper-api/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java @@ -34,6 +34,7 @@ public class PluginNameConversationPrefix implements ConversationPrefix { * @param context Context information about the conversation. * @return An empty string. */ + @Override @NotNull public String getPrefix(@NotNull ConversationContext context) { return cachedPrefix; diff --git a/paper-api/src/main/java/org/bukkit/conversations/StringPrompt.java b/paper-api/src/main/java/org/bukkit/conversations/StringPrompt.java index 89efb9131d..f9b86d6d5b 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/StringPrompt.java +++ b/paper-api/src/main/java/org/bukkit/conversations/StringPrompt.java @@ -14,6 +14,7 @@ public abstract class StringPrompt implements Prompt { * @param context Context information about the conversation. * @return True. */ + @Override public boolean blocksForInput(@NotNull ConversationContext context) { return true; } diff --git a/paper-api/src/main/java/org/bukkit/conversations/ValidatingPrompt.java b/paper-api/src/main/java/org/bukkit/conversations/ValidatingPrompt.java index 3ecfa59a45..c57b6cb479 100644 --- a/paper-api/src/main/java/org/bukkit/conversations/ValidatingPrompt.java +++ b/paper-api/src/main/java/org/bukkit/conversations/ValidatingPrompt.java @@ -23,6 +23,7 @@ public abstract class ValidatingPrompt implements Prompt { * @param input The input text from the user. * @return This prompt or the next Prompt in the prompt graph. */ + @Override @Nullable public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) { if (isInputValid(context, input)) { @@ -43,6 +44,7 @@ public abstract class ValidatingPrompt implements Prompt { * @param context Context information about the conversation. * @return True. */ + @Override public boolean blocksForInput(@NotNull ConversationContext context) { return true; } diff --git a/paper-api/src/main/java/org/bukkit/entity/EnderDragonPart.java b/paper-api/src/main/java/org/bukkit/entity/EnderDragonPart.java index 77fc93378e..d0ac89bab1 100644 --- a/paper-api/src/main/java/org/bukkit/entity/EnderDragonPart.java +++ b/paper-api/src/main/java/org/bukkit/entity/EnderDragonPart.java @@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull; * Represents an ender dragon part */ public interface EnderDragonPart extends ComplexEntityPart, Damageable { + @Override @NotNull public EnderDragon getParent(); } diff --git a/paper-api/src/main/java/org/bukkit/entity/Entity.java b/paper-api/src/main/java/org/bukkit/entity/Entity.java index 0d38a47702..cd6642f5a3 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Entity.java +++ b/paper-api/src/main/java/org/bukkit/entity/Entity.java @@ -223,6 +223,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent * * @return Server instance running this Entity */ + @Override @NotNull public Server getServer(); diff --git a/paper-api/src/main/java/org/bukkit/entity/Player.java b/paper-api/src/main/java/org/bukkit/entity/Player.java index ab9045e2e7..c55abad87c 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Player.java +++ b/paper-api/src/main/java/org/bukkit/entity/Player.java @@ -138,6 +138,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * @param message Message to be displayed */ + @Override public void sendRawMessage(@NotNull String message); /** diff --git a/paper-api/src/main/java/org/bukkit/entity/Vehicle.java b/paper-api/src/main/java/org/bukkit/entity/Vehicle.java index c73ee6cbd1..771a27304e 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Vehicle.java +++ b/paper-api/src/main/java/org/bukkit/entity/Vehicle.java @@ -13,6 +13,7 @@ public interface Vehicle extends Entity { * * @return velocity vector */ + @Override @NotNull public Vector getVelocity(); @@ -21,5 +22,6 @@ public interface Vehicle extends Entity { * * @param vel velocity vector */ + @Override public void setVelocity(@NotNull Vector vel); } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockBreakEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockBreakEvent.java index ef5048ef1a..c05cd9cadc 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockBreakEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockBreakEvent.java @@ -66,10 +66,12 @@ public class BlockBreakEvent extends BlockExpEvent implements Cancellable { return this.dropItems; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java index 3fc9c57163..c0c38df368 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockBurnEvent.java @@ -38,10 +38,12 @@ public class BlockBurnEvent extends BlockEvent implements Cancellable { return ignitingBlock; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockDamageEvent.java index 9fbe23ab24..f70871e1ae 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockDamageEvent.java @@ -67,10 +67,12 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable { return itemstack; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java index 23c428d2db..6e8be28f6b 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java @@ -68,10 +68,12 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable { velocity = vel; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockExpEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockExpEvent.java index c5d9bf3c27..21b9026552 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockExpEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockExpEvent.java @@ -36,6 +36,7 @@ public class BlockExpEvent extends BlockEvent { this.exp = exp; } + @Override @NotNull public HandlerList getHandlers() { return handlers; diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java index 2b9816d327..44f7f6939a 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java @@ -22,10 +22,12 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable { this.cancel = false; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockFadeEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockFadeEvent.java index 844dc823fa..362643de40 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockFadeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockFadeEvent.java @@ -44,10 +44,12 @@ public class BlockFadeEvent extends BlockEvent implements Cancellable { return newState; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockFromToEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockFromToEvent.java index 2fb4a214a9..1af3928056 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockFromToEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockFromToEvent.java @@ -55,10 +55,12 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable { return to; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockGrowEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockGrowEvent.java index d3679795aa..73d5375d2f 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockGrowEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockGrowEvent.java @@ -41,14 +41,17 @@ public class BlockGrowEvent extends BlockEvent implements Cancellable { return newState; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } + @Override @NotNull public HandlerList getHandlers() { return handlers; diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java index 5dc2bc1f5b..8aecadef01 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java @@ -37,10 +37,12 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { this.cancel = false; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java index aabbcbb0b1..e3a5f5824e 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java @@ -64,10 +64,12 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { return changed.getMaterial(); } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockPistonEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockPistonEvent.java index 47191c8f25..2cdf2919e7 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockPistonEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockPistonEvent.java @@ -18,10 +18,12 @@ public abstract class BlockPistonEvent extends BlockEvent implements Cancellable this.direction = direction; } + @Override public boolean isCancelled() { return this.cancelled; } + @Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java index 586e3c8edc..be0a2d1f23 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java @@ -40,10 +40,12 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { cancel = false; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java b/paper-api/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java index 538e4246cc..c33f9cb803 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java @@ -18,10 +18,12 @@ public class LeavesDecayEvent extends BlockEvent implements Cancellable { super(block); } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/NotePlayEvent.java b/paper-api/src/main/java/org/bukkit/event/block/NotePlayEvent.java index ad8b89e2bd..a3887067d1 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/NotePlayEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/NotePlayEvent.java @@ -24,10 +24,12 @@ public class NotePlayEvent extends BlockEvent implements Cancellable { this.note = note; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/paper-api/src/main/java/org/bukkit/event/block/SignChangeEvent.java index 8b78d4de5c..7190db11ef 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/SignChangeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/SignChangeEvent.java @@ -70,10 +70,12 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { lines[index] = line; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java b/paper-api/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java index 59d46b52a0..4ab67a55e4 100644 --- a/paper-api/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java @@ -106,10 +106,12 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { return button; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java index 5828a52b15..4295baf51e 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java @@ -28,10 +28,12 @@ public class CreeperPowerEvent extends EntityEvent implements Cancellable { this.cause = cause; } + @Override public boolean isCancelled() { return canceled; } + @Override public void setCancelled(boolean cancel) { canceled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java index 62fba99a09..e79fc76bbe 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java @@ -34,10 +34,12 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { return block; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java index 4b4c7bb524..eea9aa7bf1 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java @@ -21,10 +21,12 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable { this.cancel = false; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java index 4de0983410..35cae8978b 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java @@ -40,10 +40,12 @@ public class EntityCreatePortalEvent extends EntityEvent implements Cancellable return blocks; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index b5d8a34c6f..4d1b4d1f80 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -43,10 +43,12 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { this.modifierFunctions = modifierFunctions; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java index a483f385c7..10d0e18dfd 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java @@ -26,10 +26,12 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { this.cancel = false; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java index 97ef2481de..e2c0cb3393 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java @@ -19,10 +19,12 @@ public class EntityInteractEvent extends EntityEvent implements Cancellable { this.block = block; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java index b583accbb5..c866df03d6 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java @@ -46,10 +46,12 @@ public class EntityPickupItemEvent extends EntityEvent implements Cancellable { return remaining; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java index ec12b57e44..18c5e31abc 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java @@ -69,10 +69,12 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { return force; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityTameEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityTameEvent.java index 0698fa6939..c410b48c2f 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityTameEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityTameEvent.java @@ -25,10 +25,12 @@ public class EntityTameEvent extends EntityEvent implements Cancellable { return (LivingEntity) entity; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java index db667785b0..2946ee3fc5 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java @@ -21,10 +21,12 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable { this.reason = reason; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java index f309986f36..6fe47c8ccd 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java @@ -14,6 +14,7 @@ public class EntityTargetLivingEntityEvent extends EntityTargetEvent{ super(entity, target, reason); } + @Override @Nullable public LivingEntity getTarget() { return (LivingEntity) super.getTarget(); @@ -29,6 +30,7 @@ public class EntityTargetLivingEntityEvent extends EntityTargetEvent{ * * @param target The entity to target */ + @Override public void setTarget(@Nullable Entity target) { if (target == null || target instanceof LivingEntity) { super.setTarget(target); diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java index 6d62a03f21..a7918049ae 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java @@ -26,10 +26,12 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable { this.cancel = false; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java index 31fdb30144..6db5dad719 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java @@ -26,10 +26,12 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { this(explosive, explosive.getYield(), explosive.isIncendiary()); } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java index f5b9906124..221cf69837 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java @@ -49,10 +49,12 @@ public class FoodLevelChangeEvent extends EntityEvent implements Cancellable { this.level = level; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java index d38cc3cb09..65b1ddb2b2 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java @@ -18,6 +18,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable { this.power = power; } + @Override public boolean isCancelled() { return cancelled; } @@ -25,6 +26,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable { /** * @deprecated horse jumping was moved client side. */ + @Override @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; diff --git a/paper-api/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java index 93e6f5ee7f..6fc66197eb 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java @@ -23,10 +23,12 @@ public class ItemDespawnEvent extends EntityEvent implements Cancellable { location = loc; } + @Override public boolean isCancelled() { return canceled; } + @Override public void setCancelled(boolean cancel) { canceled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/PigZapEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/PigZapEvent.java index 0074423fd3..0e0ed93b56 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/PigZapEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/PigZapEvent.java @@ -24,10 +24,12 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable { this.pigzombie = pigzombie; } + @Override public boolean isCancelled() { return canceled; } + @Override public void setCancelled(boolean cancel) { canceled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java index e087e1418b..cbf0c736b7 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java @@ -64,10 +64,12 @@ public class PlayerLeashEntityEvent extends Event implements Cancellable { return handlers; } + @Override public boolean isCancelled() { return this.cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java index 17b49300e5..90d7e8141a 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java @@ -78,10 +78,12 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable } } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java index f7a4bc4bd8..c5fc3c5584 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java @@ -15,10 +15,12 @@ public class ProjectileLaunchEvent extends EntitySpawnEvent implements Cancellab super(what); } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java index 60c648ee6a..4db826e4db 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java @@ -20,10 +20,12 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable { this.color = color; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java index 428ca4c9c2..05264b31ad 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java @@ -17,10 +17,12 @@ public class SheepRegrowWoolEvent extends EntityEvent implements Cancellable { this.cancel = false; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java index ea69522667..02b659847c 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java @@ -18,10 +18,12 @@ public class SlimeSplitEvent extends EntityEvent implements Cancellable { this.count = count; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java b/paper-api/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java index 8c43c890e0..16d8196e1f 100644 --- a/paper-api/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java @@ -28,10 +28,12 @@ public class HangingBreakEvent extends HangingEvent implements Cancellable { return cause; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java b/paper-api/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java index 8ce33024fa..959b9f3fb4 100644 --- a/paper-api/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java @@ -56,10 +56,12 @@ public class HangingPlaceEvent extends HangingEvent implements Cancellable { return blockFace; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java index 140fc92081..8fbfad91b0 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java @@ -42,10 +42,12 @@ public class BrewEvent extends BlockEvent implements Cancellable { return fuelLevel; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java index 46a67e6711..bc71bc2d3a 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java @@ -71,10 +71,12 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable { this.burning = burning; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java index bc1e13b761..9c6db8be46 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java @@ -18,11 +18,13 @@ public class InventoryCreativeEvent extends InventoryClickEvent { this.item = newItem; } + @Override @NotNull public ItemStack getCursor() { return item; } + @Override public void setCursor(@NotNull ItemStack item) { this.item = item; } diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java index b75b184df2..707b4381e3 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java @@ -59,6 +59,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C * * @return whether the event is cancelled */ + @Override public boolean isCancelled() { return getResult() == Result.DENY; } @@ -72,6 +73,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C * * @param toCancel result becomes DENY if true, ALLOW if false */ + @Override public void setCancelled(boolean toCancel) { setResult(toCancel ? Result.DENY : Result.ALLOW); } diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java index 2bb57d2342..a8c48f5a41 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java @@ -94,10 +94,12 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { return didSourceInitiate ? sourceInventory : destinationInventory; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java index 946e346042..9013d04350 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java @@ -37,6 +37,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable { * * @return true if this event is cancelled */ + @Override public boolean isCancelled() { return cancelled; } @@ -50,6 +51,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable { * * @param cancel true if you wish to cancel this event */ + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java index b761c0224c..1ffac4d58e 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java @@ -42,10 +42,12 @@ public class InventoryPickupItemEvent extends Event implements Cancellable { return item; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java b/paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java index dadd20d9a9..ab129b0588 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java @@ -124,10 +124,12 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { return recipients; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java index fae6a901bd..07fa439a4f 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java @@ -30,10 +30,12 @@ public class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancel return achievement; } + @Override public boolean isCancelled() { return isCancelled; } + @Override public void setCancelled(boolean cancel) { this.isCancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java index 4affca1275..6cd236cd1f 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java @@ -35,10 +35,12 @@ public class PlayerAnimationEvent extends PlayerEvent implements Cancellable { return animationType; } + @Override public boolean isCancelled() { return this.isCancelled; } + @Override public void setCancelled(boolean cancel) { this.isCancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java index d0ccba0603..d2990a20d7 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java @@ -76,10 +76,12 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab return blockFace; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java index da2e54f699..26966167bc 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java @@ -42,10 +42,12 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { this.recipients = recipients; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java index 2efc885bc4..a6dae91073 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java @@ -63,10 +63,12 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell this.message = message; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java index 4ac31e1228..aca500f32e 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java @@ -29,10 +29,12 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable { return drop; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java index 44e62e61b6..c8fda418bd 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java @@ -122,10 +122,12 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { return handlers; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java index 3ee819ee2e..4d3ff7b293 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java @@ -50,10 +50,12 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { return hookEntity; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java index 020faee1cc..4b96e0573c 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java @@ -19,10 +19,12 @@ public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellabl this.newGameMode = newGameMode; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java index c4406610fe..1d3d62969c 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java @@ -26,10 +26,12 @@ public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellabl this.hand = hand; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java index 6708c564f8..1208e1f8c2 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java @@ -88,6 +88,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @param cancel true if you wish to cancel this event */ + @Override public void setCancelled(boolean cancel) { setUseInteractedBlock(cancel ? Result.DENY : useInteractedBlock() == Result.DENY ? Result.DEFAULT : useInteractedBlock()); setUseItemInHand(cancel ? Result.DENY : useItemInHand() == Result.DENY ? Result.DEFAULT : useItemInHand()); diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java index ee0f95b109..c2793f3ef0 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java @@ -58,10 +58,12 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { } } + @Override public boolean isCancelled() { return this.isCancelled; } + @Override public void setCancelled(boolean cancel) { this.isCancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java index d5100d8fec..39048573a5 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java @@ -38,10 +38,12 @@ public class PlayerItemHeldEvent extends PlayerEvent implements Cancellable { return current; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerKickEvent.java index fa1105f4e9..14c337f15f 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerKickEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerKickEvent.java @@ -41,10 +41,12 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { return leaveMessage; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java index 8b90184517..1b2267f4e8 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java @@ -33,6 +33,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @return true if this event is cancelled */ + @Override public boolean isCancelled() { return cancel; } @@ -47,6 +48,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @param cancel true if you wish to cancel this event */ + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java index c7599116f8..951ea2cc76 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java @@ -45,10 +45,12 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { return remaining; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java index 8743491389..93429c5339 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java @@ -20,10 +20,12 @@ public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable { this.what = what; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java index ae7d0e6e3b..f971844bf4 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java @@ -102,10 +102,12 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel return material; } + @Override public boolean isCancelled() { return isCancelled; } + @Override public void setCancelled(boolean cancel) { this.isCancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java index 3e53cf9c4f..9c200f8aca 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java @@ -27,10 +27,12 @@ public class PlayerToggleFlightEvent extends PlayerEvent implements Cancellable return isFlying; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java index 68d902ae28..348e5b5e50 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java @@ -27,10 +27,12 @@ public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable { return isSneaking; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java index 3b84960d6d..dc8cf2197c 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java @@ -27,10 +27,12 @@ public class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable return isSprinting; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java index e2672aac19..cf78950b56 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java @@ -28,10 +28,12 @@ public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Canc return player; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java index c081c03ee8..dee4a8e6fe 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java @@ -19,10 +19,12 @@ public class PlayerVelocityEvent extends PlayerEvent implements Cancellable { this.velocity = velocity; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java index ced91e4e4b..45da51d594 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java @@ -50,10 +50,12 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { this.damage = damage; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java index 2ee6ffd0f8..26bc6898fc 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java @@ -32,10 +32,12 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable { return attacker; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java index 066992f0af..64f21f6849 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java @@ -29,10 +29,12 @@ public class VehicleEnterEvent extends VehicleEvent implements Cancellable { return entered; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java index 235c687277..6bafc62e22 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java @@ -26,10 +26,12 @@ public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implement return entity; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java index 69c9e499af..963b9ead4c 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java @@ -29,10 +29,12 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable { return exited; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java b/paper-api/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java index 45f26a7b3e..418f9391d8 100644 --- a/paper-api/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java @@ -26,10 +26,12 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable { this.cause = cause; } + @Override public boolean isCancelled() { return canceled; } + @Override public void setCancelled(boolean cancel) { canceled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java b/paper-api/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java index 641769dfea..6cdf83476b 100644 --- a/paper-api/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java @@ -18,10 +18,12 @@ public class ThunderChangeEvent extends WeatherEvent implements Cancellable { this.to = to; } + @Override public boolean isCancelled() { return canceled; } + @Override public void setCancelled(boolean cancel) { canceled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java b/paper-api/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java index db19e79090..d562d87e74 100644 --- a/paper-api/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java @@ -18,10 +18,12 @@ public class WeatherChangeEvent extends WeatherEvent implements Cancellable { this.to = to; } + @Override public boolean isCancelled() { return canceled; } + @Override public void setCancelled(boolean cancel) { canceled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/world/PortalCreateEvent.java b/paper-api/src/main/java/org/bukkit/event/world/PortalCreateEvent.java index 6e6ee66a51..e61558e9c9 100644 --- a/paper-api/src/main/java/org/bukkit/event/world/PortalCreateEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/world/PortalCreateEvent.java @@ -34,10 +34,12 @@ public class PortalCreateEvent extends WorldEvent implements Cancellable { return this.blocks; } + @Override public boolean isCancelled() { return cancel; } + @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/world/StructureGrowEvent.java b/paper-api/src/main/java/org/bukkit/event/world/StructureGrowEvent.java index 578337699a..7af8d6e51c 100644 --- a/paper-api/src/main/java/org/bukkit/event/world/StructureGrowEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/world/StructureGrowEvent.java @@ -83,10 +83,12 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable { return blocks; } + @Override public boolean isCancelled() { return cancelled; } + @Override public void setCancelled(boolean cancel) { cancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java b/paper-api/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java index d1cb72116c..8eeeada870 100644 --- a/paper-api/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java @@ -16,10 +16,12 @@ public class WorldUnloadEvent extends WorldEvent implements Cancellable { super(world); } + @Override public boolean isCancelled() { return this.isCancelled; } + @Override public void setCancelled(boolean cancel) { this.isCancelled = cancel; } diff --git a/paper-api/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java b/paper-api/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java index 3e103efd90..1d862c23d4 100644 --- a/paper-api/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java +++ b/paper-api/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java @@ -59,6 +59,7 @@ public class GenericCommandHelpTopic extends HelpTopic { fullText = sb.toString(); } + @Override public boolean canSee(@NotNull CommandSender sender) { if (!command.isRegistered()) { // Unregistered commands should not show up in the help diff --git a/paper-api/src/main/java/org/bukkit/help/HelpTopicComparator.java b/paper-api/src/main/java/org/bukkit/help/HelpTopicComparator.java index 2ec9333351..75bb69283f 100644 --- a/paper-api/src/main/java/org/bukkit/help/HelpTopicComparator.java +++ b/paper-api/src/main/java/org/bukkit/help/HelpTopicComparator.java @@ -26,6 +26,7 @@ public final class HelpTopicComparator implements Comparator { private HelpTopicComparator() {} + @Override public int compare(@NotNull HelpTopic lhs, @NotNull HelpTopic rhs) { return tnc.compare(lhs.getName(), rhs.getName()); } @@ -33,6 +34,7 @@ public final class HelpTopicComparator implements Comparator { public static final class TopicNameComparator implements Comparator { private TopicNameComparator(){} + @Override public int compare(@NotNull String lhs, @NotNull String rhs) { boolean lhsStartSlash = lhs.startsWith("/"); boolean rhsStartSlash = rhs.startsWith("/"); diff --git a/paper-api/src/main/java/org/bukkit/help/IndexHelpTopic.java b/paper-api/src/main/java/org/bukkit/help/IndexHelpTopic.java index 150c4272cc..88a812d66b 100644 --- a/paper-api/src/main/java/org/bukkit/help/IndexHelpTopic.java +++ b/paper-api/src/main/java/org/bukkit/help/IndexHelpTopic.java @@ -44,6 +44,7 @@ public class IndexHelpTopic extends HelpTopic { this.allTopics = topics; } + @Override public boolean canSee(@NotNull CommandSender sender) { if (sender instanceof ConsoleCommandSender) { return true; @@ -59,6 +60,7 @@ public class IndexHelpTopic extends HelpTopic { permission = amendedPermission; } + @Override @NotNull public String getFullText(@NotNull CommandSender sender) { StringBuilder sb = new StringBuilder(); diff --git a/paper-api/src/main/java/org/bukkit/inventory/BrewerInventory.java b/paper-api/src/main/java/org/bukkit/inventory/BrewerInventory.java index df45423e66..d8a52b59e9 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/BrewerInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/BrewerInventory.java @@ -40,6 +40,7 @@ public interface BrewerInventory extends Inventory { */ void setFuel(@Nullable ItemStack fuel); + @Override @Nullable BrewingStand getHolder(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/DoubleChestInventory.java b/paper-api/src/main/java/org/bukkit/inventory/DoubleChestInventory.java index ca18cc8afb..6d0067cbc3 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/DoubleChestInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/DoubleChestInventory.java @@ -25,6 +25,7 @@ public interface DoubleChestInventory extends Inventory { @NotNull Inventory getRightSide(); + @Override @Nullable DoubleChest getHolder(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/FurnaceInventory.java b/paper-api/src/main/java/org/bukkit/inventory/FurnaceInventory.java index 65d8fa437f..3f46259c1e 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/FurnaceInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/FurnaceInventory.java @@ -53,6 +53,7 @@ public interface FurnaceInventory extends Inventory { */ void setSmelting(@Nullable ItemStack stack); + @Override @Nullable Furnace getHolder(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java b/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java index 35066cea66..bab86d8049 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java @@ -430,6 +430,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { return level; } + @Override @NotNull @Utility public Map serialize() { diff --git a/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java b/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java index ef55b14637..88ce9dc6b9 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java @@ -212,6 +212,7 @@ public interface PlayerInventory extends Inventory { */ public void setHeldItemSlot(int slot); + @Override @Nullable public HumanEntity getHolder(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/paper-api/src/main/java/org/bukkit/inventory/ShapedRecipe.java index 83c72eda9d..8a3184528e 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/paper-api/src/main/java/org/bukkit/inventory/ShapedRecipe.java @@ -189,6 +189,7 @@ public class ShapedRecipe implements Recipe, Keyed { * * @return The result stack. */ + @Override @NotNull public ItemStack getResult() { return output.clone(); diff --git a/paper-api/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/paper-api/src/main/java/org/bukkit/inventory/ShapelessRecipe.java index ef28e75da7..17f2a0113d 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/paper-api/src/main/java/org/bukkit/inventory/ShapelessRecipe.java @@ -253,6 +253,7 @@ public class ShapelessRecipe implements Recipe, Keyed { * * @return The result stack. */ + @Override @NotNull public ItemStack getResult() { return output.clone(); diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/BookMeta.java index 9775dca7ef..976a6c828f 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/BookMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/BookMeta.java @@ -182,6 +182,7 @@ public interface BookMeta extends ItemMeta { */ int getPageCount(); + @Override @NotNull BookMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java index 19347a31db..aae2ed2ec4 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java @@ -76,6 +76,7 @@ public interface EnchantmentStorageMeta extends ItemMeta { */ boolean hasConflictingStoredEnchant(@NotNull Enchantment ench); + @Override @NotNull EnchantmentStorageMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java index e50a029df3..ce0f148d28 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java @@ -33,6 +33,7 @@ public interface FireworkEffectMeta extends ItemMeta { @Nullable FireworkEffect getEffect(); + @Override @NotNull FireworkEffectMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java index bd7cd4b348..fe23948170 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java @@ -91,6 +91,7 @@ public interface FireworkMeta extends ItemMeta { */ void setPower(int power) throws IllegalArgumentException; + @Override @NotNull FireworkMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java index 0b6779c6d5..c1676991c3 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java @@ -30,6 +30,7 @@ public interface LeatherArmorMeta extends ItemMeta { */ void setColor(@Nullable Color color); + @Override @NotNull LeatherArmorMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java index c90ad23791..8fca3ba238 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/MapMeta.java @@ -156,6 +156,7 @@ public interface MapMeta extends ItemMeta { */ void setColor(@Nullable Color color); + @Override @NotNull MapMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/SkullMeta.java index 1583764b42..35a392033e 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/SkullMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/SkullMeta.java @@ -55,6 +55,7 @@ public interface SkullMeta extends ItemMeta { */ boolean setOwningPlayer(@Nullable OfflinePlayer owner); + @Override @NotNull SkullMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/TropicalFishBucketMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/TropicalFishBucketMeta.java index 86db7cfa28..268b92e347 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/TropicalFishBucketMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/TropicalFishBucketMeta.java @@ -80,6 +80,7 @@ public interface TropicalFishBucketMeta extends ItemMeta { */ boolean hasVariant(); + @Override @NotNull TropicalFishBucketMeta clone(); } diff --git a/paper-api/src/main/java/org/bukkit/material/Banner.java b/paper-api/src/main/java/org/bukkit/material/Banner.java index 5f1843f9f8..517b36826a 100644 --- a/paper-api/src/main/java/org/bukkit/material/Banner.java +++ b/paper-api/src/main/java/org/bukkit/material/Banner.java @@ -28,6 +28,7 @@ public class Banner extends MaterialData implements Attachable { return getItemType() == Material.LEGACY_WALL_BANNER; } + @Override public BlockFace getAttachedFace() { if (isWallBanner()) { byte data = getData(); @@ -52,6 +53,7 @@ public class Banner extends MaterialData implements Attachable { } } + @Override public BlockFace getFacing() { byte data = getData(); @@ -112,6 +114,7 @@ public class Banner extends MaterialData implements Attachable { } } + @Override public void setFacingDirection(BlockFace face) { byte data; diff --git a/paper-api/src/main/java/org/bukkit/material/Bed.java b/paper-api/src/main/java/org/bukkit/material/Bed.java index 63965682d7..406e7e33bf 100644 --- a/paper-api/src/main/java/org/bukkit/material/Bed.java +++ b/paper-api/src/main/java/org/bukkit/material/Bed.java @@ -61,6 +61,7 @@ public class Bed extends MaterialData implements Directional { * Set which direction the head of the bed is facing. Note that this will * only affect one of the two blocks the bed is made of. */ + @Override public void setFacingDirection(BlockFace face) { byte data; @@ -94,6 +95,7 @@ public class Bed extends MaterialData implements Directional { * * @return the direction the head of the bed is facing */ + @Override public BlockFace getFacing() { byte data = (byte) (getData() & 0x7); diff --git a/paper-api/src/main/java/org/bukkit/material/Button.java b/paper-api/src/main/java/org/bukkit/material/Button.java index f705977af3..7cdfdb14d7 100644 --- a/paper-api/src/main/java/org/bukkit/material/Button.java +++ b/paper-api/src/main/java/org/bukkit/material/Button.java @@ -31,6 +31,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Override public boolean isPowered() { return (getData() & 0x8) == 0x8; } @@ -50,6 +51,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { * * @return BlockFace attached to */ + @Override public BlockFace getAttachedFace() { byte data = (byte) (getData() & 0x7); @@ -79,6 +81,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { /** * Sets the direction this button is pointing toward */ + @Override public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x8); diff --git a/paper-api/src/main/java/org/bukkit/material/CocoaPlant.java b/paper-api/src/main/java/org/bukkit/material/CocoaPlant.java index 2982220065..4c780581e8 100644 --- a/paper-api/src/main/java/org/bukkit/material/CocoaPlant.java +++ b/paper-api/src/main/java/org/bukkit/material/CocoaPlant.java @@ -75,10 +75,12 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable setData((byte) dat); } + @Override public BlockFace getAttachedFace() { return getFacing().getOppositeFace(); } + @Override public void setFacingDirection(BlockFace face) { int dat = getData() & 0xC; switch (face) { @@ -98,6 +100,7 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable setData((byte) dat); } + @Override public BlockFace getFacing() { switch (getData() & 0x3) { case 0: diff --git a/paper-api/src/main/java/org/bukkit/material/Command.java b/paper-api/src/main/java/org/bukkit/material/Command.java index 7f6a88d5d8..09e69be6ba 100644 --- a/paper-api/src/main/java/org/bukkit/material/Command.java +++ b/paper-api/src/main/java/org/bukkit/material/Command.java @@ -30,6 +30,7 @@ public class Command extends MaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Override public boolean isPowered() { return (getData() & 1) != 0; } diff --git a/paper-api/src/main/java/org/bukkit/material/DetectorRail.java b/paper-api/src/main/java/org/bukkit/material/DetectorRail.java index 32d5db523e..593e025ee7 100644 --- a/paper-api/src/main/java/org/bukkit/material/DetectorRail.java +++ b/paper-api/src/main/java/org/bukkit/material/DetectorRail.java @@ -24,6 +24,7 @@ public class DetectorRail extends ExtendedRails implements PressureSensor { super(type, data); } + @Override public boolean isPressed() { return (getData() & 0x8) == 0x8; } diff --git a/paper-api/src/main/java/org/bukkit/material/DirectionalContainer.java b/paper-api/src/main/java/org/bukkit/material/DirectionalContainer.java index 5143363183..c25dea8cbd 100644 --- a/paper-api/src/main/java/org/bukkit/material/DirectionalContainer.java +++ b/paper-api/src/main/java/org/bukkit/material/DirectionalContainer.java @@ -22,6 +22,7 @@ public class DirectionalContainer extends MaterialData implements Directional { super(type, data); } + @Override public void setFacingDirection(BlockFace face) { byte data; @@ -46,6 +47,7 @@ public class DirectionalContainer extends MaterialData implements Directional { setData(data); } + @Override public BlockFace getFacing() { byte data = getData(); diff --git a/paper-api/src/main/java/org/bukkit/material/Dispenser.java b/paper-api/src/main/java/org/bukkit/material/Dispenser.java index d078664a63..efc62ca5b2 100644 --- a/paper-api/src/main/java/org/bukkit/material/Dispenser.java +++ b/paper-api/src/main/java/org/bukkit/material/Dispenser.java @@ -31,6 +31,7 @@ public class Dispenser extends FurnaceAndDispenser { super(type, data); } + @Override public void setFacingDirection(BlockFace face) { byte data; @@ -63,6 +64,7 @@ public class Dispenser extends FurnaceAndDispenser { setData(data); } + @Override public BlockFace getFacing() { int data = getData() & 0x7; diff --git a/paper-api/src/main/java/org/bukkit/material/Door.java b/paper-api/src/main/java/org/bukkit/material/Door.java index 15f2928e60..ae488dd617 100644 --- a/paper-api/src/main/java/org/bukkit/material/Door.java +++ b/paper-api/src/main/java/org/bukkit/material/Door.java @@ -200,6 +200,7 @@ public class Door extends MaterialData implements Directional, Openable { /** * Result is undefined if isTopHalf() is true. */ + @Override public boolean isOpen() { return ((getData() & 0x4) == 0x4); } @@ -207,6 +208,7 @@ public class Door extends MaterialData implements Directional, Openable { /** * Set whether the door is open. Undefined if isTopHalf() is true. */ + @Override public void setOpen(boolean isOpen) { setData((byte) (isOpen ? (getData() | 0x4) : (getData() & ~0x4))); } @@ -248,6 +250,7 @@ public class Door extends MaterialData implements Directional, Openable { * * @param face the direction */ + @Override public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0xC); switch (face) { @@ -274,6 +277,7 @@ public class Door extends MaterialData implements Directional, Openable { * * @return the direction */ + @Override public BlockFace getFacing() { byte data = (byte) (getData() & 0x3); switch (data) { diff --git a/paper-api/src/main/java/org/bukkit/material/Dye.java b/paper-api/src/main/java/org/bukkit/material/Dye.java index 5752be0ee3..9635cb6e28 100644 --- a/paper-api/src/main/java/org/bukkit/material/Dye.java +++ b/paper-api/src/main/java/org/bukkit/material/Dye.java @@ -37,6 +37,7 @@ public class Dye extends MaterialData implements Colorable { * * @return DyeColor of this dye */ + @Override public DyeColor getColor() { return DyeColor.getByDyeData(getData()); } @@ -46,6 +47,7 @@ public class Dye extends MaterialData implements Colorable { * * @param color New color of this dye */ + @Override public void setColor(DyeColor color) { setData(color.getDyeData()); } diff --git a/paper-api/src/main/java/org/bukkit/material/Gate.java b/paper-api/src/main/java/org/bukkit/material/Gate.java index ff0420610f..7d635aa791 100644 --- a/paper-api/src/main/java/org/bukkit/material/Gate.java +++ b/paper-api/src/main/java/org/bukkit/material/Gate.java @@ -32,6 +32,7 @@ public class Gate extends MaterialData implements Directional, Openable { super(Material.LEGACY_FENCE_GATE, data); } + @Override public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & ~DIR_BIT); @@ -54,6 +55,7 @@ public class Gate extends MaterialData implements Directional, Openable { setData(data); } + @Override public BlockFace getFacing() { switch (getData() & DIR_BIT) { case GATE_SOUTH: @@ -69,10 +71,12 @@ public class Gate extends MaterialData implements Directional, Openable { return BlockFace.EAST; } + @Override public boolean isOpen() { return (getData() & OPEN_BIT) > 0; } + @Override public void setOpen(boolean isOpen) { byte data = getData(); diff --git a/paper-api/src/main/java/org/bukkit/material/Ladder.java b/paper-api/src/main/java/org/bukkit/material/Ladder.java index 54447bbb5a..b0d13a0078 100644 --- a/paper-api/src/main/java/org/bukkit/material/Ladder.java +++ b/paper-api/src/main/java/org/bukkit/material/Ladder.java @@ -30,6 +30,7 @@ public class Ladder extends SimpleAttachableMaterialData { * * @return BlockFace attached to */ + @Override public BlockFace getAttachedFace() { byte data = getData(); @@ -53,6 +54,7 @@ public class Ladder extends SimpleAttachableMaterialData { /** * Sets the direction this ladder is facing */ + @Override public void setFacingDirection(BlockFace face) { byte data = (byte) 0x0; diff --git a/paper-api/src/main/java/org/bukkit/material/Lever.java b/paper-api/src/main/java/org/bukkit/material/Lever.java index 8e68da3c9b..8892f78dde 100644 --- a/paper-api/src/main/java/org/bukkit/material/Lever.java +++ b/paper-api/src/main/java/org/bukkit/material/Lever.java @@ -31,6 +31,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Override public boolean isPowered() { return (getData() & 0x8) == 0x8; } @@ -49,6 +50,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { * * @return BlockFace attached to */ + @Override public BlockFace getAttachedFace() { byte data = (byte) (getData() & 0x7); @@ -81,6 +83,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { /** * Sets the direction this lever is pointing in */ + @Override public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x8); BlockFace attach = getAttachedFace(); diff --git a/paper-api/src/main/java/org/bukkit/material/PistonExtensionMaterial.java b/paper-api/src/main/java/org/bukkit/material/PistonExtensionMaterial.java index f293b9ca35..6435f234cc 100644 --- a/paper-api/src/main/java/org/bukkit/material/PistonExtensionMaterial.java +++ b/paper-api/src/main/java/org/bukkit/material/PistonExtensionMaterial.java @@ -22,6 +22,7 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable super(type, data); } + @Override public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x8); @@ -45,6 +46,7 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable setData(data); } + @Override public BlockFace getFacing() { byte dir = (byte) (getData() & 7); @@ -84,6 +86,7 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable setData((byte) (sticky ? (getData() | 0x8) : (getData() & ~0x8))); } + @Override public BlockFace getAttachedFace() { return getFacing().getOppositeFace(); } diff --git a/paper-api/src/main/java/org/bukkit/material/PoweredRail.java b/paper-api/src/main/java/org/bukkit/material/PoweredRail.java index bdccff9445..96efd3ce39 100644 --- a/paper-api/src/main/java/org/bukkit/material/PoweredRail.java +++ b/paper-api/src/main/java/org/bukkit/material/PoweredRail.java @@ -24,6 +24,7 @@ public class PoweredRail extends ExtendedRails implements Redstone { super(type, data); } + @Override public boolean isPowered() { return (getData() & 0x8) == 0x8; } diff --git a/paper-api/src/main/java/org/bukkit/material/PressurePlate.java b/paper-api/src/main/java/org/bukkit/material/PressurePlate.java index 95ce6648fb..bc1f57f055 100644 --- a/paper-api/src/main/java/org/bukkit/material/PressurePlate.java +++ b/paper-api/src/main/java/org/bukkit/material/PressurePlate.java @@ -24,6 +24,7 @@ public class PressurePlate extends MaterialData implements PressureSensor { super(type, data); } + @Override public boolean isPressed() { return getData() == 0x1; } diff --git a/paper-api/src/main/java/org/bukkit/material/Pumpkin.java b/paper-api/src/main/java/org/bukkit/material/Pumpkin.java index 1fad246bfc..1ee690aec5 100644 --- a/paper-api/src/main/java/org/bukkit/material/Pumpkin.java +++ b/paper-api/src/main/java/org/bukkit/material/Pumpkin.java @@ -40,6 +40,7 @@ public class Pumpkin extends MaterialData implements Directional { return getItemType() == Material.LEGACY_JACK_O_LANTERN; } + @Override public void setFacingDirection(BlockFace face) { byte data; @@ -64,6 +65,7 @@ public class Pumpkin extends MaterialData implements Directional { setData(data); } + @Override public BlockFace getFacing() { byte data = getData(); diff --git a/paper-api/src/main/java/org/bukkit/material/RedstoneTorch.java b/paper-api/src/main/java/org/bukkit/material/RedstoneTorch.java index b42ec940d4..683eccef84 100644 --- a/paper-api/src/main/java/org/bukkit/material/RedstoneTorch.java +++ b/paper-api/src/main/java/org/bukkit/material/RedstoneTorch.java @@ -30,6 +30,7 @@ public class RedstoneTorch extends Torch implements Redstone { * * @return true if powered, otherwise false */ + @Override public boolean isPowered() { return getItemType() == Material.LEGACY_REDSTONE_TORCH_ON; } diff --git a/paper-api/src/main/java/org/bukkit/material/RedstoneWire.java b/paper-api/src/main/java/org/bukkit/material/RedstoneWire.java index 709c395a55..a65ccd4c74 100644 --- a/paper-api/src/main/java/org/bukkit/material/RedstoneWire.java +++ b/paper-api/src/main/java/org/bukkit/material/RedstoneWire.java @@ -30,6 +30,7 @@ public class RedstoneWire extends MaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Override public boolean isPowered() { return getData() > 0; } diff --git a/paper-api/src/main/java/org/bukkit/material/Sign.java b/paper-api/src/main/java/org/bukkit/material/Sign.java index 51a6b82505..64a79a2240 100644 --- a/paper-api/src/main/java/org/bukkit/material/Sign.java +++ b/paper-api/src/main/java/org/bukkit/material/Sign.java @@ -40,6 +40,7 @@ public class Sign extends MaterialData implements Attachable { * * @return BlockFace attached to */ + @Override public BlockFace getAttachedFace() { if (isWallSign()) { byte data = getData(); @@ -69,6 +70,7 @@ public class Sign extends MaterialData implements Attachable { * * @return BlockFace indicating where this sign is facing */ + @Override public BlockFace getFacing() { byte data = getData(); @@ -129,6 +131,7 @@ public class Sign extends MaterialData implements Attachable { } } + @Override public void setFacingDirection(BlockFace face) { byte data; diff --git a/paper-api/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java b/paper-api/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java index fb92f65871..d5a38c5552 100644 --- a/paper-api/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java +++ b/paper-api/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java @@ -27,6 +27,7 @@ public abstract class SimpleAttachableMaterialData extends MaterialData implemen super(type, data); } + @Override public BlockFace getFacing() { BlockFace attachedFace = getAttachedFace(); return attachedFace == null ? null : attachedFace.getOppositeFace(); diff --git a/paper-api/src/main/java/org/bukkit/material/Skull.java b/paper-api/src/main/java/org/bukkit/material/Skull.java index a0abe74838..a1936e8c99 100644 --- a/paper-api/src/main/java/org/bukkit/material/Skull.java +++ b/paper-api/src/main/java/org/bukkit/material/Skull.java @@ -35,6 +35,7 @@ public class Skull extends MaterialData implements Directional { super(type, data); } + @Override public void setFacingDirection(BlockFace face) { int data; @@ -63,6 +64,7 @@ public class Skull extends MaterialData implements Directional { setData((byte) data); } + @Override public BlockFace getFacing() { int data = getData(); diff --git a/paper-api/src/main/java/org/bukkit/material/Stairs.java b/paper-api/src/main/java/org/bukkit/material/Stairs.java index 29ef66c4f5..aae8339876 100644 --- a/paper-api/src/main/java/org/bukkit/material/Stairs.java +++ b/paper-api/src/main/java/org/bukkit/material/Stairs.java @@ -54,6 +54,7 @@ public class Stairs extends MaterialData implements Directional { /** * Set the direction the stair part of the block is facing */ + @Override public void setFacingDirection(BlockFace face) { byte data; @@ -82,6 +83,7 @@ public class Stairs extends MaterialData implements Directional { /** * @return the direction the stair part of the block is facing */ + @Override public BlockFace getFacing() { return getDescendingDirection(); } diff --git a/paper-api/src/main/java/org/bukkit/material/Torch.java b/paper-api/src/main/java/org/bukkit/material/Torch.java index 1177846705..898cbe7f14 100644 --- a/paper-api/src/main/java/org/bukkit/material/Torch.java +++ b/paper-api/src/main/java/org/bukkit/material/Torch.java @@ -30,6 +30,7 @@ public class Torch extends SimpleAttachableMaterialData { * * @return BlockFace attached to */ + @Override public BlockFace getAttachedFace() { byte data = getData(); @@ -52,6 +53,7 @@ public class Torch extends SimpleAttachableMaterialData { } } + @Override public void setFacingDirection(BlockFace face) { byte data; diff --git a/paper-api/src/main/java/org/bukkit/material/TrapDoor.java b/paper-api/src/main/java/org/bukkit/material/TrapDoor.java index 2bbfe2b311..4fc308a370 100644 --- a/paper-api/src/main/java/org/bukkit/material/TrapDoor.java +++ b/paper-api/src/main/java/org/bukkit/material/TrapDoor.java @@ -25,10 +25,12 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { super(type, data); } + @Override public boolean isOpen() { return ((getData() & 0x4) == 0x4); } + @Override public void setOpen(boolean isOpen) { byte data = getData(); @@ -63,6 +65,7 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { setData((byte) dat); } + @Override public BlockFace getAttachedFace() { byte data = (byte) (getData() & 0x3); @@ -84,6 +87,7 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { } + @Override public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0xC); diff --git a/paper-api/src/main/java/org/bukkit/material/TripwireHook.java b/paper-api/src/main/java/org/bukkit/material/TripwireHook.java index 97f97eab8b..921b6e77cb 100644 --- a/paper-api/src/main/java/org/bukkit/material/TripwireHook.java +++ b/paper-api/src/main/java/org/bukkit/material/TripwireHook.java @@ -71,6 +71,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto setData((byte) dat); } + @Override public void setFacingDirection(BlockFace face) { int dat = getData() & 0xC; switch (face) { @@ -90,6 +91,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto setData((byte) dat); } + @Override public BlockFace getAttachedFace() { switch (getData() & 0x3) { case 0: @@ -104,6 +106,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto return null; } + @Override public boolean isPowered() { return isActivated(); } diff --git a/paper-api/src/main/java/org/bukkit/material/Wool.java b/paper-api/src/main/java/org/bukkit/material/Wool.java index 87f35f5883..193ae6185f 100644 --- a/paper-api/src/main/java/org/bukkit/material/Wool.java +++ b/paper-api/src/main/java/org/bukkit/material/Wool.java @@ -35,6 +35,7 @@ public class Wool extends MaterialData implements Colorable { * * @return DyeColor of this dye */ + @Override public DyeColor getColor() { return DyeColor.getByWoolData(getData()); } @@ -44,6 +45,7 @@ public class Wool extends MaterialData implements Colorable { * * @param color New color of this dye */ + @Override public void setColor(DyeColor color) { setData(color.getWoolData()); } diff --git a/paper-api/src/main/java/org/bukkit/metadata/LazyMetadataValue.java b/paper-api/src/main/java/org/bukkit/metadata/LazyMetadataValue.java index 398399298e..86e0e3767e 100644 --- a/paper-api/src/main/java/org/bukkit/metadata/LazyMetadataValue.java +++ b/paper-api/src/main/java/org/bukkit/metadata/LazyMetadataValue.java @@ -64,6 +64,7 @@ public class LazyMetadataValue extends MetadataValueAdapter { super(owningPlugin); } + @Override @Nullable public Object value() { eval(); @@ -94,6 +95,7 @@ public class LazyMetadataValue extends MetadataValueAdapter { } } + @Override public synchronized void invalidate() { if (cacheStrategy != CacheStrategy.CACHE_ETERNALLY) { internalValue.clear(); diff --git a/paper-api/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java b/paper-api/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java index 02b7e0dc50..b90d09f57b 100644 --- a/paper-api/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java +++ b/paper-api/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java @@ -22,35 +22,43 @@ public abstract class MetadataValueAdapter implements MetadataValue { this.owningPlugin = new WeakReference(owningPlugin); } + @Override @Nullable public Plugin getOwningPlugin() { return owningPlugin.get(); } + @Override public int asInt() { return NumberConversions.toInt(value()); } + @Override public float asFloat() { return NumberConversions.toFloat(value()); } + @Override public double asDouble() { return NumberConversions.toDouble(value()); } + @Override public long asLong() { return NumberConversions.toLong(value()); } + @Override public short asShort() { return NumberConversions.toShort(value()); } + @Override public byte asByte() { return NumberConversions.toByte(value()); } + @Override public boolean asBoolean() { Object value = value(); if (value instanceof Boolean) { @@ -68,6 +76,7 @@ public abstract class MetadataValueAdapter implements MetadataValue { return value != null; } + @Override @NotNull public String asString() { Object value = value(); diff --git a/paper-api/src/main/java/org/bukkit/permissions/PermissibleBase.java b/paper-api/src/main/java/org/bukkit/permissions/PermissibleBase.java index 27c14c0f54..497775f7f8 100644 --- a/paper-api/src/main/java/org/bukkit/permissions/PermissibleBase.java +++ b/paper-api/src/main/java/org/bukkit/permissions/PermissibleBase.java @@ -31,6 +31,7 @@ public class PermissibleBase implements Permissible { recalculatePermissions(); } + @Override public boolean isOp() { if (opable == null) { return false; @@ -39,6 +40,7 @@ public class PermissibleBase implements Permissible { } } + @Override public void setOp(boolean value) { if (opable == null) { throw new UnsupportedOperationException("Cannot change op value as no ServerOperator is set"); @@ -47,6 +49,7 @@ public class PermissibleBase implements Permissible { } } + @Override public boolean isPermissionSet(@NotNull String name) { if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); @@ -55,6 +58,7 @@ public class PermissibleBase implements Permissible { return permissions.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)); } + @Override public boolean isPermissionSet(@NotNull Permission perm) { if (perm == null) { throw new IllegalArgumentException("Permission cannot be null"); @@ -63,6 +67,7 @@ public class PermissibleBase implements Permissible { return isPermissionSet(perm.getName()); } + @Override public boolean hasPermission(@NotNull String inName) { if (inName == null) { throw new IllegalArgumentException("Permission name cannot be null"); @@ -83,6 +88,7 @@ public class PermissibleBase implements Permissible { } } + @Override public boolean hasPermission(@NotNull Permission perm) { if (perm == null) { throw new IllegalArgumentException("Permission cannot be null"); @@ -96,6 +102,7 @@ public class PermissibleBase implements Permissible { return perm.getDefault().getValue(isOp()); } + @Override @NotNull public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) { if (name == null) { @@ -114,6 +121,7 @@ public class PermissibleBase implements Permissible { return result; } + @Override @NotNull public PermissionAttachment addAttachment(@NotNull Plugin plugin) { if (plugin == null) { @@ -130,6 +138,7 @@ public class PermissibleBase implements Permissible { return result; } + @Override public void removeAttachment(@NotNull PermissionAttachment attachment) { if (attachment == null) { throw new IllegalArgumentException("Attachment cannot be null"); @@ -149,6 +158,7 @@ public class PermissibleBase implements Permissible { } } + @Override public void recalculatePermissions() { clearPermissions(); Set defaults = Bukkit.getServer().getPluginManager().getDefaultPermissions(isOp()); @@ -196,6 +206,7 @@ public class PermissibleBase implements Permissible { } } + @Override @Nullable public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) { if (name == null) { @@ -215,6 +226,7 @@ public class PermissibleBase implements Permissible { return result; } + @Override @Nullable public PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) { if (plugin == null) { @@ -234,6 +246,7 @@ public class PermissibleBase implements Permissible { } } + @Override @NotNull public Set getEffectivePermissions() { return new HashSet(permissions.values()); @@ -246,6 +259,7 @@ public class PermissibleBase implements Permissible { this.attachment = attachment; } + @Override public void run() { attachment.remove(); } diff --git a/paper-api/src/main/java/org/bukkit/plugin/PluginBase.java b/paper-api/src/main/java/org/bukkit/plugin/PluginBase.java index 70c53a24dc..94f8ceb965 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/PluginBase.java +++ b/paper-api/src/main/java/org/bukkit/plugin/PluginBase.java @@ -28,6 +28,7 @@ public abstract class PluginBase implements Plugin { return getName().equals(((Plugin) obj).getName()); } + @Override @NotNull public final String getName() { return getDescription().getName(); diff --git a/paper-api/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java b/paper-api/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java index cbcdadd490..f451719370 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java +++ b/paper-api/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java @@ -41,6 +41,7 @@ public class RegisteredServiceProvider implements Comparable other) { if (priority.ordinal() == other.getPriority().ordinal()) { return 0; diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 0c4119ae43..e776c9e041 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -66,6 +66,7 @@ public final class SimplePluginManager implements PluginManager { * @throws IllegalArgumentException Thrown when the given Class is not a * valid PluginLoader */ + @Override public void registerInterface(@NotNull Class loader) throws IllegalArgumentException { PluginLoader instance; @@ -101,6 +102,7 @@ public final class SimplePluginManager implements PluginManager { * @param directory Directory to check for plugins * @return A list of all plugins loaded */ + @Override @NotNull public Plugin[] loadPlugins(@NotNull File directory) { Validate.notNull(directory, "Directory cannot be null"); @@ -310,6 +312,7 @@ public final class SimplePluginManager implements PluginManager { * @throws UnknownDependencyException If a required dependency could not * be found */ + @Override @Nullable public synchronized Plugin loadPlugin(@NotNull File file) throws InvalidPluginException, UnknownDependencyException { Validate.notNull(file, "File cannot be null"); @@ -357,11 +360,13 @@ public final class SimplePluginManager implements PluginManager { * @param name Name of the plugin to check * @return Plugin if it exists, otherwise null */ + @Override @Nullable public synchronized Plugin getPlugin(@NotNull String name) { return lookupNames.get(name.replace(' ', '_')); } + @Override @NotNull public synchronized Plugin[] getPlugins() { return plugins.toArray(new Plugin[plugins.size()]); @@ -375,6 +380,7 @@ public final class SimplePluginManager implements PluginManager { * @param name Name of the plugin to check * @return true if the plugin is enabled, otherwise false */ + @Override public boolean isPluginEnabled(@NotNull String name) { Plugin plugin = getPlugin(name); @@ -387,6 +393,7 @@ public final class SimplePluginManager implements PluginManager { * @param plugin Plugin to check * @return true if the plugin is enabled, otherwise false */ + @Override public boolean isPluginEnabled(@Nullable Plugin plugin) { if ((plugin != null) && (plugins.contains(plugin))) { return plugin.isEnabled(); @@ -395,6 +402,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override public void enablePlugin(@NotNull final Plugin plugin) { if (!plugin.isEnabled()) { List pluginCommands = PluginCommandYamlParser.parse(plugin); @@ -413,6 +421,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override public void disablePlugins() { Plugin[] plugins = getPlugins(); for (int i = plugins.length - 1; i >= 0; i--) { @@ -420,6 +429,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override public void disablePlugin(@NotNull final Plugin plugin) { if (plugin.isEnabled()) { try { @@ -455,6 +465,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override public void clearPlugins() { synchronized (this) { disablePlugins(); @@ -475,6 +486,7 @@ public final class SimplePluginManager implements PluginManager { * * @param event Event details */ + @Override public void callEvent(@NotNull Event event) { if (event.isAsynchronous()) { if (Thread.holdsLock(this)) { @@ -524,6 +536,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override public void registerEvents(@NotNull Listener listener, @NotNull Plugin plugin) { if (!plugin.isEnabled()) { throw new IllegalPluginAccessException("Plugin attempted to register " + listener + " while not enabled"); @@ -535,6 +548,7 @@ public final class SimplePluginManager implements PluginManager { } + @Override public void registerEvent(@NotNull Class event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin) { registerEvent(event, listener, priority, executor, plugin, false); } @@ -551,6 +565,7 @@ public final class SimplePluginManager implements PluginManager { * @param ignoreCancelled Do not call executor if event was already * cancelled */ + @Override public void registerEvent(@NotNull Class event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin, boolean ignoreCancelled) { Validate.notNull(listener, "Listener cannot be null"); Validate.notNull(priority, "Priority cannot be null"); @@ -595,11 +610,13 @@ public final class SimplePluginManager implements PluginManager { } } + @Override @Nullable public Permission getPermission(@NotNull String name) { return permissions.get(name.toLowerCase(java.util.Locale.ENGLISH)); } + @Override public void addPermission(@NotNull Permission perm) { addPermission(perm, true); } @@ -616,19 +633,23 @@ public final class SimplePluginManager implements PluginManager { calculatePermissionDefault(perm, dirty); } + @Override @NotNull public Set getDefaultPermissions(boolean op) { return ImmutableSet.copyOf(defaultPerms.get(op)); } + @Override public void removePermission(@NotNull Permission perm) { removePermission(perm.getName()); } + @Override public void removePermission(@NotNull String name) { permissions.remove(name.toLowerCase(java.util.Locale.ENGLISH)); } + @Override public void recalculatePermissionDefaults(@NotNull Permission perm) { if (perm != null && permissions.containsKey(perm.getName().toLowerCase(java.util.Locale.ENGLISH))) { defaultPerms.get(true).remove(perm); @@ -667,6 +688,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override public void subscribeToPermission(@NotNull String permission, @NotNull Permissible permissible) { String name = permission.toLowerCase(java.util.Locale.ENGLISH); Map map = permSubs.get(name); @@ -679,6 +701,7 @@ public final class SimplePluginManager implements PluginManager { map.put(permissible, true); } + @Override public void unsubscribeFromPermission(@NotNull String permission, @NotNull Permissible permissible) { String name = permission.toLowerCase(java.util.Locale.ENGLISH); Map map = permSubs.get(name); @@ -692,6 +715,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override @NotNull public Set getPermissionSubscriptions(@NotNull String permission) { String name = permission.toLowerCase(java.util.Locale.ENGLISH); @@ -704,6 +728,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override public void subscribeToDefaultPerms(boolean op, @NotNull Permissible permissible) { Map map = defSubs.get(op); @@ -715,6 +740,7 @@ public final class SimplePluginManager implements PluginManager { map.put(permissible, true); } + @Override public void unsubscribeFromDefaultPerms(boolean op, @NotNull Permissible permissible) { Map map = defSubs.get(op); @@ -727,6 +753,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Override @NotNull public Set getDefaultPermSubscriptions(boolean op) { Map map = defSubs.get(op); @@ -738,11 +765,13 @@ public final class SimplePluginManager implements PluginManager { } } + @Override @NotNull public Set getPermissions() { return new HashSet(permissions.values()); } + @Override public boolean useTimings() { return useTimings; } diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimpleServicesManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimpleServicesManager.java index 6f0a63fb09..f3dd849023 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimpleServicesManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/SimpleServicesManager.java @@ -35,6 +35,7 @@ public class SimpleServicesManager implements ServicesManager { * @param plugin plugin with the provider * @param priority priority of the provider */ + @Override public void register(@NotNull Class service, @NotNull T provider, @NotNull Plugin plugin, @NotNull ServicePriority priority) { RegisteredServiceProvider registeredProvider = null; synchronized (providers) { @@ -63,6 +64,7 @@ public class SimpleServicesManager implements ServicesManager { * * @param plugin The plugin */ + @Override public void unregisterAll(@NotNull Plugin plugin) { ArrayList unregisteredEvents = new ArrayList(); synchronized (providers) { @@ -105,6 +107,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service The service interface * @param provider The service provider implementation */ + @Override public void unregister(@NotNull Class service, @NotNull Object provider) { ArrayList unregisteredEvents = new ArrayList(); synchronized (providers) { @@ -152,6 +155,7 @@ public class SimpleServicesManager implements ServicesManager { * * @param provider The service provider implementation */ + @Override public void unregister(@NotNull Object provider) { ArrayList unregisteredEvents = new ArrayList(); synchronized (providers) { @@ -196,6 +200,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service The service interface * @return provider or null */ + @Override @Nullable public T load(@NotNull Class service) { synchronized (providers) { @@ -218,6 +223,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service The service interface * @return provider registration or null */ + @Override @Nullable @SuppressWarnings("unchecked") public RegisteredServiceProvider getRegistration(@NotNull Class service) { @@ -239,6 +245,7 @@ public class SimpleServicesManager implements ServicesManager { * @param plugin The plugin * @return provider registrations */ + @Override @NotNull public List> getRegistrations(@NotNull Plugin plugin) { ImmutableList.Builder> ret = ImmutableList.>builder(); @@ -262,6 +269,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service The service interface * @return a copy of the list of registrations */ + @Override @NotNull @SuppressWarnings("unchecked") public List> getRegistrations(@NotNull Class service) { @@ -289,6 +297,7 @@ public class SimpleServicesManager implements ServicesManager { * * @return a copy of the set of known services */ + @Override @NotNull public Set> getKnownServices() { synchronized (providers) { @@ -303,6 +312,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service service to check * @return true if and only if there are registered providers */ + @Override public boolean isProvidedFor(@NotNull Class service) { synchronized (providers) { return providers.containsKey(service); diff --git a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index 43eee27d8b..c241d521bc 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/paper-api/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -64,6 +64,7 @@ public final class JavaPluginLoader implements PluginLoader { server = instance; } + @Override @NotNull public Plugin loadPlugin(@NotNull final File file) throws InvalidPluginException { Validate.notNull(file, "File cannot be null"); @@ -141,6 +142,7 @@ public final class JavaPluginLoader implements PluginLoader { return loader.plugin; } + @Override @NotNull public PluginDescriptionFile getPluginDescription(@NotNull File file) throws InvalidDescriptionException { Validate.notNull(file, "File cannot be null"); @@ -180,6 +182,7 @@ public final class JavaPluginLoader implements PluginLoader { } } + @Override @NotNull public Pattern[] getPluginFileFilters() { return fileFilters.clone(); @@ -229,6 +232,7 @@ public final class JavaPluginLoader implements PluginLoader { } } + @Override @NotNull public Map, Set> createRegisteredListeners(@NotNull Listener listener, @NotNull final Plugin plugin) { Validate.notNull(plugin, "Plugin can not be null"); @@ -297,6 +301,7 @@ public final class JavaPluginLoader implements PluginLoader { } EventExecutor executor = new EventExecutor() { + @Override public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { try { if (!eventClass.isAssignableFrom(event.getClass())) { @@ -319,6 +324,7 @@ public final class JavaPluginLoader implements PluginLoader { return ret; } + @Override public void enablePlugin(@NotNull final Plugin plugin) { Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); @@ -346,6 +352,7 @@ public final class JavaPluginLoader implements PluginLoader { } } + @Override public void disablePlugin(@NotNull Plugin plugin) { Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); diff --git a/paper-api/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/paper-api/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java index 8227b375ee..1d061412cd 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +++ b/paper-api/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java @@ -168,12 +168,14 @@ public class StandardMessenger implements Messenger { } } + @Override public boolean isReservedChannel(@NotNull String channel) { channel = validateAndCorrectChannel(channel); return channel.contains("minecraft") && !channel.equals("minecraft:brand"); } + @Override public void registerOutgoingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -186,6 +188,7 @@ public class StandardMessenger implements Messenger { addToOutgoing(plugin, channel); } + @Override public void unregisterOutgoingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -195,6 +198,7 @@ public class StandardMessenger implements Messenger { removeFromOutgoing(plugin, channel); } + @Override public void unregisterOutgoingPluginChannel(@NotNull Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -203,6 +207,7 @@ public class StandardMessenger implements Messenger { removeFromOutgoing(plugin); } + @Override @NotNull public PluginMessageListenerRegistration registerIncomingPluginChannel(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) { if (plugin == null) { @@ -223,6 +228,7 @@ public class StandardMessenger implements Messenger { return result; } + @Override public void unregisterIncomingPluginChannel(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -235,6 +241,7 @@ public class StandardMessenger implements Messenger { removeFromIncoming(new PluginMessageListenerRegistration(this, plugin, channel, listener)); } + @Override public void unregisterIncomingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -244,6 +251,7 @@ public class StandardMessenger implements Messenger { removeFromIncoming(plugin, channel); } + @Override public void unregisterIncomingPluginChannel(@NotNull Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -252,6 +260,7 @@ public class StandardMessenger implements Messenger { removeFromIncoming(plugin); } + @Override @NotNull public Set getOutgoingChannels() { synchronized (outgoingLock) { @@ -260,6 +269,7 @@ public class StandardMessenger implements Messenger { } } + @Override @NotNull public Set getOutgoingChannels(@NotNull Plugin plugin) { if (plugin == null) { @@ -277,6 +287,7 @@ public class StandardMessenger implements Messenger { } } + @Override @NotNull public Set getIncomingChannels() { synchronized (incomingLock) { @@ -285,6 +296,7 @@ public class StandardMessenger implements Messenger { } } + @Override @NotNull public Set getIncomingChannels(@NotNull Plugin plugin) { if (plugin == null) { @@ -308,6 +320,7 @@ public class StandardMessenger implements Messenger { } } + @Override @NotNull public Set getIncomingChannelRegistrations(@NotNull Plugin plugin) { if (plugin == null) { @@ -325,6 +338,7 @@ public class StandardMessenger implements Messenger { } } + @Override @NotNull public Set getIncomingChannelRegistrations(@NotNull String channel) { channel = validateAndCorrectChannel(channel); @@ -340,6 +354,7 @@ public class StandardMessenger implements Messenger { } } + @Override @NotNull public Set getIncomingChannelRegistrations(@NotNull Plugin plugin, @NotNull String channel) { if (plugin == null) { @@ -366,6 +381,7 @@ public class StandardMessenger implements Messenger { } } + @Override public boolean isRegistrationValid(@NotNull PluginMessageListenerRegistration registration) { if (registration == null) { throw new IllegalArgumentException("Registration cannot be null"); @@ -382,6 +398,7 @@ public class StandardMessenger implements Messenger { } } + @Override public boolean isIncomingChannelRegistered(@NotNull Plugin plugin, @NotNull String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -403,6 +420,7 @@ public class StandardMessenger implements Messenger { } } + @Override public boolean isOutgoingChannelRegistered(@NotNull Plugin plugin, @NotNull String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -420,6 +438,7 @@ public class StandardMessenger implements Messenger { } } + @Override public void dispatchIncomingMessage(@NotNull Player source, @NotNull String channel, @NotNull byte[] message) { if (source == null) { throw new IllegalArgumentException("Player source cannot be null"); diff --git a/paper-api/src/main/java/org/bukkit/potion/PotionEffect.java b/paper-api/src/main/java/org/bukkit/potion/PotionEffect.java index a0529fbeae..bbefcd5809 100644 --- a/paper-api/src/main/java/org/bukkit/potion/PotionEffect.java +++ b/paper-api/src/main/java/org/bukkit/potion/PotionEffect.java @@ -127,6 +127,7 @@ public class PotionEffect implements ConfigurationSerializable { return def; } + @Override @NotNull public Map serialize() { return ImmutableMap.builder() diff --git a/paper-api/src/main/java/org/bukkit/util/BlockIterator.java b/paper-api/src/main/java/org/bukkit/util/BlockIterator.java index bd82faf8e6..8a377e1413 100644 --- a/paper-api/src/main/java/org/bukkit/util/BlockIterator.java +++ b/paper-api/src/main/java/org/bukkit/util/BlockIterator.java @@ -293,6 +293,7 @@ public class BlockIterator implements Iterator { * Returns true if the iteration has more elements */ + @Override public boolean hasNext() { scan(); return currentBlock != -1; @@ -303,6 +304,7 @@ public class BlockIterator implements Iterator { * * @return the next Block in the trace */ + @Override @NotNull public Block next() throws NoSuchElementException { scan(); @@ -313,6 +315,7 @@ public class BlockIterator implements Iterator { } } + @Override public void remove() { throw new UnsupportedOperationException("[BlockIterator] doesn't support block removal"); } diff --git a/paper-api/src/main/java/org/bukkit/util/Vector.java b/paper-api/src/main/java/org/bukkit/util/Vector.java index b218a1dc8d..58d4ddbeec 100644 --- a/paper-api/src/main/java/org/bukkit/util/Vector.java +++ b/paper-api/src/main/java/org/bukkit/util/Vector.java @@ -846,6 +846,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { return new Vector(random.nextDouble(), random.nextDouble(), random.nextDouble()); } + @Override @NotNull public Map serialize() { Map result = new LinkedHashMap(); diff --git a/paper-api/src/test/java/org/bukkit/TestServer.java b/paper-api/src/test/java/org/bukkit/TestServer.java index 596384b1e0..61993528e6 100644 --- a/paper-api/src/test/java/org/bukkit/TestServer.java +++ b/paper-api/src/test/java/org/bukkit/TestServer.java @@ -23,6 +23,7 @@ public final class TestServer implements InvocationHandler { methodMap.put( Server.class.getMethod("isPrimaryThread"), new MethodHandler() { + @Override public Object handle(TestServer server, Object[] args) { return Thread.currentThread().equals(server.creatingThread); } @@ -31,6 +32,7 @@ public final class TestServer implements InvocationHandler { methodMap.put( Server.class.getMethod("getPluginManager"), new MethodHandler() { + @Override public Object handle(TestServer server, Object[] args) { return server.pluginManager; } @@ -40,6 +42,7 @@ public final class TestServer implements InvocationHandler { Server.class.getMethod("getLogger"), new MethodHandler() { final Logger logger = Logger.getLogger(TestServer.class.getCanonicalName()); + @Override public Object handle(TestServer server, Object[] args) { return logger; } @@ -48,6 +51,7 @@ public final class TestServer implements InvocationHandler { methodMap.put( Server.class.getMethod("getName"), new MethodHandler() { + @Override public Object handle(TestServer server, Object[] args) { return TestServer.class.getSimpleName(); } @@ -56,6 +60,7 @@ public final class TestServer implements InvocationHandler { methodMap.put( Server.class.getMethod("getVersion"), new MethodHandler() { + @Override public Object handle(TestServer server, Object[] args) { return "Version_" + TestServer.class.getPackage().getImplementationVersion(); } @@ -64,6 +69,7 @@ public final class TestServer implements InvocationHandler { methodMap.put( Server.class.getMethod("getBukkitVersion"), new MethodHandler() { + @Override public Object handle(TestServer server, Object[] args) { return "BukkitVersion_" + TestServer.class.getPackage().getImplementationVersion(); } @@ -88,6 +94,7 @@ public final class TestServer implements InvocationHandler { return Bukkit.getServer(); } + @Override public Object invoke(Object proxy, Method method, Object[] args) { MethodHandler handler = methods.get(method); if (handler != null) { diff --git a/paper-api/src/test/java/org/bukkit/conversations/ConversationTest.java b/paper-api/src/test/java/org/bukkit/conversations/ConversationTest.java index 139dcfd691..c448dc724d 100644 --- a/paper-api/src/test/java/org/bukkit/conversations/ConversationTest.java +++ b/paper-api/src/test/java/org/bukkit/conversations/ConversationTest.java @@ -89,10 +89,12 @@ public class ConversationTest { private class FirstPrompt extends StringPrompt { + @Override public String getPromptText(ConversationContext context) { return "FirstPrompt"; } + @Override public Prompt acceptInput(ConversationContext context, String input) { assertEquals("FirstInput", input); context.setSessionData("data", 10); @@ -107,6 +109,7 @@ public class ConversationTest { return Prompt.END_OF_CONVERSATION; } + @Override public String getPromptText(ConversationContext context) { // Assert that session data passes from one prompt to the next assertEquals(context.getSessionData("data"), 10); diff --git a/paper-api/src/test/java/org/bukkit/conversations/FakeConversable.java b/paper-api/src/test/java/org/bukkit/conversations/FakeConversable.java index 8d8f34800a..1e6b48c772 100644 --- a/paper-api/src/test/java/org/bukkit/conversations/FakeConversable.java +++ b/paper-api/src/test/java/org/bukkit/conversations/FakeConversable.java @@ -15,29 +15,35 @@ public class FakeConversable implements Conversable { public Conversation abandonedConverstion; public ConversationAbandonedEvent abandonedConversationEvent; + @Override public boolean isConversing() { return false; } + @Override public void acceptConversationInput(String input) { } + @Override public boolean beginConversation(Conversation conversation) { begunConversation = conversation; conversation.outputNextPrompt(); return true; } + @Override public void abandonConversation(Conversation conversation) { abandonedConverstion = conversation; } + @Override public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) { abandonedConverstion = conversation; abandonedConversationEvent = details; } + @Override public void sendRawMessage(String message) { lastSentMessage = message; } diff --git a/paper-api/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java b/paper-api/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java index 0af8afd808..6093e9865b 100644 --- a/paper-api/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java +++ b/paper-api/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java @@ -57,6 +57,7 @@ public class ValidatingPromptTest { return null; } + @Override public String getPromptText(ConversationContext context) { return null; } @@ -75,6 +76,7 @@ public class ValidatingPromptTest { return null; } + @Override public String getPromptText(ConversationContext context) { return null; } @@ -89,6 +91,7 @@ public class ValidatingPromptTest { return null; } + @Override public String getPromptText(ConversationContext context) { return null; } @@ -107,6 +110,7 @@ public class ValidatingPromptTest { return null; } + @Override public String getPromptText(ConversationContext context) { return null; } diff --git a/paper-api/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java b/paper-api/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java index 2850a082b4..f94754e41a 100644 --- a/paper-api/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java +++ b/paper-api/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java @@ -44,6 +44,7 @@ public class LazyMetadataValueTest { @Test(expected=MetadataEvaluationException.class) public void testEvalException() { subject = new LazyMetadataValue(plugin, LazyMetadataValue.CacheStrategy.CACHE_AFTER_FIRST_EVAL, new Callable() { + @Override public Object call() throws Exception { throw new RuntimeException("Gotcha!"); } @@ -56,6 +57,7 @@ public class LazyMetadataValueTest { final Counter counter = new Counter(); final int value = 10; subject = new LazyMetadataValue(plugin, LazyMetadataValue.CacheStrategy.CACHE_AFTER_FIRST_EVAL, new Callable() { + @Override public Object call() throws Exception { counter.increment(); return value; @@ -77,6 +79,7 @@ public class LazyMetadataValueTest { final Counter counter = new Counter(); final int value = 10; subject = new LazyMetadataValue(plugin, LazyMetadataValue.CacheStrategy.NEVER_CACHE, new Callable() { + @Override public Object call() throws Exception { counter.increment(); return value; @@ -94,6 +97,7 @@ public class LazyMetadataValueTest { final Counter counter = new Counter(); final int value = 10; subject = new LazyMetadataValue(plugin, LazyMetadataValue.CacheStrategy.CACHE_ETERNALLY, new Callable() { + @Override public Object call() throws Exception { counter.increment(); return value; @@ -113,6 +117,7 @@ public class LazyMetadataValueTest { private LazyMetadataValue makeSimpleCallable(final Object value) { return new LazyMetadataValue(plugin, new Callable() { + @Override public Object call() throws Exception { return value; } diff --git a/paper-api/src/test/java/org/bukkit/metadata/MetadataStoreTest.java b/paper-api/src/test/java/org/bukkit/metadata/MetadataStoreTest.java index ffb8455851..12373ff16c 100644 --- a/paper-api/src/test/java/org/bukkit/metadata/MetadataStoreTest.java +++ b/paper-api/src/test/java/org/bukkit/metadata/MetadataStoreTest.java @@ -34,6 +34,7 @@ public class MetadataStoreTest { final Counter counter = new Counter(); subject.setMetadata("subject", "key", new LazyMetadataValue(pluginX, new Callable() { + @Override public Object call() throws Exception { counter.increment(); return 10; @@ -52,6 +53,7 @@ public class MetadataStoreTest { final Counter counter = new Counter(); subject.setMetadata("subject", "key", new LazyMetadataValue(pluginX, new Callable() { + @Override public Object call() throws Exception { counter.increment(); return 10; diff --git a/paper-api/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java b/paper-api/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java index d3026a4923..2d545f0e12 100644 --- a/paper-api/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java +++ b/paper-api/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java @@ -85,10 +85,12 @@ public class MetadataValueAdapterTest { super(owningPlugin); } + @Override public Object value() { return ++internalValue; } + @Override public void invalidate() { internalValue = 0; } diff --git a/paper-api/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/paper-api/src/test/java/org/bukkit/plugin/PluginManagerTest.java index 5e986de826..17dbe91392 100644 --- a/paper-api/src/test/java/org/bukkit/plugin/PluginManagerTest.java +++ b/paper-api/src/test/java/org/bukkit/plugin/PluginManagerTest.java @@ -41,6 +41,7 @@ public class PluginManagerTest { final Event event = new TestEvent(true); Thread secondThread = new Thread( new Runnable() { + @Override public void run() { try { synchronized (pm) { @@ -63,6 +64,7 @@ public class PluginManagerTest { final Event event = new TestEvent(true); Thread secondThread = new Thread( new Runnable() { + @Override public void run() { try { pm.callEvent(event); @@ -82,6 +84,7 @@ public class PluginManagerTest { final Event event = new TestEvent(false); Thread secondThread = new Thread( new Runnable() { + @Override public void run() { try { pm.callEvent(event); @@ -105,6 +108,7 @@ public class PluginManagerTest { final Event event = new TestEvent(false); Thread secondThread = new Thread( new Runnable() { + @Override public void run() { try { synchronized (pm) { diff --git a/paper-api/src/test/java/org/bukkit/plugin/TestPlugin.java b/paper-api/src/test/java/org/bukkit/plugin/TestPlugin.java index e6819e5868..6d45089718 100644 --- a/paper-api/src/test/java/org/bukkit/plugin/TestPlugin.java +++ b/paper-api/src/test/java/org/bukkit/plugin/TestPlugin.java @@ -22,82 +22,102 @@ public class TestPlugin extends PluginBase { this.enabled = enabled; } + @Override public File getDataFolder() { throw new UnsupportedOperationException("Not supported."); } + @Override public PluginDescriptionFile getDescription() { return new PluginDescriptionFile(pluginName, "1.0", "test.test"); } + @Override public FileConfiguration getConfig() { throw new UnsupportedOperationException("Not supported."); } + @Override public InputStream getResource(String filename) { throw new UnsupportedOperationException("Not supported."); } + @Override public void saveConfig() { throw new UnsupportedOperationException("Not supported."); } + @Override public void saveDefaultConfig() { throw new UnsupportedOperationException("Not supported."); } + @Override public void saveResource(String resourcePath, boolean replace) { throw new UnsupportedOperationException("Not supported."); } + @Override public void reloadConfig() { throw new UnsupportedOperationException("Not supported."); } + @Override public PluginLogger getLogger() { throw new UnsupportedOperationException("Not supported."); } + @Override public PluginLoader getPluginLoader() { throw new UnsupportedOperationException("Not supported."); } + @Override public Server getServer() { throw new UnsupportedOperationException("Not supported."); } + @Override public boolean isEnabled() { return enabled; } + @Override public void onDisable() { throw new UnsupportedOperationException("Not supported."); } + @Override public void onLoad() { throw new UnsupportedOperationException("Not supported."); } + @Override public void onEnable() { throw new UnsupportedOperationException("Not supported."); } + @Override public boolean isNaggable() { throw new UnsupportedOperationException("Not supported."); } + @Override public void setNaggable(boolean canNag) { throw new UnsupportedOperationException("Not supported."); } + @Override public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) { throw new UnsupportedOperationException("Not supported."); } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { throw new UnsupportedOperationException("Not supported."); } + @Override public List onTabComplete(CommandSender sender, Command command, String alias, String[] args) { throw new UnsupportedOperationException("Not supported."); } diff --git a/paper-api/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java b/paper-api/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java index f2758cd3d4..351fc4a9f4 100644 --- a/paper-api/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java +++ b/paper-api/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java @@ -18,6 +18,7 @@ public class TimedRegisteredListenerTest { public void testEventClass() throws EventException { Listener listener = new Listener() {}; EventExecutor executor = new EventExecutor() { + @Override public void execute(Listener listener, Event event) {} }; TestPlugin plugin = new TestPlugin("Test"); diff --git a/paper-api/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java b/paper-api/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java index 10370c3e8b..7a5b6108d5 100644 --- a/paper-api/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java +++ b/paper-api/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java @@ -13,6 +13,7 @@ public class TestMessageListener implements PluginMessageListener { this.message = message; } + @Override public void onPluginMessageReceived(String channel, Player player, byte[] message) { assertEquals(this.channel, channel); assertArrayEquals(this.message, message); diff --git a/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java b/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java index c4ed33fc0b..1b7642dc1c 100644 --- a/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java +++ b/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java @@ -39,6 +39,7 @@ public final class TestPlayer implements InvocationHandler { } } + @Override public Object invoke(Object proxy, Method method, Object[] args) { MethodHandler handler = methods.get(method); if (handler != null) {