Working 1.13.2 development environment

Including a couple bugfixes to bad 1.13.2 code!!!
This commit is contained in:
Brady
2019-03-12 01:05:39 -05:00
parent e2cc51908b
commit 5a16561954
6 changed files with 121 additions and 28 deletions

View File

@@ -93,7 +93,7 @@ public class WorldProvider implements IWorldProvider, Helper {
} catch (IOException ignored) {}
// We will actually store the world data in a subfolder: "DIM<id>"
Path dir = new File(directory, "DIM" + dimension).toPath();
Path dir = new File(directory, "DIM" + dimension.getId()).toPath();
if (!Files.exists(dir)) {
try {
Files.createDirectories(dir);

View File

@@ -502,7 +502,7 @@ public interface MovementHelper extends ActionCosts, Helper {
static boolean possiblyFlowing(IBlockState state) {
IFluidState fluidState = state.getFluidState();
return fluidState.getFluid() instanceof FlowingFluid
&& state.get(FlowingFluid.LEVEL_1_8) != 0;
&& fluidState.getFluid().getLevel(fluidState) != 8;
}
static boolean isFlowing(int x, int y, int z, IBlockState state, BlockStateInterface bsi) {
@@ -510,7 +510,7 @@ public interface MovementHelper extends ActionCosts, Helper {
if (!(fluidState.getFluid() instanceof FlowingFluid)) {
return false;
}
if (fluidState.get(FlowingFluid.LEVEL_1_8) != 0) {
if (fluidState.getFluid().getLevel(fluidState) != 8) {
return true;
}
return possiblyFlowing(bsi.get0(x + 1, y, z))

View File

@@ -23,6 +23,7 @@ import baritone.api.event.events.RenderEvent;
import baritone.api.pathing.calc.IPath;
import baritone.api.pathing.goals.*;
import baritone.api.utils.BetterBlockPos;
import baritone.api.utils.IPlayerContext;
import baritone.api.utils.interfaces.IGoalRenderPos;
import baritone.behavior.PathingBehavior;
import baritone.pathing.path.PathExecutor;
@@ -38,6 +39,8 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import java.awt.*;
import java.util.Collection;
@@ -218,12 +221,10 @@ public final class PathRenderer implements Helper {
BlockStateInterface bsi = new BlockStateInterface(BaritoneAPI.getProvider().getPrimaryBaritone().getPlayerContext()); // TODO this assumes same dimension between primary baritone and render view? is this safe?
positions.forEach(pos -> {
IBlockState state = bsi.get0(pos);
AxisAlignedBB toDraw;
if (state.getBlock().equals(Blocks.AIR)) {
toDraw = Blocks.DIRT.getDefaultState().getShape(player.world, pos).getBoundingBox();
} else {
toDraw = state.getShape(player.world, pos).getBoundingBox();
}
VoxelShape shape = state.getShape(player.world, pos);
AxisAlignedBB toDraw = shape.isEmpty() ? VoxelShapes.fullCube().getBoundingBox() : shape.getBoundingBox();
toDraw = toDraw.expand(expand, expand, expand).offset(-mc.getRenderManager().viewerPosX, -mc.getRenderManager().viewerPosY, -mc.getRenderManager().viewerPosZ);
BUFFER.begin(GL_LINE_STRIP, DefaultVertexFormats.POSITION);
BUFFER.pos(toDraw.minX, toDraw.minY, toDraw.minZ).endVertex();