Error about my GUI build

Started by FutureStudios on

Topic category: Troubleshooting, bugs, and solutions

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Error about my GUI build

My console:


Executing Gradle task: build
Build info: MCreator 2022.3.48217, forge-1.19.2, 64-bit, 7775 MB, Windows 10, JVM 17.0.3, JAVA_HOME: C:\Program Files\Pylo\MCreator\jdk, started on: 2023-01-25-17:52:24

> Configure project :
The code of this workspace uses official obfuscation mappings provided by Mojang. These mappings fall under their associated license you should be fully aware of.
(c) 2020 Microsoft Corporation. These mappings are provided "as-is" and you bear the risk of using them. You may copy and use the mappings for development purposes,
but you may not redistribute the mappings complete and unmodified. Microsoft makes no warranties, express or implied, with respect to the mappings provided here.
Use and modification of this document or the source code (in any form) of Minecraft: Java Edition is governed by the Minecraft End User License Agreement available
at https://account.mojang.com/documents/minecraft_eula.

> Task :compileJava FAILED
C:\Users\Manganese\MCreatorWorkspaces\mod\src\main\java\net\mcreator\mod\client\gui\ItemCombinderGUIScreen.java:76: error: unclosed string literal   this.font.draw(poseStack, "+"",
     ^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
1 actionable task: 1 executed

BUILD FAILED
Task completed in 7 seconds

And then my code:

import net.mcreator.mod.world.inventory.ItemCombinderGUIMenu;

import java.util.HashMap;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.systems.RenderSystem;

public class ItemCombinderGUIScreen extends AbstractContainerScreen<ItemCombinderGUIMenu> {
	private final static HashMap<String, Object> guistate = ItemCombinderGUIMenu.guistate;
	private final Level world;
	private final int x, y, z;
	private final Player entity;

	public ItemCombinderGUIScreen(ItemCombinderGUIMenu container, Inventory inventory, Component text) {
		super(container, inventory, text);
		this.world = container.world;
		this.x = container.x;
		this.y = container.y;
		this.z = container.z;
		this.entity = container.entity;
		this.imageWidth = 176;
		this.imageHeight = 166;
	}

	@Override
	public boolean isPauseScreen() {
		return true;
	}

	private static final ResourceLocation texture = new ResourceLocation("mod:textures/screens/item_combinder_gui.png");

	@Override
	public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
		this.renderBackground(ms);
		super.render(ms, mouseX, mouseY, partialTicks);
		this.renderTooltip(ms, mouseX, mouseY);
	}

	@Override
	protected void renderBg(PoseStack ms, float partialTicks, int gx, int gy) {
		RenderSystem.setShaderColor(1, 1, 1, 1);
		RenderSystem.enableBlend();
		RenderSystem.defaultBlendFunc();
		RenderSystem.setShaderTexture(0, texture);
		this.blit(ms, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight, this.imageWidth, this.imageHeight);
		RenderSystem.disableBlend();
	}

	@Override
	public boolean keyPressed(int key, int b, int c) {
		if (key == 256) {
			this.minecraft.player.closeContainer();
			return true;
		}
		return super.keyPressed(key, b, c);
	}

	@Override
	public void containerTick() {
		super.containerTick();
	}

	@Override protected void renderLabels(PoseStack poseStack, int mouseX, int mouseY) {
				this.font.draw(poseStack, "Item Combinder",
					6, 7, -12829636);
				this.font.draw(poseStack, "+"",
					26, 47, -12829636);
	}

	@Override
	public void onClose() {
		super.onClose();
		Minecraft.getInstance().keyboardHandler.setSendRepeatsToGui(false);
	}

	@Override
	public void init() {
		super.init();
		this.minecraft.keyboardHandler.setSendRepeatsToGui(true);
		this.addRenderableWidget(new Button(this.leftPos + 60, this.topPos + 62, 51, 20, Component.literal("Craft"), e -> {
			if (true) {
				ModMod.PACKET_HANDLER.sendToServer(new ItemCombinderGUIButtonMessage(0, x, y, z));
				ItemCombinderGUIButtonMessage.handleButtonAction(entity, 0, x, y, z);
			}
		}));
	}
}

How could I forget about the error?! Down below:

Could not build and stuff... failiure...
Export .zip...
Shortened to ten...
WhateverICalledIt...

Yeah, I can't copy and paste that text FSR...

 

So... Is there any fix?