RandomPortals

RandomPortals

335k Downloads

[Bug] [1.12.2] Portal Generation Location is Not Ideal / Safe

PiggiesGoSqueal opened this issue ยท 6 comments

commented

I know you're not working on the 1.12.2 version of the mod anymore but I figured it was still worth reporting at least.

Currently in the 1.12.2-1.8.1.3 version of this mod the part in the file:
"destination": {
"dimensionID": 0,
"locationDetectionBehavior": "FORCE_INITIAL",
"initialLocation": {
"x": 0,
"y": 0,
"z": 0
},

^ Means the portal will always be created at the Y coordinate 0 (AKA at bedrock level and remove the lowest layer of bedrock to place the portal). This happened every time I tried creating a portal. I set it to 65 Y and it started going to 65 Y every time.

Would be nice if it teleported to on the ground (AKA with no blocks over the player & on land). Or offered an option for that because putting it at 65 works frequently but not always. If it is an extreme hills biome for example then it may teleport the player into a mountain or unsafe location. Similarly, if it is a one-way portal then it may teleport the player into the middle of an ocean and if they have no blocks... Well.... They're screwed. Lol.

commented

Just an update, if I make the portal be one way and not generate a portal in the destination dimension then having 0 for Y seems to work. I only tested it once but it brought me to on land above ground.

commented

So to clarify, you'd like the X and Z coordinates to be forced to 0, but the Y coordinate to be determined dynamically?

commented

Apologies for the late reply, I pretty rarely check my email (which is how I see the notifications).

So to clarify, you'd like the X and Z coordinates to be forced to 0, but the Y coordinate to be determined dynamically?

No, I meant this:

Would be nice if it teleported to on the ground (AKA with no blocks over the player & on land). Or offered an option for that because putting it at 65 [Y] works frequently but not always. If it is an extreme hills biome for example then it may teleport the player into a mountain or unsafe location. Similarly, if it is a one-way portal then it may teleport the player into the middle of an ocean and if they have no blocks... Well.... They're screwed. Lol.

In other words, if someone creates a portal that leads to the main world, it will determine the X and Z coords however it already does (AKA NOT be forced to 0 X and 0 Z). Then the Y coordinate would be whatever allows it to meet these conditions:

  • It must be on a solid block (so it doesn't spawn a player in the middle of the ocean or in a lava area (which would be especially harmful for one-way portals)
  • It must have no blocks over head (AKA must be above ground)

That way it minimizes the chance they spawn in a dangerous or inconvenient location.

Thanks!

Sincerely,
pinkpig

commented

Sorry for the late reply, but it seems like setting locationDetectionBehavior to IGNORE_INITIAL would solve this issue.

commented

Sorry for the late reply, but it seems like setting locationDetectionBehavior to IGNORE_INITIAL would solve this issue.

All good, I've been busy as well. Anyways, I set the option to what you said and started the server. It didn't seem to change anything. I used to have FORCE_INITIAL and it would spawn the portal at Y 65 I'm assuming (I don't recall for actual tests but it is set to spawn at 65 Y so I'll assume it does but maybe it is spawning at same Y as -->). When set to IGNORE_INITIAL it will ALWAYS spawn at 69 Y for the bottom-most blocks. And the ground isn't at 69 Y so that isn't the reason it is spawning there.

Would it be possible for you to add condition for portals to match before generating the portal? The conditions:

  1. Is on solid blocks (so it doesn't spawn in the middle of the ocean, sky, or on trees, in lava, etc).
  2. The sky is directly above (meaning it is above ground).

NOTE: Please tag me when you respond so I hopefully get a notification for my Github. Otherwise, I'll likely see this next time I clean out my emails. :P

commented

@PiggiesGoSqueal You can now use FORCE_INITIAL and set initialLocation.useTopSolidY to true.