Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Registrying Buildpath into gradlew


Zyldra
 Share

Recommended Posts

I have a problem with exporting my mod that contains a plugin for NEI, the plugin works insite eclipse but when I try to export it then gradlew doesn't know that I extendet the Buildpath.

 

Here the eror code if you wan't:

 

 

The assetDir is deprecated!  Use runDir instead! runDir set to eclipse/..The assetDir is deprecated!  Use runDir instead! runDir set to eclipse/..

 

****************************

Powered By MCP:           

http://mcp.ocean-labs.de/ 

Searge, ProfMobius, Fesh0r,

R4wk, ZeuX, IngisKahn, bspkrs

MCP Data version : unknown

****************************

:compileApiJava UP-TO-DATE

:processApiResources UP-TO-DATE

:apiClasses UP-TO-DATE

:sourceMainJava UP-TO-DATE

:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:4: error: package codechicken.nei.recipe does not exist

import codechicken.nei.recipe.DefaultOverlayHandler;

                            ^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:5: error: package codechicken.nei.recipe does not exist

import codechicken.nei.recipe.FurnaceRecipeHandler;

                            ^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:6: error: package codechicken.nei.api does not exist

import codechicken.nei.api.API;

                          ^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:13: error: package codechicken.nei does not exist

import codechicken.nei.NEIServerUtils;

                      ^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:14: error: package codechicken.nei does not exist

import codechicken.nei.PositionedStack;

                      ^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:15: error: package codechicken.nei.recipe does not exist

import codechicken.nei.recipe.TemplateRecipeHandler;

                            ^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:16: error: package codechicken.nei.recipe.TemplateRecipeHandler does not exist

import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe;

                                                  ^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:18: error: cannot find symbol

public class RecipeInfusionAltar extends TemplateRecipeHandler {

                                        ^

  symbol: class TemplateRecipeHandler

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:20: error: cannot find symbol

public class CachedInfusionRecipe extends CachedRecipe

                                          ^

  symbol:  class CachedRecipe

