Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So I tried to make my structure look for air blocks, then spawn it in there. My suspicion with my problem is that air blocks with the requirements are rare thus making it stack on each other. Other people doesn't seem to have this problem tho. I always see that the issue is on the Y level.

public static void generateNestUnderground(World world, Random random, int x, int z) {
	     int xzCheckDistance = 10;
	     if((random.nextInt(125)) == 1) {
	         for (int y = 55; y >= 30; y--) {
	             if (world.getBlockState(new BlockPos(x,y,z)).getBlock().isAir(world.getBlockState(new BlockPos(x,y,z)), world, new BlockPos(x,y,z))) {
	                 for (int y2 = 1; y2 <= 30; y2++) {
	                     if (world.getBlockState(new BlockPos(x,y-y2,z)).isBlockNormalCube()) {
	                         int y4 = 0;
	                         int y5 = 0;
	                         for (int x2 = 0; x2 <= xzCheckDistance; x2++) {
	                             if (world.getBlockState(new BlockPos(x-x2,y-y2+y4 +1,z)).isBlockNormalCube()) {
	                                 Boolean wall = true;
	                                 for (int y3 = 1; y3 <= 4; y3++) {
	                                     if (!world.getBlockState(new BlockPos(x-x2,y-y2+y4+1+y3,z)).isNormalCube()) {
	                                         wall = false;
	                                         y4 += y3;
	                                         break;
	                                     }
	                                 }
	                                 if (wall) {
	                                     if (world.getBlockState(new BlockPos(x - x2, y - y2 + y4, z)).isNormalCube()) {
	                                         StructureDragonNests.generate(world, new BlockPos(x - x2, y - y2 + y4, z), random);
                                       	     Utils.getLogger().info("Underground Nest here at:"  +  new BlockPos(x - x2, y - y2 + y4, z));
                                       }return;
                                   }
                               }
                           } break;
                       }
                   }
               }
           }
       }
	}
}

 

2017-09-02_11.51.41.png

2017-09-03_00.53.36.png

2017-09-03_00.53.43.png

2017-09-03_00.53.58.png

Edited by TheRPGAdventurer
screenshots

I suggest that you search for a simpler air pocket and then enlarge the pocket to accommodate your structure (or include surrounding air as part of your structure). Also, if you see stacking, then your search needs to be reprogrammed so that block-changes made by one insertion will affect the results of the next search (preventing overlap).

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

  • Author
Just now, jeffryfisher said:

I suggest that you search for a simpler air pocket and then enlarge the pocket to accommodate your structure (or include surrounding air as part of your structure). Also, if you see stacking, then your search needs to be reprogrammed so that block-changes made by one insertion will affect the results of the next search (preventing overlap).

what's the difference of isNormalCube and isBlockNormalCube?

4 hours ago, TheRPGAdventurer said:

what's the difference of isNormalCube and isBlockNormalCube?

Right click -> References -> Find in workspace -> learn

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.

  • Author
20 hours ago, Draco18s said:

Right click -> References -> Find in workspace -> learn

Another question, what is the uppermost y level of the nether(bedrock.)

1 hour ago, TheRPGAdventurer said:

Another question, what is the uppermost y level of the nether(bedrock.)

Start new game (Creative) -> Travel to the nether -> hit F3 -> Punch your way to the ceiling

 

Seriously. Learn how to figure this shit out for yourself. It's probably also on the wiki.

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.

  • Author
1 minute ago, Draco18s said:

Start new game (Creative) -> Travel to the nether -> hit F3 -> Punch your way to the ceiling

 

Seriously. Learn how to figure this shit out for yourself. It's probably also on the wiki.

My computer is kinda laggy for this sometimes, I already found the answer on the wiki. BTW! Thanks for making me learn to myself and notjust turn into some script kiddie.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.