net.minecraft.client.util.math.MatrixStack Java Examples

The following examples show how to use net.minecraft.client.util.math.MatrixStack. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MachineHandledScreen.java    From Galacticraft-Rewoven with MIT License 7 votes vote down vote up
@Override
public void render(MatrixStack stack, int mouseX, int mouseY, float delta) {
    if (this.handler.blockEntity != null) {
        ConfigurableElectricMachineBlockEntity.SecurityInfo security = this.handler.blockEntity.getSecurity();
        switch (security.getPublicity()) {
            case PRIVATE:
                if (!this.playerInventory.player.getUuid().equals(security.getOwner())) {
                    DrawableUtils.drawCenteredString(stack, this.client.textRenderer, "\u00A7l" + new TranslatableText("ui.galacticraft-rewoven.tabs.security_config.not_your_machine").asString(), (this.width / 2), this.y + 50, Formatting.DARK_RED.getColorValue());
                    return;
                }
            case SPACE_RACE:
                if (!this.playerInventory.player.getUuid().equals(security.getOwner())) {
                    DrawableUtils.drawCenteredString(stack, this.client.textRenderer, "\u00A7l" + new TranslatableText("Team stuff pending...").asString(), (this.width / 2), this.y + 50, Formatting.DARK_RED.getColorValue());
                    return;
                }
            default:
                break;
        }
    }

    this.drawConfigTabs(stack);
    super.render(stack, mouseX, mouseY, delta);
}
 
Example #2
Source File: WurstLogo.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
public void render(MatrixStack matrixStack)
{
	if(!WurstClient.INSTANCE.getOtfs().wurstLogoOtf.isVisible())
		return;
	
	String version = getVersionString();
	TextRenderer tr = WurstClient.MC.textRenderer;
	
	// draw version background
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	
	if(WurstClient.INSTANCE.getHax().rainbowUiHack.isEnabled())
	{
		float[] acColor = WurstClient.INSTANCE.getGui().getAcColor();
		GL11.glColor4f(acColor[0], acColor[1], acColor[2], 0.5F);
		
	}else
		GL11.glColor4f(1, 1, 1, 0.5F);
	
	drawQuads(0, 6, tr.getWidth(version) + 76, 17);
	
	// draw version string
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	tr.draw(matrixStack, version, 74, 8, 0xFF000000);
	
	// draw Wurst logo
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_BLEND);
	WurstClient.MC.getTextureManager().bindTexture(texture);
	DrawableHelper.drawTexture(matrixStack, 0, 3, 0, 0, 72, 18, 72, 18);
}
 
Example #3
Source File: Peek.java    From bleachhack-1.14 with GNU General Public License v3.0 6 votes vote down vote up
public void drawMapToolTip(MatrixStack matrix, Slot slot, int mX, int mY) {
	if (slot.getStack().getItem() != Items.FILLED_MAP) return;
	
	MapState data = FilledMapItem.getMapState(slot.getStack(), mc.world);
	byte[] colors = data.colors;
	
	double size = getSettings().get(3).toSlider().getValue();
	
	GL11.glPushMatrix();
	GL11.glScaled(size, size, 1.0);
	GL11.glTranslatef(0.0F, 0.0F, 300.0F);
	int x = (int) (mX*(1/size) + 12*(1/size));
	int y = (int) (mY*(1/size) - 12*(1/size) - 140);
	
	renderTooltipBox(x - 12, y + 12, 128, 128, false);
	for (byte c: colors) {
		int c1 = c & 255;
		
		if (c1 / 4 != 0) Screen.fill(matrix, x, y, x+1, y+1, getRenderColorFix(MaterialColor.COLORS[c1 / 4].color, c1 & 3));
		if (x - (int) (mX*(1/size)+12*(1/size)) == 127) { x = (int) (mX*(1/size)+12*(1/size)); y++; }
		else x++;
	}
	
	GL11.glPopMatrix();
}
 
Example #4
Source File: SelectFileScreen.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
	float partialTicks)
{
	renderBackground(matrixStack);
	listGui.render(matrixStack, mouseX, mouseY, partialTicks);
	
	drawCenteredString(matrixStack, client.textRenderer, setting.getName(),
		width / 2, 12, 0xffffff);
	
	super.render(matrixStack, mouseX, mouseY, partialTicks);
	
	if(doneButton.isHovered() && !doneButton.active)
		renderTooltip(matrixStack,
			Arrays.asList(new LiteralText("You must first select a file.")),
			mouseX, mouseY);
}
 
