diff --git a/build.gradle b/build.gradle index 5cb167351..f92ec606f 100755 --- a/build.gradle +++ b/build.gradle @@ -85,7 +85,7 @@ task sourceJar(type: Jar, dependsOn: classes) { } minecraft { - mappings channel: 'snapshot', version: '20200707-1.16.1' + mappings channel: 'snapshot', version: '20200723-1.16.1' if (getProject().hasProperty("baritone.forge_build")) { reobfMappings 'searge' diff --git a/src/api/java/baritone/api/command/helpers/Paginator.java b/src/api/java/baritone/api/command/helpers/Paginator.java index b4fe28941..dda510ecd 100644 --- a/src/api/java/baritone/api/command/helpers/Paginator.java +++ b/src/api/java/baritone/api/command/helpers/Paginator.java @@ -77,7 +77,7 @@ public class Paginator implements Helper { boolean hasNextPage = commandPrefix != null && validPage(page + 1); TextComponent prevPageComponent = new StringTextComponent("<<"); if (hasPrevPage) { - prevPageComponent.func_230530_a_(prevPageComponent.getStyle() + prevPageComponent.setStyle(prevPageComponent.getStyle() .setClickEvent(new ClickEvent( ClickEvent.Action.RUN_COMMAND, String.format("%s %d", commandPrefix, page - 1) @@ -87,11 +87,11 @@ public class Paginator implements Helper { new StringTextComponent("Click to view previous page") ))); } else { - prevPageComponent.func_230530_a_(prevPageComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); + prevPageComponent.setStyle(prevPageComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); } TextComponent nextPageComponent = new StringTextComponent(">>"); if (hasNextPage) { - nextPageComponent.func_230530_a_(nextPageComponent.getStyle() + nextPageComponent.setStyle(nextPageComponent.getStyle() .setClickEvent(new ClickEvent( ClickEvent.Action.RUN_COMMAND, String.format("%s %d", commandPrefix, page + 1) @@ -101,14 +101,14 @@ public class Paginator implements Helper { new StringTextComponent("Click to view next page") ))); } else { - nextPageComponent.func_230530_a_(nextPageComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); + nextPageComponent.setStyle(nextPageComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); } TextComponent pagerComponent = new StringTextComponent(""); - pagerComponent.func_230530_a_(pagerComponent.getStyle().setFormatting(TextFormatting.GRAY)); - pagerComponent.func_230529_a_(prevPageComponent); // appendSibling - pagerComponent.func_240702_b_(" | "); // appendText - pagerComponent.func_230529_a_(nextPageComponent); - pagerComponent.func_240702_b_(String.format(" %d/%d", page, getMaxPage())); + pagerComponent.setStyle(pagerComponent.getStyle().setFormatting(TextFormatting.GRAY)); + pagerComponent.append(prevPageComponent); + pagerComponent.appendString(" | "); + pagerComponent.append(nextPageComponent); + pagerComponent.appendString(String.format(" %d/%d", page, getMaxPage())); logDirect(pagerComponent); } diff --git a/src/api/java/baritone/api/utils/Helper.java b/src/api/java/baritone/api/utils/Helper.java index c96c8d8d4..2562e563e 100755 --- a/src/api/java/baritone/api/utils/Helper.java +++ b/src/api/java/baritone/api/utils/Helper.java @@ -52,14 +52,14 @@ public interface Helper { final Calendar now = Calendar.getInstance(); final boolean xd = now.get(Calendar.MONTH) == Calendar.APRIL && now.get(Calendar.DAY_OF_MONTH) <= 3; TextComponent baritone = new StringTextComponent(xd ? "Baritoe" : BaritoneAPI.getSettings().shortBaritonePrefix.value ? "B" : "Baritone"); - baritone.func_230530_a_(baritone.getStyle().setFormatting(TextFormatting.LIGHT_PURPLE)); + baritone.setStyle(baritone.getStyle().setFormatting(TextFormatting.LIGHT_PURPLE)); // Outer brackets TextComponent prefix = new StringTextComponent(""); - prefix.func_230530_a_(baritone.getStyle().setFormatting(TextFormatting.DARK_PURPLE)); - prefix.func_240702_b_("["); - prefix.func_230529_a_(baritone); - prefix.func_240702_b_("]"); + prefix.setStyle(baritone.getStyle().setFormatting(TextFormatting.DARK_PURPLE)); + prefix.appendString("["); + prefix.append(baritone); + prefix.appendString("]"); return prefix; } @@ -85,9 +85,9 @@ public interface Helper { */ default void logDirect(ITextComponent... components) { TextComponent component = new StringTextComponent(""); - component.func_230529_a_(getPrefix()); - component.func_230529_a_(new StringTextComponent(" ")); - Arrays.asList(components).forEach(component::func_230529_a_); + component.append(getPrefix()); + component.append(new StringTextComponent(" ")); + Arrays.asList(components).forEach(component::append); mc.execute(() -> BaritoneAPI.getSettings().logger.value.accept(component)); } @@ -101,7 +101,7 @@ public interface Helper { default void logDirect(String message, TextFormatting color) { Stream.of(message.split("\n")).forEach(line -> { TextComponent component = new StringTextComponent(line.replace("\t", " ")); - component.func_230530_a_(component.getStyle().setFormatting(color)); + component.setStyle(component.getStyle().setFormatting(color)); logDirect(component); }); } diff --git a/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java b/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java index d749c35b8..06abfd674 100644 --- a/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java +++ b/src/launch/java/baritone/launch/mixins/MixinCommandSuggestionHelper.java @@ -52,7 +52,7 @@ public class MixinCommandSuggestionHelper { private List field_228103_l_; @Shadow - private CompletableFuture field_228107_p_; + private CompletableFuture suggestionsFuture; @Inject( method = "init", @@ -78,7 +78,7 @@ public class MixinCommandSuggestionHelper { this.field_228103_l_.clear(); if (event.completions.length == 0) { - this.field_228107_p_ = Suggestions.empty(); + this.suggestionsFuture = Suggestions.empty(); } else { int offset = this.field_228095_d_.getText().endsWith(" ") ? this.field_228095_d_.getCursorPosition() @@ -92,8 +92,8 @@ public class MixinCommandSuggestionHelper { StringRange.between(offset, offset + suggestionList.stream().mapToInt(s -> s.getText().length()).max().orElse(0)), suggestionList); - this.field_228107_p_ = new CompletableFuture<>(); - this.field_228107_p_.complete(suggestions); + this.suggestionsFuture = new CompletableFuture<>(); + this.suggestionsFuture.complete(suggestions); } } } diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 91f6a8504..8db5a7416 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -380,7 +380,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, public BetterBlockPos pathStart() { // TODO move to a helper or util class BetterBlockPos feet = ctx.playerFeet(); if (!MovementHelper.canWalkOn(ctx, feet.down())) { - if (ctx.player().func_233570_aj_()) { + if (ctx.player().isOnGround()) { double playerX = ctx.player().getPositionVec().x; double playerZ = ctx.player().getPositionVec().z; ArrayList closest = new ArrayList<>(); diff --git a/src/main/java/baritone/command/ExampleBaritoneControl.java b/src/main/java/baritone/command/ExampleBaritoneControl.java index 9c6313dd2..ed2c1f06c 100644 --- a/src/main/java/baritone/command/ExampleBaritoneControl.java +++ b/src/main/java/baritone/command/ExampleBaritoneControl.java @@ -80,7 +80,7 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener String msg = command + rest; String toDisplay = settings.censorRanCommands.value ? command + " ..." : msg; TextComponent component = new StringTextComponent(String.format("> %s", toDisplay)); - component.func_230530_a_(component.getStyle() + component.setStyle(component.getStyle() .setFormatting(TextFormatting.WHITE) .setHoverEvent(new HoverEvent( HoverEvent.Action.SHOW_TEXT, diff --git a/src/main/java/baritone/command/defaults/ChestsCommand.java b/src/main/java/baritone/command/defaults/ChestsCommand.java index 2037e1f61..4e4f3a2c3 100644 --- a/src/main/java/baritone/command/defaults/ChestsCommand.java +++ b/src/main/java/baritone/command/defaults/ChestsCommand.java @@ -55,7 +55,7 @@ public class ChestsCommand extends Command { logDirect(pos.toString()); for (ItemStack item : inv.getContents()) { IFormattableTextComponent component = (IFormattableTextComponent) item.getTextComponent(); - component.func_240702_b_(String.format(" x %d", item.getCount())); + component.appendString(String.format(" x %d", item.getCount())); logDirect(component); } } diff --git a/src/main/java/baritone/command/defaults/ComeCommand.java b/src/main/java/baritone/command/defaults/ComeCommand.java index 04d804b46..354acb9e4 100644 --- a/src/main/java/baritone/command/defaults/ComeCommand.java +++ b/src/main/java/baritone/command/defaults/ComeCommand.java @@ -42,7 +42,7 @@ public class ComeCommand extends Command { if (entity == null) { throw new CommandInvalidStateException("render view entity is null"); } - baritone.getCustomGoalProcess().setGoalAndPath(new GoalBlock(entity.func_233580_cy_())); + baritone.getCustomGoalProcess().setGoalAndPath(new GoalBlock(entity.getPosition())); logDirect("Coming"); } diff --git a/src/main/java/baritone/command/defaults/HelpCommand.java b/src/main/java/baritone/command/defaults/HelpCommand.java index 19cdce6ca..bdd49bc99 100644 --- a/src/main/java/baritone/command/defaults/HelpCommand.java +++ b/src/main/java/baritone/command/defaults/HelpCommand.java @@ -59,19 +59,19 @@ public class HelpCommand extends Command { String names = String.join("/", command.getNames()); String name = command.getNames().get(0); TextComponent shortDescComponent = new StringTextComponent(" - " + command.getShortDesc()); - shortDescComponent.func_230530_a_(shortDescComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); + shortDescComponent.setStyle(shortDescComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); TextComponent namesComponent = new StringTextComponent(names); - namesComponent.func_230530_a_(namesComponent.getStyle().setFormatting(TextFormatting.WHITE)); + namesComponent.setStyle(namesComponent.getStyle().setFormatting(TextFormatting.WHITE)); TextComponent hoverComponent = new StringTextComponent(""); - hoverComponent.func_230530_a_(hoverComponent.getStyle().setFormatting(TextFormatting.GRAY)); - hoverComponent.func_230529_a_(namesComponent); - hoverComponent.func_240702_b_("\n" + command.getShortDesc()); - hoverComponent.func_240702_b_("\n\nClick to view full help"); + hoverComponent.setStyle(hoverComponent.getStyle().setFormatting(TextFormatting.GRAY)); + hoverComponent.append(namesComponent); + hoverComponent.appendString("\n" + command.getShortDesc()); + hoverComponent.appendString("\n\nClick to view full help"); String clickCommand = FORCE_COMMAND_PREFIX + String.format("%s %s", label, command.getNames().get(0)); TextComponent component = new StringTextComponent(name); - component.func_230530_a_(component.getStyle().setFormatting(TextFormatting.GRAY)); - component.func_230529_a_(shortDescComponent); - component.func_230530_a_(component.getStyle() + component.setStyle(component.getStyle().setFormatting(TextFormatting.GRAY)); + component.append(shortDescComponent); + component.setStyle(component.getStyle() .setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverComponent)) .setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, clickCommand))); return component; @@ -89,7 +89,7 @@ public class HelpCommand extends Command { command.getLongDesc().forEach(this::logDirect); logDirect(""); TextComponent returnComponent = new StringTextComponent("Click to return to the help menu"); - returnComponent.func_230530_a_(returnComponent.getStyle().setClickEvent(new ClickEvent( + returnComponent.setStyle(returnComponent.getStyle().setClickEvent(new ClickEvent( ClickEvent.Action.RUN_COMMAND, FORCE_COMMAND_PREFIX + label ))); diff --git a/src/main/java/baritone/command/defaults/SelCommand.java b/src/main/java/baritone/command/defaults/SelCommand.java index 529421f7a..5a04fc1df 100644 --- a/src/main/java/baritone/command/defaults/SelCommand.java +++ b/src/main/java/baritone/command/defaults/SelCommand.java @@ -83,7 +83,7 @@ public class SelCommand extends Command { if (action == Action.POS2 && pos1 == null) { throw new CommandInvalidStateException("Set pos1 first before using pos2"); } - BetterBlockPos playerPos = mc.getRenderViewEntity() != null ? BetterBlockPos.from(mc.getRenderViewEntity().func_233580_cy_()) : ctx.playerFeet(); + BetterBlockPos playerPos = mc.getRenderViewEntity() != null ? BetterBlockPos.from(mc.getRenderViewEntity().getPosition()) : ctx.playerFeet(); BetterBlockPos pos = args.hasAny() ? args.getDatatypePost(RelativeBlockPos.INSTANCE, playerPos) : playerPos; args.requireMax(0); if (action == Action.POS1) { diff --git a/src/main/java/baritone/command/defaults/SetCommand.java b/src/main/java/baritone/command/defaults/SetCommand.java index 49430040b..5654670db 100644 --- a/src/main/java/baritone/command/defaults/SetCommand.java +++ b/src/main/java/baritone/command/defaults/SetCommand.java @@ -82,17 +82,17 @@ public class SetCommand extends Command { " (%s)", settingTypeToString(setting) )); - typeComponent.func_230530_a_(typeComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); + typeComponent.setStyle(typeComponent.getStyle().setFormatting(TextFormatting.DARK_GRAY)); TextComponent hoverComponent = new StringTextComponent(""); - hoverComponent.func_230530_a_(hoverComponent.getStyle().setFormatting(TextFormatting.GRAY)); - hoverComponent.func_240702_b_(setting.getName()); - hoverComponent.func_240702_b_(String.format("\nType: %s", settingTypeToString(setting))); - hoverComponent.func_240702_b_(String.format("\n\nValue:\n%s", settingValueToString(setting))); + hoverComponent.setStyle(hoverComponent.getStyle().setFormatting(TextFormatting.GRAY)); + hoverComponent.appendString(setting.getName()); + hoverComponent.appendString(String.format("\nType: %s", settingTypeToString(setting))); + hoverComponent.appendString(String.format("\n\nValue:\n%s", settingValueToString(setting))); String commandSuggestion = Baritone.settings().prefix.value + String.format("set %s ", setting.getName()); TextComponent component = new StringTextComponent(setting.getName()); - component.func_230530_a_(component.getStyle().setFormatting(TextFormatting.GRAY)); - component.func_230529_a_(typeComponent); - component.func_230530_a_(component.getStyle() + component.setStyle(component.getStyle().setFormatting(TextFormatting.GRAY)); + component.append(typeComponent); + component.setStyle(component.getStyle() .setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverComponent)) .setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, commandSuggestion))); return component; @@ -164,7 +164,7 @@ public class SetCommand extends Command { )); } TextComponent oldValueComponent = new StringTextComponent(String.format("Old value: %s", oldValue)); - oldValueComponent.func_230530_a_(oldValueComponent.getStyle() + oldValueComponent.setStyle(oldValueComponent.getStyle() .setFormatting(TextFormatting.GRAY) .setHoverEvent(new HoverEvent( HoverEvent.Action.SHOW_TEXT, diff --git a/src/main/java/baritone/command/defaults/WaypointsCommand.java b/src/main/java/baritone/command/defaults/WaypointsCommand.java index df91d805f..c264088a9 100644 --- a/src/main/java/baritone/command/defaults/WaypointsCommand.java +++ b/src/main/java/baritone/command/defaults/WaypointsCommand.java @@ -61,16 +61,16 @@ public class WaypointsCommand extends Command { BiFunction toComponent = (waypoint, _action) -> { TextComponent component = new StringTextComponent(""); TextComponent tagComponent = new StringTextComponent(waypoint.getTag().name() + " "); - tagComponent.func_230530_a_(tagComponent.getStyle().setFormatting(TextFormatting.GRAY)); + tagComponent.setStyle(tagComponent.getStyle().setFormatting(TextFormatting.GRAY)); String name = waypoint.getName(); TextComponent nameComponent = new StringTextComponent(!name.isEmpty() ? name : ""); - nameComponent.func_230530_a_(nameComponent.getStyle().setFormatting(!name.isEmpty() ? TextFormatting.GRAY : TextFormatting.DARK_GRAY)); + nameComponent.setStyle(nameComponent.getStyle().setFormatting(!name.isEmpty() ? TextFormatting.GRAY : TextFormatting.DARK_GRAY)); TextComponent timestamp = new StringTextComponent(" @ " + new Date(waypoint.getCreationTimestamp())); - timestamp.func_230530_a_(timestamp.getStyle().setFormatting(TextFormatting.DARK_GRAY)); - component.func_230529_a_(tagComponent); - component.func_230529_a_(nameComponent); - component.func_230529_a_(timestamp); - component.func_230530_a_(component.getStyle() + timestamp.setStyle(timestamp.getStyle().setFormatting(TextFormatting.DARK_GRAY)); + component.append(tagComponent); + component.append(nameComponent); + component.append(timestamp); + component.setStyle(component.getStyle() .setHoverEvent(new HoverEvent( HoverEvent.Action.SHOW_TEXT, new StringTextComponent("Click to select") @@ -138,8 +138,8 @@ public class WaypointsCommand extends Command { IWaypoint waypoint = new Waypoint(name, tag, pos); ForWaypoints.waypoints(this.baritone).addWaypoint(waypoint); TextComponent component = new StringTextComponent("Waypoint added: "); - component.func_230530_a_(component.getStyle().setFormatting(TextFormatting.GRAY)); - component.func_230529_a_(toComponent.apply(waypoint, Action.INFO)); + component.setStyle(component.getStyle().setFormatting(TextFormatting.GRAY)); + component.append(toComponent.apply(waypoint, Action.INFO)); logDirect(component); } else if (action == Action.CLEAR) { args.requireMax(1); @@ -196,7 +196,7 @@ public class WaypointsCommand extends Command { logDirect(transform.apply(waypoint)); logDirect(String.format("Position: %s", waypoint.getLocation())); TextComponent deleteComponent = new StringTextComponent("Click to delete this waypoint"); - deleteComponent.func_230530_a_(deleteComponent.getStyle().setClickEvent(new ClickEvent( + deleteComponent.setStyle(deleteComponent.getStyle().setClickEvent(new ClickEvent( ClickEvent.Action.RUN_COMMAND, String.format( "%s%s delete %s @ %d", @@ -207,7 +207,7 @@ public class WaypointsCommand extends Command { ) ))); TextComponent goalComponent = new StringTextComponent("Click to set goal to this waypoint"); - goalComponent.func_230530_a_(goalComponent.getStyle().setClickEvent(new ClickEvent( + goalComponent.setStyle(goalComponent.getStyle().setClickEvent(new ClickEvent( ClickEvent.Action.RUN_COMMAND, String.format( "%s%s goal %s @ %d", @@ -218,7 +218,7 @@ public class WaypointsCommand extends Command { ) ))); TextComponent backComponent = new StringTextComponent("Click to return to the waypoints list"); - backComponent.func_230530_a_(backComponent.getStyle().setClickEvent(new ClickEvent( + backComponent.setStyle(backComponent.getStyle().setClickEvent(new ClickEvent( ClickEvent.Action.RUN_COMMAND, String.format( "%s%s list", diff --git a/src/main/java/baritone/pathing/movement/CalculationContext.java b/src/main/java/baritone/pathing/movement/CalculationContext.java index 744707a50..260e403af 100644 --- a/src/main/java/baritone/pathing/movement/CalculationContext.java +++ b/src/main/java/baritone/pathing/movement/CalculationContext.java @@ -86,7 +86,7 @@ public class CalculationContext { this.bsi = new BlockStateInterface(world, worldData, forUseOnAnotherThread); this.toolSet = new ToolSet(player); this.hasThrowaway = Baritone.settings().allowPlace.value && ((Baritone) baritone).getInventoryBehavior().hasGenericThrowaway(); - this.hasWaterBucket = Baritone.settings().allowWaterBucketFall.value && PlayerInventory.isHotbar(player.inventory.getSlotFor(STACK_BUCKET_WATER)) && world.func_234922_V_() != DimensionType.field_236000_d_; + this.hasWaterBucket = Baritone.settings().allowWaterBucketFall.value && PlayerInventory.isHotbar(player.inventory.getSlotFor(STACK_BUCKET_WATER)) && world.func_234922_V_() != DimensionType.THE_NETHER; this.canSprint = Baritone.settings().allowSprint.value && player.getFoodStats().getFoodLevel() > 6; this.placeBlockCost = Baritone.settings().blockPlacementPenalty.value; this.allowBreak = Baritone.settings().allowBreak.value; diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index a6489384f..da36ac5f8 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -97,11 +97,11 @@ public class MovementFall extends Movement { Block destBlock = destState.getBlock(); boolean isWater = destState.getFluidState().getFluid() instanceof WaterFluid; if (!isWater && willPlaceBucket() && !playerFeet.equals(dest)) { - if (!PlayerInventory.isHotbar(ctx.player().inventory.getSlotFor(STACK_BUCKET_WATER)) || ctx.world().func_234922_V_() == DimensionType.field_236000_d_) { + if (!PlayerInventory.isHotbar(ctx.player().inventory.getSlotFor(STACK_BUCKET_WATER)) || ctx.world().func_234922_V_() == DimensionType.THE_NETHER) { return state.setStatus(MovementStatus.UNREACHABLE); } - if (ctx.player().getPositionVec().y - dest.getY() < ctx.playerController().getBlockReachDistance() && !ctx.player().func_233570_aj_()) { + if (ctx.player().getPositionVec().y - dest.getY() < ctx.playerController().getBlockReachDistance() && !ctx.player().isOnGround()) { ctx.player().inventory.currentItem = ctx.player().inventory.getSlotFor(STACK_BUCKET_WATER); targetRotation = new Rotation(toDest.getYaw(), 90.0F); @@ -136,7 +136,7 @@ public class MovementFall extends Movement { } Vector3d destCenter = VecUtils.getBlockPosCenter(dest); // we are moving to the 0.5 center not the edge (like if we were falling on a ladder) if (Math.abs(ctx.player().getPositionVec().x + ctx.player().getMotion().x - destCenter.x) > 0.1 || Math.abs(ctx.player().getPositionVec().z + ctx.player().getMotion().z - destCenter.z) > 0.1) { - if (!ctx.player().func_233570_aj_() && Math.abs(ctx.player().getMotion().y) > 0.4) { + if (!ctx.player().isOnGround() && Math.abs(ctx.player().getMotion().y) > 0.4) { state.setInput(Input.SNEAK, true); } state.setInput(Input.MOVE_FORWARD, true); @@ -148,7 +148,7 @@ public class MovementFall extends Movement { double dist = Math.abs(avoid.getX() * (destCenter.x - avoid.getX() / 2.0 - ctx.player().getPositionVec().x)) + Math.abs(avoid.getZ() * (destCenter.z - avoid.getZ() / 2.0 - ctx.player().getPositionVec().z)); if (dist < 0.6) { state.setInput(Input.MOVE_FORWARD, true); - } else if (!ctx.player().func_233570_aj_()) { + } else if (!ctx.player().isOnGround()) { state.setInput(Input.SNEAK, false); } } diff --git a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java index 9a538bd47..a2afb1996 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java @@ -251,7 +251,7 @@ public class MovementParkour extends Movement { } } else if (!ctx.playerFeet().equals(src)) { if (ctx.playerFeet().equals(src.offset(direction)) || ctx.player().getPositionVec().y - src.y > 0.0001) { - if (!MovementHelper.canWalkOn(ctx, dest.down()) && !ctx.player().func_233570_aj_() && MovementHelper.attemptToPlaceABlock(state, baritone, dest.down(), true, false) == PlaceResult.READY_TO_PLACE) { + if (!MovementHelper.canWalkOn(ctx, dest.down()) && !ctx.player().isOnGround() && MovementHelper.attemptToPlaceABlock(state, baritone, dest.down(), true, false) == PlaceResult.READY_TO_PLACE) { // go in the opposite order to check DOWN before all horizontals -- down is preferable because you don't have to look to the side while in midair, which could mess up the trajectory state.setInput(Input.CLICK_RIGHT, true); } diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index 62274e2d7..73649a445 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -245,7 +245,7 @@ public class MovementTraverse extends Movement { } Block low = BlockStateInterface.get(ctx, src).getBlock(); Block high = BlockStateInterface.get(ctx, src.up()).getBlock(); - if (ctx.player().getPositionVec().y > src.y + 0.1D && !ctx.player().func_233570_aj_() && (low == Blocks.VINE || low == Blocks.LADDER || high == Blocks.VINE || high == Blocks.LADDER)) { + if (ctx.player().getPositionVec().y > src.y + 0.1D && !ctx.player().isOnGround() && (low == Blocks.VINE || low == Blocks.LADDER || high == Blocks.VINE || high == Blocks.LADDER)) { // hitting W could cause us to climb the ladder instead of going forward // wait until we're on the ground return state; diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 7c03235c9..ac992cfa6 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -274,7 +274,7 @@ public class PathExecutor implements IPathExecutor, Helper { if (!current.isPresent()) { return false; } - if (!ctx.player().func_233570_aj_()) { + if (!ctx.player().isOnGround()) { return false; } if (!MovementHelper.canWalkOn(ctx, ctx.playerFeet().down())) { @@ -323,7 +323,7 @@ public class PathExecutor implements IPathExecutor, Helper { * @return Whether or not it was possible to snap to the current player feet */ public boolean snipsnapifpossible() { - if (!ctx.player().func_233570_aj_() && ctx.world().getFluidState(ctx.playerFeet()).isEmpty()) { + if (!ctx.player().isOnGround() && ctx.world().getFluidState(ctx.playerFeet()).isEmpty()) { // if we're falling in the air, and not in water, don't splice return false; } else { diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index 577244bd2..4acf38a0d 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -438,7 +438,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil } Optional> toBreak = toBreakNearPlayer(bcc); - if (toBreak.isPresent() && isSafeToCancel && ctx.player().func_233570_aj_()) { + if (toBreak.isPresent() && isSafeToCancel && ctx.player().isOnGround()) { // we'd like to pause to break this block // only change look direction if it's safe (don't want to fuck up an in progress parkour for example Rotation rot = toBreak.get().getB(); @@ -458,7 +458,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil } List desirableOnHotbar = new ArrayList<>(); Optional toPlace = searchForPlacables(bcc, desirableOnHotbar); - if (toPlace.isPresent() && isSafeToCancel && ctx.player().func_233570_aj_() && ticks <= 0) { + if (toPlace.isPresent() && isSafeToCancel && ctx.player().isOnGround() && ticks <= 0) { Rotation rot = toPlace.get().rot; baritone.getLookBehavior().updateTarget(rot, true); ctx.player().inventory.currentItem = toPlace.get().hotbarSelection; @@ -523,7 +523,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil private void trim() { HashSet copy = new HashSet<>(incorrectPositions); - copy.removeIf(pos -> pos.distanceSq(ctx.player().func_233580_cy_()) > 200); + copy.removeIf(pos -> pos.distanceSq(ctx.player().getPosition()) > 200); if (!copy.isEmpty()) { incorrectPositions = copy; } diff --git a/src/main/java/baritone/process/FarmProcess.java b/src/main/java/baritone/process/FarmProcess.java index 8f93d54b3..b8412de91 100644 --- a/src/main/java/baritone/process/FarmProcess.java +++ b/src/main/java/baritone/process/FarmProcess.java @@ -278,7 +278,7 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro } } for (Entity entity : ctx.entities()) { - if (entity instanceof ItemEntity && entity.func_233570_aj_()) { + if (entity instanceof ItemEntity && entity.isOnGround()) { ItemEntity ei = (ItemEntity) entity; if (PICKUP_DROPPED.contains(ei.getItem().getItem())) { // +0.1 because of farmland's 0.9375 dummy height lol diff --git a/src/main/java/baritone/process/FollowProcess.java b/src/main/java/baritone/process/FollowProcess.java index a93ae0895..85a273e75 100644 --- a/src/main/java/baritone/process/FollowProcess.java +++ b/src/main/java/baritone/process/FollowProcess.java @@ -57,7 +57,7 @@ public final class FollowProcess extends BaritoneProcessHelper implements IFollo private Goal towards(Entity following) { BlockPos pos; if (Baritone.settings().followOffsetDistance.value == 0) { - pos = following.func_233580_cy_(); + pos = following.getPosition(); } else { GoalXZ g = GoalXZ.fromDirection(following.getPositionVec(), Baritone.settings().followOffsetDirection.value, Baritone.settings().followOffsetDistance.value); pos = new BlockPos(g.getX(), following.getPositionVec().y, g.getZ()); diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index 864cf162a..108a0c780 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -114,7 +114,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro .filter(pos -> !(BlockStateInterface.get(ctx, pos).getBlock() instanceof AirBlock)) // after breaking a block, it takes mineGoalUpdateInterval ticks for it to actually update this list =( .min(Comparator.comparingDouble(ctx.playerFeet()::distanceSq)); baritone.getInputOverrideHandler().clearAllKeys(); - if (shaft.isPresent() && ctx.player().func_233570_aj_()) { + if (shaft.isPresent() && ctx.player().isOnGround()) { BlockPos pos = shaft.get(); BlockState state = baritone.bsi.get0(pos); if (!MovementHelper.avoidBreaking(baritone.bsi, pos.getX(), pos.getY(), pos.getZ(), state)) { @@ -308,7 +308,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro if (entity instanceof ItemEntity) { ItemEntity ei = (ItemEntity) entity; if (filter.has(ei.getItem())) { - ret.add(entity.func_233580_cy_()); + ret.add(entity.getPosition()); } } } @@ -399,7 +399,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro .filter(pos -> !blacklist.contains(pos)) - .sorted(Comparator.comparingDouble(ctx.getBaritone().getPlayerContext().player().func_233580_cy_()::distanceSq)) + .sorted(Comparator.comparingDouble(ctx.getBaritone().getPlayerContext().player().getPosition()::distanceSq)) .collect(Collectors.toList()); if (locs.size() > max) { diff --git a/src/main/java/baritone/utils/BaritoneAutoTest.java b/src/main/java/baritone/utils/BaritoneAutoTest.java index 37a7dc8d4..a54e85fa1 100644 --- a/src/main/java/baritone/utils/BaritoneAutoTest.java +++ b/src/main/java/baritone/utils/BaritoneAutoTest.java @@ -99,7 +99,7 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper { System.out.println("Beginning Baritone automatic test routine"); mc.displayGuiScreen(null); WorldSettings worldsettings = new WorldSettings("BaritoneAutoTest", GameType.SURVIVAL, false, Difficulty.NORMAL, true, new GameRules(), DatapackCodec.field_234880_a_); - mc.func_238192_a_("BaritoneAutoTest", worldsettings, IDynamicRegistries.func_239770_b_(), DimensionGeneratorSettings.field_236202_b_.func_236220_a_(false, OptionalLong.of(TEST_SEED))); + mc.func_238192_a_("BaritoneAutoTest", worldsettings, IDynamicRegistries.func_239770_b_(), DimensionGeneratorSettings.field_236202_b_.create(false, OptionalLong.of(TEST_SEED))); } IntegratedServer server = mc.getIntegratedServer(); diff --git a/src/main/java/baritone/utils/GuiClick.java b/src/main/java/baritone/utils/GuiClick.java index b2202c850..c6b2ea3e3 100644 --- a/src/main/java/baritone/utils/GuiClick.java +++ b/src/main/java/baritone/utils/GuiClick.java @@ -88,7 +88,7 @@ public class GuiClick extends Screen implements Helper { BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().removeAllSelections(); BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().addSelection(BetterBlockPos.from(clickStart), BetterBlockPos.from(currentMouseOver)); TextComponent component = new StringTextComponent("Selection made! For usage: " + Baritone.settings().prefix.value + "help sel"); - component.func_230530_a_(component.getStyle() + component.setStyle(component.getStyle() .setFormatting(TextFormatting.WHITE) .setClickEvent(new ClickEvent( ClickEvent.Action.RUN_COMMAND, diff --git a/src/main/java/baritone/utils/PlayerMovementInput.java b/src/main/java/baritone/utils/PlayerMovementInput.java index 247fda702..57745b922 100644 --- a/src/main/java/baritone/utils/PlayerMovementInput.java +++ b/src/main/java/baritone/utils/PlayerMovementInput.java @@ -29,7 +29,7 @@ public class PlayerMovementInput extends MovementInput { } @Override - public void func_225607_a_(boolean p_225607_1_) { + public void tickMovement(boolean p_225607_1_) { this.moveStrafe = 0.0F; this.moveForward = 0.0F; diff --git a/src/main/java/baritone/utils/pathing/Avoidance.java b/src/main/java/baritone/utils/pathing/Avoidance.java index 82a4c1796..b9848845a 100644 --- a/src/main/java/baritone/utils/pathing/Avoidance.java +++ b/src/main/java/baritone/utils/pathing/Avoidance.java @@ -77,7 +77,7 @@ public class Avoidance { .filter(entity -> (!(entity instanceof SpiderEntity)) || ctx.player().getBrightness() < 0.5) .filter(entity -> !(entity instanceof ZombifiedPiglinEntity) || ((ZombifiedPiglinEntity) entity).getRevengeTarget() != null) .filter(entity -> !(entity instanceof EndermanEntity) || ((EndermanEntity) entity).isScreaming()) - .forEach(entity -> res.add(new Avoidance(entity.func_233580_cy_(), mobCoeff, Baritone.settings().mobAvoidanceRadius.value))); + .forEach(entity -> res.add(new Avoidance(entity.getPosition(), mobCoeff, Baritone.settings().mobAvoidanceRadius.value))); } return res; }