settings ported to the annotation based system

This commit is contained in:
gnembon committed 2019-06-11 23:01:09 -03:00
1 parent 79495eccd0
commit 734dc95dab
84 files changed
+299 -1238

No files matched your search

@@ -1,6 +1,6 @@
package carpet.commands;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.utils.DistanceCalculator;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
@@ -15,7 +15,7 @@ public class DistanceCommand
public static void register(CommandDispatcher<ServerCommandSource> dispatcher)
{
LiteralArgumentBuilder<ServerCommandSource> command = literal("distance").
requires((player) -> CarpetSettings.getBool("commandDistance")).
requires((player) -> CarpetSettings.commandDistance).
then(literal("from").
executes( (c) -> DistanceCalculator.setStart(c.getSource(), c.getSource().getPosition())).
then(argument("from", Vec3ArgumentType.create()).