Example #5
Source File: CheckboxComponent.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
	float partialTicks)
{
	int x1 = getX();
	int x2 = x1 + getWidth();
	int x3 = x1 + 11;
	int y1 = getY();
	int y2 = y1 + getHeight();
	
	boolean hovering = isHovering(mouseX, mouseY, x1, x2, y1, y2);
	
	if(hovering && mouseX >= x3)
		setTooltip();
	
	if(setting.isLocked())
		hovering = false;
	
	drawBackground(x2, x3, y1, y2);
	drawBox(x1, x3, y1, y2, hovering);
	
	if(setting.isChecked())
		drawCheck(x1, y1, hovering);
	
	drawName(matrixStack, x3, y1);
}
 
Example #6
Source File: SliderComponent.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
private void drawNameAndValue(MatrixStack matrixStack, int x1, int x2,
	int y1, boolean renderAsDisabled)
{
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	
	TextRenderer tr = MC.textRenderer;
	String name = setting.getName();
	String value = setting.getValueString();
	int valueWidth = tr.getWidth(value);
	int color = renderAsDisabled ? 0xAAAAAA : 0xF0F0F0;
	tr.draw(matrixStack, name, x1, y1 + 2, color);
	tr.draw(matrixStack, value, x2 - valueWidth, y1 + 2, color);
	
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_BLEND);
}
 
Example #7
Source File: WTextField.java    From LibGui with MIT License 6 votes vote down vote up
@Override
public void paint(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
	
	/*
	if (isFocused()) {
		ScreenDrawing.rect(x-1, y-1, this.getWidth()+2, this.getHeight()+2, 0xFFFFFFFF);
	}
	
	if (backgroundPainter!=null) {
		backgroundPainter.paintBackground(x, y, this);
	} else {
		ScreenDrawing.drawBeveledPanel(x, y, this.getWidth(), this.getHeight());
	}
	
	ScreenDrawing.drawString(this.text, x+OFFSET_X_TEXT, y+OFFSET_Y_TEXT, 0xFFFFFFFF);
	//int ofs = MinecraftClient.getInstance().textRenderer.getStringWidth(this.text);
	ScreenDrawing.rect(x+OFFSET_X_TEXT+getCaretOffset(this.text, cursor), y+OFFSET_Y_TEXT-2, 1, OFFSET_Y_TEXT*2, 0xFFE0E0E0);*/
	
	renderTextField(matrices, x, y);
}
 
Example #8
Source File: ZoomManagerScreen.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
	float partialTicks)
{
	ZoomOtf zoom = WurstClient.INSTANCE.getOtfs().zoomOtf;
	SliderSetting level = zoom.getLevelSetting();
	
	renderBackground(matrixStack);
	drawCenteredString(matrixStack, textRenderer, "Zoom Manager", width / 2,
		40, 0xffffff);
	drawStringWithShadow(matrixStack, textRenderer,
		"Zoom Level: " + level.getValueString(), width / 2 - 75,
		height / 4 + 44, 0xcccccc);
	
	super.render(matrixStack, mouseX, mouseY, partialTicks);
}
 
Example #9
Source File: PlayerInventoryGCScreen.java    From Galacticraft-Rewoven with MIT License 6 votes vote down vote up
@Override
    public void drawBackground(MatrixStack stack, float v, int mouseX, int mouseY) {
//        this.drawTexturedReact(...)
        this.client.getTextureManager().bindTexture(BACKGROUND);
        this.drawTexture(stack, this.x, this.y, 0, 0, this.backgroundWidth, this.backgroundHeight);

        int int_3 = this.x;
        int int_4 = this.y;
        InventoryScreen.drawEntity(int_3 + 51, int_4 + 75, 30, (float) (int_3 + 51) - this.mouseX, (float) (int_4 + 75 - 50) - this.mouseY, this.client.player);

        this.client.getTextureManager().bindTexture(BACKGROUND);

        //X,Y,blitOffset,u,v,width,height
        this.drawTexture(stack, this.x + 138, this.y + 8, 244, 0, 12, 40);
        this.drawTexture(stack, this.x + 156, this.y + 8, 244, 0, 12, 40);

        this.client.getTextureManager().bindTexture(new Identifier(Constants.MOD_ID, Constants.ScreenTextures.getRaw(Constants.ScreenTextures.PLAYER_INVENTORY_TABS)));
        this.drawTexture(stack, this.x, this.y - 28, 0, 32, 57, 62);
    }
 
