Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperErnD committed Dec 17, 2024
1 parent 2d1831c commit 0ac4cc7
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
12 changes: 12 additions & 0 deletions config/polymer/client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"_c4": "Toggles visibility of F3 debug info",
"displayF3Info": true,
"_c5": "Enables logging of invalid registry ids (BlockStates, Blocks, Items, etc) sent by server",
"logInvalidServerEntryIds": false,
"_c6": "Disables Polymer's QoL changes that effects non-visual things",
"disableNonVisualQualityOfLifeChanges": true,
"_c7": "Enables experimental support for less standard modded containers, allowing them to display polymer items",
"experimentalModdedContainerSupport": true,
"_c11": "Makes polymer report time it's handshake took",
"logHandshakeTime": false
}
14 changes: 14 additions & 0 deletions config/polymer/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"_c1": "Keep this one at 0, unless you credit this library in another way",
"coreCommandOperatorLevel": 0,
"_c2": "Enabled developer utilities",
"enableDevTools": false,
"_c3": "Uses simpler about display for /polymer command",
"minimalisticAbout": false,
"_c4": "Logs warnings while creating template/filter entities",
"enableTemplateEntityWarnings": true,
"_c5": "Enables logging of more exceptions. Useful when debugging",
"logAllExceptions": false,
"_c6": "Forces all player resource pack checks to always return true (detect resource pack on client)",
"force_resource_pack_state_to_enabled": false
}
17 changes: 17 additions & 0 deletions config/polymer/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"_c7": "Displays vanilla/modded creatives tabs in /polymer creative",
"displayNonPolymerCreativeTabs": true,
"_c9": "Makes server send additional block updates around clicked area",
"sendBlocksAroundClicked": true,
"_c11": "Makes polymer report time it's handshake took",
"logHandshakeTime": false,
"_c12": "Enables logging of BlockState ids rebuilds",
"logBlockStateRebuilds": true,
"_c1": "Enables syncing of non-polymer entries as polymer ones, when PolyMc is present",
"polyMcSyncModdedEntries": true,
"_c2": "Delay from last light updates to syncing it to clients, in ticks",
"lightUpdateTickDelay": 1,
"_c4": "Enables experimental passing of ItemStack context through nbt, allowing for better mod compat",
"item_stack_nbt_hack": true,
"override_polymc_mining_check": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.minecraft.text.Text;
import net.minecraft.util.math.random.Random;
import net.minecraft.registry.entry.RegistryEntry;
import xyz.nucleoid.plasmid.api.game.GameOpenContext;
import xyz.nucleoid.plasmid.api.game.GameOpenException;
import xyz.nucleoid.plasmid.api.game.GameOpenProcedure;
Expand All @@ -11,11 +12,16 @@ public final class RandomGame {
public static GameOpenProcedure open(GameOpenContext<RandomGameConfig> context) {
var config = context.config();

var game = config.selectGame(Random.createLocal());
if (game == null) {
if(config.isEmpty()) {
throw new GameOpenException(Text.translatable("text.plasmid.random.empty_composite_game_config"));
}

RegistryEntry<GameConfig<?>> game = null;
while(game == null) game = config.selectGame(Random.createLocal());

return GameOpenProcedure.withOverride(GameConfig.openProcedure(context.server(), game), game);
}
}



0 comments on commit 0ac4cc7

Please sign in to comment.