Skip to content

Commit

Permalink
some overhauling, starts #67
Browse files Browse the repository at this point in the history
  • Loading branch information
way2muchnoise committed Dec 27, 2015
1 parent 78bb6f5 commit ca8a3ed
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 47 deletions.
34 changes: 10 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'maven-publish'

ext.buildProps = file "build.properties"

buildProps.withReader {
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}

repositories {
maven {
name = "forge"
Expand All @@ -46,22 +38,22 @@ configurations {
}

dependencies {
compile group: 'codechicken', name: 'NotEnoughItems', version: "${config.version.minecraft}-${config.version.nei}", ext: 'jar', classifier: "dev"
compile group: 'codechicken', name: 'CodeChickenCore', version: "${config.version.minecraft}-${config.version.cccore}", ext: 'jar', classifier: "dev"
compile group: 'codechicken', name: 'CodeChickenLib', version: "${config.version.minecraft}-${config.version.cclib}", ext: 'jar', classifier: "dev"
compile group: 'codechicken', name: 'NotEnoughItems', version: "${version_minecraft}-${version_nei}", ext: 'jar', classifier: "dev"
compile group: 'codechicken', name: 'CodeChickenCore', version: "${version_minecraft}-${version_cccore}", ext: 'jar', classifier: "dev"
compile group: 'codechicken', name: 'CodeChickenLib', version: "${version_minecraft}-${version_cclib}", ext: 'jar', classifier: "dev"
compileOnly fileTree(dir: 'lib', include: '*.jar')
}

group = "neresources"
archivesBaseName = "NotEnoughResources"

minecraft {
version = "${config.version.minecraft}-${config.version.forge}"
version = "${version_minecraft}-${version_forge}"

replaceIn "reference/Reference.java"
replace "@MAJOR@", config.version.mod.major
replace "@MINOR@", config.version.mod.minor
replace "@REVIS@", config.version.mod.revis
replace "@MAJOR@", version_mod_major
replace "@MINOR@", version_mod_minor
replace "@REVIS@", version_mod_revis

if (System.getenv("BUILD_NUMBER") != null) {
replace "@BUILD@", System.getenv("BUILD_NUMBER")
Expand All @@ -71,11 +63,11 @@ minecraft {
}

processResources {
from 'build.properties'
from 'gradle.properties'
}

allprojects {
version = "${config.version.minecraft}-${config.version.mod.major}.${config.version.mod.minor}.${config.version.mod.revis}"
version = "${version_minecraft}-${version_mod_major}.${version_mod_minor}.${version_mod_revis}"

if (System.getenv("BUILD_NUMBER") != null) {
version += ".${System.getenv("BUILD_NUMBER")}"
Expand All @@ -87,7 +79,6 @@ allprojects {
manifest {
attributes 'FMLAT': 'neresources_at.cfg'
}
dependsOn ":copyBuildXml"
destinationDir = file(rootProject.getRootDir().getPath() + '/output')
}

Expand All @@ -105,11 +96,6 @@ allprojects {
}
}

task copyBuildXml(type: Copy) {
from 'build.properties'
into 'output'
}

task apiZip(type: Zip) {
classifier = 'api'
from sourceSets*.allSource
Expand All @@ -125,4 +111,4 @@ sourceSets.main.compileClasspath += [ configurations.compileOnly ]
idea.module.scopes.PROVIDED.plus += [ configurations.compileOnly ]
eclipse.classpath.plusConfigurations += [ configurations.compileOnly ]

build.dependsOn "apiZip", "copyBuildXml"
build.dependsOn "apiZip"
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version.cccore=1.0.4.29
version.cclib=1.1.3.138
version.forge=10.13.4.1448-1.7.10
version.minecraft=1.7.10
version.mod.major=0
version.mod.minor=1
version.mod.revis=0
version.nei=1.0.3.74
version_cccore=1.0.4.29
version_cclib=1.1.3.138
version_forge=10.13.4.1558-1.7.10
version_minecraft=1.7.10
version_mod_major=0
version_mod_minor=1
version_mod_revis=0
version_nei=1.0.3.74
Binary file added lib/CoFHCore-[1.7.10]3.0.3-303-dev.jar
Binary file not shown.
Binary file added lib/TConstruct-1.7.10-1.8.8.jar
Binary file not shown.
Binary file added lib/ThermalFoundation-[1.7.10]1.2.0-102-dev.jar
Binary file not shown.
Binary file removed lib/z_forestry_1.7.10-3.1.1.4.jar
Binary file not shown.
Binary file removed lib/z_forestry_1.7.10-3.3.0.341-unstable.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package neresources.compatibility.forestry;

import cpw.mods.fml.common.registry.GameRegistry;
import forestry.core.config.Config;
import forestry.core.config.ForestryBlock;
import forestry.core.config.ForestryItem;
import forestry.plugins.PluginCore;
import neresources.api.distributions.DistributionSquare;
import neresources.api.messages.ModifyOreMessage;
import neresources.api.messages.RegisterOreMessage;
import neresources.api.utils.Priority;
import neresources.compatibility.CompatBase;
import neresources.registry.MessageRegistry;
import neresources.utils.LoaderHelper;
import neresources.utils.ModList;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
Expand All @@ -27,17 +24,8 @@ protected void init()

private void registerOres()
{
ItemStack apatite = null;
if (LoaderHelper.isModVersionGreater(ModList.forestry.toString(), new int [] { 4, 2, 0}, "."))
{
oreBlock = PluginCore.blocks.resources;
apatite = PluginCore.items.apatite.getItemStack();
}
else
{
oreBlock = ForestryBlock.resources.block();
ForestryItem.apatite.getItemStack();
}
ItemStack apatite = GameRegistry.findItemStack(ModList.Names.FORESTRY, "apatite", 1);
oreBlock = GameRegistry.findBlock(ModList.Names.FORESTRY, "resources");
MessageRegistry.addMessage(new ModifyOreMessage(new ItemStack(oreBlock, 1, 0), Priority.FIRST, apatite));
if (Config.generateApatiteOre) genApatite();
if (Config.generateCopperOre) genCopper();
Expand Down

0 comments on commit ca8a3ed

Please sign in to comment.