Compare commits

..

7 Commits

Author SHA1 Message Date
c7795e505b fix: return on null plot on big boom
- Fixes #4084
2023-06-21 22:35:01 +01:00
9d43434e40 Add 1.20.1 to the issue template 2023-06-17 18:45:42 +02:00
4f421167d1 Move renovate to .github folder 2023-06-17 18:43:53 +02:00
94f4619c2c Publish javadocs for v7 2023-06-15 17:30:27 +02:00
9885d3e506 Fill in 'since' annotations 2023-06-15 17:24:21 +02:00
a54276d3b2 Strip legacy color codes if message cannot be parsed by MiniMessage (#4077) 2023-06-15 10:23:09 +02:00
cbb284b0fd Properly drop unsupported biomes from biome list (#4074)
* Drop CUSTOM from biome list

* Drop cherry_grove if present on pre 1.20 versions
2023-06-14 15:12:34 +02:00
16 changed files with 35 additions and 22 deletions

View File

@ -27,6 +27,7 @@ body:
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first. description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
multiple: false multiple: false
options: options:
- '1.20.1'
- '1.20' - '1.20'
- '1.19.4' - '1.19.4'
- '1.19.3' - '1.19.3'

View File

@ -42,7 +42,7 @@ jobs:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish core javadoc - name: Publish core javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}} # if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
uses: cpina/github-action-push-to-another-repository@main uses: cpina/github-action-push-to-another-repository@main
env: env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
@ -54,7 +54,7 @@ jobs:
target-branch: main target-branch: main
target-directory: v7/core target-directory: v7/core
- name: Publish bukkit javadoc - name: Publish bukkit javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}} # if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
uses: cpina/github-action-push-to-another-repository@main uses: cpina/github-action-push-to-another-repository@main
env: env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}

View File

@ -290,7 +290,7 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
*/ */
@SuppressWarnings("deprecation") // The entire method is deprecated, but kept for compatibility with <=1.16.2 @SuppressWarnings("deprecation") // The entire method is deprecated, but kept for compatibility with <=1.16.2
@Override @Override
@Deprecated(since = "TODO") @Deprecated(since = "7.0.0")
public @NonNull ChunkData generateChunkData( public @NonNull ChunkData generateChunkData(
@NonNull World world, @NonNull Random random, int x, int z, @NonNull BiomeGrid biome @NonNull World world, @NonNull Random random, int x, int z, @NonNull BiomeGrid biome
) { ) {

View File

@ -1116,6 +1116,7 @@ public class BlockEventListener implements Listener {
if (plot != null) { if (plot != null) {
plot.debug("Explosion was cancelled because explosion = false"); plot.debug("Explosion was cancelled because explosion = false");
} }
return;
} }
event.blockList().removeIf(blox -> !plot.equals(area.getOwnedPlot(BukkitUtil.adapt(blox.getLocation())))); event.blockList().removeIf(blox -> !plot.equals(area.getOwnedPlot(BukkitUtil.adapt(blox.getLocation()))));
} }

View File

