Skip to content

Conversation

@rapbattlegod32
Copy link
Member

About the PR

astral map has biome locator

Why / Balance

suggestions from discord

Technical details

server config to change the block radius default value is 6400 which seems to work great, too low of a value like 256 will barely get you any results and im afraid too high of a value would be expensive to compute

Requirements

Changelog

🆑

  • feat: biome finder for the astral map

@rapbattlegod32 rapbattlegod32 added T: New Feature Type: New feature or content, or extending existing content. C: Textures Changes: Might require knowledge of spriting or visual design. T: UI / UX Improvement Type: UI and player facing interactive graphical interfaces. S: Needs Review Status: Requires additional reviews before being fully accepted. labels Oct 12, 2025
@rapbattlegod32 rapbattlegod32 requested a review from a team as a code owner October 12, 2025 21:56
@rapbattlegod32 rapbattlegod32 added the S: DO NOT MERGE Status: Open item that should NOT be merged. DNM. Allows test to run unlike draft. label Oct 12, 2025
@rapbattlegod32 rapbattlegod32 requested a review from a team as a code owner October 12, 2025 21:56
@rapbattlegod32 rapbattlegod32 added P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. C: Structures Changes: Might require knowledge of mapping. C: Networking Changes: Might require knowledge of networking. A: General Interactions Area: General in-game interactions that don't relate to another area. C: Chunks Changes: Might require knowledge of worlds, chunks and blocks. labels Oct 12, 2025
@github-actions github-actions bot added the size/M Denotes a PR that changes 100-999 lines. label Oct 12, 2025
@GSMPBot GSMPBot requested a review from drtheodor October 12, 2025 21:56
@github-actions github-actions bot added the A: Datagen Area: Datagen implementation & API. label Oct 12, 2025
@GSMPBot GSMPBot requested a review from duzos October 12, 2025 21:56
@github-actions github-actions bot added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Oct 12, 2025
@rapbattlegod32
Copy link
Member Author

ive tested myself and it works and ive also gotten a beta tester and they had no issues

@rapbattlegod32 rapbattlegod32 removed the S: DO NOT MERGE Status: Open item that should NOT be merged. DNM. Allows test to run unlike draft. label Oct 12, 2025
@rapbattlegod32
Copy link
Member Author

closes #1698

@drtheodor drtheodor removed the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Oct 24, 2025
Copy link
Member

@drtheodor drtheodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

among other things, using ait:loading as a dummy value is rather silly. If it applies to an entire list can't you just make it a separate boolean value like "waitingOnBiomes"..?

@github-actions github-actions bot added S: Awaiting Changes Status: Changes are required before another review can happen. and removed S: Needs Review Status: Requires additional reviews before being fully accepted. labels Oct 24, 2025
@GSMPBot GSMPBot requested a review from drtheodor October 27, 2025 05:02
@github-actions github-actions bot added S: Needs Review Status: Requires additional reviews before being fully accepted. and removed S: Awaiting Changes Status: Changes are required before another review can happen. labels Oct 27, 2025
@rapbattlegod32
Copy link
Member Author

nitpicks done now approve so nano can do the gui

this.close();
});
waitingOnStructures = false;
changed = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed is already false

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to be true?

public static List<Identifier> biomeIds;

static {
ServerPlayNetworking.registerGlobalReceiver(REQUEST_SEARCH, (server, player, handler, buf, responseSender) -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can include what you're trying to query.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, this doesn't have a security check. what if the player isnt using an astral map block? hax

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can include what you're trying to query.

this is known in clientside code, and will make the server's job simpler


private static void sendBiomes(ServerWorld world, ServerPlayerEntity target) {
if (biomeIds == null || biomeIds.isEmpty()) {
List<Identifier> ids = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be a static sized list or an array, iirc the registry's size can be queried

}

PacketByteBuf buf = PacketByteBufs.create();
buf.writeInt(biomeIds.size());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a writeCollection method already

ids.add(buf.readIdentifier());
}
client.execute(() -> {
biomeIds = ids;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this.

}
client.execute(() -> {
biomeIds = ids;
if (client.currentScreen instanceof dev.amble.ait.client.screens.AstralMapScreen screen) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import the class instead of querying it by its package name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, i feel like this can be cached client-side (if it isn't already present on client)
im pretty sure client knows of registered biomes... ill check the protocol wiki.

RegistryKey<Biome> biomekey = RegistryKey.of(RegistryKeys.BIOME, target);

Pair<BlockPos, RegistryEntry<Biome>> r = targetWorld.locateBiome(
entry -> entry.getKey().map(key -> key.equals(biomekey)).orElse(false),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be replaced with RegistryEntryPredicateArgumentType.getRegistryEntryPredicate(context, "biome", RegistryKeys.BIOME)

RegistryKey<Biome> biomekey = RegistryKey.of(RegistryKeys.BIOME, target);

Pair<BlockPos, RegistryEntry<Biome>> r = targetWorld.locateBiome(
entry -> entry.getKey().map(key -> key.equals(biomekey)).orElse(false),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be replaced with RegistryEntryPredicateArgumentType.getRegistryEntryPredicate(context, "biome", RegistryKeys.BIOME)

@github-actions github-actions bot added S: Awaiting Changes Status: Changes are required before another review can happen. and removed S: Needs Review Status: Requires additional reviews before being fully accepted. labels Oct 27, 2025
@rapbattlegod32
Copy link
Member Author

American.Psycho.Dry.Cleaners.If.you.don.t.shut.your.mouth.I.will.kill.you.Ayaa.S4r7og9JTJU.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: Datagen Area: Datagen implementation & API. A: General Interactions Area: General in-game interactions that don't relate to another area. C: Chunks Changes: Might require knowledge of worlds, chunks and blocks. C: Networking Changes: Might require knowledge of networking. C: Structures Changes: Might require knowledge of mapping. C: Textures Changes: Might require knowledge of spriting or visual design. P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. S: Awaiting Changes Status: Changes are required before another review can happen. size/M Denotes a PR that changes 100-999 lines. T: New Feature Type: New feature or content, or extending existing content. T: UI / UX Improvement Type: UI and player facing interactive graphical interfaces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants