From 9a95e3d10598179e53b9d9be252f73d1082426b2 Mon Sep 17 00:00:00 2001 From: CarmJos Date: Thu, 19 May 2022 02:04:57 +0800 Subject: [PATCH] =?UTF-8?q?[1.3.0]=20=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=201.=20=E6=9B=B4=E6=96=B0=20EasyConfiguration=20=E5=88=B0=203.?= =?UTF-8?q?0.0=20(=E7=A0=B4=E5=9D=8F=E6=80=A7=E6=9B=B4=E6=96=B0)=E3=80=82?= =?UTF-8?q?=202.=20=E6=B7=BB=E5=8A=A0=20ConfiguredTitle=20=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E5=BF=AB=E6=8D=B7=E5=90=91=E7=8E=A9=E5=AE=B6=E5=8F=91?= =?UTF-8?q?=E9=80=81title=E6=B6=88=E6=81=AF=E3=80=82=203.=20=E4=B8=BA=20Co?= =?UTF-8?q?nfiguredItem=20=E6=B7=BB=E5=8A=A0name=E5=92=8Clore=E7=9A=84?= =?UTF-8?q?=E5=8E=9F=E7=94=9Fparams=E5=8F=98=E9=87=8F=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E3=80=82=204.=20=E6=B7=BB=E5=8A=A0=20ProtocolLibHelper=20?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E6=94=AF=E6=8C=81=E5=A4=9A=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84=E9=83=A8=E5=88=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E3=80=82(=E5=A6=82=E9=9C=80=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=AF=B7=E5=AE=89=E8=A3=85=20ProtocolLib=20=E6=8F=92=E4=BB=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builder/title/TitleConfigBuilder.java | 16 +++++++------- .../configuration/craft/data/TitleConfig.java | 6 ++--- .../craft/function/TitleSendConsumer.java | 6 ++--- .../craft/value/ConfiguredItem.java | 4 ---- .../craft/value/ConfiguredTitle.java | 22 +++++++++---------- 5 files changed, 25 insertions(+), 29 deletions(-) diff --git a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/builder/title/TitleConfigBuilder.java b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/builder/title/TitleConfigBuilder.java index e0b14a5..1997584 100644 --- a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/builder/title/TitleConfigBuilder.java +++ b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/builder/title/TitleConfigBuilder.java @@ -30,9 +30,9 @@ public class TitleConfigBuilder extends AbstractCraftBuilder paramFormatter; @@ -61,17 +61,17 @@ public class TitleConfigBuilder extends AbstractCraftBuilder placeholders, @Nullable TitleSendConsumer sendConsumer) { if (this.line1 == null && this.line2 == null) return; diff --git a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/function/TitleSendConsumer.java b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/function/TitleSendConsumer.java index e593966..4b2ac33 100644 --- a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/function/TitleSendConsumer.java +++ b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/function/TitleSendConsumer.java @@ -18,9 +18,9 @@ public interface TitleSendConsumer { * @param line2 第二行文字 */ void send(@NotNull Player player, - @Range(from = 0L, to = Integer.MAX_VALUE) long fadeIn, - @Range(from = 0L, to = Integer.MAX_VALUE) long stay, - @Range(from = 0L, to = Integer.MAX_VALUE) long fadeOut, + @Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn, + @Range(from = 0L, to = Integer.MAX_VALUE) int stay, + @Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut, @NotNull String line1, @NotNull String line2); } diff --git a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredItem.java b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredItem.java index 89c6748..7129ceb 100644 --- a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredItem.java +++ b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredItem.java @@ -56,10 +56,6 @@ public class ConfiguredItem extends ConfiguredSection { return getItem(player, amount, new HashMap<>()); } - public @Nullable ItemStack getItem(@Nullable Player player, @NotNull Object... values) { - return getItem(player, 1, values); - } - public @Nullable ItemStack getItem(@Nullable Player player, int amount, @NotNull Object... values) { return getItem(player, amount, ParamsUtils.buildParams(params, values)); } diff --git a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredTitle.java b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredTitle.java index dce1bfc..1ea96c9 100644 --- a/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredTitle.java +++ b/craftbukkit/src/main/java/cc/carm/lib/configuration/craft/value/ConfiguredTitle.java @@ -29,22 +29,22 @@ public class ConfiguredTitle extends ConfiguredSection { } public static ConfiguredTitle of(@Nullable String line1, @Nullable String line2, - long fadeIn, long stay, long fadeOut) { + int fadeIn, int stay, int fadeOut) { return create().defaults(line1, line2).fadeIn(fadeIn).stay(stay).fadeOut(fadeOut).build(); } protected final @NotNull TitleSendConsumer sendConsumer; protected final @NotNull String[] params; - protected final long fadeIn; - protected final long stay; - protected final long fadeOut; + protected final int fadeIn; + protected final int stay; + protected final int fadeOut; public ConfiguredTitle(@Nullable ConfigurationProvider provider, @Nullable String sectionPath, @Nullable List headerComments, @Nullable String inlineComments, @Nullable TitleConfig defaultValue, @NotNull String[] params, @NotNull TitleSendConsumer sendConsumer, - long fadeIn, long stay, long fadeOut) { + int fadeIn, int stay, int fadeOut) { super(provider, sectionPath, headerComments, inlineComments, TitleConfig.class, defaultValue, getTitleParser(), TitleConfig::serialize); this.sendConsumer = sendConsumer; this.params = params; @@ -53,18 +53,18 @@ public class ConfiguredTitle extends ConfiguredSection { this.fadeOut = fadeOut; } - @Range(from = 0L, to = Long.MAX_VALUE) - public long getFadeInTicks() { + @Range(from = 0L, to = Integer.MAX_VALUE) + public int getFadeInTicks() { return fadeIn; } - @Range(from = 0L, to = Long.MAX_VALUE) - public long getStayTicks() { + @Range(from = 0L, to = Integer.MAX_VALUE) + public int getStayTicks() { return stay; } - @Range(from = 0L, to = Long.MAX_VALUE) - public long getFadeOutTicks() { + @Range(from = 0L, to = Integer.MAX_VALUE) + public int getFadeOutTicks() { return fadeOut; }