Jump to content

Recommended Posts

Posted

Hi there!

I have a problem when I'm trying to create a custom rendered block and I was wishing for some help.

 

Crash log:

---- Minecraft Crash Report ----
// This doesn't make any sense!

Time: 2014-04-23 01:24
Description: Initializing game

java.lang.NullPointerException
at net.be.mods.model.LampPostModel.<init>(LampPostModel.java:59)
at net.be.mods.renderer.RendererLampPost.<init>(RendererLampPost.java:18)
at net.be.mods.MainModBE.preInit(MainModBE.java:75)
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:572)
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.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
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.sendEventToModContainer(LoadController.java:205)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:183)
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.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
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:109)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:553)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:185)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:472)
at net.minecraft.client.Minecraft.run(Minecraft.java:809)
at net.minecraft.client.main.Main.main(Main.java:93)
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:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)


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

-- Head --
Stacktrace:
at net.be.mods.model.LampPostModel.<init>(LampPostModel.java:59)
at net.be.mods.renderer.RendererLampPost.<init>(RendererLampPost.java:18)
at net.be.mods.MainModBE.preInit(MainModBE.java:75)
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:572)
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.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
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.sendEventToModContainer(LoadController.java:205)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:183)
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.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
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:109)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:553)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:185)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:472)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:809)
at net.minecraft.client.main.Main.main(Main.java:93)
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:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

