Краш[1.7.10]

---- Minecraft Crash Report ----
// Oh - I know what I did wrong!

Time: 08.02.16 13:49
Description: Initializing game

java.lang.NullPointerException: Initializing game
at cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:170)
at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149)
at ru.nlo_92.main.registerEntity(main.java:36)
at ru.nlo_92.main.preLoad(main.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:480)
at net.minecraft.client.Minecraft.run(Minecraft.java:878)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:170)
at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149)
at ru.nlo_92.main.registerEntity(main.java:36)
at ru.nlo_92.main.preLoad(main.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:480)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:878)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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.7.10
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_71, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 780481744 bytes (744 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
UCH FML{7.10.99.99} [Forge Mod Loader] (forgeBin-1.7.10-10.13.4.1558-1.7.10.jar) 
UCH Forge{10.13.4.1558} [Minecraft Forge] (forgeBin-1.7.10-10.13.4.1558-1.7.10.jar) 
UCE mod{1.0.0} [Super Mod] (bin) 
GL info: ' Vendor: 'Intel' Version: '4.2.0 - Build 10.18.10.3379' Renderer: 'Intel(R) HD Graphics 4400'
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: Intel(R) HD Graphics 4400 GL version 4.2.0 - Build 10.18.10.3379, Intel
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: Р СѓСЃСЃРєРёР№ (Р РѕСЃСЃРёСЏ)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)

Пожалуйста найдите ошибку и скажите где ее надо искать.
 
Прошу следывать общему кодестайлу и называть классы с большой буквы. А ещё нам нужен код, мы не ванги.
 
Вот моб:
Код:
public static void registerEntity(Class entityClass, String name, int primaryColor, int secondaryColor) 
    {
        int entityID = EntityRegistry.findGlobalUniqueEntityId();
        long seed = name.hashCode();

        EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
        EntityRegistry.registerModEntity(entityClass, name, entityID, instance, 64, 1, true);
        EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID,         primaryColor, secondaryColor)); 
Вот регистр:

Код:
registerEntity(Gopnik.class, "Gopnik", 0x00FFFF, 0x00008B);
        proxy.registerRenderers();

Прокси:

Код:
public class CommonProxy {
    
    public void registerRenderers() 
    {
        
    }

}

Код:
public class ClientProxy extends CommonProxy{
    
    @Override
    public void registerRenderers() 
    {
        RenderingRegistry.registerEntityRenderingHandler(Gopnik.class, new RenderGopnik(new ModelBiped(), 0.5F));  
    }

}
Вот класс моба:

Код:
public class Gopnik extends EntityMob{
    
    public Gopnik(World par1World)
    {
    super(par1World);
    }   

}
Вот рендер моба:

Код:
public class RenderGopnik extends RenderBiped {

    private static final ResourceLocation textureLocation = new ResourceLocation("mod:textures/entity/gopnik.png");

    public RenderGopnik(ModelBiped model, float shadowSize)   
    {
        super(model, shadowSize);   
    }

    @Override
    protected ResourceLocation getEntityTexture(Entity par1Entity)  
    {
        return textureLocation;     
    }

}
 
dimagor555 написал(а):
Код:
EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID,         primaryColor, secondaryColor)); 
Ты не задал entityID нигде.
(Gopnik.class, "Gopnik", ID, 0x00FFFF, 0x00008B)

[merge_posts_bbcode]Добавлено: 08.02.2016 17:19:59[/merge_posts_bbcode]
Dragon2488 написал(а):
Как раз Ванги - вот док-во:
P_bI_L_E_S_O_S написал(а):
Ентити делаешь?
:D
 
Потому что у тебя нет ID в переменных
Код:
registerEntity(Class entityClass, String name, int entityID, int primaryColor, int secondaryColor) 
 
Выдает за ID ошибку:

Код:
registerEntity(Gopnik.class, "Gopnik", ID, 0x00FFFF, 0x00008B);
И краш
 
Ну блин, это же должно быть число! Естественно из-за слова 'ID' краш будет. Напиши там 111
 
тьфу
[merge_posts_bbcode]Добавлено: 08.02.2016 17:39:36[/merge_posts_bbcode]

Впиши так в глав. классе:
Код:
 EntityList.addMapping(Gopnik.class, "Gopnik", 111, 0xffffff, 0x000000);
 
Вроде работает
[merge_posts_bbcode]Добавлено: 08.02.2016 18:42:18[/merge_posts_bbcode]

Да. СПС. На свалку.
 
Вангую приближение кары и просветления...
[merge_posts_bbcode]Добавлено: 08.02.2016 18:21:32[/merge_posts_bbcode]

nope, не угадал...
 
Ха, а вот у меня это не работает.
[merge_posts_bbcode]Добавлено: 27.03.2016 17:46:24[/merge_posts_bbcode]

Код:
public static void registerEntity(Class entityClass, String name, int entityID, int primaryColor, int secondaryColor)
{
    entityID = EntityRegistry.findGlobalUniqueEntityId();
    long seed = name.hashCode();

    EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
    EntityRegistry.registerModEntity(entityClass, name, entityID, instance, 64, 1, true);
    EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
}

* * * * * //тут еще много чего
@EventHandler
public void init(FMLInitializationEvent event)
{
* * * * * //тут тоже еще много чего
EntityList.addMapping(EarthElemental.class, "EarthElemental", 111, 0x834d18, 0x228b22);

RenderingRegistry.registerEntityRenderingHandler(EarthElemental.class, new EarthElementalRender(new ModelBiped(), 0.5F));
proxy.registerRenderers();


Главный класс
[merge_posts_bbcode]Добавлено: 27.03.2016 17:47:02[/merge_posts_bbcode]

Код:
package com.alchemy.alchemy;

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;

public class EarthElemental extends EntityMob
{
    public EarthElemental(World par1World)
    {
        super(par1World);

        this.getNavigator().setBreakDoors(true);
        this.tasks.addTask(1, new EntityAIBreakDoor(this));
        this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
        this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
        this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
        this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
        this.tasks.addTask(7, new EntityAILookIdle(this));
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
    }

    protected boolean isAIEnabled()
    {
        return true;
    }
 
}
Это сам моб

[merge_posts_bbcode]Добавлено: 27.03.2016 17:47:25[/merge_posts_bbcode]

Код:
package com.alchemy.alchemy;

import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

public class EarthElementalRender extends RenderBiped
{
    private static final ResourceLocation textureLocation = new ResourceLocation("textures/model/mob/earth_elemental.png");

    public EarthElementalRender(ModelBiped model, float shadowSize)
    {
        super(model, shadowSize);
    }

    @Override
    protected ResourceLocation getEntityTexture(Entity par1Entity)
    {
        return textureLocation;
    }

}
Рендер моба

[merge_posts_bbcode]Добавлено: 27.03.2016 17:47:39[/merge_posts_bbcode]

Код:
package com.alchemy.alchemy;

import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.EntityList;

public class ClientProxy extends CommonProxy
{

    @Override
    public void registerRenderers()
    {
        RenderingRegistry.registerEntityRenderingHandler(EarthElemental.class, new EarthElementalRender(new ModelBiped(), 0.5F));
    }
}
Client Proxy

[merge_posts_bbcode]Добавлено: 27.03.2016 17:47:50[/merge_posts_bbcode]

Код:
package com.alchemy.alchemy;

public class CommonProxy
{

    public void registerRenderers()
    {

    }

}
Common Proxy

[merge_posts_bbcode]Добавлено: 27.03.2016 17:47:58[/merge_posts_bbcode]

Все это все равно крашит
 
Назад
Сверху