More error fixes, down to 11!
This commit is contained in:
parent
1933723b52
commit
295efab7b2
8 changed files with 42 additions and 51 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -480,10 +480,6 @@ public class ClientProxy extends CommonProxy
|
|||
{
|
||||
super.loadUtilities();
|
||||
|
||||
NetworkRegistry.registerConnectionHandler(new ClientConnectionHandler());
|
||||
|
||||
KeyBindingRegistry.registerKeyBinding(new MekanismKeyHandler());
|
||||
|
||||
HolidayManager.init();
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue