Jump to content

Help with Compiling a mod


marcocorriero

Recommended Posts

the error says  this is wrong

 

for (NBT : array)

    {

      stick = new ItemStack(Items.field_151055_y);

      try

      {

        stick.func_77982_d(JsonToNBT.func_180713_a(NBT));

      }

      catch (NBTException localNBTException) {}

      p_78018_1_.add(stick);

    }

 

malformed for loop?

Disclaimer:  I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.

Link to comment
Share on other sites

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

the error says  this is wrong

 

for (NBT : array)

    {

      stick = new ItemStack(Items.field_151055_y);

      try

      {

        stick.func_77982_d(JsonToNBT.func_180713_a(NBT));

      }

      catch (NBTException localNBTException) {}

      p_78018_1_.add(stick);

    }

 

malformed for loop?

Everything that says field or func is obfuscated. You need to deobfuscate it. To do that is to make it readable ie field_something becomes maxHealth.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Whatever that jar file is, it is not unobfuscated source code.

 

You are wrong

 

Proof:

 

d679f63e004b4c1b8846db866439504e.png

 

 

 

the error says  this is wrong

 

for (NBT : array)

    {

      stick = new ItemStack(Items.field_151055_y);

      try

      {

        stick.func_77982_d(JsonToNBT.func_180713_a(NBT));

      }

      catch (NBTException localNBTException) {}

      p_78018_1_.add(stick);

    }

 

malformed for loop?

 

Idk what i need to do, can someone fix the code and tell what is wrong with it?

 

 

 

Link to comment
Share on other sites

You posted a file from that jar right? That is not unobfuscated code. That is decompiled code.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

What is wrong? The code is obfuscated. I don't know who that guy in the chat is, but he is wrong.

 

Things like "field_151055_y" are obfuscated names.

 

He is the creator of the mod i want to edit

 

You posted a file from that jar right? That is not unobfuscated code. That is decompiled code.

 

The jar is not compiled by him, if you open with winrar you can see it, the files are all .java.

 

Link to comment
Share on other sites

.java is decompiled not deobfuscated code.

 

He coded like this way, soo how i can fix it? c-c

I usually run it through mcp, but i think forge has a built in way...diesieben?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

You didn't post any images.

 

Nvm, is strange, if i run with client, it doesn't say anything! but when i try to get the .jar it gets 56 errors, strange.

 

gradle build

