-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load game configs from dynamic registries
- Loading branch information
Showing
27 changed files
with
197 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
src/main/java/xyz/nucleoid/plasmid/game/composite/GameListConfig.java
This file was deleted.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
src/main/java/xyz/nucleoid/plasmid/game/composite/RandomGame.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
package xyz.nucleoid.plasmid.game.composite; | ||
|
||
import net.minecraft.text.Text; | ||
import net.minecraft.util.math.random.Random; | ||
import xyz.nucleoid.plasmid.game.GameOpenContext; | ||
import xyz.nucleoid.plasmid.game.GameOpenException; | ||
import xyz.nucleoid.plasmid.game.GameOpenProcedure; | ||
|
||
import java.util.Random; | ||
|
||
public final class RandomGame { | ||
public static GameOpenProcedure open(GameOpenContext<RandomGameConfig> context) { | ||
var config = context.config(); | ||
|
||
var game = config.selectGame(new Random()); | ||
var game = config.selectGame(Random.createLocal()); | ||
if (game == null) { | ||
throw new GameOpenException(Text.translatable("text.plasmid.random.empty_composite_game_config")); | ||
} | ||
|
||
return GameOpenProcedure.withOverride(game.openProcedure(context.server()), game); | ||
return GameOpenProcedure.withOverride(game.value().openProcedure(context.server()), game); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.