  location: class RecipeInfusionAltar

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:42: error: cannot find symbol

public List<PositionedStack> getIngredients() {

            ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:56: error: cannot find symbol

public PositionedStack getResult() {

      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:60: error: cannot find symbol

PositionedStack ingred1;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:61: error: cannot find symbol

PositionedStack ingred2;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:62: error: cannot find symbol

PositionedStack ingred3;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:63: error: cannot find symbol

PositionedStack ingred4;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:64: error: cannot find symbol

PositionedStack ingred5;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:65: error: cannot find symbol

PositionedStack ingred6;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:66: error: cannot find symbol

PositionedStack ingred7;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:67: error: cannot find symbol

PositionedStack ingred8;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:68: error: cannot find symbol

PositionedStack wand;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:69: error: cannot find symbol

PositionedStack result;

^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:16: error: cannot find symbol

API.registerGuiOverlay(GuiInfusionAltar.class, "InfusionCrafting");

^

  symbol:  variable API

  location: class NEICompat

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:17: error: cannot find symbol

API.registerGuiOverlayHandler(GuiInfusionAltar.class, new DefaultOverlayHandler(), "InfusionCrafting");

                                                          ^

  symbol:  class DefaultOverlayHandler

  location: class NEICompat

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:17: error: cannot find symbol

API.registerGuiOverlayHandler(GuiInfusionAltar.class, new DefaultOverlayHandler(), "InfusionCrafting");

^

  symbol:  variable API

  location: class NEICompat

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:19: error: cannot find symbol

API.registerRecipeHandler(new RecipeInfusionAltar());

^

  symbol:  variable API

  location: class NEICompat

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\NEICompat.java:20: error: cannot find symbol

API.registerUsageHandler(new RecipeInfusionAltar());

^

  symbol:  variable API

  location: class NEICompat

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:30: error: cannot find symbol

if(ingred[0]!=null)this.ingred1 = new PositionedStack(ingred[0], 3, -1);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:31: error: cannot find symbol

if(ingred[1]!=null)this.ingred2 = new PositionedStack(ingred[1], 3, 16);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:32: error: cannot find symbol

if(ingred[2]!=null)this.ingred3 = new PositionedStack(ingred[2], 3, 34);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:33: error: cannot find symbol

if(ingred[3]!=null)this.ingred4 = new PositionedStack(ingred[3], 3, 52);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:34: error: cannot find symbol

if(ingred[4]!=null)this.ingred5 = new PositionedStack(ingred[4], 147, -1);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:35: error: cannot find symbol

if(ingred[5]!=null)this.ingred6 = new PositionedStack(ingred[5], 147, 16);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:36: error: cannot find symbol

if(ingred[6]!=null)this.ingred7 = new PositionedStack(ingred[6], 147, 34);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:37: error: cannot find symbol

if(ingred[7]!=null)this.ingred8 = new PositionedStack(ingred[7], 147, 52);

                                      ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:38: error: cannot find symbol

if(ingred[8]!=null)this.wand = new PositionedStack(ingred[8], 39, 52);

                                  ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:39: error: cannot find symbol

this.result = new PositionedStack(result, 75, 16);

                  ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:43: error: cannot find symbol

ArrayList<PositionedStack> recipestacks = new ArrayList<PositionedStack>();

          ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:43: error: cannot find symbol

ArrayList<PositionedStack> recipestacks = new ArrayList<PositionedStack>();

                                                        ^

  symbol:  class PositionedStack

  location: class RecipeInfusionAltar.CachedInfusionRecipe

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:72: error: method does not override or implement a method from a supertype

@Override

^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:79: error: cannot find symbol

arecipes.add(new CachedInfusionRecipe(is, result));

^

  symbol:  variable arecipes

  location: class RecipeInfusionAltar

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:83: error: method does not override or implement a method from a supertype

@Override

^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:91: error: cannot find symbol

arecipes.add(new CachedInfusionRecipe(is, recipe.output.copy()));

^

  symbol:  variable arecipes

  location: class RecipeInfusionAltar

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:95: error: method does not override or implement a method from a supertype

@Override

^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:100: error: method does not override or implement a method from a supertype

@Override

^

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:103: error: cannot find symbol

        drawProgressBar(40, 34, 176, 0, 14, 14, 0.0F, 7);

        ^

  symbol:  method drawProgressBar(int,int,int,int,int,int,float,int)

  location: class RecipeInfusionAltar

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:104: error: cannot find symbol

        drawProgressBar(35, 15, 176, 14, 24, 16, 35, 0);

        ^

  symbol:  method drawProgressBar(int,int,int,int,int,int,int,int)

  location: class RecipeInfusionAltar

C:\Users\Gebruiker\ChaosCraft\MCP 2\build\sources\java\Zyldra\CC2\plugins\NEI\RecipeInfusionAltar.java:107: error: method does not override or implement a method from a supertype

@Override

^

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

47 errors

1 warning

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: 8.263 secs

 

 

 

What could I do?

Link to comment
Share on other sites

This is why you should only manage your dependencies using gradle. Your IDE will (when configured properly) then pick up those dependencies automatically. NEI has a maven repository (http://chickenbones.net/maven/) which you should use.

If you don't want that, put your jars into the "libs" folder in your workspace (do not reference them manually in eclipse). ForgeGradle will then pick them up automatically.

Link to comment
Share on other sites

I placed the Maven thing insite the build but it doesn't outmaticly build it into eclipse now.

 

The build file:

 

 

buildscript {

    repositories {

        mavenCentral()

        maven {

            name = "forge"

            url = "http://files.minecraftforge.net/maven"

        }

        maven {

            name = "sonatype"

            url = "https://oss.sonatype.org/content/repositories/snapshots/"

        }

    maven {

    name 'CB Repo'

    url "http://chickenbones.net/maven/"

    }

    }

    dependencies {

        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'

    }

}

 

apply plugin: 'forge'

 

version = "2.29"

group= "Zyldra.CC2" // http://maven.apache.org/guides/mini/guide-naming-conventions.html

archivesBaseName = "CC2"

 

minecraft {

    version = "1.7.10-10.13.2.1230"

    assetDir = "eclipse/assets"

}

 

dependencies {

    // you may put jars on which you depend on in ./libs

    // or you may define them like so..

    //compile "some.group:artifact:version:classifier"

    //compile "some.group:artifact:version"

    // real examples

    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env

    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

 

    // for more info...

    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html

    // http://www.gradle.org/docs/current/userguide/dependency_management.html

 

}

 

processResources

{

    // this will ensure that this task is redone when the versions change.

    inputs.property "version", project.version

    inputs.property "mcversion", project.minecraft.version

 

    // replace stuff in mcmod.info, nothing else

    from(sourceSets.main.resources.srcDirs) {

        include 'mcmod.info'

               

        // replace version and mcversion

        expand 'version':project.version, 'mcversion':project.minecraft.version

    }

       

    // copy everything else, thats not the mcmod.info

    from(sourceSets.main.resources.srcDirs) {

        exclude 'mcmod.info'

    }

}

 

 

 

What could be the problem becouse I don't know?

Link to comment
Share on other sites

The gradlew eclipse log:

 

 

The assetDir is deprecated!  Use runDir instead! runDir set to eclipse/assets/..The assetDir is deprecated!  Use runDir instead! runDir set to eclipse/assets/..

 

****************************

Powered By MCP:           

http://mcp.ocean-labs.de/ 

Searge, ProfMobius, Fesh0r,

R4wk, ZeuX, IngisKahn, bspkrs

MCP Data version : unknown

****************************

:eclipseClasspath

:eclipseJdt

:eclipseProject

:eclipse

 

BUILD SUCCESSFUL

 

Total time: 7.63 secs

 

 

 

Could:

The assetDir is deprecated!  Use runDir instead! runDir set to eclipse/assets/..The assetDir is deprecated!  Use runDir instead! runDir set to eclipse/assets/..

Be the source?

Link to comment
Share on other sites

Maybe the 3 errors I have insite of eclips could be the problem.

I have:

Description Resource Path Location Type

Project 'Minecraft' is missing required library: 'C:\Users\Gebruiker\ChaosCraft\MCP 2\unresolved dependency - net.chickenbones CodeChickenCore 1.7.10-1.0.2.13' Minecraft Build path Build Path Problem

 

Description Resource Path Location Type

Project 'Minecraft' is missing required library: 'C:\Users\Gebruiker\ChaosCraft\MCP 2\unresolved dependency - net.chickenbones NotEnoughItems 1.7.10-1.0.2.36' Minecraft Build path Build Path Problem

 

Description Resource Path Location Type

The project cannot be built until build path errors are resolved Minecraft Unknown Java Problem

Link to comment
Share on other sites

I have now changed the build file to this:

 

 

buildscript {

    repositories {

        mavenCentral()

          maven {

            name = "forge"

            url = "http://files.minecraftforge.net/maven"

        }

        maven {

            name = "sonatype"

            url = "https://oss.sonatype.org/content/repositories/snapshots/"

        }

    }

    dependencies {

        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'

    }

}

 

repositories {

    maven {

            name "chickenbones"

            url "http://chickenbones.net/maven/"'>http://chickenbones.net/maven/"

    }

}

 

apply plugin: 'forge'

 

version = "2.29"

group= "Zyldra.CC2"

archivesBaseName = "CC2"

 

minecraft {

version = "1.7.10-10.13.2.1230"

runDir = "run"

}

 

dependencies {

    // http://files.minecraftforge.net/CodeChickenLib/

    compile "codechicken:CodeChickenLib:1.7.10-1.1.1.110:dev"

    // http://chickenbones.net/maven

    compile "codechicken:CodeChickenCore:1.7.10-1.0.4.29:dev"

    compile "codechicken:NotEnoughItems:1.7.10-1.0.4.83:dev"

}

 

processResources

{

    // this will ensure that this task is redone when the versions change.

    inputs.property "version", project.version

    inputs.property "mcversion", project.minecraft.version

 

    // replace stuff in mcmod.info, nothing else

    from(sourceSets.main.resources.srcDirs) {

        include 'mcmod.info'

               

        // replace version and mcversion

        expand 'version':project.version, 'mcversion':project.minecraft.version

    }

       

    // copy everything else, thats not the mcmod.info

    from(sourceSets.main.resources.srcDirs) {

        exclude 'mcmod.info'

    }

}

 

 

And now the game starts with Nei.

 

But it has now no src code attached.

How do I have to do that?

Link to comment
Share on other sites

That's most likely because ChickenBones (once again) did stuff not according to standards.

By default a source jar has the classifier "source", his sources have "src" though, so gradle won't attach them by default.

I don't know how to fix that, you'll probably have to dig through the gradle docs.

Link to comment
Share on other sites

  • 4 months later...

In case you are still having trouble adding the source code, just download the source code from chickenbones from NEI and CCC and add them in eclipse in lib. Next configure the build path and set the source of CCC and NEI dev jars.

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
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Post the debug.log.
    • Hello, Everytime i close minecraft i need to reinstall forge. Because i am when i press "Play" from launcher game crashes and i am getting this error in the photo.https://imgur.com/VUs9P1G So everytime i delete versions folder from minecraft folder and reinstall forge so i can start the minecraft with forge but after shutting down game i need to do the same steps again. Also i have tried to delete all the mods just to start the game with forge didn't fix the crashing error. Oh, i also want to mention that with Tlauncher everything is alright i can start the game everything and i am not getting the error the but i am getting it from the original minecraft launcher downloaded from original minecraft server.
    • report error: [16:09:34] [Server thread/WARN] [minecraft/EntityType]: Exception loading entity:  java.lang.NullPointerException: null     at net.minecraft.entity.ai.attributes.AttributeModifierManager.getAttributeValue(AttributeModifierManager.java:67) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.LivingEntity.getAttributeValue(LivingEntity.java:1849) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.LivingEntity.getMaxHealth(LivingEntity.java:1610) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:209) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.MobEntity.<init>(MobEntity.java:108) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.entity.CreatureEntity.<init>(CreatureEntity.java:13) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.AgeableEntity.<init>(AgeableEntity.java:21) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.passive.AnimalEntity.<init>(AnimalEntity.java:37) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.fsmc.classmates.animals.n7Yjy.<init>(n7Yjy.java:24) ~[main/:?] {re:classloading}     at net.minecraft.entity.EntityType.create(EntityType.java:448) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.EntityType.lambda$loadEntityUnchecked$1(EntityType.java:459) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_281] {}     at net.minecraft.entity.EntityType.loadEntityUnchecked(EntityType.java:458) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.EntityType.loadEntity(EntityType.java:516) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.EntityType.loadEntityAndExecute(EntityType.java:498) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.command.impl.SummonCommand.summonEntity(SummonCommand.java:50) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.command.impl.SummonCommand.lambda$register$1(SummonCommand.java:34) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[brigadier-1.0.17.jar:?] {re:classloading}     at net.minecraft.command.Commands.handleCommand(Commands.java:222) ~[forge:?] {re:classloading}     at net.minecraft.network.play.ServerPlayNetHandler.handleSlashCommand(ServerPlayNetHandler.java:1162) ~[forge:?] {re:classloading}     at net.minecraft.network.play.ServerPlayNetHandler.func_244548_c(ServerPlayNetHandler.java:1142) ~[forge:?] {re:classloading}     at net.minecraft.network.play.ServerPlayNetHandler.processChatMessage(ServerPlayNetHandler.java:1121) ~[forge:?] {re:classloading}     at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:40) ~[forge:?] {re:classloading}     at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:8) ~[forge:?] {re:classloading}     at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge:?] {re:classloading}     at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[forge:?] {re:classloading}     at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge:?] {re:classloading}     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:759) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:742) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:736) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:722) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:668) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281] {}
    • public class ManaOverlay extends Gui implements IIngameOverlay { private final Minecraft mc; private Font font = null; public int left_height = 39; public int right_height = 49; private RenderGameOverlayEvent eventParent; public static final ResourceLocation GUI_MANA_LOCATION = new ResourceLocation("textures/gui/icons.png"); private static final ManaOverlay INSTANCE = new ManaOverlay(Minecraft.getInstance()); public ManaOverlay(Minecraft p_93005_) { super(p_93005_); this.mc = Minecraft.getInstance(); this.font = mc.font; OverlayRegistry.registerOverlayTop("Mana ", (gui, mStack, partialTicks, screenWidth, screenHeight) -> { boolean isMounted = gui.minecraft.player.getVehicle() instanceof LivingEntity; if (!isMounted && !gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements()) { setupOverlayRenderState(true, false); renderMana(screenWidth, screenHeight, mStack); } }); } public void setupOverlayRenderState(boolean blend, boolean depthText) { setupOverlayRenderState(blend, depthText, GUI_MANA_LOCATION); } public void setupOverlayRenderState(boolean blend, boolean depthTest, @Nullable ResourceLocation texture) { if (blend) { RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); } else { RenderSystem.disableBlend(); } if (depthTest) { RenderSystem.enableDepthTest(); } else { RenderSystem.disableDepthTest(); } if (texture != null) { RenderSystem.enableTexture(); bind(texture); } else { RenderSystem.disableTexture(); } RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getPositionTexShader); } public static void init() { MinecraftForge.EVENT_BUS.register(INSTANCE); } public void renderMana(int width, int height, PoseStack mStack) { minecraft.getProfiler().push("mana"); Player player = (Player)this.minecraft.getCameraEntity(); RenderSystem.enableBlend(); int left = width / 2 + 91; int top = height - right_height ; boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic FoodData stats = minecraft.player.getFoodData(); int level = stats.getFoodLevel(); for (int i = 0; i < 10; ++i) { int idx = i * 2 + 1; int x = left - i * 8 - 9; int y = top; int icon = 16; byte background = 0; if (minecraft.player.hasEffect(MobEffects.HUNGER)) { icon += 36; background = 13; } if (unused) background = 1; //Probably should be a += 1 but vanilla never uses this if (player.getFoodData().getSaturationLevel() <= 0.0F && tickCount % (level * 3 + 1) == 0) { y = top + (random.nextInt(3) - 1); } blit(mStack, x, y, 16 + background * 9, 27, 9, 9); if (idx < level) blit(mStack, x, y, icon + 36, 27, 9, 9); else if (idx == level) blit(mStack, x, y, icon + 45, 27, 9, 9); } RenderSystem.disableBlend(); minecraft.getProfiler().pop(); } @Override public void render(ForgeIngameGui gui, PoseStack pStack, float partialTicks, int width, int height) { this.screenWidth = this.minecraft.getWindow().getGuiScaledWidth(); this.screenHeight = this.minecraft.getWindow().getGuiScaledHeight(); eventParent = new RenderGameOverlayEvent(pStack, partialTicks, this.minecraft.getWindow()); if (pre(ALL, pStack)) return; font = minecraft.font; this.random.setSeed(tickCount * 312871L); OverlayRegistry.orderedEntries().forEach(entry -> { try { if (!entry.isEnabled()) return; IIngameOverlay overlay = entry.getOverlay(); if (pre(overlay, pStack)) return; //overlay.render(this, pStack, partialTicks, screenWidth, screenHeight); post(overlay, pStack); } catch(Exception e) { } }); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); post(ALL, pStack); } private boolean pre(RenderGameOverlayEvent.ElementType type, PoseStack mStack) { return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(mStack, eventParent, type)); } private void post(RenderGameOverlayEvent.ElementType type, PoseStack mStack) { MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(mStack, eventParent, type)); } private boolean pre(IIngameOverlay overlay, PoseStack mStack) { return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PreLayer(mStack, eventParent, overlay)); } private void post(IIngameOverlay overlay, PoseStack mStack) { MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PostLayer(mStack, eventParent, overlay)); } private void bind(ResourceLocation res) { RenderSystem.setShaderTexture(0, res); } } Thanks to you, I was able to display it. However, the bar that uses the full stomach ground keeps shaking. I wonder why that is? Then I feel like it's getting heavier ...
    • It's the "Width on the screen" and "Height on the screen", so in this case the screen width and height.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.