Jump to content

[solved] GUI rendering issue


Yagoki

Recommended Posts

OK guys, once more I need help..

 

Been working on this for a couple of days and I'm a bit stuck with a couple of bugs that I cant tell the source of.

When rendering the GUI for my alter structure There are two major bugs which I've come across.

 

1) There is always one element which does not render properly, from testing this normally seems to be the one which is first in the list. If this element is then moved off the screen the closest visible element to that side of the screen then renders in the same way, and so on:

 

quSZfKGl.png

then it is moved off the edge

WmguTu0l.png

 

 

2)If there are no elements being rendered on the GUI the whole GUI renders white

 

UvhjX3ml.png

 

 

The code for the GUI is here, it's mostly a ripoff of the achievements GUI, as I didn't want to go through the hassle of rewriting it for the same effect, so copied it, analysed it and played with it till I got to this point. Left my comments in, just to say what each part does, but if I got anything wrong please correct me, I'm still not very comfortable around lwjgl.

Link to comment
Share on other sites

//1 without looking at the code I'm guessing its binding the texture after each block is drawn, causing the first block to be rendered abnormally

edit: no it seems fine the bindtexture happens once before every time you render an background

 

just for a test you change

	//element render properties
if (dest.isPrivate())
drawTexturedModalRect(i5 - 2, l4 - 2, 26, 202, 26, 26);
else
drawTexturedModalRect(i5 - 2, l4 - 2, 0, 202, 26, 26);

to this

//element render properties
if (dest.isPrivate())
drawTexturedModalRect(i5 - 2, l4 - 2, 0, 202, 26, 26);//note that its now 0 at both place. this is jsut for testing purpose
else
drawTexturedModalRect(i5 - 2, l4 - 2, 0, 202, 26, 26);

 

 

2 im guessing notch code has a bug where if there is no achievement it will not even bother rendering. Which isn't technically a bug because obviously there's always achievement, but might be a problem in your code.

 

honestly it is a pain but if you want to add stuff to make it visually impressive (animation etc) you'll have to eventually change redo some part or the other

 

btw i can see where this is going ... and I to admit that I'm jealous of this ;)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Thanks for the swift reply,

I tested this against the achievements GUI and you can reach a point where there are no achievements shown, it was one of my thoughts before I posted here.

 

4aTqkSXl.png

 

 

as for the change form 0 to 26, the 26 us just the horizontal UV coordinate of the texture which is the texture corresponding to the "pointy" achievement icon:

 

0ezMFndl.png

 

 

Tested it like that anyway, to see if there was any java oddness going on, but no fix.

 

Any other ideas before i spend the next week trying to find a different way to make the code?

Link to comment
Share on other sites

as the change for 0 to 26, my fear was that it was actually in that space on the texture where theres nothing, turn out its not.

 

I'm sorry i dont have any other idea other then hardcore debugging, but i would very much like to hear about the progress of this. Whats the name of the mod you're making and when do you think you'll be done ?

 

the last thing you could try is straight up duplicate EVERYTHING the achievement thigny use and change things ONE BY ONE, slowly but surely

 

-hydroflame, author FRev-

 

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

the last thing you could try is straight up duplicate EVERYTHING the achievement thigny use and change things ONE BY ONE, slowly but surely

 

hehe, that's mostly what I did when I made it, just not overly slowly (It was fairly obvious what wasn't needed in the code)

 

I think the problem is most likely to be with binding texture for the frame, given that it overlays the whole gui goes white, bar the button which is drawn just after this:

	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	mc.renderEngine.bindTexture("/achievement/bg.png");//gets the texture
	drawTexturedModalRect(i1, j1, 0, 0, guiPaneWidth, guiPaneHeight);//draws the relevant parts
	GL11.glPopMatrix();
	zLevel = 0.0F;
	GL11.glDepthFunc(GL11.GL_LEQUAL);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);

so the big problem is probably something in that lump of GL11, or something which should get called from the loop rendering the parts, but doesn't because there are no parts to be rendered.

Link to comment
Share on other sites

heu ..... i just noticed something

 

 

you said its always the first one to be renderer that fails to have a texture

1 in the case of having "destinations" (or wtv you called your achievement-like-element) the first one to get drawn doesnt have a texture

2 in the case of no "destination" the overlay is white.

 

is it possible that the first thing to get drawn will always be white....

 

 

if thats the case ... cant you just render anything in the background, somethign that will get drawn over by the gui ... this way youll pass over the "first thing drawn is white"

 

