Skip to content

Conversation

@Hugman76
Copy link
Member

@Hugman76 Hugman76 commented Aug 2, 2025

This adds all classes needed for team list providers, a way to randomly generate a GameTeamList.
A team list provider only requires a Random to provide a GameTeamList.

It also has builtin compatibility for files that are configurated using a fixed list of game teams such as GameTeamList#CODEC/GameTeam#CODEC#asList() and integer values describing team amounts such as IntProvider#CODEC/Codec#INT.

Types

The registry for types is plasmid:team_list_provider_type (found in PlasmidRegistries#TEAM_LIST_PROVIDER_TYPE). Obviously, any mod can add to it.

Here are the different team provider types:

  • plasmid:constant - a fixed list of GameTeam.
  • plasmid:trim - trims another provider to a certain size
    • Can be also be shuffled before the trim for more variety
  • plasmid:random - picks from a list of other providers.
  • plasmid:sized_alternatives - picks for a certain size, and then picks from a map of sizes to providers.
    • The map field is optional, and if left empty will pick up from a standard map set up to support from 1 up to 16 teams. (see DefaultTeamLists) This default map provides handpicked basic teams with constrated and vivid colors. The lesser teams they are, the more effective it is at constrasting everything.

Codec

The base Codec (TeamListProvider#CODEC) supports many formats:

  • A typed provider, which is the base format
  • A list of game teams. Instead of using plasmid:constant, you can directly pass the fixed list. This means existing configurations that use GameTeamList#CODEC can be replaced with the base codec and generated configurations will have the same functionality.
  • An integer provider (which can be inlined as a constant int). This replaces the usage of plasmid:sized_alternatives with the default map.

If you are using data generation, please check around the TeamListProvider classes for helper functions, noticeably some that use the default team map.

Other details

You can try out team providers in the dev environment by launching the test mod.

If we are discontent with the teams provided by default, we will always be able to change them in the future and still maintain perfect compatiblity with previous datapack resources.

@Hugman76 Hugman76 changed the base branch from main to dev August 2, 2025 13:23
@Hugman76 Hugman76 changed the title Team providers Add team providers Aug 2, 2025
@Hugman76 Hugman76 requested a review from Patbox August 3, 2025 21:01
@Hugman76 Hugman76 marked this pull request as ready for review August 3, 2025 21:01
@Hugman76 Hugman76 changed the title Add team providers Add team list providers Aug 3, 2025
# Conflicts:
#	src/main/java/xyz/nucleoid/plasmid/api/chat/PlasmidMessageTypes.java
#	src/main/java/xyz/nucleoid/plasmid/api/game/GameType.java
#	src/main/java/xyz/nucleoid/plasmid/api/registry/PlasmidRegistries.java
#	src/main/java/xyz/nucleoid/plasmid/api/registry/PlasmidRegistryKeys.java
#	src/main/java/xyz/nucleoid/plasmid/impl/portal/GamePortalConfig.java
#	src/main/java/xyz/nucleoid/plasmid/impl/portal/menu/MenuEntryConfig.java
@Hugman76 Hugman76 requested a review from Patbox August 23, 2025 16:19
@Patbox
Copy link
Member

Patbox commented Aug 23, 2025

Aside it not compiling now, LGTM

@Hugman76
Copy link
Member Author

Oops, here we go

@Patbox Patbox merged commit 807aa61 into NucleoidMC:dev Aug 24, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants