use of net.minecraft.client.util.math.MatrixStack in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawBoxOutline.
public static void drawBoxOutline(Box box, QuadColor color, float lineWidth, Direction... excludeDirs) {
if (!getFrustum().isVisible(box)) {
return;
}
setup3DRender(true);
MatrixStack matrices = matrixFrom(box.minX, box.minY, box.minZ);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
// Outline
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(lineWidth);
buffer.begin(VertexFormat.DrawMode.LINES, VertexFormats.LINES);
Vertexer.vertexBoxLines(matrices, buffer, Boxes.moveToZero(box), color, excludeDirs);
tessellator.draw();
RenderSystem.enableCull();
end3DRender();
}
use of net.minecraft.client.util.math.MatrixStack in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawFaceFill.
public static void drawFaceFill(BlockPos blockPos, QuadColor color, Direction face) {
Box box = new Box(blockPos);
if (!getFrustum().isVisible(box)) {
return;
}
setup3DRender(true);
MatrixStack matrices = matrixFrom(box.minX, box.minY, box.minZ);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
// Fill
RenderSystem.setShader(GameRenderer::getPositionColorShader);
buffer.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
Vertexer.vertexBoxQuadsFace(matrices, buffer, Boxes.moveToZero(box), color, face);
tessellator.draw();
end3DRender();
}
use of net.minecraft.client.util.math.MatrixStack in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawFaceOutline.
public static void drawFaceOutline(BlockPos blockPos, QuadColor color, int width, Direction face) {
Box box = new Box(blockPos);
if (!getFrustum().isVisible(box)) {
return;
}
setup3DRender(true);
MatrixStack matrices = matrixFrom(box.minX, box.minY, box.minZ);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
// Outline
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(width);
buffer.begin(VertexFormat.DrawMode.LINES, VertexFormats.LINES);
Vertexer.vertexBoxLinesFace(matrices, buffer, Boxes.moveToZero(box), color, face);
tessellator.draw();
RenderSystem.enableCull();
end3DRender();
}
use of net.minecraft.client.util.math.MatrixStack in project Hypnotic-Client by Hypnotic-Development.
the class ItemRendererMixin method preRenderItem.
@Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformation$Mode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/client/render/model/BakedModel;)V", at = @At("HEAD"), cancellable = true)
public void preRenderItem(ItemStack stack, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, BakedModel model, CallbackInfo ci) {
EventRenderItem event = new EventRenderItem(matrices, stack, renderMode, EventRenderItem.RenderTime.PRE, leftHanded);
event.call();
if (ModuleManager.INSTANCE.getModule(OldBlock.class).isEnabled()) {
if ((ModuleManager.INSTANCE.getModule(Killaura.class).autoBlockMode.is("Visual") && Killaura.target != null ? Killaura.target == null : !mc.player.isUsingItem()) || renderMode != ModelTransformation.Mode.FIRST_PERSON_RIGHT_HAND)
return;
MatrixStack matrixStack = event.getMatrixStack();
boolean offHand = event.isLeftHanded() ? event.getType() == ModelTransformation.Mode.FIRST_PERSON_RIGHT_HAND : event.getType() == ModelTransformation.Mode.FIRST_PERSON_LEFT_HAND;
if (!offHand) {
if ((event.getItemStack().getItem() instanceof AxeItem || event.getItemStack().getItem() instanceof SwordItem) && event.getItemStack() == mc.player.getMainHandStack()) {
matrixStack.multiply(new Quaternion(-270f, 0f, 270f, true));
matrixStack.multiply(new Quaternion(-120f, 270f, -150f, true));
matrixStack.multiply(new Quaternion(-70f, -108f, 90f, true));
// Only plays with killaura
if (Killaura.target != null && !Killaura.target.isDead()) {
switch(ModuleManager.INSTANCE.getModule(OldBlock.class).animation.getSelected()) {
case "1.7(ish)":
matrixStack.multiply(new Quaternion(-ModuleManager.INSTANCE.getModule(OldBlock.class).swingTicks, 0, 0, true));
break;
case "Slide":
matrixStack.multiply(new Quaternion(-ModuleManager.INSTANCE.getModule(OldBlock.class).swingTicks, ModuleManager.INSTANCE.getModule(OldBlock.class).swingTicks, ModuleManager.INSTANCE.getModule(OldBlock.class).swingTicks / 2, true));
break;
case "Sigma":
matrixStack.multiply(new Quaternion(-ModuleManager.INSTANCE.getModule(OldBlock.class).swingTicks * 0.15f, 0, 0, true));
matrixStack.multiply(new Quaternion(0, 0, ModuleManager.INSTANCE.getModule(OldBlock.class).swingTicks * 0.5f, true));
break;
case "Swing":
mc.player.swingHand(Hand.MAIN_HAND);
break;
}
}
ArmCustomize arm = ModuleManager.INSTANCE.getModule(ArmCustomize.class);
if (arm.isEnabled())
matrixStack.translate(arm.mainX.getValue(), arm.mainY.getValue(), arm.mainZ.getValue());
}
}
}
if (event.isCancelled())
ci.cancel();
}
use of net.minecraft.client.util.math.MatrixStack in project Hypnotic-Client by Hypnotic-Development.
the class AltManagerScreen method render.
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.renderBackground(matrices);
fill(matrices, 100, 70, width - 100, height - 70, new Color(0, 0, 0, 100).getRGB());
drawStringWithShadow(matrices, textRenderer, MinecraftClient.getInstance().getSession().getProfile().getName(), 20, 20, -1);
RenderUtils.drawCenteredStringWithShadow(matrices, textRenderer, status, width / 2, 20, -1);
((ButtonWidget) this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, height - 50, 200, 20, new LiteralText("Add alt"), (button) -> {
MinecraftClient.getInstance().setScreen(new AddAltScreen(this));
}))).active = true;
int offset = 0;
RenderSystem.enableScissor(10, 10, 1000, 1000);
// GL11.glScissor(10, 10, 100000, 10000);
for (Account<?> alt : Accounts.get()) {
((ButtonWidget) this.addDrawableChild(new ButtonWidget(100, height - 50 + offset, 200, 20, new LiteralText("Login"), (button) -> {
MinecraftClient.getInstance().setScreen(new AddAltScreen(this));
}))).active = true;
drawStringWithShadow(matrices, textRenderer, alt.getUsername(), 100 + 5, offset, -1);
drawStringWithShadow(matrices, textRenderer, alt.getType().name(), 100 + 5, offset + 20, -1);
offset += 50;
}
RenderSystem.disableScissor();
super.render(matrices, mouseX, mouseY, delta);
}
Aggregations