mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 23:48:50 +00:00
Readd voice server (#5374)
* Add back the voice server defaulted to disabled * Port 098472a make voice output properly sleepy * Cleanup some of the voice server code * Keep track of UUID in VoiceConnection instead of username * Collapse a few missed error logging into stack trace printing * Add tooltip to walkie talkie when voice server is disabled * Fix single player crash if voice server is enabled after launch before world start
This commit is contained in:
1 parent
a1e0688af8
commit
a776879eed
16 files changed
+661
-6
No files matched your search
@@ -137,6 +137,7 @@ import mekanism.common.transmitters.grid.EnergyNetwork.EnergyTransferEvent;
|
||||
import mekanism.common.transmitters.grid.FluidNetwork.FluidTransferEvent;
|
||||
import mekanism.common.transmitters.grid.GasNetwork.GasTransferEvent;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.voice.VoiceServerManager;
|
||||
import mekanism.common.world.GenHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
@@ -267,6 +268,10 @@ public class Mekanism {
|
||||
* changes.
|
||||
*/
|
||||
public static int baseWorldGenVersion = 0;
|
||||
/**
|
||||
* The VoiceServer manager for walkie talkies
|
||||
*/
|
||||
public static VoiceServerManager voiceManager;
|
||||
/**
|
||||
* The GameProfile used by the dummy Mekanism player
|
||||
*/
|
||||
@@ -864,11 +869,18 @@ public class Mekanism {
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
if (general.voiceServerEnabled) {
|
||||
voiceManager.start();
|
||||
}
|
||||
CommandMek.register(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopping(FMLServerStoppingEvent event) {
|
||||
if (general.voiceServerEnabled) {
|
||||
voiceManager.stop();
|
||||
}
|
||||
|
||||
//Clear all cache data
|
||||
playerState.clear();
|
||||
activeVibrators.clear();
|
||||
@@ -979,6 +991,11 @@ public class Mekanism {
|
||||
//Register this module's GUI handler in the simple packet protocol
|
||||
PacketSimpleGui.handlers.add(0, proxy);
|
||||
|
||||
//Set up VoiceServerManager
|
||||
if (general.voiceServerEnabled) {
|
||||
voiceManager = new VoiceServerManager();
|
||||
}
|
||||
|
||||
//Register with TransmitterNetworkRegistry
|
||||
TransmitterNetworkRegistry.initiate();
|
||||
|
||||
|
||||
Reference in new issue
Block a user