compiles and can path
This commit is contained in:
+2
-2
@@ -82,7 +82,7 @@ task sourceJar(type: Jar, dependsOn: classes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
mappings channel: 'snapshot', version: '20190719-1.14.3'
|
mappings channel: 'snapshot', version: '20200205-1.15.1'
|
||||||
reobfMappings 'notch'
|
reobfMappings 'notch'
|
||||||
|
|
||||||
runs {
|
runs {
|
||||||
@@ -138,7 +138,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft 'com.github.ImpactDevelopment:Vanilla:1.15.1'
|
minecraft 'com.github.ImpactDevelopment:Vanilla:1.15.2'
|
||||||
|
|
||||||
runtime launchCompile('net.minecraft:launchwrapper:1.12') {
|
runtime launchCompile('net.minecraft:launchwrapper:1.12') {
|
||||||
exclude module: 'lwjgl'
|
exclude module: 'lwjgl'
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
public class MixinGameRenderer {
|
public class MixinGameRenderer {
|
||||||
|
|
||||||
@Inject(
|
@Inject(
|
||||||
method = "func_228378_a_",
|
method = "renderWorld",
|
||||||
at = @At(
|
at = @At(
|
||||||
value = "INVOKE_STRING",
|
value = "INVOKE_STRING",
|
||||||
target = "Lnet/minecraft/profiler/IProfiler;endStartSection(Ljava/lang/String;)V",
|
target = "Lnet/minecraft/profiler/IProfiler;endStartSection(Ljava/lang/String;)V",
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import baritone.api.pathing.goals.GoalTwoBlocks;
|
|||||||
import baritone.api.utils.BetterBlockPos;
|
import baritone.api.utils.BetterBlockPos;
|
||||||
import baritone.api.utils.Helper;
|
import baritone.api.utils.Helper;
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
@@ -69,9 +68,9 @@ public class GuiClick extends Screen implements Helper {
|
|||||||
double mx = mc.mouseHelper.getMouseX();
|
double mx = mc.mouseHelper.getMouseX();
|
||||||
double my = mc.mouseHelper.getMouseY();
|
double my = mc.mouseHelper.getMouseY();
|
||||||
|
|
||||||
my = mc.func_228018_at_().getHeight() - my;
|
my = mc.getMainWindow().getHeight() - my;
|
||||||
my *= mc.func_228018_at_().getFramebufferHeight() / (double) mc.func_228018_at_().getHeight();
|
my *= mc.getMainWindow().getFramebufferHeight() / (double) mc.getMainWindow().getHeight();
|
||||||
mx *= mc.func_228018_at_().getFramebufferWidth() / (double) mc.func_228018_at_().getWidth();
|
mx *= mc.getMainWindow().getFramebufferWidth() / (double) mc.getMainWindow().getWidth();
|
||||||
Vec3d near = toWorld(mx, my, 0);
|
Vec3d near = toWorld(mx, my, 0);
|
||||||
Vec3d far = toWorld(mx, my, 1); // "Use 0.945 that's what stack overflow says" - leijurv
|
Vec3d far = toWorld(mx, my, 1); // "Use 0.945 that's what stack overflow says" - leijurv
|
||||||
if (near != null && far != null) {
|
if (near != null && far != null) {
|
||||||
|
|||||||
@@ -77,35 +77,35 @@ public interface IRenderer {
|
|||||||
static void drawAABB(MatrixStack stack, AxisAlignedBB aabb) {
|
static void drawAABB(MatrixStack stack, AxisAlignedBB aabb) {
|
||||||
AxisAlignedBB toDraw = aabb.offset(-renderManager.renderPosX(), -renderManager.renderPosY(), -renderManager.renderPosZ());
|
AxisAlignedBB toDraw = aabb.offset(-renderManager.renderPosX(), -renderManager.renderPosY(), -renderManager.renderPosZ());
|
||||||
|
|
||||||
Matrix4f matrix4f = stack.func_227866_c_().func_227870_a_();
|
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
|
||||||
buffer.begin(GL_LINES, DefaultVertexFormats.POSITION);
|
buffer.begin(GL_LINES, DefaultVertexFormats.POSITION);
|
||||||
// bottom
|
// bottom
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||||
// top
|
// top
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||||
// corners
|
// corners
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public final class PathRenderer implements IRenderer, Helper {
|
|||||||
|
|
||||||
|
|
||||||
public static void drawLine(MatrixStack stack, double x1, double y1, double z1, double x2, double y2, double z2) {
|
public static void drawLine(MatrixStack stack, double x1, double y1, double z1, double x2, double y2, double z2) {
|
||||||
Matrix4f matrix4f = stack.func_227866_c_().func_227870_a_();
|
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
|
||||||
|
|
||||||
double vpX = posX();
|
double vpX = posX();
|
||||||
double vpY = posY();
|
double vpY = posY();
|
||||||
@@ -189,13 +189,13 @@ public final class PathRenderer implements IRenderer, Helper {
|
|||||||
boolean renderPathAsFrickinThingy = !settings.renderPathAsLine.value;
|
boolean renderPathAsFrickinThingy = !settings.renderPathAsLine.value;
|
||||||
|
|
||||||
buffer.begin(renderPathAsFrickinThingy ? GL_LINE_STRIP : GL_LINES, DefaultVertexFormats.POSITION);
|
buffer.begin(renderPathAsFrickinThingy ? GL_LINE_STRIP : GL_LINES, DefaultVertexFormats.POSITION);
|
||||||
buffer.func_227888_a_(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
buffer.pos(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.5D - vpY), (float) (z2 + 0.5D - vpZ)).endVertex();
|
buffer.pos(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.5D - vpY), (float) (z2 + 0.5D - vpZ)).endVertex();
|
||||||
|
|
||||||
if (renderPathAsFrickinThingy) {
|
if (renderPathAsFrickinThingy) {
|
||||||
buffer.func_227888_a_(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.53D - vpY), (float) (z2 + 0.5D - vpZ)).endVertex();
|
buffer.pos(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.53D - vpY), (float) (z2 + 0.5D - vpZ)).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.53D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
buffer.pos(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.53D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
buffer.pos(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,12 +254,12 @@ public final class PathRenderer implements IRenderer, Helper {
|
|||||||
RenderSystem.disableDepthTest();
|
RenderSystem.disableDepthTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.func_227860_a_(); // push
|
stack.push(); // push
|
||||||
stack.func_227861_a_(goalPos.getX() - renderPosX, -renderPosY, goalPos.getZ() - renderPosZ); // translate
|
stack.translate(goalPos.getX() - renderPosX, -renderPosY, goalPos.getZ() - renderPosZ); // translate
|
||||||
|
|
||||||
BeaconTileEntityRenderer.func_228842_a_(
|
BeaconTileEntityRenderer.renderBeamSegment(
|
||||||
stack,
|
stack,
|
||||||
mc.func_228019_au_().func_228489_c_(),
|
mc.getRenderTypeBuffers().getBufferSource(),
|
||||||
TEXTURE_BEACON_BEAM,
|
TEXTURE_BEACON_BEAM,
|
||||||
partialTicks,
|
partialTicks,
|
||||||
1.0F,
|
1.0F,
|
||||||
@@ -273,7 +273,7 @@ public final class PathRenderer implements IRenderer, Helper {
|
|||||||
0.25F
|
0.25F
|
||||||
);
|
);
|
||||||
|
|
||||||
stack.func_227865_b_(); // pop
|
stack.pop(); // pop
|
||||||
|
|
||||||
if (settings.renderGoalIgnoreDepth.value) {
|
if (settings.renderGoalIgnoreDepth.value) {
|
||||||
RenderSystem.enableDepthTest();
|
RenderSystem.enableDepthTest();
|
||||||
@@ -319,16 +319,16 @@ public final class PathRenderer implements IRenderer, Helper {
|
|||||||
renderHorizontalQuad(stack, minX, maxX, minZ, maxZ, y1);
|
renderHorizontalQuad(stack, minX, maxX, minZ, maxZ, y1);
|
||||||
renderHorizontalQuad(stack, minX, maxX, minZ, maxZ, y2);
|
renderHorizontalQuad(stack, minX, maxX, minZ, maxZ, y2);
|
||||||
|
|
||||||
Matrix4f matrix4f = stack.func_227866_c_().func_227870_a_();
|
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
|
||||||
buffer.begin(GL_LINES, DefaultVertexFormats.POSITION);
|
buffer.begin(GL_LINES, DefaultVertexFormats.POSITION);
|
||||||
buffer.func_227888_a_(matrix4f, (float) minX, (float) minY, (float) minZ).endVertex();
|
buffer.pos(matrix4f, (float) minX, (float) minY, (float) minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) minX, (float) maxY, (float) minZ).endVertex();
|
buffer.pos(matrix4f, (float) minX, (float) maxY, (float) minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) maxX, (float) minY, (float) minZ).endVertex();
|
buffer.pos(matrix4f, (float) maxX, (float) minY, (float) minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) maxX, (float) maxY, (float) minZ).endVertex();
|
buffer.pos(matrix4f, (float) maxX, (float) maxY, (float) minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) maxX, (float) minY, (float) maxZ).endVertex();
|
buffer.pos(matrix4f, (float) maxX, (float) minY, (float) maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) maxX, (float) maxY, (float) maxZ).endVertex();
|
buffer.pos(matrix4f, (float) maxX, (float) maxY, (float) maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) minX, (float) minY, (float) maxZ).endVertex();
|
buffer.pos(matrix4f, (float) minX, (float) minY, (float) maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) minX, (float) maxY, (float) maxZ).endVertex();
|
buffer.pos(matrix4f, (float) minX, (float) maxY, (float) maxZ).endVertex();
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
IRenderer.endLines(settings.renderGoalIgnoreDepth.value);
|
IRenderer.endLines(settings.renderGoalIgnoreDepth.value);
|
||||||
@@ -336,12 +336,12 @@ public final class PathRenderer implements IRenderer, Helper {
|
|||||||
|
|
||||||
private static void renderHorizontalQuad(MatrixStack stack, double minX, double maxX, double minZ, double maxZ, double y) {
|
private static void renderHorizontalQuad(MatrixStack stack, double minX, double maxX, double minZ, double maxZ, double y) {
|
||||||
if (y != 0) {
|
if (y != 0) {
|
||||||
Matrix4f matrix4f = stack.func_227866_c_().func_227870_a_();
|
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
|
||||||
buffer.begin(GL_LINE_LOOP, DefaultVertexFormats.POSITION);
|
buffer.begin(GL_LINE_LOOP, DefaultVertexFormats.POSITION);
|
||||||
buffer.func_227888_a_(matrix4f, (float) minX, (float) y, (float) minZ).endVertex();
|
buffer.pos(matrix4f, (float) minX, (float) y, (float) minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) maxX, (float) y, (float) minZ).endVertex();
|
buffer.pos(matrix4f, (float) maxX, (float) y, (float) minZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) maxX, (float) y, (float) maxZ).endVertex();
|
buffer.pos(matrix4f, (float) maxX, (float) y, (float) maxZ).endVertex();
|
||||||
buffer.func_227888_a_(matrix4f, (float) minX, (float) y, (float) maxZ).endVertex();
|
buffer.pos(matrix4f, (float) minX, (float) y, (float) maxZ).endVertex();
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user