@ -32,7 +32,7 @@ import java.util.stream.Stream;
* MiniMessage changed the syntax between major releases. To warrant a smooth upgrade, we attempt to replace any occurrences * MiniMessage changed the syntax between major releases. To warrant a smooth upgrade, we attempt to replace any occurrences
* while loading PlotSquared. * while loading PlotSquared.
* *
* @since TODO * @since 7.0.0
*/ */
@NotPublic @NotPublic
public class TranslationUpdateManager { public class TranslationUpdateManager {

View File

@ -40,7 +40,7 @@ public interface Caption {
* *
* @param localeHolder Locale holder * @param localeHolder Locale holder
* @return {@link ComponentLike} * @return {@link ComponentLike}
* @since TODO * @since 7.0.0
*/ */
@NonNull Component toComponent(@NonNull LocaleHolder localeHolder); @NonNull Component toComponent(@NonNull LocaleHolder localeHolder);

View File

@ -51,7 +51,7 @@ public class CaptionHolder {
* Get the {@link TagResolver}s to use when resolving tags in the {@link Caption}. * Get the {@link TagResolver}s to use when resolving tags in the {@link Caption}.
* *
* @return The tag resolvers to use. * @return The tag resolvers to use.
* @since TODO * @since 7.0.0
*/ */
public TagResolver[] getTagResolvers() { public TagResolver[] getTagResolvers() {
return this.tagResolvers; return this.tagResolvers;
@ -61,7 +61,7 @@ public class CaptionHolder {
* Set the {@link TagResolver}s to use when resolving tags in the {@link Caption}. * Set the {@link TagResolver}s to use when resolving tags in the {@link Caption}.
* *
* @param tagResolvers The tag resolvers to use. * @param tagResolvers The tag resolvers to use.
* @since TODO * @since 7.0.0
*/ */
public void setTagResolvers(TagResolver... tagResolvers) { public void setTagResolvers(TagResolver... tagResolvers) {
this.tagResolvers = tagResolvers; this.tagResolvers = tagResolvers;

View File

@ -28,16 +28,20 @@ import com.plotsquared.core.plot.flag.implementations.PlotTitleFlag;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.ParsingException;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Set; import java.util.Set;
import java.util.regex.Pattern;
import static com.plotsquared.core.configuration.caption.ComponentTransform.nested; import static com.plotsquared.core.configuration.caption.ComponentTransform.nested;
import static com.plotsquared.core.configuration.caption.ComponentTransform.stripClicks; import static com.plotsquared.core.configuration.caption.ComponentTransform.stripClicks;
public class CaptionUtility { public class CaptionUtility {
private static final Pattern LEGACY_FORMATTING = Pattern.compile("§[a-gklmnor0-9]");
// flags which values are parsed by minimessage // flags which values are parsed by minimessage
private static final Set<Class<? extends PlotFlag<?, ?>>> MINI_MESSAGE_FLAGS = Set.of( private static final Set<Class<? extends PlotFlag<?, ?>>> MINI_MESSAGE_FLAGS = Set.of(
GreetingFlag.class, GreetingFlag.class,
@ -100,7 +104,14 @@ public class CaptionUtility {
*/ */
public static String stripClickEvents(final @NonNull String miniMessageString) { public static String stripClickEvents(final @NonNull String miniMessageString) {
// parse, transform and serialize again // parse, transform and serialize again
Component component = MiniMessage.miniMessage().deserialize(miniMessageString); Component component;
try {
component = MiniMessage.miniMessage().deserialize(miniMessageString);
} catch (ParsingException e) {
// if the String cannot be parsed, we try stripping legacy colors
String legacyStripped = LEGACY_FORMATTING.matcher(miniMessageString).replaceAll("");
component = MiniMessage.miniMessage().deserialize(legacyStripped);
}
component = CLICK_STRIP_TRANSFORM.transform(component); component = CLICK_STRIP_TRANSFORM.transform(component);
return MiniMessage.miniMessage().serialize(component); return MiniMessage.miniMessage().serialize(component);
} }

View File

@ -46,7 +46,7 @@ public abstract class IndependentPlotGenerator {
* @param result Queue to write to * @param result Queue to write to
* @param settings PlotArea (settings) * @param settings PlotArea (settings)
* @param biomes If biomes should be generated * @param biomes If biomes should be generated
* @since TODO * @since 7.0.0
*/ */
public abstract void generateChunk(ZeroedDelegateScopedQueueCoordinator result, PlotArea settings, boolean biomes); public abstract void generateChunk(ZeroedDelegateScopedQueueCoordinator result, PlotArea settings, boolean biomes);
@ -55,7 +55,7 @@ public abstract class IndependentPlotGenerator {
* *
* @param result Queue to write to * @param result Queue to write to
* @param setting PlotArea (settings) * @param setting PlotArea (settings)
* @since TODO * @since 7.0.0
*/ */
public void populateChunk(ZeroedDelegateScopedQueueCoordinator result, PlotArea setting) { public void populateChunk(ZeroedDelegateScopedQueueCoordinator result, PlotArea setting) {
} }
@ -108,7 +108,7 @@ public abstract class IndependentPlotGenerator {
* @param y World y position * @param y World y position
* @param z World z position * @param z World z position
* @return Biome type to be generated * @return Biome type to be generated
* @since TODO * @since 7.0.0
*/ */
public abstract BiomeType getBiome(PlotArea settings, int x, int y, int z); public abstract BiomeType getBiome(PlotArea settings, int x, int y, int z);

View File

@ -88,7 +88,7 @@ public abstract class PlotFlag<T, F extends PlotFlag<T, F>> {
* Gets the flag name as a Kyori {@link Component} * Gets the flag name as a Kyori {@link Component}
* *
* @see #getFlagName(Class) * @see #getFlagName(Class)
* @since TODO * @since 7.0.0
*/ */
public static <T, F extends PlotFlag<T, F>> Component getFlagNameComponent(Class<F> flagClass) { public static <T, F extends PlotFlag<T, F>> Component getFlagNameComponent(Class<F> flagClass) {
return Component.text(getFlagName(flagClass)); return Component.text(getFlagName(flagClass));

View File

@ -111,7 +111,7 @@ public interface PlotAreaManager {
* *
* @param worldName Name of the world to add * @param worldName Name of the world to add
* @return {@code true} if successful, {@code false} if world already existed * @return {@code true} if successful, {@code false} if world already existed
* @since TODO * @since 7.0.0
*/ */
boolean addWorld(@NonNull String worldName); boolean addWorld(@NonNull String worldName);

View File

@ -66,7 +66,7 @@ public abstract class QueueCoordinator {
* @param x chunk x coordinate * @param x chunk x coordinate
* @param z chunk z coordinate * @param z chunk z coordinate
* @return a new {@link ZeroedDelegateScopedQueueCoordinator} * @return a new {@link ZeroedDelegateScopedQueueCoordinator}
* @since TODO * @since 7.0.0
*/ */
public ZeroedDelegateScopedQueueCoordinator getForChunk(int x, int z, int minY, int maxY) { public ZeroedDelegateScopedQueueCoordinator getForChunk(int x, int z, int minY, int maxY) {
int bx = x << 4; int bx = x << 4;

View File

@ -32,7 +32,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
* zero in the x and z directions, i.e. starting from 0,0. An offset of the minimum point of the region will then be applied to * zero in the x and z directions, i.e. starting from 0,0. An offset of the minimum point of the region will then be applied to
* x and z. * x and z.
* *
* @since TODO * @since 7.0.0
*/ */
public class ZeroedDelegateScopedQueueCoordinator extends DelegateQueueCoordinator { public class ZeroedDelegateScopedQueueCoordinator extends DelegateQueueCoordinator {
@ -50,7 +50,7 @@ public class ZeroedDelegateScopedQueueCoordinator extends DelegateQueueCoordinat
/** /**
* Create a new ScopedQueueCoordinator instance that delegates to a given QueueCoordinator. Locations are inclusive. * Create a new ScopedQueueCoordinator instance that delegates to a given QueueCoordinator. Locations are inclusive.
* *
* @since TODO * @since 7.0.0
*/ */
public ZeroedDelegateScopedQueueCoordinator(@Nullable QueueCoordinator parent, @NonNull Location min, @NonNull Location max) { public ZeroedDelegateScopedQueueCoordinator(@Nullable QueueCoordinator parent, @NonNull Location min, @NonNull Location max) {
super(parent); super(parent);

View File

@ -36,7 +36,7 @@ public abstract class ChunkManager {
private static final Map<BlockVector2, RunnableVal<ZeroedDelegateScopedQueueCoordinator>> addChunks = new ConcurrentHashMap<>(); private static final Map<BlockVector2, RunnableVal<ZeroedDelegateScopedQueueCoordinator>> addChunks = new ConcurrentHashMap<>();
/** /**
* @since TODO * @since 7.0.0
*/ */
public static void setChunkInPlotArea( public static void setChunkInPlotArea(
RunnableVal<ZeroedDelegateScopedQueueCoordinator> force, RunnableVal<ZeroedDelegateScopedQueueCoordinator> force,
@ -76,7 +76,7 @@ public abstract class ChunkManager {
} }
/** /**
* @since TODO * @since 7.0.0
*/ */
public static boolean preProcessChunk(BlockVector2 loc, ZeroedDelegateScopedQueueCoordinator queue) { public static boolean preProcessChunk(BlockVector2 loc, ZeroedDelegateScopedQueueCoordinator queue) {
final RunnableVal<ZeroedDelegateScopedQueueCoordinator> forceChunk = forceChunks.get(loc); final RunnableVal<ZeroedDelegateScopedQueueCoordinator> forceChunk = forceChunks.get(loc);
@ -89,7 +89,7 @@ public abstract class ChunkManager {
} }
/** /**
* @since TODO * @since 7.0.0
*/ */
public static boolean postProcessChunk(BlockVector2 loc, ZeroedDelegateScopedQueueCoordinator queue) { public static boolean postProcessChunk(BlockVector2 loc, ZeroedDelegateScopedQueueCoordinator queue) {
final RunnableVal<ZeroedDelegateScopedQueueCoordinator> addChunk = forceChunks.get(loc); final RunnableVal<ZeroedDelegateScopedQueueCoordinator> addChunk = forceChunks.get(loc);

View File

@ -27,7 +27,7 @@ import java.util.Collection;
/** /**
* A utility class for modifying components. * A utility class for modifying components.
* *
* @since TODO * @since 7.0.0
*/ */
public class ComponentHelper { public class ComponentHelper {
@ -37,7 +37,7 @@ public class ComponentHelper {
* @param components The components to join * @param components The components to join
* @param delimiter The delimiter to use between the components * @param delimiter The delimiter to use between the components
* @return The joined components * @return The joined components
* @since TODO * @since 7.0.0
*/ */
public static ComponentLike join(Collection<? extends ComponentLike> components, Component delimiter) { public static ComponentLike join(Collection<? extends ComponentLike> components, Component delimiter) {
return join(components.toArray(ComponentLike[]::new), delimiter); return join(components.toArray(ComponentLike[]::new), delimiter);
@ -49,7 +49,7 @@ public class ComponentHelper {
* @param components The components to join * @param components The components to join
* @param delimiter The delimiter to use between the components * @param delimiter The delimiter to use between the components
* @return The joined components * @return The joined components
* @since TODO * @since 7.0.0
*/ */
public static Component join(ComponentLike[] components, Component delimiter) { public static Component join(ComponentLike[] components, Component delimiter) {
TextComponent.Builder builder = Component.text(); TextComponent.Builder builder = Component.text();