Compare commits

...

6 Commits

Author SHA1 Message Date
Leijurv
606e9bf97c v1.5.1 2020-02-14 15:28:37 -08:00
Leijurv
47ae75a9d6 Merge branch '1.14.4' into 1.15.2 2020-02-14 15:26:34 -08:00
Leijurv
25587e317a fix link click crash 2020-02-14 15:26:03 -08:00
Leijurv
b3ba129fc5 honey is stupid lets just not 2020-02-13 18:59:08 -08:00
Leijurv
746b7b5c88 not unscuffed, just differently scuffed 2020-02-13 18:57:32 -08:00
Brady
db2f6ec78d Update mappings to 20200213-1.15.1 2020-02-13 14:44:29 -06:00
11 changed files with 40 additions and 40 deletions

View File

@@ -16,7 +16,7 @@
*/
group 'baritone'
version '1.5.0'
version '1.5.1'
buildscript {
repositories {
@@ -82,7 +82,7 @@ task sourceJar(type: Jar, dependsOn: classes) {
}
minecraft {
mappings channel: 'snapshot', version: '20200205-1.15.1'
mappings channel: 'snapshot', version: '20200213-1.15.1'
reobfMappings 'notch'
runs {

View File

@@ -18,6 +18,7 @@
package baritone.api.event.events;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.Matrix4f;
/**
* @author Brady
@@ -30,12 +31,13 @@ public final class RenderEvent {
*/
private final float partialTicks;
private final MatrixStack modelViewStack, projectionStack;
private final Matrix4f projectionMatrix;
private final MatrixStack modelViewStack;
public RenderEvent(float partialTicks, MatrixStack modelViewStack, MatrixStack projectionStack) {
public RenderEvent(float partialTicks, MatrixStack modelViewStack, Matrix4f projectionMatrix) {
this.partialTicks = partialTicks;
this.modelViewStack = modelViewStack;
this.projectionStack = projectionStack;
this.projectionMatrix = projectionMatrix;
}
/**
@@ -45,11 +47,11 @@ public final class RenderEvent {
return this.partialTicks;
}
public final MatrixStack getModelViewStack() {
public MatrixStack getModelViewStack() {
return this.modelViewStack;
}
public final MatrixStack getProjectionStack() {
return this.projectionStack;
public Matrix4f getProjectionMatrix() {
return this.projectionMatrix;
}
}

View File

@@ -29,5 +29,5 @@ public abstract class MixinScreen implements IGuiScreen {
@Override
@Invoker("openLink")
public abstract void openLink(URI url);
public abstract void openLinkInvoker(URI url);
}

View File

@@ -21,30 +21,28 @@ import baritone.api.BaritoneAPI;
import baritone.api.IBaritone;
import baritone.api.event.events.RenderEvent;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.*;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(GameRenderer.class)
public class MixinGameRenderer {
/**
* @author Brady
* @since 2/13/2020
*/
@Mixin(WorldRenderer.class)
public class MixinWorldRenderer {
@Inject(
method = "renderWorld",
at = @At(
value = "INVOKE_STRING",
target = "Lnet/minecraft/profiler/IProfiler;endStartSection(Ljava/lang/String;)V",
args = {"ldc=hand"}
),
locals = LocalCapture.CAPTURE_FAILHARD
method = "updateCameraAndRender",
at = @At("RETURN"),
locals = LocalCapture.CAPTURE_FAILSOFT
)
private void renderWorldPass(float partialTicks, long finishTimeNano, MatrixStack modelViewMatrix, CallbackInfo ci, boolean flag, ActiveRenderInfo activerenderinfo, MatrixStack projectionMatrix, float f, Matrix4f matrix4f) {
private void onStartHand(MatrixStack matrixStackIn, float partialTicks, long finishTimeNano, boolean drawBlockOutline, ActiveRenderInfo activeRenderInfoIn, GameRenderer gameRendererIn, LightTexture lightmapIn, Matrix4f projectionIn, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
ibaritone.getGameEventHandler().onRenderPass(new RenderEvent(partialTicks, modelViewMatrix, projectionMatrix));
ibaritone.getGameEventHandler().onRenderPass(new RenderEvent(partialTicks, matrixStackIn, projectionIn));
}
}
}
}

View File

@@ -9,14 +9,13 @@
},
"client": [
"MixinBitArray",
"MixinCommandSuggestionHelper",
"MixinChunkArray",
"MixinClientChunkProvider",
"MixinClientPlayerEntity",
"MixinClientPlayNetHandler",
"MixinCommandSuggestionHelper",
"MixinEntity",
"MixinEntityRenderManager",
"MixinGameRenderer",
"MixinItemStack",
"MixinLivingEntity",
"MixinLootContext",
@@ -24,6 +23,7 @@
"MixinNetworkManager",
"MixinPalettedContainer",
"MixinPlayerController",
"MixinScreen"
"MixinScreen",
"MixinWorldRenderer"
]
}

View File

@@ -100,7 +100,7 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener {
return false;
} else if (msg.trim().equalsIgnoreCase("orderpizza")) {
try {
((IGuiScreen) mc.currentScreen).openLink(new URI("https://www.dominos.com/en/pages/order/"));
((IGuiScreen) mc.currentScreen).openLinkInvoker(new URI("https://www.dominos.com/en/pages/order/"));
} catch (NullPointerException | URISyntaxException ignored) {}
return false;
}

View File

@@ -295,7 +295,7 @@ public interface MovementHelper extends ActionCosts, Helper {
*/
static boolean canWalkOn(BlockStateInterface bsi, int x, int y, int z, BlockState state) {
Block block = state.getBlock();
if (block instanceof AirBlock || block == Blocks.MAGMA_BLOCK || block == Blocks.BUBBLE_COLUMN) {
if (block instanceof AirBlock || block == Blocks.MAGMA_BLOCK || block == Blocks.BUBBLE_COLUMN || block == Blocks.HONEY_BLOCK) {
// early return for most common case (air)
// plus magma, which is a normal cube but it hurts you
return false;

View File

@@ -110,9 +110,9 @@ public class GuiClick extends Screen implements Helper {
return super.mouseClicked(mouseX, mouseY, mouseButton);
}
public void onRender(MatrixStack modelViewStack, MatrixStack projectionStack) {
this.projectionViewMatrix = projectionStack.getLast().getPositionMatrix().copy();
this.projectionViewMatrix.multiply(modelViewStack.getLast().getPositionMatrix());
public void onRender(MatrixStack modelViewStack, Matrix4f projectionMatrix) {
this.projectionViewMatrix = projectionMatrix.copy();
this.projectionViewMatrix.mul(modelViewStack.getLast().getMatrix());
this.projectionViewMatrix.invert();
if (currentMouseOver != null) {
@@ -144,8 +144,8 @@ public class GuiClick extends Screen implements Helper {
return null;
}
x /= mc.getMainWindow().getWidth();
y /= mc.getMainWindow().getHeight();
x /= mc.getMainWindow().getFramebufferWidth();
y /= mc.getMainWindow().getFramebufferHeight();
x = x * 2 - 1;
y = y * 2 - 1;

View File

@@ -77,7 +77,7 @@ public interface IRenderer {
static void drawAABB(MatrixStack stack, AxisAlignedBB aabb) {
AxisAlignedBB toDraw = aabb.offset(-renderManager.renderPosX(), -renderManager.renderPosY(), -renderManager.renderPosZ());
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
Matrix4f matrix4f = stack.getLast().getMatrix();
buffer.begin(GL_LINES, DefaultVertexFormats.POSITION);
// bottom
buffer.pos(matrix4f, (float) toDraw.minX, (float) toDraw.minY, (float) toDraw.minZ).endVertex();

View File

@@ -74,7 +74,7 @@ public final class PathRenderer implements IRenderer, Helper {
float partialTicks = event.getPartialTicks();
Goal goal = behavior.getGoal();
if (Helper.mc.currentScreen instanceof GuiClick) {
((GuiClick) Helper.mc.currentScreen).onRender(event.getModelViewStack(), event.getProjectionStack());
((GuiClick) Helper.mc.currentScreen).onRender(event.getModelViewStack(), event.getProjectionMatrix());
}
int thisPlayerDimension = behavior.baritone.getPlayerContext().world().getDimension().getType().getId();
@@ -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) {
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
Matrix4f matrix4f = stack.getLast().getMatrix();
double vpX = posX();
double vpY = posY();
@@ -319,7 +319,7 @@ public final class PathRenderer implements IRenderer, Helper {
renderHorizontalQuad(stack, minX, maxX, minZ, maxZ, y1);
renderHorizontalQuad(stack, minX, maxX, minZ, maxZ, y2);
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
Matrix4f matrix4f = stack.getLast().getMatrix();
buffer.begin(GL_LINES, DefaultVertexFormats.POSITION);
buffer.pos(matrix4f, (float) minX, (float) minY, (float) minZ).endVertex();
buffer.pos(matrix4f, (float) minX, (float) maxY, (float) minZ).endVertex();
@@ -336,7 +336,7 @@ public final class PathRenderer implements IRenderer, Helper {
private static void renderHorizontalQuad(MatrixStack stack, double minX, double maxX, double minZ, double maxZ, double y) {
if (y != 0) {
Matrix4f matrix4f = stack.getLast().getPositionMatrix();
Matrix4f matrix4f = stack.getLast().getMatrix();
buffer.begin(GL_LINE_LOOP, DefaultVertexFormats.POSITION);
buffer.pos(matrix4f, (float) minX, (float) y, (float) minZ).endVertex();
buffer.pos(matrix4f, (float) maxX, (float) y, (float) minZ).endVertex();

View File

@@ -21,5 +21,5 @@ import java.net.URI;
public interface IGuiScreen {
void openLink(URI url);
void openLinkInvoker(URI url);
}