This mapping 'snapshot_20160518' was designed for MC 1.9.4! Use at your own peril.
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava UP-TO-DATE
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:88: error: unclosed character literal
            case '�': {
                 ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:88: error: illegal character: '\u00bf'
            case '�': {
                   ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:88: error: illegal character: '\u00bd'
            case '�': {
                    ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:88: error: unclosed character literal
            case '�': {
                     ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:88: error: ';' expected
            case '�': {
                       ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:92: error: orphaned default
            default: {
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:97: error: illegal start of type
        this.stack = ItemStacks.stringtostack(this.textfield.getText());
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:97: error: ';' expected
        this.stack = ItemStacks.stringtostack(this.textfield.getText());
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:97: error: <identifier> expected
        this.stack = ItemStacks.stringtostack(this.textfield.getText());
                  ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:98: error: illegal start of type
        super.keyTyped(typedChar, keyCode);
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:98: error: ';' expected
        super.keyTyped(typedChar, keyCode);
             ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:98: error: invalid method declaration; return type required
        super.keyTyped(typedChar, keyCode);
              ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:98: error: <identifier> expected
        super.keyTyped(typedChar, keyCode);
                                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:98: error: <identifier> expected
        super.keyTyped(typedChar, keyCode);
                                         ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:101: error: class, interface, or enum expected
    public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) {
           ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:101: error: class, interface, or enum expected
    public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) {
                                 ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:101: error: class, interface, or enum expected
    public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) {
                                                   ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:101: error: class, interface, or enum expected
    public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) {
                                                                     ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:103: error: class, interface, or enum expected
        this.drawDefaultBackground();
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:104: error: class, interface, or enum expected
        this.drawCreativeTabHoveringText("MyItem-Gui", this.width / 2 - 47, 25);
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:105: error: class, interface, or enum expected
        this.textfield.drawTextBox();
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:106: error: class, interface, or enum expected
        this.itemRender.renderItemAndEffectIntoGUI(this.stack, this.width / 4, this.height / 2);
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:107: error: class, interface, or enum expected
        this.renderToolTip(this.stack, this.width / 4 + 10, this.height / 3);
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:108: error: class, interface, or enum expected
        this.fontRendererObj.drawString(this.stack.stackSize + "*", this.width / 4 - 18, this.height / 2 + 5, Color.white.getRGB());
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:109: error: class, interface, or enum expected
        super.drawScreen(mouseX, mouseY, partialTicks);
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:110: error: class, interface, or enum expected
    }
    ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:112: error: class, interface, or enum expected
    protected void actionPerformed(final GuiButton button) throws IOException {
                                         ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:116: error: class, interface, or enum expected
                break;
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:117: error: class, interface, or enum expected
            }
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:120: error: class, interface, or enum expected
                break;
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:121: error: class, interface, or enum expected
            }
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:124: error: class, interface, or enum expected
                break;
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:125: error: class, interface, or enum expected
            }
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:128: error: class, interface, or enum expected
                break;
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:129: error: class, interface, or enum expected
            }
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:141: error: class, interface, or enum expected
                this.textfield.textboxKeyTyped((char)(button.id - 100), 0);
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:142: error: class, interface, or enum expected
                break;
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:143: error: class, interface, or enum expected
            }
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:156: error: class, interface, or enum expected
                final char[] ca = { 'a', 'b', 'c', 'd', 'e', 'f', 'k', 'l', 'm', 'n', 'o', 'r' };
                      ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:157: error: class, interface, or enum expected
                this.textfield.textboxKeyTyped('&', 0);
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:158: error: class, interface, or enum expected
                this.textfield.textboxKeyTyped(ca[button.id - 110], 0);
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:159: error: class, interface, or enum expected
                break;
                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:160: error: class, interface, or enum expected
            }
            ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:163: error: class, interface, or enum expected
    }
    ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:167: error: class, interface, or enum expected
        Minecraft.getMinecraft().thePlayer.inventory.addItemStackToInventory(this.stack);
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:168: error: class, interface, or enum expected
    }
    ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:170: error: class, interface, or enum expected
    protected void mouseClicked(final int mouseX, final int mouseY, final int mouseButton) throws IOException {
                                      ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:170: error: class, interface, or enum expected
    protected void mouseClicked(final int mouseX, final int mouseY, final int mouseButton) throws IOException {
                                                        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:170: error: class, interface, or enum expected
    protected void mouseClicked(final int mouseX, final int mouseY, final int mouseButton) throws IOException {
                                                                          ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:172: error: class, interface, or enum expected
        this.textfield.mouseClicked(mouseX, mouseY, mouseButton);
        ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:173: error: class, interface, or enum expected
    }
    ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\Gui\GuiMyitem.java:177: error: class, interface, or enum expected
    }
    ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\util\ItemStacks.java:31: error: unclosed character literal
        Stringargs = Stringargs.replace('&', '�');
                                             ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\util\ItemStacks.java:31: error: illegal character: '\u00bf'
        Stringargs = Stringargs.replace('&', '�');
                                               ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\util\ItemStacks.java:31: error: illegal character: '\u00bd'
        Stringargs = Stringargs.replace('&', '�');
                                                ^
C:\Users\marco\Desktop\forge-1.10.2-12.18.2.2099-mdk (1)\build\sources\main\java\mcmodding4k\betterinventory\util\ItemStacks.java:31: error: unclosed character literal
        Stringargs = Stringargs.replace('&', '�');
                                                 ^
56 errors
:compileJava FAILED

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.

BUILD FAILED

Total time: 3.347 secs



Build failure (see the Notifications window for stacktrace): gradle build

Link to comment
Share on other sites

You will have to handle the typing and rendering yourself. Create an image of what you want the Code here box to look like. Draw that image on the screen using the Tesselator class. Create a List of type String for all the text to be stored. Render the code using Gui#fontRenderer(I think that is the variables name) and a for loop. Handle the typing with Gui#keyPressed? or Gui#keyTyped. And ignore my last post I didn't see the whole picture.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

You will have to handle the typing and rendering yourself. Create an image of what you want the Code here box to look like. Draw that image on the screen using the Tesselator class. Create a List of type String for all the text to be stored. Render the code using Gui#fontRenderer(I think that is the variables name) and a for loop. Handle the typing with Gui#keyPressed? or Gui#keyTyped. And ignore my last post I didn't see the whole picture.

For now let's fix the errors saying in compiling, When i click RunClient on eclipse it runs without any problem, but when i want the jar, and i do gradlew build, it makes 56 errors!, how to fix them?

Link to comment
Share on other sites

Your file encoding is broken, use UTF-8 everywhere.

 

How, tell me how to fix it :C

[lmgtfy]how to change file encoding to utf-8 in eclipse[/lmgtfy]

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Make your image for where the code goes. Read up on Tesselator, you just bind the texture like any other image (look in vanilla GUI's for this). Go into Gui and look at how they use the Tesselator. fontRenderer.drawString is pretty self explanatory. Create a variable in your class with the type List and set it equal to and ArrayList. There is a method in Gui called keyPressed or keyTyped not sure which, but use that to write to your List.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Make your image for where the code goes. Read up on Tesselator, you just bind the texture like any other image (look in vanilla GUI's for this). Go into Gui and look at how they use the Tesselator. fontRenderer.drawString is pretty self explanatory. Create a variable in your class with the type List and set it equal to and ArrayList. There is a method in Gui called keyPressed or keyTyped not sure which, but use that to write to your List.

 

Ermh , i didnt understand a word you said.

Link to comment
Share on other sites

Make your image for where the code goes. Read up on Tesselator, you just bind the texture like any other image (look in vanilla GUI's for this). Go into Gui and look at how they use the Tesselator. fontRenderer.drawString is pretty self explanatory. Create a variable in your class with the type List and set it equal to and ArrayList. There is a method in Gui called keyPressed or keyTyped not sure which, but use that to write to your List.

 

Ermh , i didnt understand a word you said.

What do you mean? You don't even know what the first sentence means?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Make your image for where the code goes. Read up on Tesselator, you just bind the texture like any other image (look in vanilla GUI's for this). Go into Gui and look at how they use the Tesselator. fontRenderer.drawString is pretty self explanatory. Create a variable in your class with the type List and set it equal to and ArrayList. There is a method in Gui called keyPressed or keyTyped not sure which, but use that to write to your List.

 

Ermh , i didnt understand a word you said.

What do you mean? You don't even know what the first sentence means?

 

Im not good at coding, is my first time, buddy, how i can fix it? c-c

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.

Announcements




×
×
  • Create New...

Important Information

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