-hydroflame-

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Hi again, i found a way to bypass the bug. heuuuuu don't ask why, just know that the texture will render correctly after you draw at least 1 item with renderItem

 

this is a code i was playing around, it seems to render fine even with 0 item to render

 

package com.hydroflame.gui;

 

import java.io.ByteArrayOutputStream;

import java.io.DataOutputStream;

import java.io.IOException;

import java.util.LinkedList;

import java.util.Random;

 

 

import net.minecraft.block.Block;

import net.minecraft.client.gui.GuiButton;

import net.minecraft.client.gui.GuiScreen;

import net.minecraft.client.gui.GuiSmallButton;

import net.minecraft.client.renderer.RenderHelper;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.client.renderer.entity.RenderItem;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemStack;

import net.minecraft.network.packet.Packet250CustomPayload;

import net.minecraft.util.Icon;

import net.minecraft.util.MathHelper;

import net.minecraft.util.StatCollector;

 

import org.lwjgl.input.Mouse;

import org.lwjgl.opengl.GL11;

import org.lwjgl.opengl.GL12;

 

import cpw.mods.fml.common.network.PacketDispatcher;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class tempGui extends GuiScreen {

public static final int GUI_ID = 6666115;

 

/** The top x coordinate of the achievement map */

private int guiMapTop = 0 - 112;

 

/** The left y coordinate of the achievement map */

private int guiMapLeft = 0 - 112;

 

/** The bottom x coordinate of the achievement map */

private int guiMapBottom = 100 - 77;

 

/** The right y coordinate of the achievement map */

private static int guiMapRight = 100 - 77;

private int guiPaneWidth = 256;

private int guiPaneHeight = 202;

 

/** The current mouse x coordinate */

private int mouseX = 0;

 

/** The current mouse y coordinate */

protected int mouseY = 0;

protected double field_74117_m;

protected double field_74115_n;

 

/** The x position of the achievement map */

protected double guiMapX;

 

/** The y position of the achievement map */

protected double guiMapY;

protected double field_74124_q;

protected double field_74123_r;

 

/** Whether the Mouse Button is down or not */

private int isMouseButtonDown = 0;

 

 

private final EntityPlayer player;

 

public tempGui(EntityPlayer player) {

short short1 = 141;

short short2 = 141;

field_74117_m = guiMapX = field_74124_q = 0 - short1 / 2 - 12;

field_74115_n = guiMapY = field_74123_r = 0 - short2 / 2;

 

this.player = player;

 

// Adds the achievements to its list

 

 

guiMapTop = 0 - 112;

guiMapLeft = 0 - 112;

guiMapBottom = 100 - 77;

guiMapRight = 100 - 77;

}

 

/**

* Adds the buttons (and other controls) to the screen in question.

*/

@Override

public void initGui() {

buttonList.clear();

// adds the exit button to the Gui

buttonList.add(new GuiSmallButton(1, width / 2 + 24, height / 2 + 74,

80, 20, StatCollector.translateToLocal("gui.done")));

}

 

/**

* Fired when a control is clicked. This is the equivalent of

* ActionListener.actionPerformed(ActionEvent e).

*/

@Override

protected void actionPerformed(GuiButton par1GuiButton) {

// has the exit button been pressed

if (par1GuiButton.id == 1) {

mc.displayGuiScreen((GuiScreen) null);

mc.setIngameFocus();

}

 

super.actionPerformed(par1GuiButton);

}

 

/**

* Fired when a key is typed. This is the equivalent of

* KeyListener.keyTyped(KeyEvent e).

*/

@Override

protected void keyTyped(char par1, int par2) {

// has E been pressed

if (par2 == mc.gameSettings.keyBindInventory.keyCode) {

mc.displayGuiScreen((GuiScreen) null);

mc.setIngameFocus();

} else

super.keyTyped(par1, par2);

}

 

/**

* Draws the screen and all the components in it.

*/

@Override

public void drawScreen(int par1, int par2, float par3) {

// is LMB down

if (Mouse.isButtonDown(0)) {

int k = (width - guiPaneWidth) / 2;

int l = (height - guiPaneHeight) / 2;

int i1 = k + 8;

int j1 = l + 17;

 

// Is the mouse within the Gui

if ((isMouseButtonDown == 0 || isMouseButtonDown == 1)

&& par1 >= i1 && par1 < i1 + 224 && par2 >= j1

&& par2 < j1 + 155) {

// was the mouse down last tick?

if (isMouseButtonDown == 0)

// sets the mouse variable to be read next tick

isMouseButtonDown = 1;

else {

// moves screen by the same as mouse

guiMapX -= par1 - mouseX;

guiMapY -= par2 - mouseY;

// these fields are all the same, I think render/screen

// bounds/position?

field_74124_q = field_74117_m = guiMapX;

field_74123_r = field_74115_n = guiMapY;

}

// sets the previous mouse positions

mouseX = par1;

mouseY = par2;

}

// Limits screen movement

if (field_74124_q < guiMapTop)

field_74124_q = guiMapTop;

 

if (field_74123_r < guiMapLeft)

field_74123_r = guiMapLeft;

 

if (field_74124_q >= guiMapBottom)

field_74124_q = guiMapBottom - 1;

 

if (field_74123_r >= guiMapRight)

field_74123_r = guiMapRight - 1;

} else

// if mouse is released then this is 0, Used to detect drag vs click

isMouseButtonDown = 0;

 

// Draws the screen background

drawDefaultBackground();

// draws the achievement page background (terrain type thing)

genAchievementBackground(par1, par2, par3);

// GL lighting stuff scares me :(

GL11.glDisable(GL11.GL_LIGHTING);

GL11.glDisable(GL11.GL_DEPTH_TEST);

// draws the title

drawTitle();

GL11.glEnable(GL11.GL_LIGHTING);

GL11.glEnable(GL11.GL_DEPTH_TEST);

}

 

/**

* Called from the main game loop to update the screen.

*/

@Override

public void updateScreen() {

// saves the current screen position

field_74117_m = guiMapX;

field_74115_n = guiMapY;

// the movement of the screen

double d0 = field_74124_q - guiMapX;

double d1 = field_74123_r - guiMapY;

 

// moved less than 2?

if (d0 * d0 + d1 * d1 < 4.0D) {

// x = field_74124_q

guiMapX += d0;

 

// y = field_74123_r

guiMapY += d1;

}

// if more than 2 move less

else {

guiMapX += d0 * 0.85D;

guiMapY += d1 * 0.85D;

}

}

 

/**

* Draws the "Achievements" title at the top of the GUI.

*/

protected void drawTitle() {

int i = (width - guiPaneWidth) / 2;

int j = (height - guiPaneHeight) / 2;

fontRenderer.drawString("Alters", i + 15, j + 5, 4210752);

}

 

protected void genAchievementBackground(int par1, int par2, float par3) {

// does something

int k = MathHelper.floor_double(field_74117_m

+ (guiMapX - field_74117_m) * par3);

int l = MathHelper.floor_double(field_74115_n

+ (guiMapY - field_74115_n) * par3);

 

// limits l and k to the screen boundary

if (k < guiMapTop)

k = guiMapTop;

 

if (l < guiMapLeft)

l = guiMapLeft;

 

if (k >= guiMapBottom)

k = guiMapBottom - 1;

 

if (l >= guiMapRight)

l = guiMapRight - 1;

 

// top and left bounds for the screen

int i1 = (width - guiPaneWidth) / 2;

int j1 = (height - guiPaneHeight) / 2;

// ummm... possibly bounds for achievement window

int k1 = i1 + 16;

int l1 = j1 + 17;

zLevel = 0.0F;

GL11.glDepthFunc(GL11.GL_GEQUAL);

GL11.glPushMatrix();

GL11.glTranslatef(0.0F, 0.0F, -200.0F);

GL11.glEnable(GL11.GL_TEXTURE_2D);

GL11.glDisable(GL11.GL_LIGHTING);

GL11.glEnable(GL12.GL_RESCALE_NORMAL);

GL11.glEnable(GL11.GL_COLOR_MATERIAL);

mc.renderEngine.bindTexture("/terrain.png");

int i2 = k + 288 >> 4;

int j2 = l + 288 >> 4;

int k2 = (k + 288) % 16;

int l2 = (l + 288) % 16;

Random random = new Random();

int i3;

int j3;

int k3;

 

 

// nested loop with texture stuff

for (i3 = 0; i3 * 16 - l2 < 155; ++i3) {

float f1 = 0.6F - (j2 + i3) / 25.0F * 0.3F;

GL11.glColor4f(f1, f1, f1, 1.0F);

 

// Background texture randomiser

for (k3 = 0; k3 * 16 - k2 < 224; ++k3) {

random.setSeed(1234 + i2 + k3);

random.nextInt();

j3 = random.nextInt(1 + j2 + i3) + (j2 + i3) / 2;

Icon icon = Block.sand.getBlockTextureFromSide(0);

 

drawTexturedModelRectFromIcon(k1 + k3 * 16 - k2, l1 + i3 * 16

- l2, icon, 16, 16);

}

}

 

GL11.glEnable(GL11.GL_DEPTH_TEST);

GL11.glDepthFunc(GL11.GL_LEQUAL);

GL11.glDisable(GL11.GL_TEXTURE_2D);

int l3;

int j4;

 

int par4 = 0, par5 = 0, par6 = 0;

float f1 = 0, f = 0;

Tessellator tessellator = Tessellator.instance;

        tessellator.startDrawingQuads();

        tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + par6) * f1));

        tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + par6) * f1));

        tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + 0) * f1));

        tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + 0) * f1));

        tessellator.draw();

 

 

