Add option to disable voice server
This commit is contained in:
parent
0bab44a522
commit
f4ced367cd
3 changed files with 19 additions and 3 deletions
|
@ -4,6 +4,7 @@ import java.io.BufferedInputStream;
|
|||
import java.io.BufferedOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.net.Socket;
|
||||
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
|
@ -51,6 +52,8 @@ public class VoiceClient extends Thread
|
|||
(inputThread = new VoiceInput(this)).start();
|
||||
|
||||
System.out.println("[Mekanism] VoiceServer: Successfully connected to server.");
|
||||
} catch(ConnectException e) {
|
||||
System.err.println("[Mekanism] VoiceServer: Server's VoiceServer is disabled.");
|
||||
} catch(Exception e) {
|
||||
System.err.println("[Mekanism] VoiceServer: Error while starting client connection.");
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -149,6 +149,7 @@ public class CommonProxy
|
|||
Mekanism.controlCircuitOreDict = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ControlCircuitOreDict", true).getBoolean(true);
|
||||
Mekanism.logPackets = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "LogPackets", false).getBoolean(true);
|
||||
Mekanism.dynamicTankEasterEgg = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DynamicTankEasterEgg", false).getBoolean(true);
|
||||
Mekanism.voiceServerEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoiceServerEnabled", true).getBoolean(true);
|
||||
Mekanism.obsidianTNTDelay = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTDelay", 100).getInt();
|
||||
Mekanism.obsidianTNTBlastRadius = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTBlastRadius", 12).getInt();
|
||||
Mekanism.UPDATE_DELAY = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ClientUpdateDelay", 10).getInt();
|
||||
|
|
|
@ -222,6 +222,7 @@ public class Mekanism
|
|||
public static boolean controlCircuitOreDict = true;
|
||||
public static boolean logPackets = false;
|
||||
public static boolean dynamicTankEasterEgg = false;
|
||||
public static boolean voiceServerEnabled = true;
|
||||
public static int obsidianTNTBlastRadius = 12;
|
||||
public static int obsidianTNTDelay = 100;
|
||||
public static int UPDATE_DELAY = 10;
|
||||
|
@ -1039,14 +1040,22 @@ public class Mekanism
|
|||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event)
|
||||
{
|
||||
voiceManager.start();
|
||||
if(voiceServerEnabled)
|
||||
{
|
||||
voiceManager.start();
|
||||
}
|
||||
|
||||
event.registerServerCommand(new CommandMekanism());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopping(FMLServerStoppingEvent event)
|
||||
{
|
||||
voiceManager.stop();
|
||||
if(voiceServerEnabled)
|
||||
{
|
||||
voiceManager.stop();
|
||||
}
|
||||
|
||||
teleporters.clear();
|
||||
dynamicInventories.clear();
|
||||
}
|
||||
|
@ -1106,7 +1115,10 @@ public class Mekanism
|
|||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
//Set up VoiceServerManager
|
||||
voiceManager = new VoiceServerManager();
|
||||
if(voiceServerEnabled)
|
||||
{
|
||||
voiceManager = new VoiceServerManager();
|
||||
}
|
||||
|
||||
//Register with TransmitterNetworkRegistry
|
||||
TransmitterNetworkRegistry.initiate();
|
||||
|
|
Loading…
Add table
Reference in a new issue