mirror of
https://github.com/CarmJos/MineConfiguration.git
synced 2026-06-05 06:51:49 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b31ee1318 | |||
| 9d6212e5ea | |||
| 8f3d574446 | |||
| 437e1d6d61 | |||
| a04b7c9c06 | |||
| 74e88a126c | |||
| 79a65a94bc | |||
| 6ba08f7a67 | |||
| 166b9fa0a8 | |||
| 6257cdd114 |
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>mineconfiguration-parent</artifactId>
|
<artifactId>mineconfiguration-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.6.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package cc.carm.lib.mineconfiguration.common;
|
||||||
|
|
||||||
|
import cc.carm.lib.configuration.core.ConfigurationRoot;
|
||||||
|
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public abstract class AbstractConfiguration<P extends ConfigurationProvider<?>> {
|
||||||
|
|
||||||
|
private final P configProvider;
|
||||||
|
private final P messageProvider;
|
||||||
|
|
||||||
|
protected AbstractConfiguration(@NotNull P configProvider, @NotNull P messageProvider) {
|
||||||
|
this.configProvider = configProvider;
|
||||||
|
this.messageProvider = messageProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initializeConfig(@NotNull ConfigurationRoot configRoot) {
|
||||||
|
this.configProvider.initialize(configRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initializeMessage(@NotNull ConfigurationRoot messageRoot) {
|
||||||
|
this.messageProvider.initialize(messageRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initializeConfig(@NotNull Class<? extends ConfigurationRoot> configRoot) {
|
||||||
|
this.configProvider.initialize(configRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initializeMessage(@NotNull Class<? extends ConfigurationRoot> messageRoot) {
|
||||||
|
this.messageProvider.initialize(messageRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public P getConfigProvider() {
|
||||||
|
return configProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public P getMessageProvider() {
|
||||||
|
return messageProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reload() throws Exception {
|
||||||
|
getConfigProvider().reload();
|
||||||
|
getMessageProvider().reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save() throws Exception {
|
||||||
|
getConfigProvider().save();
|
||||||
|
getMessageProvider().save();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -47,11 +47,20 @@ public abstract class ConfigMessage<M, T extends AbstractText<R>, R>
|
|||||||
sendFunction.accept(receiver, message);
|
sendFunction.accept(receiver, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
protected <N> @Nullable N parseTo(@Nullable R sender, @NotNull Map<String, Object> placeholders,
|
||||||
public @Nullable M parse(@Nullable R sender, @NotNull Map<String, Object> placeholders) {
|
@NotNull BiFunction<@Nullable R, @NotNull String, @Nullable N> parser) {
|
||||||
T value = get();
|
T value = get();
|
||||||
if (value == null || value.getMessage().isEmpty()) return null;
|
if (value == null || value.getMessage().isEmpty()) return null;
|
||||||
else return value.parse(this.messageParser, sender, placeholders);
|
else return value.parse(parser, sender, placeholders);
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable String parseString(@Nullable R sender, @NotNull Map<String, Object> placeholders) {
|
||||||
|
return parseTo(sender, placeholders, (r, s) -> s);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable M parse(@Nullable R sender, @NotNull Map<String, Object> placeholders) {
|
||||||
|
return parseTo(sender, placeholders, this.messageParser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(@Nullable String value) {
|
public void set(@Nullable String value) {
|
||||||
|
|||||||
+10
-1
@@ -4,6 +4,7 @@ import cc.carm.lib.configuration.core.function.ConfigDataFunction;
|
|||||||
import cc.carm.lib.configuration.core.value.ValueManifest;
|
import cc.carm.lib.configuration.core.value.ValueManifest;
|
||||||
import cc.carm.lib.configuration.core.value.type.ConfiguredList;
|
import cc.carm.lib.configuration.core.value.type.ConfiguredList;
|
||||||
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
|
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
|
||||||
|
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -68,14 +69,22 @@ public abstract class ConfigMessageList<M, T extends AbstractText<R>, R>
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @Nullable M parseToLine(@Nullable R receiver, @NotNull Object... values) {
|
||||||
|
return parseToLine(receiver, "\n", ParamsUtils.buildParams(this.params, values));
|
||||||
|
}
|
||||||
|
|
||||||
public @Nullable M parseToLine(@Nullable R receiver, @NotNull Map<String, Object> placeholders) {
|
public @Nullable M parseToLine(@Nullable R receiver, @NotNull Map<String, Object> placeholders) {
|
||||||
|
return parseToLine(receiver, "\n", placeholders);
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable M parseToLine(@Nullable R receiver, @NotNull String delimiter, @NotNull Map<String, Object> placeholders) {
|
||||||
List<T> list = get();
|
List<T> list = get();
|
||||||
if (list.isEmpty()) return null;
|
if (list.isEmpty()) return null;
|
||||||
|
|
||||||
List<String> messages = list.stream().map(T::getMessage).collect(Collectors.toList());
|
List<String> messages = list.stream().map(T::getMessage).collect(Collectors.toList());
|
||||||
if (String.join("", messages).isEmpty()) return null;
|
if (String.join("", messages).isEmpty()) return null;
|
||||||
|
|
||||||
String combined = String.join("\n", messages);
|
String combined = String.join(delimiter, messages);
|
||||||
T text = textBuilder.apply(combined);
|
T text = textBuilder.apply(combined);
|
||||||
|
|
||||||
return text.parse(this.messageParser, receiver, placeholders);
|
return text.parse(this.messageParser, receiver, placeholders);
|
||||||
|
|||||||
+10
-11
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>mineconfiguration-parent</artifactId>
|
<artifactId>mineconfiguration-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.6.2</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -37,11 +37,18 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.cryptomorin</groupId>
|
||||||
|
<artifactId>XSeries</artifactId>
|
||||||
|
<version>9.3.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--suppress VulnerableLibrariesLocal -->
|
<!--suppress VulnerableLibrariesLocal -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -49,15 +56,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
<version>2.11.2</version>
|
<version>2.11.3</version>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!--ProtocolLib for general packet's function support-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
|
||||||
<artifactId>ProtocolLib</artifactId>
|
|
||||||
<version>4.8.0</version>
|
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
+1
-4
@@ -7,9 +7,6 @@ import cc.carm.lib.mineconfiguration.bukkit.builder.CraftConfigBuilder;
|
|||||||
import cc.carm.lib.mineconfiguration.bukkit.source.CraftConfigProvider;
|
import cc.carm.lib.mineconfiguration.bukkit.source.CraftConfigProvider;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.source.CraftSectionWrapper;
|
import cc.carm.lib.mineconfiguration.bukkit.source.CraftSectionWrapper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public abstract class CraftConfigValue<T> extends CachedConfigValue<T> {
|
public abstract class CraftConfigValue<T> extends CachedConfigValue<T> {
|
||||||
|
|
||||||
@@ -17,7 +14,7 @@ public abstract class CraftConfigValue<T> extends CachedConfigValue<T> {
|
|||||||
return new CraftConfigBuilder();
|
return new CraftConfigBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CraftConfigValue(@NotNull ValueManifest<T> manifest) {
|
protected CraftConfigValue(@NotNull ValueManifest<T> manifest) {
|
||||||
super(manifest);
|
super(manifest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+25
-1
@@ -1,12 +1,16 @@
|
|||||||
package cc.carm.lib.mineconfiguration.bukkit;
|
package cc.carm.lib.mineconfiguration.bukkit;
|
||||||
|
|
||||||
|
import cc.carm.lib.configuration.core.ConfigurationRoot;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.source.BukkitConfigProvider;
|
import cc.carm.lib.mineconfiguration.bukkit.source.BukkitConfigProvider;
|
||||||
|
import cc.carm.lib.mineconfiguration.common.AbstractConfiguration;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class MineConfiguration {
|
public class MineConfiguration extends AbstractConfiguration<BukkitConfigProvider> {
|
||||||
|
|
||||||
public static BukkitConfigProvider from(File file, String source) {
|
public static BukkitConfigProvider from(File file, String source) {
|
||||||
BukkitConfigProvider provider = new BukkitConfigProvider(file);
|
BukkitConfigProvider provider = new BukkitConfigProvider(file);
|
||||||
@@ -39,4 +43,24 @@ public class MineConfiguration {
|
|||||||
return from(new File(plugin.getDataFolder(), fileName), source);
|
return from(new File(plugin.getDataFolder(), fileName), source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MineConfiguration(@NotNull JavaPlugin plugin) {
|
||||||
|
super(from(plugin, "config.yml"), from(plugin, "messages.yml"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public MineConfiguration(@NotNull JavaPlugin plugin,
|
||||||
|
@NotNull ConfigurationRoot configRoot,
|
||||||
|
@NotNull ConfigurationRoot messageRoot) {
|
||||||
|
this(plugin);
|
||||||
|
initializeConfig(configRoot);
|
||||||
|
initializeMessage(messageRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MineConfiguration(@NotNull JavaPlugin plugin,
|
||||||
|
@NotNull Class<? extends ConfigurationRoot> configRoot,
|
||||||
|
@NotNull Class<? extends ConfigurationRoot> messageRoot) {
|
||||||
|
this(plugin);
|
||||||
|
initializeConfig(configRoot);
|
||||||
|
initializeMessage(messageRoot);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-11
@@ -6,11 +6,8 @@ import cc.carm.lib.mineconfiguration.bukkit.builder.message.CraftMessageBuilder;
|
|||||||
import cc.carm.lib.mineconfiguration.bukkit.builder.serializable.SerializableBuilder;
|
import cc.carm.lib.mineconfiguration.bukkit.builder.serializable.SerializableBuilder;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.builder.sound.SoundConfigBuilder;
|
import cc.carm.lib.mineconfiguration.bukkit.builder.sound.SoundConfigBuilder;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.builder.title.TitleConfigBuilder;
|
import cc.carm.lib.mineconfiguration.bukkit.builder.title.TitleConfigBuilder;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.data.ItemConfig;
|
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredItem;
|
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
public class CraftConfigBuilder extends ConfigBuilder {
|
public class CraftConfigBuilder extends ConfigBuilder {
|
||||||
|
|
||||||
@@ -34,12 +31,4 @@ public class CraftConfigBuilder extends ConfigBuilder {
|
|||||||
return new SerializableBuilder<>(valueClass);
|
return new SerializableBuilder<>(valueClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NotNull ConfiguredItem ofItem() {
|
|
||||||
return createItem().build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull ConfiguredItem ofItem(@Nullable ItemConfig defaultItem) {
|
|
||||||
return createItem().defaults(defaultItem).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-5
@@ -2,19 +2,21 @@ package cc.carm.lib.mineconfiguration.bukkit.builder.item;
|
|||||||
|
|
||||||
import cc.carm.lib.configuration.core.value.ValueManifest;
|
import cc.carm.lib.configuration.core.value.ValueManifest;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
|
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.data.ItemConfig;
|
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredItem;
|
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredItem;
|
||||||
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.inventory.ItemFlag;
|
import org.bukkit.inventory.ItemFlag;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.function.UnaryOperator;
|
||||||
|
|
||||||
public class ItemConfigBuilder extends AbstractCraftBuilder<ItemConfig, ItemConfigBuilder> {
|
public class ItemConfigBuilder extends AbstractCraftBuilder<ItemStack, ItemConfigBuilder> {
|
||||||
|
|
||||||
protected Material type;
|
protected Material type;
|
||||||
protected short data = 0;
|
protected short data = 0;
|
||||||
@@ -84,7 +86,7 @@ public class ItemConfigBuilder extends AbstractCraftBuilder<ItemConfig, ItemConf
|
|||||||
return defaultFlags(new LinkedHashSet<>(Arrays.asList(flags)));
|
return defaultFlags(new LinkedHashSet<>(Arrays.asList(flags)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemConfigBuilder formatParam(@NotNull Function<@NotNull String, @NotNull String> paramFormatter) {
|
public ItemConfigBuilder formatParam(@NotNull UnaryOperator<String> paramFormatter) {
|
||||||
this.paramFormatter = paramFormatter;
|
this.paramFormatter = paramFormatter;
|
||||||
return getThis();
|
return getThis();
|
||||||
}
|
}
|
||||||
@@ -104,9 +106,20 @@ public class ItemConfigBuilder extends AbstractCraftBuilder<ItemConfig, ItemConf
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected @Nullable ItemConfig buildDefault() {
|
protected @Nullable ItemStack buildDefault() {
|
||||||
if (this.type == null) return null;
|
if (this.type == null) return null;
|
||||||
else return new ItemConfig(type, data, name, lore, enchants, flags);
|
|
||||||
|
ItemStack item = new ItemStack(type, 1, data);
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return item;
|
||||||
|
|
||||||
|
Optional.ofNullable(this.name).ifPresent(meta::setDisplayName);
|
||||||
|
Optional.ofNullable(this.lore).ifPresent(meta::setLore);
|
||||||
|
enchants.forEach((enchant, level) -> meta.addEnchant(enchant, level, true));
|
||||||
|
flags.forEach(meta::addItemFlags);
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
-2
@@ -1,6 +1,5 @@
|
|||||||
package cc.carm.lib.mineconfiguration.bukkit.builder.message;
|
package cc.carm.lib.mineconfiguration.bukkit.builder.message;
|
||||||
|
|
||||||
import cc.carm.lib.configuration.core.value.ValueManifest;
|
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
|
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.utils.TextParser;
|
import cc.carm.lib.mineconfiguration.bukkit.utils.TextParser;
|
||||||
import cc.carm.lib.mineconfiguration.common.builder.message.MessageConfigBuilder;
|
import cc.carm.lib.mineconfiguration.common.builder.message.MessageConfigBuilder;
|
||||||
@@ -9,7 +8,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
public class CraftMessageBuilder extends MessageConfigBuilder<CommandSender, TextConfig> {
|
public class CraftMessageBuilder extends MessageConfigBuilder<CommandSender, TextConfig> {
|
||||||
|
|||||||
+2
-13
@@ -3,10 +3,9 @@ package cc.carm.lib.mineconfiguration.bukkit.builder.title;
|
|||||||
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
|
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.data.TitleConfig;
|
import cc.carm.lib.mineconfiguration.bukkit.data.TitleConfig;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.function.TitleSendConsumer;
|
import cc.carm.lib.mineconfiguration.bukkit.function.TitleSendConsumer;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.utils.ProtocolLibHelper;
|
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredTitle;
|
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredTitle;
|
||||||
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
||||||
import org.bukkit.Bukkit;
|
import com.cryptomorin.xseries.messages.Titles;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.annotations.Range;
|
import org.jetbrains.annotations.Range;
|
||||||
@@ -16,17 +15,7 @@ import java.util.function.Function;
|
|||||||
|
|
||||||
public class TitleConfigBuilder extends AbstractCraftBuilder<TitleConfig, TitleConfigBuilder> {
|
public class TitleConfigBuilder extends AbstractCraftBuilder<TitleConfig, TitleConfigBuilder> {
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
protected static @NotNull TitleSendConsumer DEFAULT_TITLE_CONSUMER = Titles::sendTitle;
|
||||||
protected static @NotNull TitleSendConsumer DEFAULT_TITLE_CONSUMER = (player, fadeIn, stay, fadeOut, line1, line2) -> {
|
|
||||||
if (Bukkit.getPluginManager().isPluginEnabled("ProtocolLib")) {
|
|
||||||
try {
|
|
||||||
ProtocolLibHelper.sendTitle(player, fadeIn, stay, fadeOut, line1, line2);
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
player.sendTitle(line1, line2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
protected @NotNull String[] params = new String[0];
|
protected @NotNull String[] params = new String[0];
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -26,6 +26,8 @@ public class ItemConfig {
|
|||||||
protected @NotNull Map<Enchantment, Integer> enchants;
|
protected @NotNull Map<Enchantment, Integer> enchants;
|
||||||
protected @NotNull Set<ItemFlag> flags;
|
protected @NotNull Set<ItemFlag> flags;
|
||||||
|
|
||||||
|
protected int customModelData = 0;
|
||||||
|
|
||||||
public ItemConfig(@NotNull Material type, @Nullable String name) {
|
public ItemConfig(@NotNull Material type, @Nullable String name) {
|
||||||
this(type, name, Collections.emptyList());
|
this(type, name, Collections.emptyList());
|
||||||
}
|
}
|
||||||
@@ -131,7 +133,7 @@ public class ItemConfig {
|
|||||||
public static @NotNull ItemConfig deserialize(@NotNull ConfigurationSection section) throws Exception {
|
public static @NotNull ItemConfig deserialize(@NotNull ConfigurationSection section) throws Exception {
|
||||||
return deserialize(CraftSectionWrapper.of(section));
|
return deserialize(CraftSectionWrapper.of(section));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static @NotNull ItemConfig deserialize(@NotNull ConfigurationWrapper<?> section) throws Exception {
|
public static @NotNull ItemConfig deserialize(@NotNull ConfigurationWrapper<?> section) throws Exception {
|
||||||
String typeName = section.getString("type");
|
String typeName = section.getString("type");
|
||||||
if (typeName == null) throw new NullPointerException("Item type name is null");
|
if (typeName == null) throw new NullPointerException("Item type name is null");
|
||||||
|
|||||||
-41
@@ -1,41 +0,0 @@
|
|||||||
package cc.carm.lib.mineconfiguration.bukkit.utils;
|
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType;
|
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
|
||||||
import com.comphenix.protocol.ProtocolManager;
|
|
||||||
import com.comphenix.protocol.events.PacketContainer;
|
|
||||||
import com.comphenix.protocol.wrappers.EnumWrappers;
|
|
||||||
import com.comphenix.protocol.wrappers.WrappedChatComponent;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
public class ProtocolLibHelper {
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public static void sendTitle(@NotNull Player player, long fadeIn, long stay, long fadeOut, String line1, String line2) throws Exception {
|
|
||||||
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
|
|
||||||
|
|
||||||
if (line1 != null) {
|
|
||||||
PacketContainer packet = pm.createPacket(PacketType.Play.Server.TITLE);
|
|
||||||
packet.getTitleActions().write(0, EnumWrappers.TitleAction.TITLE);
|
|
||||||
packet.getChatComponents().write(0, WrappedChatComponent.fromText(line1));
|
|
||||||
pm.sendServerPacket(player, packet, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (line2 != null) {
|
|
||||||
PacketContainer packet = pm.createPacket(PacketType.Play.Server.TITLE);
|
|
||||||
packet.getTitleActions().write(0, EnumWrappers.TitleAction.SUBTITLE);
|
|
||||||
packet.getChatComponents().write(0, WrappedChatComponent.fromText(line2));
|
|
||||||
pm.sendServerPacket(player, packet, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
PacketContainer timePacket = pm.createPacket(PacketType.Play.Server.TITLE);
|
|
||||||
timePacket.getTitleActions().write(0, EnumWrappers.TitleAction.TIMES);
|
|
||||||
timePacket.getIntegers()
|
|
||||||
.write(0, Math.toIntExact(fadeIn))
|
|
||||||
.write(1, Math.toIntExact(stay))
|
|
||||||
.write(2, Math.toIntExact(fadeOut));
|
|
||||||
pm.sendServerPacket(player, timePacket, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+73
-33
@@ -1,71 +1,111 @@
|
|||||||
package cc.carm.lib.mineconfiguration.bukkit.value;
|
package cc.carm.lib.mineconfiguration.bukkit.value;
|
||||||
|
|
||||||
import cc.carm.lib.configuration.core.function.ConfigValueParser;
|
|
||||||
import cc.carm.lib.configuration.core.source.ConfigurationWrapper;
|
|
||||||
import cc.carm.lib.configuration.core.value.ValueManifest;
|
import cc.carm.lib.configuration.core.value.ValueManifest;
|
||||||
import cc.carm.lib.configuration.core.value.type.ConfiguredSection;
|
import cc.carm.lib.configuration.core.value.type.ConfiguredSection;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
|
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.builder.item.ItemConfigBuilder;
|
import cc.carm.lib.mineconfiguration.bukkit.builder.item.ItemConfigBuilder;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.data.ItemConfig;
|
import cc.carm.lib.mineconfiguration.bukkit.utils.TextParser;
|
||||||
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
||||||
|
import com.cryptomorin.xseries.XItemStack;
|
||||||
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Map;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class ConfiguredItem extends ConfiguredSection<ItemConfig> {
|
public class ConfiguredItem extends ConfiguredSection<ItemStack> {
|
||||||
|
|
||||||
public static ItemConfigBuilder create() {
|
public static ItemConfigBuilder create() {
|
||||||
return CraftConfigValue.builder().createItem();
|
return new ItemConfigBuilder();
|
||||||
}
|
|
||||||
|
|
||||||
public static ConfiguredItem of() {
|
|
||||||
return CraftConfigValue.builder().ofItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ConfiguredItem of(@Nullable ItemConfig defaultItem) {
|
|
||||||
return CraftConfigValue.builder().ofItem(defaultItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final @NotNull String[] params;
|
protected final @NotNull String[] params;
|
||||||
|
|
||||||
public ConfiguredItem(@NotNull ValueManifest<ItemConfig> manifest, @NotNull String[] params) {
|
public ConfiguredItem(@NotNull ValueManifest<ItemStack> manifest, @NotNull String[] params) {
|
||||||
super(
|
super(
|
||||||
manifest, ItemConfig.class,
|
manifest, ItemStack.class,
|
||||||
getItemParser(), ItemConfig::serialize
|
(data, v) -> XItemStack.deserialize((ConfigurationSection) data.getSource()),
|
||||||
|
XItemStack::serialize
|
||||||
);
|
);
|
||||||
this.params = params;
|
this.params = params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ConfigValueParser<ConfigurationWrapper<?>, ItemConfig> getItemParser() {
|
|
||||||
return (s, d) -> ItemConfig.deserialize(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull String[] getParams() {
|
public @NotNull String[] getParams() {
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable ItemStack getItem(@Nullable Player player) {
|
@Override
|
||||||
return getItem(player, 1);
|
public @Nullable ItemStack get() {
|
||||||
|
return Optional.ofNullable(super.get()).map(ItemStack::clone).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable ItemStack getItem(@Nullable Player player, int amount) {
|
public void modifyItem(Consumer<ItemStack> modifier) {
|
||||||
return getItem(player, amount, new HashMap<>());
|
ItemStack item = get();
|
||||||
|
if (item == null) return;
|
||||||
|
modifier.accept(item);
|
||||||
|
set(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable ItemStack getItem(@Nullable Player player, int amount, @NotNull Object... values) {
|
public void modifyMeta(Consumer<ItemMeta> modifier) {
|
||||||
return getItem(player, amount, ParamsUtils.buildParams(params, values));
|
modifyItem(item -> {
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
modifier.accept(meta);
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable ItemStack getItem(@Nullable Player player, int amount, @NotNull String[] params, @NotNull Object[] values) {
|
public void setName(@Nullable String name) {
|
||||||
return getItem(player, amount, ParamsUtils.buildParams(params, values));
|
modifyMeta(meta -> meta.setDisplayName(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable ItemStack getItem(@Nullable Player player, int amount, @NotNull Map<String, Object> placeholders) {
|
public void setLore(@Nullable List<String> lore) {
|
||||||
return getOptional().map(item -> item.getItemStack(player, amount, placeholders)).orElse(null);
|
modifyMeta(meta -> meta.setLore(lore));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLore(String... lore) {
|
||||||
|
if (lore.length == 0) setLore((List<String>) null);
|
||||||
|
else setLore(Arrays.asList(lore));
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable ItemStack get(@Nullable Player player) {
|
||||||
|
return get(player, new HashMap<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable ItemStack get(@Nullable Player player, @NotNull Object... values) {
|
||||||
|
return get(player, ParamsUtils.buildParams(params, values));
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable ItemStack get(@Nullable Player player, @NotNull String[] params, @NotNull Object[] values) {
|
||||||
|
return get(player, ParamsUtils.buildParams(params, values));
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable ItemStack get(@Nullable Player player, @NotNull Map<String, Object> placeholders) {
|
||||||
|
return get(item -> {
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return;
|
||||||
|
|
||||||
|
List<String> lore = meta.getLore();
|
||||||
|
if (lore != null && !lore.isEmpty()) {
|
||||||
|
meta.setLore(TextParser.parseList(player, lore, placeholders));
|
||||||
|
}
|
||||||
|
|
||||||
|
String name = meta.getDisplayName();
|
||||||
|
if (!name.isEmpty()) {
|
||||||
|
meta.setDisplayName(TextParser.parseText(player, name, placeholders));
|
||||||
|
}
|
||||||
|
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable ItemStack get(Consumer<ItemStack> modifier) {
|
||||||
|
return getOptional().map(item -> {
|
||||||
|
modifier.accept(item);
|
||||||
|
return item;
|
||||||
|
}).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -4,15 +4,19 @@ import cc.carm.lib.configuration.core.value.ValueManifest;
|
|||||||
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
|
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.builder.message.CraftMessageValueBuilder;
|
import cc.carm.lib.mineconfiguration.bukkit.builder.message.CraftMessageValueBuilder;
|
||||||
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
|
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
|
||||||
|
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
|
||||||
import cc.carm.lib.mineconfiguration.common.value.ConfigMessage;
|
import cc.carm.lib.mineconfiguration.common.value.ConfigMessage;
|
||||||
|
import com.cryptomorin.xseries.messages.ActionBar;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
@@ -41,6 +45,14 @@ public class ConfiguredMessage<M> extends ConfigMessage<M, TextConfig, CommandSe
|
|||||||
super(manifest, TextConfig.class, params, messageParser, sendFunction, TextConfig::of);
|
super(manifest, TextConfig.class, params, messageParser, sendFunction, TextConfig::of);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendActionBar(Player player, String... values) {
|
||||||
|
sendActionBar(player, ParamsUtils.buildParams(this.params, values));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendActionBar(Player player, Map<String, Object> placeholders) {
|
||||||
|
ActionBar.sendActionBar(player, parseString(player, placeholders));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull Collection<CommandSender> getAllReceivers() {
|
public @NotNull Collection<CommandSender> getAllReceivers() {
|
||||||
List<CommandSender> senders = new ArrayList<>();
|
List<CommandSender> senders = new ArrayList<>();
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ public class ConfiguredSerializable<T extends ConfigurationSerializable> extends
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 出现了解析错误,提示并返回默认值。
|
// 出现了解析错误,提示并返回默认值。
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return useDefault();
|
return getDefaultValue();
|
||||||
}
|
}
|
||||||
} else return Optional.ofNullable(getCachedValue()).orElse(defaultValue);
|
} else return Optional.ofNullable(getCachedValue()).orElse(defaultValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>mineconfiguration-parent</artifactId>
|
<artifactId>mineconfiguration-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.6.2</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
+26
-1
@@ -1,15 +1,18 @@
|
|||||||
package cc.carm.lib.mineconfiguration.bungee;
|
package cc.carm.lib.mineconfiguration.bungee;
|
||||||
|
|
||||||
|
import cc.carm.lib.configuration.core.ConfigurationRoot;
|
||||||
import cc.carm.lib.mineconfiguration.bungee.source.BungeeConfigProvider;
|
import cc.carm.lib.mineconfiguration.bungee.source.BungeeConfigProvider;
|
||||||
|
import cc.carm.lib.mineconfiguration.common.AbstractConfiguration;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.md_5.bungee.config.ConfigurationProvider;
|
import net.md_5.bungee.config.ConfigurationProvider;
|
||||||
import net.md_5.bungee.config.JsonConfiguration;
|
import net.md_5.bungee.config.JsonConfiguration;
|
||||||
import net.md_5.bungee.config.YamlConfiguration;
|
import net.md_5.bungee.config.YamlConfiguration;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class MineConfiguration {
|
public class MineConfiguration extends AbstractConfiguration<BungeeConfigProvider> {
|
||||||
|
|
||||||
protected static BungeeConfigProvider create(File file, String source, ConfigurationProvider loader) {
|
protected static BungeeConfigProvider create(File file, String source, ConfigurationProvider loader) {
|
||||||
BungeeConfigProvider provider = new BungeeConfigProvider(file, loader);
|
BungeeConfigProvider provider = new BungeeConfigProvider(file, loader);
|
||||||
@@ -94,4 +97,26 @@ public class MineConfiguration {
|
|||||||
return fromJSON(new File(plugin.getDataFolder(), fileName), source);
|
return fromJSON(new File(plugin.getDataFolder(), fileName), source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MineConfiguration(@NotNull Plugin plugin) {
|
||||||
|
super(from(plugin, "config.yml"), from(plugin, "messages.yml"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public MineConfiguration(@NotNull Plugin plugin,
|
||||||
|
@NotNull ConfigurationRoot configRoot,
|
||||||
|
@NotNull ConfigurationRoot messageRoot) {
|
||||||
|
this(plugin);
|
||||||
|
initializeConfig(configRoot);
|
||||||
|
initializeMessage(messageRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MineConfiguration(@NotNull Plugin plugin,
|
||||||
|
@NotNull Class<? extends ConfigurationRoot> configRoot,
|
||||||
|
@NotNull Class<? extends ConfigurationRoot> messageRoot) {
|
||||||
|
this(plugin);
|
||||||
|
initializeConfig(configRoot);
|
||||||
|
initializeMessage(messageRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class ConfigTest {
|
|||||||
|
|
||||||
@HeaderComment("执行的指令列表")
|
@HeaderComment("执行的指令列表")
|
||||||
@InlineComment("建议以\"\"包裹")
|
@InlineComment("建议以\"\"包裹")
|
||||||
public static final ConfigValue<List<String>> COMMANDS = ConfiguredList.builder(String.class)
|
public static final ConfigValue<List<String>> COMMANDS = ConfiguredList.builderOf(String.class)
|
||||||
.fromString().defaults("alert Commands here!").build();
|
.fromString().defaults("alert Commands here!").build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||||
|
|
||||||
<deps.easyconfifuration.version>3.5.1</deps.easyconfifuration.version>
|
<deps.easyconfifuration.version>3.6.0</deps.easyconfifuration.version>
|
||||||
<deps.easyplugin.version>1.5.4</deps.easyplugin.version>
|
<deps.easyplugin.version>1.5.4</deps.easyplugin.version>
|
||||||
<deps.yamlcommentwriter.version>1.0.1</deps.yamlcommentwriter.version>
|
<deps.yamlcommentwriter.version>1.0.1</deps.yamlcommentwriter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<artifactId>mineconfiguration-parent</artifactId>
|
<artifactId>mineconfiguration-parent</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>2.6.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modules>
|
<modules>
|
||||||
<module>common</module>
|
<module>common</module>
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.1.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<useSystemClassLoader>false</useSystemClassLoader>
|
<useSystemClassLoader>false</useSystemClassLoader>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>sign-artifacts</id>
|
<id>sign-artifacts</id>
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
<artifactId>maven-release-plugin</artifactId>
|
||||||
<version>2.5.3</version>
|
<version>3.0.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||||
<useReleaseProfile>false</useReleaseProfile>
|
<useReleaseProfile>false</useReleaseProfile>
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.3.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
|
|||||||
Reference in New Issue
Block a user