Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
This commit is contained in:
@@ -134,7 +134,10 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
|||||||
int maxX = 15;
|
int maxX = 15;
|
||||||
int maxY = 15;
|
int maxY = 15;
|
||||||
|
|
||||||
TileEntity te = getHost().getTile();
|
IPartHost host = getHost();
|
||||||
|
if ( host != null )
|
||||||
|
{
|
||||||
|
TileEntity te = host.getTile();
|
||||||
|
|
||||||
int x = te.xCoord;
|
int x = te.xCoord;
|
||||||
int y = te.yCoord;
|
int y = te.yCoord;
|
||||||
@@ -154,6 +157,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
|||||||
|
|
||||||
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
|
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
|
||||||
maxY = 16;
|
maxY = 16;
|
||||||
|
}
|
||||||
|
|
||||||
bch.addBox( 5, 5, 14, 11, 11, 15 );
|
bch.addBox( 5, 5, 14, 11, 11, 15 );
|
||||||
bch.addBox( minX, minY, 15, maxX, maxY, bch.isBBCollision() ? 15 : 16 );
|
bch.addBox( minX, minY, 15, maxX, maxY, bch.isBBCollision() ? 15 : 16 );
|
||||||
|
|||||||
@@ -201,7 +201,10 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
|||||||
int maxX = 15;
|
int maxX = 15;
|
||||||
int maxY = 15;
|
int maxY = 15;
|
||||||
|
|
||||||
TileEntity te = getHost().getTile();
|
IPartHost host = getHost();
|
||||||
|
if ( host != null )
|
||||||
|
{
|
||||||
|
TileEntity te = host.getTile();
|
||||||
|
|
||||||
int x = te.xCoord;
|
int x = te.xCoord;
|
||||||
int y = te.yCoord;
|
int y = te.yCoord;
|
||||||
@@ -221,6 +224,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
|||||||
|
|
||||||
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
|
if ( isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), side ) )
|
||||||
maxY = 16;
|
maxY = 16;
|
||||||
|
}
|
||||||
|
|
||||||
bch.addBox( 5, 5, 14, 11, 11, 15 );
|
bch.addBox( 5, 5, 14, 11, 11, 15 );
|
||||||
bch.addBox( minX, minY, 15, maxX, maxY, 16 );
|
bch.addBox( minX, minY, 15, maxX, maxY, 16 );
|
||||||
@@ -399,7 +403,8 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
|||||||
side.offsetX, side.offsetY, side.offsetZ );
|
side.offsetX, side.offsetY, side.offsetZ );
|
||||||
|
|
||||||
if ( Worked == false && side.offsetX == 0 && side.offsetZ == 0 )
|
if ( Worked == false && side.offsetX == 0 && side.offsetZ == 0 )
|
||||||
Worked = i.onItemUse( is, player, w, x-side.offsetX, y-side.offsetY, z-side.offsetZ, side.ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
Worked = i.onItemUse( is, player, w, x - side.offsetX, y - side.offsetY, z - side.offsetZ, side.ordinal(), side.offsetX,
|
||||||
|
side.offsetY, side.offsetZ );
|
||||||
|
|
||||||
if ( Worked == false && side.offsetY == 0 )
|
if ( Worked == false && side.offsetY == 0 )
|
||||||
Worked = i.onItemUse( is, player, w, x, y - 1, z, ForgeDirection.UP.ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
Worked = i.onItemUse( is, player, w, x, y - 1, z, ForgeDirection.UP.ordinal(), side.offsetX, side.offsetY, side.offsetZ );
|
||||||
|
|||||||
@@ -5,11 +5,18 @@ import java.io.InputStreamReader;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.AELog;
|
import appeng.core.AELog;
|
||||||
|
import appeng.core.AppEng;
|
||||||
|
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
|
|
||||||
public class VersionChecker implements Runnable
|
public class VersionChecker implements Runnable
|
||||||
{
|
{
|
||||||
@@ -17,6 +24,7 @@ public class VersionChecker implements Runnable
|
|||||||
public static VersionChecker instance = null;
|
public static VersionChecker instance = null;
|
||||||
|
|
||||||
private long delay = 0;
|
private long delay = 0;
|
||||||
|
private boolean VersionChecker = true;
|
||||||
|
|
||||||
public VersionChecker() {
|
public VersionChecker() {
|
||||||
long now = (new Date()).getTime();
|
long now = (new Date()).getTime();
|
||||||
@@ -41,13 +49,12 @@ public class VersionChecker implements Runnable
|
|||||||
Thread.yield();
|
Thread.yield();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
URL url = new URL( "http://ae-mod.info/releases/?latest" );
|
String MCVersion = cpw.mods.fml.common.Loader.instance().getMCVersionString().replace( "Minecraft ", "" );
|
||||||
|
URL url = new URL( "http://ae2.ae-mod.info/builds/latest.json?VersionMC=" + MCVersion + "&Channel=" + AEConfig.CHANNEL + "&CurrentVersion="
|
||||||
String MCVersion = cpw.mods.fml.common.Loader.instance().getMCVersionString();
|
+ AEConfig.VERSION );
|
||||||
|
|
||||||
URLConnection yc = url.openConnection();
|
URLConnection yc = url.openConnection();
|
||||||
yc.setRequestProperty( "User-Agent", "AE2/" + AEConfig.VERSION + " (Channel:" + AEConfig.CHANNEL + "," + MCVersion.replace( " ", ":" )
|
yc.setRequestProperty( "User-Agent", "AE2/" + AEConfig.VERSION + " (Channel:" + AEConfig.CHANNEL + "," + MCVersion.replace( " ", ":" ) + ")" );
|
||||||
+ ")" );
|
|
||||||
BufferedReader in = new BufferedReader( new InputStreamReader( yc.getInputStream() ) );
|
BufferedReader in = new BufferedReader( new InputStreamReader( yc.getInputStream() ) );
|
||||||
|
|
||||||
String Version = "";
|
String Version = "";
|
||||||
@@ -60,12 +67,42 @@ public class VersionChecker implements Runnable
|
|||||||
|
|
||||||
if ( Version.length() > 2 )
|
if ( Version.length() > 2 )
|
||||||
{
|
{
|
||||||
Matcher m = Pattern.compile( "\"Version\":\"([^\"]+)\"" ).matcher( Version );
|
JsonElement element = (new JsonParser()).parse( Version );
|
||||||
m.find();
|
|
||||||
Version = m.group( 1 );
|
int version = element.getAsJsonObject().get( "FormatVersion" ).getAsInt();
|
||||||
AEConfig.instance.latestVersion = Version;
|
if ( version == 1 )
|
||||||
|
{
|
||||||
|
JsonObject Meta = element.getAsJsonObject().get( "Meta" ).getAsJsonObject();
|
||||||
|
JsonArray Versions = element.getAsJsonObject().get( "Versions" ).getAsJsonArray();
|
||||||
|
if ( Versions.size() > 0 )
|
||||||
|
{
|
||||||
|
JsonObject Latest = Versions.get( 0 ).getAsJsonObject();
|
||||||
|
|
||||||
|
AEConfig.instance.latestVersion = Latest.get( "Version" ).getAsString();
|
||||||
AEConfig.instance.latestTimeStamp = (new Date()).getTime();
|
AEConfig.instance.latestTimeStamp = (new Date()).getTime();
|
||||||
AEConfig.instance.save();
|
AEConfig.instance.save();
|
||||||
|
|
||||||
|
if ( VersionChecker && !AEConfig.VERSION.equals( AEConfig.instance.latestVersion ) )
|
||||||
|
{
|
||||||
|
NBTTagCompound versionInf = new NBTTagCompound();
|
||||||
|
versionInf.setString( "modDisplayName", "Applied Energistics 2" );
|
||||||
|
versionInf.setString( "oldVersion", AEConfig.VERSION );
|
||||||
|
versionInf.setString( "newVersion", AEConfig.instance.latestVersion );
|
||||||
|
versionInf.setString( "updateUrl", Latest.get( "UserBuild" ).getAsString() );
|
||||||
|
versionInf.setBoolean( "isDirectLink", true );
|
||||||
|
|
||||||
|
JsonElement changeLog = Latest.get( "ChangeLog" );
|
||||||
|
if ( changeLog == null )
|
||||||
|
versionInf.setString( "changeLog", "For full change log please see: " + Meta.get( "DownloadLink" ).getAsString() );
|
||||||
|
else
|
||||||
|
versionInf.setString( "changeLog", changeLog.getAsString() );
|
||||||
|
|
||||||
|
versionInf.setString( "newFileName", "appliedenergistics2-" + AEConfig.instance.latestVersion + ".jar" );
|
||||||
|
FMLInterModComms.sendRuntimeMessage( AppEng.instance, "VersionChecker", "addUpdate", versionInf );
|
||||||
|
VersionChecker = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.sleep( 1000 * 3600 * 4 );
|
Thread.sleep( 1000 * 3600 * 4 );
|
||||||
@@ -83,5 +120,4 @@ public class VersionChecker implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user