diff --git a/.gitignore b/.gitignore index a70fcdae..184705d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ !/Features.md !/LICENSE !/README.md -!/src \ No newline at end of file +!/src +!build.gradle \ No newline at end of file diff --git a/ChangeLog.txt b/ChangeLog.txt index 8a3efcd9..5bf890c8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,11 @@ -10/12/2014 0.7.0b +10/19/2014 0.7.1b + Fixes #63: Essentia gas generation moved to post-init event. + This should now support all TC addon essentia types. + +10/13/2014 0.7.1b + Fixes #57: Export buses not longer crash when attempting to export to empty jar. + +10/12/2014 0.7.0b Dependency Changed: Thaumcraft 4.2.1.4 Updated forge to 10.13.1.1225 Fixes #47: Configurable Fluid conversion ratio. diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..fa45e434 --- /dev/null +++ b/build.gradle @@ -0,0 +1,63 @@ +buildscript { + repositories { + mavenCentral() + maven { + name = "forge" + url = "http://files.minecraftforge.net/maven" + } + maven { + name = "sonatype" + url = "https://oss.sonatype.org/content/repositories/snapshots/" + } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + } +} + +apply plugin: 'forge' + +version = "0.7.1b" +group= "thaumicenergistics" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "thaumicenergistics" + +minecraft { + version = "1.7.10-10.13.1.1225" + assetDir = "eclipse/assets" +} + +dependencies { + // you may put jars on which you depend on in ./libs + // or you may define them like so.. + //compile "some.group:artifact:version:classifier" + //compile "some.group:artifact:version" + + // real examples + //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env + //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + + // for more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html + +} + +processResources +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/src/main/java/thaumicenergistics/ThaumicEnergistics.java b/src/main/java/thaumicenergistics/ThaumicEnergistics.java index cd6c13aa..e5fe3d5f 100644 --- a/src/main/java/thaumicenergistics/ThaumicEnergistics.java +++ b/src/main/java/thaumicenergistics/ThaumicEnergistics.java @@ -23,7 +23,7 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; -@Mod(modid = ThaumicEnergistics.MOD_ID, name = "Thaumic Energistics", version = ThaumicEnergistics.VERSION, dependencies = "required-after:appliedenergistics2;required-after:Thaumcraft;after:Waila;after:ForbiddenMagic;after:MagicBees") +@Mod(modid = ThaumicEnergistics.MOD_ID, name = "Thaumic Energistics", version = ThaumicEnergistics.VERSION, dependencies = "required-after:appliedenergistics2;required-after:Thaumcraft;after:Waila") public class ThaumicEnergistics { /* @@ -48,7 +48,7 @@ public class ThaumicEnergistics /** * Current version of the mod. */ - public static final String VERSION = "0.7.0b"; // Note: don't forget to change the build.gradle file as well + public static final String VERSION = "0.7.1b"; // Note: don't forget to change the build.gradle file as well /** * Singleton instance @@ -270,6 +270,9 @@ public class ThaumicEnergistics // Register TC research ThaumicEnergistics.proxy.registerResearch(); + // Register fluids + ThaumicEnergistics.proxy.registerFluids(); + this.endLoadStageTracking( t ); } @@ -302,9 +305,6 @@ public class ThaumicEnergistics // Register items ThaumicEnergistics.proxy.registerItems(); - // Register fluids - ThaumicEnergistics.proxy.registerFluids(); - // Register blocks ThaumicEnergistics.proxy.registerBlocks(); diff --git a/src/main/java/thaumicenergistics/integration/tc/EssentiaTileContainerHelper.java b/src/main/java/thaumicenergistics/integration/tc/EssentiaTileContainerHelper.java index 707f783e..88e76846 100644 --- a/src/main/java/thaumicenergistics/integration/tc/EssentiaTileContainerHelper.java +++ b/src/main/java/thaumicenergistics/integration/tc/EssentiaTileContainerHelper.java @@ -455,11 +455,14 @@ public final class EssentiaTileContainerHelper return 0; } + // Get the aspect in the container + AspectStack storedEssentia = this.getAspectStackFromContainer( container ); + // Match types on jars - if( ( container instanceof TileJarFillable ) ) + if( ( storedEssentia != null ) && ( container instanceof TileJarFillable ) ) { // Do the aspects match? - if( aspectToFill != this.getAspectStackFromContainer( container ).aspect ) + if( aspectToFill != storedEssentia.aspect ) { // Aspects do not match; return 0; diff --git a/src/main/java/thaumicenergistics/inventory/HandlerEssentiaStorageBus.java b/src/main/java/thaumicenergistics/inventory/HandlerEssentiaStorageBus.java index 97ba26db..e585eb84 100644 --- a/src/main/java/thaumicenergistics/inventory/HandlerEssentiaStorageBus.java +++ b/src/main/java/thaumicenergistics/inventory/HandlerEssentiaStorageBus.java @@ -65,6 +65,11 @@ public class HandlerEssentiaStorageBus */ public boolean isVoidAllowed = false; + /** + * Set true when essentia was recently voided. + */ + public boolean didVoid = false; + /** * Creates the handler. * @@ -476,12 +481,23 @@ public class HandlerEssentiaStorageBus // Calculate how much was left over int remaining_FU = toFill.amount - filled_FU; - // Did we completely drain the input stack, or can we void the remainder? - if( remaining_FU == 0 || canVoid ) + // Did we completely drain the input stack? + if( remaining_FU == 0 ) { // Nothing left over return null; } + // Are we voiding the remainder? + else if( canVoid ) + { + // Mark that we are voiding + this.didVoid = true; + + // TODO: send changes to network here. + + // Report that we accepted it all. + return null; + } // Return what was left over return AEApi.instance().storage().createFluidStack( new FluidStack( toFill.getFluid(), remaining_FU ) ); diff --git a/src/main/java/thaumicenergistics/parts/AEPartEssentiaExportBus.java b/src/main/java/thaumicenergistics/parts/AEPartEssentiaExportBus.java index e78a9590..635ca9e5 100644 --- a/src/main/java/thaumicenergistics/parts/AEPartEssentiaExportBus.java +++ b/src/main/java/thaumicenergistics/parts/AEPartEssentiaExportBus.java @@ -5,8 +5,6 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; import thaumcraft.api.aspects.Aspect; -import thaumcraft.common.tiles.TileEssentiaReservoir; -import thaumicenergistics.integration.tc.EssentiaTileContainerHelper; import thaumicenergistics.registries.AEPartsEnum; import thaumicenergistics.texture.BlockTextureManager; import appeng.api.config.SecurityPermissions; @@ -49,10 +47,9 @@ public class AEPartEssentiaExportBus @Override public boolean doWork( final int transferAmount ) { - EssentiaTileContainerHelper.instance.addTileToInjectWhitelist( TileEssentiaReservoir.class ); - - if( ( this.facingContainer != null ) ) + if( this.facingContainer != null ) { + // Attempt to extract essentia from the network return this.extractEssentiaFromNetwork( transferAmount ); } diff --git a/src/main/java/thaumicenergistics/parts/AEPartEssentiaIO.java b/src/main/java/thaumicenergistics/parts/AEPartEssentiaIO.java index 5f196bf9..81a5d250 100644 --- a/src/main/java/thaumicenergistics/parts/AEPartEssentiaIO.java +++ b/src/main/java/thaumicenergistics/parts/AEPartEssentiaIO.java @@ -248,6 +248,13 @@ public abstract class AEPartEssentiaIO protected boolean extractEssentiaFromNetwork( final int amountToFillContainer ) { + // Ensure we have a container. + if( this.facingContainer == null ) + { + // Invalid container + return false; + } + // Get the aspect in the container Aspect aspectToMatch = EssentiaTileContainerHelper.instance.getAspectInContainer( this.facingContainer ); diff --git a/src/main/resources/assets/thaumicenergistics/lang/en_US.lang b/src/main/resources/assets/thaumicenergistics/lang/en_US.lang index dcde46fa..6acac1b8 100644 --- a/src/main/resources/assets/thaumicenergistics/lang/en_US.lang +++ b/src/main/resources/assets/thaumicenergistics/lang/en_US.lang @@ -35,7 +35,7 @@ thaumicenergistics.item.material.coalescence.core.name=Coalescence Core thaumicenergistics.tooltip.essentia.cell.bytes=%d of %d bytes used. thaumicenergistics.tooltip.essentia.cell.types=%d of %d essentia types stored. thaumicenergistics.tooltip.button.clear.crafting=Deposit Crafting Grid -thaumicenergistics.tooltip.button.void=Allow Void +thaumicenergistics.tooltip.button.void=Allow Void? thaumicenergistics.tooltip.button.void.disabled=Do not void essentia thaumicenergistics.tooltip.button.void.allowed=Void essentia if jar is full thaumicenergistics.tooltip.button.void.note=Only applies to void jars