chore: Replace AnnotationHelper class (#3706)

This commit is contained in:
Alexander Brandes 2022-06-21 19:09:17 +02:00 committed by GitHub
parent dda52ebc2e
commit f27009216c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 75 deletions

View File

@ -50,6 +50,7 @@ dependencies {
implementation(libs.arkitektonika)
implementation(libs.http4j)
implementation("com.intellectualsites.paster:Paster")
implementation("com.intellectualsites.informative-annotations:informative-annotations")
// Adventure
implementation("net.kyori:adventure-platform-bukkit")
@ -87,6 +88,7 @@ tasks.named<ShadowJar>("shadowJar") {
relocate("javax.inject", "com.plotsquared.core.annotation.inject")
relocate("net.jcip", "com.plotsquared.core.annotations.jcip")
relocate("edu.umd.cs.findbugs", "com.plotsquared.core.annotations.findbugs")
relocate("com.intellectualsites.informative-annotations", "com.plotsquared.core.annotation.informative")
// Get rid of all the libs which are 100% unused.
minimize()

View File

@ -19,12 +19,12 @@
package com.plotsquared.bukkit.queue;
import com.google.common.base.Preconditions;
import com.intellectualsites.annotations.DoNotUse;
import com.plotsquared.bukkit.util.BukkitBlockUtil;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.util.AnnotationHelper;
import com.plotsquared.core.util.ChunkUtil;
import com.plotsquared.core.util.PatternUtil;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
@ -44,7 +44,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Arrays;
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
@DoNotUse
public class GenChunk extends ScopedQueueCoordinator {
public final Biome[] biomes;

View File

@ -43,6 +43,7 @@ dependencies {
api(libs.cloudServices)
api(libs.arkitektonika)
api("com.intellectualsites.paster:Paster")
api("com.intellectualsites.informative-annotations:informative-annotations")
}
tasks.processResources {
@ -62,5 +63,6 @@ tasks {
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
opt.links("https://checkerframework.org/api/")
opt.links("https://javadoc.io/doc/com.intellectualsites.informative-annotations/informative-annotations/latest/")
}
}

View File

@ -22,6 +22,7 @@ import cloud.commandframework.services.ServicePipeline;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
import com.intellectualsites.annotations.DoNotUse;
import com.plotsquared.core.backup.BackupManager;
import com.plotsquared.core.configuration.caption.LocaleHolder;
import com.plotsquared.core.generator.GeneratorWrapper;
@ -33,7 +34,6 @@ import com.plotsquared.core.permissions.PermissionHandler;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.util.AnnotationHelper;
import com.plotsquared.core.util.ChunkManager;
import com.plotsquared.core.util.EconHandler;
import com.plotsquared.core.util.PlatformWorldManager;
@ -308,7 +308,7 @@ public interface PlotPlatform<P> extends LocaleHolder {
* @return worldedit implementations
* @since 6.3.0
*/
@AnnotationHelper.ApiDescription(info = "Internal use only")
@DoNotUse
@NonNull String worldEditImplementations();
/**

View File

@ -20,6 +20,7 @@ package com.plotsquared.core.generator;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.intellectualsites.annotations.DoNotUse;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.Settings;
@ -33,7 +34,6 @@ import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.plot.PlotManager;
import com.plotsquared.core.plot.schematic.Schematic;
import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.util.AnnotationHelper;
import com.plotsquared.core.util.FileUtils;
import com.plotsquared.core.util.MathMan;
import com.plotsquared.core.util.SchematicHandler;
@ -531,7 +531,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
*
* @since 6.9.0
*/
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
@DoNotUse
public @Nullable List<Entity> getPlotSchematicEntities() {
return schem3Entities;
}
@ -541,7 +541,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
*
* @since 6.9.0
*/
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
@DoNotUse
public @Nullable BlockVector3 getPlotSchematicMinPoint() {
return schem3MinPoint;
}
@ -551,7 +551,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
*
* @since 6.9.0
*/
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
@DoNotUse
public boolean populationNeeded() {
return schem1PopulationNeeded || schem2PopulationNeeded || schem3PopulationNeeded;
}

View File

@ -18,7 +18,7 @@
*/
package com.plotsquared.core.location;
import com.plotsquared.core.util.AnnotationHelper;
import com.intellectualsites.annotations.DoNotUse;
import com.sk89q.worldedit.math.BlockVector3;
import org.checkerframework.checker.nullness.qual.NonNull;
@ -28,7 +28,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
*
* @since 6.9.0
*/
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
@DoNotUse
public final class UncheckedWorldLocation extends Location {
private final String worldName;
@ -54,7 +54,7 @@ public final class UncheckedWorldLocation extends Location {
*
* @since 6.9.0
*/
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
@DoNotUse
public static @NonNull UncheckedWorldLocation at(
final @NonNull String world, final int x, final int y, final int z
) {
@ -62,7 +62,7 @@ public final class UncheckedWorldLocation extends Location {
}
@Override
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
@DoNotUse
public @NonNull String getWorldName() {
return this.worldName;
}

View File

@ -20,8 +20,8 @@ package com.plotsquared.core.plot.flag;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.intellectualsites.annotations.NotPublic;
import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.util.AnnotationHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.checkerframework.checker.nullness.qual.NonNull;
@ -32,7 +32,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
/**
* Container type for {@link PlotFlag plot flags}.
@ -353,7 +352,7 @@ public class FlagContainer {
* @return a new Runnable that cleans up once the FlagContainer isn't needed anymore.
* @since 6.0.10
*/
@AnnotationHelper.ApiDescription(info = "This method should not be considered as public or API.")
@NotPublic
public Runnable createCleanupHook() {
return () -> GlobalFlagContainer.getInstance().unsubscribe(unknownsRef);
}

View File

@ -18,8 +18,8 @@
*/
package com.plotsquared.core.queue;
import com.intellectualsites.annotations.DoNotUse;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.util.AnnotationHelper;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
@ -37,7 +37,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
* in {@link BlockArrayCacheScopedQueueCoordinator#setOffsetX(int)} and
* {@link BlockArrayCacheScopedQueueCoordinator#setOffsetZ(int)}
*/
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to change at any time and created for specific use cases.")
@DoNotUse
public class BlockArrayCacheScopedQueueCoordinator extends ScopedQueueCoordinator {
private final BlockState[][][] blockStates;

View File

@ -1,55 +0,0 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.core.util;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.MODULE;
import static java.lang.annotation.ElementType.PACKAGE;
import static java.lang.annotation.ElementType.RECORD_COMPONENT;
import static java.lang.annotation.ElementType.TYPE;
/**
* @since 6.2.2
*/
@AnnotationHelper.ApiDescription(info = "An internal class for custom annotations." +
"This is in no form part of the API and is subject to change at any time.")
public final class AnnotationHelper {
private AnnotationHelper() {
}
@Documented
@Retention(RetentionPolicy.CLASS)
@Target(value = {METHOD, PACKAGE, MODULE, RECORD_COMPONENT, TYPE})
public @interface ApiDescription {
/**
* Returns additional information how to use a class for the API
*
* @return the version string
* @since 6.2.2
*/
String info() default "";
}
}

View File

@ -19,6 +19,7 @@
package com.plotsquared.core.util;
import com.google.common.eventbus.EventBus;
import com.intellectualsites.annotations.DoNotUse;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlayerAutoPlotEvent;
@ -81,8 +82,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
@AnnotationHelper.ApiDescription(info = "This is an internal class used by PlotSquared to dispatch events." +
"This is in no form part of the API and is subject to change at any time.")
@DoNotUse
public class EventDispatcher {
private final EventBus eventBus = new EventBus("PlotSquaredEvents");

View File

@ -65,7 +65,7 @@ subprojects {
}
dependencies {
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.5"))
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.7"))
}
dependencies {