diff --git a/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java b/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java index a9a3a361..2acfe508 100644 --- a/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java +++ b/bukkit/src/main/java/net/william278/husksync/migrator/MpdbMigrator.java @@ -36,7 +36,10 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; -import java.util.*; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; diff --git a/common/src/main/java/net/william278/husksync/config/Locales.java b/common/src/main/java/net/william278/husksync/config/Locales.java index 87d9f703..adf5c324 100644 --- a/common/src/main/java/net/william278/husksync/config/Locales.java +++ b/common/src/main/java/net/william278/husksync/config/Locales.java @@ -155,29 +155,6 @@ public static String escapeText(@NotNull String string) { return value.toString().replace("__", "_\\_"); } - @NotNull - public String truncateText(@NotNull String string, int truncateAfter) { - if (string.isBlank()) { - return string; - } - return string.length() > truncateAfter ? string.substring(0, truncateAfter) + "…" : string; - } - - @NotNull - public String getNotApplicable() { - return getRawLocale("not_applicable").orElse("N/A"); - } - - @NotNull - public String getListJoiner() { - return getRawLocale("list_separator").orElse(", "); - } - - @NotNull - public String getNone() { - return getRawLocale("none").orElse("(none)"); - } - /** * Returns the base list options to use for a paginated chat list * diff --git a/common/src/main/java/net/william278/husksync/data/DataSnapshot.java b/common/src/main/java/net/william278/husksync/data/DataSnapshot.java index e1be24d9..5edde9e0 100644 --- a/common/src/main/java/net/william278/husksync/data/DataSnapshot.java +++ b/common/src/main/java/net/william278/husksync/data/DataSnapshot.java @@ -23,6 +23,8 @@ import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import de.themoep.minedown.adventure.MineDown; +import lombok.Getter; +import lombok.Setter; import net.william278.desertwell.util.Version; import net.william278.husksync.HuskSync; import net.william278.husksync.adapter.Adaptable; @@ -52,6 +54,21 @@ public class DataSnapshot { @SerializedName("id") protected UUID id; + /** + * -- GETTER -- + * Get whether the snapshot is pinned + * + * @return Whether the snapshot is pinned + * + * -- SETTER -- + * Set whether the snapshot is pinned + * + * @param pinned Whether the snapshot is pinned + * + + */ + @Setter + @Getter @SerializedName("pinned") protected boolean pinned; @@ -70,6 +87,14 @@ public class DataSnapshot { @SerializedName("platform_type") protected String platformType; + /** + * -- GETTER -- + * Get the format version of the snapshot (indicating the version of HuskSync that created it) + * + * @return The format version of the snapshot + * + */ + @Getter @SerializedName("format_version") protected int formatVersion; @@ -168,26 +193,6 @@ public String getShortId() { return id.toString().substring(0, 8); } - /** - * Get whether the snapshot is pinned - * - * @return Whether the snapshot is pinned - * @since 3.0 - */ - public boolean isPinned() { - return pinned; - } - - /** - * Set whether the snapshot is pinned - * - * @param pinned Whether the snapshot is pinned - * @since 3.0 - */ - public void setPinned(boolean pinned) { - this.pinned = pinned; - } - /** * Get why the snapshot was created * @@ -255,16 +260,6 @@ public String getPlatformType() { return platformType; } - /** - * Get the format version of the snapshot (indicating the version of HuskSync that created it) - * - * @return The format version of the snapshot - * @since 3.0 - */ - public int getFormatVersion() { - return formatVersion; - } - /** * A packed {@link DataSnapshot} that has not been deserialized. * @@ -304,7 +299,6 @@ data, getMinecraftVersion(), platformType, formatVersion ); } - @NotNull @ApiStatus.Internal public byte[] asBytes(@NotNull HuskSync plugin) throws DataAdapter.AdaptionException { return plugin.getDataAdapter().toBytes(this);