Reverting back the version check mechanic I was trying out (different release streams), and some source code cleanup

This commit is contained in:
pahimar 2013-03-19 12:15:09 -04:00
parent f0ac7a41fc
commit e118cb78a7
11 changed files with 38 additions and 80 deletions

View file

@ -25,8 +25,7 @@ import cpw.mods.fml.relauncher.SideOnly;
*
*/
@SideOnly(Side.CLIENT)
public class TileEntityAlchemicalChestRenderer extends
TileEntitySpecialRenderer {
public class TileEntityAlchemicalChestRenderer extends TileEntitySpecialRenderer {
private ModelChest modelChest = new ModelChest();

View file

@ -46,7 +46,6 @@ public class VersionHelper implements Runnable {
private static byte result = UNINITIALIZED;
public static String remoteVersion = null;
public static String remoteUpdateLocation = null;
public static String remoteVersionType = null;
/***
* Checks the version of the currently running instance of the mod against
@ -66,67 +65,33 @@ public class VersionHelper implements Runnable {
String remoteVersionProperty = remoteVersionProperties.getProperty(Loader.instance().getMCVersionString());
if (remoteVersionProperty != null) {
String[] remoteVersionTokens = remoteVersionProperty.split("|");
String[] remoteVersionTokens = remoteVersionProperty.split("\\|");
if (remoteVersionTokens.length == 2) {
if (remoteVersionTokens.length >= 2) {
remoteVersion = remoteVersionTokens[0];
remoteUpdateLocation = remoteVersionTokens[1];
}
else if (remoteVersionTokens.length == 3) {
remoteVersion = remoteVersionTokens[0];
remoteUpdateLocation = remoteVersionTokens[1];
remoteVersionType = remoteVersionTokens[2];
}
else {
result = ERROR;
return;
}
if (remoteVersion != null) {
if (!ConfigurationSettings.LAST_DISCOVERED_VERSION.equalsIgnoreCase(remoteVersion)) {
ConfigurationHandler.set(Configuration.CATEGORY_GENERAL, ConfigurationSettings.LAST_DISCOVERED_VERSION_CONFIGNAME, remoteVersion);
if (remoteVersionType != null) {
ConfigurationHandler.set(Configuration.CATEGORY_GENERAL, ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE_CONFIGNAME, remoteVersionType);
}
}
if (remoteVersion.equalsIgnoreCase(Reference.VERSION)) {
if (remoteVersionType != null) {
if (remoteVersionType.equalsIgnoreCase(Reference.VERSION_TYPE) && remoteVersionType.equalsIgnoreCase(Strings.RECOMMENDED_VERSION)) {
if (remoteVersion.equals(Reference.VERSION)) {
result = CURRENT;
return;
}
}
else {
result = CURRENT;
return;
}
}
else {
result = OUTDATED;
return;
}
}
else {
result = ERROR;
return;
}
}
else {
result = MC_VERSION_NOT_FOUND;
}
/*
* if (remoteVersion != null) { if
* (!ConfigurationSettings.LAST_DISCOVERED_VERSION
* .equalsIgnoreCase(remoteVersion)) {
* ConfigurationHandler.set(Configuration.CATEGORY_GENERAL,
* ConfigurationSettings.LAST_DISCOVERED_VERSION_CONFIGNAME,
* remoteVersion); } if (remoteVersion.equals(Reference.VERSION)) {
* result = CURRENT; return; } } if (remoteVersionProperty == null)
* { result = MC_VERSION_NOT_FOUND; } else { result = OUTDATED; }
*/
}
catch (Exception e) {
}
@ -220,7 +185,7 @@ public class VersionHelper implements Runnable {
LogHelper.log(Level.INFO, LanguageRegistry.instance().getStringLocalization(Strings.VERSION_CHECK_INIT_LOG_MESSAGE) + " " + REMOTE_VERSION_XML_FILE);
try {
while (count < Reference.VERSION_CHECK_ATTEMPTS && (result == UNINITIALIZED || result == ERROR)) {
while (count < Reference.VERSION_CHECK_ATTEMPTS - 1 && (result == UNINITIALIZED || result == ERROR)) {
checkVersion();
count++;

View file

@ -25,8 +25,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*
*/
public class ItemMiniumStone extends ItemEE
implements ITransmutationStone, IKeyBound {
public class ItemMiniumStone extends ItemEE implements ITransmutationStone, IKeyBound {
public ItemMiniumStone(int id) {

View file

@ -18,7 +18,6 @@ public class Reference {
public static final String MOD_ID = "EE3";
public static final String MOD_NAME = "Equivalent Exchange 3";
public static final String VERSION = "@VERSION@";
public static final String VERSION_TYPE = "@VERSION_TYPE@";
public static final String CHANNEL_NAME = MOD_ID;
public static final int SECOND_IN_TICKS = 20;
public static final int SHIFTED_ID_RANGE_CORRECTION = 256;

View file

@ -23,8 +23,6 @@ public class Strings {
public static final String GENERAL_ERROR_MESSAGE = "version.general_error";
public static final String FINAL_ERROR_MESSAGE = "version.final_error";
public static final String MC_VERSION_NOT_FOUND = "version.mc_version_not_found";
public static final String DEVELOPMENT_VERSION = "Development";
public static final String RECOMMENDED_VERSION = "Recommended";
/* NBT related constants */
public static final String NBT_ITEM_CHARGE_LEVEL_KEY = "itemChargeLevel";

View file

@ -25,12 +25,9 @@ import com.pahimar.ee3.network.packet.PacketTileUpdate;
*
*/
public enum PacketTypeHandler {
KEY(PacketKeyPressed.class),
TILE(PacketTileUpdate.class),
REQUEST_EVENT(PacketRequestEvent.class),
SPAWN_PARTICLE(PacketSpawnParticle.class),
SOUND_EVENT(PacketSoundEvent.class),
ITEM_UPDATE(PacketItemUpdate.class);
KEY(PacketKeyPressed.class), TILE(PacketTileUpdate.class), REQUEST_EVENT(
PacketRequestEvent.class), SPAWN_PARTICLE(PacketSpawnParticle.class), SOUND_EVENT(
PacketSoundEvent.class), ITEM_UPDATE(PacketItemUpdate.class);
private Class<? extends PacketEE> clazz;

View file

@ -16,6 +16,7 @@ public class Face {
public int glDrawingMode;
public Vec3 getFaceNormal() {
Vec3 v1 = Vec3.createVectorHelper(vertices[1].x - vertices[0].x, vertices[1].y - vertices[0].y, vertices[1].z - vertices[0].z);
Vec3 v2 = Vec3.createVectorHelper(vertices[2].x - vertices[0].x, vertices[2].y - vertices[0].y, vertices[2].z - vertices[0].z);

View file

@ -7,5 +7,5 @@
<entry key="Minecraft 1.4.5">pre1d|http://goo.gl/Ria2V</entry>
<entry key="Minecraft 1.4.6">pre1e|http://goo.gl/Ria2V</entry>
<entry key="Minecraft 1.4.7">pre1f|http://goo.gl/Ria2V</entry>
<entry key="Minecraft 1.5">pre1g|http://goo.gl/Ria2V|Development</entry>
<entry key="Minecraft 1.5">pre1g|http://goo.gl/Ria2V</entry>
</properties>