Example #10
Source File: SpaceRaceScreen.java    From Galacticraft-Rewoven with MIT License 6 votes vote down vote up
private void renderButton(MatrixStack stack, TextRenderer textRenderer, Text text, int x, int y, int width, int height) {
    RenderSystem.disableBlend();
    stack.push();

    fillSolid(stack.peek().getModel(), x, y, x + width, y + height, 0x0);

    drawHorizontalLineSolid(stack, x, x + width, y, 0x2d2d2d);
    drawVerticalLineSolid(stack, x + width, y, y + height, 0x2d2d2d);
    drawHorizontalLineSolid(stack, x + width, x, y + height, 0x2d2d2d);
    drawVerticalLineSolid(stack, x, y, y + height, 0x2d2d2d);

    stack.pop();
    RenderSystem.enableBlend();

    textRenderer.draw(stack, text, x + (width / 2F) - (textRenderer.getWidth(text) / 2F), y + (height / 2F) - 4F, 0xffffff);
}
 
Example #11
Source File: PonyPosture.java    From MineLittlePony with MIT License 5 votes vote down vote up
default void apply(T player, IModel model, MatrixStack stack, float yaw, float ticks, int invert) {
    if (applies(player)) {
        double motionX = player.getX() - player.prevX;
        double motionY = player.isOnGround() ? 0 : player.getY() - player.prevY;
        double motionZ = player.getZ() - player.prevZ;

        transform(model, player, stack, motionX, invert * motionY, motionZ, yaw, ticks);
    }
}
 
Example #12
Source File: RenderUtilsLiving.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public static void drawItem(double x, double y, double z, double offX, double offY, double scale, ItemStack item) {
	glSetup(x, y, z);
	
    GL11.glScaled(0.4*scale, 0.4*scale, 0);
    
    GL11.glTranslated(offX, offY, 0);
    if (item.getItem() instanceof BlockItem) GL11.glRotatef(180F, 1F, 180F, 10F);
    mc.getItemRenderer().renderItem(new ItemStack(
    		item.getItem()), Mode.GUI, 0, 0, new MatrixStack(), mc.getBufferBuilders().getEntityVertexConsumers());
    if (item.getItem() instanceof BlockItem) GL11.glRotatef(-180F, -1F, -180F, -10F);
    GL11.glDisable(GL11.GL_LIGHTING);
    
    GL11.glScalef(-0.05F, -0.05F, 0);
    
    if (item.getCount() > 0) {
	    int w = mc.textRenderer.getStringWidth("x" + item.getCount()) / 2;
	    mc.textRenderer.drawWithShadow("x" + item.getCount(), 7 - w, 5, 0xffffff);
    }
    
    GL11.glScalef(0.85F, 0.85F, 0.85F);
    
    int c = 0;
    for (Entry<Enchantment, Integer> m: EnchantmentHelper.getEnchantments(item).entrySet()) {
    	int w1 = mc.textRenderer.getStringWidth(I18n.translate(m.getKey().getName(2).asString()).substring(0, 2) + m.getValue()) / 2;
    	mc.textRenderer.drawWithShadow(
    			I18n.translate(m.getKey().getName(2).asString()).substring(0, 2) + m.getValue(), -4 - w1, c*10-1,
    			m.getKey() == Enchantments.VANISHING_CURSE || m.getKey() == Enchantments.BINDING_CURSE
    			? 0xff5050 : 0xffb0e0);
    	c--;
    }
    
    GL11.glScalef(0.6F, 0.6F, 0.6F);
    String dur = item.getMaxDamage() - item.getDamage() + "";
       int color = 0x000000;
       try{ color = MathHelper.hsvToRgb(((float) (item.getMaxDamage() - item.getDamage()) / item.getMaxDamage()) / 3.0F, 1.0F, 1.0F); } catch (Exception e) {}
    if (item.isDamageable()) mc.textRenderer.drawWithShadow(dur, -8 - dur.length() * 3, 15,
    		new Color(color >> 16 & 255, color >> 8 & 255, color & 255).getRGB());
    
    glCleanup();
}
 
