mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Consistenty use javax annotations. (#1197)
- Unfortunately jetbrains annotations seem to be exposed transitively via core somewhere, but with the correct IDE settings, annotations can be defaulted to javax - Cleaning up of import order in #1195 - Must be merged before #1195 Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
@ -67,7 +67,6 @@ dependencies {
|
||||
})
|
||||
implementation("org.apache.logging.log4j:log4j-api")
|
||||
compileOnly("org.spigotmc:spigot:1.17-R0.1-SNAPSHOT")
|
||||
compileOnly("org.jetbrains:annotations:21.0.0")
|
||||
implementation("io.papermc:paperlib:1.0.6")
|
||||
compileOnly("com.sk89q:dummypermscompat:1.10") {
|
||||
exclude("com.github.MilkBowl", "VaultAPI")
|
||||
|
@ -5,14 +5,14 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class DelegateLock extends ReentrantLockWithGetOwner {
|
||||
private final ReentrantLock parent;
|
||||
private volatile boolean modified;
|
||||
private final AtomicInteger count;
|
||||
|
||||
public DelegateLock(@NotNull ReentrantLock parent) {
|
||||
public DelegateLock(@Nonnull ReentrantLock parent) {
|
||||
this.parent = parent;
|
||||
this.count = null;
|
||||
}
|
||||
|
@ -8,11 +8,11 @@ import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
|
||||
import com.fastasyncworldedit.core.configuration.Settings;
|
||||
import com.fastasyncworldedit.core.extent.processor.lighting.RelightMode;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class NMSRelighterFactory implements RelighterFactory {
|
||||
@Override
|
||||
public @NotNull Relighter createRelighter(RelightMode relightMode, World world, IQueueExtent<IQueueChunk> queue) {
|
||||
public @Nonnull Relighter createRelighter(RelightMode relightMode, World world, IQueueExtent<IQueueChunk> queue) {
|
||||
return new NMSRelighter(queue,
|
||||
relightMode != null ? relightMode : RelightMode.valueOf(Settings.IMP.LIGHTING.MODE));
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.PluginBase;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginLoader;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
@ -95,26 +95,26 @@ public class PluginPreloader extends PluginBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Nonnull
|
||||
public File getDataFolder() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Nonnull
|
||||
public PluginDescriptionFile getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Nonnull
|
||||
public FileConfiguration getConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public InputStream getResource(@NotNull String filename) {
|
||||
public InputStream getResource(@Nonnull String filename) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public class PluginPreloader extends PluginBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveResource(@NotNull String resourcePath, boolean replace) {
|
||||
public void saveResource(@Nonnull String resourcePath, boolean replace) {
|
||||
|
||||
}
|
||||
|
||||
@ -139,13 +139,13 @@ public class PluginPreloader extends PluginBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Nonnull
|
||||
public PluginLoader getPluginLoader() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Nonnull
|
||||
public Server getServer() {
|
||||
return null;
|
||||
}
|
||||
@ -182,24 +182,24 @@ public class PluginPreloader extends PluginBase {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, @Nullable String id) {
|
||||
public ChunkGenerator getDefaultWorldGenerator(@Nonnull String worldName, @Nullable String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Nonnull
|
||||
public Logger getLogger() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
public boolean onCommand(@Nonnull CommandSender sender, @Nonnull Command command, @Nonnull String label, String[] args) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(@Nonnull CommandSender sender, @Nonnull Command command, @Nonnull String alias, String[] args) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -84,9 +84,9 @@ public class FaweDelegateRegionManager {
|
||||
return hpw.getType() != PlotAreaType.AUGMENTED || hpw.getTerrain() == PlotAreaTerrainType.NONE;
|
||||
}
|
||||
|
||||
public boolean handleClear(@NotNull Plot plot,
|
||||
public boolean handleClear(@Nonnull Plot plot,
|
||||
@Nullable Runnable whenDone,
|
||||
@NotNull PlotManager manager) {
|
||||
@Nonnull PlotManager manager) {
|
||||
TaskManager.IMP.async(() -> {
|
||||
synchronized (FaweDelegateRegionManager.class) {
|
||||
final HybridPlotWorld hybridPlotWorld = ((HybridPlotManager) manager).getHybridPlotWorld();
|
||||
|
@ -33,7 +33,7 @@ import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import net.jpountz.lz4.LZ4BlockInputStream;
|
||||
import org.anarres.parallelgzip.ParallelGZIPOutputStream;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
@ -190,7 +190,7 @@ public class FaweDelegateSchematicHandler {
|
||||
}, whenDone);
|
||||
}
|
||||
|
||||
public Schematic getSchematic(@NotNull InputStream is) {
|
||||
public Schematic getSchematic(@Nonnull InputStream is) {
|
||||
try {
|
||||
FastSchematicReader schematicReader = new FastSchematicReader(
|
||||
new NBTInputStream(new BufferedInputStream(new GZIPInputStream(new BufferedInputStream(is)))));
|
||||
|
@ -18,8 +18,8 @@ import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -76,7 +76,7 @@ public class FaweQueueCoordinator extends QueueCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBiome(int x, int y, int z, @NotNull BiomeType biome) {
|
||||
public boolean setBiome(int x, int y, int z, @Nonnull BiomeType biome) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -86,23 +86,23 @@ public class FaweQueueCoordinator extends QueueCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setEntity(@NotNull Entity entity) {
|
||||
public boolean setEntity(@Nonnull Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BlockVector2> getReadChunks() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addReadChunks(@NotNull Set<BlockVector2> readChunks) {
|
||||
public void addReadChunks(@Nonnull Set<BlockVector2> readChunks) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addReadChunk(@NotNull BlockVector2 chunk) {
|
||||
public void addReadChunk(@Nonnull BlockVector2 chunk) {
|
||||
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public class FaweQueueCoordinator extends QueueCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRegenRegion(@NotNull CuboidRegion regenRegion) {
|
||||
public void setRegenRegion(@Nonnull CuboidRegion regenRegion) {
|
||||
|
||||
}
|
||||
|
||||
@ -161,16 +161,16 @@ public class FaweQueueCoordinator extends QueueCoordinator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChunkConsumer(@NotNull Consumer<BlockVector2> consumer) {
|
||||
public void setChunkConsumer(@Nonnull Consumer<BlockVector2> consumer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addProgressSubscriber(@NotNull ProgressSubscriber progressSubscriber) {
|
||||
public void addProgressSubscriber(@Nonnull ProgressSubscriber progressSubscriber) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
@Override
|
||||
public LightingMode getLightingMode() {
|
||||
return null;
|
||||
|
@ -4,7 +4,7 @@ import com.fastasyncworldedit.core.util.TaskManager;
|
||||
import org.apache.commons.lang.mutable.MutableInt;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BukkitTaskManager extends TaskManager {
|
||||
|
||||
@ -15,34 +15,34 @@ public class BukkitTaskManager extends TaskManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int repeat(@NotNull final Runnable runnable, final int interval) {
|
||||
public int repeat(@Nonnull final Runnable runnable, final int interval) {
|
||||
return this.plugin.getServer().getScheduler().scheduleSyncRepeatingTask(this.plugin, runnable, interval, interval);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int repeatAsync(@NotNull final Runnable runnable, final int interval) {
|
||||
public int repeatAsync(@Nonnull final Runnable runnable, final int interval) {
|
||||
return this.plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(this.plugin, runnable, interval, interval);
|
||||
}
|
||||
|
||||
public MutableInt index = new MutableInt(0);
|
||||
|
||||
@Override
|
||||
public void async(@NotNull final Runnable runnable) {
|
||||
public void async(@Nonnull final Runnable runnable) {
|
||||
this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, runnable).getTaskId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void task(@NotNull final Runnable runnable) {
|
||||
public void task(@Nonnull final Runnable runnable) {
|
||||
this.plugin.getServer().getScheduler().runTask(this.plugin, runnable).getTaskId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void later(@NotNull final Runnable runnable, final int delay) {
|
||||
public void later(@Nonnull final Runnable runnable, final int delay) {
|
||||
this.plugin.getServer().getScheduler().runTaskLater(this.plugin, runnable, delay).getTaskId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void laterAsync(@NotNull final Runnable runnable, final int delay) {
|
||||
public void laterAsync(@Nonnull final Runnable runnable, final int delay) {
|
||||
this.plugin.getServer().getScheduler().runTaskLaterAsynchronously(this.plugin, runnable, delay);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.fastasyncworldedit.bukkit.util;
|
||||
|
||||
import com.google.common.collect.ComparisonChain;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Utility class for retrieving and comparing minecraft server versions.
|
||||
@ -107,7 +107,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull MinecraftVersion other) {
|
||||
public int compareTo(@Nonnull MinecraftVersion other) {
|
||||
if (other.equals(this)) {
|
||||
return 0;
|
||||
}
|
||||
@ -140,4 +140,4 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
return fullPackagePath.substring(fullPackagePath.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
@ -430,7 +430,7 @@ public enum BukkitAdapter {
|
||||
* @param blockData The Bukkit BlockData
|
||||
* @return The WorldEdit BlockState
|
||||
*/
|
||||
public static BlockState adapt(@NotNull BlockData blockData) {
|
||||
public static BlockState adapt(@Nonnull BlockData blockData) {
|
||||
//FAWE start - logic moved to IBukkitAdapter
|
||||
return getAdapter().adapt(blockData);
|
||||
//FAWE end
|
||||
@ -444,7 +444,7 @@ public enum BukkitAdapter {
|
||||
* @param block The WorldEdit BlockStateHolder
|
||||
* @return The Bukkit BlockData
|
||||
*/
|
||||
public static BlockData adapt(@NotNull BlockStateHolder block) {
|
||||
public static BlockData adapt(@Nonnull BlockStateHolder block) {
|
||||
//FAWE start - logic moved to IBukkitAdapter
|
||||
return getAdapter().adapt(block);
|
||||
//FAWE end
|
||||
|
@ -36,7 +36,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Locale;
|
||||
|
@ -45,7 +45,7 @@ import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.enginehub.piston.CommandManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -264,7 +264,7 @@ public class BukkitServerInterface extends AbstractPlatform implements MultiUser
|
||||
|
||||
//FAWE start
|
||||
@Override
|
||||
public @NotNull RelighterFactory getRelighterFactory() {
|
||||
public @Nonnull RelighterFactory getRelighterFactory() {
|
||||
if (this.relighterFactory == null) {
|
||||
this.relighterFactory = this.plugin.getBukkitImplAdapter().getRelighterFactory();
|
||||
LOGGER.info("Using " + this.relighterFactory.getClass().getCanonicalName() + " as relighter factory.");
|
||||
|
@ -37,7 +37,7 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TestOfflinePermissible implements OfflinePlayer, Permissible {
|
||||
private boolean op;
|
||||
@ -201,106 +201,106 @@ public class TestOfflinePermissible implements OfflinePlayer, Permissible {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
|
||||
public void incrementStatistic(@Nonnull Statistic statistic) throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
|
||||
public void decrementStatistic(@Nonnull Statistic statistic) throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incrementStatistic(@NotNull Statistic statistic, int amount)
|
||||
public void incrementStatistic(@Nonnull Statistic statistic, int amount)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decrementStatistic(@NotNull Statistic statistic, int amount)
|
||||
public void decrementStatistic(@Nonnull Statistic statistic, int amount)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStatistic(@NotNull Statistic statistic, int newValue)
|
||||
public void setStatistic(@Nonnull Statistic statistic, int newValue)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
|
||||
public int getStatistic(@Nonnull Statistic statistic) throws IllegalArgumentException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material)
|
||||
public void incrementStatistic(@Nonnull Statistic statistic, @Nonnull Material material)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material)
|
||||
public void decrementStatistic(@Nonnull Statistic statistic, @Nonnull Material material)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatistic(@NotNull Statistic statistic, @NotNull Material material)
|
||||
public int getStatistic(@Nonnull Statistic statistic, @Nonnull Material material)
|
||||
throws IllegalArgumentException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material,
|
||||
public void incrementStatistic(@Nonnull Statistic statistic, @Nonnull Material material,
|
||||
int amount) throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material,
|
||||
public void decrementStatistic(@Nonnull Statistic statistic, @Nonnull Material material,
|
||||
int amount) throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStatistic(@NotNull Statistic statistic, @NotNull Material material, int newValue)
|
||||
public void setStatistic(@Nonnull Statistic statistic, @Nonnull Material material, int newValue)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType)
|
||||
public void incrementStatistic(@Nonnull Statistic statistic, @Nonnull EntityType entityType)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType)
|
||||
public void decrementStatistic(@Nonnull Statistic statistic, @Nonnull EntityType entityType)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType)
|
||||
public int getStatistic(@Nonnull Statistic statistic, @Nonnull EntityType entityType)
|
||||
throws IllegalArgumentException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType,
|
||||
public void incrementStatistic(@Nonnull Statistic statistic, @Nonnull EntityType entityType,
|
||||
int amount) throws IllegalArgumentException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType,
|
||||
public void decrementStatistic(@Nonnull Statistic statistic, @Nonnull EntityType entityType,
|
||||
int amount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType,
|
||||
public void setStatistic(@Nonnull Statistic statistic, @Nonnull EntityType entityType,
|
||||
int newValue) {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user