2013-10-15 05:36:07 +02:00
|
|
|
package mekanism.client;
|
|
|
|
|
2014-02-02 01:02:51 +01:00
|
|
|
import mekanism.api.MekanismAPI;
|
|
|
|
import mekanism.api.MekanismAPI.BoxBlacklistEvent;
|
2013-10-15 05:36:07 +02:00
|
|
|
import mekanism.client.sound.SoundHandler;
|
2013-12-09 23:54:59 +01:00
|
|
|
import mekanism.client.voice.VoiceClient;
|
2013-10-15 05:36:07 +02:00
|
|
|
import mekanism.common.Mekanism;
|
2013-12-05 22:42:00 +01:00
|
|
|
import mekanism.common.PacketHandler;
|
|
|
|
import mekanism.common.PacketHandler.Transmission;
|
|
|
|
import mekanism.common.network.PacketKey;
|
2013-12-09 02:22:04 +01:00
|
|
|
import net.minecraft.client.Minecraft;
|
2014-02-02 01:02:51 +01:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2013-12-05 22:42:00 +01:00
|
|
|
|
|
|
|
import org.lwjgl.input.Keyboard;
|
|
|
|
|
2013-11-03 22:54:33 +01:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-10-15 05:36:07 +02:00
|
|
|
|
|
|
|
public class MekanismClient extends Mekanism
|
|
|
|
{
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
/** The main SoundHandler instance that is used by all audio sources */
|
|
|
|
public static SoundHandler audioHandler;
|
|
|
|
|
2013-12-09 23:54:59 +01:00
|
|
|
public static VoiceClient voiceClient;
|
|
|
|
|
2013-10-15 05:36:07 +02:00
|
|
|
//General Configuration
|
|
|
|
public static boolean enableSounds = true;
|
|
|
|
public static boolean fancyUniversalCableRender = true;
|
2013-12-24 19:25:31 +01:00
|
|
|
public static boolean holidays = true;
|
2013-12-08 18:49:48 +01:00
|
|
|
public static double baseSoundVolume = 1;
|
2013-11-03 02:07:55 +01:00
|
|
|
|
|
|
|
public static long ticksPassed = 0;
|
2013-12-05 22:42:00 +01:00
|
|
|
|
2013-12-26 18:02:17 +01:00
|
|
|
public static void updateKey(int key, int type)
|
2013-12-05 22:42:00 +01:00
|
|
|
{
|
2013-12-09 02:22:04 +01:00
|
|
|
boolean down = Minecraft.getMinecraft().currentScreen == null ? Keyboard.isKeyDown(key) : false;
|
|
|
|
|
2013-12-26 18:02:17 +01:00
|
|
|
if(down != keyMap.has(Minecraft.getMinecraft().thePlayer, type))
|
2013-12-05 22:42:00 +01:00
|
|
|
{
|
2013-12-26 18:02:17 +01:00
|
|
|
PacketHandler.sendPacket(Transmission.SERVER, new PacketKey().setParams(type, down));
|
|
|
|
keyMap.update(Minecraft.getMinecraft().thePlayer, type, down);
|
2013-12-05 22:42:00 +01:00
|
|
|
}
|
|
|
|
}
|
2014-01-23 23:06:33 +01:00
|
|
|
|
|
|
|
public static void reset()
|
|
|
|
{
|
|
|
|
if(Mekanism.voiceServerEnabled)
|
|
|
|
{
|
|
|
|
if(MekanismClient.voiceClient != null)
|
|
|
|
{
|
|
|
|
MekanismClient.voiceClient.disconnect();
|
|
|
|
MekanismClient.voiceClient = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ClientTickHandler.tickingSet.clear();
|
|
|
|
Mekanism.proxy.unloadSoundHandler();
|
|
|
|
|
2014-02-02 01:02:51 +01:00
|
|
|
MekanismAPI.getBoxIgnore().clear();
|
|
|
|
MinecraftForge.EVENT_BUS.post(new BoxBlacklistEvent());
|
|
|
|
|
2014-01-23 23:06:33 +01:00
|
|
|
Mekanism.jetpackOn.clear();
|
|
|
|
Mekanism.gasmaskOn.clear();
|
|
|
|
|
|
|
|
Mekanism.proxy.loadConfiguration();
|
|
|
|
|
|
|
|
System.out.println("[Mekanism] Reloaded config.");
|
|
|
|
}
|
2013-10-15 05:36:07 +02:00
|
|
|
}
|