-- System Details --
Details:
Minecraft Version: 1.6.4
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 922970696 bytes (880 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 v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized
FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized
Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized
beautifulexistence{Pre-alpha v0.001} [bE mods] (bin) Unloaded->Constructed->Errored
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: AMD Radeon HD 7570 GL version 4.2.11476 Compatibility Profile Context, ATI Technologies Inc.
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Pack: Default
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

 

Main Class:

@Mod(modid = MainModBE.modid, name = "BE mods", version = "Pre-alpha v0.001")
@NetworkMod(clientSideRequired = true, serverSideRequired = true)
public class MainModBE {

    public static final String modid = "beautifulexistence";

    @EventHandler
    public void preInit(FMLPreInitializationEvent e) {
    	
    	//Tile Entity
    	
        ClientRegistry.registerTileEntity(TileEntityPostLamp.class, "LampPost", new RendererLampPost());
        
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPostLamp.class, new RendererLampPost());

    public static Block blockLampPost;

    @EventHandler
    public void load(FMLInitializationEvent e)
    {

        LanguageRegistry.instance().addStringLocalization(BETab.getTranslatedTabLabel(), "BE Tab");

        blockLampPost = new blockLampPost(3006).setUnlocalizedName("blockLampPost").setHardness(4.0F).setStepSound(Block.soundMetalFootstep).setResistance(15.0F);

        GameRegistry.registerBlock(blockLampPost, modid + blockLampPost.getUnlocalizedName().substring(5));

        LanguageRegistry.addName(blockLampPost, "Lamp Post");

 

blockLampPost:

public class blockLampPost extends BlockContainer{

public blockLampPost(int id) {
	super(id, Material.rock);

	this.setLightValue(1F);
	this.setCreativeTab(MainModBE.BETab);
}

public TileEntity createNewTileEntity(World world) {
	return new TileEntityPostLamp();
}

public int getRenderType() {
	return -1;
}

public boolean isOpaqueCube() {
	return false;
}

public boolean renderAsNormalBlock() {
	return false;
}

@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister icon) {
	this.blockIcon = icon.registerIcon(MainModBE.modid + ":" + "LampPlacer");
}

}

 

LampPostModel:

public class LampPostModel extends ModelBase {

    ModelRenderer Shape1;
    ModelRenderer Shape2;
    ModelRenderer Shape3;
    ModelRenderer Shape4;
    ModelRenderer Shape5;
    ModelRenderer Shape6;
    ModelRenderer Shape7;
    ModelRenderer Shape8;
  
  public LampPostModel()
  {
    textureWidth = 64;
    textureHeight = 64;
    
      Shape1 = new ModelRenderer(this, 0, 9);
      Shape1.addBox(-1F, -1F, -1F, 2, 2, 2);
      Shape1.setRotationPoint(0F, 23F, 0F);
      Shape1.setTextureSize(64, 64);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      Shape2 = new ModelRenderer(this, 0, 14);
      Shape2.addBox(0F, 0F, 0F, 4, 1, 4);
      Shape2.setRotationPoint(-2F, 21F, -2F);
      Shape2.setTextureSize(64, 64);
      Shape2.mirror = true;
      setRotation(Shape2, 0F, 0F, 0F);
      Shape3 = new ModelRenderer(this, 15, 34);
      Shape3.addBox(0F, -5F, 0F, 1, 5, 1);
      Shape3.setRotationPoint(1F, 21.5F, -2F);
      Shape3.setTextureSize(64, 64);
      Shape3.mirror = true;
      setRotation(Shape3, 0.0872665F, 0F, 0.0872665F);
      Shape4 = new ModelRenderer(this, 10, 34);
      Shape4.addBox(0F, -5F, 0F, 1, 5, 1);
      Shape4.setRotationPoint(1F, 21.5F, 1F);
      Shape4.setTextureSize(64, 64);
      Shape4.mirror = true;
      setRotation(Shape4, -0.0872665F, 0F, 0.0872665F);
      Shape5 = new ModelRenderer(this, 5, 34);
      Shape5.addBox(0F, -5F, 0F, 1, 5, 1);
      Shape5.setRotationPoint(-2F, 21.5F, 1F);
      Shape5.setTextureSize(64, 64);
      Shape5.mirror = true;
      setRotation(Shape5, -0.0872665F, 0F, -0.0872665F);
      Shape6 = new ModelRenderer(this, 0, 34);
      Shape6.addBox(0F, -5F, 0F, 1, 5, 1);
      Shape6.setRotationPoint(-2F, 21.5F, -2F);
      Shape6.setTextureSize(64, 64);
      Shape6.mirror = true;
      setRotation(Shape6, 0.0872665F, 0F, -0.0872665F);
      Shape7.mirror = true;
      Shape7 = new ModelRenderer(this, 0, 20);
      Shape7.addBox(0F, 0F, 0F, 6, 1, 6);
      Shape7.setRotationPoint(-3F, 16F, -3F);
      Shape7.setTextureSize(64, 64);
      Shape7.mirror = true;
      setRotation(Shape7, 0F, 0F, 0F);
      Shape7.mirror = false;
      Shape8 = new ModelRenderer(this, 0, 28);
      Shape8.addBox(0F, 0F, 0F, 4, 1, 4);
      Shape8.setRotationPoint(-2F, 15F, -2F);
      Shape8.setTextureSize(64, 64);
      Shape8.mirror = true;
      setRotation(Shape8, 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);
    Shape1.render(f5);
    Shape2.render(f5);
    Shape3.render(f5);
    Shape4.render(f5);
    Shape5.render(f5);
    Shape6.render(f5);
    Shape7.render(f5);
    Shape8.render(f5);
  }
  
  public void renderModel(float f5) {
    Shape1.render(f5);
    Shape2.render(f5);
    Shape3.render(f5);
    Shape4.render(f5);
    Shape5.render(f5);
    Shape6.render(f5);
    Shape7.render(f5);
    Shape8.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);
  }
}

 

RenderLampPost:

public class RendererLampPost extends TileEntitySpecialRenderer{

private static final ResourceLocation texture = new ResourceLocation(MainModBE.modid, "textures/model/LampPost.png");

private LampPostModel model;

public RendererLampPost() {
	this.model = new LampPostModel();
}

public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {	

	GL11.glPushMatrix();
	GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
	GL11.glRotatef(180, 0F, 0F, 1F);
	this.bindTexture(texture);
	GL11.glPushMatrix();
	this.model.renderModel(0.0625F);
	GL11.glPopMatrix();
	GL11.glPopMatrix();
}
}

 

I only picked out the most important things and semi relevant stuff in the main class.

I am really stuck :/

Posted
  On 4/23/2014 at 1:54 AM, coolAlias said:

Look at your error log, it tells you exactly what and where the problem is, null pointer on line 59 of your model class.

 

Shape7.mirror = true;
Shape7 = new ModelRenderer(this, 0, 20);

 

How can you set Shape7's mirror state when it does not yet exist? :P

 

Omg... That was just ridiculously easy... Thank you:D

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

    • Maximize Savings With [acu639380] T e m u Promo Code $100 Off 2025 brings you unbeatable savings on T e m u , one of the most popular online shopping destinations. With the exclusive T e m u  Promo code (acu639380), you can unlock incredible discounts, including $100 off for new and existing users. Whether you’re a first-time shopper or a loyal customer, T e m u  ensures a seamless shopping experience with fast delivery, free shipping in 67 countries, and up to 90% off on a wide range of products. Why Choose T e m u ? T e m u  is a treasure trove of trending items at unbeatable prices. From fashion and beauty to electronics and home essentials, T e m u ’s vast collection caters to all your shopping needs. Here are some key features that make T e m u  stand out: Free shipping: Available in 67 countries. Unbeatable prices: Discounts up to 90% off. Fast delivery: Ensures your items arrive promptly. Exclusive Benefits of T e m u  Promo Code (acu639380) Using the T e m u  Promo code (acu639380) in 2025 can help you save more than ever before. Here’s a breakdown of the benefits: $100 Off for New Users: New shoppers can enjoy a flat $100 discount with the T e m u  first-time user Promo. $100 Off for Existing Users: Loyal customers can also take advantage of this substantial discount with the same code. 40% Extra Off: Apply the T e m u  Promo code (acu639380) to receive an additional 40% discount on selected products. $100 Promo Bundle: Get a $100 Promo bundle to maximize savings across multiple purchases. Free Gifts for New Users: First-time shoppers are rewarded with exclusive gifts. How to Redeem T e m u  Promo Code (acu639380) Redeeming your T e m u  Promo code (acu639380) is simple and straightforward: Visit the T e m u  website or app. Add your favorite items to your shopping cart. Enter the promo code (acu639380) at checkout. Watch the savings apply instantly! T e m u  Promos for 2025 This month is packed with incredible offers tailored for both new and existing users: For New Users: T e m u  Promo code (acu639380) $100 off: Enjoy a significant discount on your first order. T e m u  first-time user Promo: Unlock exclusive savings and free gifts. T e m u  discount code (acu639380) for 2025: Enhance your shopping experience with additional discounts. For Existing Users: T e m u  Promo code (acu639380) $100 off: Loyal customers can continue to enjoy massive savings. T e m u  Promo code (acu639380) 40% off: Apply this code for extra discounts on selected items. T e m u  Promo bundle: A $100 Promo bundle available for repeated use. Country-Specific T e m u  Promo Codes T e m u  offers regional discounts to ensure everyone can benefit from their amazing deals. Here’s how the T e m u  Promo code (acu639380) can be used worldwide: North America USA: $100 off your next purchase with T e m u  Promo code (acu639380). Canada: Enjoy a $100 discount using the same code. South America Mexico: Save 40% on selected items with T e m u  Promo code (acu639380). Brazil: Get exclusive 40% discounts on your shopping. Europe UK: Apply the T e m u  Promo code (acu639380) for $100 off. Germany: Take advantage of the $100 Promo bundle. Asia Japan: First-time users can use T e m u  new user Promo for $100 off. India: Use the Promo bundle for multiple savings. T e m u ’s New Offers in 2025 This month, T e m u  has introduced fresh deals to elevate your shopping experience. Enjoy free shipping, trending items at up to 90% off, and exclusive discounts with the T e m u  promo code (acu639380). Benefits of T e m u  Promos T e m u  Promos are designed to enhance your shopping experience. Here are the standout advantages: $100 Off: Ideal for significant savings, whether you’re a new or existing user. 40% Extra Discount: Perfect for those looking to stock up on essentials. Free Gifts: Specially curated for first-time shoppers. $100 Promo Bundle: Offers flexibility across multiple purchases. How T e m u  Makes Shopping Easy T e m u ’s user-friendly platform ensures a hassle-free shopping experience. With options like fast delivery, detailed product descriptions, and seamless payment methods, T e m u  is a one-stop shop for all your needs. FAQs about T e m u  Promo Code (acu639380) Can I combine multiple T e m u  Promo codes? No, only one Promo code can be used per transaction. However, the $100 Promo bundle can be split across multiple orders.  Is the T e m u  Promo code (acu639380) valid on all items? The code applies to a wide range of products but July exclude certain categories.  How often can I use the T e m u  Promo code (acu639380)? The usage frequency depends on the specific terms and conditions of each code. Final Thoughts T e m u  is setting new standards in online shopping with its incredible deals and discounts. With the T e m u  Promo code (acu639380), you can maximize your savings and enjoy a premium shopping experience. Whether you’re new to T e m u  or a returning customer, these offers ensure that every purchase is a win. Don’t wait—use the T e m u  promo code (acu639380) today and start saving big!
    • Typically—at least in my case—the broken datapack thing always turns out to be a broken mod. Someone else here might have a better answer for you than I do, but when that happens, I go through all my mods, disabling them one by one until I locate the culprit. It’s a headache, but it’s the only way I know how to do it.
    • Is there any mod for creating world templates for 1.20.1 forge, I found a fabric mod for such as purpose but can't seem to find one for forge. I know connector and forgeified fabric api exist but i'd prefer a forge mod to adding like 50 mods to my 200 mod modpack. Does anyone know of such a mod or is my only option using the fabric mod with connector?  
    • Please read the FAQ (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/) and post logs as described there to a site such as https://mclo.gs and post the link here.
    • I'm trying to play with the origins mod but even after adding it to the mod folder it doesn't show up in minecraft forge. I'm using 1.20.2 because that is the last update from the origins and I'm using the same version of forge.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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