Skip to content

Commit

Permalink
fixes porting EC 0.34.0 to 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Paul-R committed Sep 27, 2023
1 parent a5c2bc9 commit 4bd7622
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static <T> Command<ServerCommandSource> create(
Collection<Entry<String, T>> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<BlockPos.Mutable> getChunkCandidateBlocks(ChunkPos chunkPos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public final class EssentialCommandsConfig extends Config<EssentialCommandsConfi
@ConfigOption public final Option<Integer> RTP_MIN_RADIUS = new Option<>("rtp_min_radius", RTP_RADIUS.getValue(), (String s) -> parseIntOrDefault(s, RTP_RADIUS.getValue()));
@ConfigOption public final Option<Integer> RTP_COOLDOWN = new Option<>("rtp_cooldown", 30, ConfigUtil::parseInt);
@ConfigOption public final Option<Integer> RTP_MAX_ATTEMPTS = new Option<>("rtp_max_attempts", 15, ConfigUtil::parseInt);
@ConfigOption public final Option<List<String>> RTP_ENABLED_WORLDS = new Option<>("rtp_enabled_worlds", List.of(World.OVERWORLD.getValue().getPath()), arrayParser(Object::toString));
@ConfigOption public final Option<List<String>> RTP_ENABLED_WORLDS = new Option<>("rtp_enabled_worlds", List.of("minecraft:overworld"), arrayParser(Object::toString));
@ConfigOption public final Option<Boolean> BROADCAST_TO_OPS = new Option<>("broadcast_to_ops", false, Boolean::parseBoolean);
@ConfigOption public final Option<Boolean> NICK_REVEAL_ON_HOVER = new Option<>("nick_reveal_on_hover", true, Boolean::parseBoolean);
@ConfigOption public final Option<Boolean> GRANT_LOWEST_NUMERIC_BY_DEFAULT = new Option<>("grant_lowest_numeric_by_default", true, Boolean::parseBoolean);
Expand Down

0 comments on commit 4bd7622

Please sign in to comment.