Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] More information on parameters required. #1

Closed
shinyone opened this issue Jul 1, 2024 · 6 comments
Closed

[Documentation] More information on parameters required. #1

shinyone opened this issue Jul 1, 2024 · 6 comments

Comments

@shinyone
Copy link

shinyone commented Jul 1, 2024

This is just what I have been looking for, however, the co-ordinates produced are not what I am expecting.

Please could you explain the following settings and what they do?

  • tileSize
  • searchWidth
  • tileScale
  • javaVersion - what format is this in?

let optional_params = {
tileSize: 16,
searchWidth: 8,
edition: "Java",
javaVersion: 10200,
tileScale: 0.25,
dimension: "overworld",
biomeHeight: "worldSurface",
}

For example, I am trying to find the villages using seed "-4835653925793959178". But can not get the same values as /locate or mcseeder.

[
  {
    type: 'village',
    x: 17.5,
    z: 221.5,
    metadata: { type: 'plains', zombie: false }
  },
  {
    type: 'village',
    x: 26,
    z: 275.25,
    metadata: { type: 'desert', zombie: false }
  }
]

Ref: https://www.mcseeder.com/?seed=-4835653925793959178&version=1.20

@gptlang
Copy link
Owner

gptlang commented Jul 5, 2024

You might need to multiply the x/z by 16 because they are in chunks

@gptlang
Copy link
Owner

gptlang commented Jul 5, 2024

It has been way too long since I've looked at this so I'm not quite sure.

If you want something that works, check out the locate module in meteor-rejects of which I'm the author of AntiCope/meteor-rejects#318.

It comes from here: https://github.com/gptlang/cubiomes
which has a more sensible API that deals with real coordinates rather than chunks

public static Pos GetNearestStructure(StructureType structType, int x, int z, Long seed, MCVersion mc_version) 

@shinyone
Copy link
Author

shinyone commented Jul 5, 2024

You might need to multiply the x/z by 16 because they are in chunks

Thanks. I've been looking at this today. Indeed, multiplying by 16 was the conclusion that worked for me.

@shinyone
Copy link
Author

shinyone commented Jul 5, 2024

It has been way too long since I've looked at this so I'm not quite sure.

If you want something that works, check out the locate module in meteor-rejects of which I'm the author of AntiCope/meteor-rejects#318.

It comes from here: https://github.com/gptlang/cubiomes which has a more sensible API that deals with real coordinates rather than chunks

public static Pos GetNearestStructure(StructureType structType, int x, int z, Long seed, MCVersion mc_version) 

Amazing! Great resource.

I forked and modified your code to have something working locally. I want a list of 30+ villages locations for a plugin. Therefore, I want it in Java ideally. But having nodejs create a json file would have worked...

However, meteor looks cool, and in Java, which is perfect. Although I only really need the structure locations. GetNearestStructure is limited because I don't want the nearest I want all within a certain region.

SeedLocation solves that with the searchWidth. Unless you know of another Java based API that is available?

@gptlang
Copy link
Owner

gptlang commented Jul 5, 2024

SeedLocation solves that with the searchWidth. Unless you know of another Java based API that is available?

not right now but it's trivial to implement.

The current logic: https://github.com/gptlang/cubiomes-c/blob/d646bf219d2a49c1fe61662a0bd252130d9b1dfb/main.c#L48-L126

The problem is that you can't pass arrays between C and Java so instead you can return a pointer and then in a loop call back into C for individual items until you get null.

@shinyone
Copy link
Author

shinyone commented Jul 8, 2024

Decided to create a node.js http server to retrieve the JSON created from MC-SeedLocator...

Thanks for you help and making this available.

@shinyone shinyone closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants