Jump to content

Recommended Posts

Posted

Hello! I have just started modding, I've learned quite a bit of Java and decided to start my own mod. One of the items the mod is centered around I decided to create and use a 3D model for, similar to the Portal Gun mod or Modular Power Suits. I watched a tutorial about it from iChun, the creator of the Portal Gun mod. I followed his instructions and as an end result the game crashed. I messed around and found I had made a couple errors here and there. After fixing those, Eclipse showed no other errors yet I keep getting this:

 

  Reveal hidden contents

 

Some help would be greatly appreciated, I want my first mod to be a success.

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted

Hi,

first of all you need a Model for your Item or Block. The easyest way to do this is to make it with [lmgtfy]Techne[/lmgtfy] which is a programm to create minecraft model files. After that you need to apply a TileEntitySpecialRenderer to the Tileentity of your Block/Item (create the Tileentity first). The only thing you need to do then is to bind the Tileentity to your renderer with the game registry. I have done this for my mod too and it is not easy. I will upload my code later so you can see what i meant. ;)

(Don't mind my bad english)

 

Busti

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

Inn the error log you provided we can read the following:

   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
   at sypher.mps.items.ArmCannon.<init>(ArmCannon.java:27)

 

So you have a NullPointerException causing the crash. At line 27 of ArmCannon.java.

So go into the ArmCannon.java file and see what happends at line27, for some reason you are trying to do something with something which is null :)

 

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted
  On 3/27/2013 at 9:12 AM, Busti said:

Hi,

first of all you need a Model for your Item or Block. The easyest way to do this is to make it with [lmgtfy]Techne[/lmgtfy] which is a programm to create minecraft model files. After that you need to apply a TileEntitySpecialRenderer to the Tileentity of your Block/Item (create the Tileentity first). The only thing you need to do then is to bind the Tileentity to your renderer with the game registry. I have done this for my mod too and it is not easy. I will upload my code later so you can see what i meant. ;)

(Don't mind my bad english)

 

Busti

 

Thanks for the tip but I've already got a model ready, it just refuses to work. You code would be a great help though, so thanks in advance.

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted
  On 3/27/2013 at 1:07 PM, Mazetar said:

Inn the error log you provided we can read the following:

   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
   at sypher.mps.items.ArmCannon.<init>(ArmCannon.java:27)

 

So you have a NullPointerException causing the crash. At line 27 of ArmCannon.java.

So go into the ArmCannon.java file and see what happends at line27, for some reason you are trying to do something with something which is null :)

 

 

I checked there, but it was just an empty line after my closing bracket so I removed it just in case. I'm now getting a NullPointException on line 79 of the ArmCannonModel1.class, which doesn't make any sense.

 

  Reveal hidden contents

 

 

ArmCannonModel1.class:

  Reveal hidden contents

 

 

This is really starting to confuse me, so thanks for the help guys. Tell me if you need any thing else to help out.

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted

I checked one last time and I think I found it, for some reason Techne copied Front2.mirrior = true; and placed it in two separate areas. Though, when I try to equip the model I crash, I'll look into it further and try to find out what it is this time.

 

Error Code:

 

  Reveal hidden contents

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted

Please use pastebin(With syntax highlightning: Java) when posting code, then it looks like this: http://pastebin.com/b85FsjAE

Look it even got line numbers! :D

 

Looking at the pastebin, then line 79 seems okay, but since we are copy-pasting I assume the lines can have jumped up or down a line.

 

So looking at the area around line 79 you see something quite interesting:

Front2.mirror = true;
      Front2 = new ModelRenderer(this, 0, 30);
      Front2.addBox(11F, 1F, 0F, 3, 1, 1);

 

You are setting a property of Front2 before you instansiate Front2, this would cause the exception, since Front2 is null when you try to set mirror=true;

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted

That's what I found, Techne seems to have duplicated that part. I removed the first one and it fixed the issue, though now the model crashes when trying to load the texture. I'm currently working with an un-textured model to get the correct position until I can find what the texture loading is messing up, the error code is posted above. I'll make sure to post in pastebin next time, thanks for the advice.

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted
  Quote
