Bug fixes!
This commit is contained in:
parent
ac31fc2b4e
commit
add3cf0bf6
3 changed files with 26 additions and 22 deletions
common/mekanism/client
|
@ -17,8 +17,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class ClientConnectionHandler implements IConnectionHandler
|
||||
{
|
||||
public VoiceClient voiceClient;
|
||||
|
||||
@Override
|
||||
public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager) {}
|
||||
|
||||
|
@ -35,8 +33,8 @@ public class ClientConnectionHandler implements IConnectionHandler
|
|||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
try {
|
||||
voiceClient = new VoiceClient(server, Mekanism.VOICE_PORT);
|
||||
voiceClient.start();
|
||||
MekanismClient.voiceClient = new VoiceClient(server, Mekanism.VOICE_PORT);
|
||||
MekanismClient.voiceClient.start();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
@ -48,29 +46,14 @@ public class ClientConnectionHandler implements IConnectionHandler
|
|||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
try {
|
||||
voiceClient = new VoiceClient(InetAddress.getLocalHost().getHostAddress(), Mekanism.VOICE_PORT);
|
||||
voiceClient.start();
|
||||
MekanismClient.voiceClient = new VoiceClient(InetAddress.getLocalHost().getHostAddress(), Mekanism.VOICE_PORT);
|
||||
MekanismClient.voiceClient.start();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionClosed(INetworkManager manager)
|
||||
{
|
||||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
if(voiceClient != null)
|
||||
{
|
||||
voiceClient.disconnect();
|
||||
voiceClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
ClientTickHandler.tickingSet.clear();
|
||||
Mekanism.jetpackOn.clear();
|
||||
Mekanism.gasmaskOn.clear();
|
||||
Mekanism.proxy.unloadSoundHandler();
|
||||
}
|
||||
public void connectionClosed(INetworkManager manager) {}
|
||||
|
||||
@Override
|
||||
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login) {}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package mekanism.client;
|
||||
|
||||
import mekanism.common.Mekanism;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import cpw.mods.fml.common.IPlayerTracker;
|
||||
|
||||
|
@ -13,6 +14,23 @@ public class ClientPlayerTracker implements IPlayerTracker
|
|||
public void onPlayerLogout(EntityPlayer player)
|
||||
{
|
||||
Mekanism.jetpackOn.remove(player);
|
||||
|
||||
if(player.username.equals(Minecraft.getMinecraft().thePlayer.username))
|
||||
{
|
||||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
if(MekanismClient.voiceClient != null)
|
||||
{
|
||||
MekanismClient.voiceClient.disconnect();
|
||||
MekanismClient.voiceClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
ClientTickHandler.tickingSet.clear();
|
||||
Mekanism.jetpackOn.clear();
|
||||
Mekanism.gasmaskOn.clear();
|
||||
Mekanism.proxy.unloadSoundHandler();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package mekanism.client;
|
||||
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.client.voice.VoiceClient;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.PacketHandler.Transmission;
|
||||
|
@ -18,6 +19,8 @@ public class MekanismClient extends Mekanism
|
|||
/** The main SoundHandler instance that is used by all audio sources */
|
||||
public static SoundHandler audioHandler;
|
||||
|
||||
public static VoiceClient voiceClient;
|
||||
|
||||
//General Configuration
|
||||
public static boolean enableSounds = true;
|
||||
public static boolean fancyUniversalCableRender = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue