Merge branch 'master' into future
This commit is contained in:
commit
dc25b617c1
2 files changed
+22
-1
No files matched your search
@@ -127,6 +127,27 @@ public class CarpetSettings
|
|||||||
public static String commandDistance = "true";
|
public static String commandDistance = "true";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
private static class CarpetPermissionLevel extends Validator<String> {
|
||||||
|
@Override public String validate(ServerCommandSource source, ParsedRule<String> currentRule, String newValue, String string) {
|
||||||
|
if (source.hasPermissionLevel(4))
|
||||||
|
return newValue;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String description()
|
||||||
|
{
|
||||||
|
return "This setting can only be set by admins with op level 4";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Rule(
|
||||||
|
desc = "Carpet command permission level. Can only be set via .conf file",
|
||||||
|
category = CREATIVE,
|
||||||
|
validate = CarpetPermissionLevel.class,
|
||||||
|
options = {"ops", "2", "4"}
|
||||||
|
)
|
||||||
|
public static String carpetCommandPermissionLevel = "ops";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Rule(desc = "Gbhs sgnf sadsgras fhskdpri!!!", category = EXPERIMENTAL)
|
@Rule(desc = "Gbhs sgnf sadsgras fhskdpri!!!", category = EXPERIMENTAL)
|
||||||
|
|||||||
@@ -588,7 +588,7 @@ public class SettingsManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
LiteralArgumentBuilder<ServerCommandSource> literalargumentbuilder = literal(identifier).requires((player) ->
|
LiteralArgumentBuilder<ServerCommandSource> literalargumentbuilder = literal(identifier).requires((player) ->
|
||||||
player.hasPermissionLevel(2) && !locked);
|
canUseCommand(player, CarpetSettings.carpetCommandPermissionLevel) && !locked);
|
||||||
|
|
||||||
literalargumentbuilder.executes((context)-> listAllSettings(context.getSource())).
|
literalargumentbuilder.executes((context)-> listAllSettings(context.getSource())).
|
||||||
then(literal("list").
|
then(literal("list").
|
||||||
|
|||||||
Reference in new issue
Block a user