[sTDERR] java.lang.Error: Unresolved compilation problem:

The method func_98187_b(String, int) is undefined for the type RenderEngine

 

at sypher.mps.models.ItemRenderLauncher.renderItem(ItemRenderLauncher.java:46)

 

Read the error log my friend, it tells you most of the time the source of your problem ;)

What does these two lines from the log tell you?

 

  Reveal hidden contents

 

 

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted

I'm getting the same error which doesn't make sense

 

Here's my crash report

---- Minecraft Crash Report ----
// Ouch. That hurt 

Time: 3/27/13 10:00 AM
Description: Failed to start game

java.lang.NullPointerException
at com.biosystemstudios.ClientProxy.registerRenderThings(ClientProxy.java:14)
at com.biosystemstudios.mod_MainClass.load(mod_MainClass.java:70)
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:601)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)
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:601)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
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:601)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:444)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Thread.java:722)


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

-- System Details --
Details:
Minecraft Version: 1.5.1
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_11, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 845715608 bytes (806 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
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.44 FML v5.1.8.608 Minecraft Forge 7.7.0.608 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
terestrial [Extra Terestrial Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 5450 GL version 4.2.11631 Compatibility Profile Context, ATI Technologies Inc.
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
[.

 

Here is my classes

 

ClientProxy

http://pastebin.com/s7Xc6h0n

 

BlinSwordModel

package com.biosystemstudios;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class BlinSwordModel extends ModelBase
{
//fields
public ModelRenderer Hilt2;
public ModelRenderer Hilt1;
public ModelRenderer Handle;
public ModelRenderer Bludge1;
public ModelRenderer Bludge2;
public ModelRenderer Blade1;
public ModelRenderer Blade2;
public ModelRenderer Blade3;
public ModelRenderer Shape1;

public BlinSwordModel()
{
	textureWidth = 64;
	textureHeight = 64;

	Hilt2 = new ModelRenderer(this, 0, 30);
	Hilt2.addBox(-4F, 0F, 0F, 8, 1, 1);
	Hilt2.setRotationPoint(0F, 1F, 0F);
	Hilt2.setTextureSize(64, 64);
	Hilt2.mirror = true;
	setRotation(Hilt2, 0F, 0F, 0F);
	Hilt1 = new ModelRenderer(this, 0, 30);
	Hilt1.addBox(-3F, 0F, 0F, 6, 1, 1);
	Hilt1.setRotationPoint(0F, 0F, 0F);
	Hilt1.setTextureSize(64, 64);
	Hilt1.mirror = true;
	setRotation(Hilt1, 0F, 0F, 0F);
	Handle = new ModelRenderer(this, 0, 34);
	Handle.addBox(-1F, -3F, -1F, 2, 6, 2);
	Handle.setRotationPoint(0F, 5F, 0.5F);
	Handle.setTextureSize(64, 64);
	Handle.mirror = true;
	setRotation(Handle, 0F, 0F, 0F);
	Bludge1 = new ModelRenderer(this, 25, 0);
	Bludge1.addBox(0F, 0F, 0F, 3, 2, 3);
	Bludge1.setRotationPoint(-1.5F, 8F, -1F);
	Bludge1.setTextureSize(64, 64);
	Bludge1.mirror = true;
	setRotation(Bludge1, 0F, 0F, 0F);
	Bludge2 = new ModelRenderer(this, 25, 0);
	Bludge2.addBox(0F, 0F, 0F, 2, 1, 2);
	Bludge2.setRotationPoint(-1F, 10F, -0.5F);
	Bludge2.setTextureSize(64, 64);
	Bludge2.mirror = true;
	setRotation(Bludge2, 0F, 0F, 0F);
	Blade1 = new ModelRenderer(this, 0, 0);
	Blade1.addBox(0F, 0F, 0F, 3, 16, 1);
	Blade1.setRotationPoint(-1.5F, -16F, 0F);
	Blade1.setTextureSize(64, 64);
	Blade1.mirror = true;
	setRotation(Blade1, 0F, 0F, 0F);
	Blade2 = new ModelRenderer(this, 9, 0);
	Blade2.addBox(0F, 0F, 0F, 1, 3, 1);
	Blade2.setRotationPoint(-0.25F, -18F, 0F);
	Blade2.setTextureSize(64, 64);
	Blade2.mirror = true;
	setRotation(Blade2, 0F, 0F, -0.2617994F);
	Blade3 = new ModelRenderer(this, 9, 0);
	Blade3.addBox(0F, 0F, 0F, 1, 3, 1);
	Blade3.setRotationPoint(-0.7F, -18.25F, 0F);
	Blade3.setTextureSize(64, 64);
	Blade3.mirror = true;
	setRotation(Blade3, 0F, 0F, 0.2617994F);
	Shape1 = new ModelRenderer(this, 9, 0);
	Shape1.addBox(0F, 0F, 0F, 1, 1, 1);
	Shape1.setRotationPoint(-0.5F, -17F, 0F);
	Shape1.setTextureSize(64, 64);
	Shape1.mirror = true;
	setRotation(Shape1, 0F, 0F, 0F);
}

public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
	super.render(entity, f, f1, f2, f3, f4, f5);
	setRotationAngles(f, f1, f2, f3, f4, f5, entity);
	Hilt2.render(f5);
	Hilt1.render(f5);
	Handle.render(f5);
	Bludge1.render(f5);
	Bludge2.render(f5);
	Blade1.render(f5);
	Blade2.render(f5);
	Blade3.render(f5);
	Shape1.render(f5);
}

private void setRotation(ModelRenderer model, float x, float y, float z)
{
	model.rotateAngleX = x;
	model.rotateAngleY = y;
	model.rotateAngleZ = z;
}

public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
	super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}

}

ItemRenderSword

package com.biosystemstudios;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;

public class ItemRenderSword implements IItemRenderer {

protected BlinSwordModel swordModel;

public ItemRenderSword(){
	swordModel = new BlinSwordModel();
}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
	switch(type){
	case EQUIPPED: return true;
	default: return false;
	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
	return false;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	switch(type){
	case EQUIPPED:
	{
		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture("/mods/et/textures/models/BlinSword.png");
		swordModel.render((Entity)data[1], 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0625f);
		GL11.glPopMatrix();
	}
	default:
		break;
	}
}

}

mod_MainClass

package com.biosystemstudios;

import net.minecraft.block.Block;
import net.minecraft.block.BlockSand;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "terestrial", name = "Extra Terestrial Mod", version = "0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class mod_MainClass {

@SidedProxy(clientSide = "com.biosystemstudios.ClientProxy", serverSide = "com.biosystemstudios.ServerProxy")
public static ServerProxy proxy;

//Blocks
public static Block TutBlock;
public static Block CannonBlock;
//items
public static Item BlinOreRaw;
public static Item BlinOrePure;
public static Item BlinShard;
public static Item BlinCrystal;
public static Item BlinPaxel;
public static Item GlassBox;
//Tools
public static Item BlinomiumPickaxe;
public static Item BlinomiumAxe;
public static Item BlinomiumShovel;
public static Item BlinomiumHoe;
public static Item BlinomiumSword;

//Armor
public static Item BlinHelmet;
public static Item BlinPlate;
public static Item BlinLegs;
public static Item BlinBoots;

// Pre-Init
@PreInit
public void load(FMLPreInitializationEvent PreEvent){

}

// Init
@Init
public void load(FMLInitializationEvent e){
	proxy.registerRenderThings();
	proxy.registerServerTickHandler();

	addBlocks(); 			// Blocks
	addItems();				// Items
	addTools();				// Tools
	addArmor();				// Armor
	addRecipes();			// Recipes
	addMobs();				// Mobs

	EntityEgg(EntityAlien.class, 0xFFFFFF, 0x00DD00);
	GameRegistry.registerWorldGenerator(new worldGeneratorBlinomium());
	GameRegistry.registerTileEntity(CannonTileEntity.class, "cannonTileEntity");

}

private void addBlocks(){
	TutBlock = new TutBlock(450).setHardness(1.5f).setResistance(17.0f).setUnlocalizedName("Tut Block").setLightValue(0.9f);
	CannonBlock = new CannonBlock(451).setHardness(175.0f).setResistance(20.0f).setUnlocalizedName("Cannon Block");
	MinecraftForge.setBlockHarvestLevel(TutBlock, "pickaxe", 3);
	GameRegistry.registerBlock(TutBlock, "BiosystemStudios.TutBlock");
	GameRegistry.registerBlock(CannonBlock, "BiosystemStudios.CannonBlock");
}

private void addItems(){
	BlinOreRaw = new BlinOreRaw(2000).setUnlocalizedName("Raw Blinomium Ore");
	BlinOrePure = new BlinOrePure(2001).setUnlocalizedName("Pure Blinomium Ore");
	BlinShard = new BlinShard(2002).setUnlocalizedName("Blinomium Shard");
	BlinCrystal = new BlinCrystal(2003, -6, -7.0f, false).setUnlocalizedName("Blinomium Crystal");
	GlassBox = new GlassBox(2004).setUnlocalizedName("Glass Box");
}

private void addArmor(){
	EnumArmorMaterial BlinArmorMaterial = EnumHelper.addArmorMaterial("Blinomium Armor Material", 40, new int[]{4, 9, 7, 4}, 10);

	BlinHelmet = new BlinArmor(4000, BlinArmorMaterial, proxy.addArmor("Blinomium"), 0).setUnlocalizedName("Blin Helmet");
	BlinPlate = new BlinArmor(4001, BlinArmorMaterial, proxy.addArmor("Blinomium"), 1).setUnlocalizedName("Blin Plate");
	BlinLegs = new BlinArmor(4002, BlinArmorMaterial, proxy.addArmor("Blinomium"), 2).setUnlocalizedName("Blin Legs");
	BlinBoots = new BlinArmor(4003, BlinArmorMaterial, proxy.addArmor("Blinomium"), 3).setUnlocalizedName("Blin Boots");
}

private void addTools(){
	EnumToolMaterial BlinomiumTool = EnumHelper.addToolMaterial("Blinomium Material", 2, 6400, 24.0f, 8, 10);

	BlinomiumPickaxe = new BlinomiumPickaxe(3000, BlinomiumTool).setUnlocalizedName("Blinomium Pickaxe");
	BlinomiumAxe = new BlinomiumAxe(3001, BlinomiumTool).setUnlocalizedName("Blinomium Axe");
	BlinomiumShovel = new BlinomiumShovel(3002, BlinomiumTool).setUnlocalizedName("Blinomium Spade");
	BlinomiumHoe = new BlinomiumHoe(3003, BlinomiumTool).setUnlocalizedName("Blinomium Hoe");
	BlinomiumSword = new BlinomiumSword(3004, BlinomiumTool).setUnlocalizedName("Blinomium Sword").setFull3D();
	BlinPaxel = new BlinomiumPaxel(3005, BlinomiumTool).setUnlocalizedName("Blinomium Paxel");
}

private void addMobs(){
	EntityRegistry.registerModEntity(EntityAlien.class, "AlienEntity", 1, this, 80, 5, true);
	EntityRegistry.addSpawn(EntityAlien.class, 10, 1, 3, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.desert, 
																					BiomeGenBase.extremeHills, BiomeGenBase.forest,
																					BiomeGenBase.jungle, BiomeGenBase.plains,
																					BiomeGenBase.taiga, BiomeGenBase.taigaHills);
	LanguageRegistry.instance().addStringLocalization("entity.terestrial.AlienEntity.name", "Alien Entity");
}

private void registerItemNames(){
	LanguageRegistry.addName(TutBlock, "Raw Blinomium Ore");
	LanguageRegistry.addName(BlinOreRaw, "Impure Blinomium Ore");
	LanguageRegistry.addName(BlinOrePure, "Blinomium Ingot");
	LanguageRegistry.addName(BlinomiumPickaxe, "Blinomium Pickaxe");
	LanguageRegistry.addName(BlinomiumAxe, "Blinomium Axe");
	LanguageRegistry.addName(BlinomiumShovel, "Blinomium Shovel");
	LanguageRegistry.addName(BlinomiumHoe, "Blinomium Hoe");
	LanguageRegistry.addName(BlinomiumSword, "Blinomium Sword");
	LanguageRegistry.addName(BlinHelmet, "Blinomium Helmet");
	LanguageRegistry.addName(BlinPlate, "Blinomium Plate");
	LanguageRegistry.addName(BlinLegs, "Blinomium Legs");
	LanguageRegistry.addName(BlinBoots, "Blinomium Boots");
	LanguageRegistry.addName(BlinShard, "Blinomium Shard");
	LanguageRegistry.addName(BlinCrystal, "Blinomium Crystal");
	LanguageRegistry.addName(CannonBlock, "Cannon");
	LanguageRegistry.addName(BlinPaxel, "Ultimate Blinomium Tool");
	LanguageRegistry.addName(GlassBox, "Uncharged Cannon");
}

private void addRecipes(){

	//Recipes
	//  Tools
	GameRegistry.addRecipe(new ItemStack(this.BlinomiumPickaxe, 1), new Object[]{ 
		"BBB", " S ", " S ", 'B', this.BlinOrePure, 'S', Item.stick
	});
	GameRegistry.addRecipe(new ItemStack(this.BlinomiumSword, 1), new Object[]{
		" B ", " B ", " S ", 'B', this.BlinOrePure, 'S', Item.stick
	});
	GameRegistry.addRecipe(new ItemStack(this.BlinomiumAxe, 1), new Object[]{
		"BB ","BS ", " S ", 'B', this.BlinOrePure, 'S', Item.stick
	});
	GameRegistry.addRecipe(new ItemStack(this.BlinomiumShovel, 1), new Object[]{
		" B ", " S ", " S ", 'B', this.BlinOrePure, 'S', Item.stick
	});
	GameRegistry.addRecipe(new ItemStack(this.BlinomiumHoe, 1), new Object[]{
		"BB ", " S ", " S ", 'B', this.BlinOrePure, 'S', Item.stick
	});

	//  Armors
	GameRegistry.addRecipe(new ItemStack(this.BlinHelmet, 1), new Object[] {
		"BBB", "B B", "   ", 'B', this.BlinOrePure
	});
	GameRegistry.addRecipe(new ItemStack(this.BlinPlate, 1), new Object[]{
		"b b", "bbb", "bbb", 'b', this.BlinOrePure
	});
	GameRegistry.addRecipe(new ItemStack(this.BlinLegs, 1), new Object[]{
		"bbb", "b b", "b b", 'b', this.BlinOrePure
	});
	GameRegistry.addRecipe(new ItemStack(this.BlinBoots, 1), new Object[]{
		"   ", "b b", "b b", 'b', this.BlinOrePure
	});

	//Smelting Recipes
	GameRegistry.addSmelting(this.TutBlock.blockID, new ItemStack(this.BlinOreRaw, 1), 10.0f);
	GameRegistry.addSmelting(this.BlinOreRaw.itemID , new ItemStack(this.BlinOrePure, 1), 10.0f);

	/*GameRegistry.addRecipe(new ItemStack(this.BlinOrePure, 1), new Object[]{
		"r", 'r', (new ItemStack(mod_MainClass.BlinOreRaw, 1, -1))
	});*/


	//Misc. Recipes
	GameRegistry.addRecipe(new ItemStack(this.BlinCrystal, 1), new Object[]{
		"ss", "ss", 's', this.BlinShard
	});
	GameRegistry.addShapelessRecipe(new ItemStack(this.CannonBlock, 1), new Object[]{
		this.BlinCrystal, this.GlassBox
	});
	GameRegistry.addRecipe(new ItemStack(this.GlassBox, 1), new Object[]{
		"iii","i p", "iii", 'i', Item.ingotIron, 'p', Block.thinGlass
	});
}

public static int getUniqueID(){
	int EntityId = 300;
	do{
		EntityId++;
	}while(EntityList.getStringFromID(EntityId) != null);

	return EntityId;
}

public static void EntityEgg(Class<? extends Entity > entity, int primaryColor, int secondaryColor){
	int id = getUniqueID();
	EntityList.IDtoClassMapping.put(id, entity);
	EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}


// Post Load
@PostInit
public void PostLoad(FMLPostInitializationEvent PostEvent){
	registerItemNames();	//Item Names
}
}

 

 