// Achievement saved to this if mouse over

RenderHelper.enableGUIStandardItemLighting();

GL11.glDisable(GL11.GL_LIGHTING);

GL11.glEnable(GL12.GL_RESCALE_NORMAL);

GL11.glEnable(GL11.GL_COLOR_MATERIAL);

int l4;

int i5;

//NOTE THIS  \/

//renders somethign somewhere invisible, seems to fix the problem

RenderItem renderitem = new RenderItem();

renderitem.renderItemAndEffectIntoGUI(mc.fontRenderer,mc.renderEngine, new ItemStack(Block.dirt), 0 + 3,0 + 3);

 

 

// iterates over achievements and renders them

for (k3 = 0; k3 < 4; ++k3) {

// achievement being rendered

// position of element relative to screen

j4 = k3*50 - k;

l3 = 0 - l;

// is on page/is visible?

if (j4 >= -24 && l3 >= -24 && j4 <= 224 && l3 <= 155) {

// properties of element colour/shade for rendering

float f2;

f2 = 1.0F;

GL11.glColor4f(f2, f2, f2, 1.0F);

i5 = k1 + j4;

l4 = l1 + l3;

mc.renderEngine.bindTexture("/achievement/bg.png");

// element position relative to view-port

// element render properties

drawTexturedModalRect(i5 - 2, l4 - 2, 0, 202, 26, 26);

// renders an item on the gui

 

GL11.glEnable(GL11.GL_LIGHTING);

GL11.glEnable(GL11.GL_CULL_FACE);

renderitem.renderItemAndEffectIntoGUI(mc.fontRenderer,mc.renderEngine, new ItemStack(Block.dirt), i5 + 3,l4 + 3);

GL11.glDisable(GL11.GL_LIGHTING);

 

GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

// is mouse over

}

}

 

 

 

 

 