Example #13
Source File: GameRendererMixin.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Inject(
	at = {@At(value = "FIELD",
		target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z",
		opcode = Opcodes.GETFIELD,
		ordinal = 0)},
	method = {
		"renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V"})
private void onRenderWorld(float partialTicks, long finishTimeNano,
	MatrixStack matrixStack, CallbackInfo ci)
{
	RenderEvent event = new RenderEvent(partialTicks);
	WurstClient.INSTANCE.getEventManager().fire(event);
}
 
Example #14
Source File: UnicornHorn.java    From MineLittlePony with MIT License 5 votes vote down vote up
public void renderMagic(MatrixStack stack, VertexConsumer verts, int tint) {
    if (visible) {
        Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers();

        VertexConsumer vertices = immediate.getBuffer(MagicGlow.getRenderLayer());

        glow.render(stack, vertices, OverlayTexture.DEFAULT_UV, 0x0F00F0, Color.r(tint), Color.g(tint), Color.b(tint), 0.4F);
    }
}
 
Example #15
Source File: WWidget.java    From LibGui with MIT License 5 votes vote down vote up
/**
 * Internal method to render tooltip data. This requires an overriden {@link #addTooltip(List)
 * addTooltip} method to insert data into the tooltip - without this, the method returns early, because no work
 */
@Environment(EnvType.CLIENT)
public void renderTooltip(MatrixStack matrices, int x, int y, int tX, int tY) {
	List<StringRenderable> info = new ArrayList<>();
	addTooltip(info);

	if (info.size() == 0)
		return;

	Screen screen = MinecraftClient.getInstance().currentScreen;
	screen.renderTooltip(matrices, info, tX+x, tY+y);
}
 
Example #16
Source File: EditItemListScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
	float partialTicks)
{
	renderBackground(matrixStack);
	listGui.render(matrixStack, mouseX, mouseY, partialTicks);
	
	drawCenteredString(matrixStack, client.textRenderer,
		itemList.getName() + " (" + listGui.getItemCount() + ")", width / 2,
		12, 0xffffff);
	
	itemNameField.render(matrixStack, mouseX, mouseY, partialTicks);
	super.render(matrixStack, mouseX, mouseY, partialTicks);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-64 + width / 2 - 152, 0, 0);
	
	if(itemNameField.getText().isEmpty() && !itemNameField.isFocused())
	{
		GL11.glPushMatrix();
		GL11.glTranslated(0, 0, 300);
		drawStringWithShadow(matrixStack, client.textRenderer,
			"item name or ID", 68, height - 50, 0x808080);
		GL11.glPopMatrix();
	}
	
	fill(matrixStack, 48, height - 56, 64, height - 36, 0xffa0a0a0);
	fill(matrixStack, 49, height - 55, 64, height - 37, 0xff000000);
	fill(matrixStack, 214, height - 56, 244, height - 55, 0xffa0a0a0);
	fill(matrixStack, 214, height - 37, 244, height - 36, 0xffa0a0a0);
	fill(matrixStack, 244, height - 56, 246, height - 36, 0xffa0a0a0);
	fill(matrixStack, 214, height - 55, 243, height - 52, 0xff000000);
	fill(matrixStack, 214, height - 40, 243, height - 37, 0xff000000);
	fill(matrixStack, 215, height - 55, 216, height - 37, 0xff000000);
	fill(matrixStack, 242, height - 55, 245, height - 37, 0xff000000);
	listGui.renderIconAndGetName(matrixStack, new ItemStack(itemToAdd), 52,
		height - 52, false);
	
	GL11.glPopMatrix();
}
 
Example #17
Source File: ZebraModel.java    From MineLittlePony with MIT License 5 votes vote down vote up
static void applyLongNeck(BodyPart part, MatrixStack stack) {
    if (part == BodyPart.HEAD || part == BodyPart.NECK) {
        stack.translate(0, -0.1F, 0);
    }
    if (part == BodyPart.NECK) {
         stack.scale(1, 1.3F, 1);
    }
}
 