Not quite sure why I am getting a null pointer exception. I have my itemID and the ItemRender class in there. Not sure why I'm crashing

Bumper Cars!

Posted

have you put this string of code in your model?

 

public void renderModel(float f1)

  {

    YOURMODELPART1.render(f1);      //Should be your model part ex: arm1, arm2, leg2//

    YOURMODELPART2.render(f1);

    YOURMODELPART3.render(f1);

 

    //etc....//

 

  }

 

PS: i'm sure that Mazetar (the post up mine) didn't do that... for you, well, i don't have your source

Actually i don't know what to write in this signature soooo.... anyway

Posted
  On 3/27/2013 at 5:21 PM, Alesimula said:

have you put this string of code in your model?

 

public void renderModel(float f1)

  {

    YOURMODELPART1.render(f1);      //Should be your model part ex: arm1, arm2, leg2//

    YOURMODELPART2.render(f1);

    YOURMODELPART3.render(f1);

 

    //etc....//

 

  }

 

PS: i'm sure that Mazetar (the post up mine) didn't do that... for you, well, i don't have your source

 

Not sure if you were referring to me because I have listed all my source code and it's not renderModel it's just render

Bumper Cars!

Posted
  On 3/27/2013 at 5:42 PM, ThatBenderGuy said:

  Quote