GL11.glDisable(GL11.GL_DEPTH_TEST);

GL11.glEnable(GL11.GL_BLEND);

GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

mc.renderEngine.bindTexture("/achievement/bg.png");

drawTexturedModalRect(i1, j1, 0, 0, guiPaneWidth, guiPaneHeight);

GL11.glPopMatrix();

zLevel = 0.0F;

GL11.glDepthFunc(GL11.GL_LEQUAL);

GL11.glDisable(GL11.GL_DEPTH_TEST);

GL11.glEnable(GL11.GL_TEXTURE_2D);

super.drawScreen(par1, par2, par3);

// renders the info of the mouse over element

 

 

GL11.glEnable(GL11.GL_DEPTH_TEST);

GL11.glEnable(GL11.GL_LIGHTING);

RenderHelper.disableStandardItemLighting();

}

 

/**

* Returns true if this GUI should pause the game when it is displayed in

* single-player

*/

@Override

public boolean doesGuiPauseGame() {

return true;

}

 

@Override

protected void mouseClicked(int par1, int par2, int par3) {

 

super.mouseClicked(par1, par2, par3);

}

}

 

 

 

i had to remove all "altars" related because i didn't have them, but it shouldn't affect the rendering code

 

Cheer,

 

-hydroflame, author FRev-

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

I fixed it at about 00:30 (GMT), and didn't have any internet at that time. Managed to identify it as being badly written vanilla code (in my opinion). There was this line "GL11.glDisable(GL11.GL_TEXTURE_2D);" in the vanilla code which I had to remove. This is (as far as I can tell) has no use in the original code as it then gets re-enabled in a method directly, after which draws the lines between achievements. Just had to remove this line and it's all good. (alternatively I could have put GL11.glEnable(GL11.GL_TEXTURE_2D))

 

Thanks for the help anyway.

 

By the looks of it you took a similar method to fixing it as I did, The Item render thingi calls GL11.glEnable(GL11.GL_TEXTURE_2D), which is why it fixed it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • rp.crazyheal.xyz mods  
    • I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache  and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.