From 69a710428673bb76fc739e726bebbbe201d30e44 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 7 Oct 2018 11:14:54 -0400 Subject: [PATCH] Updated Android tool versions --- android/build.gradle | 34 ++----------------- build.gradle | 2 +- .../world/blocks/power/PowerGraph.java | 11 ++++++ .../world/blocks/power/PowerNode.java | 20 +++++------ 4 files changed, 25 insertions(+), 42 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 9b31844377..3f0cb0691c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -36,8 +36,8 @@ task deploy(type: Copy){ } android { - buildToolsVersion '27.0.3' - compileSdkVersion 27 + buildToolsVersion '28.0.2' + compileSdkVersion 28 sourceSets { main { manifest.srcFile 'AndroidManifest.xml' @@ -137,6 +137,7 @@ task copyAndroidNatives() { } } } + task run(type: Exec) { def path def localProperties = project.file("../local.properties") @@ -158,36 +159,7 @@ task run(type: Exec) { def adb = path + "/platform-tools/adb" commandLine "$adb", 'shell', 'am', 'start', '-n', 'io.anuke.mindustry/io.anuke.mindustry.AndroidLauncher' } -// sets up the Android Eclipse project, using the old Ant based build. -eclipse { - // need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin - // ignores any nodes added in classpath.file.withXml - sourceSets { - main { - java.srcDirs "src", 'gen' - } - } - jdt { - sourceCompatibility = 1.7 - targetCompatibility = 1.7 - } - - classpath { - plusConfigurations += [project.configurations.compile] - containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES' - } - - project { - name = appName + "-android" - natures 'com.android.ide.eclipse.adt.AndroidNature' - buildCommands.clear() - buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder" - buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder" - buildCommand "org.eclipse.jdt.core.javabuilder" - buildCommand "com.android.ide.eclipse.adt.ApkBuilder" - } -} // sets up the Android Idea project, using the old Ant based build. idea { module { diff --git a/build.gradle b/build.gradle index 3c49d8d45a..ce8e3c85f4 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { dependencies { classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0' classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6' - classpath 'com.android.tools.build:gradle:3.1.3' + classpath 'com.android.tools.build:gradle:3.2.0' classpath "com.badlogicgames.gdx:gdx-tools:1.9.8" } } diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java index c17ad9986a..f6be43f919 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java @@ -133,4 +133,15 @@ public class PowerGraph{ } } } + + @Override + public String toString(){ + return "PowerGraph{" + + "producers=" + producers + + ", consumers=" + consumers + + ", all=" + all + + ", lastFrameUpdated=" + lastFrameUpdated + + ", graphID=" + graphID + + '}'; + } } diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java index a69049b986..5cb5f77c2d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java @@ -74,22 +74,22 @@ public class PowerNode extends PowerBlock{ TileEntity entity = tile.entity(); - entity.power.links.removeValue(other.packedPosition()); - - if(other.block() instanceof PowerNode){ - other.entity.power.links.removeValue(tile.packedPosition()); - } - //clear all graph data first PowerGraph tg = entity.power.graph; tg.clear(); + + entity.power.links.removeValue(other.packedPosition()); + other.entity.power.links.removeValue(tile.packedPosition()); + //reflow from this point, covering all tiles on this side tg.reflow(tile); - //create new graph for other end - PowerGraph og = new PowerGraph(); - //reflow from other end - og.reflow(other); + if(other.entity.power.graph != tg){ + //create new graph for other end + PowerGraph og = new PowerGraph(); + //reflow from other end + og.reflow(other); + } } @Override