have you put this string of code in your model?

 

public void renderModel(float f1)

  {

    YOURMODELPART1.render(f1);      //Should be your model part ex: arm1, arm2, leg2//

    YOURMODELPART2.render(f1);

    YOURMODELPART3.render(f1);

 

    //etc....//

 

  }

 

PS: i'm sure that Mazetar (the post up mine) didn't do that... for you, well, i don't have your source

 

Not sure if you were referring to me because I have listed all my source code and it's not renderModel it's just render

 

 

No, there are two codes: render and renderModel, and when you make a custom block model (but not in an entity model) you should do renderModel too

Actually i don't know what to write in this signature soooo.... anyway

Posted
  On 3/27/2013 at 5:45 PM, Alesimula said:

  Quote

  Quote

have you put this string of code in your model?

 

public void renderModel(float f1)

  {

    YOURMODELPART1.render(f1);      //Should be your model part ex: arm1, arm2, leg2//

    YOURMODELPART2.render(f1);

    YOURMODELPART3.render(f1);

 

    //etc....//

 

  }

 

PS: i'm sure that Mazetar (the post up mine) didn't do that... for you, well, i don't have your source

 

Not sure if you were referring to me because I have listed all my source code and it's not renderModel it's just render

 

 

No, there are two codes: render and renderModel, and when you make a custom block model (but not in an entity model) you should do renderModel too

 

