Donator data is now pulled remotely, digital miner shouldn't halt the game anymore, fixed Electrolytic Separator issue. @pgatt, please test.
This commit is contained in:
parent
74e14284c7
commit
2ec88debdf
|
@ -35,7 +35,8 @@ public class SalinationControllerRecipeHandler extends BaseRecipeHandler
|
|||
public static int xOffset = 5;
|
||||
public static int yOffset = 12;
|
||||
|
||||
static {
|
||||
static
|
||||
{
|
||||
if(recipes.isEmpty())
|
||||
{
|
||||
recipes.put(new FluidStack(FluidRegistry.WATER, 1), new FluidStack(FluidRegistry.getFluid("brine"), 1));
|
||||
|
|
|
@ -1215,17 +1215,6 @@ public class Mekanism
|
|||
PacketHandler.registerPacket(PacketConfigSync.class);
|
||||
PacketHandler.registerPacket(PacketBoxBlacklist.class);
|
||||
|
||||
//Donators
|
||||
donators.add("mrgreaper");
|
||||
donators.add("ejmiv89");
|
||||
donators.add("Greylocke");
|
||||
donators.add("darkphan");
|
||||
donators.add("Nephatrine");
|
||||
donators.add("SoldierW518");
|
||||
donators.add("JamesNorth");
|
||||
donators.add("Ozurian");
|
||||
donators.add("Not_Steve");
|
||||
|
||||
//Load proxy
|
||||
proxy.registerRenderInformation();
|
||||
proxy.loadUtilities();
|
||||
|
|
|
@ -20,11 +20,7 @@ public class ThreadGetData extends Thread
|
|||
{
|
||||
Mekanism.latestVersionNumber = MekanismUtils.getLatestVersion();
|
||||
Mekanism.recentNews = MekanismUtils.getRecentNews();
|
||||
System.out.println("[Mekanism] Successfully retrieved data from server.");
|
||||
try {
|
||||
finalize();
|
||||
} catch(Throwable t) {
|
||||
System.out.println("[Mekanism] Unable to finalize server data.");
|
||||
}
|
||||
|
||||
MekanismUtils.updateDonators();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,6 +160,11 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
int index = oresToMine.nextSetBit(next);
|
||||
Coord4D coord = getCoordFromIndex(index);
|
||||
|
||||
if(index == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if(!coord.exists(worldObj))
|
||||
{
|
||||
next = index;
|
||||
|
@ -206,9 +211,9 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
worldObj.playAuxSFXAtEntity(null, 2001, coord.xCoord, coord.yCoord, coord.zCoord, id + (meta << 12));
|
||||
|
||||
delay = getDelay();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
for(Integer i : toRemove)
|
||||
|
|
|
@ -62,9 +62,6 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
|
||||
/** Type type of gas this block is dumping. */
|
||||
public boolean dumpRight = false;
|
||||
|
||||
/** Whether to dump excess gas when a tank is full */
|
||||
public boolean dumpExcess = true; // default to true until gui elements added
|
||||
|
||||
public TileEntityElectrolyticSeparator()
|
||||
{
|
||||
|
@ -201,12 +198,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
}
|
||||
|
||||
public boolean canFill(ChemicalPair gases)
|
||||
{
|
||||
if(dumpExcess)
|
||||
{
|
||||
return leftTank.canReceiveType(gases.leftGas.getGas()) && rightTank.canReceiveType(gases.rightGas.getGas());
|
||||
}
|
||||
|
||||
{
|
||||
return (leftTank.canReceive(gases.leftGas.getGas()) && leftTank.getNeeded() >= gases.leftGas.amount
|
||||
&& rightTank.canReceive(gases.rightGas.getGas()) && rightTank.getNeeded() >= gases.rightGas.amount);
|
||||
}
|
||||
|
|
|
@ -9,10 +9,8 @@ import java.net.HttpURLConnection;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
|
@ -26,9 +24,9 @@ import mekanism.common.IFactory.RecipeType;
|
|||
import mekanism.common.IInvConfiguration;
|
||||
import mekanism.common.IModule;
|
||||
import mekanism.common.IRedstoneControl;
|
||||
import mekanism.common.OreDictCache;
|
||||
import mekanism.common.IRedstoneControl.RedstoneControl;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.OreDictCache;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.PacketHandler.Transmission;
|
||||
import mekanism.common.Teleporter;
|
||||
|
@ -143,7 +141,7 @@ public final class MekanismUtils
|
|||
*/
|
||||
public static String getLatestVersion()
|
||||
{
|
||||
String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt").split(":");
|
||||
String[] text = merge(getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt")).split(":");
|
||||
if(!text[0].contains("UTF-8") && !text[0].contains("HTML") && !text[0].contains("http")) return text[0];
|
||||
return "null";
|
||||
}
|
||||
|
@ -154,46 +152,68 @@ public final class MekanismUtils
|
|||
*/
|
||||
public static String getRecentNews()
|
||||
{
|
||||
String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt").split(":");
|
||||
String[] text = merge(getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt")).split(":");
|
||||
if(text.length > 1 && !text[1].contains("UTF-8") && !text[1].contains("HTML") && !text[1].contains("http")) return text[1];
|
||||
return "null";
|
||||
}
|
||||
|
||||
public static void updateDonators()
|
||||
{
|
||||
Mekanism.donators.clear();
|
||||
List<String> text = getHTML("http://dl.dropbox.com/u/90411166/Donators/Mekanism.txt");
|
||||
|
||||
for(String s : text)
|
||||
{
|
||||
Mekanism.donators.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns one line of HTML from the url.
|
||||
* @param urlToRead - URL to read from.
|
||||
* @return HTML text from the url.
|
||||
*/
|
||||
public static String getHTML(String urlToRead)
|
||||
public static List<String> getHTML(String urlToRead)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
URL url;
|
||||
HttpURLConnection conn;
|
||||
BufferedReader rd;
|
||||
String line;
|
||||
String result = "";
|
||||
List<String> result = new ArrayList<String>();
|
||||
|
||||
try {
|
||||
url = new URL(urlToRead);
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn = (HttpURLConnection)url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
|
||||
while((line = rd.readLine()) != null)
|
||||
{
|
||||
result += line;
|
||||
sb.append(line);
|
||||
result.add(line.trim());
|
||||
}
|
||||
|
||||
rd.close();
|
||||
} catch (Exception e) {
|
||||
result = "null";
|
||||
} catch(Exception e) {
|
||||
result.clear();
|
||||
result.add("null");
|
||||
System.err.println("[Mekanism] An error occured while connecting to URL '" + urlToRead + ".'");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String merge(List<String> text)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
for(String s : text)
|
||||
{
|
||||
builder.append(s);
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a Packet3Chat packet to the defined player, with the defined message.
|
||||
* @param player - Player to send packet to.
|
||||
|
|
Loading…
Reference in a new issue