From 0ac4cc721d193eff9b7ae0fa5f7aabb841577138 Mon Sep 17 00:00:00 2001 From: SuperErnD Date: Tue, 17 Dec 2024 22:02:59 +0200 Subject: [PATCH] fix #314 --- config/polymer/client.json | 12 ++++++++++++ config/polymer/common.json | 14 ++++++++++++++ config/polymer/server.json | 17 +++++++++++++++++ .../plasmid/impl/game/composite/RandomGame.java | 10 ++++++++-- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 config/polymer/client.json create mode 100644 config/polymer/common.json create mode 100644 config/polymer/server.json diff --git a/config/polymer/client.json b/config/polymer/client.json new file mode 100644 index 00000000..0e9891bb --- /dev/null +++ b/config/polymer/client.json @@ -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 +} \ No newline at end of file diff --git a/config/polymer/common.json b/config/polymer/common.json new file mode 100644 index 00000000..8cb8734f --- /dev/null +++ b/config/polymer/common.json @@ -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 +} \ No newline at end of file diff --git a/config/polymer/server.json b/config/polymer/server.json new file mode 100644 index 00000000..24db9116 --- /dev/null +++ b/config/polymer/server.json @@ -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 +} \ No newline at end of file diff --git a/src/main/java/xyz/nucleoid/plasmid/impl/game/composite/RandomGame.java b/src/main/java/xyz/nucleoid/plasmid/impl/game/composite/RandomGame.java index 13edb601..06519af4 100644 --- a/src/main/java/xyz/nucleoid/plasmid/impl/game/composite/RandomGame.java +++ b/src/main/java/xyz/nucleoid/plasmid/impl/game/composite/RandomGame.java @@ -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; @@ -11,11 +12,16 @@ public final class RandomGame { public static GameOpenProcedure open(GameOpenContext 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> game = null; + while(game == null) game = config.selectGame(Random.createLocal()); return GameOpenProcedure.withOverride(GameConfig.openProcedure(context.server(), game), game); } } + + +