feat: add crucible mechanics config option
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Timo Ley 2023-01-21 23:31:46 +01:00
parent eb7c01ad7b
commit b98a39af6e
3 changed files with 52 additions and 10 deletions

View File

@ -24,7 +24,7 @@ apply from: './gradle/scripts/mixins.gradle'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
version = "1.7.5"
version = "1.8.0"
group= "dev.tilera"
archivesBaseName = "auracore"

View File

@ -16,6 +16,7 @@ public class Config {
public static boolean replaceAspects = true;
public static boolean legacyAspects = false;
public static boolean generateEldritchRing = true;
public static boolean legacyCrucibleMechanics = true;
public static boolean noScanning() {
return knowAllAspects;
@ -31,6 +32,7 @@ public class Config {
replaceAspects = config.getBoolean("replaceAspects", "client", replaceAspects, "Replace some aspect textures");
legacyAspects = config.getBoolean("legacyAspects", "aspects", legacyAspects, "Use TC3 item aspects");
generateEldritchRing = config.getBoolean("generateEldritchRing", "worldgen", generateEldritchRing, "Generate Eldritch Ring structures");
legacyCrucibleMechanics = config.getBoolean("legacyCrucibleMechanics", "crucible", legacyCrucibleMechanics, "Use TC3 crucible mechanics");
config.save();
}

View File

@ -4,6 +4,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import dev.tilera.auracore.Config;
import dev.tilera.auracore.api.IAlembic;
import dev.tilera.auracore.aura.AuraManager;
import net.minecraft.block.Block;
@ -39,6 +40,8 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
@Shadow(remap = false)
public abstract int tagAmount();
@Shadow(remap = false)
public abstract void spill();
@Shadow(remap = false)
abstract void drawEffects();
boolean spillNextTick = false;
@ -91,8 +94,13 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
}
}
}
AuraManager.addFluxToClosest(this.worldObj, (float) this.xCoord + 0.5f, (float) this.yCoord + 0.5f,
(float) this.zCoord + 0.5f, this.aspects);
if (Config.legacyCrucibleMechanics) {
AuraManager.addFluxToClosest(this.worldObj, (float) this.xCoord + 0.5f, (float) this.yCoord + 0.5f, (float) this.zCoord + 0.5f, this.aspects);
} else {
for(int a = 0; a < this.aspects.visSize() / 2; ++a) {
this.spill();
}
}
this.aspects = new AspectList();
this.markDirty();
@ -143,13 +151,45 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
}
}
}
if (this.tagAmount() > 500 && this.counter % 5L == 0L) {
AspectList tt = this.takeRandomFromSource();
AuraManager.addFluxToClosest(this.worldObj, this.xCoord, this.yCoord, this.zCoord, tt);
if (this.tagAmount() <= 500) {
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
if (Config.legacyCrucibleMechanics) {
if (this.tagAmount() > 500 && this.counter % 5L == 0L) {
AspectList tt = this.takeRandomFromSource();
AuraManager.addFluxToClosest(this.worldObj, this.xCoord, this.yCoord, this.zCoord, tt);
if (this.tagAmount() <= 500) {
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
}
} else {
if (this.tagAmount() > 100 && this.counter % 5L == 0L) {
this.takeRandomFromSource();
this.spill();
}
if (this.counter > 100L && this.heat > 150) {
this.counter = 0L;
if (this.tagAmount() > 0) {
int s = this.aspects.getAspects().length;
Aspect a = this.aspects.getAspects()[super.worldObj.rand.nextInt(s)];
if (a.isPrimal()) {
a = this.aspects.getAspects()[super.worldObj.rand.nextInt(s)];
}
this.tank.drain(2, true);
this.aspects.remove(a, 1);
if (!a.isPrimal()) {
if (super.worldObj.rand.nextBoolean()) {
this.aspects.add(a.getComponents()[0], 1);
} else {
this.aspects.add(a.getComponents()[1], 1);
}
} else {
this.spill();
}
}
this.markDirty();
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
}
}
} else if (this.tank.getFluidAmount() > 0) {
this.drawEffects();