@@ -85,10 +85,10 @@ index d97771ecaf06b92d92b5ca0224ae0866e36703a6..439305bb4f5ce232aa6237276c121d53
85
85
.withRequiredArg()
86
86
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
87
87
new file mode 100644
88
- index 0000000000000000000000000000000000000000..59c98fa51afd4fd305852d14509b06f8bef859a1
88
+ index 0000000000000000000000000000000000000000..10cf4d4aed544e0e0dd6698119734eb9e9cc92e2
89
89
--- /dev/null
90
90
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
91
- @@ -0,0 +1,883 @@
91
+ @@ -0,0 +1,889 @@
92
92
+ package org.leavesmc.leaves;
93
93
+
94
94
+ import com.destroystokyo.paper.util.SneakyThrow;
@@ -228,13 +228,13 @@ index 0000000000000000000000000000000000000000..59c98fa51afd4fd305852d14509b06f8
228
228
+ public static boolean fakeplayerSpawnPhantom = false;
229
229
+
230
230
+ @GlobalConfig(name = "regen-amount", category = {"modify", "fakeplayer"}, verify = RegenAmountVerify.class)
231
- + public static double fakeplayerRegenAmount = 0.010 ;
231
+ + public static double fakeplayerRegenAmount = 0.0 ;
232
232
+
233
233
+ private static class RegenAmountVerify extends ConfigVerifyImpl.DoubleConfigVerify {
234
234
+ @Override
235
235
+ public void check(Double old, Double value) throws IllegalArgumentException {
236
- + if (value <= 0.0) {
237
- + throw new IllegalArgumentException("regen-amount need > 0.0f ");
236
+ + if (value < 0.0) {
237
+ + throw new IllegalArgumentException("regen-amount need >= 0.0 ");
238
238
+ }
239
239
+ }
240
240
+ }
@@ -245,6 +245,12 @@ index 0000000000000000000000000000000000000000..59c98fa51afd4fd305852d14509b06f8
245
245
+ @GlobalConfig(name = "modify-config", category = {"modify", "fakeplayer"})
246
246
+ public static boolean fakeplayerModifyConfig = false;
247
247
+
248
+ + @GlobalConfig(name = "manual-save-and-load", category = {"modify", "fakeplayer"})
249
+ + public static boolean fakeplayerManualSaveAndLoad = false;
250
+ +
251
+ + @GlobalConfig(name = "cache-skin", category = {"modify", "fakeplayer"}, lock = true)
252
+ + public static boolean fakeplayerCacheSkin = false;
253
+ +
248
254
+ // Leaves end - modify - fakeplayer
249
255
+
250
256
+ // Leaves start - modify - minecraft-old
@@ -974,10 +980,10 @@ index 0000000000000000000000000000000000000000..59c98fa51afd4fd305852d14509b06f8
974
980
+ }
975
981
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgument.java b/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
976
982
new file mode 100644
977
- index 0000000000000000000000000000000000000000..2f0e6671dd8bfe4f320eab92c5f5bbc10abc3b05
983
+ index 0000000000000000000000000000000000000000..0bccbf7816ef621316f0da4911ec112f4753f88e
978
984
--- /dev/null
979
985
+++ b/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
980
- @@ -0,0 +1,49 @@
986
+ @@ -0,0 +1,55 @@
981
987
+ package org.leavesmc.leaves.command;
982
988
+
983
989
+ import org.jetbrains.annotations.NotNull;
@@ -988,17 +994,23 @@ index 0000000000000000000000000000000000000000..2f0e6671dd8bfe4f320eab92c5f5bbc1
988
994
+
989
995
+ public class CommandArgument {
990
996
+
997
+ + public static final CommandArgument EMPTY = new CommandArgument();
998
+ +
991
999
+ private final List<CommandArgumentType<?>> argumentTypes;
992
1000
+ private final List<List<String>> tabComplete;
993
1001
+
994
- + public CommandArgument(CommandArgumentType<?>... argumentTypes) {
1002
+ + private CommandArgument(CommandArgumentType<?>... argumentTypes) {
995
1003
+ this.argumentTypes = List.of(argumentTypes);
996
1004
+ this.tabComplete = new ArrayList<>();
997
1005
+ for (int i = 0; i < argumentTypes.length; i++) {
998
1006
+ tabComplete.add(new ArrayList<>());
999
1007
+ }
1000
1008
+ }
1001
1009
+
1010
+ + public static CommandArgument of(CommandArgumentType<?>... argumentTypes) {
1011
+ + return new CommandArgument(argumentTypes);
1012
+ + }
1013
+ +
1002
1014
+ public List<String> tabComplete(int n) {
1003
1015
+ if (tabComplete.size() > n) {
1004
1016
+ return tabComplete.get(n);
@@ -1029,10 +1041,10 @@ index 0000000000000000000000000000000000000000..2f0e6671dd8bfe4f320eab92c5f5bbc1
1029
1041
+ }
1030
1042
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java b/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java
1031
1043
new file mode 100644
1032
- index 0000000000000000000000000000000000000000..3f0707940f22736f703c24f4da25c18fa6e5b309
1044
+ index 0000000000000000000000000000000000000000..46aa6eaa75b65aad6bdbe4a5f517b42e87bcca77
1033
1045
--- /dev/null
1034
1046
+++ b/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java
1035
- @@ -0,0 +1,65 @@
1047
+ @@ -0,0 +1,69 @@
1036
1048
+ package org.leavesmc.leaves.command;
1037
1049
+
1038
1050
+ import net.minecraft.core.BlockPos;
@@ -1065,6 +1077,10 @@ index 0000000000000000000000000000000000000000..3f0707940f22736f703c24f4da25c18f
1065
1077
+ return Objects.requireNonNullElse(read(String.class), def);
1066
1078
+ }
1067
1079
+
1080
+ + public boolean readBoolean(boolean def) {
1081
+ + return Objects.requireNonNullElse(read(Boolean.class), def);
1082
+ + }
1083
+ +
1068
1084
+ public BlockPos readPos() {
1069
1085
+ Integer[] pos = {read(Integer.class), read(Integer.class), read(Integer.class)};
1070
1086
+ for (Integer po : pos) {
@@ -1100,10 +1116,10 @@ index 0000000000000000000000000000000000000000..3f0707940f22736f703c24f4da25c18f
1100
1116
+ }
1101
1117
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgumentType.java b/src/main/java/org/leavesmc/leaves/command/CommandArgumentType.java
1102
1118
new file mode 100644
1103
- index 0000000000000000000000000000000000000000..0d6d33e66461dda39c8f0e8395bf3f047ef88cbd
1119
+ index 0000000000000000000000000000000000000000..4ca3508475bbd9771768704e300fe12b717489d6
1104
1120
--- /dev/null
1105
1121
+++ b/src/main/java/org/leavesmc/leaves/command/CommandArgumentType.java
1106
- @@ -0,0 +1,48 @@
1122
+ @@ -0,0 +1,55 @@
1107
1123
+ package org.leavesmc.leaves.command;
1108
1124
+
1109
1125
+ import org.jetbrains.annotations.NotNull;
@@ -1150,6 +1166,13 @@ index 0000000000000000000000000000000000000000..0d6d33e66461dda39c8f0e8395bf3f04
1150
1166
+ }
1151
1167
+ };
1152
1168
+
1169
+ + public static final CommandArgumentType<Boolean> BOOLEAN = new CommandArgumentType<>() {
1170
+ + @Override
1171
+ + public Boolean pasre(@NotNull String arg) {
1172
+ + return Boolean.parseBoolean(arg);
1173
+ + }
1174
+ + };
1175
+ +
1153
1176
+ public abstract E pasre(@NotNull String arg);
1154
1177
+ }
1155
1178
diff --git a/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java b/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java
0 commit comments