TheRPGAdventurer Posted September 21, 2017 Share Posted September 21, 2017 (edited) We do know that there is a big roof in the nether and it is the highest y level in the nether right? I need a Y level that can adapt below the roof in the nether. Which one is it? Edited September 21, 2017 by TheRPGAdventurer Mistaken title Quote Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 22, 2017 Author Share Posted September 22, 2017 Do you know something that goes with a BlockPos? I need that because when i make my dragon fly by pressing space, it needs an altitude in order to lift off. When I fly it in a place and there is a Block above like the nether, it just jumps upward without liftoff trying to get the heighest height possible then the minecraft:block above blocks it. /** * Returns the distance to the ground while the entity is flying. */ public double getAltitude() { BlockPos groundPos = world.getHeight(getPosition()); return posY - groundPos.getY(); } Quote Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 24, 2017 Author Share Posted September 24, 2017 On 9/23/2017 at 0:07 AM, diesieben07 said: First of all, I correct my previous post, you should use World::getActualHeight. Then, I have no idea what you are trying to say. Why is getActualHeight not the thing for you? Ok, I thought no one was replying I'm gonna present a video and explain the problem. Quote Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 24, 2017 Author Share Posted September 24, 2017 The problem is that when I liftoff and there is a block above like in the nether, it would just try to reach that height because the getHeight() method finds the highest possible solid block but then gets blocked by the blocks solidity. I changed my code btw to fit in with integers. public double getAltitude() { int blockX = (int) (posX - 0.5); int blockZ = (int) (posZ - 0.5); return posY - world.getHeight(blockX, blockZ); } Quote Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 27, 2017 Author Share Posted September 27, 2017 (edited) Just now, diesieben07 said: So you are still using getHeight, not getActualHeight. yes, the get actual height one will make the dragon jump high until it reaches "y 256" before spreading it's wings, because of |"return nether ? 128:256; "| Got a better Y coords because Im trying to make a custom one as an alternative, any advices? Edited September 27, 2017 by TheRPGAdventurer wrong grammar changed "to" to before Quote Link to comment Share on other sites More sharing options...
jeffryfisher Posted September 27, 2017 Share Posted September 27, 2017 Ah, the Nether is tricky because the normal gaming space is all enclosed. I think the OP's problem is that a flying algorithm written for an open-sky dimension (such as the End) will try to get above the Nether's bedrock ceiling. There's not much up there except patches of mushrooms (and the occasional zombie-pigman grinder ). @TheRPGAdventurer, I think you will want to write your own custom method to detect large open spaces within the nether. You'll probably also want your dragon to fly through netherrack without destroying it (the way vanilla dragons fly through endstone). You have some logic to work out, but you might find hints in the projects of others who have built villages in the nether (so they also had to figure out how to detect open spaces and where there floors were). Try searching out discussions and code from those other projects both here and at github. Quote 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. Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 28, 2017 Author Share Posted September 28, 2017 Just now, jeffryfisher said: Ah, the Nether is tricky because the normal gaming space is all enclosed. I think the OP's problem is that a flying algorithm written for an open-sky dimension (such as the End) will try to get above the Nether's bedrock ceiling. There's not much up there except patches of mushrooms (and the occasional zombie-pigman grinder ). @TheRPGAdventurer, I think you will want to write your own custom method to detect large open spaces within the nether. You'll probably also want your dragon to fly through netherrack without destroying it (the way vanilla dragons fly through endstone). You have some logic to work out, but you might find hints in the projects of others who have built villages in the nether (so they also had to figure out how to detect open spaces and where there floors were). Try searching out discussions and code from those other projects both here and at github. thanks for the suggestion but my dragon cannot break blocks. ;P Also do you know mods that spawn nether villages or other structures? I don't really know all the whole minecraft nods. Quote Link to comment Share on other sites More sharing options...
jeffryfisher Posted September 28, 2017 Share Posted September 28, 2017 8 hours ago, TheRPGAdventurer said: do you know mods that spawn nether villages I only know that I have seen threads in this forum asking for help with such mods. Seek and you (or your favorite search engine) will find them, possibly linked to github repositories. Quote 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. Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 29, 2017 Author Share Posted September 29, 2017 Just now, jeffryfisher said: I only know that I have seen threads in this forum asking for help with such mods. Seek and you (or your favorite search engine) will find them, possibly linked to github repositories. I finally come up for an idea when looking for MO Biomes source code, what if I get the world's blockstate then detect if it is solid or not but I have trouble understanding the difference between isNormalCube() and isBlockNormalCube(), or just use isSolid()? Quote Link to comment Share on other sites More sharing options...
jeffryfisher Posted September 29, 2017 Share Posted September 29, 2017 If you look for solid, then you could end up under lava. I suggest "coming up for air" using isAir(). Decide what you will do when you find no adequate air pocket below 127. The algorithm for placing a nether portal might offer a clue. Quote 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. Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 30, 2017 Author Share Posted September 30, 2017 Just now, jeffryfisher said: If you look for solid, then you could end up under lava. I suggest "coming up for air" using isAir(). Decide what you will do when you find no adequate air pocket below 127. The algorithm for placing a nether portal might offer a clue. Class for which I will find the nether portal algorithim? Location? Thanks! Quote Link to comment Share on other sites More sharing options...
TheRPGAdventurer Posted September 30, 2017 Author Share Posted September 30, 2017 (edited) Just now, TheRPGAdventurer said: Class for which I will find the nether portal algorithim? Location? Thanks! But I think I am starting to get it, what if I just detect if it is standing on a solid block. BTW, getheight just detects the heighest solid block. Because instead of finding the heighest block above just get the block this entity is standing, this.getPosition()? Edited September 30, 2017 by TheRPGAdventurer Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.