Oh well I dont have "renderModels" in my code but here is how I fixed it

 

I had my addTools method before my proxy.registerRenderThings method thus It was trying to obtain

 

here is my new source code for my @Init load method

@Init
public void load(FMLInitializationEvent e){
	addBlocks(); 
	addItems();
	addTools();     // <- Notice how this method
	addArmor();
	addRecipes();
	addMobs();
	proxy.registerRenderThings(); // <- is now BEFORE this method
	proxy.registerServerTickHandler();

	EntityEgg(EntityAlien.class, 0xFFFFFF, 0x00DD00);
	GameRegistry.registerWorldGenerator(new worldGeneratorBlinomium());
	GameRegistry.registerTileEntity(CannonTileEntity.class, "cannonTileEntity");

}

Bumper Cars!

Posted
  On 3/27/2013 at 5:13 PM, ThatBenderGuy said:

I'm getting the same error which doesn't make sense

 

Here's my crash report

---- Minecraft Crash Report ----
// Ouch. That hurt 

Time: 3/27/13 10:00 AM
Description: Failed to start game

java.lang.NullPointerException
at com.biosystemstudios.ClientProxy.registerRenderThings(ClientProxy.java:14)
at com.biosystemstudios.mod_MainClass.load(mod_MainClass.java:70)

 

