mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Bridging gap between old and new versions of Update Checker
This commit is contained in:
parent
b1d070595b
commit
dc6e0b05be
5 changed files with 8 additions and 13 deletions
|
@ -16,7 +16,6 @@ import ellpeck.actuallyadditions.util.WorldPos;
|
|||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -123,7 +122,7 @@ public class LaserRelayConnectionHandler{
|
|||
* (Puts it into the correct network!)
|
||||
*/
|
||||
public boolean addConnection(WorldPos firstRelay, WorldPos secondRelay){
|
||||
int distance = (int)Vec3.createVectorHelper(firstRelay.getX(), firstRelay.getY(), firstRelay.getZ()).distanceTo(Vec3.createVectorHelper(secondRelay.getX(), secondRelay.getY(), secondRelay.getZ()));
|
||||
int distance = (int)firstRelay.toVec().distanceTo(secondRelay.toVec());
|
||||
if(distance > 15 || firstRelay.isEqual(secondRelay) || firstRelay.getWorld() != secondRelay.getWorld()){
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -28,22 +28,16 @@ public class ThreadUpdateChecker extends Thread{
|
|||
public void run(){
|
||||
ModUtil.LOGGER.info("Starting Update Check...");
|
||||
try{
|
||||
URL newestURL = new URL("https://raw.githubusercontent.com/Ellpeck/ActuallyAdditions/master/update/newestVersion.txt");
|
||||
URL newestURL = new URL("https://raw.githubusercontent.com/Ellpeck/ActuallyAdditions/master/update/updateVersion.txt");
|
||||
BufferedReader newestReader = new BufferedReader(new InputStreamReader(newestURL.openStream()));
|
||||
UpdateChecker.updateVersion = newestReader.readLine();
|
||||
newestReader.close();
|
||||
|
||||
//Legacy Versions
|
||||
if(!ModUtil.VERSION.contains("r")){
|
||||
UpdateChecker.needsUpdateNotify = true;
|
||||
}
|
||||
else{
|
||||
int updateVersion = Integer.parseInt(UpdateChecker.updateVersion.replace("-", "").replace(".", "").replace("r", ""));
|
||||
int clientVersion = Integer.parseInt(ModUtil.VERSION.replace("-", "").replace(".", "").replace("r", ""));
|
||||
if(updateVersion > clientVersion){
|
||||
UpdateChecker.needsUpdateNotify = true;
|
||||
}
|
||||
}
|
||||
|
||||
ModUtil.LOGGER.info("Update Check done!");
|
||||
}
|
||||
|
|
1
update/changelog.txt
Normal file
1
update/changelog.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Laser Relays, out of Beta! +New Update Checker
|
|
@ -1 +1 @@
|
|||
1.7.10-0.0.9.4
|
||||
1.7.10-1
|
1
update/updateVersion.txt
Normal file
1
update/updateVersion.txt
Normal file
|
@ -0,0 +1 @@
|
|||
1.7.10-r1
|
Loading…
Reference in a new issue