Нужна помощь с мобом 1.7.10.

31
1
1
Здравствуйте,у меня возникла проблема с мобом,а точнее его регистрацией и рендерингом.

Код: Main.class

//proxy-связь;
@Mod.Instance("com.endienasg.shinkansen.Main")
public static com.endienasg.shinkansen.Main instance;
@SidedProxy(clientSide = "ClientProxy.ClientProxy", serverSide = "CommonProxy.CommonProxy")
public static CommonProxy proxy;




//creative Tab
public static final CreativeTabs tabshinkansenMod = new CreativeTabs("tabshinkansenMod"){
public Item getTabIconItem() {
return Item.getItemFromBlock(Blocks.command_block);


}
};
//info
public static final String MODID = "shinkansen";
public static final String MODNAME = "shinkansen Mod";
public static final String VERSION = "0.1.0";

//block
public static Block pipe;
public static Block wood;

//item
public static Item MyPickaxe;
public static Item Myaxe;
public static Item MyShovel;



//Mob|entity
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));
}



@EventHandler
public void preLoad(FMLPreInitializationEvent event)
{
System.out.println("Я тут");

registerEntity(E5.class, "E5", 0x00FFFF, 0x00008B);




//block
pipe = new BlockTut(Material.iron, "pipe", "iron");
wood = new BlockWood(Material.wood, "wood", "wood");

//item
MyPickaxe = new MyPickaxe()
.setUnlocalizedName("MyPickaxe");

Myaxe = new Myaxe()
.setUnlocalizedName("Myaxe");

MyShovel = new MyShovel()
.setUnlocalizedName("MyShovel");

proxy.registerRenderers();


//GameRegistry.registerItem
GameRegistry.registerItem( MyShovel, "SilverShovel");
GameRegistry.registerItem( Myaxe, "Silveraxe");
GameRegistry.registerItem( MyPickaxe, "SilverPickaxe");

}








@EventHandler
public void Load(FMLInitializationEvent event)
{















}


@EventHandler
public void postLoad(FMLPostInitializationEvent event)
{


GameRegistry.addRecipe(new ItemStack(Main.MyPickaxe, 1),


new Object[]{
"X#X",
" Y ",
" X ",

('X'),Blocks.diamond_block,
('#'),Items.nether_star,
('Y'),Items.golden_apple

});//end of repice






}

}



Код CommonProxy:
package com.endienasg.proxy;

public class CommonProxy {
public void registerRenderers()
{

}

}


Код ClientProxy
package com.endienasg.proxy;

import com.endienasg.shinkansen.E5;
import com.endienasg.shinkansen.RenderE5;

import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.client.model.ModelBiped;

public class ClientProxy extends CommonProxy{
@Override
public void registerRenderers()
{
RenderingRegistry.registerEntityRenderingHandler(E5.class, new RenderE5(new ModelBiped(), 0.5F));
}
}

Код E5.class (сам моб (планируется перенести его из разряда "Моб" -> "Вагонетка и её производные (увы я не знаю как)"
package com.endienasg.shinkansen;

import net.minecraft.entity.monster.EntityMob;
import net.minecraft.world.World;

public class E5 extends EntityMob
{
public E5(World par1World)
{
super(par1World);
}
}



Код RenderE5
package com.endienasg.shinkansen;

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

public class RenderE5 extends RenderBiped {

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

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

@Override
protected ResourceLocation getEntityTexture(Entity par1Entity)
{
return textureLocation;
}
}
 
31
1
1
Main.java:
Криво скопировал оказывается XD

package com.endienasg.shinkansen;

import javax.swing.text.html.parser.Entity;

import com.endienasg.proxy.CommonProxy;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityList;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;




@Mod(modid = Main.MODID, name = Main.MODNAME,version = Main.VERSION)

public class Main {
//proxy-связь;
@Mod.Instance("com.endienasg.shinkansen.Main")
public static com.endienasg.shinkansen.Main instance;
@SidedProxy(clientSide = "ClientProxy.ClientProxy", serverSide = "CommonProxy.CommonProxy")
public static CommonProxy proxy;




//creative Tab
public static final CreativeTabs tabshinkansenMod = new CreativeTabs("tabshinkansenMod"){
public Item getTabIconItem() {
return Item.getItemFromBlock(Blocks.command_block);


}
};
//info
public static final String MODID = "shinkansen";
public static final String MODNAME = "shinkansen Mod";
public static final String VERSION = "0.1.0";

//block
public static Block pipe;
public static Block wood;

//item
public static Item MyPickaxe;
public static Item Myaxe;
public static Item MyShovel;



//Mob|entity
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));
}



@EventHandler
public void preLoad(FMLPreInitializationEvent event)
{
System.out.println("Я тут");

registerEntity(E5.class, "E5", 0x00FFFF, 0x00008B);




//block
pipe = new BlockTut(Material.iron, "pipe", "iron");
wood = new BlockWood(Material.wood, "wood", "wood");

//item
MyPickaxe = new MyPickaxe()
.setUnlocalizedName("MyPickaxe");

Myaxe = new Myaxe()
.setUnlocalizedName("Myaxe");

MyShovel = new MyShovel()
.setUnlocalizedName("MyShovel");

proxy.registerRenderers();


//GameRegistry.registerItem
GameRegistry.registerItem( MyShovel, "SilverShovel");
GameRegistry.registerItem( Myaxe, "Silveraxe");
GameRegistry.registerItem( MyPickaxe, "SilverPickaxe");

}








@EventHandler
public void Load(FMLInitializationEvent event)
{















}


@EventHandler
public void postLoad(FMLPostInitializationEvent event)
{


GameRegistry.addRecipe(new ItemStack(Main.MyPickaxe, 1),


new Object[]{
"X#X",
" Y ",
" X ",

('X'),Blocks.diamond_block,
('#'),Items.nether_star,
('Y'),Items.golden_apple

});//end of repice






}

}
 
31
1
1
---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 25.08.20 20:14
Description: Initializing game

java.lang.NullPointerException: Initializing game
at cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:171)
at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:150)
at com.endienasg.shinkansen.Main.registerEntity(Main.java:71)
at com.endienasg.shinkansen.Main.preLoad(Main.java:82)
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:522)
at net.minecraft.client.Minecraft.run(Minecraft.java:942)
at net.minecraft.client.main.Main.main(Main.java:164)
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:171)
at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:150)
at com.endienasg.shinkansen.Main.registerEntity(Main.java:71)
at com.endienasg.shinkansen.Main.preLoad(Main.java:82)
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:522)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:942)
at net.minecraft.client.main.Main.main(Main.java:164)
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 10 (amd64) version 10.0
Java Version: 1.8.0_261, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 604329480 bytes (576 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 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] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
UCH Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
UCE shinkansen{0.1.0} [shinkansen Mod] (bin)
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 451.48' Renderer: 'GeForce GTX 1660 SUPER/PCIe/SSE2'
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: GeForce GTX 1660 SUPER/PCIe/SSE2 GL version 4.6.0 NVIDIA 451.48, NVIDIA Corporation
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: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)


Вот это выдает
 
Сверху