Fix a few IDE warnings (#1345)

This commit is contained in:
altrisi authored and GitHub committed 2022-02-20 19:16:12 +01:00
1 parent e011f65e75
commit b1c934da28
19 files changed
+225 -350

No files matched your search

@@ -4,6 +4,7 @@ import carpet.CarpetSettings;
import carpet.settings.SettingsManager;
import carpet.utils.Messenger;
import com.google.common.collect.Lists;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.arguments.IntegerArgumentType;
@@ -79,12 +80,6 @@ public class DrawCommand
dispatcher.register(command);
}
@FunctionalInterface
private interface OptionalBlockSelector
{
Integer apply(final CommandContext<CommandSourceStack> ctx) throws CommandSyntaxException;
}
@FunctionalInterface
private interface ArgumentExtractor<T>
{
@@ -92,13 +87,13 @@ public class DrawCommand
}
private static RequiredArgumentBuilder<CommandSourceStack, BlockInput>
drawShape(OptionalBlockSelector drawer)
drawShape(Command<CommandSourceStack> drawer)
{
return argument("block", BlockStateArgument.block()).
executes(drawer::apply)
executes(drawer)
.then(literal("replace")
.then(argument("filter", BlockPredicateArgument.blockPredicate())
.executes(drawer::apply)));
.executes(drawer)));
}
private static class ErrorHandled extends RuntimeException {}