No you don't have the same problem, yours is totally different. He's error is a method being undefined.

And yours is clearly an Null Pointer Exception -_-

 

It's located inn your client proxy's line number 14.

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted
  On 3/27/2013 at 3:56 PM, Mazetar said:

 

  Reveal hidden contents

 

Yes, I know what the error message is telling me. Clicking on the error in Eclipse takes you straight to the problematic line. My main problem is I don't know what is going wrong, how is the string undefined? This is the line that's supposed to add the texture to the model, it works fine without it except for being half invisible and made of books and apples. Here's the source code: http://pastebin.com/br2H3wgm

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted

It means that here is no such method, called "func_98187_b" inside RenderEngine.

Since your tutorial says there is, I would assume it did exist earlier but now has been renamed.

I'm not familiar with rendering code so I'm not sure what it's renamed too but that should be possible to find out :)

 

 

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted

I messed around with the code and looked into the renderEngine class fine, I believe that func_98187_b has been replaced with bindTexture. The game no longer crashes when it renders the texture, however, the texture comes up as white with black stripes, like the missing texture thing. I think that I'm using the wrong string import for bindTexture, but I'm not sure. Currently using

Minecraft.getMinecraft().renderEngine.bindTexture("/mps/models/ArmCannonTexture.png");

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted

