mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-12 16:27:27 +00:00
Make Aspects#set not undoable
This commit is contained in:
1 parent
44bb751d54
commit
ba2df81fe7
4 files changed
+35
-12
No files matched your search
+18
-3
@@ -1,17 +1,24 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
url = "https://maven.minecraftforge.net"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
maven {
|
||||
name = "Scala CI dependencies"
|
||||
url = "https://repo1.maven.org/maven2/"
|
||||
}
|
||||
maven {
|
||||
name = "jitpack"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,3 +81,11 @@ task deobfJar(type: Jar) {
|
||||
}
|
||||
|
||||
tasks.build.dependsOn deobfJar
|
||||
|
||||
idea {
|
||||
module {
|
||||
inheritOutputDirs = false
|
||||
outputDir = compileJava.destinationDir
|
||||
testOutputDir = compileTestJava.destinationDir
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
minecraft.version=1.7.10
|
||||
forge.version=10.13.4.1448-1.7.10
|
||||
forge.version=10.13.4.1614-1.7.10
|
||||
|
||||
mod.version=0.9.6
|
||||
mod.version=0.9.7-GTNH
|
||||
|
||||
forestry.version=4.1.0.43
|
||||
+1
-1
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
||||
@@ -37,7 +37,6 @@ public class Aspects {
|
||||
private final String aspects;
|
||||
private final boolean replace;
|
||||
private AspectList oldList;
|
||||
private AspectList newList;
|
||||
|
||||
public Add(ItemStack stack, String aspects, boolean replace) {
|
||||
super("Aspects");
|
||||
@@ -48,19 +47,28 @@ public class Aspects {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
oldList = ThaumcraftApiHelper.getObjectAspects(stack);
|
||||
if (!replace)
|
||||
newList = ThaumcraftHelper.parseAspects(oldList, aspects);
|
||||
else
|
||||
AspectList newList;
|
||||
if (replace) {
|
||||
newList = ThaumcraftHelper.parseAspects(aspects);
|
||||
|
||||
} else {
|
||||
oldList = ThaumcraftApiHelper.getObjectAspects(stack);
|
||||
newList = ThaumcraftHelper.parseAspects(oldList, aspects);
|
||||
}
|
||||
|
||||
ThaumcraftApi.objectTags.put(Arrays.asList(stack.getItem(), stack.getItemDamage()), newList);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return !replace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (replace)
|
||||
return;
|
||||
if (oldList == null) {
|
||||
ThaumcraftApi.objectTags.remove(Arrays.asList(stack.getItem(), stack.getItemDamage()));
|
||||
} else
|
||||
|
||||
Reference in new issue
Block a user