diff --git a/build.gradle b/build.gradle index cb51d7e..66c29db 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ buildscript { apply plugin: 'idea' apply plugin: 'forge' -version = "0.3.0" +version = "0.3.1" group = "at.chaosfield.openradio" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "OpenRadio" diff --git a/src/main/java/at/chaosfield/openradio/CreativeTab.java b/src/main/java/at/chaosfield/openradio/CreativeTab.java index 19cda00..859f4d4 100644 --- a/src/main/java/at/chaosfield/openradio/CreativeTab.java +++ b/src/main/java/at/chaosfield/openradio/CreativeTab.java @@ -2,6 +2,7 @@ import at.chaosfield.openradio.common.init.Blocks; import at.chaosfield.openradio.common.init.Items; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; @@ -28,7 +29,9 @@ public void displayAllReleventItems(List list){ this.list = list; this.addBlock(Blocks.laserBlock); - this.addBlock(Blocks.aeencoderBlock); + + if(Loader.isModLoaded("appliedenergistics2")) + this.addBlock(Blocks.aeencoderBlock); this.addItem(Items.laserSocketItem); this.addItem(Items.lensItem); diff --git a/src/main/java/at/chaosfield/openradio/OpenRadio.java b/src/main/java/at/chaosfield/openradio/OpenRadio.java index a4c5043..7c9dc82 100644 --- a/src/main/java/at/chaosfield/openradio/OpenRadio.java +++ b/src/main/java/at/chaosfield/openradio/OpenRadio.java @@ -18,7 +18,7 @@ * Created by Jakob Riepler (XDjackieXD) */ -@Mod(name = "Open Radio", modid = OpenRadio.MODID, version = "0.3.0", modLanguage = "java", dependencies = "required-after:OpenComputers@[1.5.0,);required-after:appliedenergistics2") +@Mod(name = "Open Radio", modid = OpenRadio.MODID, version = "0.3.1", modLanguage = "java", dependencies = "required-after:OpenComputers@[1.5.0,)") public class OpenRadio{ public static final String MODID = "openradio"; diff --git a/src/main/java/at/chaosfield/openradio/common/init/Blocks.java b/src/main/java/at/chaosfield/openradio/common/init/Blocks.java index 9e52914..65dab02 100644 --- a/src/main/java/at/chaosfield/openradio/common/init/Blocks.java +++ b/src/main/java/at/chaosfield/openradio/common/init/Blocks.java @@ -3,20 +3,23 @@ import at.chaosfield.openradio.OpenRadio; import at.chaosfield.openradio.common.block.AEEncoderBlock; import at.chaosfield.openradio.common.block.LaserBlock; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; /** * Created by Jakob Riepler (XDjackieXD) */ public class Blocks { - public static LaserBlock laserBlock; - public static AEEncoderBlock aeencoderBlock; + public static LaserBlock laserBlock = null; + public static AEEncoderBlock aeencoderBlock = null; //Register all blocks (Has to be called during FML Init) public static void init(){ laserBlock = new LaserBlock(); - aeencoderBlock = new AEEncoderBlock(); GameRegistry.registerBlock(laserBlock, OpenRadio.MODID + ".laser"); - GameRegistry.registerBlock(aeencoderBlock, OpenRadio.MODID + ".aeencoder"); + if(Loader.isModLoaded("appliedenergistics2")) { + aeencoderBlock = new AEEncoderBlock(); + GameRegistry.registerBlock(aeencoderBlock, OpenRadio.MODID + ".aeencoder"); + } } } diff --git a/src/main/java/at/chaosfield/openradio/proxy/CommonProxy.java b/src/main/java/at/chaosfield/openradio/proxy/CommonProxy.java index 04aae1f..02e2952 100644 --- a/src/main/java/at/chaosfield/openradio/proxy/CommonProxy.java +++ b/src/main/java/at/chaosfield/openradio/proxy/CommonProxy.java @@ -3,6 +3,7 @@ import at.chaosfield.openradio.OpenRadio; import at.chaosfield.openradio.common.tileentity.AEEncoderTileEntity; import at.chaosfield.openradio.common.tileentity.LaserTileEntity; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; /** @@ -11,7 +12,8 @@ public class CommonProxy{ public void registerTileEntities(){ GameRegistry.registerTileEntity(LaserTileEntity.class, OpenRadio.MODID + ":laser"); - GameRegistry.registerTileEntity(AEEncoderTileEntity.class, OpenRadio.MODID + ":aeencoder"); + if(Loader.isModLoaded("appliedenergistics2")) + GameRegistry.registerTileEntity(AEEncoderTileEntity.class, OpenRadio.MODID + ":aeencoder"); } public void registerRenders(){} diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index b34df1a..263fb62 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -11,7 +11,7 @@ "credits": "OpenComputers for some parts of the Textures", "logoFile": "", "screenshots": [], - "requiredMods": [ "Forge" ], - "dependencies": [] + "requiredMods": [ "Forge", "OpenComputers@[1.5.0,)" ], + "dependencies": [ "appliedenergistics2" ] } ]