Okay, the texture still has shown up so I believe that I'm using the wrong string. On a much worse note, I found out that the model was too long so I shortened it and added some parts, now I get this error:

 

  Reveal hidden contents

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted

I can't figure how to get the model to work with parts, so I removed them in the end. It works fine now, though the texture is still giving my errors. I tested a lot and I'm positive that bindTexture is what replaced func_(randomnumber)_b, though I still have trouble with how to tell it where the texture file is.

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Posted

Okay, after more testing I've figured it out! The correct code is now:

Minecraft.getMinecraft().renderEngine.bindTexture("/mods/<ModName>/<Any Additional Folders, (models/textures, etc.) /<TextureName>.png");

This will render the models texture! The topic is now officially solved.

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When you name a method like that, with no return value, it is a constructor. The constructor must have the same name as the class it constructs, in this case, ModItems. I would strongly advise reading up on some basic Java tutorials, because you will definitely be running into a lot more issues as you go along without the basics. *I should also add that the Forge documentation is a reference, not a tutorial. Even following tutorials, you should know Java basics, otherwise the smallest of mistakes will trip you up as you copy someone elses code.
    • so, I'm starting modding and I'm following the official documantation for forge: https://docs.minecraftforge.net, but in the registries part it is not working as it is in the docs:   public class ModItems { private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, DarkStarvation.MOD_ID); public static final RegistryObject<Item> TEST_ITEM = ITEMS.register("test_item", () -> new Item(new Item.Properties())); public DarkStarvation(FMLJavaModLoadingContext context) { ITEMS.register(context.getModEventBus()); } } in 'public DarkStarvation(...' the DarkStarvation has this error: Invalid method declaration; return type required and the getModEventBus(): Cannot resolve method 'getModEventBus' in 'FMLJavaModLoadingContext' please help, I asked gpt but it is saying that I'm using an old method, but I'm following the latest version of Forge Docs???
    • I merged your second post with the original , there is no need to post a new thread asking for an answer. If someone sees your post and can help, they will reply. If you are seeking a quicker response, you could try asking in the Minecraft Forge diacord.
    • Create a new instance and start with cobblemon - if this works, add the rest of your mods in groups   Maybe another mod is conflicting - like Sodium/Iris or Radical Cobblemon Trainers
    • https://forums.minecraftforge.net/topic/157393-1201-forge-rocket-flame-particle-trail-moves-up-and-crashes-into-the-rocket-during-flight/#comment-584134
  • Topics

×
×
  • Create New...

Important Information

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