fix movement, mixins and color, proguard
This commit is contained in:
@@ -44,7 +44,7 @@ public class BaritoneToast implements Toast {
|
||||
}
|
||||
|
||||
|
||||
//TODO: fix
|
||||
//TODO: check
|
||||
toastGui.getMinecraft().getTextureManager().bindForSetup(new ResourceLocation("textures/gui/toasts.png"));
|
||||
//GlStateManager._color4f(1.0F, 1.0F, 1.0F, 255.0F);
|
||||
toastGui.blit(matrixStack, 0, 0, 0, 32, 160, 32);
|
||||
|
||||
@@ -175,7 +175,7 @@ public class MixinClientPlayNetHandler {
|
||||
method = "handlePlayerCombatKill",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/client/Minecraft.setScreen(Lnet/minecraft/client/gui/screen/Screen;)V"
|
||||
target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V"
|
||||
)
|
||||
)
|
||||
private void onPlayerDeath(ClientboundPlayerCombatKillPacket packetIn, CallbackInfo ci) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class MixinLootContext {
|
||||
method = "create",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/server/MinecraftServer.getLootTableManager()Lnet/minecraft/loot/LootTableManager;"
|
||||
target = "Lnet/minecraft/server/MinecraftServer;getLootTables()Lnet/minecraft/world/level/storage/loot/LootTables;"
|
||||
)
|
||||
)
|
||||
private LootTables getLootTableManager(MinecraftServer server) {
|
||||
@@ -62,7 +62,7 @@ public class MixinLootContext {
|
||||
method = "create",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/server/MinecraftServer.func_229736_aP_()Lnet/minecraft/loot/LootPredicateManager;"
|
||||
target = "Lnet/minecraft/server/MinecraftServer;getPredicateManager()Lnet/minecraft/world/level/storage/loot/PredicateManager;"
|
||||
)
|
||||
)
|
||||
private PredicateManager getLootPredicateManager(MinecraftServer server) {
|
||||
|
||||
@@ -59,14 +59,7 @@ public class MixinMinecraft {
|
||||
|
||||
@Inject(
|
||||
method = "runTick",
|
||||
at = @At(
|
||||
value = "FIELD",
|
||||
opcode = Opcodes.GETFIELD,
|
||||
target = "net/minecraft/client/Minecraft.currentScreen:Lnet/minecraft/client/gui/screen/Screen;",
|
||||
ordinal = 5,
|
||||
shift = At.Shift.BY,
|
||||
by = -3
|
||||
)
|
||||
at = @At("HEAD")
|
||||
)
|
||||
private void runTick(CallbackInfo ci) {
|
||||
final BiFunction<EventState, TickEvent.Type, TickEvent> tickProvider = TickEvent.createNextProvider();
|
||||
@@ -119,11 +112,11 @@ public class MixinMinecraft {
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = "runTick",
|
||||
method = "tick",
|
||||
at = @At(
|
||||
value = "FIELD",
|
||||
opcode = Opcodes.GETFIELD,
|
||||
target = "net/minecraft/client/gui/screens/Screen.passEvents:Z"
|
||||
target = "Lnet/minecraft/client/gui/screens/Screen;passEvents:Z"
|
||||
)
|
||||
)
|
||||
private boolean passEvents(Screen screen) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
],
|
||||
|
||||
"depends": {
|
||||
"fabricloader": ">=0.11.6",
|
||||
"fabricloader": ">=0.11.0",
|
||||
"minecraft": "1.17.x"
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public abstract class Movement implements IMovement, MovementHelper {
|
||||
}
|
||||
boolean somethingInTheWay = false;
|
||||
for (BetterBlockPos blockPos : positionsToBreak) {
|
||||
if (!ctx.world().getEntities(null, new AABB(0, 0, 0, 1, 1.1, 1).move(blockPos)).isEmpty() && Baritone.settings().pauseMiningForFallingBlocks.value) {
|
||||
if (!ctx.world().getEntities(ctx.player(), new AABB(0, 0, 0, 1, 1.1, 1).move(blockPos)).isEmpty() && Baritone.settings().pauseMiningForFallingBlocks.value) {
|
||||
return false;
|
||||
}
|
||||
if (!MovementHelper.canWalkThrough(ctx, blockPos)) { // can't break air, so don't try
|
||||
|
||||
@@ -128,8 +128,8 @@ public class GuiClick extends Screen implements Helper {
|
||||
if (clickStart != null && !clickStart.equals(currentMouseOver)) {
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
|
||||
//TODO: fix
|
||||
//RenderSystem.color4f(Color.RED.getColorComponents(null)[0], Color.RED.getColorComponents(null)[1], Color.RED.getColorComponents(null)[2], 0.4F);
|
||||
//TODO: check
|
||||
IRenderer.glColor(Color.RED, 0.4F);
|
||||
RenderSystem.lineWidth(Baritone.settings().pathRenderLineWidthPixels.value);
|
||||
RenderSystem.disableTexture();
|
||||
RenderSystem.depthMask(false);
|
||||
|
||||
@@ -36,10 +36,14 @@ public interface IRenderer {
|
||||
IEntityRenderManager renderManager = (IEntityRenderManager) Helper.mc.getEntityRenderDispatcher();
|
||||
Settings settings = BaritoneAPI.getSettings();
|
||||
|
||||
float[] color = new float[] {1.0F, 1.0F, 1.0F, 255.0F};
|
||||
|
||||
static void glColor(Color color, float alpha) {
|
||||
float[] colorComponents = color.getColorComponents(null);
|
||||
//TODO: fix
|
||||
//RenderSystem.color4f(colorComponents[0], colorComponents[1], colorComponents[2], alpha);
|
||||
IRenderer.color[0] = colorComponents[0];
|
||||
IRenderer.color[1] = colorComponents[1];
|
||||
IRenderer.color[2] = colorComponents[2];
|
||||
IRenderer.color[3] = alpha;
|
||||
}
|
||||
|
||||
static void startLines(Color color, float alpha, float lineWidth, boolean ignoreDepth) {
|
||||
@@ -74,34 +78,34 @@ public interface IRenderer {
|
||||
|
||||
Matrix4f matrix4f = stack.last().pose();
|
||||
//TODO: check
|
||||
buffer.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION);
|
||||
buffer.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
|
||||
// bottom
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
// top
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
// corners
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.minY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.maxX, (float) toDraw.maxY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) toDraw.minX, (float) toDraw.maxY, (float) toDraw.maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
tessellator.end();
|
||||
}
|
||||
|
||||
|
||||
@@ -190,14 +190,14 @@ public final class PathRenderer implements IRenderer, Helper {
|
||||
boolean renderPathAsFrickinThingy = !settings.renderPathAsLine.value;
|
||||
|
||||
//TODO: check
|
||||
buffer.begin(renderPathAsFrickinThingy ? VertexFormat.Mode.DEBUG_LINE_STRIP : VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION);
|
||||
buffer.vertex(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
||||
buffer.vertex(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.5D - vpY), (float) (z2 + 0.5D - vpZ)).endVertex();
|
||||
buffer.begin(renderPathAsFrickinThingy ? VertexFormat.Mode.DEBUG_LINE_STRIP : VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
|
||||
buffer.vertex(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.5D - vpY), (float) (z2 + 0.5D - vpZ)).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
|
||||
if (renderPathAsFrickinThingy) {
|
||||
buffer.vertex(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.53D - vpY), (float) (z2 + 0.5D - vpZ)).endVertex();
|
||||
buffer.vertex(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.53D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
||||
buffer.vertex(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).endVertex();
|
||||
buffer.vertex(matrix4f, (float) (x2 + 0.5D - vpX), (float) (y2 + 0.53D - vpY), (float) (z2 + 0.5D - vpZ)).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.53D - vpY), (float) (z1 + 0.5D - vpZ)).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) (x1 + 0.5D - vpX), (float) (y1 + 0.5D - vpY), (float) (z1 + 0.5D - vpZ)).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ public final class PathRenderer implements IRenderer, Helper {
|
||||
if (settings.renderGoalXZBeacon.value) {
|
||||
glPushAttrib(GL_LIGHTING_BIT);
|
||||
|
||||
//TODO: fix
|
||||
//TODO: check
|
||||
Helper.mc.getTextureManager().bindForSetup(TEXTURE_BEACON_BEAM);
|
||||
if (settings.renderGoalIgnoreDepth.value) {
|
||||
RenderSystem.disableDepthTest();
|
||||
@@ -324,15 +324,15 @@ public final class PathRenderer implements IRenderer, Helper {
|
||||
renderHorizontalQuad(stack, minX, maxX, minZ, maxZ, y2);
|
||||
|
||||
Matrix4f matrix4f = stack.last().pose();
|
||||
buffer.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION);
|
||||
buffer.vertex(matrix4f, (float) minX, (float) minY, (float) minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) maxY, (float) minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) minY, (float) minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) maxY, (float) minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) minY, (float) maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) maxY, (float) maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) minY, (float) maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) maxY, (float) maxZ).endVertex();
|
||||
buffer.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
|
||||
buffer.vertex(matrix4f, (float) minX, (float) minY, (float) minZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) maxY, (float) minZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) minY, (float) minZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) maxY, (float) minZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) minY, (float) maxZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) maxY, (float) maxZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) minY, (float) maxZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) maxY, (float) maxZ).color(IRenderer.color[0], IRenderer.color[1], IRenderer.color[2], IRenderer.color[3]).endVertex();
|
||||
tessellator.end();
|
||||
|
||||
IRenderer.endLines(settings.renderGoalIgnoreDepth.value);
|
||||
@@ -342,12 +342,12 @@ public final class PathRenderer implements IRenderer, Helper {
|
||||
if (y != 0) {
|
||||
Matrix4f matrix4f = stack.last().pose();
|
||||
//TODO: check
|
||||
buffer.begin(VertexFormat.Mode.DEBUG_LINE_STRIP, DefaultVertexFormat.POSITION);
|
||||
buffer.vertex(matrix4f, (float) minX, (float) y, (float) minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) y, (float) minZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) y, (float) maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) y, (float) maxZ).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) y, (float) minZ).endVertex();
|
||||
buffer.begin(VertexFormat.Mode.DEBUG_LINE_STRIP, DefaultVertexFormat.POSITION_COLOR);
|
||||
buffer.vertex(matrix4f, (float) minX, (float) y, (float) minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) y, (float) minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) maxX, (float) y, (float) maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) y, (float) maxZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
buffer.vertex(matrix4f, (float) minX, (float) y, (float) minZ).color(color[0], color[1], color[2], color[3]).endVertex();
|
||||
tessellator.end();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user