Jump to content

[1.12] [RESOLVED] Shulker box doesn't generate


That_Martin_Guy

Recommended Posts

I am trying to generate a shulker box with a single item inside in this class. The problem is that it simply doesn't generate at all. Forge doesn't give me any related to the loot table (only rendering errors because I don't have any renderer for my items and blocks). Any ideas?

 

EDIT: A solution has been found. Feel free to look at this diff.

Edited by That_Martin_Guy
Problem has been fixed
Link to comment
Share on other sites

In class TheDarkness, you have then line:

GameRegistry.registerWorldGenerator(new WorldGenReliquaryChest(), 0);

You have set the generation weight to zero, which means there is zero chance that the world generator will generate.

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Link to comment
Share on other sites

7 hours ago, Jay Avery said:

Is the method definitely being called?

I'm not sure, I haven't messed with world generation before. I looked at Choonster's test mod while doing it, and he seemed to do something very similar to what I did.

5 hours ago, Earthcomputer said:

In class TheDarkness, you have then line:


GameRegistry.registerWorldGenerator(new WorldGenReliquaryChest(), 0);

You have set the generation weight to zero, which means there is zero chance that the world generator will generate.

Changing it to 100 doesn't work. Are you sure that is the case?

4 hours ago, diesieben07 said:

No.

That doesn't really help much :/

Link to comment
Share on other sites

Of course not.

world.getChunkFromBlockCoords(new BlockPos(spawnX >> 4, world.getSpawnPoint().getY(), spawnZ >> 4));

You said "get me a chunk from block coords" and then passed in chunk coords.

Also, the Y value is irrelevant, you should just pass 0 there rather than spending CPU cycles calculating how high up the spawn is, just to pass it into a method that gives no fucks.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

27 minutes ago, That_Martin_Guy said:

The reason I created that is because that's what diesieben told me to try it (atleast the way I interpreted it, which might be the wrong way). Besides, passing in the normal block coordinates without shift-right doesn't generate it either.

That's because you don't need getChunkFromBlockCoords at all.

All you need to do is take the spawn coordinates (in block form) and do >>4 on them to get the chunk coordinates. You don't need the chunk, all you want to know is if the current chunk has the same coordinates as the spawn chunk.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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