diff --git a/src/main/java/com/fibermc/essentialcommands/commands/FlySpeedCommand.java b/src/main/java/com/fibermc/essentialcommands/commands/FlySpeedCommand.java index d87ca002..6d446b63 100644 --- a/src/main/java/com/fibermc/essentialcommands/commands/FlySpeedCommand.java +++ b/src/main/java/com/fibermc/essentialcommands/commands/FlySpeedCommand.java @@ -57,7 +57,7 @@ public static void exec(ServerCommandSource source, ServerPlayerEntity target, i if (!Objects.equals(source.getPlayer(), target)) { ECText ecTextSource = ECText.access(source.getPlayer()); - source.sendFeedback(() -> + source.sendFeedback( ecTextSource.getText( "cmd.fly.speed.feedback.update.other", ecTextSource.accent(String.valueOf(oldFlySpeed)), diff --git a/src/main/java/com/fibermc/essentialcommands/commands/ListCommandFactory.java b/src/main/java/com/fibermc/essentialcommands/commands/ListCommandFactory.java index e959c9d8..1b9f7e05 100644 --- a/src/main/java/com/fibermc/essentialcommands/commands/ListCommandFactory.java +++ b/src/main/java/com/fibermc/essentialcommands/commands/ListCommandFactory.java @@ -38,7 +38,7 @@ public static Command create( Collection> suggestionsList = suggestionsProvider.getSuggestionList(context); context.getSource().sendFeedback( - getSuggestionText(responsePreText, commandExecText, suggestionsList, styleProvider), + getSuggestionText(responsePreText, commandExecText, suggestionsList, Entry::getKey, styleProvider), CONFIG.BROADCAST_TO_OPS ); return 0; diff --git a/src/main/java/com/fibermc/essentialcommands/commands/RandomTeleportCommand.java b/src/main/java/com/fibermc/essentialcommands/commands/RandomTeleportCommand.java index c76c8f84..26d6542a 100644 --- a/src/main/java/com/fibermc/essentialcommands/commands/RandomTeleportCommand.java +++ b/src/main/java/com/fibermc/essentialcommands/commands/RandomTeleportCommand.java @@ -23,7 +23,6 @@ import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import net.minecraft.block.BlockState; import net.minecraft.block.Material; import net.minecraft.command.CommandException; import net.minecraft.server.command.ServerCommandSource; @@ -216,7 +215,7 @@ private static boolean isSafePosition(Chunk chunk, BlockPos pos, ExecutionContex } var material = chunk.getBlockState(pos).getMaterial(); - return pos.getY() < maxY.get() && !material.isLiquid() && material != Material.FIRE; + return pos.getY() < ctx.topY && !material.isLiquid() && material != Material.FIRE; } public static Iterable getChunkCandidateBlocks(ChunkPos chunkPos) { diff --git a/src/main/java/com/fibermc/essentialcommands/commands/helpers/HeightFindingStrategy.java b/src/main/java/com/fibermc/essentialcommands/commands/helpers/HeightFindingStrategy.java index 50dce59d..97bdf56f 100644 --- a/src/main/java/com/fibermc/essentialcommands/commands/helpers/HeightFindingStrategy.java +++ b/src/main/java/com/fibermc/essentialcommands/commands/helpers/HeightFindingStrategy.java @@ -55,7 +55,7 @@ private static OptionalInt findYBottomUp(Chunk chunk, int x, int z) { while (mutablePos.getY() < topY) { bsHead3 = chunk.getBlockState(mutablePos.move(Direction.UP)); - if (bsFeet1.isSolid() && bsBody2.isAir() && bsHead3.isAir()) { // If there is a floor block and space for player body+head + if (bsFeet1.getMaterial().isSolid() && bsBody2.isAir() && bsHead3.isAir()) { // If there is a floor block and space for player body+head return OptionalInt.of(mutablePos.getY() - 1); } @@ -67,7 +67,7 @@ private static OptionalInt findYBottomUp(Chunk chunk, int x, int z) { } public static int getChunkHighestNonEmptySectionYOffsetOrTopY(Chunk chunk) { - int i = chunk.getHighestNonEmptySection(); + int i = chunk.getHighestNonEmptySection().getYOffset(); return i == chunk.getTopY() ? chunk.getBottomY() : ChunkSectionPos.getBlockCoord(chunk.sectionIndexToCoord(i)); } } diff --git a/src/main/java/com/fibermc/essentialcommands/config/EssentialCommandsConfig.java b/src/main/java/com/fibermc/essentialcommands/config/EssentialCommandsConfig.java index 0d3b8edc..c9e2d26b 100644 --- a/src/main/java/com/fibermc/essentialcommands/config/EssentialCommandsConfig.java +++ b/src/main/java/com/fibermc/essentialcommands/config/EssentialCommandsConfig.java @@ -88,7 +88,7 @@ public final class EssentialCommandsConfig extends Config RTP_MIN_RADIUS = new Option<>("rtp_min_radius", RTP_RADIUS.getValue(), (String s) -> parseIntOrDefault(s, RTP_RADIUS.getValue())); @ConfigOption public final Option RTP_COOLDOWN = new Option<>("rtp_cooldown", 30, ConfigUtil::parseInt); @ConfigOption public final Option RTP_MAX_ATTEMPTS = new Option<>("rtp_max_attempts", 15, ConfigUtil::parseInt); - @ConfigOption public final Option> RTP_ENABLED_WORLDS = new Option<>("rtp_enabled_worlds", List.of(World.OVERWORLD.getValue().getPath()), arrayParser(Object::toString)); + @ConfigOption public final Option> RTP_ENABLED_WORLDS = new Option<>("rtp_enabled_worlds", List.of("minecraft:overworld"), arrayParser(Object::toString)); @ConfigOption public final Option BROADCAST_TO_OPS = new Option<>("broadcast_to_ops", false, Boolean::parseBoolean); @ConfigOption public final Option NICK_REVEAL_ON_HOVER = new Option<>("nick_reveal_on_hover", true, Boolean::parseBoolean); @ConfigOption public final Option GRANT_LOWEST_NUMERIC_BY_DEFAULT = new Option<>("grant_lowest_numeric_by_default", true, Boolean::parseBoolean);