Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2018-10-07 19:22:18 -03:00
4 changed files with 25 additions and 42 deletions

View File

@@ -36,8 +36,8 @@ task deploy(type: Copy){
} }
android { android {
buildToolsVersion '27.0.3' buildToolsVersion '28.0.2'
compileSdkVersion 27 compileSdkVersion 28
sourceSets { sourceSets {
main { main {
manifest.srcFile 'AndroidManifest.xml' manifest.srcFile 'AndroidManifest.xml'
@@ -137,6 +137,7 @@ task copyAndroidNatives() {
} }
} }
} }
task run(type: Exec) { task run(type: Exec) {
def path def path
def localProperties = project.file("../local.properties") def localProperties = project.file("../local.properties")
@@ -158,36 +159,7 @@ task run(type: Exec) {
def adb = path + "/platform-tools/adb" def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'io.anuke.mindustry/io.anuke.mindustry.AndroidLauncher' 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. // sets up the Android Idea project, using the old Ant based build.
idea { idea {
module { module {

View File

@@ -9,7 +9,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0' classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0'
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6' 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" classpath "com.badlogicgames.gdx:gdx-tools:1.9.8"
} }
} }

View File

@@ -133,4 +133,15 @@ public class PowerGraph{
} }
} }
} }
@Override
public String toString(){
return "PowerGraph{" +
"producers=" + producers +
", consumers=" + consumers +
", all=" + all +
", lastFrameUpdated=" + lastFrameUpdated +
", graphID=" + graphID +
'}';
}
} }

View File

@@ -74,23 +74,23 @@ public class PowerNode extends PowerBlock{
TileEntity entity = tile.entity(); 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 //clear all graph data first
PowerGraph tg = entity.power.graph; PowerGraph tg = entity.power.graph;
tg.clear(); 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 //reflow from this point, covering all tiles on this side
tg.reflow(tile); tg.reflow(tile);
if(other.entity.power.graph != tg){
//create new graph for other end //create new graph for other end
PowerGraph og = new PowerGraph(); PowerGraph og = new PowerGraph();
//reflow from other end //reflow from other end
og.reflow(other); og.reflow(other);
} }
}
@Override @Override
public void setBars(){ public void setBars(){