Jump to content

Dialup_King

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Dialup_King

  1. I found out that the config sync has nothing to do with the actual issue. It was actually due to all processing being done server side so the client decides nothing. Hindsite, I should have realised this initially. So my new approach is to send a packet on login and config change that tells the server which voice to use. It will be stored in the player NBT data. Then, whenever a voice line is played, it looks at the NBT data. I doubt this is the right, or even a good, way to do this but it works.
  2. Never mind. I decided to add a toggle to the video settings menu because that somehow is easier and is more convenient.
  3. I'm trying to make a config option that the client doesn't sync with the server. I want the option to be toggleable in game via the Mod Options. I'm currently using the config annotations provided by Forge. The options display and operate correctly for singleplayer. However, when connecting to servers, the options are synced with the server and changing them does nothing while in multiplayer. I've seen other mods with client side only config, but I have been having a hard time looking through their source code. Here is the only class I have that handles config things: package dialupking.nepcraft.managers; import dialupking.nepcraft.Nepcraft; import net.minecraftforge.common.config.Config; import net.minecraftforge.common.config.ConfigManager; /** * Handles configuration data. * * @author Nickolas Bradham * */ @Config(modid = Nepcraft.S_MODID) public final class NepConfigManager { @Config.Comment("Voice cool-down duration in ms.") @Config.RangeInt(min = 0) public static int voiceCool = 1000; @Config.Comment("Special activation cool-down duration in ms.") @Config.RangeInt(min = 0) public static int specialCool = 10000; @Config.Comment("Special duration in ticks.") @Config.RangeInt(min = 0) public static int specialDuration = 100; @Config.Comment("Use alt voice lines.") public static boolean useAltVoice = false; // Player decides this on client side. /** * @see ConfigManager#sync */ public final void sync() { ConfigManager.sync(Nepcraft.S_MODID, Config.Type.INSTANCE); } } The only other thing is my main mod class calls the sync() function in the onConfigChanged() SubscribeEvent. Any help would be appreciated. Thanks!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.