mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Bug fixes!
This commit is contained in:
1 parent
ac31fc2b4e
commit
add3cf0bf6
3 files changed
+26
-22
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user