Skip to content

Commit

Permalink
Fixed some completely wrong casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro270707 committed Jan 16, 2024
1 parent 4f659d9 commit 2e5092b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@SuppressWarnings("unchecked")
public class GameRuleCommand {
public static void register(CommandDispatcher<CommanderCommandSource> dispatcher) {
final LiteralArgumentBuilder<CommanderCommandSource> argumentBuilder = (LiteralArgumentBuilder) LiteralArgumentBuilder.literal("gamerule").requires(c -> ((CommanderCommandSource)c).hasAdmin());
final LiteralArgumentBuilder<CommanderCommandSource> argumentBuilder = (LiteralArgumentBuilder) LiteralArgumentBuilder.literal("gamerule").requires(source -> ((CommanderCommandSource)source).hasAdmin());
for (final GameRule<?> gameRule : Registries.GAME_RULES) {
RequiredArgumentBuilder<CommanderCommandSource, ?> gameRuleValueArgument;
if (gameRule instanceof GameRuleBoolean) {
Expand All @@ -39,7 +39,7 @@ public static void register(CommandDispatcher<CommanderCommandSource> dispatcher
}
argumentBuilder.then(LiteralArgumentBuilder.<CommanderCommandSource>literal(gameRule.getKey())
.executes(c -> {
c.getSource().sendTranslatableMessage("commands.commander.gamerule.get", gameRule.getKey(), ((CommanderCommandSource)c).getWorld().getGameRule(gameRule));
c.getSource().sendTranslatableMessage("commands.commander.gamerule.get", gameRule.getKey(), c.getSource().getWorld().getGameRule(gameRule));
return Command.SINGLE_SUCCESS;
})
.then(gameRuleValueArgument));
Expand Down

0 comments on commit 2e5092b

Please sign in to comment.