Jump to content

Recommended Posts

Posted

Hello!

 

I have been working on a custom biome. I edited the WorldChunkManager.java (a vanilla MC file) temporarily so find my biome easier (not sure if this was relevant to my issue or not so I decided to mention it anyways)

public static ArrayList<BiomeGenBase> allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(Base.blight));

I have no errors starting up but am getting a crash when I make a new world (link to full report below). It's a NullPointerException and none of the traceback passes through any of my files so I do not even know where to begin..

Any help is greatly appreciated!

 

Full Crash Report: http://pastebin.com/qGPA80Lr

Posted

Hi

 

Although my line numbers don't link up with yours, I'm guessing the crash is on this line in getTopSolidOrLiquidBlock

 

            if (l != 0 && Block.blocksList[l].blockMaterial.blocksMovement() && Block.blocksList[l].blockMaterial != Material.leaves && !Block.blocksList[l].isBlockFoliage(this, x, k, z))

 

Probably this means that your custom biome has added a new block but you've forgotten to initialise it, so Block.blocksList[l] is still null.

 

-TGG

Posted

Alright, I checked everything and I am positive all the blocks are initialized and I tried to run it again (having made no changes) and I get a different report.

 

Report: http://pastebin.com/KA3vBuz8

 

Exception getting block type in world. I am not sure what exactly that points to considering I have declared a type and have had no problem with bonemealing my saplings into full trees with wondrous results. Something with my WorldGenInfectedTree file has the world gen angry but I don't know what.

Posted

Hi

 

Looks like a same problem i.e. Blocks.blocksList is null

    public Material getBlockMaterial(int par1, int par2, int par3)
    {
        int l = this.getBlockId(par1, par2, par3);
        return l == 0 ? Material.air : Block.blocksList[l].blockMaterial;
    }

 

I seem to remember something that world generation must not use blocks with an ID >= 256, perhaps it is related to that (I'm really not sure).

 

Do you know how to use breakpoints in your debugger?  You could add a breakpoint on Null Pointer Exception, and when it pauses at that line, inspect which block it is trying to access.  That will probably give useful clues.

 

-TGG

Posted

I seem to remember something that world generation must not use blocks with an ID >= 256, perhaps it is related to that (I'm really not sure).

 

I knew that biome top/filler blocks were not allowed above 255, I believe it is 255 and lower because Java starts the counting at 0, 0-255 is that range of 256 ids still though. I haven't had my trees gen regularly in the overworld regularly yet (I need to do some digging because I am pretty sure they should NOT be generating in the first place lol), maybe that is what is crashing. I'll test a bit and see what I can come up with.

Posted

So I figured out what is causing the issue but why is it causing it is beyond me.

 

If I comment out

this.topBlock = (byte)Base.blockInfectedGrass.blockID;
this.fillerBlock = (byte)Base.blockInfectedDirt.blockID;

I get rid of the problem and the biome spawns without any problems. If the two lines above are incorrect slightly, it's because I manually wrote them as my laptop running eclipse is low on battery (that's what I get for not charging it)

 

The block ids are 250 (BlockInfectedGrass) and 251 (BlockInfectedDirt) so their ids are not the issue here. Somewhere while generating the world and biome with these two blocks as the top/filler blocks I am getting a null pointer. Why? I'd prefer stubbing my toe over dealing with a null pointer exception.

 

Any ideas anybody?

Posted

I am fairly certain they are but I will link a pastebin to my Base class (where I register everything).

 

Base File: http://pastebin.com/GJr0jrM1

 

A sort of long file that houses all registration and what-not. Around line 700 the block registration starts (if there are line numbers in that link that is...) and after blocks I register my biome.

 

I tried moving my registrations to my Pre Init, but had no different in my error (it seems to be giving different tracebacks each time though).

Posted

@Kriki98,

 

Because of the way vanilla biomes work, you are required to use a byte value for those two blocks. My initialization for my config declares the id of them as an integer but because of the way the BiomeGenBase class is written, the top and filler blocks are required to be byte values therefore the casting from int to byte is required.

Posted

The first thing I would suggest is: Update to 1.7 (preferably 1.7.10), It's long enough out for you to update, which also brings 2 Benefits:

- No worrying for item/block IDs as they're now handled internally.

- Biome blocks can now have an ID higher than 255

 

For figuring out how to register a biome in 1.7: http://www.minecraftforge.net/forum/index.php/topic,21466.msg108900.html#msg108900

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

I'd love to update, although this doesn't solve my problem directly. My modding partner isn't too inclined to want to update because we have a lot of work already done in 1.6.4.

 

Although with this information about biomes in 1.7 I may be able to convince him. I appreciate the suggestion as I was not aware that biomes accepted (although I had a hunch) above a byte size in 1.7. Thanks! I'll look into it and I appreciate the link!

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 I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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