diff --git a/src/main/java/mekanism/client/ClientConnectionHandler.java b/src/main/java/mekanism/client/ClientConnectionHandler.java index 9839660ea..10e93aced 100644 --- a/src/main/java/mekanism/client/ClientConnectionHandler.java +++ b/src/main/java/mekanism/client/ClientConnectionHandler.java @@ -17,17 +17,16 @@ public class ClientConnectionHandler { if(event.isLocal) { - connectionOpened(); + localConnection(); } - else - { + else { //TODO this is probably wrong - connectionOpened(event.manager.getSocketAddress().toString()); + remoteConnection(event.manager.getSocketAddress().toString()); } } /* Remote */ - public void connectionOpened(String server) + public void remoteConnection(String server) { if(Mekanism.voiceServerEnabled) { @@ -38,7 +37,7 @@ public class ClientConnectionHandler } /* Integrated */ - public void connectionOpened() + public void localConnection() { if(Mekanism.voiceServerEnabled) { diff --git a/src/main/java/mekanism/client/ClientProxy.java b/src/main/java/mekanism/client/ClientProxy.java index b3956e85c..346b30419 100644 --- a/src/main/java/mekanism/client/ClientProxy.java +++ b/src/main/java/mekanism/client/ClientProxy.java @@ -480,10 +480,6 @@ public class ClientProxy extends CommonProxy { super.loadUtilities(); - NetworkRegistry.registerConnectionHandler(new ClientConnectionHandler()); - - KeyBindingRegistry.registerKeyBinding(new MekanismKeyHandler()); - HolidayManager.init(); } diff --git a/src/main/java/mekanism/client/MekKeyHandler.java b/src/main/java/mekanism/client/MekKeyHandler.java index 2acfc1f8f..c2b06e692 100644 --- a/src/main/java/mekanism/client/MekKeyHandler.java +++ b/src/main/java/mekanism/client/MekKeyHandler.java @@ -26,12 +26,12 @@ public abstract class MekKeyHandler * @param keyBindings * @param repeatings */ - public MekKeyHandler(KeyBinding[] keyBindings, boolean[] repeatings) + public MekKeyHandler(KeyBinding[] bindings, boolean[] rep) { assert keyBindings.length == repeatings.length : "You need to pass two arrays of identical length"; - this.keyBindings = keyBindings; - this.repeatings = repeatings; - this.keyDown = new boolean[keyBindings.length]; + keyBindings = bindings; + repeatings = rep; + keyDown = new boolean[keyBindings.length]; } /** @@ -40,48 +40,52 @@ public abstract class MekKeyHandler * * @param keyBindings */ - public MekKeyHandler(KeyBinding[] keyBindings) + public MekKeyHandler(KeyBinding[] bindings) { - this.keyBindings = keyBindings; - this.isDummy = true; + keyBindings = bindings; + isDummy = true; } public KeyBinding[] getKeyBindings () { - return this.keyBindings; + return keyBindings; } @SubscribeEvent public void onTick(ClientTickEvent event) { - if (event.side == Side.CLIENT) + if(event.side == Side.CLIENT) { - if (event.phase == Phase.START) + if(event.phase == Phase.START) + { keyTick(event.type, false); - else if (event.phase == Phase.END) + } + else if(event.phase == Phase.END) + { keyTick(event.type, true); + } } - } public void keyTick(Type type, boolean tickEnd) { - for (int i = 0; i < keyBindings.length; i++) + for(int i = 0; i < keyBindings.length; i++) { KeyBinding keyBinding = keyBindings[i]; int keyCode = keyBinding.getKeyCode(); boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode)); - if (state != keyDown[i] || (state && repeatings[i])) + + if(state != keyDown[i] || (state && repeatings[i])) { - if (state) + if(state) { keyDown(type, keyBinding, tickEnd, state != keyDown[i]); } - else - { + else { keyUp(type, keyBinding, tickEnd); } - if (tickEnd) + + if(tickEnd) { keyDown[i] = state; } @@ -103,7 +107,7 @@ public abstract class MekKeyHandler * @param isRepeat * is it a repeat key event */ - public abstract void keyDown (Type types, KeyBinding kb, boolean tickEnd, boolean isRepeat); + public abstract void keyDown(Type types, KeyBinding kb, boolean tickEnd, boolean isRepeat); /** * Fired once when the key changes state from down to up @@ -115,6 +119,6 @@ public abstract class MekKeyHandler * @param tickEnd * was it an end or start tick which fired the key */ - public abstract void keyUp (Type types, KeyBinding kb, boolean tickEnd); + public abstract void keyUp(Type types, KeyBinding kb, boolean tickEnd); } \ No newline at end of file diff --git a/src/main/java/mekanism/client/render/RenderPartTransmitter.java b/src/main/java/mekanism/client/render/RenderPartTransmitter.java index 14f0e83ae..b74dd4c1c 100644 --- a/src/main/java/mekanism/client/render/RenderPartTransmitter.java +++ b/src/main/java/mekanism/client/render/RenderPartTransmitter.java @@ -142,11 +142,13 @@ public class RenderPartTransmitter implements IIconSelfRegister public void renderItem(TransmitterType type) { CCRenderState.reset(); - CCRenderState.startDrawing(7); + CCRenderState.startDrawing(); + for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { renderSide(side, type); } + CCRenderState.draw(); } @@ -240,8 +242,7 @@ public class RenderPartTransmitter implements IIconSelfRegister GL11.glPushMatrix(); CCRenderState.reset(); CCRenderState.useNormals = true; - CCRenderState.useModelColours(true); - CCRenderState.startDrawing(7); + CCRenderState.startDrawing(); GL11.glTranslated(pos.x, pos.y, pos.z); for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) @@ -306,7 +307,7 @@ public class RenderPartTransmitter implements IIconSelfRegister } else if(pipe.getConnectionType(side) != ConnectionType.NONE) { GL11.glCullFace(GL11.GL_FRONT); - CCRenderState.startDrawing(7); + CCRenderState.startDrawing(); renderFluidInOut(side, pipe); CCRenderState.draw(); GL11.glCullFace(GL11.GL_BACK); @@ -471,8 +472,7 @@ public class RenderPartTransmitter implements IIconSelfRegister GL11.glPushMatrix(); CCRenderState.reset(); CCRenderState.useNormals = true; - CCRenderState.useModelColours(true); - CCRenderState.startDrawing(7); + CCRenderState.startDrawing(); GL11.glTranslated(pos.x, pos.y, pos.z); for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) @@ -494,7 +494,6 @@ public class RenderPartTransmitter implements IIconSelfRegister { TextureUtils.bindAtlas(0); CCRenderState.reset(); - CCRenderState.useModelColours(true); CCRenderState.setBrightness(transmitter.world(), transmitter.x(), transmitter.y(), transmitter.z()); for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) diff --git a/src/main/java/mekanism/client/voice/VoiceInput.java b/src/main/java/mekanism/client/voice/VoiceInput.java index 6868c5cd0..c571008b4 100644 --- a/src/main/java/mekanism/client/voice/VoiceInput.java +++ b/src/main/java/mekanism/client/voice/VoiceInput.java @@ -40,11 +40,11 @@ public class VoiceInput extends Thread while(voiceClient.running) { - if(MekanismKeyHandler.voiceKey.pressed) + if(MekanismKeyHandler.voiceKey.getIsKeyPressed()) { targetLine.flush(); - while(voiceClient.running && MekanismKeyHandler.voiceKey.pressed) + while(voiceClient.running && MekanismKeyHandler.voiceKey.getIsKeyPressed()) { try { int availableBytes = audioInput.available(); diff --git a/src/main/java/mekanism/common/multipart/PartSidedPipe.java b/src/main/java/mekanism/common/multipart/PartSidedPipe.java index eecaf90f6..8a1e9a63c 100644 --- a/src/main/java/mekanism/common/multipart/PartSidedPipe.java +++ b/src/main/java/mekanism/common/multipart/PartSidedPipe.java @@ -308,12 +308,14 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, @Override @SideOnly(Side.CLIENT) - public void renderStatic(Vector3 pos, LazyLightMatrix olm, int pass) + public boolean renderStatic(Vector3 pos, int pass) { if(pass == 1) { - RenderPartTransmitter.getInstance().renderStatic(this, olm); + RenderPartTransmitter.getInstance().renderStatic(this); } + + return true; } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntitySalinationController.java b/src/main/java/mekanism/common/tile/TileEntitySalinationController.java index b31b5c370..e9c257da9 100644 --- a/src/main/java/mekanism/common/tile/TileEntitySalinationController.java +++ b/src/main/java/mekanism/common/tile/TileEntitySalinationController.java @@ -315,7 +315,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp { if(!temperatureSet) { - biomeTemp = worldObj.getBiomeGenForCoordsBody(xCoord, zCoord).getFloatTemperature(); + biomeTemp = worldObj.getBiomeGenForCoordsBody(xCoord, zCoord).getFloatTemperature(xCoord, yCoord, zCoord); temperatureSet = true; } diff --git a/src/main/java/mekanism/common/util/MekanismUtils.java b/src/main/java/mekanism/common/util/MekanismUtils.java index a69fc8890..1cfdd3f7d 100644 --- a/src/main/java/mekanism/common/util/MekanismUtils.java +++ b/src/main/java/mekanism/common/util/MekanismUtils.java @@ -269,15 +269,6 @@ public final class MekanismUtils return null; } - /** - * Sends the defined message to all players. - * @param msg - message to send - */ - public static void sendChatMessageToAllPlayers(String msg) - { - PacketDispatcher.sendPacketToAllPlayers(new Packet3Chat(msg)); - } - /** * Checks if the mod doesn't need an update. * @return if mod doesn't need an update