Example #18
Source File: WButton.java    From LibGui with MIT License 5 votes vote down vote up
@Override
public void paint(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
	boolean hovered = (mouseX>=0 && mouseY>=0 && mouseX<getWidth() && mouseY<getHeight());
	int state = 1; //1=regular. 2=hovered. 0=disabled.
	if (!enabled) state = 0;
	else if (hovered || isFocused()) state = 2;
	
	float px = 1/256f;
	float buttonLeft = 0 * px;
	float buttonTop = (46 + (state*20)) * px;
	int halfWidth = getWidth()/2;
	if (halfWidth>198) halfWidth=198;
	float buttonWidth = halfWidth*px;
	float buttonHeight = 20*px;
	
	float buttonEndLeft = (200-(getWidth()/2)) * px;
	
	ScreenDrawing.texturedRect(x, y, getWidth()/2, 20, AbstractButtonWidget.WIDGETS_LOCATION, buttonLeft, buttonTop, buttonLeft+buttonWidth, buttonTop+buttonHeight, 0xFFFFFFFF);
	ScreenDrawing.texturedRect(x+(getWidth()/2), y, getWidth()/2, 20, AbstractButtonWidget.WIDGETS_LOCATION, buttonEndLeft, buttonTop, 200*px, buttonTop+buttonHeight, 0xFFFFFFFF);
	
	if (label!=null) {
		int color = 0xE0E0E0;
		if (!enabled) {
			color = 0xA0A0A0;
		} /*else if (hovered) {
			color = 0xFFFFA0;
		}*/
		
		ScreenDrawing.drawStringWithShadow(matrices, label, alignment, x, y + ((20 - 8) / 2), width, color); //LibGuiClient.config.darkMode ? darkmodeColor : color);
	}
}
 
Example #19
Source File: MixinMultiplayerScreen.java    From ViaFabric with MIT License 5 votes vote down vote up
@Inject(method = "render", at = {
        @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;render" +
                        "(Lnet/minecraft/client/util/math/MatrixStack;IIF)V"),
})
private void onRender(MatrixStack matrices, int int_1, int int_2, float float_1, CallbackInfo ci) {
    protocolVersion.render(matrices, int_1, int_2, float_1);
}
 
Example #20
Source File: SeaponyModel.java    From MineLittlePony with MIT License 5 votes vote down vote up
@Override
protected void renderBody(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha) {
    torso.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
    bodyCenter.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
    torso.rotate(stack);

    tail.renderPart(stack, vertices, overlayUv, lightUv, red, green, blue, alpha, attributes.interpolatorId);
    leftFin.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
    centerFin.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
    rightFin.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
}
 
Example #21
Source File: EditSliderScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY,
	float partialTicks)
{
	renderBackground(matrixStack);
	drawCenteredString(matrixStack, client.textRenderer, slider.getName(),
		width / 2, 20, 0xFFFFFF);
	
	valueField.render(matrixStack, mouseX, mouseY, partialTicks);
	super.render(matrixStack, mouseX, mouseY, partialTicks);
}
 
Example #22
Source File: UnicornModel.java    From MineLittlePony with MIT License 5 votes vote down vote up
@Override
protected void renderHead(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha) {
    super.renderHead(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);

    if (hasHorn()) {
        head.rotate(stack);
        horn.renderPart(stack, vertices, overlayUv, lightUv, red, green, blue, alpha, attributes.interpolatorId);
    }
}
 
Example #23
Source File: BasicSolarPanelScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
protected void drawBackground(MatrixStack stack, float v, int mouseX, int mouseY) {
    this.renderBackground(stack);
    this.client.getTextureManager().bindTexture(BACKGROUND);

    int leftPos = this.x;
    int topPos = this.y;

    this.drawTexture(stack, leftPos, topPos, 0, 0, this.backgroundWidth, this.backgroundHeight);
    this.drawEnergyBufferBar(stack, this.x + 10, this.y + 9);
}
 
Example #24
Source File: PostureFlight.java    From MineLittlePony with MIT License 5 votes vote down vote up
@Override
public void transform(IModel model, PlayerEntity player, MatrixStack stack, double motionX, double motionY, double motionZ, float yaw, float ticks) {
    model.getAttributes().motionPitch = (float) calculateIncline(player, motionX, motionY, motionZ);

    float roll = (float)calculateRoll(player, motionX,  motionY, motionZ);

    roll = model.getMetadata().getInterpolator(player.getUuid()).interpolate("pegasusRoll", roll, 10);

    stack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(model.getAttributes().motionPitch));
    stack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(roll));
}
 
