Replace JB occurrences with JSR 305 (for now) (#1651)

* refactor: Replace JB occurrences with JSR 305 (for now)

* chore: Update adapter jar
Dieser Commit ist enthalten in:
Alex 2022-03-10 14:24:44 +01:00 committet von GitHub
Ursprung f59353006a
Commit 5d18e15128
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
16 geänderte Dateien mit 30 neuen und 31 gelöschten Zeilen

Datei anzeigen

@ -997,7 +997,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
@Override
public void onStatusChange(ChunkPos pos, @org.jetbrains.annotations.Nullable ChunkStatus status) {
public void onStatusChange(ChunkPos pos, @Nullable ChunkStatus status) {
}
@Override

Datei anzeigen

@ -58,9 +58,8 @@ import org.bukkit.World;
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Arrays;
@ -387,7 +386,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
return false;
}
@NotNull
@Nonnull
@Override
public Iterator<CompoundTag> iterator() {
Iterable<CompoundTag> result = StreamSupport.stream(Iterables.concat(slices).spliterator(), false).map(input -> {

Datei anzeigen

@ -990,7 +990,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
@Override
public void onStatusChange(ChunkPos pos, @org.jetbrains.annotations.Nullable ChunkStatus status) {
public void onStatusChange(ChunkPos pos, @Nullable ChunkStatus status) {
}
@Override

Datei anzeigen

@ -59,8 +59,8 @@ import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R1.block.CraftBlock;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Arrays;
@ -374,7 +374,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
return false;
}
@NotNull
@Nonnull
@Override
public Iterator<CompoundTag> iterator() {
Iterable<CompoundTag> result = StreamSupport.stream(Iterables.concat(slices).spliterator(), false).map(input -> {

Datei anzeigen

@ -51,10 +51,10 @@ import net.minecraft.world.level.chunk.SingleValuePalette;
import net.minecraft.world.level.gameevent.GameEventDispatcher;
import net.minecraft.world.level.gameevent.GameEventListener;
import org.bukkit.craftbukkit.v1_18_R1.CraftChunk;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import sun.misc.Unsafe;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Constructor;
@ -608,7 +608,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
return null;
}
@NotNull
@Nonnull
@Override
public Iterator<net.minecraft.world.level.block.state.BlockState> iterator() {
return Collections.emptyIterator();
@ -629,7 +629,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
return null;
}
@NotNull
@Nonnull
@Override
public Iterator<Biome> iterator() {
return Collections.emptyIterator();

Datei anzeigen

@ -960,7 +960,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
@Override
public void onStatusChange(ChunkPos pos, @org.jetbrains.annotations.Nullable ChunkStatus status) {
public void onStatusChange(ChunkPos pos, @Nullable ChunkStatus status) {
}
@Override

Datei anzeigen

@ -60,8 +60,8 @@ import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.block.CraftBlock;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Arrays;
@ -375,7 +375,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
return false;
}
@NotNull
@Nonnull
@Override
public Iterator<CompoundTag> iterator() {
Iterable<CompoundTag> result = StreamSupport.stream(Iterables.concat(slices).spliterator(), false).map(input -> {

Datei anzeigen

@ -52,10 +52,10 @@ import net.minecraft.world.level.chunk.SingleValuePalette;
import net.minecraft.world.level.gameevent.GameEventDispatcher;
import net.minecraft.world.level.gameevent.GameEventListener;
import org.bukkit.craftbukkit.v1_18_R2.CraftChunk;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import sun.misc.Unsafe;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Constructor;
@ -621,7 +621,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
return null;
}
@NotNull
@Nonnull
@Override
public Iterator<net.minecraft.world.level.block.state.BlockState> iterator() {
return Collections.emptyIterator();
@ -642,7 +642,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
return null;
}
@NotNull
@Nonnull
@Override
public Iterator<Biome> iterator() {
return Collections.emptyIterator();

Datei anzeigen

@ -7,8 +7,8 @@ import com.fastasyncworldedit.core.extent.transform.RandomTransform;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.stream.Stream;
public class Linear3DTransformParser extends RichParser<ResettableExtent> {
@ -31,7 +31,7 @@ public class Linear3DTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
protected ResettableExtent parseFromInput(@Nonnull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length != 1) {
return null;
}

Datei anzeigen

@ -7,8 +7,8 @@ import com.fastasyncworldedit.core.extent.transform.RandomTransform;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.stream.Stream;
public class LinearTransformParser extends RichParser<ResettableExtent> {
@ -31,7 +31,7 @@ public class LinearTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
protected ResettableExtent parseFromInput(@Nonnull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length != 1) {
return null;
}

Datei anzeigen

@ -8,8 +8,8 @@ import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.function.pattern.Pattern;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.stream.Stream;
public class PatternTransformParser extends RichParser<ResettableExtent> {
@ -34,7 +34,7 @@ public class PatternTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
protected ResettableExtent parseFromInput(@Nonnull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length > 2) {
return null;
}

Datei anzeigen

@ -9,8 +9,8 @@ import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
import com.sk89q.worldedit.math.transform.AffineTransform;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.stream.Stream;
public class RotateTransformParser extends RichParser<ResettableExtent> {
@ -36,7 +36,7 @@ public class RotateTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
protected ResettableExtent parseFromInput(@Nonnull String[] arguments, ParserContext context) throws InputParseException {
AffineTransform transform = new AffineTransform();
Extent extent;
if (arguments.length == 1) {

Datei anzeigen

@ -8,8 +8,8 @@ import com.sk89q.worldedit.command.util.SuggestionHelper;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extent.Extent;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.stream.Stream;
public class ScaleTransformParser extends RichParser<ResettableExtent> {
@ -34,7 +34,7 @@ public class ScaleTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
protected ResettableExtent parseFromInput(@Nonnull String[] arguments, ParserContext context) throws InputParseException {
double xScale;
double yScale;
double zScale;

Datei anzeigen

@ -8,8 +8,8 @@ import com.sk89q.worldedit.command.util.SuggestionHelper;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extent.Extent;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.stream.Stream;
public class SpreadTransformParser extends RichParser<ResettableExtent> {
@ -34,7 +34,7 @@ public class SpreadTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
protected ResettableExtent parseFromInput(@Nonnull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length != 3 && arguments.length != 4) {
return null;
}

Datei anzeigen

@ -11,8 +11,8 @@ import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.registry.Registries;
import org.enginehub.piston.CommandManager;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
import java.util.EnumMap;
import java.util.Map;
import java.util.Set;