Jump to content

java.lang.NullPointerException error


Qunergy

Recommended Posts

 

 

Sorry for my bad english

I had a problem.

Here's the source code (Api Forge 1.8): http://vk.com/doc314307403_413247164

If you delete the line CreateItem(...) at CreateSword() and add GameRegistry.registerItem(...) everything works.

And if you remove the rendering, it all works.

This log(error information I've highlighted in bold):

 

Executing: gradle :runClient

 

 

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

Powered By MCP:           

http://modcoderpack.com/   

Searge, ProfMobius, Fesh0r,

R4wk, ZeuX, IngisKahn, bspkrs

MCP Data version : snapshot_20141130

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

:compileApiJava UP-TO-DATE

:processApiResources UP-TO-DATE

:apiClasses UP-TO-DATE

:sourceMainJava

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

C:\Source\IllusoryWorld\forge\build\sources\java\aquinary\illusory\Core.java:23: error: unmappable character for encoding Cp1251

//Р?нформация Рѕ РјРѕРґРµ

  ^

C:\Source\IllusoryWorld\forge\build\sources\java\aquinary\illusory\item\sword\BasicSword.java:73: error: unmappable character for encoding Cp1251

    //Р?нициализация всех мечай

      ^

1 warning

:compileJava

:processResources UP-TO-DATE

:classes

:jar

:getVersionJson

:extractUserDev UP-TO-DATE

:extractNatives UP-TO-DATE

:getAssetsIndex

:getAssets

:makeStart

[ant:javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6

[ant:javac] 1 warning

:runClient

[02:33:43] [main/INFO] [GradleStart]: Extra: []

[02:33:43] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --accessToken, {REDACTED}, --assetIndex, 1.8, --assetsDir, C:/Users/Quiner/.gradle/caches/minecraft/assets, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[02:33:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[02:33:43] [main/INFO] [FML]: Forge Mod Loader version 8.0.37.1334 for Minecraft 1.8 loading

[02:33:43] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_79, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jdk1.7.0_79\jre

[02:33:43] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[02:33:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[02:33:43] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[02:33:43] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[02:33:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[02:33:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[02:33:43] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[02:33:45] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[02:33:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[02:33:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[02:33:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[02:33:46] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[02:33:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[02:33:46] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[02:33:47] [Client thread/INFO]: Setting user: Player0

[02:33:51] [Client thread/INFO]: LWJGL Version: 2.9.1

[02:33:52] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[02:33:52] [Client thread/INFO] [FML]: MinecraftForge v11.14.1.1334 Initialized

[02:33:52] [Client thread/INFO] [FML]: Replaced 204 ore recipies

[02:33:53] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[02:33:53] [Client thread/INFO] [FML]: Searching C:\Source\IllusoryWorld\forge\eclipse\mods for mods

[02:33:55] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[02:33:55] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, illusory] at CLIENT

[02:33:55] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, illusory] at SERVER

[02:33:56] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Illusory World

[02:33:56] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[02:33:56] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

[02:33:56] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[02:33:56] [Client thread/INFO] [FML]: Applying holder lookups

[02:33:56] [Client thread/INFO] [FML]: Holder lookups applied

[02:33:57] [sound Library Loader/INFO]: Starting up SoundSystem...

[02:33:58] [Thread-7/INFO]: Initializing LWJGL OpenAL

[02:33:58] [Thread-7/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[02:33:59] [Thread-7/INFO]: OpenAL initialized.

[02:33:59] [sound Library Loader/INFO]: Sound engine started

[02:34:06] [Client thread/INFO]: Created: 512x512 textures-atlas

[02:34:07] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue

[02:34:07] [Client thread/ERROR] [FML]:

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML{8.0.37.1334} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized->Initialized

Forge{11.14.1.1334} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized->Initialized

illusory{0.0.0} [illusory World] (modid-1.0.jar) Unloaded->Constructed->Pre-initialized->Errored

[02:34:07] [Client thread/ERROR] [FML]: The following problems were captured during this phase

[02:34:07] [Client thread/ERROR] [FML]: Caught exception from illusory

java.lang.NullPointerException

at aquinary.illusory.item.RenderItem.RenderItem(RenderItem.java:28) ~[modid-1.0.jar:?]

at aquinary.illusory.item.sword.BasicSword.RenderSword(BasicSword.java:85) ~[modid-1.0.jar:?]

at aquinary.illusory.proxy.Common.init(Common.java:28) ~[modid-1.0.jar:?]

at aquinary.illusory.proxy.Client.init(Client.java:30) ~[modid-1.0.jar:?]

at aquinary.illusory.Core.init(Core.java:53) ~[modid-1.0.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]

at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) ~[forgeSrc-1.8-11.14.1.1334.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[forgeSrc-1.8-11.14.1.1334.jar:?]

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[forgeSrc-1.8-11.14.1.1334.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?]

at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692) [Loader.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:521) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

[02:34:07] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: ---- Minecraft Crash Report ----

// Who set us up the TNT?

 

 

Time: 19.08.15 2:34

Description: Initializing game

 

 

java.lang.NullPointerException: Initializing game

at aquinary.illusory.item.RenderItem.RenderItem(RenderItem.java:28)

at aquinary.illusory.item.sword.BasicSword.RenderSword(BasicSword.java:85)

at aquinary.illusory.proxy.Common.init(Common.java:28)

at aquinary.illusory.proxy.Client.init(Client.java:30)

at aquinary.illusory.Core.init(Core.java:53)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)

at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692)

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:521)

at net.minecraft.client.Minecraft.run(Minecraft.java:356)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

 

-- Head --

Stacktrace:

at aquinary.illusory.item.RenderItem.RenderItem(RenderItem.java:28)

at aquinary.illusory.item.sword.BasicSword.RenderSword(BasicSword.java:85)

at aquinary.illusory.proxy.Common.init(Common.java:28)

at aquinary.illusory.proxy.Client.init(Client.java:30)

at aquinary.illusory.Core.init(Core.java:53)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)

at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692)

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:521)

 

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:356)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

-- System Details --

Details:

Minecraft Version: 1.8

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.7.0_79, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 152827752 bytes (145 MB) / 287309824 bytes (274 MB) up to 824180736 bytes (786 MB)

JVM Flags: 0 total;

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.10 FML v8.0.37.1334 Minecraft Forge 11.14.1.1334 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML{8.0.37.1334} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized->Initialized

Forge{11.14.1.1334} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized->Initialized

illusory{0.0.0} [illusory World] (modid-1.0.jar) Unloaded->Constructed->Pre-initialized->Errored

Loaded coremods (and transformers):

Launched Version: 1.8

LWJGL: 2.9.1

OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.4252, Intel

GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

 

 

Using VBOs: No

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

[02:34:07] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Source\IllusoryWorld\forge\eclipse\.\crash-reports\crash-2015-08-19_02.34.07-client.txt

AL lib: (EE) alc_cleanup: 1 device not closed

:runClient FAILED

 

 

FAILURE: Build failed with an exception.

 

 

* What went wrong:

Execution failed for task ':runClient'.

> Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value -1

 

 

* 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: 34.357 secs

 

 

 

 

 

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

 

Link to comment
Share on other sites

I did download it though to see what you are doing and you are going at it all wrong in your client proxy class.

 

public class Client extends Common
{
    
    @Override
    public void preInit(FMLPreInitializationEvent event)
    {
        super.preInit(event);


        RenderItem.preInit();
     }
   
    @Override
    public void init(FMLInitializationEvent event)
    {
        super.init(event);
        BasicSword.RenderSword();
    }
    
    @Override 
    public void postInit(FMLPostInitializationEvent event)
    {
        super.postInit(event);    
    }
}

 

@Override

    public void preInit(FMLPreInitializationEvent event)

    {

        super.preInit(event);

 

      [glow=red,2,300] //you need to register item first here not in your Item class[/glow]

 

        RenderItem.preInit();

    }

 

There is plenty more issues that I have noticed at least from how I code. If you register the item in your client proxy before you do your rendering it should fix your null pointer problem. 

~SureShotM/Leo~ gaming coding all around fun!

Link to comment
Share on other sites

This?

public void preInit(FMLPreInitializationEvent event)
    {
        super.preInit(event);
         
        RenderItem.preInit();
        BasicSword.CreateSword();
     }

, after delete BasicSword.CreateSword() in Common.java due to an error 

Not work :( (

Link to comment
Share on other sites

This?

public void preInit(FMLPreInitializationEvent event)
    {
        super.preInit(event);
         
        RenderItem.preInit();
        BasicSword.CreateSword();
     }

, after delete BasicSword.CreateSword() in Common.java due to an error 

Not work :( (

 

No not like that.

 

public void preInit(FMLPreInitializationEvent event)
    {
        super.preInit(event);
         
        GameRegistry.registerItem(yourItem, nameOfItemasString);
        RenderItem.preInit();
     }

 

You need to register the item before it can render.

I suggest if you know java to look for some tutorials, if you do not know java I suggest you learn java.

My other tip to you is to look at github to see how other moders set up there environments since each one has different ways.

~SureShotM/Leo~ gaming coding all around fun!

Link to comment
Share on other sites

I did so, but I do not like.

Why is the method through the function will not work? I have noticed that even if the write

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(BasicSword.wood_stone_sword, 0, new ModelResourceLocation(Core.MODID + ":" + BasicSword.wood_stone_sword.getUnlocalizedName().substring(5), "inventory"))  then it just is not working. Why? oO

Link to comment
Share on other sites

I do not use that at all and will not be able to help, but so the others can help you more then I can, here is his code.

 

ItemClass:

 

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package aquinary.illusory.item.sword;

import static aquinary.illusory.item.RegisterItem.CreateItem;
import aquinary.illusory.item.RenderItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSword;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

/**
*
* @author Aquinary
*/


public class BasicSword extends ItemSword
{
    
    /* Оружие */
    public static Item wood_iron_sword;
    public static Item wood_stone_sword;
    public static Item wood_gold_sword;
    public static Item wood_diamond_sword;
    
    public static Item stone_wood_sword;
    public static Item stone_iron_sword;
    public static Item stone_gold_sword;
    public static Item stone_diamond_sword;
    
    public static Item iron_wood_sword;
    public static Item iron_stone_sword;
    public static Item iron_gold_sword;
    public static Item iron_diamond_sword;
    
    public static Item gold_wood_sword;
    public static Item gold_stone_sword;
    public static Item gold_iron_sword;
    public static Item gold_diamond_sword;
    
    public static Item diamond_wood_sword;
    public static Item diamond_stone_sword;
    public static Item diamond_iron_sword;
    public static Item diamond_diamond_sword;
    
    /* Матерьялы */
    
    public static ToolMaterial wood_stone_sword_material = EnumHelper.addToolMaterial("wood_stone_material", 0, 500, 1.0F, 3.0F, 18);
    public static ToolMaterial wood_iron_sword_material = EnumHelper.addToolMaterial("wood_stone_material", 0, 500, 1.0F, 3.0F, 18);
    public static ToolMaterial wood_gold_sword_material = EnumHelper.addToolMaterial("wood_stone_material", 0, 500, 1.0F, 3.0F, 18);
    public static ToolMaterial wood_diamond_sword_material = EnumHelper.addToolMaterial("wood_stone_material", 0, 500, 1.0F, 3.0F, 18);

    public static void preInit() 
    {
      
    }

       
   
    
    public BasicSword(String uName, ToolMaterial material) 
    {
        super(material);
        this.setUnlocalizedName(uName);
        this.setCreativeTab(CreativeTabs.tabCombat);        
    }
    
    //Инициализация всех мечай
    public static void CreateSword()
    {
        //if delete this string, and...
        CreateItem("wood_stone_sword", BasicSword.wood_stone_sword, BasicSword.wood_stone_sword_material); 
        //uncomment, this work! o_O
        //GameRegistry.registerItem(BasicSword.wood_stone_sword = new BasicSword("wood_stone_sword", BasicSword.wood_stone_sword_material), "wood_stone_sword");
    }
    
    //Рендеринг мечей
    public static void RenderSword()
    {
        RenderItem.RenderItem(wood_stone_sword);
    }   
}

 

 

Client Proxy:

 

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package aquinary.illusory.proxy;

import aquinary.illusory.item.RenderItem;
import aquinary.illusory.item.sword.BasicSword;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
/**
*
* @author Aquinary
*/
public class Client extends Common
{
    
    @Override
    public void preInit(FMLPreInitializationEvent event)
    {
        super.preInit(event);
        RenderItem.preInit();
     }
   
    @Override
    public void init(FMLInitializationEvent event)
    {
        super.init(event);
        BasicSword.RenderSword();
    }
    
    @Override 
    public void postInit(FMLPostInitializationEvent event)
    {
        super.postInit(event);    
    }
}

 

 

Register Item class:

 

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package aquinary.illusory.item;

import aquinary.illusory.item.sword.BasicSword;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.fml.common.registry.GameRegistry;

/**
*
* @author Aquinary
*/
public class RegisterItem 
{
    public static void CreateItem(String uName, Item item, ToolMaterial material)
    {
        GameRegistry.registerItem(item = new BasicSword(uName, material),uName); 
    }
}

 

 

Render Item class:

 

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package aquinary.illusory.item;

import aquinary.illusory.Core;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;

/**
*
* @author Aquinary
*/
public final class RenderItem 
{
    
   public static void preInit() 
   {
        
   }
   

    public static void RenderItem(Item item)
    {
       Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Core.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
    }

}

 

 

I understood what the null pointer was but the rest is confusing me.

~SureShotM/Leo~ gaming coding all around fun!

Link to comment
Share on other sites

Where's the main class? Is anything actually calling proxy.preinit(...) so that the registration happens?

 

As usual for such threads, I recommend setting a break point ahead of the crash (and maybe ahead of your entire mod's construction) and re-running in the debugger so you can walk through everything you *think* it is doing. When your program does something unexpected (or skips something critical), it's usually painfully obvious and easy to fix.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.