Example #25
Source File: SpaceRaceScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
public void renderBackground(MatrixStack stack) {
    // 5% of width
    int maxWidth = (int) (this.width - (getXMargins() * 1.5D));
    if (widthSize < maxWidth) {
        widthSize += Math.min(3, maxWidth - widthSize);
    }

    int maxHeight = (int) (this.height - (getYMargins() * 1.5D));
    if (heightSize < maxHeight) {
        heightSize += Math.min(2, maxHeight - heightSize);
    }

    fill(stack, getLeft(), getTop(), getLeft() + widthSize, getTop() + heightSize, 0x80000000);
}
 
Example #26
Source File: PistonBlockEntityRenderer_movableTEMixin.java    From fabric-carpet with MIT License 5 votes vote down vote up
@Inject(method = "render", at = @At(value = "INVOKE",
        target = "Lnet/minecraft/client/render/block/entity/PistonBlockEntityRenderer;method_3575(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/world/World;ZI)V", ordinal = 3))
private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, float float_1, MatrixStack matrixStack_1, VertexConsumerProvider layeredVertexConsumerStorage_1, int int_1, int int_2, CallbackInfo ci)
//private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, double double_1, double double_2, double double_3, float float_1, class_4587 class_4587_1, class_4597 class_4597_1, int int_1, CallbackInfo ci)
{
    if (!((PistonBlockEntityInterface) pistonBlockEntity_1).isRenderModeSet())
        ((PistonBlockEntityInterface) pistonBlockEntity_1).setRenderCarriedBlockEntity(CarpetSettings.movableBlockEntities && ((PistonBlockEntityInterface) pistonBlockEntity_1).getCarriedBlockEntity() != null);
}
 
Example #27
Source File: InGameOverlayRendererMixin.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Inject(at = {@At("HEAD")},
	method = {
		"renderFireOverlay(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/util/math/MatrixStack;)V"},
	cancellable = true)
private static void onRenderFireOverlay(MinecraftClient minecraftClient,
	MatrixStack matrixStack, CallbackInfo ci)
{
	if(WurstClient.INSTANCE.getHax().noFireOverlayHack.isEnabled())
		ci.cancel();
}
 
Example #28
Source File: TerrainRenderContextMixin.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Inject(at = {@At("HEAD")},
	method = {"tesselateBlock"},
	cancellable = true,
	remap = false)
private void tesselateBlock(BlockState blockState, BlockPos blockPos,
	final BakedModel model, MatrixStack matrixStack,
	CallbackInfoReturnable<Boolean> cir)
{
	TesselateBlockEvent event = new TesselateBlockEvent(blockState);
	WurstClient.INSTANCE.getEventManager().fire(event);
	
	if(event.isCancelled())
		cir.cancel();
}
 
Example #29
Source File: SpaceRaceScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
protected void drawVerticalLineSolid(MatrixStack matrices, int x, int y1, int y2, int color) {
    if (y2 < y1) {
        int i = y1;
        y1 = y2;
        y2 = i;
    }

    fillSolid(matrices.peek().getModel(), x, y1 + 1, x + 1, y2, color);
}
 
Example #30
Source File: SpaceRaceScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
private void renderHoveredButton(MatrixStack stack, TextRenderer textRenderer, Text text, int x, int y, int width, int height) {
    RenderSystem.disableBlend();
    stack.push();

    fillSolid(stack.peek().getModel(), x, y, x + width, y + height, 0x1e1e1e);

    drawHorizontalLineSolid(stack, x, x + width, y, 0x3c3c3c);
    drawVerticalLineSolid(stack, x + width, y, y + height, 0x3c3c3c);
    drawHorizontalLineSolid(stack, x + width, x, y + height, 0x3c3c3c);
    drawVerticalLineSolid(stack, x, y, y + height, 0x3c3c3c);

    stack.pop();
    RenderSystem.enableBlend();

    textRenderer.draw(stack, text, x + (width / 2F) - (textRenderer.getWidth(text) / 2F), y + (height / 2F) - 4F, 0xffffff);
}