diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 412eeda7..00000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.github/scripts/test-no-error-reports.sh b/.github/scripts/test-no-error-reports.sh new file mode 100644 index 00000000..e3876606 --- /dev/null +++ b/.github/scripts/test-no-error-reports.sh @@ -0,0 +1,27 @@ +if [[ -d "run/crash-reports" ]]; then + echo "Crash reports detected:" + cat $directory/* + exit 1 +fi + +if grep --quiet "Fatal errors were detected" server.log; then + echo "Fatal errors detected:" + cat server.log + exit 1 +fi + +if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then + echo "Server force stopped:" + cat server.log + exit 1 +fi + +if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then + echo "Server didn't finish startup:" + cat server.log + exit 1 +fi + +echo "No crash reports detected" +exit 0 + diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 00000000..08df9fe8 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,45 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Build and test + +on: + pull_request: + branches: [ master, main ] + push: + branches: [ master, main ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Setup the workspace + run: ./gradlew setupCIWorkspace + + - name: Build the mod + run: ./gradlew build + + - name: Run server for 1.5 minutes + run: | + mkdir run + echo "eula=true" > run/eula.txt + timeout 90 ./gradlew runServer | tee --append server.log || true + + - name: Test no errors reported during server run + run: | + chmod +x .github/scripts/test-no-error-reports.sh + .github/scripts/test-no-error-reports.sh diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml new file mode 100644 index 00000000..96d37f7d --- /dev/null +++ b/.github/workflows/release-tags.yml @@ -0,0 +1,61 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Release tagged build + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set release version + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Setup the workspace + run: ./gradlew setupCIWorkspace + + - name: Build the mod + run: ./gradlew build + + - name: Release under current tag + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "${{ env.RELEASE_VERSION }}" + prerelease: false + title: "${{ env.RELEASE_VERSION }}" + files: build/libs/*.jar + + - name: Set repository owner and name + run: | + echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV + echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV + + - name: Publish package + run: ./gradlew publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ARTIFACT_GROUP_ID: com.github.${{ env.REPOSITORY_OWNER }} + ARTIFACT_ID: "${{ env.REPOSITORY_NAME }}" + ARTIFACT_VERSION: "${{ env.RELEASE_VERSION }}" + REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" + REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" + diff --git a/.gitignore b/.gitignore index ceb3ba16..558ad12d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,28 @@ -# General use .gitignore for Minecraft modding. - -# Directories -/.gradle/ -/build/ -/eclipse -/run/ -/out/ -/asm/ -/bin/ -/build/ -/config/ -crash-reports/ +.gradle +.settings /.idea/ -/.metadata/ -/.settings/ -/libs/ -/saves/ -/resourcepacks/ +/run/ +/build/ +/eclipse/ +.classpath +.project +/bin/ +/config/ +/crash-reports/ /logs/ -/mods/ -/screenshots/ - -# File Extensions -*.psd +options.txt +/saves/ +usernamecache.json +banned-ips.json +banned-players.json +eula.txt +ops.json +server.properties +servers.dat +usercache.json +whitelist.json +/out/ *.iml *.ipr *.iws -*.classpath -*.project - -# Specific files -Thumbs.db -usernamecache.json -options.txt - -*.bat +src/main/resources/mixins.*.json diff --git a/Idea.bat b/Idea.bat deleted file mode 100644 index 0ed751be..00000000 --- a/Idea.bat +++ /dev/null @@ -1 +0,0 @@ -gradlew idea \ No newline at end of file diff --git a/SetupDevWorkspaces.bat b/SetupDevWorkspaces.bat deleted file mode 100644 index b628f3cf..00000000 --- a/SetupDevWorkspaces.bat +++ /dev/null @@ -1 +0,0 @@ -gradlew setupDevWorkspace \ No newline at end of file diff --git a/SetupWorkspaces.bat b/SetupWorkspaces.bat deleted file mode 100644 index 0457d337..00000000 --- a/SetupWorkspaces.bat +++ /dev/null @@ -1 +0,0 @@ -gradlew setupDecompWorkspace --refresh-dependencies \ No newline at end of file diff --git a/build.bat b/build.bat deleted file mode 100644 index 646a0cb1..00000000 --- a/build.bat +++ /dev/null @@ -1 +0,0 @@ -gradlew build \ No newline at end of file diff --git a/build.gradle b/build.gradle index ef14c640..18fedd35 100644 --- a/build.gradle +++ b/build.gradle @@ -1,139 +1,529 @@ +//version: 928ecf7feb33a1149538b0e2cd17e3bc5f281428 +/* +DO NOT CHANGE THIS FILE! + +Also, you may replace this file at any time if there is an update available. +Please check https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle for updates. + */ + + +import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +import java.util.concurrent.TimeUnit + buildscript { repositories { - mavenCentral() - maven { url = "https://maven.minecraftforge.net/" } - maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" } - maven { url = "https://jitpack.io/" } + maven { + name = "forge" + 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 'com.github.GTNewHorizons:ForgeGradle:1.2.4' - classpath 'org.ajoberstar:gradle-git:0.10.1' } } +plugins { + id 'idea' + id 'scala' + id("org.ajoberstar.grgit") version("3.1.1") + id("com.github.johnrengelman.shadow") version("4.0.4") + id("com.palantir.git-version") version("0.12.3") +} + apply plugin: 'forge' -ext.configFile = file "build.properties" -configFile.withReader { - def prop = new Properties() - prop.load(it) - project.ext.config = new ConfigSlurper().parse prop +def projectJavaVersion = JavaLanguageVersion.of(8) + +java { + toolchain { + languageVersion.set(projectJavaVersion) + } } -version = config.mc_version + "-" + config.mod_version + "-" + config.build_number -group= config.package_group -archivesBaseName = config.mod_name +idea { + module { + inheritOutputDirs = true + downloadJavadoc = true + downloadSources = true + } +} -import org.ajoberstar.grgit.Grgit +if(JavaVersion.current() != JavaVersion.VERSION_1_8) { + throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current()) +} -def gitHash = 'unknown' -if (new File(projectDir, '.git').exists()) { - def repo = Grgit.open(project.file('.')) - gitHash = repo.log().find().abbreviatedId +checkPropertyExists("modName") +checkPropertyExists("modId") +checkPropertyExists("modGroup") +checkPropertyExists("autoUpdateBuildScript") +checkPropertyExists("minecraftVersion") +checkPropertyExists("forgeVersion") +checkPropertyExists("replaceGradleTokenInFile") +checkPropertyExists("gradleTokenModId") +checkPropertyExists("gradleTokenModName") +checkPropertyExists("gradleTokenVersion") +checkPropertyExists("gradleTokenGroupName") +checkPropertyExists("apiPackage") +checkPropertyExists("accessTransformersFile") +checkPropertyExists("usesMixins") +checkPropertyExists("mixinPlugin") +checkPropertyExists("mixinsPackage") +checkPropertyExists("coreModClass") +checkPropertyExists("containsMixinsAndOrCoreModOnly") +checkPropertyExists("usesShadowedDependencies") +checkPropertyExists("developmentEnvironmentUserName") + + +String javaSourceDir = "src/main/java/" +String scalaSourceDir = "src/main/scala/" + +String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") +String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") +if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { + throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala) +} + +if(apiPackage) { + targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { + throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala) + } +} + +if(accessTransformersFile) { + String targetFile = "src/main/resources/META-INF/" + accessTransformersFile + if(getFile(targetFile).exists() == false) { + throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) + } +} + +if(usesMixins.toBoolean()) { + if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) { + throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!") + } + + targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") + targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") + if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { + throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala) + } + + String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java" + String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java" + if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) { + throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava) + } +} + +if(coreModClass) { + String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java" + String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java" + if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) { + throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava) + } +} + +configurations.all { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) + + // Make sure GregTech build won't time out + System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String) + System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String) +} + +// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version +'git config core.fileMode false'.execute() +// Pulls version from git tag +try { + version = minecraftVersion + "-" + gitVersion() +} +catch (Exception e) { + throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!"); +} + +group = modGroup +if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { + archivesBaseName = customArchiveBaseName +} +else { + archivesBaseName = modId +} + +minecraft { + version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion + runDir = "run" + + if (replaceGradleTokenInFile) { + replaceIn replaceGradleTokenInFile + if(gradleTokenModId) { + replace gradleTokenModId, modId + } + if(gradleTokenModName) { + replace gradleTokenModName, modName + } + if(gradleTokenVersion) { + replace gradleTokenVersion, versionDetails().lastTag + } + if(gradleTokenGroupName) { + replace gradleTokenGroupName, modGroup + } + } +} + +if(file("addon.gradle").exists()) { + apply from: "addon.gradle" +} + +apply from: 'repositories.gradle' + +configurations { + implementation.extendsFrom(shadowImplementation) } repositories { maven { - name 'DVS1 Maven FS' - url 'https://dvs1.progwml6.com/files/maven' + name = "Overmind forge repo mirror" + url = "https://gregtech.overminddl1.com/" } - maven { - name 'tterrag Repo' - url 'https://maven.tterrag.com/' - } - maven { - name = "gt" - url = "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/" - } - maven { - url "https://jitpack.io" + if(usesMixins.toBoolean()) { + maven { + name = "sponge" + url = "https://repo.spongepowered.org/repository/maven-public" + } + maven { + url = "https://jitpack.io" + } } } dependencies { - implementation "com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev" - implementation "com.github.GTNewHorizons:ForgeMultipart:master-SNAPSHOT:dev" - compile fileTree(dir: 'libs', include: 'CraftTweaker-Dev-1.7.10-3.2.2-GTNH.4-legacy.jar') - compile fileTree(dir: 'libs', include: 'Guide-API-1.7.10-1.0.1-20-deobf.jar') - compile "team.chisel:Chisel:" + config.chisel_version + ":api" + if(usesMixins.toBoolean()) { + annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3") + annotationProcessor("com.google.guava:guava:24.1.1-jre") + annotationProcessor("com.google.code.gson:gson:2.8.6") + annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT") + // using 0.8 to workaround a issue in 0.7 which fails mixin application + compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") { + // Mixin includes a lot of dependencies that are too up-to-date + exclude module: "launchwrapper" + exclude module: "guava" + exclude module: "gson" + exclude module: "commons-io" + exclude module: "log4j-core" + } + compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev") + } } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +apply from: 'dependencies.gradle' -minecraft { - version = config.mc_version + "-" + config.forge_version - runDir = "run" - - replaceIn "GAPIChecker.java" - replace "@VERSION@", config.guideapi_version +def mixingConfigRefMap = "mixins." + modId + ".refmap.json" +def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap +def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" + +task generateAssets { + if(usesMixins.toBoolean()) { + getFile("/src/main/resources/mixins." + modId + ".json").text = """{ + "required": true, + "minVersion": "0.7.11", + "package": "${modGroup}.${mixinsPackage}", + "plugin": "${modGroup}.${mixinPlugin}", + "refmap": "${mixingConfigRefMap}", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" } -processResources { - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - from(sourceSets.main.resources.srcDirs) { - include '**/*.info' - include '**/*.properties' - - expand 'version': project.version, 'mcversion': project.minecraft.version +""" } - from(sourceSets.main.resources.srcDirs) { - exclude '**/*.info' - exclude '**/*.properties' - exclude '**/*.db' +} + +task relocateShadowJar(type: ConfigureShadowRelocation) { + target = tasks.shadowJar + prefix = modGroup + ".shadow" +} + +shadowJar { + manifest { + attributes(getManifestAttributes()) } + + minimize() // This will only allow shading for actually used classes + configurations = [project.configurations.shadowImplementation] + dependsOn(relocateShadowJar) } jar { - dependsOn "incrementBuildNumber" - classifier = '' - manifest.mainAttributes( - "Built-By": System.getProperty('user.name'), - "Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})", - "Implementation-Title": project.name, - "Implementation-Version": project.version, - "Git-Hash": gitHash + manifest { + attributes(getManifestAttributes()) + } + + if(usesShadowedDependencies.toBoolean()) { + dependsOn(shadowJar) + enabled = false + } +} + +reobf { + if(usesMixins.toBoolean()) { + addExtraSrgFile mixinSrg + } +} + +afterEvaluate { + if(usesMixins.toBoolean()) { + tasks.compileJava { + options.compilerArgs += [ + "-AreobfSrgFile=${tasks.reobf.srg}", + "-AoutSrgFile=${mixinSrg}", + "-AoutRefMapFile=${refMap}", + // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code + "-XDenableSunApiLintControl", + "-XDignore.symbol.file" + ] + } + } +} + +runClient { + def arguments = [] + + if(usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + } + + if(developmentEnvironmentUserName) { + arguments += [ + "--username", + developmentEnvironmentUserName + ] + } + + args(arguments) +} + +runServer { + def arguments = [] + + if (usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + } + + args(arguments) +} + +tasks.withType(JavaExec).configureEach { + javaLauncher.set( + javaToolchains.launcherFor { + languageVersion = projectJavaVersion + } ) } -// add a source jar -task sourceJar(type: Jar) { - from sourceSets.main.allSource - classifier = 'sources' +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 "minecraftVersion": project.minecraft.version, + "modVersion": versionDetails().lastTag, + "modId": modId, + "modName": modName + } + + if(usesMixins.toBoolean()) { + from refMap + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } + } + +def getManifestAttributes() { + def manifestAttributes = [:] + if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] + } + + if(accessTransformersFile) { + manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] + } + + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + + if(usesMixins.toBoolean()) { + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : "mixins." + modId + ".json", + "ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false + ] + } + return manifestAttributes } -// add a javadoc jar -task javadocJar(type: Jar, dependsOn: javadoc) { - from javadoc.destinationDir - classifier = 'javadoc' +task sourcesJar(type: Jar) { + from (sourceSets.main.allJava) + from (file("$projectDir/LICENSE")) + getArchiveClassifier().set('sources') } -// because the normal output has been made to be obfuscated -task deobfJar(type: Jar) { +task shadowDevJar(type: ShadowJar) { from sourceSets.main.output - classifier = 'deobf' + getArchiveClassifier().set("dev") + + manifest { + attributes(getManifestAttributes()) + } + + minimize() // This will only allow shading for actually used classes + configurations = [project.configurations.shadowImplementation] } -tasks.build.dependsOn sourceJar, javadocJar, deobfJar - -tasks.withType(JavaCompile) { task -> - task.options.encoding = 'UTF-8' +task relocateShadowDevJar(type: ConfigureShadowRelocation) { + target = tasks.shadowDevJar + prefix = modGroup + ".shadow" } -task("incrementBuildNumber") { - // increment build number - doFirst { - // increment - config.build_number = (config.build_number.toString().toInteger()) + 1 - - // write back to the file - configFile.withWriter { - config.toProperties().store(it, "") - } - } +task circularResolverJar(type: Jar) { + dependsOn(relocateShadowDevJar) + dependsOn(shadowDevJar) + enabled = false } -// Uncomment this line if you want to auto-upload to CurseForge when you build. This requires you to setup curse.gradle yourself. -// fileTree('gradle').include('curse.gradle').collect().sort().each { apply from: it } \ No newline at end of file +task devJar(type: Jar) { + from sourceSets.main.output + getArchiveClassifier().set("dev") + + manifest { + attributes(getManifestAttributes()) + } + + if(usesShadowedDependencies.toBoolean()) { + dependsOn(circularResolverJar) + enabled = false + } +} + +task apiJar(type: Jar) { + from (sourceSets.main.allJava) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' + } + + from (sourceSets.main.output) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' + } + + from (sourceSets.main.resources.srcDirs) { + include("LICENSE") + } + + getArchiveClassifier().set('api') +} + +artifacts { + archives sourcesJar + archives devJar + if(apiPackage) { + archives apiJar + } +} + +// Updating +task updateBuildScript { + doLast { + if (performBuildScriptUpdate(projectDir.toString())) return + + print("Build script already up-to-date!") + } +} + +if (isNewBuildScriptVersionAvailable(projectDir.toString())) { + if (autoUpdateBuildScript.toBoolean()) { + performBuildScriptUpdate(projectDir.toString()) + } else { + println("Build script update available! Run 'gradle updateBuildScript'") + } +} + +static URL availableBuildScriptUrl() { + new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle") +} + +boolean performBuildScriptUpdate(String projectDir) { + if (isNewBuildScriptVersionAvailable(projectDir)) { + def buildscriptFile = getFile("build.gradle") + availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } + print("Build script updated. Please REIMPORT the project or RESTART your IDE!") + return true + } + return false +} + +boolean isNewBuildScriptVersionAvailable(String projectDir) { + Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] + + String currentBuildScript = getFile("build.gradle").getText() + String currentBuildScriptHash = getVersionHash(currentBuildScript) + String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() + String availableBuildScriptHash = getVersionHash(availableBuildScript) + + boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash + return !isUpToDate +} + +static String getVersionHash(String buildScriptContent) { + String versionLine = buildScriptContent.find("^//version: [a-z0-9]*") + if(versionLine != null) { + return versionLine.split(": ").last() + } + return "" +} + +configure(updateBuildScript) { + group = 'forgegradle' + description = 'Updates the build script to the latest version' +} + +// Helper methods + +def checkPropertyExists(String propertyName) { + if (project.hasProperty(propertyName) == false) { + throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties") + } +} + +def getFile(String relativePath) { + return new File(projectDir, relativePath) +} diff --git a/build.properties b/build.properties deleted file mode 100644 index 578bd805..00000000 --- a/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -# -#Sat Dec 04 09:06:56 CST 2021 -mod_name=BloodMagic -forge_version=10.13.4.1614-1.7.10 -ccc_version=1.0.7.47 -cclib_version=1.1.3.138 -nei_version=1.0.5.111 -//=Dependency Information -package_group=com.wayoftime.bloodmagic -guideapi_version=1.0.1-20 -mod_version=1.3.3 -minetweaker_version=Dev-1.7.10-3.2.2-GTNH -chisel_version=2.9.2.8 -build_number=47 -mc_version=1.7.10 diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 00000000..3f69f307 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,32 @@ +// Add your dependencies here + +dependencies { + compileOnly("com.github.GTNewHorizons:Botania:master-SNAPSHOT:api") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:ForestryMC:master-SNAPSHOT:api") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:ForgeMultipart:master-SNAPSHOT:dev") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:Chisel:master-SNAPSHOT:api") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:ZenScript:master-SNAPSHOT") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:CraftTweaker:master-SNAPSHOT:dev") { + transitive = false + } + + compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { + transitive = false + } + compileOnly("curse.maven:guide-api-228832:2287185") { + transitive = false + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..c9d93cc4 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,64 @@ +modName = AlchemicalWizardry + +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = AWWayofTime + +modGroup = WayofTime.alchemicalWizardry + +# WHY is there no version field? +# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the +# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/ + +# Will update your build.gradle automatically whenever an update is available +autoUpdateBuildScript = false + +minecraftVersion = 1.7.10 +forgeVersion = 10.13.4.1614 + +# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you +# restart Minecraft in development. Choose this dependent on your mod: +# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name +# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty +developmentEnvironmentUserName = "Developer" + +# Define a source file of your project with: +# public static final String VERSION = "GRADLETOKEN_VERSION"; +# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's +# version in @Mod([...], version = VERSION, [...]) +# Leave these properties empty to skip individual token replacements +replaceGradleTokenInFile = AlchemicalWizardry.java +gradleTokenModId = +gradleTokenModName = +gradleTokenVersion = GRADLETOKEN_VERSION +gradleTokenGroupName = + +# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can +# leave this property empty. +# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api +apiPackage = api + +# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/ +# Example value: mymodid_at.cfg +accessTransformersFile = + +# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! +usesMixins = false +# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. +mixinPlugin = +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# This parameter is for legacy compatability only +# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +coreModClass = +# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class +# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! +containsMixinsAndOrCoreModOnly = false + +# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your +# responsibility check the licence and request permission for distribution, if required. +usesShadowedDependencies = false + +# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older +# projects. New projects should not use this parameter. +customArchiveBaseName = BloodMagic diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 3baa851b..5c2d1cf0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3fb50dd7..3ab0b725 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Sat Jan 04 01:56:22 CET 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip diff --git a/gradlew b/gradlew index 91a7e269..83f2acfd 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## ## @@ -6,47 +22,6 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" @@ -61,9 +36,49 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- +cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" -cd "$SAVED" >&- +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -90,7 +105,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -110,10 +125,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` @@ -154,11 +170,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 8a0b282a..9618d8d9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -8,14 +24,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +62,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +75,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..09bbb514 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +before_install: + - ./gradlew setupCIWorkspace \ No newline at end of file diff --git a/libs/Baubles-deobf-1.7.10-1.0.1.10.jar b/libs/Baubles-deobf-1.7.10-1.0.1.10.jar deleted file mode 100644 index 85855697..00000000 Binary files a/libs/Baubles-deobf-1.7.10-1.0.1.10.jar and /dev/null differ diff --git a/libs/Botania r1.8-248-deobf.jar b/libs/Botania r1.8-248-deobf.jar deleted file mode 100644 index 3857abb6..00000000 Binary files a/libs/Botania r1.8-248-deobf.jar and /dev/null differ diff --git a/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar b/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar deleted file mode 100644 index 08c35fc2..00000000 Binary files a/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar and /dev/null differ diff --git a/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar b/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar deleted file mode 100644 index 249afbce..00000000 Binary files a/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar and /dev/null differ diff --git a/libs/CraftTweaker-Dev-1.7.10-3.2.2-GTNH-legacy.jar b/libs/CraftTweaker-Dev-1.7.10-3.2.2-GTNH-legacy.jar deleted file mode 100644 index 9327804f..00000000 Binary files a/libs/CraftTweaker-Dev-1.7.10-3.2.2-GTNH-legacy.jar and /dev/null differ diff --git a/libs/GTNewHorizonsCoreMod-1.7.10-1.1.41.jar b/libs/GTNewHorizonsCoreMod-1.7.10-1.1.41.jar deleted file mode 100644 index b385561e..00000000 Binary files a/libs/GTNewHorizonsCoreMod-1.7.10-1.1.41.jar and /dev/null differ diff --git a/libs/GemBlocksForGreg-1.5.0.jar b/libs/GemBlocksForGreg-1.5.0.jar deleted file mode 100644 index 5edcfc43..00000000 Binary files a/libs/GemBlocksForGreg-1.5.0.jar and /dev/null differ diff --git a/libs/Guide-API-1.7.10-1.0.1-20-deobf.jar b/libs/Guide-API-1.7.10-1.0.1-20-deobf.jar deleted file mode 100644 index 4f61310e..00000000 Binary files a/libs/Guide-API-1.7.10-1.0.1-20-deobf.jar and /dev/null differ diff --git a/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar b/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar deleted file mode 100644 index 3b92091d..00000000 Binary files a/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar and /dev/null differ diff --git a/libs/PneumaticCraft-1.7.10-1.12.7-150-universal.jar b/libs/PneumaticCraft-1.7.10-1.12.7-150-universal.jar deleted file mode 100644 index f0b70b74..00000000 Binary files a/libs/PneumaticCraft-1.7.10-1.12.7-150-universal.jar and /dev/null differ diff --git a/libs/Thaumcraft-1.7.10-4.2.3.5.jar b/libs/Thaumcraft-1.7.10-4.2.3.5.jar deleted file mode 100644 index 0007a227..00000000 Binary files a/libs/Thaumcraft-1.7.10-4.2.3.5.jar and /dev/null differ diff --git a/libs/YAMCore-1.7.10-0.5.63-deobf.jar b/libs/YAMCore-1.7.10-0.5.63-deobf.jar deleted file mode 100644 index 0cee76e6..00000000 Binary files a/libs/YAMCore-1.7.10-0.5.63-deobf.jar and /dev/null differ diff --git a/libs/appliedenergistics2-rv2-stable-10-api.jar b/libs/appliedenergistics2-rv2-stable-10-api.jar deleted file mode 100644 index fe7063d9..00000000 Binary files a/libs/appliedenergistics2-rv2-stable-10-api.jar and /dev/null differ diff --git a/libs/forestry_1.7.10-3.6.12.3-dev.jar b/libs/forestry_1.7.10-3.6.12.3-dev.jar deleted file mode 100644 index 1facccdb..00000000 Binary files a/libs/forestry_1.7.10-3.6.12.3-dev.jar and /dev/null differ diff --git a/libs/gregtech-5.08.33.27-dev.jar b/libs/gregtech-5.08.33.27-dev.jar deleted file mode 100644 index ca4bc197..00000000 Binary files a/libs/gregtech-5.08.33.27-dev.jar and /dev/null differ diff --git a/libs/industrialcraft-2-2.2.790-experimental.jar b/libs/industrialcraft-2-2.2.790-experimental.jar deleted file mode 100644 index 20524b3c..00000000 Binary files a/libs/industrialcraft-2-2.2.790-experimental.jar and /dev/null differ diff --git a/repositories.gradle b/repositories.gradle new file mode 100644 index 00000000..f717fc3a --- /dev/null +++ b/repositories.gradle @@ -0,0 +1,10 @@ +// Add any additional repositories for your dependencies here + +repositories { + maven { + url "https://cursemaven.com" + } + maven { + url = "https://jitpack.io" + } +} diff --git a/src/api/java/forestry/api/apiculture/BeeManager.java b/src/api/java/forestry/api/apiculture/BeeManager.java deleted file mode 100644 index 80b03a46..00000000 --- a/src/api/java/forestry/api/apiculture/BeeManager.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.item.ItemStack; -/** - * - * Some miscellaneous lists and settings for bees. - * - * @author SirSengir - */ -public class BeeManager { - - /** - * 0 - Common Village Bees 1 - Uncommon Village Bees (20 % of spawns) - */ - public static ArrayList[] villageBees; - - /** - * List of items that can induce swarming. Integer denotes x in 1000 chance. - */ - public static HashMap inducers = new HashMap(); - - /** - * Convenient access to AlleleManager.alleleRegistry.getSpeciesRoot("rootBees") - */ - public static IBeeRoot beeRoot; - - /** - * Used to create new bees. - */ - public static IBeeFactory beeFactory; - - /** - * Used to create new bee mutations. - */ - public static IBeeMutationFactory beeMutationFactory; - - /** - * Used to get Forestry's jubilance implementations. - */ - public static IJubilanceFactory jubilanceFactory; -} diff --git a/src/api/java/forestry/api/apiculture/EnumBeeChromosome.java b/src/api/java/forestry/api/apiculture/EnumBeeChromosome.java deleted file mode 100644 index 165247ef..00000000 --- a/src/api/java/forestry/api/apiculture/EnumBeeChromosome.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleArea; -import forestry.api.genetics.IAlleleBoolean; -import forestry.api.genetics.IAlleleFloat; -import forestry.api.genetics.IAlleleFlowers; -import forestry.api.genetics.IAlleleInteger; -import forestry.api.genetics.IAlleleTolerance; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.ISpeciesRoot; - -/** - * Enum representing the order of chromosomes in a bee's genome and what they control. - * - * @author SirSengir - */ -public enum EnumBeeChromosome implements IChromosomeType { - /** - * Species of the bee. Alleles here must implement {@link IAlleleBeeSpecies}. - */ - SPECIES(IAlleleBeeSpecies.class), - /** - * (Production) Speed of the bee. - */ - SPEED(IAlleleFloat.class), - /** - * Lifespan of the bee. - */ - LIFESPAN(IAlleleInteger.class), - /** - * Fertility of the bee. Determines number of offspring. - */ - FERTILITY(IAlleleInteger.class), - /** - * Temperature difference to its native supported one the bee can tolerate. - */ - TEMPERATURE_TOLERANCE(IAlleleTolerance.class), - /** - * Slightly incorrectly named. If true, a naturally dirunal bee can work during the night. If true, a naturally nocturnal bee can work during the day. - */ - NOCTURNAL(IAlleleBoolean.class), - /** - * Not used / superseded by fixed values for the species. Probably going to be replaced with a boolean for FIRE_RESIST. - */ - @Deprecated - HUMIDITY(IAllele.class), - /** - * Humidity difference to its native supported one the bee can tolerate. - */ - HUMIDITY_TOLERANCE(IAlleleTolerance.class), - /** - * If true the bee can work during rain. - */ - TOLERANT_FLYER(IAlleleBoolean.class), - /** - * If true, the bee can work without a clear view of the sky. - */ - CAVE_DWELLING(IAlleleBoolean.class), - /** - * Contains the supported flower provider. - */ - FLOWER_PROVIDER(IAlleleFlowers.class), - /** - * Determines pollination speed. - */ - FLOWERING(IAlleleInteger.class), - /** - * Determines the size of the bee's territory. - */ - TERRITORY(IAlleleArea.class), - /** - * Determines the bee's effect. - */ - EFFECT(IAlleleBeeEffect.class); - - Class clss; - - EnumBeeChromosome(Class clss) { - this.clss = clss; - } - - @Override - public Class getAlleleClass() { - return clss; - } - - @Override - public String getName() { - return this.toString().toLowerCase(); - } - - @Override - public ISpeciesRoot getSpeciesRoot() { - return BeeManager.beeRoot; - } -} diff --git a/src/api/java/forestry/api/apiculture/EnumBeeType.java b/src/api/java/forestry/api/apiculture/EnumBeeType.java deleted file mode 100644 index e3e45c2b..00000000 --- a/src/api/java/forestry/api/apiculture/EnumBeeType.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.Locale; - -public enum EnumBeeType { - DRONE, PRINCESS, QUEEN, LARVAE, NONE; - - public static final EnumBeeType[] VALUES = values(); - - String name; - - private EnumBeeType() { - this.name = this.toString().toLowerCase(Locale.ENGLISH); - } - - public String getName() { - return name; - } -} diff --git a/src/api/java/forestry/api/apiculture/FlowerManager.java b/src/api/java/forestry/api/apiculture/FlowerManager.java deleted file mode 100644 index 667b4489..00000000 --- a/src/api/java/forestry/api/apiculture/FlowerManager.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; - -import forestry.api.genetics.IFlowerProvider; -import forestry.api.genetics.IFlowerRegistry; - -public class FlowerManager { - /** - * ItemStacks representing simple flower blocks. Meta-sensitive, processed by the basic {@link IFlowerProvider}. - * - * @deprecated since Forestry 3.4. Use {@link #IFlowerRegistry.registerPlantableFlower(ItemStack flower, double weight, String... flowerTypes)} instead. - *
e.g. FlowerManager.flowerRegister.registerPlantableFlower(new ItemStack(Blocks.red_flower), 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
- */ - @Deprecated - public static ArrayList plainFlowers = new ArrayList(); - - /** - *
e.g. FlowerManager.flowerRegister.registerPlantableFlower(new ItemStack(Blocks.red_flower), 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
- */ - public static IFlowerRegistry flowerRegistry; - - public static final String FlowerTypeVanilla = "flowersVanilla"; - public static final String FlowerTypeNether = "flowersNether"; - public static final String FlowerTypeCacti = "flowersCacti"; - public static final String FlowerTypeMushrooms = "flowersMushrooms"; - public static final String FlowerTypeEnd = "flowersEnd"; - public static final String FlowerTypeJungle = "flowersJungle"; - public static final String FlowerTypeSnow = "flowersSnow"; - public static final String FlowerTypeWheat = "flowersWheat"; - public static final String FlowerTypeGourd = "flowersGourd"; -} diff --git a/src/api/java/forestry/api/apiculture/IAlleleBeeEffect.java b/src/api/java/forestry/api/apiculture/IAlleleBeeEffect.java deleted file mode 100644 index b2dddb31..00000000 --- a/src/api/java/forestry/api/apiculture/IAlleleBeeEffect.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.IAlleleEffect; -import forestry.api.genetics.IEffectData; - -public interface IAlleleBeeEffect extends IAlleleEffect { - - /** - * Called by apiaries to cause an effect in the world. - * - * @param genome - * Genome of the bee queen causing this effect - * @param storedData - * Object containing the stored effect data for the apiary/hive the bee is in. - * @param housing {@link IBeeHousing} the bee currently resides in. - * @return storedData, may have been manipulated. - */ - IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); - - /** - * Is called to produce bee effects. - * - * @param genome - * @param storedData - * Object containing the stored effect data for the apiary/hive the bee is in. - * @param housing {@link IBeeHousing} the bee currently resides in. - * @return storedData, may have been manipulated. - */ - IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); - -} diff --git a/src/api/java/forestry/api/apiculture/IAlleleBeeSpecies.java b/src/api/java/forestry/api/apiculture/IAlleleBeeSpecies.java deleted file mode 100644 index 86346639..00000000 --- a/src/api/java/forestry/api/apiculture/IAlleleBeeSpecies.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.Map; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import forestry.api.genetics.IAlleleSpecies; - -public interface IAlleleBeeSpecies extends IAlleleSpecies { - - /** - * @return the IBeeRoot - */ - IBeeRoot getRoot(); - - /** - * @return true if this species is only active at night. - */ - boolean isNocturnal(); - - /** - * @return Map of possible products with the chance for drop each bee cycle. (0 - 1] - */ - Map getProductChances(); - - /** - * @return Map of possible specialities with the chance for drop each bee cycle. (0 - 1] - */ - Map getSpecialtyChances(); - - /** - * Only jubilant bees produce specialities. - * @return true if the bee is jubilant, false otherwise. - */ - boolean isJubilant(IBeeGenome genome, IBeeHousing housing); - - @SideOnly(Side.CLIENT) - IIcon getIcon(EnumBeeType type, int renderPass); - - /** - * @deprecated since Forestry 3.6. - * @return Path of the texture to use for entity rendering. - */ - @Deprecated - String getEntityTexture(); - - /** - * @deprecated Since Forestry 3.6 use getProductChances() - * @return Map of possible products with the chance for drop each bee cycle. (0 - 100) - */ - @Deprecated - Map getProducts(); - - /** - * @deprecated Since Forestry 3.6 use getSpecialtyChances() - * @return Map of possible specialities with the chance for drop each bee cycle. (0 - 100) - */ - @Deprecated - Map getSpecialty(); -} diff --git a/src/api/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java b/src/api/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java deleted file mode 100644 index 06664b2f..00000000 --- a/src/api/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import net.minecraft.item.ItemStack; - -import forestry.api.genetics.IAlleleSpeciesCustom; - -public interface IAlleleBeeSpeciesCustom extends IAlleleBeeSpecies, IAlleleSpeciesCustom { - - /** - * Add a product for this bee species. - * Chance is between 0 and 1. - */ - IAlleleBeeSpeciesCustom addProduct(ItemStack product, Float chance); - - /** - * Add a specialty product for this bee species. - * Bees only produce their specialty when they are Jubilant (see IJubilanceProvider) - * Chance is between 0 and 1. - */ - IAlleleBeeSpeciesCustom addSpecialty(ItemStack specialty, Float chance); - - /** - * Set the Jubilance Provider for this bee species. - * Bees only produce their specialty when they are Jubilant (see IJubilanceProvider) - */ - IAlleleBeeSpeciesCustom setJubilanceProvider(IJubilanceProvider provider); - - /** - * Make this species only active at night. - */ - IAlleleBeeSpeciesCustom setNocturnal(); - - /** Use this if you have custom icons for bees. */ - IAlleleBeeSpeciesCustom setCustomBeeIconProvider(IBeeIconProvider beeIconProvider); -} diff --git a/src/api/java/forestry/api/apiculture/IAlvearyComponent.java b/src/api/java/forestry/api/apiculture/IAlvearyComponent.java deleted file mode 100644 index 80cf98b1..00000000 --- a/src/api/java/forestry/api/apiculture/IAlvearyComponent.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.core.ITileStructure; - -/** - * Needs to be implemented by TileEntities that want to be part of an alveary. - */ -public interface IAlvearyComponent extends ITileStructure { - - void registerBeeModifier(IBeeModifier modifier); - - void removeBeeModifier(IBeeModifier modifier); - - void registerBeeListener(IBeeListener event); - - void removeBeeListener(IBeeListener event); - - void addTemperatureChange(float change, float boundaryDown, float boundaryUp); - - void addHumidityChange(float change, float boundaryDown, float boundaryUp); - - /** - * @return true if this TE has a function other than a plain alveary block. Returning true prevents the TE from becoming master. - */ - boolean hasFunction(); - -} diff --git a/src/api/java/forestry/api/apiculture/IApiaristTracker.java b/src/api/java/forestry/api/apiculture/IApiaristTracker.java deleted file mode 100644 index 0c65f56b..00000000 --- a/src/api/java/forestry/api/apiculture/IApiaristTracker.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IIndividual; - -/** - * Can be used to garner information on bee breeding. See {@link forestry.api.genetics.ISpeciesRoot} for retrieval functions. - * - * @author SirSengir - */ -public interface IApiaristTracker extends IBreedingTracker { - - /** - * Register the birth of a queen. Will mark species as discovered. - * - * @param queen - * Created queen. - */ - void registerQueen(IIndividual queen); - - /** - * @return Amount of queens bred with this tracker. - */ - int getQueenCount(); - - /** - * Register the birth of a princess. Will mark species as discovered. - * - * @param princess - * Created princess. - */ - void registerPrincess(IIndividual princess); - - /** - * @return Amount of princesses bred with this tracker. - */ - int getPrincessCount(); - - /** - * Register the birth of a drone. Will mark species as discovered. - * - * @param drone - * Created drone. - */ - void registerDrone(IIndividual drone); - - /** - * @return Amount of drones bred with this tracker. - */ - int getDroneCount(); - -} diff --git a/src/api/java/forestry/api/apiculture/IArmorApiarist.java b/src/api/java/forestry/api/apiculture/IArmorApiarist.java deleted file mode 100644 index fef81eb5..00000000 --- a/src/api/java/forestry/api/apiculture/IArmorApiarist.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * When implemented by armor piece items, allows them to act as apiarist's armor. - */ -public interface IArmorApiarist { - /** - * Called when the apiarist's armor acts as protection against an attack. - * - * @param player - * Player being attacked - * @param armor - * Armor item - * @param cause - * Optional cause of attack, such as a bee effect identifier - * @param doProtect - * Whether or not to actually do the side effects of protection - * @return Whether or not the armor should protect the player from that attack - */ - public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect); -} diff --git a/src/api/java/forestry/api/apiculture/IBee.java b/src/api/java/forestry/api/apiculture/IBee.java deleted file mode 100644 index b77b752e..00000000 --- a/src/api/java/forestry/api/apiculture/IBee.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; - -import forestry.api.core.IErrorState; -import forestry.api.genetics.IEffectData; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IIndividualLiving; - -/** - * Other implementations than Forestry's default one are not supported. - * - * @author SirSengir - */ -public interface IBee extends IIndividualLiving { - - /** - * @return Bee's genetic information. - */ - IBeeGenome getGenome(); - - /** - * @return Genetic information of the bee's mate, null if unmated. - */ - IBeeGenome getMate(); - - /** - * @return true if the individual is originally of natural origin. - */ - boolean isNatural(); - - /** - * @return generation this individual is removed from the original individual. - */ - int getGeneration(); - - /** - * Set the natural flag on this bee. - * @param flag - */ - void setIsNatural(boolean flag); - - IEffectData[] doEffect(IEffectData[] storedData, IBeeHousing housing); - - IEffectData[] doFX(IEffectData[] storedData, IBeeHousing housing); - - /** - * @return true if the bee may spawn offspring - */ - boolean canSpawn(); - - /** - * Determines whether the queen can work. - * - * @param housing the {@link IBeeHousing} the bee currently resides in. - * @return the error code encountered. - */ - IErrorState canWork(IBeeHousing housing); - - boolean hasFlower(IBeeHousing housing); - - ArrayList getSuitableBiomes(); - - ItemStack[] getProduceList(); - - ItemStack[] getSpecialtyList(); - - ItemStack[] produceStacks(IBeeHousing housing); - - IBee spawnPrincess(IBeeHousing housing); - - IBee[] spawnDrones(IBeeHousing housing); - - void plantFlowerRandom(IBeeHousing housing); - - IIndividual retrievePollen(IBeeHousing housing); - - boolean pollinateRandom(IBeeHousing housing, IIndividual pollen); - -} diff --git a/src/api/java/forestry/api/apiculture/IBeeFactory.java b/src/api/java/forestry/api/apiculture/IBeeFactory.java deleted file mode 100644 index c164731c..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.IClassification; - -public interface IBeeFactory { - - /** - * Creates a new bee species. - * Automatically registered with AlleleManager.alleleRegistry.registerAllele() - * See IAlleleBeeSpeciesCustom and IAlleleSpeciesCustom for adding additional properties to the returned species. - * - * @param uid Unique Identifier for this species - * @param dominant Whether this species is genetically dominant (false means it is recessive) - * @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry. - * @param unlocalizedName Unlocalized name for this species - * @param unlocalizedDescription Unlocalized description for this species - * @param branch Classification of this species - * @param binomial Binomial name of the species sans genus ("Apis"). "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null. - * @param primaryColor The outline color of this species - * @param secondaryColor The body color of this species - * @return a new bee species allele. - */ - IAlleleBeeSpeciesCustom createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor); - - /** - * Creates a new bee branch. - * Must be registered with AlleleManager.alleleRegistry.getClassification("family.apidae").addMemberGroup(); - * - * @param uid Unique Identifier for this branch - * @param scientific approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis" - * @return a new bee branch - */ - IClassification createBranch(String uid, String scientific); -} diff --git a/src/api/java/forestry/api/apiculture/IBeeGenome.java b/src/api/java/forestry/api/apiculture/IBeeGenome.java deleted file mode 100644 index 642eeeb5..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeGenome.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.EnumTolerance; -import forestry.api.genetics.IFlowerProvider; -import forestry.api.genetics.IGenome; - -/** - * Only the default implementation is supported. - * - * @author SirSengir - * - */ -public interface IBeeGenome extends IGenome { - - IAlleleBeeSpecies getPrimary(); - - IAlleleBeeSpecies getSecondary(); - - float getSpeed(); - - int getLifespan(); - - int getFertility(); - - EnumTolerance getToleranceTemp(); - - EnumTolerance getToleranceHumid(); - - boolean getNocturnal(); - - boolean getTolerantFlyer(); - - boolean getCaveDwelling(); - - IFlowerProvider getFlowerProvider(); - - int getFlowering(); - - int[] getTerritory(); - - IAlleleBeeEffect getEffect(); - -} diff --git a/src/api/java/forestry/api/apiculture/IBeeHousing.java b/src/api/java/forestry/api/apiculture/IBeeHousing.java deleted file mode 100644 index 5d795a3b..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeHousing.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import net.minecraft.item.ItemStack; - -import forestry.api.genetics.IHousing; - -public interface IBeeHousing extends IBeeModifier, IBeeListener, IHousing { - - ItemStack getQueen(); - - ItemStack getDrone(); - - void setQueen(ItemStack itemstack); - - void setDrone(ItemStack itemstack); - - /** - * @return true if princesses and drones can (currently) mate in this housing to generate queens. - */ - boolean canBreed(); - -} diff --git a/src/api/java/forestry/api/apiculture/IBeeIconProvider.java b/src/api/java/forestry/api/apiculture/IBeeIconProvider.java deleted file mode 100644 index d29a722b..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeIconProvider.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - -public interface IBeeIconProvider { - void registerIcons(IIconRegister register); - IIcon getIcon(EnumBeeType type, int renderPass); -} diff --git a/src/api/java/forestry/api/apiculture/IBeeListener.java b/src/api/java/forestry/api/apiculture/IBeeListener.java deleted file mode 100644 index 7fd5865c..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeListener.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import net.minecraft.item.ItemStack; - -import forestry.api.genetics.IIndividual; - -public interface IBeeListener { - - /** - * Called on queen update. - * - * @param queen - */ - void onQueenChange(ItemStack queen); - - /** - * Called when the bees wear out the housing's equipment. - * - * @param amount - * Integer indicating the amount worn out. - */ - void wearOutEquipment(int amount); - - /** - * Called just before the children are generated, and the queen removed. - * - * @param queen - */ - void onQueenDeath(IBee queen); - - /** - * Called after the children have been spawned, but before the queen appears - * - * @param queen - */ - void onPostQueenDeath(IBee queen); - - boolean onPollenRetrieved(IBee queen, IIndividual pollen, boolean isHandled); - - boolean onEggLaid(IBee queen); -} diff --git a/src/api/java/forestry/api/apiculture/IBeeModifier.java b/src/api/java/forestry/api/apiculture/IBeeModifier.java deleted file mode 100644 index 4f9f7bbe..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeModifier.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -public interface IBeeModifier { - - /** - * @param genome Genome of the bee this modifier is called for. - * @param currentModifier Current modifier. - * @return Float used to modify the base territory. - */ - float getTerritoryModifier(IBeeGenome genome, float currentModifier); - - /** - * @param genome Genome of the bee this modifier is called for. - * @param mate - * @param currentModifier Current modifier. - * @return Float used to modify the base mutation chance. - */ - float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier); - - /** - * @param genome Genome of the bee this modifier is called for. - * @param currentModifier Current modifier. - * @return Float used to modify the life span of queens. - */ - float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier); - - /** - * @param genome Genome of the bee this modifier is called for. - * @param currentModifier Current modifier. - * @return Float modifying the production speed of queens. - */ - float getProductionModifier(IBeeGenome genome, float currentModifier); - - /** - * @param genome Genome of the bee this modifier is called for. - * @return Float modifying the flowering of queens. - */ - float getFloweringModifier(IBeeGenome genome, float currentModifier); - - /** - * @param genome Genome of the bee this modifier is called for. - * @return Float modifying the chance for a swarmer queen to die off. - */ - float getGeneticDecay(IBeeGenome genome, float currentModifier); - - /** - * @return Boolean indicating if housing can ignore rain - */ - boolean isSealed(); - - /** - * @return Boolean indicating if housing can ignore darkness/night - */ - boolean isSelfLighted(); - - /** - * @return Boolean indicating if housing can ignore not seeing the sky - */ - boolean isSunlightSimulated(); - - /** - * @return Boolean indicating whether this housing simulates the nether - */ - boolean isHellish(); - -} diff --git a/src/api/java/forestry/api/apiculture/IBeeMutation.java b/src/api/java/forestry/api/apiculture/IBeeMutation.java deleted file mode 100644 index 6421c8f6..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeMutation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IMutation; - -public interface IBeeMutation extends IMutation { - - IBeeRoot getRoot(); - - /** - * @param housing - * @param allele0 - * @param allele1 - * @param genome0 - * @param genome1 - * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously! - * @deprecated since Forestry 3.6, use the IAlleleBeeSpecies / IBeeGenome version - */ - @Deprecated - float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); - - float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1); -} diff --git a/src/api/java/forestry/api/apiculture/IBeeMutationCustom.java b/src/api/java/forestry/api/apiculture/IBeeMutationCustom.java deleted file mode 100644 index d97a839a..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeMutationCustom.java +++ /dev/null @@ -1,12 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.IMutationCustom; - -public interface IBeeMutationCustom extends IBeeMutation, IMutationCustom { - -} diff --git a/src/api/java/forestry/api/apiculture/IBeeMutationFactory.java b/src/api/java/forestry/api/apiculture/IBeeMutationFactory.java deleted file mode 100644 index 315a4c6f..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeMutationFactory.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.genetics.IAllele; - -public interface IBeeMutationFactory { - /** - * Creates a new bee mutation. - * Automatically registered with BeeManager.beeRoot.registerMutation() - * See IBeeMutationCustom and IMutationCustom for adding additional properties to the returned mutation. - * - * @param parentBee0 A parent bee for this mutation - * @param parentBee1 A parent bee for this mutation - * @param result The resulting alleles for this mutation - * @param chance The chance that breeding the two parent bees will result in this mutation - * @return a new bee mutation. - */ - IBeeMutationCustom createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance); -} diff --git a/src/api/java/forestry/api/apiculture/IBeeRoot.java b/src/api/java/forestry/api/apiculture/IBeeRoot.java deleted file mode 100644 index b4bbb291..00000000 --- a/src/api/java/forestry/api/apiculture/IBeeRoot.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.ArrayList; -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -import com.mojang.authlib.GameProfile; - -import forestry.api.core.IStructureLogic; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.ISpeciesRoot; - -public interface IBeeRoot extends ISpeciesRoot { - - /** - * @return true if passed item is a Forestry bee. Equal to getType(ItemStack stack) != EnumBeeType.NONE - */ - @Override - boolean isMember(ItemStack stack); - - /** - * @return {@link IBee} pattern parsed from the passed stack's nbt data. - */ - @Override - IBee getMember(ItemStack stack); - - @Override - IBee getMember(NBTTagCompound compound); - - /* GENOME CONVERSION */ - @Override - IBee templateAsIndividual(IAllele[] template); - - @Override - IBee templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); - - @Override - IBeeGenome templateAsGenome(IAllele[] template); - - @Override - IBeeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); - - /* BREEDING TRACKER */ - /** - * @param world - * @return {@link IApiaristTracker} associated with the passed world. - */ - IApiaristTracker getBreedingTracker(World world, GameProfile player); - - /* BEE SPECIFIC */ - /** - * @return type of bee encoded on the itemstack. EnumBeeType.NONE if it isn't a bee. - */ - EnumBeeType getType(ItemStack stack); - - /** - * @return true if passed item is a drone. Equal to getType(ItemStack stack) == EnumBeeType.DRONE - */ - boolean isDrone(ItemStack stack); - - /** - * @return true if passed item is mated (i.e. a queen) - */ - boolean isMated(ItemStack stack); - - /** - * @param genome - * Valid {@link IBeeGenome} - * @return {@link IBee} from the passed genome - */ - IBee getBee(World world, IBeeGenome genome); - - /** - * Creates an IBee suitable for a queen containing the necessary second genome for the mate. - * - * @param genome - * Valid {@link IBeeGenome} - * @param mate - * Valid {@link IBee} representing the mate. - * @return Mated {@link IBee} from the passed genomes. - */ - IBee getBee(World world, IBeeGenome genome, IBee mate); - - /* TEMPLATES */ - @Override - ArrayList getIndividualTemplates(); - - /* MUTATIONS */ - @Override - Collection getMutations(boolean shuffle); - - /* GAME MODE */ - void resetBeekeepingMode(); - - ArrayList getBeekeepingModes(); - - IBeekeepingMode getBeekeepingMode(World world); - - IBeekeepingMode getBeekeepingMode(String name); - - void registerBeekeepingMode(IBeekeepingMode mode); - - void setBeekeepingMode(World world, String name); - - /* MISC */ - /** - * @param housing - * Object implementing IBeeHousing. - * @return IBeekeepingLogic - */ - IBeekeepingLogic createBeekeepingLogic(IBeeHousing housing); - - /** - * TileEntities wanting to function as alveary components need to implement structure logic for validation. - * - * @return IStructureLogic for alvearies. - */ - IStructureLogic createAlvearyStructureLogic(IAlvearyComponent structure); - -} diff --git a/src/api/java/forestry/api/apiculture/IBeekeepingLogic.java b/src/api/java/forestry/api/apiculture/IBeekeepingLogic.java deleted file mode 100644 index 0a4da7b3..00000000 --- a/src/api/java/forestry/api/apiculture/IBeekeepingLogic.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import forestry.api.core.INBTTagable; -import forestry.api.genetics.IEffectData; - -public interface IBeekeepingLogic extends INBTTagable { - - /* STATE INFORMATION */ - int getBreedingTime(); - - int getTotalBreedingTime(); - - IBee getQueen(); - - IBeeHousing getHousing(); - - IEffectData[] getEffectData(); - - /* UPDATING */ - void update(); - -} diff --git a/src/api/java/forestry/api/apiculture/IBeekeepingMode.java b/src/api/java/forestry/api/apiculture/IBeekeepingMode.java deleted file mode 100644 index 80d30981..00000000 --- a/src/api/java/forestry/api/apiculture/IBeekeepingMode.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.ArrayList; - -import net.minecraft.world.World; - -public interface IBeekeepingMode extends IBeeModifier { - - /** - * @return Localized name of this beekeeping mode. - */ - String getName(); - - /** - * @return Localized list of strings outlining the behaviour of this beekeeping mode. - */ - ArrayList getDescription(); - - /** - * @return Float used to modify the wear on comb frames. - */ - float getWearModifier(); - - /** - * @param queen - * @return fertility taking into account the birthing queen and surroundings. - */ - int getFinalFertility(IBee queen, World world, int x, int y, int z); - - /** - * @param queen - * @return true if the queen is genetically "fatigued" and should not be reproduced anymore. - */ - boolean isFatigued(IBee queen, IBeeHousing housing); - - /** - * @param queen - * @param housing - * @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect. - */ - boolean isOverworked(IBee queen, IBeeHousing housing); - - /** - * - * @param queen - * @param offspring - * @param housing - * @return true if the genetic structure of the queen is breaking down during spawning of the offspring (with chance). will trigger a negative effect. - */ - boolean isDegenerating(IBee queen, IBee offspring, IBeeHousing housing); - - /** - * @param queen - * @return true if an offspring of this queen is considered a natural - */ - boolean isNaturalOffspring(IBee queen); - - /** - * @param queen - * @return true if this mode allows the passed queen or princess to be multiplied - */ - boolean mayMultiplyPrincess(IBee queen); - - -} diff --git a/src/api/java/forestry/api/apiculture/IHiveDrop.java b/src/api/java/forestry/api/apiculture/IHiveDrop.java deleted file mode 100644 index ea175f8b..00000000 --- a/src/api/java/forestry/api/apiculture/IHiveDrop.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Bees can be seeded either as hive drops or as mutation results. - * - * Add IHiveDrops with HiveManager.get___Hive.addDrop - * - * @author SirSengir - */ -public interface IHiveDrop { - - ItemStack getPrincess(World world, int x, int y, int z, int fortune); - - Collection getDrones(World world, int x, int y, int z, int fortune); - - Collection getAdditional(World world, int x, int y, int z, int fortune); - - /** - * Chance to drop. Default drops have 80 (= 80 %). - * - * @param world Minecraft world this is called for. - * @param x x-Coordinate of the broken hive. - * @param y y-Coordinate of the broken hive. - * @param z z-Coordinate of the broken hive. - * @return Chance for drop as an integer of 0 - 100. - */ - int getChance(World world, int x, int y, int z); -} diff --git a/src/api/java/forestry/api/apiculture/IHiveFrame.java b/src/api/java/forestry/api/apiculture/IHiveFrame.java deleted file mode 100644 index dabc9e01..00000000 --- a/src/api/java/forestry/api/apiculture/IHiveFrame.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import net.minecraft.item.ItemStack; - -public interface IHiveFrame extends IBeeModifier { - - /** - * Wears out a frame. - * - * @param housing - * IBeeHousing the frame is contained in. - * @param frame - * ItemStack containing the actual frame. - * @param queen - * Current queen in the caller. - * @param wear - * Integer denoting the amount worn out. The wear modifier of the current beekeeping mode has already been taken into account. - * @return ItemStack containing the actual frame with adjusted damage. - */ - ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear); - -} diff --git a/src/api/java/forestry/api/apiculture/IJubilanceFactory.java b/src/api/java/forestry/api/apiculture/IJubilanceFactory.java deleted file mode 100644 index 1b81a9d0..00000000 --- a/src/api/java/forestry/api/apiculture/IJubilanceFactory.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -import net.minecraft.block.Block; - -public interface IJubilanceFactory { - /** The default Jubilance Provider is satisfied when the humidity and temperature are ideal for the bee. */ - IJubilanceProvider getDefault(); - - /** The Requires Resource Jubilance Provider is satisfied when a specific block is under the hive. */ - IJubilanceProvider getRequiresResource(Block block, int meta); -} diff --git a/src/api/java/forestry/api/apiculture/IJubilanceProvider.java b/src/api/java/forestry/api/apiculture/IJubilanceProvider.java deleted file mode 100644 index faf34d05..00000000 --- a/src/api/java/forestry/api/apiculture/IJubilanceProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture; - -public interface IJubilanceProvider { - - /** - * Returns true when conditions are right to make this species Jubilant. - * Jubilant bees can produce their Specialty products. - */ - boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing); -} diff --git a/src/api/java/forestry/api/apiculture/hives/HiveManager.java b/src/api/java/forestry/api/apiculture/hives/HiveManager.java deleted file mode 100644 index 17ca7d20..00000000 --- a/src/api/java/forestry/api/apiculture/hives/HiveManager.java +++ /dev/null @@ -1,13 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture.hives; - -public class HiveManager { - - public static IHiveRegistry hiveRegistry; - public static IHiveGenHelper genHelper; - -} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveDescription.java b/src/api/java/forestry/api/apiculture/hives/IHiveDescription.java deleted file mode 100644 index 82d761db..00000000 --- a/src/api/java/forestry/api/apiculture/hives/IHiveDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture.hives; - -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; - -public interface IHiveDescription { - - /** - * The hive generator for this hive. - */ - IHiveGen getHiveGen(); - - /** - * The hive block to be placed in the world. - */ - Block getBlock(); - int getMeta(); - - /** - * returns true if the hive can be generated in these conditions. - * Used as a fast early-elimination check for hives that have no hope of spawning in the area. - */ - boolean isGoodBiome(BiomeGenBase biome); - boolean isGoodHumidity(EnumHumidity humidity); - boolean isGoodTemperature(EnumTemperature temperature); - - /** - * float representing the relative chance a hive will generate in a chunk. - * Default is 1.0, higher numbers result in more hives, smaller will result in fewer. - * Tree hives want around 3.0 to 4.0 since there are less locations to generate on. - */ - float getGenChance(); - - /** - * Called after successful hive generation. - * world, x, y, z give the location of the new hive. - **/ - void postGen(World world, int x, int y, int z); -} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveGen.java b/src/api/java/forestry/api/apiculture/hives/IHiveGen.java deleted file mode 100644 index 57569d26..00000000 --- a/src/api/java/forestry/api/apiculture/hives/IHiveGen.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture.hives; - -import net.minecraft.world.World; - -public interface IHiveGen { - - /** - * return a Y value that the hive should try to generate at. - * returns negative if the hive can't be placed anywhere. - */ - int getYForHive(World world, int x, int z); - - /** - * returns true if the hive can be generated at this location. - * Used for advanced conditions, like checking that the ground below the hive is a certain type. - */ - boolean isValidLocation(World world, int x, int y, int z); - - /** - * returns true if the hive can safely replace the block at this location. - */ - boolean canReplace(World world, int x, int y, int z); - -} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveGenHelper.java b/src/api/java/forestry/api/apiculture/hives/IHiveGenHelper.java deleted file mode 100644 index 0eb6400c..00000000 --- a/src/api/java/forestry/api/apiculture/hives/IHiveGenHelper.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture.hives; - -import net.minecraft.block.Block; - -public interface IHiveGenHelper { - - /** - * Returns a hiveGen for a hive that spawns on the ground. - * validGroundBlocks specifies which block materials it can spawn on. - */ - IHiveGen ground(Block... validGroundBlocks); - - /** - * Returns a hiveGen for a hive that spawns in trees. - */ - IHiveGen tree(); - -} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveRegistry.java b/src/api/java/forestry/api/apiculture/hives/IHiveRegistry.java deleted file mode 100644 index 73f3524c..00000000 --- a/src/api/java/forestry/api/apiculture/hives/IHiveRegistry.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.apiculture.hives; - -import java.util.List; - -import forestry.api.apiculture.IHiveDrop; - -public interface IHiveRegistry { - - /* Forestry Hive Names */ - public static final String forest = "Forestry:forest"; - public static final String meadows = "Forestry:meadows"; - public static final String desert = "Forestry:desert"; - public static final String jungle = "Forestry:jungle"; - public static final String end = "Forestry:end"; - public static final String snow = "Forestry:snow"; - public static final String swamp = "Forestry:swamp"; - - /** - * Adds a new hive to be generated in the world. - */ - void registerHive(String hiveName, IHiveDescription hiveDescription); - - /** - * Add drops to a registered hive. - */ - void addDrops(String hiveName, IHiveDrop... drops); - void addDrops(String hiveName, List drop); -} diff --git a/src/api/java/forestry/api/apiculture/hives/package-info.java b/src/api/java/forestry/api/apiculture/hives/package-info.java deleted file mode 100644 index a045530c..00000000 --- a/src/api/java/forestry/api/apiculture/hives/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="4.1.0", owner="ForestryAPI|apiculture", provides="ForestryAPI|hives") -package forestry.api.apiculture.hives; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/apiculture/package-info.java b/src/api/java/forestry/api/apiculture/package-info.java deleted file mode 100644 index 3114e3eb..00000000 --- a/src/api/java/forestry/api/apiculture/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="3.3.0", owner="ForestryAPI|core", provides="ForestryAPI|apiculture") -package forestry.api.apiculture; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/arboriculture/EnumGermlingType.java b/src/api/java/forestry/api/arboriculture/EnumGermlingType.java deleted file mode 100644 index a564be0d..00000000 --- a/src/api/java/forestry/api/arboriculture/EnumGermlingType.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -public enum EnumGermlingType { - SAPLING("sapling"), BLOSSOM("blossom"), POLLEN("pollen"), GERMLING("germling"), NONE("none"); - - public static final EnumGermlingType[] VALUES = values(); - - private final String name; - - private EnumGermlingType(String name) { - this.name = name; - } - - public String getName() { - return name; - } - -} diff --git a/src/api/java/forestry/api/arboriculture/EnumGrowthConditions.java b/src/api/java/forestry/api/arboriculture/EnumGrowthConditions.java deleted file mode 100644 index 8b28601c..00000000 --- a/src/api/java/forestry/api/arboriculture/EnumGrowthConditions.java +++ /dev/null @@ -1,10 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -public enum EnumGrowthConditions { - HOSTILE, PALTRY, NORMAL, GOOD, EXCELLENT -} diff --git a/src/api/java/forestry/api/arboriculture/EnumTreeChromosome.java b/src/api/java/forestry/api/arboriculture/EnumTreeChromosome.java deleted file mode 100644 index 8f74d0c2..00000000 --- a/src/api/java/forestry/api/arboriculture/EnumTreeChromosome.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleArea; -import forestry.api.genetics.IAlleleBoolean; -import forestry.api.genetics.IAlleleFloat; -import forestry.api.genetics.IAlleleInteger; -import forestry.api.genetics.IAllelePlantType; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IFruitFamily; -import forestry.api.genetics.ISpeciesRoot; -import net.minecraftforge.common.EnumPlantType; - -public enum EnumTreeChromosome implements IChromosomeType { - - /** - * Determines the following: - WorldGen, including the used wood blocks - {@link IFruitFamily}s supported. Limits which {@link IFruitProvider} - * will actually yield fruit with this species. - Native {@link EnumPlantType} for this tree. Combines with the PLANT chromosome. - */ - SPECIES(IAlleleTreeSpecies.class), - /** - * {@link IGrowthProvider}, determines conditions required by the tree to grow. - */ - GROWTH(IAlleleGrowth.class), - /** - * A float modifying the height of the tree. Taken into account at worldgen. - */ - HEIGHT(IAlleleFloat.class), - /** - * Chance for saplings. - */ - FERTILITY(IAlleleFloat.class), - /** - * {@link IFruitProvider}, determines if and what fruits are grown on the tree. Limited by the {@link IFruitFamily}s the species supports. - */ - FRUITS(IAlleleFruit.class), - /** - * Chance for fruit leaves and/or drops. - */ - YIELD(IAlleleFloat.class), - /** - * May add additional tolerances for {@link EnumPlantTypes}. - */ - PLANT(IAllelePlantType.class), - /** - * Determines the speed at which fruit will ripen on this tree. - */ - SAPPINESS(IAlleleFloat.class), - /** - * Territory for leaf effects. Unused. - */ - TERRITORY(IAlleleArea.class), - /** - * Leaf effect. Unused. - */ - EFFECT(IAlleleLeafEffect.class), - /** - * Amount of random ticks which need to elapse before a sapling will grow into a tree. - */ - MATURATION(IAlleleInteger.class), - - GIRTH(IAlleleInteger.class), - /** - * Determines if the tree can burn. - */ - FIREPROOF(IAlleleBoolean.class), - ; - - Class clss; - - EnumTreeChromosome(Class clss) { - this.clss = clss; - } - - @Override - public Class getAlleleClass() { - return clss; - } - - @Override - public String getName() { - return this.toString().toLowerCase(); - } - - @Override - public ISpeciesRoot getSpeciesRoot() { - return AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees"); - } - -} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleFruit.java b/src/api/java/forestry/api/arboriculture/IAlleleFruit.java deleted file mode 100644 index 0f54db51..00000000 --- a/src/api/java/forestry/api/arboriculture/IAlleleFruit.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import forestry.api.genetics.IAllele; - -/** - * Simple allele encapsulating an {@link IFruitProvider}. - */ -public interface IAlleleFruit extends IAllele { - - IFruitProvider getProvider(); - -} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleGrowth.java b/src/api/java/forestry/api/arboriculture/IAlleleGrowth.java deleted file mode 100644 index 6cb4b438..00000000 --- a/src/api/java/forestry/api/arboriculture/IAlleleGrowth.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import forestry.api.genetics.IAllele; - -/** - * Simple allele encapsulating an {@link IGrowthProvider}. - */ -public interface IAlleleGrowth extends IAllele { - - IGrowthProvider getProvider(); - -} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleLeafEffect.java b/src/api/java/forestry/api/arboriculture/IAlleleLeafEffect.java deleted file mode 100644 index d52d963a..00000000 --- a/src/api/java/forestry/api/arboriculture/IAlleleLeafEffect.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import net.minecraft.world.World; - -import forestry.api.genetics.IAlleleEffect; -import forestry.api.genetics.IEffectData; - -/** - * Simple allele encapsulating a leaf effect. (Not implemented) - */ -public interface IAlleleLeafEffect extends IAlleleEffect { - - IEffectData doEffect(ITreeGenome genome, IEffectData storedData, World world, int x, int y, int z); - -} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleTreeSpecies.java b/src/api/java/forestry/api/arboriculture/IAlleleTreeSpecies.java deleted file mode 100644 index be057254..00000000 --- a/src/api/java/forestry/api/arboriculture/IAlleleTreeSpecies.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraftforge.common.EnumPlantType; - -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IFruitFamily; - -public interface IAlleleTreeSpecies extends IAlleleSpecies { - - ITreeRoot getRoot(); - - /** - * @return Native plant type of this species. - */ - EnumPlantType getPlantType(); - - /** - * @return List of all {@link IFruitFamily}s which can grow on leaves generated by this species. - */ - Collection getSuitableFruit(); - - /** - * @param tree - * @param world - * @param x - * @param y - * @param z - * @return Tree generator for the tree at the given location. - */ - WorldGenerator getGenerator(ITree tree, World world, int x, int y, int z); - - /** - * @return All available generator classes for this species. - */ - Class[] getGeneratorClasses(); - - /* TEXTURES AND OVERRIDES */ - int getLeafColour(ITree tree); - - short getLeafIconIndex(ITree tree, boolean fancy); - - @SideOnly(Side.CLIENT) - IIcon getGermlingIcon(EnumGermlingType type, int renderPass); - - @SideOnly(Side.CLIENT) - int getGermlingColour(EnumGermlingType type, int renderPass); - - /** - * - * @return Array of ItemStacks representing logs that these tree produces, the first one being the primary one - */ - ItemStack[] getLogStacks(); - -} diff --git a/src/api/java/forestry/api/arboriculture/IArboristTracker.java b/src/api/java/forestry/api/arboriculture/IArboristTracker.java deleted file mode 100644 index 9777e876..00000000 --- a/src/api/java/forestry/api/arboriculture/IArboristTracker.java +++ /dev/null @@ -1,12 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import forestry.api.genetics.IBreedingTracker; - -public interface IArboristTracker extends IBreedingTracker { - -} diff --git a/src/api/java/forestry/api/arboriculture/IFruitProvider.java b/src/api/java/forestry/api/arboriculture/IFruitProvider.java deleted file mode 100644 index ef54fc99..00000000 --- a/src/api/java/forestry/api/arboriculture/IFruitProvider.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import forestry.api.genetics.IFruitFamily; - -public interface IFruitProvider { - - IFruitFamily getFamily(); - - int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime); - - boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z); - - int getRipeningPeriod(); - - // / Products, Chance - ItemStack[] getProducts(); - - // / Specialty, Chance - ItemStack[] getSpecialty(); - - ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime); - - /** - * @return Short, human-readable identifier used in the treealyzer. - */ - String getDescription(); - - /* TEXTURE OVERLAY */ - /** - * @param genome - * @param world - * @param x - * @param y - * @param z - * @param ripeningTime - * Elapsed ripening time for the fruit. - * @param fancy - * @return IIcon index of the texture to overlay on the leaf block. - */ - short getIconIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy); - - /** - * @return true if this fruit provider requires fruit blocks to spawn, false otherwise. - */ - boolean requiresFruitBlocks(); - - /** - * Tries to spawn a fruit block at the potential position when the tree generates. - * - * @param genome - * @param world - * @param x - * @param y - * @param z - * @return true if a fruit block was spawned, false otherwise. - */ - boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z); - - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister register); -} diff --git a/src/api/java/forestry/api/arboriculture/IGrowthProvider.java b/src/api/java/forestry/api/arboriculture/IGrowthProvider.java deleted file mode 100644 index 92e553e0..00000000 --- a/src/api/java/forestry/api/arboriculture/IGrowthProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import net.minecraft.world.World; - -public interface IGrowthProvider { - - /** - * Check to see whether a sapling at the given location with the given genome can grow into a tree. - * - * @param genome Genome of the tree this is called for. - * @param world Minecraft world the tree will inhabit. - * @param xPos x-Coordinate to attempt growth at. - * @param yPos y-Coordinate to attempt growth at. - * @param zPos z-Coordinate to attempt growth at. - * @param expectedGirth Trunk size of the tree to generate. - * @param expectedHeight Height of the tree to generate. - * @return true if the tree can grow at the given coordinates, false otherwise. - */ - boolean canGrow(ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth, int expectedHeight); - - EnumGrowthConditions getGrowthConditions(ITreeGenome genome, World world, int xPos, int yPos, int zPos); - - /** - * @return Short, human-readable identifier used in the treealyzer. - */ - String getDescription(); - - /** - * @return Detailed description of growth behaviour used in the treealyzer. - */ - String[] getInfo(); - -} diff --git a/src/api/java/forestry/api/arboriculture/ILeafTickHandler.java b/src/api/java/forestry/api/arboriculture/ILeafTickHandler.java deleted file mode 100644 index 4d7fba44..00000000 --- a/src/api/java/forestry/api/arboriculture/ILeafTickHandler.java +++ /dev/null @@ -1,12 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import net.minecraft.world.World; - -public interface ILeafTickHandler { - boolean onRandomLeafTick(ITree tree, World world, int biomeId, int x, int y, int z, boolean isDestroyed); -} diff --git a/src/api/java/forestry/api/arboriculture/IToolGrafter.java b/src/api/java/forestry/api/arboriculture/IToolGrafter.java deleted file mode 100644 index 339725e6..00000000 --- a/src/api/java/forestry/api/arboriculture/IToolGrafter.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface IToolGrafter { - /** - * Called by leaves to determine the increase in sapling droprate. - * - * @param stack ItemStack containing the grafter. - * @param world Minecraft world the player and the target block inhabit. - * @param x x-Coordinate of the broken leaf block. - * @param y y-Coordinate of the broken leaf block. - * @param z z-Coordinate of the broken leaf block. - * @return Float representing the factor the usual drop chance is to be multiplied by. - */ - float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z); -} diff --git a/src/api/java/forestry/api/arboriculture/ITree.java b/src/api/java/forestry/api/arboriculture/ITree.java deleted file mode 100644 index 5cbd736f..00000000 --- a/src/api/java/forestry/api/arboriculture/ITree.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import java.util.EnumSet; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; - -import net.minecraftforge.common.EnumPlantType; - -import forestry.api.genetics.IEffectData; -import forestry.api.genetics.IIndividual; -import forestry.api.world.ITreeGenData; - -public interface ITree extends IIndividual, ITreeGenData { - - void mate(ITree other); - - IEffectData[] doEffect(IEffectData[] storedData, World world, int biomeid, int x, int y, int z); - - IEffectData[] doFX(IEffectData[] storedData, World world, int biomeid, int x, int y, int z); - - ITreeGenome getGenome(); - - ITreeGenome getMate(); - - EnumSet getPlantTypes(); - - ITree[] getSaplings(World world, int x, int y, int z, float modifier); - - ItemStack[] getProduceList(); - - ItemStack[] getSpecialtyList(); - - ItemStack[] produceStacks(World world, int x, int y, int z, int ripeningTime); - - /** - * - * @param world - * @param x - * @param y - * @param z - * @return Boolean indicating whether a sapling can stay planted at the given position. - */ - boolean canStay(World world, int x, int y, int z); - - /** - * - * @param world - * @param x - * @param y - * @param z - * @return Boolean indicating whether a sapling at the given position can grow into a tree. - */ - boolean canGrow(World world, int x, int y, int z, int expectedGirth, int expectedHeight); - - /** - * @return Integer denoting the maturity (block ticks) required for a sapling to attempt to grow into a tree. - */ - int getRequiredMaturity(); - - /** - * @return Integer denoting how resilient leaf blocks are against adverse influences (i.e. caterpillars). - */ - int getResilience(); - - /** - * @param world - * @param x - * @param y - * @param z - * @return Integer denoting the size of the tree trunk. - */ - int getGirth(World world, int x, int y, int z); - - - - /** - * - * @param world - * @param x - * @param y - * @param z - * @return Growth conditions at the given position. - */ - EnumGrowthConditions getGrowthCondition(World world, int x, int y, int z); - - WorldGenerator getTreeGenerator(World world, int x, int y, int z, boolean wasBonemealed); - - ITree copy(); - - boolean isPureBred(EnumTreeChromosome chromosome); - - boolean canBearFruit(); -} diff --git a/src/api/java/forestry/api/arboriculture/ITreeGenome.java b/src/api/java/forestry/api/arboriculture/ITreeGenome.java deleted file mode 100644 index ee5a1f02..00000000 --- a/src/api/java/forestry/api/arboriculture/ITreeGenome.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import java.util.EnumSet; - -import net.minecraftforge.common.EnumPlantType; - -import forestry.api.genetics.IGenome; - -public interface ITreeGenome extends IGenome { - - IAlleleTreeSpecies getPrimary(); - - IAlleleTreeSpecies getSecondary(); - - IFruitProvider getFruitProvider(); - - IGrowthProvider getGrowthProvider(); - - float getHeight(); - - float getFertility(); - - /** - * @return Determines either a) how many fruit leaves there are or b) the chance for any fruit leave to drop a sapling. Exact usage determined by the - * IFruitProvider - */ - float getYield(); - - float getSappiness(); - - EnumSet getPlantTypes(); - - /** - * @return Amount of random block ticks required for a sapling to mature into a fully grown tree. - */ - int getMaturationTime(); - - int getGirth(); - - IAlleleLeafEffect getEffect(); -} diff --git a/src/api/java/forestry/api/arboriculture/ITreeModifier.java b/src/api/java/forestry/api/arboriculture/ITreeModifier.java deleted file mode 100644 index 775f91eb..00000000 --- a/src/api/java/forestry/api/arboriculture/ITreeModifier.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -public interface ITreeModifier { - - /** - * - * @param genome - * @return Float used to modify the height. - */ - float getHeightModifier(ITreeGenome genome, float currentModifier); - - /** - * - * @param genome - * @return Float used to modify the yield. - */ - float getYieldModifier(ITreeGenome genome, float currentModifier); - - /** - * - * @param genome - * @return Float used to modify the sappiness. - */ - float getSappinessModifier(ITreeGenome genome, float currentModifier); - - /** - * - * @param genome - * @return Float used to modify the maturation. - */ - float getMaturationModifier(ITreeGenome genome, float currentModifier); - - /** - * @param genome0 - * @param genome1 - * @return Float used to modify the base mutation chance. - */ - float getMutationModifier(ITreeGenome genome0, ITreeGenome genome1, float currentModifier); - -} diff --git a/src/api/java/forestry/api/arboriculture/ITreeMutation.java b/src/api/java/forestry/api/arboriculture/ITreeMutation.java deleted file mode 100644 index 65804969..00000000 --- a/src/api/java/forestry/api/arboriculture/ITreeMutation.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import net.minecraft.world.World; - -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; - -public interface ITreeMutation extends IMutation { - - /** - * @return {@link ISpeciesRoot} this mutation is associated with. - */ - ITreeRoot getRoot(); - - /** - * @param world - * @param x - * @param y - * @param z - * @param allele0 - * @param allele1 - * @param genome0 - * @param genome1 - * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously! - */ - float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); -} diff --git a/src/api/java/forestry/api/arboriculture/ITreeRoot.java b/src/api/java/forestry/api/arboriculture/ITreeRoot.java deleted file mode 100644 index e966ca04..00000000 --- a/src/api/java/forestry/api/arboriculture/ITreeRoot.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import java.util.ArrayList; -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -import com.mojang.authlib.GameProfile; - -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IChromosome; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.ISpeciesRoot; - -public interface ITreeRoot extends ISpeciesRoot { - - @Override - boolean isMember(ItemStack itemstack); - - @Override - ITree getMember(ItemStack itemstack); - - @Override - ITree getMember(NBTTagCompound compound); - - @Override - ITree templateAsIndividual(IAllele[] template); - - @Override - ITree templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); - - @Override - ITreeGenome templateAsGenome(IAllele[] template); - - @Override - ITreeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); - - /** - * @param world - * @return {@link IArboristTracker} associated with the passed world. - */ - @Override - IArboristTracker getBreedingTracker(World world, GameProfile player); - - /* TREE SPECIFIC */ - /** - * Register a leaf tick handler. - * @param handler the {@link ILeafTickHandler} to register. - */ - void registerLeafTickHandler(ILeafTickHandler handler); - - Collection getLeafTickHandlers(); - - /** - * @return type of tree encoded on the itemstack. EnumBeeType.NONE if it isn't a tree. - */ - EnumGermlingType getType(ItemStack stack); - - ITree getTree(World world, int x, int y, int z); - - ITree getTree(World world, ITreeGenome genome); - - boolean plantSapling(World world, ITree tree, GameProfile owner, int x, int y, int z); - - /** - * @deprecated since Forestry 3.5.0. Use ITreeGenData setLeavesDecorative. - */ - @Deprecated - // decorative=true for creative and player-placed leaves. No decay, pollination, or drops. - boolean setLeaves(World world, IIndividual tree, GameProfile owner, int x, int y, int z, boolean decorative); - - /** - * @deprecated since Forestry 3.5.0. Use ITreeGenData setLeaves. - */ - @Deprecated - // set normal leaves created as worldgen - boolean setLeaves(World world, IIndividual tree, GameProfile owner, int x, int y, int z); - - @Override - IChromosome[] templateAsChromosomes(IAllele[] template); - - @Override - IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive); - - boolean setFruitBlock(World world, IAlleleFruit allele, float sappiness, short[] indices, int x, int y, int z); - - /* GAME MODE */ - ArrayList getTreekeepingModes(); - - ITreekeepingMode getTreekeepingMode(World world); - - ITreekeepingMode getTreekeepingMode(String name); - - void registerTreekeepingMode(ITreekeepingMode mode); - - void setTreekeepingMode(World world, String name); - - /* TEMPLATES */ - @Override - ArrayList getIndividualTemplates(); - - /* MUTATIONS */ - @Override - Collection getMutations(boolean shuffle); - -} diff --git a/src/api/java/forestry/api/arboriculture/ITreekeepingMode.java b/src/api/java/forestry/api/arboriculture/ITreekeepingMode.java deleted file mode 100644 index cc5224d8..00000000 --- a/src/api/java/forestry/api/arboriculture/ITreekeepingMode.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.arboriculture; - -import java.util.ArrayList; - -public interface ITreekeepingMode extends ITreeModifier { - - /** - * @return Localized name of this treekeeping mode. - */ - String getName(); - - /** - * @return Localized list of strings outlining the behaviour of this treekeeping mode. - */ - ArrayList getDescription(); - -} diff --git a/src/api/java/forestry/api/arboriculture/package-info.java b/src/api/java/forestry/api/arboriculture/package-info.java deleted file mode 100644 index de961141..00000000 --- a/src/api/java/forestry/api/arboriculture/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="2.3.0", owner="ForestryAPI|core", provides="ForestryAPI|arboriculture") -package forestry.api.arboriculture; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/circuits/ChipsetManager.java b/src/api/java/forestry/api/circuits/ChipsetManager.java deleted file mode 100644 index c5f0db5c..00000000 --- a/src/api/java/forestry/api/circuits/ChipsetManager.java +++ /dev/null @@ -1,13 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.circuits; - -public class ChipsetManager { - - public static ISolderManager solderManager; - public static ICircuitRegistry circuitRegistry; - -} diff --git a/src/api/java/forestry/api/circuits/ICircuit.java b/src/api/java/forestry/api/circuits/ICircuit.java deleted file mode 100644 index 01b7e79d..00000000 --- a/src/api/java/forestry/api/circuits/ICircuit.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.circuits; - -import java.util.List; - -import net.minecraft.tileentity.TileEntity; - -public interface ICircuit { - String getUID(); - - boolean requiresDiscovery(); - - int getLimit(); - - String getName(); - - boolean isCircuitable(TileEntity tile); - - void onInsertion(int slot, TileEntity tile); - - void onLoad(int slot, TileEntity tile); - - void onRemoval(int slot, TileEntity tile); - - void onTick(int slot, TileEntity tile); - - void addTooltip(List list); -} diff --git a/src/api/java/forestry/api/circuits/ICircuitBoard.java b/src/api/java/forestry/api/circuits/ICircuitBoard.java deleted file mode 100644 index 3b424d75..00000000 --- a/src/api/java/forestry/api/circuits/ICircuitBoard.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.circuits; - -import java.util.List; - -import net.minecraft.tileentity.TileEntity; - -import forestry.api.core.INBTTagable; - -public interface ICircuitBoard extends INBTTagable { - - int getPrimaryColor(); - - int getSecondaryColor(); - - void addTooltip(List list); - - void onInsertion(TileEntity tile); - - void onLoad(TileEntity tile); - - void onRemoval(TileEntity tile); - - void onTick(TileEntity tile); - - ICircuit[] getCircuits(); - -} diff --git a/src/api/java/forestry/api/circuits/ICircuitLayout.java b/src/api/java/forestry/api/circuits/ICircuitLayout.java deleted file mode 100644 index e90853b9..00000000 --- a/src/api/java/forestry/api/circuits/ICircuitLayout.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.circuits; - -public interface ICircuitLayout { - - String getUID(); - - String getName(); - - String getUsage(); - -} diff --git a/src/api/java/forestry/api/circuits/ICircuitLibrary.java b/src/api/java/forestry/api/circuits/ICircuitLibrary.java deleted file mode 100644 index 0d65ba45..00000000 --- a/src/api/java/forestry/api/circuits/ICircuitLibrary.java +++ /dev/null @@ -1,10 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.circuits; - -public interface ICircuitLibrary { - -} diff --git a/src/api/java/forestry/api/circuits/ICircuitRegistry.java b/src/api/java/forestry/api/circuits/ICircuitRegistry.java deleted file mode 100644 index 9fb2b94d..00000000 --- a/src/api/java/forestry/api/circuits/ICircuitRegistry.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.circuits; - -import java.util.Map; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface ICircuitRegistry { - - /* CIRCUITS */ - Map getRegisteredCircuits(); - - void registerCircuit(ICircuit circuit); - - ICircuit getCircuit(String uid); - - ICircuitLibrary getCircuitLibrary(World world, String playername); - - /* LAYOUTS */ - Map getRegisteredLayouts(); - - void registerLayout(ICircuitLayout layout); - - ICircuitLayout getLayout(String uid); - - ICircuitLayout getDefaultLayout(); - - ICircuitBoard getCircuitboard(ItemStack itemstack); - - boolean isChipset(ItemStack itemstack); - -} diff --git a/src/api/java/forestry/api/circuits/ISolderManager.java b/src/api/java/forestry/api/circuits/ISolderManager.java deleted file mode 100644 index af9b41f1..00000000 --- a/src/api/java/forestry/api/circuits/ISolderManager.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.circuits; - -import net.minecraft.item.ItemStack; - -public interface ISolderManager { - - void addRecipe(ICircuitLayout layout, ItemStack resource, ICircuit circuit); - -} diff --git a/src/api/java/forestry/api/circuits/package-info.java b/src/api/java/forestry/api/circuits/package-info.java deleted file mode 100644 index 88612198..00000000 --- a/src/api/java/forestry/api/circuits/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="2.0.0", owner="ForestryAPI|core", provides="ForestryAPI|circuits") -package forestry.api.circuits; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/core/BiomeHelper.java b/src/api/java/forestry/api/core/BiomeHelper.java deleted file mode 100644 index bc20cd66..00000000 --- a/src/api/java/forestry/api/core/BiomeHelper.java +++ /dev/null @@ -1,36 +0,0 @@ -package forestry.api.core; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.world.biome.BiomeGenBase; - -import net.minecraftforge.common.BiomeDictionary; - -public class BiomeHelper { - - private static final Map isBiomeHellishCache = new HashMap(); - - /** - * Determines if it can rain or snow in the given biome. - */ - public static boolean canRainOrSnow(BiomeGenBase biomeGenBase) { - return biomeGenBase.getEnableSnow() || biomeGenBase.canSpawnLightningBolt(); - } - - /** - * Determines if a given BiomeGenBase is of HELLISH temperature, since it is treated separately from actual temperature values. - * Uses the BiomeDictionary. - * @param biomeGen BiomeGenBase of the biome in question - * @return true, if the BiomeGenBase is a Nether-type biome; false otherwise. - */ - public static boolean isBiomeHellish(BiomeGenBase biomeGen) { - if (isBiomeHellishCache.containsKey(biomeGen)) { - return isBiomeHellishCache.get(biomeGen); - } - - boolean isBiomeHellish = BiomeDictionary.isBiomeOfType(biomeGen, BiomeDictionary.Type.NETHER); - isBiomeHellishCache.put(biomeGen, isBiomeHellish); - return isBiomeHellish; - } -} diff --git a/src/api/java/forestry/api/core/EnumHumidity.java b/src/api/java/forestry/api/core/EnumHumidity.java deleted file mode 100644 index a8743169..00000000 --- a/src/api/java/forestry/api/core/EnumHumidity.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -/** - * Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location. - * - * This enum concerns humidity. - */ -public enum EnumHumidity { - ARID("Arid"), NORMAL("Normal"), DAMP("Damp"); - - public final String name; - - private EnumHumidity(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - - /** - * Determines the EnumHumidity given a floating point representation of Minecraft Rainfall. - * To check if rainfall is possible in a biome, use BiomeHelper.canRainOrSnow(). - * @param rawHumidity raw rainfall value - * @return EnumHumidity corresponding to rainfall value - */ - public static EnumHumidity getFromValue(float rawHumidity) { - if (rawHumidity > 0.85f) { // matches BiomeGenBase.isHighHumidity() - return DAMP; - } - else if (rawHumidity >= 0.3f) { - return NORMAL; - } - else { - return ARID; - } - } -} diff --git a/src/api/java/forestry/api/core/EnumTemperature.java b/src/api/java/forestry/api/core/EnumTemperature.java deleted file mode 100644 index b0c4c889..00000000 --- a/src/api/java/forestry/api/core/EnumTemperature.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.util.IIcon; -import net.minecraft.world.biome.BiomeGenBase; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location. - * - * This enum concerns temperature. - */ -public enum EnumTemperature { - NONE("None", "habitats/ocean"), ICY("Icy", "habitats/snow"), COLD("Cold", "habitats/taiga"), - NORMAL("Normal", "habitats/plains"), WARM("Warm", "habitats/jungle"), HOT("Hot", "habitats/desert"), HELLISH("Hellish", "habitats/nether"); - - public final String name; - public final String iconIndex; - - private EnumTemperature(String name, String iconIndex) { - this.name = name; - this.iconIndex = iconIndex; - } - - public String getName() { - return this.name; - } - - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return ForestryAPI.textureManager.getDefault(iconIndex); - } - - /** - * Determines the EnumTemperature given a floating point representation of - * Minecraft temperature. Hellish biomes are handled based on their biome - * type - check BiomeHelper.isBiomeHellish. - * @param rawTemp raw temperature value - * @return EnumTemperature corresponding to value of rawTemp - */ - public static EnumTemperature getFromValue(float rawTemp) { - if (rawTemp > 1.00f) { - return HOT; - } - else if (rawTemp > 0.80f) { - return WARM; - } - else if (rawTemp > 0.30f) { - return NORMAL; - } - else if (rawTemp > 0.0f) { - return COLD; - } - else { - return ICY; - } - } - - public static EnumTemperature getFromBiome(BiomeGenBase biomeGenBase) { - if (BiomeHelper.isBiomeHellish(biomeGenBase)) { - return HELLISH; - } - return getFromValue(biomeGenBase.temperature); - } -} diff --git a/src/api/java/forestry/api/core/ErrorStateRegistry.java b/src/api/java/forestry/api/core/ErrorStateRegistry.java deleted file mode 100644 index 67e5c466..00000000 --- a/src/api/java/forestry/api/core/ErrorStateRegistry.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2011-2014 SirSengir. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser Public License v3 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl-3.0.txt - * - * Various Contributors including, but not limited to: - * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges - ******************************************************************************* - */ -package forestry.api.core; - -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import net.minecraft.client.renderer.texture.IIconRegister; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * - * @author CovertJaguar - */ -public class ErrorStateRegistry { - - private static final BiMap states = HashBiMap.create(); - private static final Map stateNames = new HashMap(); - private static final Set stateView = Collections.unmodifiableSet(states.inverse().keySet()); - - public static void registerErrorState(IErrorState state) { - if (states.containsKey(state.getID())) - throw new RuntimeException("Forestry Error State does not possess a unique id."); - states.put(state.getID(), state); - addStateName(state, state.getUniqueName()); - } - - public static void addAlias(IErrorState state, String name) { - if (!states.values().contains(state)) - throw new RuntimeException("Forestry Error State did not exist while trying to register alias."); - addStateName(state, name); - } - - private static void addStateName(IErrorState state, String name) { - if (!name.contains(":")) - throw new RuntimeException("Forestry Error State name must be in the format :."); - if (stateNames.containsKey(name)) - throw new RuntimeException("Forestry Error State does not possess a unique name."); - stateNames.put(name, state); - } - - public static IErrorState getErrorState(short id) { - return states.get(id); - } - - public static IErrorState getErrorState(String name) { - return stateNames.get(name); - } - - public static Set getErrorStates() { - return stateView; - } - - @SideOnly(Side.CLIENT) - public static void initIcons(IIconRegister register) { - for (IErrorState code : states.values()) { - code.registerIcons(register); - } - } -} diff --git a/src/api/java/forestry/api/core/ForestryAPI.java b/src/api/java/forestry/api/core/ForestryAPI.java deleted file mode 100644 index 24c5b7eb..00000000 --- a/src/api/java/forestry/api/core/ForestryAPI.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Forestry's API is divided into several subcategories to make it easier to understand. - * - * If you need to distribute API files, try to only include the parts you are actually - * using to minimize conflicts due to API changes. - * - * .core - Miscallenous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods. - * .fuels - Managers and classes to facilitate adding fuels to various engines and machines. - * .recipes - Managers and helpers to facilitate adding new recipes to various machines. - * .storage - Managers, events and interfaces for defining new backpacks and handling backpack behaviour. - * .mail - Anything related to handling letters and adding new mail carrier systems. - * .genetics - Shared code for all genetic subclasses. - * \ .apiculture - Bees. - * \ .arboriculture - Trees. - * \ .lepidopterology - Butterflies. - * - * Note that if Forestry is not present, all these references will be null. - */ -public class ForestryAPI { - - /** - * The main mod instance for Forestry. - */ - public static Object instance; - - /** - * A {@link ITextureManager} needed for some things in the API. - */ - @SideOnly(Side.CLIENT) - public static ITextureManager textureManager; - - /** - * The currently active {@link IGameMode}. - */ - public static IGameMode activeMode; - - /** - * Provides information on certain Forestry constants (Villager IDs, Chest gen keys, etc) - */ - public static IForestryConstants forestryConstants; - -} diff --git a/src/api/java/forestry/api/core/ForestryEvent.java b/src/api/java/forestry/api/core/ForestryEvent.java deleted file mode 100644 index 86aac9bc..00000000 --- a/src/api/java/forestry/api/core/ForestryEvent.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.entity.player.EntityPlayer; - -import com.mojang.authlib.GameProfile; - -import cpw.mods.fml.common.eventhandler.Event; - -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; - -public abstract class ForestryEvent extends Event { - - private static abstract class BreedingEvent extends ForestryEvent { - public final ISpeciesRoot root; - public final IBreedingTracker tracker; - public final GameProfile username; - - private BreedingEvent(ISpeciesRoot root, GameProfile username, IBreedingTracker tracker) { - super(); - this.root = root; - this.username = username; - this.tracker = tracker; - } - } - - public static class SpeciesDiscovered extends BreedingEvent { - public final IAlleleSpecies species; - public SpeciesDiscovered(ISpeciesRoot root, GameProfile username, IAlleleSpecies species, IBreedingTracker tracker) { - super(root, username, tracker); - this.species = species; - } - } - - public static class MutationDiscovered extends BreedingEvent { - public final IMutation allele; - public MutationDiscovered(ISpeciesRoot root, GameProfile username, IMutation allele, IBreedingTracker tracker) { - super(root, username, tracker); - this.allele = allele; - } - } - - public static class SyncedBreedingTracker extends ForestryEvent { - public final IBreedingTracker tracker; - public final EntityPlayer player; - public SyncedBreedingTracker(IBreedingTracker tracker, EntityPlayer player) { - super(); - this.tracker = tracker; - this.player = player; - } - - } -} diff --git a/src/api/java/forestry/api/core/IArmorNaturalist.java b/src/api/java/forestry/api/core/IArmorNaturalist.java deleted file mode 100644 index 87400e27..00000000 --- a/src/api/java/forestry/api/core/IArmorNaturalist.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -public interface IArmorNaturalist { - - /** - * Called when the naturalist's armor acts as spectacles for seeing pollinated tree leaves/flowers. - * - * @param player - * Player doing the viewing - * @param armor - * Armor item - * @param doSee - * Whether or not to actually do the side effects of viewing - * @return true if the armor actually allows the player to see pollination. - */ - public boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee); -} diff --git a/src/api/java/forestry/api/core/IErrorState.java b/src/api/java/forestry/api/core/IErrorState.java deleted file mode 100644 index b17305fb..00000000 --- a/src/api/java/forestry/api/core/IErrorState.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2011-2014 SirSengir. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser Public License v3 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl-3.0.txt - * - * Various Contributors including, but not limited to: - * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges - ******************************************************************************* - */ -package forestry.api.core; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * - * @author CovertJaguar - */ -public interface IErrorState { - - short getID(); - - String getUniqueName(); - - String getDescription(); - - String getHelp(); - - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister register); - - @SideOnly(value = Side.CLIENT) - IIcon getIcon(); - -} diff --git a/src/api/java/forestry/api/core/IForestryConstants.java b/src/api/java/forestry/api/core/IForestryConstants.java deleted file mode 100644 index 4cf876f6..00000000 --- a/src/api/java/forestry/api/core/IForestryConstants.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -public interface IForestryConstants { - - /** - * @return The villager ID for the Apiarist Villager. - */ - public int getApicultureVillagerID(); - - /** - * @return The villager ID for the Arborist Villager. - */ - public int getArboricultureVillagerID(); - - /** - * @return The ChestGenHooks key for adding items to the Forestry Villager chest. - */ - public String getVillagerChestGenKey(); -} diff --git a/src/api/java/forestry/api/core/IGameMode.java b/src/api/java/forestry/api/core/IGameMode.java deleted file mode 100644 index 0b2b0c55..00000000 --- a/src/api/java/forestry/api/core/IGameMode.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.item.ItemStack; - -public interface IGameMode { - - /** - * @return Human-readable identifier for the game mode. (i.e. 'EASY', 'NORMAL', 'HARD') - */ - String getIdentifier(); - - /** - * @param ident Identifier for the setting. (See the gamemode config.) - * @return Value of the requested setting, false if unknown setting. - */ - boolean getBooleanSetting(String ident); - - /** - * @param ident Identifier for the setting. (See the gamemode config.) - * @return Value of the requested setting, 0 if unknown setting. - */ - int getIntegerSetting(String ident); - - /** - * @param ident Identifier for the setting. (See the gamemode config.) - * @return Value of the requested setting, 0 if unknown setting. - */ - float getFloatSetting(String ident); - - /** - * @param ident Identifier for the setting. (See the gamemode config.) - * @return Value of the requested setting, an itemstack containing an apple if unknown setting. - */ - ItemStack getStackSetting(String ident); - -} diff --git a/src/api/java/forestry/api/core/IIconProvider.java b/src/api/java/forestry/api/core/IIconProvider.java deleted file mode 100644 index 308e3ce5..00000000 --- a/src/api/java/forestry/api/core/IIconProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Provides icons, needed in some interfaces, most notably for bees and trees. - */ -public interface IIconProvider { - - @SideOnly(Side.CLIENT) - IIcon getIcon(short texUID); - - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister register); - -} diff --git a/src/api/java/forestry/api/core/INBTTagable.java b/src/api/java/forestry/api/core/INBTTagable.java deleted file mode 100644 index 1d3f8580..00000000 --- a/src/api/java/forestry/api/core/INBTTagable.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.nbt.NBTTagCompound; - -public interface INBTTagable { - void readFromNBT(NBTTagCompound nbttagcompound); - - void writeToNBT(NBTTagCompound nbttagcompound); -} diff --git a/src/api/java/forestry/api/core/IStructureLogic.java b/src/api/java/forestry/api/core/IStructureLogic.java deleted file mode 100644 index aa93d171..00000000 --- a/src/api/java/forestry/api/core/IStructureLogic.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -public interface IStructureLogic extends INBTTagable { - - /** - * @return String unique to the type of structure controlled by this structure logic. - */ - String getTypeUID(); - - /** - * Called by {@link ITileStructure}'s validateStructure(). - */ - void validateStructure(); - -} diff --git a/src/api/java/forestry/api/core/ITextureManager.java b/src/api/java/forestry/api/core/ITextureManager.java deleted file mode 100644 index a259fcae..00000000 --- a/src/api/java/forestry/api/core/ITextureManager.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.util.IIcon; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public interface ITextureManager { - - void registerIconProvider(IIconProvider provider); - - IIcon getIcon(short texUID); - - IIcon getDefault(String ident); -} diff --git a/src/api/java/forestry/api/core/ITileStructure.java b/src/api/java/forestry/api/core/ITileStructure.java deleted file mode 100644 index c8c29cad..00000000 --- a/src/api/java/forestry/api/core/ITileStructure.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.tileentity.TileEntity; - -/** - * The basis for multiblock components. - */ -public interface ITileStructure { - - /** - * @return String unique to the type of structure controlled by this structure logic. Should map to {@link IStructureLogic} - */ - String getTypeUID(); - - /** - * Should map to {@link IStructureLogic} - */ - void validateStructure(); - - /** - * Called when the structure resets. - */ - void onStructureReset(); - - /** - * @return TileEntity that is the master in this structure, null if no structure exists. - */ - ITileStructure getCentralTE(); - - /** - * Called to set the master TileEntity. Implementing TileEntity should keep track of the master's coordinates, not refer to the TE object itself. - * - * @param tile - */ - void setCentralTE(TileEntity tile); - - /** - * @return ISidedInventory representing the inventory accessed from this block. - */ - ISidedInventory getStructureInventory(); - - /** - * Only called on Forestry's own blocks. - */ - void makeMaster(); - - /** - * @return true if this TE is the master in a structure, false otherwise. - */ - boolean isMaster(); - - /** - * @return true if the TE is master or has a master. - */ - boolean isIntegratedIntoStructure(); - -} diff --git a/src/api/java/forestry/api/core/IToolPipette.java b/src/api/java/forestry/api/core/IToolPipette.java deleted file mode 100644 index f5f1a633..00000000 --- a/src/api/java/forestry/api/core/IToolPipette.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011-2014 SirSengir. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser Public License v3 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl-3.0.txt - * - * Various Contributors including, but not limited to: - * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -/** - * Taken from BuildCraft 5.0.x - */ -public interface IToolPipette { - - /** - * @param pipette - * ItemStack of the pipette. - * @return Capacity of the pipette. - */ - int getCapacity(ItemStack pipette); - - /** - * @param pipette - * @return true if the pipette can pipette. - */ - boolean canPipette(ItemStack pipette); - - /** - * Fills the pipette with the given liquid stack. - * - * @param pipette - * @param liquid - * @param doFill - * @return Amount of liquid used in filling the pipette. - */ - int fill(ItemStack pipette, FluidStack liquid, boolean doFill); - - /** - * Drains liquid from the pipette - * - * @param pipette - * @param maxDrain - * @param doDrain - * @return Fluid stack representing the liquid and amount drained from the pipette. - */ - FluidStack drain(ItemStack pipette, int maxDrain, boolean doDrain); -} diff --git a/src/api/java/forestry/api/core/IToolScoop.java b/src/api/java/forestry/api/core/IToolScoop.java deleted file mode 100644 index 583b6c7e..00000000 --- a/src/api/java/forestry/api/core/IToolScoop.java +++ /dev/null @@ -1,13 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -/** - * Marks a tool as a scoop. - */ -public interface IToolScoop { - -} diff --git a/src/api/java/forestry/api/core/Tabs.java b/src/api/java/forestry/api/core/Tabs.java deleted file mode 100644 index 4ce85838..00000000 --- a/src/api/java/forestry/api/core/Tabs.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.core; - -import net.minecraft.creativetab.CreativeTabs; - -/** - * References to the specialised tabs added by Forestry to creative inventory. - */ -public class Tabs { - - public static CreativeTabs tabApiculture; - public static CreativeTabs tabArboriculture; - public static CreativeTabs tabLepidopterology; - -} diff --git a/src/api/java/forestry/api/core/package-info.java b/src/api/java/forestry/api/core/package-info.java deleted file mode 100644 index 3db8ba25..00000000 --- a/src/api/java/forestry/api/core/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="3.0.0", owner="Forestry", provides="ForestryAPI|core") -package forestry.api.core; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/farming/Farmables.java b/src/api/java/forestry/api/farming/Farmables.java deleted file mode 100644 index bc4c159c..00000000 --- a/src/api/java/forestry/api/farming/Farmables.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import java.util.Collection; -import java.util.HashMap; - -public class Farmables { - /** - * Can be used to add IFarmables to some of the vanilla farm logics. - * - * Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom - */ - public static HashMap> farmables = new HashMap>(); - - public static IFarmInterface farmInterface; -} diff --git a/src/api/java/forestry/api/farming/ICrop.java b/src/api/java/forestry/api/farming/ICrop.java deleted file mode 100644 index 22575477..00000000 --- a/src/api/java/forestry/api/farming/ICrop.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; - -public interface ICrop { - - /** - * Harvests this crop. Performs the necessary manipulations to set the crop into a "harvested" state. - * - * @return Products harvested. - */ - Collection harvest(); - -} diff --git a/src/api/java/forestry/api/farming/IFarmComponent.java b/src/api/java/forestry/api/farming/IFarmComponent.java deleted file mode 100644 index 3387f7a3..00000000 --- a/src/api/java/forestry/api/farming/IFarmComponent.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import forestry.api.core.ITileStructure; - -public interface IFarmComponent extends ITileStructure { - - boolean hasFunction(); - - void registerListener(IFarmListener listener); - - void removeListener(IFarmListener listener); -} diff --git a/src/api/java/forestry/api/farming/IFarmHousing.java b/src/api/java/forestry/api/farming/IFarmHousing.java deleted file mode 100644 index acdd982d..00000000 --- a/src/api/java/forestry/api/farming/IFarmHousing.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; - -public interface IFarmHousing { - - int[] getCoords(); - - int[] getArea(); - - int[] getOffset(); - - World getWorld(); - - /** - * Will run the work cycle on a master TE. Will do nothing on any other farm component. - * - * @return true if any work was done, false otherwise. - */ - boolean doWork(); - - boolean hasLiquid(FluidStack liquid); - - void removeLiquid(FluidStack liquid); - - boolean hasResources(ItemStack[] resources); - - void removeResources(ItemStack[] resources); - - /** - * Callback for {@link IFarmLogic}s to plant a sapling, seed, germling, stem. Will remove the appropriate germling from the farm's inventory. It's up to the - * logic to only call this on a valid location. - * - * @param farmable - * @param world - * @param x - * @param y - * @param z - * @return true if planting was successful, false otherwise. - */ - boolean plantGermling(IFarmable farmable, World world, int x, int y, int z); - - /* INTERACTION WITH HATCHES */ - boolean acceptsAsGermling(ItemStack itemstack); - - boolean acceptsAsResource(ItemStack itemstack); - - boolean acceptsAsFertilizer(ItemStack itemstack); - - /* LOGIC */ - /** - * Set a farm logic for the given direction. UP/DOWN/UNKNOWN are invalid! - * - * @param direction - * @param logic - */ - void setFarmLogic(ForgeDirection direction, IFarmLogic logic); - - /** - * Reset the farm logic for the given direction to default. UP/DOWN/UNKNOWN are invalid! - * - * @param direction - */ - void resetFarmLogic(ForgeDirection direction); -} diff --git a/src/api/java/forestry/api/farming/IFarmInterface.java b/src/api/java/forestry/api/farming/IFarmInterface.java deleted file mode 100644 index 08968747..00000000 --- a/src/api/java/forestry/api/farming/IFarmInterface.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import forestry.api.core.IStructureLogic; - -public interface IFarmInterface { - - /** - * Creates {@link IStructureLogic} for use in farm components. - * - * @param structure - * {@link IFarmComponent} to create the logic for. - * @return {@link IStructureLogic} for use in farm components - */ - IStructureLogic createFarmStructureLogic(IFarmComponent structure); -} diff --git a/src/api/java/forestry/api/farming/IFarmListener.java b/src/api/java/forestry/api/farming/IFarmListener.java deleted file mode 100644 index 461525ff..00000000 --- a/src/api/java/forestry/api/farming/IFarmListener.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.common.util.ForgeDirection; - -public interface IFarmListener { - - /** - * Called before a crop is harvested. - * - * @param crop - * ICrop about to be harvested. - * @return true to cancel further processing of this crop. - */ - boolean beforeCropHarvest(ICrop crop); - - /** - * Called after a crop has been harvested, but before harvested items are stowed in the farms inventory. - * - * @param harvested - * Collection of harvested stacks. May be manipulated. Ensure removal of stacks with 0 or less items! - * @param crop - * Harvested {@link ICrop} - */ - void afterCropHarvest(Collection harvested, ICrop crop); - - /** - * Called after the stack of collected items has been returned by the farm logic, but before it is added to the farm's pending queue. - * - * @param collected - * Collection of collected stacks. May be manipulated. Ensure removal of stacks with 0 or less items! - * @param logic - */ - void hasCollected(Collection collected, IFarmLogic logic); - - /** - * Called after farmland has successfully been cultivated by a farm logic. - * - * @param logic - * @param x - * @param y - * @param z - * @param direction - * @param extent - */ - void hasCultivated(IFarmLogic logic, int x, int y, int z, ForgeDirection direction, int extent); - - /** - * Called after the stack of harvested crops has been returned by the farm logic, but before it is added to the farm's pending queue. - * - * @param harvested - * @param logic - * @param x - * @param y - * @param z - * @param direction - * @param extent - */ - void hasScheduledHarvest(Collection harvested, IFarmLogic logic, int x, int y, int z, ForgeDirection direction, int extent); - - /** - * Can be used to cancel farm task on a per side/{@link IFarmLogic} basis. - * - * @param logic - * @param direction - * @return true to skip any work action on the given logic and direction for this work cycle. - */ - boolean cancelTask(IFarmLogic logic, ForgeDirection direction); -} diff --git a/src/api/java/forestry/api/farming/IFarmLogic.java b/src/api/java/forestry/api/farming/IFarmLogic.java deleted file mode 100644 index 1c2482c0..00000000 --- a/src/api/java/forestry/api/farming/IFarmLogic.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraftforge.common.util.ForgeDirection; - -public interface IFarmLogic { - - int getFertilizerConsumption(); - - int getWaterConsumption(float hydrationModifier); - - boolean isAcceptedResource(ItemStack itemstack); - - boolean isAcceptedGermling(ItemStack itemstack); - - Collection collect(); - - boolean cultivate(int x, int y, int z, ForgeDirection direction, int extent); - - Collection harvest(int x, int y, int z, ForgeDirection direction, int extent); - - IFarmLogic setManual(boolean manual); - - @SideOnly(Side.CLIENT) - IIcon getIcon(); - - ResourceLocation getSpriteSheet(); - - String getName(); -} diff --git a/src/api/java/forestry/api/farming/IFarmable.java b/src/api/java/forestry/api/farming/IFarmable.java deleted file mode 100644 index 440ae599..00000000 --- a/src/api/java/forestry/api/farming/IFarmable.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.farming; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * IGermling describes a crop or other harvestable object and can be used to inspect item stacks and blocks for matches. - */ -public interface IFarmable { - - /** - * @param world - * @param x - * @param y - * @param z - * @return true if the block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop. - */ - boolean isSaplingAt(World world, int x, int y, int z); - - /** - * @param world - * @param x - * @param y - * @param z - * @return {@link ICrop} if the block at the given location is a harvestable and mature crop, null otherwise. - */ - ICrop getCropAt(World world, int x, int y, int z); - - /** - * @param itemstack - * @return true if the item is a valid germling (plantable sapling, seed, etc.) for this type. - */ - boolean isGermling(ItemStack itemstack); - - /** - * @param itemstack - * @return true if the item is something that can drop from this type without actually being harvested as a crop. (Apples or sapling from decaying leaves.) - */ - boolean isWindfall(ItemStack itemstack); - - /** - * Plants a sapling by manipulating the world. The {@link IFarmLogic} should have verified the given location as valid. Called by the {@link IFarmHousing} - * which handles resources. - * - * @param germling - * @param world - * @param x - * @param y - * @param z - * @return true on success, false otherwise. - */ - boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z); - -} diff --git a/src/api/java/forestry/api/farming/package-info.java b/src/api/java/forestry/api/farming/package-info.java deleted file mode 100644 index 4460886c..00000000 --- a/src/api/java/forestry/api/farming/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="1.1.0", owner="ForestryAPI|core", provides="ForestryAPI|farming") -package forestry.api.farming; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/food/BeverageManager.java b/src/api/java/forestry/api/food/BeverageManager.java deleted file mode 100644 index 2b0143ab..00000000 --- a/src/api/java/forestry/api/food/BeverageManager.java +++ /dev/null @@ -1,13 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.food; - -public class BeverageManager { - public static IBeverageEffect[] effectList = new IBeverageEffect[128]; - - public static IInfuserManager infuserManager; - public static IIngredientManager ingredientManager; -} diff --git a/src/api/java/forestry/api/food/IBeverageEffect.java b/src/api/java/forestry/api/food/IBeverageEffect.java deleted file mode 100644 index 6a787411..00000000 --- a/src/api/java/forestry/api/food/IBeverageEffect.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.food; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -public interface IBeverageEffect { - int getId(); - - void doEffect(World world, EntityPlayer player); - - String getDescription(); -} diff --git a/src/api/java/forestry/api/food/IInfuserManager.java b/src/api/java/forestry/api/food/IInfuserManager.java deleted file mode 100644 index d778ffa4..00000000 --- a/src/api/java/forestry/api/food/IInfuserManager.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.food; - -import net.minecraft.item.ItemStack; - -public interface IInfuserManager { - - void addMixture(int meta, ItemStack ingredient, IBeverageEffect effect); - - void addMixture(int meta, ItemStack[] ingredients, IBeverageEffect effect); - - ItemStack getSeasoned(ItemStack base, ItemStack[] ingredients); - - boolean hasMixtures(ItemStack[] ingredients); - - boolean isIngredient(ItemStack itemstack); - - ItemStack[] getRequired(ItemStack[] ingredients); - -} diff --git a/src/api/java/forestry/api/food/IIngredientManager.java b/src/api/java/forestry/api/food/IIngredientManager.java deleted file mode 100644 index fab0e012..00000000 --- a/src/api/java/forestry/api/food/IIngredientManager.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.food; - -import net.minecraft.item.ItemStack; - -public interface IIngredientManager { - - String getDescription(ItemStack itemstack); - - void addIngredient(ItemStack ingredient, String description); - -} diff --git a/src/api/java/forestry/api/food/package-info.java b/src/api/java/forestry/api/food/package-info.java deleted file mode 100644 index 372c3016..00000000 --- a/src/api/java/forestry/api/food/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="1.1.0", owner="ForestryAPI|core", provides="ForestryAPI|food") -package forestry.api.food; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/fuels/EngineBronzeFuel.java b/src/api/java/forestry/api/fuels/EngineBronzeFuel.java deleted file mode 100644 index cbab0caf..00000000 --- a/src/api/java/forestry/api/fuels/EngineBronzeFuel.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.fuels; - -import net.minecraftforge.fluids.Fluid; - -public class EngineBronzeFuel { - /** - * Item that is valid fuel for a biogas engine. - */ - public final Fluid liquid; - /** - * Power produced by this fuel per work cycle of the engine. - */ - public final int powerPerCycle; - /** - * How many work cycles a single "stack" of this type lasts. - */ - public final int burnDuration; - /** - * By how much the normal heat dissipation rate of 1 is multiplied when using this fuel type. - */ - public final int dissipationMultiplier; - - public EngineBronzeFuel(Fluid liquid, int powerPerCycle, int burnDuration, int dissipationMultiplier) { - this.liquid = liquid; - this.powerPerCycle = powerPerCycle; - this.burnDuration = burnDuration; - this.dissipationMultiplier = dissipationMultiplier; - } -} diff --git a/src/api/java/forestry/api/fuels/EngineCopperFuel.java b/src/api/java/forestry/api/fuels/EngineCopperFuel.java deleted file mode 100644 index af568dd4..00000000 --- a/src/api/java/forestry/api/fuels/EngineCopperFuel.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.fuels; - -import net.minecraft.item.ItemStack; - -public class EngineCopperFuel { - - /** - * Item that is valid fuel for a peat-fired engine. - */ - public final ItemStack fuel; - /** - * Power produced by this fuel per work cycle. - */ - public final int powerPerCycle; - /** - * Amount of work cycles this item lasts before being consumed. - */ - public final int burnDuration; - - public EngineCopperFuel(ItemStack fuel, int powerPerCycle, int burnDuration) { - this.fuel = fuel; - this.powerPerCycle = powerPerCycle; - this.burnDuration = burnDuration; - } - -} diff --git a/src/api/java/forestry/api/fuels/FermenterFuel.java b/src/api/java/forestry/api/fuels/FermenterFuel.java deleted file mode 100644 index 32989a80..00000000 --- a/src/api/java/forestry/api/fuels/FermenterFuel.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.fuels; - -import net.minecraft.item.ItemStack; - -public class FermenterFuel { - /** - * Item that is a valid fuel for the fermenter (i.e. fertilizer). - */ - public final ItemStack item; - /** - * How much is fermeted per work cycle, i.e. how much biomass is produced per cycle. - */ - public final int fermentPerCycle; - /** - * Amount of work cycles a single item of this fuel lasts before expiring. - */ - public final int burnDuration; - - public FermenterFuel(ItemStack item, int fermentPerCycle, int burnDuration) { - this.item = item; - this.fermentPerCycle = fermentPerCycle; - this.burnDuration = burnDuration; - } -} diff --git a/src/api/java/forestry/api/fuels/FuelManager.java b/src/api/java/forestry/api/fuels/FuelManager.java deleted file mode 100644 index f53d6fb7..00000000 --- a/src/api/java/forestry/api/fuels/FuelManager.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.fuels; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; - -import java.util.HashMap; - - -public class FuelManager { - /** - * Add new fuels for the fermenter here (i.e. fertilizer). - */ - public static HashMap fermenterFuel; - /** - * Add new resources for the moistener here (i.e. wheat) - */ - public static HashMap moistenerResource; - /** - * Add new substrates for the rainmaker here - */ - public static HashMap rainSubstrate; - /** - * Add new fuels for EngineBronze (= biogas engine) here - */ - public static HashMap bronzeEngineFuel; - /** - * Add new fuels for EngineCopper (= peat-fired engine) here - */ - public static HashMap copperEngineFuel; - /** - * Add new fuels for Generator here - */ - public static HashMap generatorFuel; - -} diff --git a/src/api/java/forestry/api/fuels/GeneratorFuel.java b/src/api/java/forestry/api/fuels/GeneratorFuel.java deleted file mode 100644 index 16e2ee4d..00000000 --- a/src/api/java/forestry/api/fuels/GeneratorFuel.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.fuels; - -import net.minecraftforge.fluids.FluidStack; - -public class GeneratorFuel { - - /** - * LiquidStack representing the fuel type and amount consumed per triggered cycle. - */ - public final FluidStack fuelConsumed; - /** - * EU emitted per tick while this fuel is being consumed in the generator (i.e. biofuel = 32, biomass = 8). - */ - public final int eu; - /** - * Rate at which the fuel is consumed. 1 - Every tick 2 - Every second tick 3 - Every third tick etc. - */ - public final int rate; - - public GeneratorFuel(FluidStack fuelConsumed, int eu, int rate) { - this.fuelConsumed = fuelConsumed; - this.eu = eu; - this.rate = rate; - } - -} diff --git a/src/api/java/forestry/api/fuels/MoistenerFuel.java b/src/api/java/forestry/api/fuels/MoistenerFuel.java deleted file mode 100644 index 4c4c7a0b..00000000 --- a/src/api/java/forestry/api/fuels/MoistenerFuel.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.fuels; - -import net.minecraft.item.ItemStack; - -public class MoistenerFuel { - /** - * The item to use - */ - public final ItemStack item; - /** - * The item that leaves the moistener's working slot (i.e. mouldy wheat, decayed wheat, mulch) - */ - public final ItemStack product; - /** - * How much this item contributes to the final product of the moistener (i.e. mycelium) - */ - public final int moistenerValue; - /** - * What stage this product represents. Resources with lower stage value will be consumed first. - */ - public final int stage; - - public MoistenerFuel(ItemStack item, ItemStack product, int stage, int moistenerValue) { - this.item = item; - this.product = product; - this.stage = stage; - this.moistenerValue = moistenerValue; - } -} diff --git a/src/api/java/forestry/api/fuels/RainSubstrate.java b/src/api/java/forestry/api/fuels/RainSubstrate.java deleted file mode 100644 index ab0deb5a..00000000 --- a/src/api/java/forestry/api/fuels/RainSubstrate.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.fuels; - -import net.minecraft.item.ItemStack; - -public class RainSubstrate { - /** - * Rain substrate capable of activating the rainmaker. - */ - public ItemStack item; - /** - * Duration of the rain shower triggered by this substrate in Minecraft ticks. - */ - public int duration; - /** - * Speed of activation sequence triggered. - */ - public float speed; - - public boolean reverse; - - public RainSubstrate(ItemStack item, int duration, float speed) { - this(item, duration, speed, false); - } - - public RainSubstrate(ItemStack item, float speed) { - this(item, 0, speed, true); - } - - public RainSubstrate(ItemStack item, int duration, float speed, boolean reverse) { - this.item = item; - this.duration = duration; - this.speed = speed; - this.reverse = reverse; - } -} diff --git a/src/api/java/forestry/api/fuels/package-info.java b/src/api/java/forestry/api/fuels/package-info.java deleted file mode 100644 index 748fa228..00000000 --- a/src/api/java/forestry/api/fuels/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="2.0.1", owner="ForestryAPI|core", provides="ForestryAPI|fuels") -package forestry.api.fuels; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/genetics/AlleleManager.java b/src/api/java/forestry/api/genetics/AlleleManager.java deleted file mode 100644 index 6e351162..00000000 --- a/src/api/java/forestry/api/genetics/AlleleManager.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.HashMap; - -import net.minecraft.item.ItemStack; - -/** - * Holds a static reference to the {@link IAlleleRegistry}. - */ -public class AlleleManager { - /** - * Main access point for all things related to genetics. See {@link IAlleleRegistry} for details. - */ - public static IAlleleRegistry alleleRegistry; - /** - * Translates plain leaf blocks into genetic data. Used by bees and butterflies to convert and pollinate foreign leaf blocks. - */ - public static HashMap ersatzSpecimen = new HashMap(); - /** - * Translates plain saplings into genetic data. Used by the treealyzer and the farm to convert foreign saplings. - */ - public static HashMap ersatzSaplings = new HashMap(); - /** - * Queryable instance of an {@link IClimateHelper} for easier implementation. - */ - public static IClimateHelper climateHelper; - /** - * Creates Forestry alleles. - */ - public static IAlleleFactory alleleFactory; -} diff --git a/src/api/java/forestry/api/genetics/EnumTolerance.java b/src/api/java/forestry/api/genetics/EnumTolerance.java deleted file mode 100644 index 6ff0085e..00000000 --- a/src/api/java/forestry/api/genetics/EnumTolerance.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -public enum EnumTolerance { - NONE, - - BOTH_1, BOTH_2, BOTH_3, BOTH_4, BOTH_5, - - UP_1, UP_2, UP_3, UP_4, UP_5, - - DOWN_1, DOWN_2, DOWN_3, DOWN_4, DOWN_5 -} diff --git a/src/api/java/forestry/api/genetics/IAllele.java b/src/api/java/forestry/api/genetics/IAllele.java deleted file mode 100644 index 52747410..00000000 --- a/src/api/java/forestry/api/genetics/IAllele.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * An {@link IIndividual}'s {@link IGenome} is composed of {@link IChromosome}s consisting each of a primary and secondary {@link IAllele}. - * - * {@link IAllele}s hold all information regarding an {@link IIndividual}'s traits, from species to size, temperature tolerances, etc. - * - * Should be extended for different types of alleles. ISpeciesAllele, IBiomeAllele, etc. - * - * @author SirSengir - */ -public interface IAllele { - - /** - * @return A unique string identifier for this allele. - */ - String getUID(); - - /** - * @return true if the allele is dominant, false otherwise. - */ - boolean isDominant(); - - /** - * @return Localized short, human-readable identifier used in tooltips and beealyzer. - */ - String getName(); - - /** - * @return The unlocalized identifier - */ - String getUnlocalizedName(); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleArea.java b/src/api/java/forestry/api/genetics/IAlleleArea.java deleted file mode 100644 index 7277ff0a..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleArea.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * Simple interface to allow adding additional alleles containing float values. - */ -public interface IAlleleArea extends IAllele { - - int[] getValue(); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleBoolean.java b/src/api/java/forestry/api/genetics/IAlleleBoolean.java deleted file mode 100644 index 887da3b9..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleBoolean.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * Simple interface to allow adding additional alleles containing float values. - */ -public interface IAlleleBoolean extends IAllele { - - boolean getValue(); - - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleEffect.java b/src/api/java/forestry/api/genetics/IAlleleEffect.java deleted file mode 100644 index 7b94e6b1..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleEffect.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * Basic effect allele. - */ -public interface IAlleleEffect extends IAllele { - /** - * @return true if this effect can combine with the effect on other allele (i.e. run before or after). combination can only occur if both effects are - * combinable. - */ - boolean isCombinable(); - - /** - * Returns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect. - * - * @param storedData - * @return {@link IEffectData} for the next cycle. - */ - IEffectData validateStorage(IEffectData storedData); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleFactory.java b/src/api/java/forestry/api/genetics/IAlleleFactory.java deleted file mode 100644 index 2b390069..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleFactory.java +++ /dev/null @@ -1,80 +0,0 @@ -package forestry.api.genetics; - -/** - * Creates new alleles with smart localization. - * - * - * UID is created like this: - * modId + '.' + category + WordUtils.capitalize(valueName); - * For Example: - * modId:forestry, category:height, valueName:smallest => forestry.heightSmallest - * This is mainly for legacy compatibility and may change in future major versions. - * - * - * The default localization uses: - * [modId].allele.[valueName] - * - * Languages that need category-specific names can override it by defining: - * [modId].allele.[category].[valueName] - * - * For example: - * en_US - * forestry.allele.smallest=Smallest - * ru_RU - * forestry.allele.smallest=????? ????????? - * forestry.allele.height.smallest=????? ?????? - */ -public interface IAlleleFactory { - /** - * @param modId mod prefix for uid and localization (i.e. "forestry") - * @param category allele category for uid and localization (i.e. "height") - * @param valueName allele value name for uid and localization (i.e. "smallest") - * @param value allele float value - * @param isDominant allele dominance - * @return a new IAlleleFloat - */ - IAlleleFloat createFloat(String modId, String category, String valueName, float value, boolean isDominant); - - /** - * @param modId mod prefix for uid and localization (i.e. "forestry") - * @param category allele category for uid and localization (i.e. "territory") - * @param valueName allele value name for uid and localization (i.e. "large") - * @param xDimValue allele area X Size - * @param yDimValue allele area Y Size - * @param zDimValue allele area Z Size - * @param isDominant allele dominance - * @return a new IAlleleArea - */ - IAlleleArea createArea(String modId, String category, String valueName, int xDimValue, int yDimValue, int zDimValue, boolean isDominant); - - /** - * @param modId mod prefix for uid and localization (i.e. "forestry") - * @param category allele category for uid and localization (i.e. "fertility") - * @param valueName allele value name for uid and localization (i.e. "low") - * @param value allele int value - * @param isDominant allele dominance - * @return a new IAlleleInteger - */ - IAlleleInteger createInteger(String modId, String category, String valueName, int value, boolean isDominant); - - /** - * @param modId mod prefix for uid and localization (i.e. "forestry") - * @param category allele category for uid and localization (i.e. "fireproof") - * @param value allele boolean value - * @param isDominant allele dominance - * @return a new IAlleleBoolean - * Note that valueName will always be "true" or "false" - */ - IAlleleBoolean createBoolean(String modId, String category, boolean value, boolean isDominant); - - /** - * @param modId mod prefix for uid (i.e. "forestry") - * @param category allele category for uid (i.e. "flowers") - * @param valueName allele value name for uid (i.e. "vanilla") - * @param value allele IFlowerProvider value - * @param isDominant allele dominance - * @return a new IAlleleFlowers - * IAlleleFlowers localization is handled by the IFlowerProvider.getDescription(), unlike the other alleles. - */ - IAlleleFlowers createFlowers(String modId, String category, String valueName, IFlowerProvider value, boolean isDominant); -} diff --git a/src/api/java/forestry/api/genetics/IAlleleFloat.java b/src/api/java/forestry/api/genetics/IAlleleFloat.java deleted file mode 100644 index 6ca28776..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleFloat.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * Simple interface to allow adding additional alleles containing float values. - */ -public interface IAlleleFloat extends IAllele { - - float getValue(); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleFlowers.java b/src/api/java/forestry/api/genetics/IAlleleFlowers.java deleted file mode 100644 index 0368ca41..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleFlowers.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - - -public interface IAlleleFlowers extends IAllele { - - /** - * @return FlowerProvider - */ - IFlowerProvider getProvider(); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleHandler.java b/src/api/java/forestry/api/genetics/IAlleleHandler.java deleted file mode 100644 index 3d052afe..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * @author Alex Binnie - * - * Handler for events that occur in IAlleleRegistry, such as registering alleles, branches etc. Useful for handling plugin specific behavior (i.e. - * creating a list of all bee species etc.) - * - */ -public interface IAlleleHandler { - - /** - * Called when an allele is registered with {@link IAlleleRegistry}. - * - * @param allele - * Allele which was registered. - */ - public void onRegisterAllele(IAllele allele); - - /** - * Called when a classification is registered with {@link IAlleleRegistry}. - * - * @param classification - * Classification which was registered. - */ - public void onRegisterClassification(IClassification classification); - - /** - * Called when a fruit family is registered with {@link IAlleleRegistry}. - * - * @param family - * Fruit family which was registered. - */ - public void onRegisterFruitFamily(IFruitFamily family); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleInteger.java b/src/api/java/forestry/api/genetics/IAlleleInteger.java deleted file mode 100644 index 6991efe5..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleInteger.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * Simple interface to allow adding additional alleles containing integer values. - */ -public interface IAlleleInteger extends IAllele { - - int getValue(); - -} diff --git a/src/api/java/forestry/api/genetics/IAllelePlantType.java b/src/api/java/forestry/api/genetics/IAllelePlantType.java deleted file mode 100644 index 211237f2..00000000 --- a/src/api/java/forestry/api/genetics/IAllelePlantType.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.EnumSet; - -import net.minecraftforge.common.EnumPlantType; - -public interface IAllelePlantType extends IAllele { - - public EnumSet getPlantTypes(); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleRegistry.java b/src/api/java/forestry/api/genetics/IAlleleRegistry.java deleted file mode 100644 index 9b0907b0..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleRegistry.java +++ /dev/null @@ -1,218 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.Collection; -import java.util.Map; - -import net.minecraft.item.ItemStack; - -import com.mojang.authlib.GameProfile; - -import forestry.api.genetics.IClassification.EnumClassLevel; - -/** - * Manages {@link ISpeciesRoot}, {@link IAllele}s, {@link IFruitFamily}s, {@link IClassification}, the blacklist and allows creation of research notes. - * - * @author SirSengir - */ -public interface IAlleleRegistry { - - /* SPECIES ROOT CLASSES */ - /** - * Register a {@link ISpeciesRoot}. - * @param root {@link ISpeciesRoot} to register. - */ - void registerSpeciesRoot(ISpeciesRoot root); - - /** - * @return Map of all registered {@link ISpeciesRoot}. - */ - Map getSpeciesRoot(); - - /** - * Retrieve the {@link ISpeciesRoot} with the given uid. - * @param uid Unique id for the species class, i.e. "rootBees", "rootTrees", "rootButterflies". - * @return {@link ISpeciesRoot} if it exists, null otherwise. - */ - ISpeciesRoot getSpeciesRoot(String uid); - - /** - * Retrieve a matching {@link ISpeciesRoot} for the given itemstack. - * @param stack An itemstack possibly containing NBT data which can be converted by a species root. - * @return {@link ISpeciesRoot} if found, null otherwise. - */ - ISpeciesRoot getSpeciesRoot(ItemStack stack); - - /** - * Retrieve a matching {@link ISpeciesRoot} for the given {@link IIndividual}-class. - * @param clz Class extending {@link IIndividual}. - * @return {@link ISpeciesRoot} if found, null otherwise. - */ - ISpeciesRoot getSpeciesRoot(Class clz); - - /* INDIVIDUAL */ - /** - * Tests the itemstack for genetic information. - * - * @param stack - * @return true if the itemstack is an individual. - */ - boolean isIndividual(ItemStack stack); - - /** - * Retrieve genetic information from an itemstack. - * - * @param stack - * Stack to retrieve genetic information for. - * @return IIndividual containing genetic information, null if none could be extracted. - */ - IIndividual getIndividual(ItemStack stack); - - /* ALLELES */ - - /** - * @return HashMap of all currently registered alleles. - */ - Map getRegisteredAlleles(); - - /** - * Registers an allele. - * - * @param allele - * IAllele to register. - */ - void registerAllele(IAllele allele); - - /** - * @return HashMap of all registered deprecated alleles and their corresponding replacements - */ - Map getDeprecatedAlleleReplacements(); - - /** - * Registers an old allele UID and the new IAllele to replace instances of it with. - * - * @param deprecatedAlleleUID - * the old allele's UID - * @param replacement - * the IAllele that the deprecated Allele will be replaced with. - */ - void registerDeprecatedAlleleReplacement(String deprecatedAlleleUID, IAllele replacement); - - /** - * Gets an allele - * - * @param uid - * String based unique identifier of the allele to retrieve. - * @return IAllele if found or a replacement is found in the Deprecated Allele map, null otherwise. - */ - IAllele getAllele(String uid); - - /* CLASSIFICATIONS */ - /** - * @return HashMap of all currently registered classifications. - */ - Map getRegisteredClassifications(); - - /** - * Registers a classification. - * - * @param classification - * IClassification to register. - */ - void registerClassification(IClassification classification); - - /** - * Creates and returns a classification. - * - * @param level - * EnumClassLevel of the classification to create. - * @param uid - * String based unique identifier. Implementation will throw an exception if the key is already taken. - * @param scientific - * Binomial for the given classification. - * @return Created {@link IClassification} for easier chaining. - */ - IClassification createAndRegisterClassification(EnumClassLevel level, String uid, String scientific); - - /** - * Gets a classification. - * - * @param uid - * String based unique identifier of the classification to retrieve. - * @return {@link IClassification} if found, null otherwise. - */ - IClassification getClassification(String uid); - - /* FRUIT FAMILIES */ - /** - * Get all registered fruit families. - * - * @return A map of registered fruit families and their UIDs. - */ - Map getRegisteredFruitFamilies(); - - /** - * Registers a new fruit family. - * - * @param family - */ - void registerFruitFamily(IFruitFamily family); - - /** - * Retrieves a fruit family identified by uid. - * - * @param uid - * @return {IFruitFamily} if found, false otherwise. - */ - IFruitFamily getFruitFamily(String uid); - - /* ALLELE HANDLERS */ - /** - * Registers a new IAlleleHandler - * - * @param handler - * IAlleleHandler to register. - */ - void registerAlleleHandler(IAlleleHandler handler); - - /* BLACKLIST */ - /** - * Blacklist an allele identified by its UID from mutation. - * - * @param uid - * UID of the allele to blacklist. - */ - void blacklistAllele(String uid); - - /** - * @return Current blacklisted alleles. - */ - Collection getAlleleBlacklist(); - - /** - * @param uid - * UID of the species to vet. - * @return true if the allele is blacklisted. - */ - boolean isBlacklisted(String uid); - - /* RESEARCH */ - /** - * @param researcher Username of the player who researched this note. - * @param species {@link IAlleleSpecies} to encode on the research note. - * @return An itemstack containing a research note with the given species encoded onto it. - */ - ItemStack getSpeciesNoteStack(GameProfile researcher, IAlleleSpecies species); - - /** - * @param researcher Username of the player who researched this note. - * @param mutation {@link IMutation} to encode on the research note. - * @return An itemstack containing a research note with the given mutation encoded onto it. - */ - ItemStack getMutationNoteStack(GameProfile researcher, IMutation mutation); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleSpecies.java b/src/api/java/forestry/api/genetics/IAlleleSpecies.java deleted file mode 100644 index 5a75adef..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleSpecies.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import com.mojang.authlib.GameProfile; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.api.core.IIconProvider; - -/** - * Basic species allele. - */ -public interface IAlleleSpecies extends IAllele { - - /** - * @return the {@link ISpeciesRoot} associated with this species. - */ - ISpeciesRoot getRoot(); - - /** - * @return Localized short description of this species. (May be null.) - */ - String getDescription(); - - /** - * Binomial name of the species sans genus ("Apis"). Returning "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun - * names or return null. - * - * @return flavour text (may be null) - */ - String getBinomial(); - - /** - * Authority for the binomial name, e.g. "Sengir" on species of base Forestry. - * - * @return flavour text (may be null) - */ - String getAuthority(); - - /** - * @return Branch this species is associated with. - */ - IClassification getBranch(); - - /* RESEARCH */ - /** - * Complexity determines the difficulty researching a species. The values of primary and secondary are - * added together (and rounded) to determine the amount of pairs needed for successful research. - * @return Values between 3 - 11 are useful. - */ - int getComplexity(); - - /** - * @param itemstack - * @return A float signifying the chance for the passed itemstack to yield a research success. - */ - float getResearchSuitability(ItemStack itemstack); - - /** - * @param world - * @param gameProfile - * @param individual - * @param bountyLevel - * @return Array of itemstacks representing the bounty for this research success. - */ - ItemStack[] getResearchBounty(World world, GameProfile gameProfile, IIndividual individual, int bountyLevel); - - /* CLIMATE */ - /** - * @return Preferred temperature - */ - EnumTemperature getTemperature(); - - /** - * @return Preferred humidity - */ - EnumHumidity getHumidity(); - - /* MISC */ - /** - * @return true if the species icon should have a glowing effect. - */ - boolean hasEffect(); - - /** - * @return true if the species should not be displayed in NEI or creative inventory. - */ - boolean isSecret(); - - /** - * @return true to have the species count against the species total. - */ - boolean isCounted(); - - /* APPEARANCE */ - /** - * @param renderPass Render pass to get the colour for. - * @return Colour to use for the render pass. - */ - int getIconColour(int renderPass); - - @SideOnly(Side.CLIENT) - IIconProvider getIconProvider(); - -} diff --git a/src/api/java/forestry/api/genetics/IAlleleSpeciesCustom.java b/src/api/java/forestry/api/genetics/IAlleleSpeciesCustom.java deleted file mode 100644 index ff138162..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleSpeciesCustom.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; - -public interface IAlleleSpeciesCustom extends IAlleleSpecies { - - IAlleleSpeciesCustom setTemperature(EnumTemperature temperature); - IAlleleSpeciesCustom setHumidity(EnumHumidity humidity); - - IAlleleSpeciesCustom setHasEffect(); - - /** Secret species are not shown in creative mode. */ - IAlleleSpeciesCustom setIsSecret(); - - /** Uncounted species do not count toward total species discovered. */ - IAlleleSpeciesCustom setIsNotCounted(); -} diff --git a/src/api/java/forestry/api/genetics/IAlleleTolerance.java b/src/api/java/forestry/api/genetics/IAlleleTolerance.java deleted file mode 100644 index f5ba9e67..00000000 --- a/src/api/java/forestry/api/genetics/IAlleleTolerance.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * Simple interface to allow adding additional alleles containing float values. - */ -public interface IAlleleTolerance extends IAllele { - - EnumTolerance getValue(); - -} diff --git a/src/api/java/forestry/api/genetics/IBreedingTracker.java b/src/api/java/forestry/api/genetics/IBreedingTracker.java deleted file mode 100644 index e3614481..00000000 --- a/src/api/java/forestry/api/genetics/IBreedingTracker.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; - -import forestry.api.apiculture.IBeekeepingMode; - -/** - * Keeps track of who bred and/or discovered which species in a world. - * - * @author SirSengir - */ -public interface IBreedingTracker { - - /** - * @return Name of the current {@link IBeekeepingMode}. - */ - String getModeName(); - - /** - * Set the current {@link IBeekeepingMode}. - */ - void setModeName(String name); - - /** - * @return Amount of species discovered. - */ - int getSpeciesBred(); - - /** - * Register the birth of an individual. Will mark it as discovered. - * - * @param individual - */ - void registerBirth(IIndividual individual); - - /** - * Register the pickup of an individual. - * - * @param individual - */ - void registerPickup(IIndividual individual); - - /** - * Marks a species as discovered. Should only be called from registerIndividual normally. - * - * @param species - */ - void registerSpecies(IAlleleSpecies species); - - /** - * Register a successful mutation. Will mark it as discovered. - * - * @param mutation - */ - void registerMutation(IMutation mutation); - - /** - * Queries the tracker for discovered species. - * - * @param mutation - * Mutation to query for. - * @return true if the mutation has been discovered. - */ - boolean isDiscovered(IMutation mutation); - - /** - * Queries the tracker for discovered species. - * - * @param species - * Species to check. - * @return true if the species has been bred. - */ - boolean isDiscovered(IAlleleSpecies species); - - /** - * Synchronizes the tracker to the client side. Should be called before opening any gui needing that information. - * - * @param player - */ - void synchToPlayer(EntityPlayer player); - - /* LOADING & SAVING */ - void decodeFromNBT(NBTTagCompound nbttagcompound); - - void encodeToNBT(NBTTagCompound nbttagcompound); - -} diff --git a/src/api/java/forestry/api/genetics/IChromosome.java b/src/api/java/forestry/api/genetics/IChromosome.java deleted file mode 100644 index d501efba..00000000 --- a/src/api/java/forestry/api/genetics/IChromosome.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import forestry.api.core.INBTTagable; - -/** - * Implementations other than Forestry's default one are not supported! - * - * @author SirSengir - */ -public interface IChromosome extends INBTTagable { - - IAllele getPrimaryAllele(); - - IAllele getSecondaryAllele(); - - IAllele getInactiveAllele(); - - IAllele getActiveAllele(); - -} diff --git a/src/api/java/forestry/api/genetics/IChromosomeType.java b/src/api/java/forestry/api/genetics/IChromosomeType.java deleted file mode 100644 index a3b1f8e0..00000000 --- a/src/api/java/forestry/api/genetics/IChromosomeType.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/* - * Interface to be implemented by the enums representing the various chromosomes - */ -public interface IChromosomeType { - - /* - * Get class which all alleles on this chromosome must interface - */ - Class getAlleleClass(); - - String getName(); - - ISpeciesRoot getSpeciesRoot(); - - int ordinal(); - -} diff --git a/src/api/java/forestry/api/genetics/IClassification.java b/src/api/java/forestry/api/genetics/IClassification.java deleted file mode 100644 index f365b915..00000000 --- a/src/api/java/forestry/api/genetics/IClassification.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * Biological classifications from domain down to genus. - * - * Used by the *alyzers to display hierarchies. - */ -public interface IClassification { - - public enum EnumClassLevel { - - DOMAIN(0x777fff, true), KINGDOM(0x77c3ff), PHYLUM(0x77ffb6, true), DIVISION(0x77ffb6, true), CLASS(0x7bff77), ORDER(0xbeff77), FAMILY(0xfffd77), - SUBFAMILY(0xfffd77), TRIBE(0xfffd77), GENUS(0xffba77); - - private int colour; - private boolean isDroppable; - - private EnumClassLevel(int colour) { - this(colour, false); - } - - private EnumClassLevel(int colour, boolean isDroppable) { - this.colour = colour; - this.isDroppable = isDroppable; - } - - /** - * @return Colour to use for displaying this classification. - */ - public int getColour() { - return colour; - } - - /** - * @return Indicates whether display of this classification level can be ommitted in case of space constraints. - */ - public boolean isDroppable() { - return isDroppable; - } - } - - /** - * @return Level inside the full hierarchy this particular classification is located at. - */ - EnumClassLevel getLevel(); - - /** - * @return Unique String identifier. - */ - String getUID(); - - /** - * @return Localized branch name for user display. - */ - String getName(); - - /** - * A branch approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis" - * - * @return flavour text (may be null) - */ - String getScientific(); - - /** - * @return Localized description of this branch. (May be null.) - */ - String getDescription(); - - /** - * @return Member groups of this one. - */ - IClassification[] getMemberGroups(); - - /** - * Adds subgroups to this group. - */ - void addMemberGroup(IClassification group); - - /** - * @return Member species of this group. - */ - IAlleleSpecies[] getMemberSpecies(); - - /** - * Used by the allele registry to populate internal collection of branch members on the fly. - * - * @param species - */ - void addMemberSpecies(IAlleleSpecies species); - - /** - * @return Parent classification, null if this is root. - */ - IClassification getParent(); - - /** - * Only used internally by the AlleleRegistry if this classification has been added to another one. - * - * @param parent - */ - void setParent(IClassification parent); -} diff --git a/src/api/java/forestry/api/genetics/IClimateHelper.java b/src/api/java/forestry/api/genetics/IClimateHelper.java deleted file mode 100644 index 48146042..00000000 --- a/src/api/java/forestry/api/genetics/IClimateHelper.java +++ /dev/null @@ -1,53 +0,0 @@ -package forestry.api.genetics; - -import java.util.Collection; - -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; - -public interface IClimateHelper { - /** - * Determines whether the given temperature and humidity are within the given constraints. - * @param temperature The temperature to test. - * @param humidity The humidity to test. - * @param baseTemp Base temperature for the test. - * @param tolTemp Temperature tolerance to apply. - * @param baseHumid Base humidity for the test. - * @param tolHumid Humidity tolerance to apply. - * @return true if both temperature and humidity fit the given constraints. - */ - boolean isWithinLimits(EnumTemperature temperature, EnumHumidity humidity, - EnumTemperature baseTemp, EnumTolerance tolTemp, - EnumHumidity baseHumid, EnumTolerance tolHumid); - - boolean isWithinLimits(EnumTemperature temperature, EnumTemperature baseTemp, EnumTolerance tolTemp); - boolean isWithinLimits(EnumHumidity humidity, EnumHumidity baseHumid, EnumTolerance tolHumid); - - /** - * Gets a collection of humidities which fit the given parameters. - * @param prefered Base humidity from which to measure. - * @param tolerance Tolerance to apply to the base humidity. - * @return A collection of humidities which fall within the given parameters. - */ - Collection getToleratedHumidity(EnumHumidity prefered, EnumTolerance tolerance); - /** - * Gets a collection of temperatures which fit the given parameters. - * @param prefered Base temperature from which to measure. - * @param tolerance Tolerance to apply to the base temperatures. - * @return A collection of temperatures which fall within the given parameters. - */ - Collection getToleratedTemperature(EnumTemperature prefered, EnumTolerance tolerance); - - /** - * Gets a localized, human readable string for the given temperature. - * @param temperature Temperature to generate the string for. - * @return A localized, human readable string for the given temperature. - */ - String toDisplay(EnumTemperature temperature); - /** - * Gets a localized, human readable string for the given humidity. - * @param humidity Humidity to generate the string for. - * @return A localized, human readable string for the given humidity. - */ - String toDisplay(EnumHumidity humidity); -} \ No newline at end of file diff --git a/src/api/java/forestry/api/genetics/IEffectData.java b/src/api/java/forestry/api/genetics/IEffectData.java deleted file mode 100644 index 909ab78d..00000000 --- a/src/api/java/forestry/api/genetics/IEffectData.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import forestry.api.core.INBTTagable; - -/** - * Container to hold some temporary data for bee, tree and butterfly effects. - * - * @author SirSengir - */ -public interface IEffectData extends INBTTagable { - void setInteger(int index, int val); - - void setFloat(int index, float val); - - void setBoolean(int index, boolean val); - - int getInteger(int index); - - float getFloat(int index); - - boolean getBoolean(int index); -} diff --git a/src/api/java/forestry/api/genetics/IFlower.java b/src/api/java/forestry/api/genetics/IFlower.java deleted file mode 100644 index 79ef8115..00000000 --- a/src/api/java/forestry/api/genetics/IFlower.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.block.Block; - -public interface IFlower extends Comparable { - - Block getBlock(); - int getMeta(); - - double getWeight(); - void setWeight(double weight); - - boolean isPlantable(); - -} diff --git a/src/api/java/forestry/api/genetics/IFlowerGrowthRule.java b/src/api/java/forestry/api/genetics/IFlowerGrowthRule.java deleted file mode 100644 index 55237399..00000000 --- a/src/api/java/forestry/api/genetics/IFlowerGrowthRule.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.world.World; - -/** - * Basic condition for flower growing - */ -public interface IFlowerGrowthRule { - boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z); -} diff --git a/src/api/java/forestry/api/genetics/IFlowerProvider.java b/src/api/java/forestry/api/genetics/IFlowerProvider.java deleted file mode 100644 index 9849da03..00000000 --- a/src/api/java/forestry/api/genetics/IFlowerProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface IFlowerProvider { - /** - * @return True if the block at the passed coordinates is a valid flower for the species. - */ - boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z); - - boolean isAcceptedPollinatable(World world, IPollinatable pollinatable); - - /** - * @return True if a flower was planted. - */ - boolean growFlower(World world, IIndividual individual, int x, int y, int z); - - /** - * @return Short, human-readable identifier used in the beealyzer. - */ - String getDescription(); - - /** - * Allows the flower provider to affect the produce at the given location. - * - * @return Array of itemstacks being the (modified or unmodified) produce. - */ - ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products); - - /** - * @return List of valid flowers for the flower provider. The first in the array is for use as an icon. - * Returns an empty list if the flower provider does not have any valid flowers. - */ - List getFlowers(); -} diff --git a/src/api/java/forestry/api/genetics/IFlowerRegistry.java b/src/api/java/forestry/api/genetics/IFlowerRegistry.java deleted file mode 100644 index ce6cb42c..00000000 --- a/src/api/java/forestry/api/genetics/IFlowerRegistry.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.world.World; - -public interface IFlowerRegistry { - - List getAcceptableFlowers(String flowerType); - - boolean growFlower(String flowerType, World world, IIndividual individual, int x, int y, int z); - - boolean isAcceptedFlower(String flowerType, World world, IIndividual individual, int x, int y, int z); - - /** - * Registers a non-plantable flower, but bees accept them. - * - * @param flowerTypes See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX - */ - void registerAcceptableFlower(Block flowerBlock, String... flowerTypes); - void registerAcceptableFlower(Block flowerBlock, int flowerMeta, String... flowerTypes); - - void registerGrowthRule(IFlowerGrowthRule rule, String... flowerTypes); - - /** - * Registers a plantable flower. - * The distribution is based on its own weight and the total number of plants for this flowerType. - * - * @param weight Weight for the Flower (Vanilla = 1.0, Modded flowers < 1.0) - * @param flowerTypes See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX - */ - void registerPlantableFlower(Block flowerBlock, int flowerMeta, double weight, String... flowerTypes); - - IFlower getRandomPlantableFlower(String flowerType, Random rand); - -} diff --git a/src/api/java/forestry/api/genetics/IFruitBearer.java b/src/api/java/forestry/api/genetics/IFruitBearer.java deleted file mode 100644 index 5316f9eb..00000000 --- a/src/api/java/forestry/api/genetics/IFruitBearer.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; - -/** - * Can be implemented by tile entities which can bear fruit. - * - * @author SirSengir - */ -public interface IFruitBearer { - - /** - * @return true if the actual tile can bear fruits. - */ - boolean hasFruit(); - - /** - * @return Family of the potential fruits on this tile. - */ - IFruitFamily getFruitFamily(); - - /** - * Picks the fruits of this tile, resetting it to unripe fruits. - * - * @param tool - * Tool used in picking the fruits. May be null. - * @return Picked fruits. - */ - Collection pickFruit(ItemStack tool); - - /** - * @return float indicating the ripeness of the fruit with >= 1.0f indicating full ripeness. - */ - float getRipeness(); - - /** - * Increases the ripeness of the fruit. - * - * @param add - * Float to add to the ripeness. Will truncate to valid values. - */ - void addRipeness(float add); -} diff --git a/src/api/java/forestry/api/genetics/IFruitFamily.java b/src/api/java/forestry/api/genetics/IFruitFamily.java deleted file mode 100644 index d48a4d8a..00000000 --- a/src/api/java/forestry/api/genetics/IFruitFamily.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -public interface IFruitFamily { - - /** - * @return Unique String identifier. - */ - String getUID(); - - /** - * @return Localized family name for user display. - */ - String getName(); - - /** - * A scientific-y name for this fruit family - * - * @return flavour text (may be null) - */ - String getScientific(); - - /** - * @return Localized description of this fruit family. (May be null.) - */ - String getDescription(); - -} diff --git a/src/api/java/forestry/api/genetics/IGenome.java b/src/api/java/forestry/api/genetics/IGenome.java deleted file mode 100644 index 0d3ad231..00000000 --- a/src/api/java/forestry/api/genetics/IGenome.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import forestry.api.core.INBTTagable; - -/** - * Holds the {@link IChromosome}s which comprise the traits of a given individual. - * - * Only the default implementation is supported. - */ -public interface IGenome extends INBTTagable { - - IAlleleSpecies getPrimary(); - - IAlleleSpecies getSecondary(); - - IChromosome[] getChromosomes(); - - IAllele getActiveAllele(IChromosomeType chromosomeType); - - IAllele getInactiveAllele(IChromosomeType chromosomeType); - - boolean isGeneticEqual(IGenome other); - - ISpeciesRoot getSpeciesRoot(); -} diff --git a/src/api/java/forestry/api/genetics/IHousing.java b/src/api/java/forestry/api/genetics/IHousing.java deleted file mode 100644 index 5a510311..00000000 --- a/src/api/java/forestry/api/genetics/IHousing.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -import com.mojang.authlib.GameProfile; - -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.api.core.IErrorState; - -/** - * Any housing, hatchery or nest which is a fixed location in the world. - */ -public interface IHousing { - - /** - * @return String containing the login of this housing's owner. - */ - GameProfile getOwnerName(); - - World getWorld(); - - int getXCoord(); - - int getYCoord(); - - int getZCoord(); - - BiomeGenBase getBiome(); - - EnumTemperature getTemperature(); - - EnumHumidity getHumidity(); - - void setErrorState(IErrorState state); - - IErrorState getErrorState(); - - /** - * Adds products to the housing's inventory. - * - * @param product - * ItemStack with the product to add. - * @param all - * if true, success requires that all products are added - * @return Boolean indicating success or failure. - */ - boolean addProduct(ItemStack product, boolean all); - -} diff --git a/src/api/java/forestry/api/genetics/IIndividual.java b/src/api/java/forestry/api/genetics/IIndividual.java deleted file mode 100644 index f86aa582..00000000 --- a/src/api/java/forestry/api/genetics/IIndividual.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.List; - -import forestry.api.core.INBTTagable; - -/** - * An actual individual with genetic information. - * - * Only the default implementation is supported. - */ -public interface IIndividual extends INBTTagable { - - String getIdent(); - - String getDisplayName(); - - void addTooltip(List list); - - /** - * Call to mark the IIndividual as analyzed. - * @return true if the IIndividual has not been analyzed previously. - */ - boolean analyze(); - - boolean isAnalyzed(); - - boolean hasEffect(); - - boolean isSecret(); - - IGenome getGenome(); - - /** - * Check whether the genetic makeup of two IIndividuals is identical. Ignores additional data like generations, irregular mating, etc.. - * @param other - * @return true if the given other IIndividual has the amount of chromosomes and their alleles are identical. - */ - boolean isGeneticEqual(IIndividual other); - - /** - * @return A deep copy of this individual. - */ - IIndividual copy(); - - boolean isPureBred(IChromosomeType chromosomeType); - -} diff --git a/src/api/java/forestry/api/genetics/IIndividualLiving.java b/src/api/java/forestry/api/genetics/IIndividualLiving.java deleted file mode 100644 index 67ce0a97..00000000 --- a/src/api/java/forestry/api/genetics/IIndividualLiving.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.world.World; - -public interface IIndividualLiving extends IIndividual { - - /** - * @return Genetic information of the mate, null if unmated. - */ - IGenome getMate(); - - /** - * @return Current health of the individual. - */ - int getHealth(); - - /** - * @return Maximum health of the individual. - */ - int getMaxHealth(); - - /** - * Age the individual. - * @param world - * @param ageModifier - */ - void age(World world, float ageModifier); - - /** - * Mate with the given individual. - * @param individual the {@link IIndividual} to mate this one with. - */ - void mate(IIndividual individual); - - /** - * @return true if the individual is among the living. - */ - boolean isAlive(); - -} diff --git a/src/api/java/forestry/api/genetics/ILegacyHandler.java b/src/api/java/forestry/api/genetics/ILegacyHandler.java deleted file mode 100644 index 901afa7f..00000000 --- a/src/api/java/forestry/api/genetics/ILegacyHandler.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -/** - * AlleleManager.alleleRegistry can be cast to this type. - * @deprecated Since Forestry 3.6. Use IAlleleRegistry. - */ -@Deprecated -public interface ILegacyHandler { - void registerLegacyMapping(int id, String uid); - - IAllele getFromLegacyMap(int id); -} diff --git a/src/api/java/forestry/api/genetics/IMutation.java b/src/api/java/forestry/api/genetics/IMutation.java deleted file mode 100644 index 8c15ca58..00000000 --- a/src/api/java/forestry/api/genetics/IMutation.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.Collection; - -/** - * Individuals can be seeded either as hive drops or as mutation results. - * - * {@link IAlleleRegistry} manages these. - * - * @author SirSengir - */ -public interface IMutation { - - /** - * @return {@link ISpeciesRoot} this mutation is associated with. - */ - ISpeciesRoot getRoot(); - - /** - * @return first of the alleles implementing IAlleleSpecies required for this mutation. - */ - IAllele getAllele0(); - - /** - * @return second of the alleles implementing IAlleleSpecies required for this mutation. - */ - IAllele getAllele1(); - - /** - * @return Array of {@link IAllele} representing the full default genome of the mutated side. - * - * Make sure to return a proper array for the species class. Returning an allele of the wrong type will cause cast errors on runtime. - */ - IAllele[] getTemplate(); - - /** - * @return Unmodified base chance for mutation to fire. - */ - float getBaseChance(); - - /** - * @return Collection of localized, human-readable strings describing special mutation conditions, if any. - */ - Collection getSpecialConditions(); - - /** - * @param allele - * @return true if the passed allele is one of the alleles participating in this mutation. - */ - boolean isPartner(IAllele allele); - - /** - * @param allele - * @return the other allele which was not passed as argument. - */ - IAllele getPartner(IAllele allele); - - /** - * @return true if the mutation should not be displayed in the beealyzer. - */ - boolean isSecret(); - -} diff --git a/src/api/java/forestry/api/genetics/IMutationCondition.java b/src/api/java/forestry/api/genetics/IMutationCondition.java deleted file mode 100644 index ac8de0a2..00000000 --- a/src/api/java/forestry/api/genetics/IMutationCondition.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.world.World; - -public interface IMutationCondition { - - /** - * Returns a float from 0 to 1 representing the chance for mutation to occur. - * Most will return 1 if the condition is met and 0 otherwise, - * but the float offers flexibility for more advanced conditions. - */ - float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); - - /** - * A localized description of the mutation condition. (i.e. "A temperature of HOT is required.") - */ - String getDescription(); -} diff --git a/src/api/java/forestry/api/genetics/IMutationCustom.java b/src/api/java/forestry/api/genetics/IMutationCustom.java deleted file mode 100644 index f6d366cd..00000000 --- a/src/api/java/forestry/api/genetics/IMutationCustom.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import net.minecraft.block.Block; - -import net.minecraftforge.common.BiomeDictionary; - -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; - -/** Set custom mutation requirements */ -public interface IMutationCustom extends IMutation { - - /** Prevent this mutation from being shown in the analyzers */ - IMutationCustom setIsSecret(); - - /** Require a specific temperature for this mutation to occur */ - IMutationCustom restrictTemperature(EnumTemperature temperature); - IMutationCustom restrictTemperature(EnumTemperature minTemperature, EnumTemperature maxTemperature); - - /** Require a specific humidity for this mutation to occur */ - IMutationCustom restrictHumidity(EnumHumidity humidity); - IMutationCustom restrictHumidity(EnumHumidity minHumidity, EnumHumidity maxHumidity); - - /** - * Restrict this mutation to certain types of biomes. - * @param types The types of biomes this mutation can occur. - */ - IMutationCustom restrictBiomeType(BiomeDictionary.Type... types); - - /** Restrict the days of the year that this mutation can occur */ - IMutationCustom restrictDateRange(int startMonth, int startDay, int endMonth, int endDay); - - /** Restrict the time of day that this mutation can occur */ - IMutationCustom requireDay(); - IMutationCustom requireNight(); - - /** Require a specific resource to be under the location of the mutation */ - IMutationCustom requireResource(Block block, int meta); - - /** Require some other custom mutation condition */ - IMutationCustom addMutationCondition(IMutationCondition mutationCondition); -} diff --git a/src/api/java/forestry/api/genetics/IPollinatable.java b/src/api/java/forestry/api/genetics/IPollinatable.java deleted file mode 100644 index 5b0694d7..00000000 --- a/src/api/java/forestry/api/genetics/IPollinatable.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.EnumSet; - -import net.minecraftforge.common.EnumPlantType; - -/** - * Can be implemented by tile entities, if they wish to be pollinatable. - * - * @author SirSengir - */ -public interface IPollinatable { - - /** - * @return plant types this pollinatable is classified as. (Can be used by bees to determine whether to interact or not. - */ - EnumSet getPlantType(); - - /** - * @return IIndividual containing the genetic information of this IPollinatable - */ - IIndividual getPollen(); - - /** - * Checks whether this {@link IPollinatable} can mate with the given pollen. - * - * Must be the one to check genetic equivalency. - * - * @param pollen - * IIndividual representing the pollen. - * @return true if mating is possible, false otherwise. - */ - boolean canMateWith(IIndividual pollen); - - /** - * Pollinates this entity. - * - * @param pollen - * IIndividual representing the pollen. - */ - void mateWith(IIndividual pollen); - -} diff --git a/src/api/java/forestry/api/genetics/ISpeciesRoot.java b/src/api/java/forestry/api/genetics/ISpeciesRoot.java deleted file mode 100644 index 7424405d..00000000 --- a/src/api/java/forestry/api/genetics/ISpeciesRoot.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.genetics; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Map; -import java.util.Random; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -import com.mojang.authlib.GameProfile; - -/** - * Describes a class of species (i.e. bees, trees, butterflies), provides helper functions and access to common functionality. - */ -public interface ISpeciesRoot { - - /** - * @return A unique identifier for the species class. Should consist of "root" + a common name for the species class in camel-case, i.e. "rootBees", "rootTrees", "rootButterflies". - */ - String getUID(); - - /** - * @return Class of the sub-interface inheriting from {@link IIndividual}. - */ - Class getMemberClass(); - - /** - * @return Integer denoting the number of (counted) species of this type in the world. - */ - int getSpeciesCount(); - - /** - * Used to check whether a given itemstack contains genetic data corresponding to an {@link IIndividual} of this class. - * @param stack itemstack to check. - * @return true if the itemstack contains an {@link IIndividual} of this class, false otherwise. - */ - boolean isMember(ItemStack stack); - - /** - * Used to check whether a given itemstack contains genetic data corresponding to an {@link IIndividual} of this class and matches the given type. - * @param stack itemstack to check. - * @param type Integer denoting the type needed to match. (i.e. butterfly vs. butterfly serum; bee queens, princesses, drones; etc.) - * @return true if the itemstack contains an {@link IIndividual} of this class, false otherwise. - */ - boolean isMember(ItemStack stack, int type); - - /** - * Used to check whether the given {@link IIndividual} is member of this class. - * @param individual {@link IIndividual} to check. - * @return true if the individual is member of this class, false otherwise. - */ - boolean isMember(IIndividual individual); - - IIndividual getMember(ItemStack stack); - - IIndividual getMember(NBTTagCompound compound); - - ItemStack getMemberStack(IIndividual individual, int type); - - /* BREEDING TRACKER */ - IBreedingTracker getBreedingTracker(World world, GameProfile player); - - /* GENOME MANIPULATION */ - IIndividual templateAsIndividual(IAllele[] template); - - IIndividual templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); - - IChromosome[] templateAsChromosomes(IAllele[] template); - - IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive); - - IGenome templateAsGenome(IAllele[] template); - - IGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); - - /* TEMPLATES */ - /** - * Registers a bee template using the UID of the first allele as identifier. - * - * @param template - */ - void registerTemplate(IAllele[] template); - - /** - * Registers a bee template using the passed identifier. - * - * @param template - */ - void registerTemplate(String identifier, IAllele[] template); - - /** - * Retrieves a registered template using the passed identifier. - * - * @param identifier - * @return Array of {@link IAllele} representing a genome. - */ - IAllele[] getTemplate(String identifier); - - /** - * @return Default individual template for use when stuff breaks. - */ - IAllele[] getDefaultTemplate(); - - /** - * @param rand Random to use. - * @return A random template from the pool of registered species templates. - */ - IAllele[] getRandomTemplate(Random rand); - - Map getGenomeTemplates(); - ArrayList getIndividualTemplates(); - - /* MUTATIONS */ - /** - * Use to register mutations. - * - * @param mutation - */ - void registerMutation(IMutation mutation); - - /** - * @return All registered mutations. - */ - Collection getMutations(boolean shuffle); - - /** - * @param other Allele to match mutations against. - * @return All registered mutations the given allele is part of. - */ - Collection getCombinations(IAllele other); - - Collection getPaths(IAllele result, IChromosomeType chromosomeType); - - /* RESEARCH */ - /** - * @return List of generic catalysts which should be accepted for research by species of this class. - */ - Map getResearchCatalysts(); - - /** - * Sets an item stack as a valid (generic) research catalyst for this class. - * @param itemstack ItemStack to set as suitable. - * @param suitability Float between 0 and 1 to indicate suitability. - */ - void setResearchSuitability(ItemStack itemstack, float suitability); - - /** - * @return Array of {@link IChromosomeType} which are in this species genome - */ - IChromosomeType[] getKaryotype(); - - /** - * @return {@link IChromosomeType} which is the "key" for this species class, usually the species chromosome. - */ - IChromosomeType getKaryotypeKey(); -} diff --git a/src/api/java/forestry/api/genetics/package-info.java b/src/api/java/forestry/api/genetics/package-info.java deleted file mode 100644 index fdd093bb..00000000 --- a/src/api/java/forestry/api/genetics/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="3.2.0", owner="ForestryAPI|core", provides="ForestryAPI|genetics") -package forestry.api.genetics; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/lepidopterology/EnumButterflyChromosome.java b/src/api/java/forestry/api/lepidopterology/EnumButterflyChromosome.java deleted file mode 100644 index 9f89f7f8..00000000 --- a/src/api/java/forestry/api/lepidopterology/EnumButterflyChromosome.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleArea; -import forestry.api.genetics.IAlleleBoolean; -import forestry.api.genetics.IAlleleFloat; -import forestry.api.genetics.IAlleleFlowers; -import forestry.api.genetics.IAlleleInteger; -import forestry.api.genetics.IAlleleTolerance; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.ISpeciesRoot; - -public enum EnumButterflyChromosome implements IChromosomeType { - /** - * Species of the bee. Alleles here must implement {@link IAlleleButterflySpecies}. - */ - SPECIES(IAlleleButterflySpecies.class), - /** - * Physical size. - */ - SIZE(IAlleleFloat.class), - /** - * Flight speed. - */ - SPEED(IAlleleFloat.class), - /** - * How long the butterfly can last without access to matching pollinatables. - */ - LIFESPAN(IAlleleInteger.class), - /** - * Species with a higher metabolism have a higher appetite and may cause more damage to their environment. - */ - METABOLISM(IAlleleInteger.class), - /** - * Determines likelyhood of caterpillars and length of caterpillar/pupation phase. Also: Number of max caterpillars after mating? - */ - FERTILITY(IAlleleInteger.class), - /** - * Not sure yet. - */ - TEMPERATURE_TOLERANCE(IAlleleTolerance.class), - /** - * Not sure yet. - */ - HUMIDITY_TOLERANCE(IAlleleTolerance.class), - /** - * Only nocturnal butterflys/moths will fly at night. Allows daylight activity for naturally nocturnal species. - */ - NOCTURNAL(IAlleleBoolean.class), - /** - * Only tolerant flyers will fly in the rain. - */ - TOLERANT_FLYER(IAlleleBoolean.class), - /** - * Fire resistance. - */ - FIRE_RESIST(IAlleleBoolean.class), - /** - * Required flowers/leaves. - */ - FLOWER_PROVIDER(IAlleleFlowers.class), - /** - * Extra effect to surroundings. (?) - */ - EFFECT(IAlleleButterflyEffect.class), - /** - * Not used yet - */ - TERRITORY(IAlleleArea.class), - ; - - Class clss; - - EnumButterflyChromosome(Class clss) { - this.clss = clss; - } - - @Override - public Class getAlleleClass() { - return clss; - } - - @Override - public String getName() { - return this.toString().toLowerCase(); - } - - @Override - public ISpeciesRoot getSpeciesRoot() { - return AlleleManager.alleleRegistry.getSpeciesRoot("rootButterflies"); - } -} diff --git a/src/api/java/forestry/api/lepidopterology/EnumFlutterType.java b/src/api/java/forestry/api/lepidopterology/EnumFlutterType.java deleted file mode 100644 index f197d7b7..00000000 --- a/src/api/java/forestry/api/lepidopterology/EnumFlutterType.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -public enum EnumFlutterType { - BUTTERFLY, - SERUM, - CATERPILLAR, - NONE; - - public static final EnumFlutterType[] VALUES = values(); -} diff --git a/src/api/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java b/src/api/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java deleted file mode 100644 index 6457dbe8..00000000 --- a/src/api/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import forestry.api.genetics.IAlleleEffect; -import forestry.api.genetics.IEffectData; - -public interface IAlleleButterflyEffect extends IAlleleEffect { - - /** - * Used by butterflies to trigger effects in the world. - * @param butterfly {@link IEntityButterfly} - * @param storedData - * @return {@link forestry.api.genetics.IEffectData} for the next cycle. - */ - IEffectData doEffect(IEntityButterfly butterfly, IEffectData storedData); - -} diff --git a/src/api/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java b/src/api/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java deleted file mode 100644 index c1536118..00000000 --- a/src/api/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import java.util.EnumSet; -import java.util.Map; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.common.BiomeDictionary; - -import forestry.api.genetics.IAlleleSpecies; - -public interface IAlleleButterflySpecies extends IAlleleSpecies { - - /** - * @return the IBeeRoot - */ - IButterflyRoot getRoot(); - - /** - * @return Path of the texture to use for entity rendering. - */ - String getEntityTexture(); - - /** - * Allows butterflies to restrict random spawns beyond the restrictions set by getTemperature() and getHumidity(). - * - * @return EnumSet of biome tags this butterfly species can be spawned in. - */ - EnumSet getSpawnBiomes(); - - /** - * @return true if a prospective spawn biome must not match a biome tag outside of getSpawnBiomes. - */ - boolean strictSpawnMatch(); - - /** - * @return Float between 0 and 1 representing the rarity of the species, will affect spawn rate. - */ - float getRarity(); - - /** - * @return Float representing the distance below which this butterfly will take flight if it detects a player which is not sneaking. - */ - float getFlightDistance(); - - /** - * @return true if this species is only active at night. - */ - boolean isNocturnal(); - - Map getButterflyLoot(); - - Map getCaterpillarLoot(); -} diff --git a/src/api/java/forestry/api/lepidopterology/IButterfly.java b/src/api/java/forestry/api/lepidopterology/IButterfly.java deleted file mode 100644 index c3013247..00000000 --- a/src/api/java/forestry/api/lepidopterology/IButterfly.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import forestry.api.genetics.IIndividualLiving; - -public interface IButterfly extends IIndividualLiving { - - IButterflyGenome getGenome(); - - /** - * @return Genetic information of the mate, null if unmated. - */ - IButterflyGenome getMate(); - - /** - * @return Physical size of the butterfly. - */ - float getSize(); - - /** - * @param world - * @param x - * @param y - * @param z - * @return true if the butterfly can naturally spawn at the given location at this time. (Used to auto-spawn butterflies from tree leaves.) - */ - boolean canSpawn(World world, double x, double y, double z); - - /** - * @param world - * @param x - * @param y - * @param z - * @return true if the butterfly can take flight at the given location at this time. (Used to auto-spawn butterflies from dropped items.) - */ - boolean canTakeFlight(World world, double x, double y, double z); - - /** - * @param world - * @param x - * @param y - * @param z - * @return true if the environment (temperature, humidity) is valid for the butterfly at the given location. - */ - boolean isAcceptedEnvironment(World world, double x, double y, double z); - - IButterfly spawnCaterpillar(IButterflyNursery nursery); - - /** - * @param entity - * @param playerKill Whether or not the butterfly was killed by a player. - * @param lootLevel Loot level according to the weapon used to kill the butterfly. - * @return Array of itemstacks to drop on death of the given entity. - */ - ItemStack[] getLootDrop(IEntityButterfly entity, boolean playerKill, int lootLevel); - - /** - * @param nursery - * @param playerKill Whether or not the nursery was broken by a player. - * @param lootLevel Fortune level. - * @return Array of itemstacks to drop on breaking of the nursery. - */ - ItemStack[] getCaterpillarDrop(IButterflyNursery nursery, boolean playerKill, int lootLevel); - - /** - * Create an exact copy of this butterfly. - */ - IButterfly copy(); - -} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyGenome.java b/src/api/java/forestry/api/lepidopterology/IButterflyGenome.java deleted file mode 100644 index 93816600..00000000 --- a/src/api/java/forestry/api/lepidopterology/IButterflyGenome.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import forestry.api.genetics.EnumTolerance; -import forestry.api.genetics.IFlowerProvider; -import forestry.api.genetics.IGenome; - -public interface IButterflyGenome extends IGenome { - - IAlleleButterflySpecies getPrimary(); - - IAlleleButterflySpecies getSecondary(); - - float getSize(); - - int getLifespan(); - - int getMetabolism(); - - int getFertility(); - - float getSpeed(); - - EnumTolerance getToleranceTemp(); - - EnumTolerance getToleranceHumid(); - - boolean getNocturnal(); - - boolean getTolerantFlyer(); - - boolean getFireResist(); - - IFlowerProvider getFlowerProvider(); - - IAlleleButterflyEffect getEffect(); - -} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyMutation.java b/src/api/java/forestry/api/lepidopterology/IButterflyMutation.java deleted file mode 100644 index 027e96eb..00000000 --- a/src/api/java/forestry/api/lepidopterology/IButterflyMutation.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IMutation; - -public interface IButterflyMutation extends IMutation { - float getChance(IButterflyNursery housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); -} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyNursery.java b/src/api/java/forestry/api/lepidopterology/IButterflyNursery.java deleted file mode 100644 index 56e42f2e..00000000 --- a/src/api/java/forestry/api/lepidopterology/IButterflyNursery.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import forestry.api.genetics.IHousing; -import forestry.api.genetics.IIndividual; - -public interface IButterflyNursery extends IHousing { - - IButterfly getCaterpillar(); - - IIndividual getNanny(); - - void setCaterpillar(IButterfly butterfly); - - boolean canNurse(IButterfly butterfly); - -} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyRoot.java b/src/api/java/forestry/api/lepidopterology/IButterflyRoot.java deleted file mode 100644 index 7028df15..00000000 --- a/src/api/java/forestry/api/lepidopterology/IButterflyRoot.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import java.util.ArrayList; -import java.util.Collection; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -import com.mojang.authlib.GameProfile; - -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.ISpeciesRoot; - -public interface IButterflyRoot extends ISpeciesRoot { - - @Override - boolean isMember(ItemStack stack); - - @Override - IButterfly getMember(ItemStack stack); - - @Override - IButterfly getMember(NBTTagCompound compound); - - @Override - ItemStack getMemberStack(IIndividual butterfly, int type); - - /* GENOME CONVERSION */ - @Override - IButterfly templateAsIndividual(IAllele[] template); - - @Override - IButterfly templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); - - @Override - IButterflyGenome templateAsGenome(IAllele[] template); - - @Override - IButterflyGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); - - /* BUTTERFLY SPECIFIC */ - ILepidopteristTracker getBreedingTracker(World world, GameProfile player); - - /** - * Spawns the given butterfly in the world. - * @param butterfly - * @return butterfly entity on success, null otherwise. - */ - EntityLiving spawnButterflyInWorld(World world, IButterfly butterfly, double x, double y, double z); - - /** - * @return true if passed item is mated. - */ - boolean isMated(ItemStack stack); - - /* TEMPLATES */ - @Override - ArrayList getIndividualTemplates(); - - /* MUTATIONS */ - @Override - Collection getMutations(boolean shuffle); - - EnumFlutterType getType(ItemStack stack); - -} diff --git a/src/api/java/forestry/api/lepidopterology/IEntityButterfly.java b/src/api/java/forestry/api/lepidopterology/IEntityButterfly.java deleted file mode 100644 index 963c7210..00000000 --- a/src/api/java/forestry/api/lepidopterology/IEntityButterfly.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.passive.IAnimals; - -import forestry.api.genetics.IIndividual; - -public interface IEntityButterfly extends IAnimals { - - void changeExhaustion(int change); - - int getExhaustion(); - - IButterfly getButterfly(); - - /** - * @return The entity as an EntityCreature to save casting. - */ - EntityCreature getEntity(); - - IIndividual getPollen(); - - void setPollen(IIndividual pollen); -} diff --git a/src/api/java/forestry/api/lepidopterology/ILepidopteristTracker.java b/src/api/java/forestry/api/lepidopterology/ILepidopteristTracker.java deleted file mode 100644 index 79926975..00000000 --- a/src/api/java/forestry/api/lepidopterology/ILepidopteristTracker.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.lepidopterology; - -import forestry.api.genetics.IBreedingTracker; - -public interface ILepidopteristTracker extends IBreedingTracker { - - void registerCatch(IButterfly butterfly); - -} diff --git a/src/api/java/forestry/api/lepidopterology/package-info.java b/src/api/java/forestry/api/lepidopterology/package-info.java deleted file mode 100644 index 070b4322..00000000 --- a/src/api/java/forestry/api/lepidopterology/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="1.1", owner="ForestryAPI|core", provides="ForestryAPI|lepidopterology") -package forestry.api.lepidopterology; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/mail/EnumAddressee.java b/src/api/java/forestry/api/mail/EnumAddressee.java deleted file mode 100644 index 28c73847..00000000 --- a/src/api/java/forestry/api/mail/EnumAddressee.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import java.util.Locale; - -public enum EnumAddressee { - PLAYER, TRADER; - - public static EnumAddressee fromString(String ident) { - ident = ident.toLowerCase(Locale.ENGLISH); - for(EnumAddressee addr : values()) { - if(addr.toString().equals(ident)) - return addr; - } - - return null; - } - - public String toString() { - return super.toString().toLowerCase(Locale.ENGLISH); - } -} diff --git a/src/api/java/forestry/api/mail/EnumPostage.java b/src/api/java/forestry/api/mail/EnumPostage.java deleted file mode 100644 index 772114fb..00000000 --- a/src/api/java/forestry/api/mail/EnumPostage.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -public enum EnumPostage { - P_0(0), P_1(1), P_2(2), P_5(5), P_10(10), P_20(20), P_50(50), P_100(100), P_200(200); - - private final int value; - - private EnumPostage(int value) { - this.value = value; - } - - public int getValue() { - return this.value; - } -} diff --git a/src/api/java/forestry/api/mail/ILetter.java b/src/api/java/forestry/api/mail/ILetter.java deleted file mode 100644 index 42df8acb..00000000 --- a/src/api/java/forestry/api/mail/ILetter.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -import forestry.api.core.INBTTagable; - -public interface ILetter extends IInventory, INBTTagable { - - ItemStack[] getPostage(); - - void setProcessed(boolean flag); - - boolean isProcessed(); - - boolean isMailable(); - - void setSender(IMailAddress address); - - IMailAddress getSender(); - - boolean hasRecipient(); - - void setRecipient(IMailAddress address); - - IMailAddress[] getRecipients(); - - String getRecipientString(); - - void setText(String text); - - String getText(); - - void addTooltip(List list); - - boolean isPostPaid(); - - int requiredPostage(); - - void invalidatePostage(); - - ItemStack[] getAttachments(); - - void addAttachment(ItemStack itemstack); - - void addAttachments(ItemStack[] itemstacks); - - int countAttachments(); - - void addStamps(ItemStack stamps); - -} diff --git a/src/api/java/forestry/api/mail/ILetterHandler.java b/src/api/java/forestry/api/mail/ILetterHandler.java deleted file mode 100644 index 576a0d7d..00000000 --- a/src/api/java/forestry/api/mail/ILetterHandler.java +++ /dev/null @@ -1,13 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface ILetterHandler { - IPostalState handleLetter(World world, IMailAddress recipient, ItemStack letterStack, boolean doLodge); -} diff --git a/src/api/java/forestry/api/mail/IMailAddress.java b/src/api/java/forestry/api/mail/IMailAddress.java deleted file mode 100644 index 8441b09a..00000000 --- a/src/api/java/forestry/api/mail/IMailAddress.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import com.mojang.authlib.GameProfile; - -import forestry.api.core.INBTTagable; - -public interface IMailAddress extends INBTTagable { - - EnumAddressee getType(); - String getName(); - - boolean isValid(); - - boolean isPlayer(); - boolean isTrader(); - - GameProfile getPlayerProfile(); -} diff --git a/src/api/java/forestry/api/mail/IPostOffice.java b/src/api/java/forestry/api/mail/IPostOffice.java deleted file mode 100644 index a8a14eac..00000000 --- a/src/api/java/forestry/api/mail/IPostOffice.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import java.util.Map; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface IPostOffice { - - void collectPostage(ItemStack[] stamps); - - IPostalState lodgeLetter(World world, ItemStack itemstack, boolean doLodge); - - ItemStack getAnyStamp(int max); - - ItemStack getAnyStamp(EnumPostage postage, int max); - - ItemStack getAnyStamp(EnumPostage[] postages, int max); - - void registerTradeStation(ITradeStation trade); - - void deregisterTradeStation(ITradeStation trade); - - Map getActiveTradeStations(World world); -} diff --git a/src/api/java/forestry/api/mail/IPostRegistry.java b/src/api/java/forestry/api/mail/IPostRegistry.java deleted file mode 100644 index f20352d9..00000000 --- a/src/api/java/forestry/api/mail/IPostRegistry.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import java.util.Map; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import com.mojang.authlib.GameProfile; - -public interface IPostRegistry { - - /* POST OFFICE */ - IPostOffice getPostOffice(World world); - - /* MAIL ADDRESSES */ - IMailAddress getMailAddress(GameProfile gameProfile); - IMailAddress getMailAddress(String traderName); - - /* LETTERS */ - boolean isLetter(ItemStack itemstack); - - ILetter createLetter(IMailAddress sender, IMailAddress recipient); - - ILetter getLetter(ItemStack itemstack); - - ItemStack createLetterStack(ILetter letter); - - /* CARRIERS */ - /** - * Registers a new {@link IPostalCarrier}. See {@link IPostalCarrier} for details. - * @param carrier {@link IPostalCarrier} to register. - */ - void registerCarrier(IPostalCarrier carrier); - - IPostalCarrier getCarrier(EnumAddressee uid); - - Map getRegisteredCarriers(); - - /* TRADE STATIONS */ - void deleteTradeStation(World world, IMailAddress address); - - ITradeStation getOrCreateTradeStation(World world, GameProfile owner, IMailAddress address); - - ITradeStation getTradeStation(World world, IMailAddress address); - - boolean isAvailableTradeAddress(World world, IMailAddress address); - - boolean isValidTradeAddress(World world, IMailAddress address); - - /* PO BOXES */ - boolean isValidPOBox(World world, IMailAddress address); - -} diff --git a/src/api/java/forestry/api/mail/IPostalCarrier.java b/src/api/java/forestry/api/mail/IPostalCarrier.java deleted file mode 100644 index 28db78ae..00000000 --- a/src/api/java/forestry/api/mail/IPostalCarrier.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Postal Carriers are systems which can be hooked into Forestry's mail system to handle mail delivery. - * - * The two available carriers in vanilla Forestry are - * "player" - Delivers mail to individual players. - * "trader" - Handles mail addressed to trade stations. - */ -public interface IPostalCarrier { - - /** - * @return An EnumAddressee identifying the type of carrier - */ - EnumAddressee getType(); - - /** - * @return A human-readable name for this carrier. - */ - String getName(); - - @SideOnly(Side.CLIENT) - IIcon getIcon(); - - /** - * Handle delivery of a letter addressed to this carrier. - * @param world The world the {@link IPostOffice} handles. - * @param office {link @IPostOffice} which received this letter and handed it to the carrier. - * @param recipient An identifier for the recipient as typed by the player into the address field. - * @param letterstack ItemStack representing the letter. See {@link IPostRegistry} for helper functions to validate and extract it. - * @param doDeliver Whether or not the letter is supposed to actually be delivered or if delivery is only to be simulated. - * @return {link IPostalState} holding information on success or failure for delivery. - */ - IPostalState deliverLetter(World world, IPostOffice office, IMailAddress recipient, ItemStack letterstack, boolean doDeliver); - -} diff --git a/src/api/java/forestry/api/mail/IPostalState.java b/src/api/java/forestry/api/mail/IPostalState.java deleted file mode 100644 index bc843621..00000000 --- a/src/api/java/forestry/api/mail/IPostalState.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -public interface IPostalState { - boolean isOk(); - - String getIdentifier(); - - int ordinal(); -} diff --git a/src/api/java/forestry/api/mail/IStamps.java b/src/api/java/forestry/api/mail/IStamps.java deleted file mode 100644 index 4332a811..00000000 --- a/src/api/java/forestry/api/mail/IStamps.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import net.minecraft.item.ItemStack; - -public interface IStamps { - - EnumPostage getPostage(ItemStack itemstack); - -} diff --git a/src/api/java/forestry/api/mail/ITradeStation.java b/src/api/java/forestry/api/mail/ITradeStation.java deleted file mode 100644 index 78a498a0..00000000 --- a/src/api/java/forestry/api/mail/ITradeStation.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import net.minecraft.inventory.IInventory; - -public interface ITradeStation extends ILetterHandler, IInventory { - - IMailAddress getAddress(); - - boolean isValid(); - - void invalidate(); - - void setVirtual(boolean isVirtual); - - boolean isVirtual(); - - TradeStationInfo getTradeInfo(); - -} diff --git a/src/api/java/forestry/api/mail/PostManager.java b/src/api/java/forestry/api/mail/PostManager.java deleted file mode 100644 index c3f0e45b..00000000 --- a/src/api/java/forestry/api/mail/PostManager.java +++ /dev/null @@ -1,11 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - - -public class PostManager { - public static IPostRegistry postRegistry; -} diff --git a/src/api/java/forestry/api/mail/TradeStationInfo.java b/src/api/java/forestry/api/mail/TradeStationInfo.java deleted file mode 100644 index 14424bed..00000000 --- a/src/api/java/forestry/api/mail/TradeStationInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.mail; - -import java.lang.IllegalArgumentException; -import net.minecraft.item.ItemStack; -import com.mojang.authlib.GameProfile; - -public class TradeStationInfo { - public final IMailAddress address; - public final GameProfile owner; - public final ItemStack tradegood; - public final ItemStack[] required; - public final IPostalState state; - - public TradeStationInfo(IMailAddress address, GameProfile owner, ItemStack tradegood, ItemStack[] required, IPostalState state) { - if (!address.isTrader()) { - throw new IllegalArgumentException("TradeStation address must be a trader"); - } - this.address = address; - this.owner = owner; - this.tradegood = tradegood; - this.required = required; - this.state = state; - } -} diff --git a/src/api/java/forestry/api/mail/package-info.java b/src/api/java/forestry/api/mail/package-info.java deleted file mode 100644 index a1050727..00000000 --- a/src/api/java/forestry/api/mail/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|mail") -package forestry.api.mail; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/recipes/ICarpenterManager.java b/src/api/java/forestry/api/recipes/ICarpenterManager.java deleted file mode 100644 index 8e3eabbe..00000000 --- a/src/api/java/forestry/api/recipes/ICarpenterManager.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.ShapedRecipes; - -import net.minecraftforge.fluids.FluidStack; - -/** - * Provides an interface to the recipe manager of the carpenter. - * - * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even - * if your mod loads before Forestry. - * - * Accessible via {@link RecipeManagers} - * - * Only shaped recipes can be added currently. - * - * @author SirSengir - */ -public interface ICarpenterManager extends ICraftingProvider { - /** - * Add a shaped recipe to the carpenter. - * - * @param box - * ItemStack of one item representing the required box (carton, crate) for this recipe. May be null. - * @param product - * Crafting result. - * @param materials - * Materials needed in the crafting matrix. This gets passed directly to {@link ShapedRecipes}. Notation is the same. - */ - public void addRecipe(ItemStack box, ItemStack product, Object... materials); - - /** - * Add a shaped recipe to the carpenter. - * - * @param packagingTime - * Number of work cycles required to craft the recipe once. - * @param box - * ItemStack of one item representing the required box (carton, crate) for this recipe. May be null. - * @param product - * Crafting result. - * @param materials - * Materials needed in the crafting matrix. This gets passed directly to {@link ShapedRecipes}. Notation is the same. - */ - public void addRecipe(int packagingTime, ItemStack box, ItemStack product, Object... materials); - - /** - * Add a shaped recipe to the carpenter. - * - * @param packagingTime - * Number of work cycles required to craft the recipe once. - * @param liquid - * Liquid required in carpenter's tank. - * @param box - * ItemStack of one item representing the required box (carton, crate) for this recipe. May be null. - * @param product - * Crafting result. - * @param materials - * Materials needed in the crafting matrix. This gets passed directly to {@link ShapedRecipes}. Notation is the same. - */ - public void addRecipe(int packagingTime, FluidStack liquid, ItemStack box, ItemStack product, Object... materials); -} diff --git a/src/api/java/forestry/api/recipes/ICentrifugeManager.java b/src/api/java/forestry/api/recipes/ICentrifugeManager.java deleted file mode 100644 index 910bd32c..00000000 --- a/src/api/java/forestry/api/recipes/ICentrifugeManager.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import java.util.HashMap; - -import net.minecraft.item.ItemStack; - -/** - * Provides an interface to the recipe manager of the centrifuge. - * - * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even - * if your mod loads before Forestry. - * - * Accessible via {@link RecipeManagers} - * - * @author SirSengir - */ -public interface ICentrifugeManager extends ICraftingProvider { - - /** - * Add a recipe to the centrifuge - * - * @param timePerItem - * Time to centrifugate one item of the given type - * @param resource - * ItemStack containing information on item id and damage. Stack size will be ignored. - * @param products - * HashMap specifying the possible products and the chances of them resulting from centrifugation. - */ - public void addRecipe(int timePerItem, ItemStack resource, HashMap products); - - /** - * Add a recipe to the centrifuge - * - * @param timePerItem - * Time to centrifugate one item of the given type - * @param resource - * ItemStack containing information on item id and damage. Stack size will be ignored. - * @param produce - * Array of ItemStacks that can be the result of this recipe. - * @param chances - * Array of integers corresponding and matching to produce providing the chance (0-100) for the ItemStack at the given index to be - * produced. - */ - public void addRecipe(int timePerItem, ItemStack resource, ItemStack[] produce, int[] chances); - - /** - * Add a recipe to the centrifuge - * - * @param timePerItem - * Time to centrifugate one item of the given type - * @param resource - * ItemStack containing information on item id and damage. Stack size will be ignored. - * @param primary - * Primary product produced by centrifugating one item. Yield 100 %. - * @param secondary - * Secondary product that may be produced when centrifugating the given item. May be null. - * @param chance - * Chance (1 - 100) for centrifugation to yield the secondary product. - */ - public void addRecipe(int timePerItem, ItemStack resource, ItemStack primary, ItemStack secondary, int chance); - - /** - * Add a recipe to the centrifuge - * - * @param timePerItem - * Time to centrifugate one item of the given type - * @param resource - * ItemStack containing information on item id and damage. Stack size will be ignored. - * @param primary - * Primary product produced by centrifugating one item. Yield 100 %. - */ - public void addRecipe(int timePerItem, ItemStack resource, ItemStack primary); - -} diff --git a/src/api/java/forestry/api/recipes/ICraftingProvider.java b/src/api/java/forestry/api/recipes/ICraftingProvider.java deleted file mode 100644 index 502dffb4..00000000 --- a/src/api/java/forestry/api/recipes/ICraftingProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import java.util.Map; - -public interface ICraftingProvider { - /** - * Access to the full list of recipes contained in the crafting provider. - * - * @return List of the given format where the first array represents inputs and the second outputs. Objects can be either ItemStack or LiquidStack. - */ - public Map getRecipes(); -} diff --git a/src/api/java/forestry/api/recipes/IFabricatorManager.java b/src/api/java/forestry/api/recipes/IFabricatorManager.java deleted file mode 100644 index a01f0da4..00000000 --- a/src/api/java/forestry/api/recipes/IFabricatorManager.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -public interface IFabricatorManager extends ICraftingProvider { - - void addRecipe(ItemStack plan, FluidStack molten, ItemStack result, Object[] pattern); - - void addSmelting(ItemStack resource, FluidStack molten, int meltingPoint); - -} diff --git a/src/api/java/forestry/api/recipes/IFermenterManager.java b/src/api/java/forestry/api/recipes/IFermenterManager.java deleted file mode 100644 index 92c903bb..00000000 --- a/src/api/java/forestry/api/recipes/IFermenterManager.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -/** - * Provides an interface to the recipe manager of the fermenter. - * - * The manager is initialized at the beginning of Forestry's BaseMod.load() - * cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be - * null even if your mod loads before Forestry. - * - * Accessible via {@link RecipeManagers} - * - * @author SirSengir - */ -public interface IFermenterManager extends ICraftingProvider { - - /** - * Add a recipe to the fermenter - * - * @param resource ItemStack representing the resource. - * @param fermentationValue Value of the given resource, i.e. how much needs - * to be fermented for the output to be deposited into the product tank. - * @param modifier Modifies the amount of liquid output per work cycle. - * (water = 1.0f, honey = 1.5f) - * @param output LiquidStack representing output liquid. Amount is - * determined by fermentationValue*modifier. - * @param liquid LiquidStack representing resource liquid and amount. - * @throws NullPointerException if resource, output or liquid is null - */ - public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output, FluidStack liquid); - - /** - * Add a recipe to the fermenter. Defaults to water as input liquid. - * - * @param resource ItemStack representing the resource. - * @param modifier Modifies the amount of liquid output per work cycle. - * (water = 1.0f, honey = 1.5f) - * @param fermentationValue Value of the given resource, i.e. how much needs - * to be fermented for the output to be deposited into the product tank. - * @param output LiquidStack representing output liquid. Amount is - * determined by fermentationValue*modifier. - * @throws NullPointerException if resource, output or liquid is null - */ - public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output); -} diff --git a/src/api/java/forestry/api/recipes/IMoistenerManager.java b/src/api/java/forestry/api/recipes/IMoistenerManager.java deleted file mode 100644 index 711264b4..00000000 --- a/src/api/java/forestry/api/recipes/IMoistenerManager.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import net.minecraft.item.ItemStack; - -/** - * Provides an interface to the recipe manager of the moistener. - * - * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even - * if your mod loads before Forestry. - * - * Accessible via {@link RecipeManagers} - * - * @author SirSengir - */ -public interface IMoistenerManager extends ICraftingProvider { - - /** - * Add a recipe to the moistener - * - * @param resource - * Item required in resource stack. Will be reduced by one per produced item. - * @param product - * Item to produce per resource processed. - * @param timePerItem - * Moistener runs at 1 - 4 time ticks per ingame tick depending on light level. For mycelium this value is currently 5000. - */ - public void addRecipe(ItemStack resource, ItemStack product, int timePerItem); -} diff --git a/src/api/java/forestry/api/recipes/ISqueezerManager.java b/src/api/java/forestry/api/recipes/ISqueezerManager.java deleted file mode 100644 index 0a63b731..00000000 --- a/src/api/java/forestry/api/recipes/ISqueezerManager.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -/** - * Provides an interface to the recipe manager of the suqeezer. - * - * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even - * if your mod loads before Forestry. - * - * Accessible via {@link RecipeManagers} - * - * @author SirSengir - */ -public interface ISqueezerManager extends ICraftingProvider { - - /** - * Add a recipe to the squeezer. - * - * @param timePerItem - * Number of work cycles required to squeeze one set of resources. - * @param resources - * Array of item stacks representing the required resources for one process. Stack size will be taken into account. - * @param liquid - * {@link FluidStack} representing the output of this recipe. - * @param remnants - * Item stack representing the possible remnants from this recipe. - * @param chance - * Chance remnants will be produced by a single recipe cycle. - */ - public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid, ItemStack remnants, int chance); - - /** - * Add a recipe to the squeezer. - * - * @param timePerItem - * Number of work cycles required to squeeze one set of resources. - * @param resources - * Array of item stacks representing the required resources for one process. Stack size will be taken into account. - * @param liquid - * {@link FluidStack} representing the output of this recipe. - */ - public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid); -} diff --git a/src/api/java/forestry/api/recipes/IStillManager.java b/src/api/java/forestry/api/recipes/IStillManager.java deleted file mode 100644 index 47fd4215..00000000 --- a/src/api/java/forestry/api/recipes/IStillManager.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import net.minecraftforge.fluids.FluidStack; - -/** - * Provides an interface to the recipe manager of the still. - * - * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even - * if your mod loads before Forestry. - * - * Accessible via {@link RecipeManagers} - * - * Note that this is untested with anything other than biomass->biofuel conversion. - * - * @author SirSengir - */ -public interface IStillManager extends ICraftingProvider { - /** - * Add a recipe to the still - * - * @param cyclesPerUnit - * Amount of work cycles required to run through the conversion once. - * @param input - * ItemStack representing the input liquid. - * @param output - * ItemStack representing the output liquid - */ - public void addRecipe(int cyclesPerUnit, FluidStack input, FluidStack output); -} diff --git a/src/api/java/forestry/api/recipes/IVariableFermentable.java b/src/api/java/forestry/api/recipes/IVariableFermentable.java deleted file mode 100644 index f0997f53..00000000 --- a/src/api/java/forestry/api/recipes/IVariableFermentable.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import net.minecraft.item.ItemStack; - -/** - * Fermenter checks any valid fermentation item for an implementation of this interface. - * This does not supersede adding a proper recipe to the fermenter! - */ -public interface IVariableFermentable { - - /** - * @param itemstack - * @return Float representing the modification to be applied to the matching recipe's biomass output. - */ - float getFermentationModifier(ItemStack itemstack); -} diff --git a/src/api/java/forestry/api/recipes/RecipeManagers.java b/src/api/java/forestry/api/recipes/RecipeManagers.java deleted file mode 100644 index 403bd5b5..00000000 --- a/src/api/java/forestry/api/recipes/RecipeManagers.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.recipes; - -import java.util.Collection; - -/** - * Contains all available recipe managers for Forestry machines and items. - * - * @author SirSengir - */ -public class RecipeManagers { - - public static Collection craftingProviders; - - /** - * Allows you to add recipes to the carpenter. See {@link ICarpenterManager} for details. - */ - public static ICarpenterManager carpenterManager; - /** - * Allows you to add recipes to the centrifuge. See {@link ICentrifugeManager} for details. - */ - public static ICentrifugeManager centrifugeManager; - /** - * Allows you to add recipes to the fermenter. See {@link IFermenterManager} for details. - */ - public static IFermenterManager fermenterManager; - /** - * Allows you to add recipes to the moistener. See {@link IMoistenerManager} for details. - */ - public static IMoistenerManager moistenerManager; - /** - * Allows you to add recipes to the squeezer. See {@link ISqueezerManager} for details. - */ - public static ISqueezerManager squeezerManager; - /** - * Allows you to add recipes to the still. See {@link IStillManager} for details. - */ - public static IStillManager stillManager; - - public static IFabricatorManager fabricatorManager; -} diff --git a/src/api/java/forestry/api/recipes/package-info.java b/src/api/java/forestry/api/recipes/package-info.java deleted file mode 100644 index c76d83b9..00000000 --- a/src/api/java/forestry/api/recipes/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|recipes") -package forestry.api.recipes; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/storage/BackpackEvent.java b/src/api/java/forestry/api/storage/BackpackEvent.java deleted file mode 100644 index 37427788..00000000 --- a/src/api/java/forestry/api/storage/BackpackEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -import cpw.mods.fml.common.eventhandler.Event; - - -public abstract class BackpackEvent extends Event { - - public final EntityPlayer player; - public final IBackpackDefinition backpackDefinition; - public final IInventory backpackInventory; - - public BackpackEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory) { - this.player = player; - this.backpackDefinition = backpackDefinition; - this.backpackInventory = backpackInventory; - } -} diff --git a/src/api/java/forestry/api/storage/BackpackManager.java b/src/api/java/forestry/api/storage/BackpackManager.java deleted file mode 100644 index 8805904d..00000000 --- a/src/api/java/forestry/api/storage/BackpackManager.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.item.ItemStack; - -public class BackpackManager { - /** - * 0 - Miner's Backpack 1 - Digger's Backpack 2 - Forester's Backpack 3 - Hunter's Backpack 4 - Adventurer's Backpack - * - * Use IMC messages to achieve the same effect! - */ - public static ArrayList[] backpackItems; - - public static IBackpackInterface backpackInterface; - - /** - * Only use this if you know what you are doing. Prefer backpackInterface. - */ - public static HashMap definitions = new HashMap(); -} diff --git a/src/api/java/forestry/api/storage/BackpackResupplyEvent.java b/src/api/java/forestry/api/storage/BackpackResupplyEvent.java deleted file mode 100644 index e6e5e119..00000000 --- a/src/api/java/forestry/api/storage/BackpackResupplyEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -import cpw.mods.fml.common.eventhandler.Cancelable; - -/** - * Use @SubscribeEvent on a method taking this event as an argument. Will fire whenever a backpack tries to resupply to a player inventory. Processing will stop - * if the event is canceled. - */ -@Cancelable -public class BackpackResupplyEvent extends BackpackEvent { - - public BackpackResupplyEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory) { - super(player, backpackDefinition, backpackInventory); - } - -} diff --git a/src/api/java/forestry/api/storage/BackpackStowEvent.java b/src/api/java/forestry/api/storage/BackpackStowEvent.java deleted file mode 100644 index 3afbf7a1..00000000 --- a/src/api/java/forestry/api/storage/BackpackStowEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -import cpw.mods.fml.common.eventhandler.Cancelable; - -/** - * Use @SubscribeEvent on a method taking this event as an argument. Will fire whenever a backpack tries to store an item. Processing will stop if the stacksize - * of stackToStow drops to 0 or less or the event is canceled. - */ -@Cancelable -public class BackpackStowEvent extends BackpackEvent { - - public final ItemStack stackToStow; - - public BackpackStowEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory, ItemStack stackToStow) { - super(player, backpackDefinition, backpackInventory); - this.stackToStow = stackToStow; - } -} diff --git a/src/api/java/forestry/api/storage/EnumBackpackType.java b/src/api/java/forestry/api/storage/EnumBackpackType.java deleted file mode 100644 index 48ad7ee0..00000000 --- a/src/api/java/forestry/api/storage/EnumBackpackType.java +++ /dev/null @@ -1,10 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -public enum EnumBackpackType { - APIARIST, T1, T2 -} diff --git a/src/api/java/forestry/api/storage/IBackpackDefinition.java b/src/api/java/forestry/api/storage/IBackpackDefinition.java deleted file mode 100644 index 31c66631..00000000 --- a/src/api/java/forestry/api/storage/IBackpackDefinition.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IBackpackDefinition { - - /** - * @return A unique string identifier - */ - String getKey(); - - /** - * @return Human-readable name of the backpack. - */ - String getName(ItemStack backpack); - - /** - * @return Primary colour for the backpack icon. - */ - int getPrimaryColour(); - - /** - * @return Secondary colour for backpack icon. - */ - int getSecondaryColour(); - - /** - * Adds an item as valid for this backpack. - * - * @param validItem - */ - void addValidItem(ItemStack validItem); - void addValidItems(List validItems); - - /** - * Returns true if the itemstack is a valid item for this backpack type. - */ - boolean isValidItem(ItemStack itemstack); - -} diff --git a/src/api/java/forestry/api/storage/IBackpackInterface.java b/src/api/java/forestry/api/storage/IBackpackInterface.java deleted file mode 100644 index 27a2eba5..00000000 --- a/src/api/java/forestry/api/storage/IBackpackInterface.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -import net.minecraft.item.Item; - -public interface IBackpackInterface { - - /** - * Adds a backpack with the given definition and type, returning the item. - * - * @param definition - * Definition of backpack behaviour. - * @param type - * Type of backpack. (T1 or T2 (= Woven) - * @return Created backpack item. - */ - Item addBackpack(IBackpackDefinition definition, EnumBackpackType type); -} diff --git a/src/api/java/forestry/api/storage/ICrateRegistry.java b/src/api/java/forestry/api/storage/ICrateRegistry.java deleted file mode 100644 index 868511e3..00000000 --- a/src/api/java/forestry/api/storage/ICrateRegistry.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public interface ICrateRegistry { - - /** - * Makes a new crate, registers it with the game registry with uid, - * and creates crating and uncrating recipes for the Carpenter. - * The icon is rendered automatically from the contained item. - * - * Can only be called during the Init stage. - */ - void registerCrate(Item item, String uid); - void registerCrate(Block block, String uid); - void registerCrate(ItemStack stack, String uid); - - /** - * Same as the above, but uses the ore dictionary for the Carpenter crating recipe. - */ - void registerCrateUsingOreDict(Item item, String uid); - void registerCrateUsingOreDict(Block block, String uid); - void registerCrateUsingOreDict(ItemStack stack, String uid); - -} diff --git a/src/api/java/forestry/api/storage/StorageManager.java b/src/api/java/forestry/api/storage/StorageManager.java deleted file mode 100644 index ef4ec4cf..00000000 --- a/src/api/java/forestry/api/storage/StorageManager.java +++ /dev/null @@ -1,12 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.storage; - -public class StorageManager { - - public static ICrateRegistry crateRegistry; - -} diff --git a/src/api/java/forestry/api/storage/package-info.java b/src/api/java/forestry/api/storage/package-info.java deleted file mode 100644 index 3d0c1e9d..00000000 --- a/src/api/java/forestry/api/storage/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|storage") -package forestry.api.storage; -import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/world/ITreeGenData.java b/src/api/java/forestry/api/world/ITreeGenData.java deleted file mode 100644 index bf59c5e5..00000000 --- a/src/api/java/forestry/api/world/ITreeGenData.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.world; - -import net.minecraft.world.World; - -import com.mojang.authlib.GameProfile; - -import forestry.api.arboriculture.ITreeGenome; - -public interface ITreeGenData { - - int getGirth(World world, int x, int y, int z); - - float getHeightModifier(); - - boolean canGrow(World world, int x, int y, int z, int expectedGirth, int expectedHeight); - - void setLeaves(World world, GameProfile owner, int x, int y, int z); - void setLeavesDecorative(World world, GameProfile owner, int x, int y, int z); - - boolean allowsFruitBlocks(); - - boolean trySpawnFruitBlock(World world, int x, int y, int z); - - ITreeGenome getGenome(); -} diff --git a/src/api/java/forestry/api/world/IWorldGenInterface.java b/src/api/java/forestry/api/world/IWorldGenInterface.java deleted file mode 100644 index b7b5555f..00000000 --- a/src/api/java/forestry/api/world/IWorldGenInterface.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.world; - -import net.minecraft.world.gen.feature.WorldGenerator; - -public interface IWorldGenInterface { - - /** - * Retrieves generators for trees identified by a given string. - * - * Returned generator classes take an {@link ITreeGenData} in the constructor. - * - * @param ident - * Unique identifier for tree type. Forestry's convention is 'treeSpecies', i.e. 'treeBaobab', 'treeSequoia'. - * @return All generators matching the given ident. - */ - Class[] getTreeGenerators(String ident); -} diff --git a/src/api/java/forestry/api/world/WorldGenManager.java b/src/api/java/forestry/api/world/WorldGenManager.java deleted file mode 100644 index a2a5b4f8..00000000 --- a/src/api/java/forestry/api/world/WorldGenManager.java +++ /dev/null @@ -1,10 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -package forestry.api.world; - -public class WorldGenManager { - public static IWorldGenInterface worldgenInterface; -} diff --git a/src/api/java/forestry/api/world/package-info.java b/src/api/java/forestry/api/world/package-info.java deleted file mode 100644 index c7e60f4e..00000000 --- a/src/api/java/forestry/api/world/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ -@API(apiVersion="1.1.0", owner="ForestryAPI|core", provides="ForestryAPI|world") -package forestry.api.world; -import cpw.mods.fml.common.API; diff --git a/src/api/java/thaumcraft/api/IGoggles.java b/src/api/java/thaumcraft/api/IGoggles.java deleted file mode 100644 index 2f53d816..00000000 --- a/src/api/java/thaumcraft/api/IGoggles.java +++ /dev/null @@ -1,22 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * - * @author Azanor - * - * Equipped head slot items that extend this class will be able to perform most functions that - * goggles of revealing can apart from view nodes which is handled by IRevealer. - * - */ - -public interface IGoggles { - - /* - * If this method returns true things like block essentia contents will be shown. - */ - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player); - -} diff --git a/src/api/java/thaumcraft/api/IRepairable.java b/src/api/java/thaumcraft/api/IRepairable.java deleted file mode 100644 index 48c6dff9..00000000 --- a/src/api/java/thaumcraft/api/IRepairable.java +++ /dev/null @@ -1,13 +0,0 @@ -package thaumcraft.api; - - - -/** - * @author Azanor - * Items, armor and tools with this interface can receive the Repair enchantment. - * Repairs 1 point of durability every 10 seconds (2 for repair II) - */ -public interface IRepairable { - - -} diff --git a/src/api/java/thaumcraft/api/IRepairableExtended.java b/src/api/java/thaumcraft/api/IRepairableExtended.java deleted file mode 100644 index 33827124..00000000 --- a/src/api/java/thaumcraft/api/IRepairableExtended.java +++ /dev/null @@ -1,17 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - - - -/** - * @author Azanor - * Items, armor and tools with this interface can receive the Repair enchantment. - * Repairs 1 point of durability every 10 seconds (2 for repair II) - */ -public interface IRepairableExtended extends IRepairable { - - public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantlevel); - -} diff --git a/src/api/java/thaumcraft/api/IRunicArmor.java b/src/api/java/thaumcraft/api/IRunicArmor.java deleted file mode 100644 index 5dd31100..00000000 --- a/src/api/java/thaumcraft/api/IRunicArmor.java +++ /dev/null @@ -1,22 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.item.ItemStack; - -/** - * - * @author Azanor - * - * Armor or bauble slot items that implement this interface can provide runic shielding. - * Recharging, hardening, etc. is handled internally by thaumcraft. - * - */ - -public interface IRunicArmor { - - /** - * returns how much charge this item can provide. This is the base shielding value - any hardening is stored and calculated internally. - */ - public int getRunicCharge(ItemStack itemstack); - - -} diff --git a/src/api/java/thaumcraft/api/IScribeTools.java b/src/api/java/thaumcraft/api/IScribeTools.java deleted file mode 100644 index 8800fa57..00000000 --- a/src/api/java/thaumcraft/api/IScribeTools.java +++ /dev/null @@ -1,14 +0,0 @@ -package thaumcraft.api; - - -/** - * - * @author Azanor - * - * Interface used to identify scribing tool items used in research table - * - */ - -public interface IScribeTools { - -} diff --git a/src/api/java/thaumcraft/api/IVisDiscountGear.java b/src/api/java/thaumcraft/api/IVisDiscountGear.java deleted file mode 100644 index 3793ea3e..00000000 --- a/src/api/java/thaumcraft/api/IVisDiscountGear.java +++ /dev/null @@ -1,20 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import thaumcraft.api.aspects.Aspect; - - - - -/** - * @author Azanor - * ItemArmor with this interface will grant a discount to the vis cost of actions the wearer performs with casting wands. - * The amount returned is the percentage by which the cost is discounted. There is a built-int max discount of 50%, but - * individual items really shouldn't have a discount more than 5% - */ -public interface IVisDiscountGear { - - int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect); - -} diff --git a/src/api/java/thaumcraft/api/ItemApi.java b/src/api/java/thaumcraft/api/ItemApi.java deleted file mode 100644 index 25dda282..00000000 --- a/src/api/java/thaumcraft/api/ItemApi.java +++ /dev/null @@ -1,70 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.FMLLog; - -/** - * @author Azanor - * - * This is used to gain access to the items in my mod. - * I only give some examples and it will probably still - * require a bit of work for you to get hold of everything you need. - * - */ -public class ItemApi { - - public static ItemStack getItem(String itemString, int meta) { - ItemStack item = null; - - try { - String itemClass = "thaumcraft.common.config.ConfigItems"; - Object obj = Class.forName(itemClass).getField(itemString).get(null); - if (obj instanceof Item) { - item = new ItemStack((Item) obj,1,meta); - } else if (obj instanceof ItemStack) { - item = (ItemStack) obj; - } - } catch (Exception ex) { - FMLLog.warning("[Thaumcraft] Could not retrieve item identified by: " + itemString); - } - - return item; - } - - public static ItemStack getBlock(String itemString, int meta) { - ItemStack item = null; - - try { - String itemClass = "thaumcraft.common.config.ConfigBlocks"; - Object obj = Class.forName(itemClass).getField(itemString).get(null); - if (obj instanceof Block) { - item = new ItemStack((Block) obj,1,meta); - } else if (obj instanceof ItemStack) { - item = (ItemStack) obj; - } - } catch (Exception ex) { - FMLLog.warning("[Thaumcraft] Could not retrieve block identified by: " + itemString); - } - - return item; - } - - /** - * - * Some examples - * - * Casting Wands: - * itemWandCasting - * - * Resources: - * itemEssence, itemWispEssence, itemResource, itemShard, itemNugget, - * itemNuggetChicken, itemNuggetBeef, itemNuggetPork, itemTripleMeatTreat - * - * Research: - * itemResearchNotes, itemInkwell, itemThaumonomicon - * - */ - -} diff --git a/src/api/java/thaumcraft/api/ItemRunic.java b/src/api/java/thaumcraft/api/ItemRunic.java deleted file mode 100644 index 80251f59..00000000 --- a/src/api/java/thaumcraft/api/ItemRunic.java +++ /dev/null @@ -1,21 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class ItemRunic extends Item implements IRunicArmor { - - int charge; - - public ItemRunic (int charge) - { - super(); - this.charge = charge; - } - - @Override - public int getRunicCharge(ItemStack itemstack) { - return charge; - } - -} diff --git a/src/api/java/thaumcraft/api/ThaumcraftApi.java b/src/api/java/thaumcraft/api/ThaumcraftApi.java deleted file mode 100644 index 0b135d31..00000000 --- a/src/api/java/thaumcraft/api/ThaumcraftApi.java +++ /dev/null @@ -1,507 +0,0 @@ -package thaumcraft.api; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.block.Block; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.EnumHelper; -import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.crafting.CrucibleRecipe; -import thaumcraft.api.crafting.InfusionEnchantmentRecipe; -import thaumcraft.api.crafting.InfusionRecipe; -import thaumcraft.api.crafting.ShapedArcaneRecipe; -import thaumcraft.api.crafting.ShapelessArcaneRecipe; -import thaumcraft.api.research.IScanEventHandler; -import thaumcraft.api.research.ResearchCategories; -import thaumcraft.api.research.ResearchCategoryList; -import thaumcraft.api.research.ResearchItem; -import thaumcraft.api.research.ResearchPage; - - -/** - * @author Azanor - * - * - * IMPORTANT: If you are adding your own aspects to items it is a good idea to do it AFTER Thaumcraft adds its aspects, otherwise odd things may happen. - * - */ -public class ThaumcraftApi { - - //Materials - public static ToolMaterial toolMatThaumium = EnumHelper.addToolMaterial("THAUMIUM", 3, 400, 7F, 2, 22); - public static ToolMaterial toolMatElemental = EnumHelper.addToolMaterial("THAUMIUM_ELEMENTAL", 3, 1500, 10F, 3, 18); - public static ArmorMaterial armorMatThaumium = EnumHelper.addArmorMaterial("THAUMIUM", 25, new int[] { 2, 6, 5, 2 }, 25); - public static ArmorMaterial armorMatSpecial = EnumHelper.addArmorMaterial("SPECIAL", 25, new int[] { 1, 3, 2, 1 }, 25); - - //Enchantment references - public static int enchantFrugal; - public static int enchantPotency; - public static int enchantWandFortune; - public static int enchantHaste; - public static int enchantRepair; - - //Miscellaneous - /** - * Portable Hole Block-id Blacklist. - * Simply add the block-id's of blocks you don't want the portable hole to go through. - */ - public static ArrayList portableHoleBlackList = new ArrayList(); - - - //RESEARCH///////////////////////////////////////// - public static ArrayList scanEventhandlers = new ArrayList(); - public static ArrayList scanEntities = new ArrayList(); - public static class EntityTagsNBT { - public EntityTagsNBT(String name, Object value) { - this.name = name; - this.value = value; - } - public String name; - public Object value; - } - public static class EntityTags { - public EntityTags(String entityName, AspectList aspects, EntityTagsNBT... nbts) { - this.entityName = entityName; - this.nbts = nbts; - this.aspects = aspects; - } - public String entityName; - public EntityTagsNBT[] nbts; - public AspectList aspects; - } - - /** - * not really working atm, so ignore it for now - * @param scanEventHandler - */ - public static void registerScanEventhandler(IScanEventHandler scanEventHandler) { - scanEventhandlers.add(scanEventHandler); - } - - /** - * This is used to add aspects to entities which you can then scan using a thaumometer. - * Also used to calculate vis drops from mobs. - * @param entityName - * @param aspects - * @param nbt you can specify certain nbt keys and their values - * to differentiate between mobs.
For example the normal and wither skeleton: - *
ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 5)); - *
ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 8), new NBTTagByte("SkeletonType",(byte) 1)); - */ - public static void registerEntityTag(String entityName, AspectList aspects, EntityTagsNBT... nbt ) { - scanEntities.add(new EntityTags(entityName,aspects,nbt)); - } - - //RECIPES///////////////////////////////////////// - private static ArrayList craftingRecipes = new ArrayList(); - private static HashMap smeltingBonus = new HashMap(); - - /** - * This method is used to determine what bonus items are generated when the infernal furnace smelts items - * @param in The input of the smelting operation. e.g. new ItemStack(Block.oreGold) - * @param out The bonus item that can be produced from the smelting operation e.g. new ItemStack(nuggetGold,0,0). - * Stacksize should be 0 unless you want to guarantee that at least 1 item is always produced. - */ - public static void addSmeltingBonus(ItemStack in, ItemStack out) { - smeltingBonus.put( - Arrays.asList(in.getItem(),in.getItemDamage()), - new ItemStack(out.getItem(),0,out.getItemDamage())); - } - - /** - * This method is used to determine what bonus items are generated when the infernal furnace smelts items - * @param in The ore dictionary input of the smelting operation. e.g. "oreGold" - * @param out The bonus item that can be produced from the smelting operation e.g. new ItemStack(nuggetGold,0,0). - * Stacksize should be 0 unless you want to guarantee that at least 1 item is always produced. - */ - public static void addSmeltingBonus(String in, ItemStack out) { - smeltingBonus.put( in, new ItemStack(out.getItem(),0,out.getItemDamage())); - } - - /** - * Returns the bonus item produced from a smelting operation in the infernal furnace - * @param in The input of the smelting operation. e.g. new ItemStack(oreGold) - * @return the The bonus item that can be produced - */ - public static ItemStack getSmeltingBonus(ItemStack in) { - ItemStack out = smeltingBonus.get(Arrays.asList(in.getItem(),in.getItemDamage())); - if (out==null) { - out = smeltingBonus.get(Arrays.asList(in.getItem(),OreDictionary.WILDCARD_VALUE)); - } - if (out==null) { - String od = OreDictionary.getOreName( OreDictionary.getOreID(in)); - out = smeltingBonus.get(od); - } - return out; - } - - public static List getCraftingRecipes() { - return craftingRecipes; - } - - /** - * @param research the research key required for this recipe to work. Leave blank if it will work without research - * @param result the recipe output - * @param aspects the vis cost per aspect. - * @param recipe The recipe. Format is exactly the same as vanilla recipes. Input itemstacks are NBT sensitive. - */ - public static ShapedArcaneRecipe addArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object ... recipe) - { - ShapedArcaneRecipe r= new ShapedArcaneRecipe(research, result, aspects, recipe); - craftingRecipes.add(r); - return r; - } - - /** - * @param research the research key required for this recipe to work. Leave blank if it will work without research - * @param result the recipe output - * @param aspects the vis cost per aspect - * @param recipe The recipe. Format is exactly the same as vanilla shapeless recipes. Input itemstacks are NBT sensitive. - */ - public static ShapelessArcaneRecipe addShapelessArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object ... recipe) - { - ShapelessArcaneRecipe r = new ShapelessArcaneRecipe(research, result, aspects, recipe); - craftingRecipes.add(r); - return r; - } - - /** - * @param research the research key required for this recipe to work. Leave blank if it will work without research - * @param result the recipe output. It can either be an itemstack or an nbt compound tag that will be added to the central item - * @param instability a number that represents the N in 1000 chance for the infusion altar to spawn an - * instability effect each second while the crafting is in progress - * @param aspects the essentia cost per aspect. - * @param aspects input the central item to be infused - * @param recipe An array of items required to craft this. Input itemstacks are NBT sensitive. - * Infusion crafting components are automatically "fuzzy" and the oredict will be checked for possible matches. - * - */ - public static InfusionRecipe addInfusionCraftingRecipe(String research, Object result, int instability, AspectList aspects, ItemStack input,ItemStack[] recipe) - { - if (!(result instanceof ItemStack || result instanceof Object[])) return null; - InfusionRecipe r= new InfusionRecipe(research, result, instability, aspects, input, recipe); - craftingRecipes.add(r); - return r; - } - - /** - * @param research the research key required for this recipe to work. Leave blank if it will work without research - * @param enchantment the enchantment that will be applied to the item - * @param instability a number that represents the N in 1000 chance for the infusion altar to spawn an - * instability effect each second while the crafting is in progress - * @param aspects the essentia cost per aspect. - * @param recipe An array of items required to craft this. Input itemstacks are NBT sensitive. - * Infusion crafting components are automatically "fuzzy" and the oredict will be checked for possible matches. - * - */ - public static InfusionEnchantmentRecipe addInfusionEnchantmentRecipe(String research, Enchantment enchantment, int instability, AspectList aspects, ItemStack[] recipe) - { - InfusionEnchantmentRecipe r= new InfusionEnchantmentRecipe(research, enchantment, instability, aspects, recipe); - craftingRecipes.add(r); - return r; - } - - /** - * @param stack the recipe result - * @return the recipe - */ - public static InfusionRecipe getInfusionRecipe(ItemStack res) { - for (Object r:getCraftingRecipes()) { - if (r instanceof InfusionRecipe) { - if (((InfusionRecipe)r).getRecipeOutput() instanceof ItemStack) { - if (((ItemStack) ((InfusionRecipe)r).getRecipeOutput()).isItemEqual(res)) - return (InfusionRecipe)r; - } - } - } - return null; - } - - - /** - * @param key the research key required for this recipe to work. - * @param result the output result - * @param catalyst an itemstack of the catalyst or a string if it is an ore dictionary item - * @param cost the vis cost - * @param tags the aspects required to craft this - */ - public static CrucibleRecipe addCrucibleRecipe(String key, ItemStack result, Object catalyst, AspectList tags) { - CrucibleRecipe rc = new CrucibleRecipe(key, result, catalyst, tags); - getCraftingRecipes().add(rc); - return rc; - } - - - /** - * @param stack the recipe result - * @return the recipe - */ - public static CrucibleRecipe getCrucibleRecipe(ItemStack stack) { - for (Object r:getCraftingRecipes()) { - if (r instanceof CrucibleRecipe) { - if (((CrucibleRecipe)r).getRecipeOutput().isItemEqual(stack)) - return (CrucibleRecipe)r; - } - } - return null; - } - - /** - * Used by the thaumonomicon drilldown feature. - * @param stack the item - * @return the thaumcraft recipe key that produces that item. - */ - private static HashMap keyCache = new HashMap(); - - public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) { - int[] key = new int[] {Item.getIdFromItem(stack.getItem()),stack.getItemDamage()}; - if (keyCache.containsKey(key)) { - if (keyCache.get(key)==null) return null; - if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String)(keyCache.get(key))[0])) - return keyCache.get(key); - else - return null; - } - for (ResearchCategoryList rcl:ResearchCategories.researchCategories.values()) { - for (ResearchItem ri:rcl.research.values()) { - if (ri.getPages()==null) continue; - for (int a=0;a objectTags = new ConcurrentHashMap(); - - /** - * Checks to see if the passed item/block already has aspects associated with it. - * @param id - * @param meta - * @return - */ - public static boolean exists(Item item, int meta) { - AspectList tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,meta)); - if (tmp==null) { - tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,OreDictionary.WILDCARD_VALUE)); - if (meta==OreDictionary.WILDCARD_VALUE && tmp==null) { - int index=0; - do { - tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,index)); - index++; - } while (index<16 && tmp==null); - } - if (tmp==null) return false; - } - - return true; - } - - /** - * Used to assign apsects to the given item/block. Here is an example of the declaration for cobblestone:

- * ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.cobblestone), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); - * @param item the item passed. Pass OreDictionary.WILDCARD_VALUE if all damage values of this item/block should have the same aspects - * @param aspects A ObjectTags object of the associated aspects - */ - public static void registerObjectTag(ItemStack item, AspectList aspects) { - if (aspects==null) aspects=new AspectList(); - try { - objectTags.put(Arrays.asList(item.getItem(),item.getItemDamage()), aspects); - } catch (Exception e) {} - } - - - /** - * Used to assign apsects to the given item/block. Here is an example of the declaration for cobblestone:

- * ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.cobblestone), new int[]{0,1}, (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); - * @param item - * @param meta A range of meta values if you wish to lump several item meta's together as being the "same" item (i.e. stair orientations) - * @param aspects A ObjectTags object of the associated aspects - */ - public static void registerObjectTag(ItemStack item, int[] meta, AspectList aspects) { - if (aspects==null) aspects=new AspectList(); - try { - objectTags.put(Arrays.asList(item.getItem(),meta), aspects); - } catch (Exception e) {} - } - - /** - * Used to assign apsects to the given ore dictionary item. - * @param oreDict the ore dictionary name - * @param aspects A ObjectTags object of the associated aspects - */ - public static void registerObjectTag(String oreDict, AspectList aspects) { - if (aspects==null) aspects=new AspectList(); - ArrayList ores = OreDictionary.getOres(oreDict); - if (ores!=null && ores.size()>0) { - for (ItemStack ore:ores) { - try { - objectTags.put(Arrays.asList(ore.getItem(), ore.getItemDamage()), aspects); - } catch (Exception e) {} - } - } - } - - /** - * Used to assign aspects to the given item/block. - * Attempts to automatically generate aspect tags by checking registered recipes. - * Here is an example of the declaration for pistons:

- * ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.cobblestone), (new AspectList()).add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 4)); - * @param item, pass OreDictionary.WILDCARD_VALUE to meta if all damage values of this item/block should have the same aspects - * @param aspects A ObjectTags object of the associated aspects - */ - public static void registerComplexObjectTag(ItemStack item, AspectList aspects ) { - if (!exists(item.getItem(),item.getItemDamage())) { - AspectList tmp = ThaumcraftApiHelper.generateTags(item.getItem(), item.getItemDamage()); - if (tmp != null && tmp.size()>0) { - for(Aspect tag:tmp.getAspects()) { - aspects.add(tag, tmp.getAmount(tag)); - } - } - registerObjectTag(item,aspects); - } else { - AspectList tmp = ThaumcraftApiHelper.getObjectAspects(item); - for(Aspect tag:aspects.getAspects()) { - tmp.merge(tag, tmp.getAmount(tag)); - } - registerObjectTag(item,tmp); - } - } - - //WARP /////////////////////////////////////////////////////////////////////////////////////// - private static HashMap warpMap = new HashMap(); - - /** - * This method is used to determine how much warp is gained if the item is crafted - * @param craftresult The item crafted - * @param amount how much warp is gained - */ - public static void addWarpToItem(ItemStack craftresult, int amount) { - warpMap.put(Arrays.asList(craftresult.getItem(),craftresult.getItemDamage()),amount); - } - - /** - * This method is used to determine how much warp is gained if the sent item is crafted - * @param in The item crafted - * @param amount how much warp is gained - */ - public static void addWarpToResearch(String research, int amount) { - warpMap.put(research, amount); - } - - /** - * Returns how much warp is gained from the item or research passed in - * @param in itemstack or string - * @return how much warp it will give - */ - public static int getWarp(Object in) { - if (in==null) return 0; - if (in instanceof ItemStack && warpMap.containsKey(Arrays.asList(((ItemStack)in).getItem(),((ItemStack)in).getItemDamage()))) { - return warpMap.get(Arrays.asList(((ItemStack)in).getItem(),((ItemStack)in).getItemDamage())); - } else - if (in instanceof String && warpMap.containsKey((String)in)) { - return warpMap.get((String)in); - } - return 0; - } - - //CROPS ////////////////////////////////////////////////////////////////////////////////////////// - - /** - * To define mod crops you need to use FMLInterModComms in your @Mod.Init method. - * There are two 'types' of crops you can add. Standard crops and clickable crops. - * - * Standard crops work like normal vanilla crops - they grow until a certain metadata - * value is reached and you harvest them by destroying the block and collecting the blocks. - * You need to create and ItemStack that tells the golem what block id and metadata represents - * the crop when fully grown. Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the metadata won't get - * checked. - * Example for vanilla wheat: - * FMLInterModComms.sendMessage("Thaumcraft", "harvestStandardCrop", new ItemStack(Block.crops,1,7)); - * - * Clickable crops are crops that you right click to gather their bounty instead of destroying them. - * As for standard crops, you need to create and ItemStack that tells the golem what block id - * and metadata represents the crop when fully grown. The golem will trigger the blocks onBlockActivated method. - * Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the metadata won't get checked. - * Example (this will technically do nothing since clicking wheat does nothing, but you get the idea): - * FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(Block.crops,1,7)); - * - * Stacked crops (like reeds) are crops that you wish the bottom block should remain after harvesting. - * As for standard crops, you need to create and ItemStack that tells the golem what block id - * and metadata represents the crop when fully grown. Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the actualy md won't get - * checked. If it has the order upgrade it will only harvest if the crop is more than one block high. - * Example: - * FMLInterModComms.sendMessage("Thaumcraft", "harvestStackedCrop", new ItemStack(Block.reed,1,7)); - */ - - //NATIVE CLUSTERS ////////////////////////////////////////////////////////////////////////////////// - - /** - * You can define certain ores that will have a chance to produce native clusters via FMLInterModComms - * in your @Mod.Init method using the "nativeCluster" string message. - * The format should be: - * "[ore item/block id],[ore item/block metadata],[cluster item/block id],[cluster item/block metadata],[chance modifier float]" - * - * NOTE: The chance modifier is a multiplier applied to the default chance for that cluster to be produced (default 27.5% for a pickaxe of the core) - * - * Example for vanilla iron ore to produce one of my own native iron clusters (assuming default id's) at double the default chance: - * FMLInterModComms.sendMessage("Thaumcraft", "nativeCluster","15,0,25016,16,2.0"); - */ - - //LAMP OF GROWTH BLACKLIST /////////////////////////////////////////////////////////////////////////// - /** - * You can blacklist crops that should not be effected by the Lamp of Growth via FMLInterModComms - * in your @Mod.Init method using the "lampBlacklist" itemstack message. - * Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the metadata won't get checked. - * Example for vanilla wheat: - * FMLInterModComms.sendMessage("Thaumcraft", "lampBlacklist", new ItemStack(Block.crops,1,OreDictionary.WILDCARD_VALUE)); - */ - - //DIMENSION BLACKLIST /////////////////////////////////////////////////////////////////////////// - /** - * You can blacklist a dimension to not spawn certain thaumcraft features - * in your @Mod.Init method using the "dimensionBlacklist" string message in the format "[dimension]:[level]" - * The level values are as follows: - * [0] stop all tc spawning and generation - * [1] allow ore and node generation - * [2] allow mob spawning - * [3] allow ore and node gen + mob spawning - * Example: - * FMLInterModComms.sendMessage("Thaumcraft", "dimensionBlacklist", "15:1"); - */ - - //BIOME BLACKLIST /////////////////////////////////////////////////////////////////////////// - /** - * You can blacklist a biome to not spawn certain thaumcraft features - * in your @Mod.Init method using the "biomeBlacklist" string message in the format "[biome id]:[level]" - * The level values are as follows: - * [0] stop all tc spawning and generation - * [1] allow ore and node generation - * [2] allow mob spawning - * [3] allow ore and node gen + mob spawning - * Example: - * FMLInterModComms.sendMessage("Thaumcraft", "biomeBlacklist", "180:2"); - */ -} diff --git a/src/api/java/thaumcraft/api/ThaumcraftApiHelper.java b/src/api/java/thaumcraft/api/ThaumcraftApiHelper.java deleted file mode 100644 index a4b6d42a..00000000 --- a/src/api/java/thaumcraft/api/ThaumcraftApiHelper.java +++ /dev/null @@ -1,269 +0,0 @@ -package thaumcraft.api; - -import java.lang.reflect.Method; -import java.util.HashMap; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.aspects.IEssentiaTransport; -import cpw.mods.fml.common.FMLLog; - -public class ThaumcraftApiHelper { - - public static AspectList cullTags(AspectList temp) { - AspectList temp2 = new AspectList(); - for (Aspect tag:temp.getAspects()) { - if (tag!=null) - temp2.add(tag, temp.getAmount(tag)); - } - while (temp2!=null && temp2.size()>10) { - Aspect lowest = null; - int low = Integer.MAX_VALUE; - for (Aspect tag:temp2.getAspects()) { - if (tag==null) continue; - if (temp2.getAmount(tag) allAspects= new HashMap(); - private static HashMap allCompoundAspects= new HashMap(); - - public static AspectList getAllAspects(int amount) { - if (allAspects.get(amount)==null) { - AspectList al = new AspectList(); - for (Aspect aspect:Aspect.aspects.values()) { - al.add(aspect, amount); - } - allAspects.put(amount, al); - } - return allAspects.get(amount); - } - - public static AspectList getAllCompoundAspects(int amount) { - if (allCompoundAspects.get(amount)==null) { - AspectList al = new AspectList(); - for (Aspect aspect:Aspect.getCompoundAspects()) { - al.add(aspect, amount); - } - allCompoundAspects.put(amount, al); - } - return allCompoundAspects.get(amount); - } - - static Method consumeVisFromWand; - /** - * Use to subtract vis from a wand for most operations - * Wands store vis differently so "real" vis costs need to be multiplied by 100 before calling this method - * @param wand the wand itemstack - * @param player the player using the wand - * @param cost the cost of the operation. - * @param doit actually subtract the vis from the wand if true - if false just simulate the result - * @param crafting is this a crafting operation or not - if - * false then things like frugal and potency will apply to the costs - * @return was the vis successfully subtracted - */ - public static boolean consumeVisFromWand(ItemStack wand, EntityPlayer player, - AspectList cost, boolean doit, boolean crafting) { - boolean ot = false; - try { - if(consumeVisFromWand == null) { - Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting"); - consumeVisFromWand = fake.getMethod("consumeAllVis", - ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class, boolean.class); - } - ot = (Boolean) consumeVisFromWand.invoke( - consumeVisFromWand.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit, crafting); - } catch(Exception ex) { - FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVis"); - } - return ot; - } - - static Method consumeVisFromWandCrafting; - /** - * Subtract vis for use by a crafting mechanic. Costs are calculated slightly - * differently and things like the frugal enchant is ignored - * Must NOT be multiplied by 100 - send the actual vis cost - * @param wand the wand itemstack - * @param player the player using the wand - * @param cost the cost of the operation. - * @param doit actually subtract the vis from the wand if true - if false just simulate the result - * @return was the vis successfully subtracted - */ - public static boolean consumeVisFromWandCrafting(ItemStack wand, EntityPlayer player, - AspectList cost, boolean doit) { - boolean ot = false; - try { - if(consumeVisFromWandCrafting == null) { - Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting"); - consumeVisFromWandCrafting = fake.getMethod("consumeAllVisCrafting", - ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class); - } - ot = (Boolean) consumeVisFromWandCrafting.invoke( - consumeVisFromWandCrafting.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit); - } catch(Exception ex) { - FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVisCrafting"); - } - return ot; - } - - static Method consumeVisFromInventory; - /** - * Subtract vis from a wand the player is carrying. Works like consumeVisFromWand in that actual vis - * costs should be multiplied by 100. The costs are handled like crafting however and things like - * frugal don't effect them - * @param player the player using the wand - * @param cost the cost of the operation. - * @return was the vis successfully subtracted - */ - public static boolean consumeVisFromInventory(EntityPlayer player, AspectList cost) { - boolean ot = false; - try { - if(consumeVisFromInventory == null) { - Class fake = Class.forName("thaumcraft.common.items.wands.WandManager"); - consumeVisFromInventory = fake.getMethod("consumeVisFromInventory", - EntityPlayer.class, AspectList.class); - } - ot = (Boolean) consumeVisFromInventory.invoke(null, player, cost); - } catch(Exception ex) { - FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.WandManager method consumeVisFromInventory"); - } - return ot; - } -} diff --git a/src/api/java/thaumcraft/api/TileThaumcraft.java b/src/api/java/thaumcraft/api/TileThaumcraft.java deleted file mode 100644 index 56ccae87..00000000 --- a/src/api/java/thaumcraft/api/TileThaumcraft.java +++ /dev/null @@ -1,63 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -/** - * - * @author azanor - * - * Custom tile entity class I use for most of my tile entities. Setup in such a way that only - * the nbt data within readCustomNBT / writeCustomNBT will be sent to the client when the tile - * updates. Apart from all the normal TE data that gets sent that is. - * - */ -public class TileThaumcraft extends TileEntity { - - //NBT stuff - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - readCustomNBT(nbttagcompound); - } - - public void readCustomNBT(NBTTagCompound nbttagcompound) - { - //TODO - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - writeCustomNBT(nbttagcompound); - } - - public void writeCustomNBT(NBTTagCompound nbttagcompound) - { - //TODO - } - - //Client Packet stuff - @Override - public Packet getDescriptionPacket() { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - this.writeCustomNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, nbttagcompound); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - this.readCustomNBT(pkt.func_148857_g()); - } - - - - -} diff --git a/src/api/java/thaumcraft/api/WorldCoordinates.java b/src/api/java/thaumcraft/api/WorldCoordinates.java deleted file mode 100644 index 6c620af5..00000000 --- a/src/api/java/thaumcraft/api/WorldCoordinates.java +++ /dev/null @@ -1,117 +0,0 @@ -package thaumcraft.api; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class WorldCoordinates implements Comparable -{ - public int x; - - /** the y coordinate */ - public int y; - - /** the z coordinate */ - public int z; - - public int dim; - - public WorldCoordinates() {} - - public WorldCoordinates(int par1, int par2, int par3, int d) - { - this.x = par1; - this.y = par2; - this.z = par3; - this.dim = d; - } - - public WorldCoordinates(TileEntity tile) - { - this.x = tile.xCoord; - this.y = tile.yCoord; - this.z = tile.zCoord; - this.dim = tile.getWorldObj().provider.dimensionId; - } - - public WorldCoordinates(WorldCoordinates par1ChunkCoordinates) - { - this.x = par1ChunkCoordinates.x; - this.y = par1ChunkCoordinates.y; - this.z = par1ChunkCoordinates.z; - this.dim = par1ChunkCoordinates.dim; - } - - public boolean equals(Object par1Obj) - { - if (!(par1Obj instanceof WorldCoordinates)) - { - return false; - } - else - { - WorldCoordinates coordinates = (WorldCoordinates)par1Obj; - return this.x == coordinates.x && this.y == coordinates.y && this.z == coordinates.z && this.dim == coordinates.dim ; - } - } - - public int hashCode() - { - return this.x + this.y << 8 + this.z << 16 + this.dim << 24; - } - - /** - * Compare the coordinate with another coordinate - */ - public int compareWorldCoordinate(WorldCoordinates par1) - { - return this.dim == par1.dim ? ( - this.y == par1.y ? (this.z == par1.z ? this.x - par1.x : this.z - par1.z) : this.y - par1.y) : -1; - } - - public void set(int par1, int par2, int par3, int d) - { - this.x = par1; - this.y = par2; - this.z = par3; - this.dim = d; - } - - /** - * Returns the squared distance between this coordinates and the coordinates given as argument. - */ - public float getDistanceSquared(int par1, int par2, int par3) - { - float f = (float)(this.x - par1); - float f1 = (float)(this.y - par2); - float f2 = (float)(this.z - par3); - return f * f + f1 * f1 + f2 * f2; - } - - /** - * Return the squared distance between this coordinates and the ChunkCoordinates given as argument. - */ - public float getDistanceSquaredToWorldCoordinates(WorldCoordinates par1ChunkCoordinates) - { - return this.getDistanceSquared(par1ChunkCoordinates.x, par1ChunkCoordinates.y, par1ChunkCoordinates.z); - } - - public int compareTo(Object par1Obj) - { - return this.compareWorldCoordinate((WorldCoordinates)par1Obj); - } - - public void readNBT(NBTTagCompound nbt) { - this.x = nbt.getInteger("w_x"); - this.y = nbt.getInteger("w_y"); - this.z = nbt.getInteger("w_z"); - this.dim = nbt.getInteger("w_d"); - } - - public void writeNBT(NBTTagCompound nbt) { - nbt.setInteger("w_x",x); - nbt.setInteger("w_y",y); - nbt.setInteger("w_z",z); - nbt.setInteger("w_d",dim); - } - -} diff --git a/src/api/java/thaumcraft/api/aspects/Aspect.java b/src/api/java/thaumcraft/api/aspects/Aspect.java deleted file mode 100644 index 3c33a4a7..00000000 --- a/src/api/java/thaumcraft/api/aspects/Aspect.java +++ /dev/null @@ -1,201 +0,0 @@ -package thaumcraft.api.aspects; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashMap; - -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.apache.commons.lang3.text.WordUtils; - -public class Aspect { - - String tag; - Aspect[] components; - int color; - private String chatcolor; - ResourceLocation image; - int blend; - - /** - * Use this constructor to register your own aspects. - * @param tag the key that will be used to reference this aspect, as well as its latin display name - * @param color color to display the tag in - * @param components the aspects this one is formed from - * @param image ResourceLocation pointing to a 32x32 icon of the aspect - * @param blend GL11 blendmode (1 or 771). Used for rendering nodes. Default is 1 - */ - public Aspect(String tag, int color, Aspect[] components, ResourceLocation image, int blend) { - if (aspects.containsKey(tag)) throw new IllegalArgumentException(tag+" already registered!"); - this.tag = tag; - this.components = components; - this.color = color; - this.image = image; - this.blend = blend; - aspects.put(tag, this); - } - - /** - * Shortcut constructor I use for the default aspects - you shouldn't be using this. - */ - public Aspect(String tag, int color, Aspect[] components) { - this(tag,color,components,new ResourceLocation("thaumcraft","textures/aspects/"+tag.toLowerCase()+".png"),1); - } - - /** - * Shortcut constructor I use for the default aspects - you shouldn't be using this. - */ - public Aspect(String tag, int color, Aspect[] components, int blend) { - this(tag,color,components,new ResourceLocation("thaumcraft","textures/aspects/"+tag.toLowerCase()+".png"),blend); - } - - /** - * Shortcut constructor I use for the primal aspects - - * you shouldn't use this as making your own primal aspects will break all the things. - */ - public Aspect(String tag, int color, String chatcolor, int blend) { - this(tag,color,(Aspect[])null, blend); - this.setChatcolor(chatcolor); - } - - public int getColor() { - return color; - } - - public String getName() { - return WordUtils.capitalizeFully(tag); - } - - public String getLocalizedDescription() { - return StatCollector.translateToLocal("tc.aspect."+tag); - } - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - - public Aspect[] getComponents() { - return components; - } - - public void setComponents(Aspect[] components) { - this.components = components; - } - - public ResourceLocation getImage() { - return image; - } - - public static Aspect getAspect(String tag) { - return aspects.get(tag); - } - - public int getBlend() { - return blend; - } - - public void setBlend(int blend) { - this.blend = blend; - } - - public boolean isPrimal() { - return getComponents()==null || getComponents().length!=2; - } - - /////////////////////////////// - public static ArrayList getPrimalAspects() { - ArrayList primals = new ArrayList(); - Collection pa = aspects.values(); - for (Aspect aspect:pa) { - if (aspect.isPrimal()) primals.add(aspect); - } - return primals; - } - - public static ArrayList getCompoundAspects() { - ArrayList compounds = new ArrayList(); - Collection pa = aspects.values(); - for (Aspect aspect:pa) { - if (!aspect.isPrimal()) compounds.add(aspect); - } - return compounds; - } - - public String getChatcolor() { - return chatcolor; - } - - public void setChatcolor(String chatcolor) { - this.chatcolor = chatcolor; - } - - - /////////////////////////////// - public static LinkedHashMap aspects = new LinkedHashMap(); - - //PRIMAL - public static final Aspect AIR = new Aspect("aer",0xffff7e,"e",1); - public static final Aspect EARTH = new Aspect("terra",0x56c000,"2",1); - public static final Aspect FIRE = new Aspect("ignis",0xff5a01,"c",1); - public static final Aspect WATER = new Aspect("aqua",0x3cd4fc,"3",1); - public static final Aspect ORDER = new Aspect("ordo",0xd5d4ec,"7",1); - public static final Aspect ENTROPY = new Aspect("perditio",0x404040,"8",771); - - //SECONDARY - public static final Aspect VOID = new Aspect("vacuos",0x888888, new Aspect[] {AIR, ENTROPY},771); - public static final Aspect LIGHT = new Aspect("lux",0xfff663, new Aspect[] {AIR, FIRE}); - public static final Aspect WEATHER = new Aspect("tempestas",0xFFFFFF, new Aspect[] {AIR, WATER}); - public static final Aspect MOTION = new Aspect("motus",0xcdccf4, new Aspect[] {AIR, ORDER}); - public static final Aspect COLD = new Aspect("gelum",0xe1ffff, new Aspect[] {FIRE, ENTROPY}); - public static final Aspect CRYSTAL = new Aspect("vitreus",0x80ffff, new Aspect[] {EARTH, ORDER}); - public static final Aspect LIFE = new Aspect("victus",0xde0005, new Aspect[] {WATER, EARTH}); - public static final Aspect POISON = new Aspect("venenum",0x89f000, new Aspect[] {WATER, ENTROPY}); - public static final Aspect ENERGY = new Aspect("potentia",0xc0ffff, new Aspect[] {ORDER, FIRE}); - public static final Aspect EXCHANGE = new Aspect("permutatio",0x578357, new Aspect[] {ENTROPY, ORDER}); -// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {AIR, EARTH}); -// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {FIRE, EARTH}); -// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {FIRE, WATER}); -// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {ORDER, WATER}); -// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {EARTH, ENTROPY}); - - //TERTIARY - public static final Aspect METAL = new Aspect("metallum",0xb5b5cd, new Aspect[] {EARTH, CRYSTAL}); - public static final Aspect DEATH = new Aspect("mortuus",0x887788, new Aspect[] {LIFE, ENTROPY}); - public static final Aspect FLIGHT = new Aspect("volatus",0xe7e7d7, new Aspect[] {AIR, MOTION}); - public static final Aspect DARKNESS = new Aspect("tenebrae",0x222222, new Aspect[] {VOID, LIGHT}); - public static final Aspect SOUL = new Aspect("spiritus",0xebebfb, new Aspect[] {LIFE, DEATH}); - public static final Aspect HEAL = new Aspect("sano",0xff2f34, new Aspect[] {LIFE, ORDER}); - public static final Aspect TRAVEL = new Aspect("iter",0xe0585b, new Aspect[] {MOTION, EARTH}); - public static final Aspect ELDRITCH = new Aspect("alienis",0x805080, new Aspect[] {VOID, DARKNESS}); - public static final Aspect MAGIC = new Aspect("praecantatio",0x9700c0, new Aspect[] {VOID, ENERGY}); - public static final Aspect AURA = new Aspect("auram",0xffc0ff, new Aspect[] {MAGIC, AIR}); - public static final Aspect TAINT = new Aspect("vitium",0x800080, new Aspect[] {MAGIC, ENTROPY}); - public static final Aspect SLIME = new Aspect("limus",0x01f800, new Aspect[] {LIFE, WATER}); - public static final Aspect PLANT = new Aspect("herba",0x01ac00, new Aspect[] {LIFE, EARTH}); - public static final Aspect TREE = new Aspect("arbor",0x876531, new Aspect[] {AIR, PLANT}); - public static final Aspect BEAST = new Aspect("bestia",0x9f6409, new Aspect[] {MOTION, LIFE}); - public static final Aspect FLESH = new Aspect("corpus",0xee478d, new Aspect[] {DEATH, BEAST}); - public static final Aspect UNDEAD = new Aspect("exanimis",0x3a4000, new Aspect[] {MOTION, DEATH}); - public static final Aspect MIND = new Aspect("cognitio",0xffc2b3, new Aspect[] {EARTH, SOUL}); - public static final Aspect SENSES = new Aspect("sensus",0x0fd9ff, new Aspect[] {AIR, SOUL}); - public static final Aspect MAN = new Aspect("humanus",0xffd7c0, new Aspect[] {BEAST, MIND}); - public static final Aspect CROP = new Aspect("messis",0xe1b371, new Aspect[] {PLANT, MAN}); - public static final Aspect MINE = new Aspect("perfodio",0xdcd2d8, new Aspect[] {MAN, EARTH}); - public static final Aspect TOOL = new Aspect("instrumentum",0x4040ee, new Aspect[] {MAN, ORDER}); - public static final Aspect HARVEST = new Aspect("meto",0xeead82, new Aspect[] {CROP, TOOL}); - public static final Aspect WEAPON = new Aspect("telum",0xc05050, new Aspect[] {TOOL, ENTROPY}); - public static final Aspect ARMOR = new Aspect("tutamen",0x00c0c0, new Aspect[] {TOOL, EARTH}); - public static final Aspect HUNGER = new Aspect("fames",0x9a0305, new Aspect[] {LIFE, VOID}); - public static final Aspect GREED = new Aspect("lucrum",0xe6be44, new Aspect[] {MAN, HUNGER}); - public static final Aspect CRAFT = new Aspect("fabrico",0x809d80, new Aspect[] {MAN, TOOL}); - public static final Aspect CLOTH = new Aspect("pannus",0xeaeac2, new Aspect[] {TOOL, BEAST}); - public static final Aspect MECHANISM = new Aspect("machina",0x8080a0, new Aspect[] {MOTION, TOOL}); - public static final Aspect TRAP = new Aspect("vinculum",0x9a8080, new Aspect[] {MOTION, ENTROPY}); - - -} diff --git a/src/api/java/thaumcraft/api/aspects/AspectList.java b/src/api/java/thaumcraft/api/aspects/AspectList.java deleted file mode 100644 index 6b9dfcef..00000000 --- a/src/api/java/thaumcraft/api/aspects/AspectList.java +++ /dev/null @@ -1,256 +0,0 @@ -package thaumcraft.api.aspects; - -import java.io.Serializable; -import java.util.LinkedHashMap; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import thaumcraft.api.ThaumcraftApiHelper; - -public class AspectList implements Serializable { - - public LinkedHashMap aspects = new LinkedHashMap();//aspects associated with this object - - - /** - * this creates a new aspect list with preloaded values based off the aspects of the given item. - * @param the itemstack of the given item - */ - public AspectList(ItemStack stack) { - try { - AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack); - if (temp!=null) - for (Aspect tag:temp.getAspects()) { - add(tag,temp.getAmount(tag)); - } - } catch (Exception e) {} - } - - public AspectList() { - } - - public AspectList copy() { - AspectList out = new AspectList(); - for (Aspect a:this.getAspects()) - out.add(a, this.getAmount(a)); - return out; - } - - /** - * @return the amount of different aspects in this collection - */ - public int size() { - return aspects.size(); - } - - /** - * @return the amount of total vis in this collection - */ - public int visSize() { - int q = 0; - - for (Aspect as:aspects.keySet()) { - q+=this.getAmount(as); - } - - return q; - } - - /** - * @return an array of all the aspects in this collection - */ - public Aspect[] getAspects() { - Aspect[] q = new Aspect[1]; - return aspects.keySet().toArray(q); - } - - /** - * @return an array of all the aspects in this collection - */ - public Aspect[] getPrimalAspects() { - AspectList t = new AspectList(); - for (Aspect as:aspects.keySet()) { - if (as.isPrimal()) { - t.add(as,1); - } - } - Aspect[] q = new Aspect[1]; - return t.aspects.keySet().toArray(q); - } - - /** - * @return an array of all the aspects in this collection sorted by name - */ - public Aspect[] getAspectsSorted() { - try { - Aspect[] out = aspects.keySet().toArray(new Aspect[1]); - boolean change=false; - do { - change=false; - for(int a=0;a0) { - out[a] = e2; - out[a+1] = e1; - change = true; - break; - } - } - } while (change==true); - return out; - } catch (Exception e) { - return this.getAspects(); - } - } - - /** - * @return an array of all the aspects in this collection sorted by amount - */ - public Aspect[] getAspectsSortedAmount() { - try { - Aspect[] out = aspects.keySet().toArray(new Aspect[1]); - boolean change=false; - do { - change=false; - for(int a=0;a0 && e2>0 && e2>e1) { - Aspect ea = out[a]; - Aspect eb = out[a+1]; - out[a] = eb; - out[a+1] = ea; - change = true; - break; - } - } - } while (change==true); - return out; - } catch (Exception e) { - return this.getAspects(); - } - } - - /** - * @param key - * @return the amount associated with the given aspect in this collection - */ - public int getAmount(Aspect key) { - return aspects.get(key)==null?0:aspects.get(key); - } - - /** - * Reduces the amount of an aspect in this collection by the given amount. - * @param key - * @param amount - * @return - */ - public boolean reduce(Aspect key, int amount) { - if (getAmount(key)>=amount) { - int am = getAmount(key)-amount; - aspects.put(key, am); - return true; - } - return false; - } - - /** - * Reduces the amount of an aspect in this collection by the given amount. - * If reduced to 0 or less the aspect will be removed completely. - * @param key - * @param amount - * @return - */ - public AspectList remove(Aspect key, int amount) { - int am = getAmount(key)-amount; - if (am<=0) aspects.remove(key); else - this.aspects.put(key, am); - return this; - } - - /** - * Simply removes the aspect from the list - * @param key - * @param amount - * @return - */ - public AspectList remove(Aspect key) { - aspects.remove(key); - return this; - } - - /** - * Adds this aspect and amount to the collection. - * If the aspect exists then its value will be increased by the given amount. - * @param aspect - * @param amount - * @return - */ - public AspectList add(Aspect aspect, int amount) { - if (this.aspects.containsKey(aspect)) { - int oldamount = this.aspects.get(aspect); - amount+=oldamount; - } - this.aspects.put( aspect, amount ); - return this; - } - - - /** - * Adds this aspect and amount to the collection. - * If the aspect exists then only the highest of the old or new amount will be used. - * @param aspect - * @param amount - * @return - */ - public AspectList merge(Aspect aspect, int amount) { - if (this.aspects.containsKey(aspect)) { - int oldamount = this.aspects.get(aspect); - if (amount0?aspects:null; - } - return null; - } - - @Override - public void setAspects(ItemStack itemstack, AspectList aspects) { - if (!itemstack.hasTagCompound()) itemstack.setTagCompound(new NBTTagCompound()); - aspects.writeToNBT(itemstack.getTagCompound()); - } -*/ \ No newline at end of file diff --git a/src/api/java/thaumcraft/api/aspects/IEssentiaTransport.java b/src/api/java/thaumcraft/api/aspects/IEssentiaTransport.java deleted file mode 100644 index fecbc160..00000000 --- a/src/api/java/thaumcraft/api/aspects/IEssentiaTransport.java +++ /dev/null @@ -1,100 +0,0 @@ -package thaumcraft.api.aspects; - -import net.minecraftforge.common.util.ForgeDirection; - - -/** - * @author Azanor - * This interface is used by tiles that use or transport vis. - * Only tiles that implement this interface will be able to connect to vis conduits or other thaumic devices - */ -public interface IEssentiaTransport { - /** - * Is this tile able to connect to other vis users/sources on the specified side? - * @param face - * @return - */ - public boolean isConnectable(ForgeDirection face); - - /** - * Is this side used to input essentia? - * @param face - * @return - */ - boolean canInputFrom(ForgeDirection face); - - /** - * Is this side used to output essentia? - * @param face - * @return - */ - boolean canOutputTo(ForgeDirection face); - - /** - * Sets the amount of suction this block will apply - * @param suction - */ - public void setSuction(Aspect aspect, int amount); - - /** - * Returns the type of suction this block is applying. - * @param loc - * the location from where the suction is being checked - * @return - * a return type of null indicates the suction is untyped and the first thing available will be drawn - */ - public Aspect getSuctionType(ForgeDirection face); - - /** - * Returns the strength of suction this block is applying. - * @param loc - * the location from where the suction is being checked - * @return - */ - public int getSuctionAmount(ForgeDirection face); - - /** - * remove the specified amount of essentia from this transport tile - * @return how much was actually taken - */ - public int takeEssentia(Aspect aspect, int amount, ForgeDirection face); - - /** - * add the specified amount of essentia to this transport tile - * @return how much was actually added - */ - public int addEssentia(Aspect aspect, int amount, ForgeDirection face); - - /** - * What type of essentia this contains - * @param face - * @return - */ - public Aspect getEssentiaType(ForgeDirection face); - - /** - * How much essentia this block contains - * @param face - * @return - */ - public int getEssentiaAmount(ForgeDirection face); - - - - /** - * Essentia will not be drawn from this container unless the suction exceeds this amount. - * @return the amount - */ - public int getMinimumSuction(); - - /** - * Return true if you want the conduit to extend a little further into the block. - * Used by jars and alembics that have smaller than normal hitboxes - * @return - */ - boolean renderExtendedTube(); - - - -} - diff --git a/src/api/java/thaumcraft/api/crafting/CrucibleRecipe.java b/src/api/java/thaumcraft/api/crafting/CrucibleRecipe.java deleted file mode 100644 index 9c1e8a62..00000000 --- a/src/api/java/thaumcraft/api/crafting/CrucibleRecipe.java +++ /dev/null @@ -1,95 +0,0 @@ -package thaumcraft.api.crafting; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.api.ThaumcraftApiHelper; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; - -public class CrucibleRecipe { - - private ItemStack recipeOutput; - - - public Object catalyst; - public AspectList aspects; - public String key; - - public CrucibleRecipe(String researchKey, ItemStack result, Object cat, AspectList tags) { - recipeOutput = result; - this.aspects = tags; - this.key = researchKey; - this.catalyst = cat; - if (cat instanceof String) { - this.catalyst = OreDictionary.getOres((String) cat); - } - } - - - public boolean matches(AspectList itags, ItemStack cat) { - if (catalyst instanceof ItemStack && - !ThaumcraftApiHelper.itemMatches((ItemStack) catalyst,cat,false)) { - return false; - } else - if (catalyst instanceof ArrayList && ((ArrayList)catalyst).size()>0) { - ItemStack[] ores = ((ArrayList)catalyst).toArray(new ItemStack[]{}); - if (!ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{cat},ores)) return false; - } - if (itags==null) return false; - for (Aspect tag:aspects.getAspects()) { - if (itags.getAmount(tag))catalyst).size()>0) { - ItemStack[] ores = ((ArrayList)catalyst).toArray(new ItemStack[]{}); - if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{cat},ores)) return true; - } - return false; - } - - public AspectList removeMatching(AspectList itags) { - AspectList temptags = new AspectList(); - temptags.aspects.putAll(itags.aspects); - - for (Aspect tag:aspects.getAspects()) { - temptags.remove(tag, aspects.getAmount(tag)); -// if (!temptags.remove(tag, aspects.getAmount(tag))) return null; - } - - itags = temptags; - return itags; - } - - public ItemStack getRecipeOutput() { - return recipeOutput; - } - - -// @Override -// public int hashCode() { -// String hash = ""; -// if (catalyst instanceof ItemStack) { -// hash += ((ItemStack)catalyst).toString(); -// } else if (catalyst instanceof ArrayList && ((ArrayList)catalyst).size()>0) { -// for (ItemStack s:(ArrayList)catalyst) { -// hash += s.toString(); -// } -// } else { -// hash += catalyst.hashCode(); -// } -// hash += getRecipeOutput().toString(); -// for (Aspect a:aspects.getAspectsSorted()) { -// hash += a.getTag() + aspects.getAmount(a); -// } -// return hash.hashCode(); -// } - -} diff --git a/src/api/java/thaumcraft/api/crafting/IArcaneRecipe.java b/src/api/java/thaumcraft/api/crafting/IArcaneRecipe.java deleted file mode 100644 index bb5036d2..00000000 --- a/src/api/java/thaumcraft/api/crafting/IArcaneRecipe.java +++ /dev/null @@ -1,35 +0,0 @@ -package thaumcraft.api.crafting; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import thaumcraft.api.aspects.AspectList; - -public interface IArcaneRecipe -{ - - - /** - * Used to check if a recipe matches current crafting inventory - * @param player - */ - boolean matches(IInventory var1, World world, EntityPlayer player); - - /** - * Returns an Item that is the result of this recipe - */ - ItemStack getCraftingResult(IInventory var1); - - /** - * Returns the size of the recipe area - */ - int getRecipeSize(); - - ItemStack getRecipeOutput(); - AspectList getAspects(); - AspectList getAspects(IInventory var1); - String getResearch(); - - -} diff --git a/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java b/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java deleted file mode 100644 index d137ff24..00000000 --- a/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java +++ /dev/null @@ -1,19 +0,0 @@ -package thaumcraft.api.crafting; - -import net.minecraft.world.World; - -/** - * - * @author Azanor - * - * Blocks that implement this interface act as infusion crafting stabilisers like candles and skulls - * - */ -public interface IInfusionStabiliser { - - /** - * returns true if the block can stabilise things - */ - public boolean canStabaliseInfusion(World world, int x, int y, int z); - -} diff --git a/src/api/java/thaumcraft/api/crafting/InfusionEnchantmentRecipe.java b/src/api/java/thaumcraft/api/crafting/InfusionEnchantmentRecipe.java deleted file mode 100644 index 6fb4d63d..00000000 --- a/src/api/java/thaumcraft/api/crafting/InfusionEnchantmentRecipe.java +++ /dev/null @@ -1,156 +0,0 @@ -package thaumcraft.api.crafting; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Map; - -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.api.ThaumcraftApiHelper; -import thaumcraft.api.aspects.AspectList; - -public class InfusionEnchantmentRecipe -{ - - public AspectList aspects; - public String research; - public ItemStack[] components; - public Enchantment enchantment; - public int recipeXP; - public int instability; - - public InfusionEnchantmentRecipe(String research, Enchantment input, int inst, - AspectList aspects2, ItemStack[] recipe) { - this.research = research; - this.enchantment = input; - this.aspects = aspects2; - this.components = recipe; - this.instability = inst; - this.recipeXP = Math.max(1, input.getMinEnchantability(1)/3); - } - - /** - * Used to check if a recipe matches current crafting inventory - * @param player - */ - public boolean matches(ArrayList input, ItemStack central, World world, EntityPlayer player) { - if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { - return false; - } - - if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) { - return false; - } - - Map map1 = EnchantmentHelper.getEnchantments(central); - Iterator iterator = map1.keySet().iterator(); - while (iterator.hasNext()) - { - int j1 = ((Integer)iterator.next()).intValue(); - Enchantment ench = Enchantment.enchantmentsList[j1]; - if (j1 == enchantment.effectId && - EnchantmentHelper.getEnchantmentLevel(j1, central)>=ench.getMaxLevel()) - return false; - if (enchantment.effectId != ench.effectId && - (!enchantment.canApplyTogether(ench) || - !ench.canApplyTogether(enchantment))) { - return false; - } - } - - ItemStack i2 = null; - - ArrayList ii = new ArrayList(); - for (ItemStack is:input) { - ii.add(is.copy()); - } - - for (ItemStack comp:components) { - boolean b=false; - for (int a=0;a stack0.getMaxStackSize() ? false : t1)); - } - - - public Enchantment getEnchantment() { - return enchantment; - - } - - public AspectList getAspects() { - return aspects; - - } - - public String getResearch() { - return research; - - } - - public int calcInstability(ItemStack recipeInput) { - int i = 0; - Map map1 = EnchantmentHelper.getEnchantments(recipeInput); - Iterator iterator = map1.keySet().iterator(); - while (iterator.hasNext()) - { - int j1 = ((Integer)iterator.next()).intValue(); - i += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput); - } - return (i/2) + instability; - } - - public int calcXP(ItemStack recipeInput) { - return recipeXP * (1+EnchantmentHelper.getEnchantmentLevel(enchantment.effectId, recipeInput)); - } - - public float getEssentiaMod(ItemStack recipeInput) { - float mod = EnchantmentHelper.getEnchantmentLevel(enchantment.effectId, recipeInput); - Map map1 = EnchantmentHelper.getEnchantments(recipeInput); - Iterator iterator = map1.keySet().iterator(); - while (iterator.hasNext()) - { - int j1 = ((Integer)iterator.next()).intValue(); - if (j1 != enchantment.effectId) - mod += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput) * .1f; - } - return mod; - } - -} diff --git a/src/api/java/thaumcraft/api/crafting/InfusionRecipe.java b/src/api/java/thaumcraft/api/crafting/InfusionRecipe.java deleted file mode 100644 index fef0a347..00000000 --- a/src/api/java/thaumcraft/api/crafting/InfusionRecipe.java +++ /dev/null @@ -1,128 +0,0 @@ -package thaumcraft.api.crafting; - -import java.util.ArrayList; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.api.ThaumcraftApiHelper; -import thaumcraft.api.aspects.AspectList; - -public class InfusionRecipe -{ - protected AspectList aspects; - protected String research; - private ItemStack[] components; - private ItemStack recipeInput; - protected Object recipeOutput; - protected int instability; - - public InfusionRecipe(String research, Object output, int inst, - AspectList aspects2, ItemStack input, ItemStack[] recipe) { - this.research = research; - this.recipeOutput = output; - this.recipeInput = input; - this.aspects = aspects2; - this.components = recipe; - this.instability = inst; - } - - /** - * Used to check if a recipe matches current crafting inventory - * @param player - */ - public boolean matches(ArrayList input, ItemStack central, World world, EntityPlayer player) { - if (getRecipeInput()==null) return false; - - if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { - return false; - } - - ItemStack i2 = central.copy(); - if (getRecipeInput().getItemDamage()==OreDictionary.WILDCARD_VALUE) { - i2.setItemDamage(OreDictionary.WILDCARD_VALUE); - } - - if (!areItemStacksEqual(i2, getRecipeInput(), true)) return false; - - ArrayList ii = new ArrayList(); - for (ItemStack is:input) { - ii.add(is.copy()); - } - - for (ItemStack comp:getComponents()) { - boolean b=false; - for (int a=0;a stack0.getMaxStackSize() ? false : t1)); - } - - - public Object getRecipeOutput() { - return getRecipeOutput(this.getRecipeInput()); - } - - public AspectList getAspects() { - return getAspects(this.getRecipeInput()); - } - - public int getInstability() { - return getInstability(this.getRecipeInput()); - } - - public String getResearch() { - return research; - } - - public ItemStack getRecipeInput() { - return recipeInput; - } - - public ItemStack[] getComponents() { - return components; - } - - public Object getRecipeOutput(ItemStack input) { - return recipeOutput; - } - - public AspectList getAspects(ItemStack input) { - return aspects; - } - - public int getInstability(ItemStack input) { - return instability; - } -} diff --git a/src/api/java/thaumcraft/api/crafting/ShapedArcaneRecipe.java b/src/api/java/thaumcraft/api/crafting/ShapedArcaneRecipe.java deleted file mode 100644 index 40c7bc27..00000000 --- a/src/api/java/thaumcraft/api/crafting/ShapedArcaneRecipe.java +++ /dev/null @@ -1,261 +0,0 @@ -package thaumcraft.api.crafting; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.api.ThaumcraftApiHelper; -import thaumcraft.api.aspects.AspectList; - -public class ShapedArcaneRecipe implements IArcaneRecipe -{ - //Added in for future ease of change, but hard coded for now. - private static final int MAX_CRAFT_GRID_WIDTH = 3; - private static final int MAX_CRAFT_GRID_HEIGHT = 3; - - public ItemStack output = null; - public Object[] input = null; - public AspectList aspects = null; - public String research; - public int width = 0; - public int height = 0; - private boolean mirrored = true; - - public ShapedArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); } - public ShapedArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); } - public ShapedArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe) - { - output = result.copy(); - this.research = research; - this.aspects = aspects; - String shape = ""; - - int idx = 0; - - if (recipe[idx] instanceof Boolean) - { - mirrored = (Boolean)recipe[idx]; - if (recipe[idx+1] instanceof Object[]) - { - recipe = (Object[])recipe[idx+1]; - } - else - { - idx = 1; - } - } - - if (recipe[idx] instanceof String[]) - { - String[] parts = ((String[])recipe[idx++]); - - for (String s : parts) - { - width = s.length(); - shape += s; - } - - height = parts.length; - } - else - { - while (recipe[idx] instanceof String) - { - String s = (String)recipe[idx++]; - shape += s; - width = s.length(); - height++; - } - } - - if (width * height != shape.length()) - { - String ret = "Invalid shaped ore recipe: "; - for (Object tmp : recipe) - { - ret += tmp + ", "; - } - ret += output; - throw new RuntimeException(ret); - } - - HashMap itemMap = new HashMap(); - - for (; idx < recipe.length; idx += 2) - { - Character chr = (Character)recipe[idx]; - Object in = recipe[idx + 1]; - - if (in instanceof ItemStack) - { - itemMap.put(chr, ((ItemStack)in).copy()); - } - else if (in instanceof Item) - { - itemMap.put(chr, new ItemStack((Item)in)); - } - else if (in instanceof Block) - { - itemMap.put(chr, new ItemStack((Block)in, 1, OreDictionary.WILDCARD_VALUE)); - } - else if (in instanceof String) - { - itemMap.put(chr, OreDictionary.getOres((String)in)); - } - else - { - String ret = "Invalid shaped ore recipe: "; - for (Object tmp : recipe) - { - ret += tmp + ", "; - } - ret += output; - throw new RuntimeException(ret); - } - } - - input = new Object[width * height]; - int x = 0; - for (char chr : shape.toCharArray()) - { - input[x++] = itemMap.get(chr); - } - } - - @Override - public ItemStack getCraftingResult(IInventory var1){ return output.copy(); } - - @Override - public int getRecipeSize(){ return input.length; } - - @Override - public ItemStack getRecipeOutput(){ return output; } - - @Override - public boolean matches(IInventory inv, World world, EntityPlayer player) - { - if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { - return false; - } - for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++) - { - for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y) - { - if (checkMatch(inv, x, y, false)) - { - return true; - } - - if (mirrored && checkMatch(inv, x, y, true)) - { - return true; - } - } - } - - return false; - } - - private boolean checkMatch(IInventory inv, int startX, int startY, boolean mirror) - { - for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++) - { - for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++) - { - int subX = x - startX; - int subY = y - startY; - Object target = null; - - if (subX >= 0 && subY >= 0 && subX < width && subY < height) - { - if (mirror) - { - target = input[width - subX - 1 + subY * width]; - } - else - { - target = input[subX + subY * width]; - } - } - - ItemStack slot = ThaumcraftApiHelper.getStackInRowAndColumn(inv, x, y); - - if (target instanceof ItemStack) - { - if (!checkItemEquals((ItemStack)target, slot)) - { - return false; - } - } - else if (target instanceof ArrayList) - { - boolean matched = false; - - for (ItemStack item : (ArrayList)target) - { - matched = matched || checkItemEquals(item, slot); - } - - if (!matched) - { - return false; - } - } - else if (target == null && slot != null) - { - return false; - } - } - } - - return true; - } - - private boolean checkItemEquals(ItemStack target, ItemStack input) - { - if (input == null && target != null || input != null && target == null) - { - return false; - } - return (target.getItem() == input.getItem() && - (!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) && - (target.getItemDamage() == OreDictionary.WILDCARD_VALUE|| target.getItemDamage() == input.getItemDamage())); - } - - public ShapedArcaneRecipe setMirrored(boolean mirror) - { - mirrored = mirror; - return this; - } - - /** - * Returns the input for this recipe, any mod accessing this value should never - * manipulate the values in this array as it will effect the recipe itself. - * @return The recipes input vales. - */ - public Object[] getInput() - { - return this.input; - } - - @Override - public AspectList getAspects() { - return aspects; - } - - @Override - public AspectList getAspects(IInventory inv) { - return aspects; - } - - @Override - public String getResearch() { - return research; - } -} diff --git a/src/api/java/thaumcraft/api/crafting/ShapelessArcaneRecipe.java b/src/api/java/thaumcraft/api/crafting/ShapelessArcaneRecipe.java deleted file mode 100644 index 3d4ed508..00000000 --- a/src/api/java/thaumcraft/api/crafting/ShapelessArcaneRecipe.java +++ /dev/null @@ -1,157 +0,0 @@ -package thaumcraft.api.crafting; - -import java.util.ArrayList; -import java.util.Iterator; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.api.ThaumcraftApiHelper; -import thaumcraft.api.aspects.AspectList; - -public class ShapelessArcaneRecipe implements IArcaneRecipe -{ - private ItemStack output = null; - private ArrayList input = new ArrayList(); - - public AspectList aspects = null; - public String research; - - public ShapelessArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); } - public ShapelessArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); } - - public ShapelessArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe) - { - output = result.copy(); - this.research = research; - this.aspects = aspects; - for (Object in : recipe) - { - if (in instanceof ItemStack) - { - input.add(((ItemStack)in).copy()); - } - else if (in instanceof Item) - { - input.add(new ItemStack((Item)in)); - } - else if (in instanceof Block) - { - input.add(new ItemStack((Block)in)); - } - else if (in instanceof String) - { - input.add(OreDictionary.getOres((String)in)); - } - else - { - String ret = "Invalid shapeless ore recipe: "; - for (Object tmp : recipe) - { - ret += tmp + ", "; - } - ret += output; - throw new RuntimeException(ret); - } - } - } - - @Override - public int getRecipeSize(){ return input.size(); } - - @Override - public ItemStack getRecipeOutput(){ return output; } - - @Override - public ItemStack getCraftingResult(IInventory var1){ return output.copy(); } - - @Override - public boolean matches(IInventory var1, World world, EntityPlayer player) - { - if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { - return false; - } - - ArrayList required = new ArrayList(input); - - for (int x = 0; x < 9; x++) - { - ItemStack slot = var1.getStackInSlot(x); - - if (slot != null) - { - boolean inRecipe = false; - Iterator req = required.iterator(); - - while (req.hasNext()) - { - boolean match = false; - - Object next = req.next(); - - if (next instanceof ItemStack) - { - match = checkItemEquals((ItemStack)next, slot); - } - else if (next instanceof ArrayList) - { - for (ItemStack item : (ArrayList)next) - { - match = match || checkItemEquals(item, slot); - } - } - - if (match) - { - inRecipe = true; - required.remove(next); - break; - } - } - - if (!inRecipe) - { - return false; - } - } - } - - return required.isEmpty(); - } - - private boolean checkItemEquals(ItemStack target, ItemStack input) - { - return (target.getItem() == input.getItem() && - (!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) && - (target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage())); - } - - /** - * Returns the input for this recipe, any mod accessing this value should never - * manipulate the values in this array as it will effect the recipe itself. - * @return The recipes input vales. - */ - public ArrayList getInput() - { - return this.input; - } - - @Override - public AspectList getAspects() { - return aspects; - } - - @Override - public AspectList getAspects(IInventory inv) { - return aspects; - } - - @Override - public String getResearch() { - return research; - } -} diff --git a/src/api/java/thaumcraft/api/damagesource/DamageSourceIndirectThaumcraftEntity.java b/src/api/java/thaumcraft/api/damagesource/DamageSourceIndirectThaumcraftEntity.java deleted file mode 100644 index 1562d052..00000000 --- a/src/api/java/thaumcraft/api/damagesource/DamageSourceIndirectThaumcraftEntity.java +++ /dev/null @@ -1,32 +0,0 @@ -package thaumcraft.api.damagesource; - -import net.minecraft.entity.Entity; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSourceIndirect; - -public class DamageSourceIndirectThaumcraftEntity extends EntityDamageSourceIndirect { - - private boolean fireDamage; - private float hungerDamage; - private boolean isUnblockable; - - - public DamageSourceIndirectThaumcraftEntity(String par1Str, - Entity par2Entity, Entity par3Entity) { - super(par1Str, par2Entity, par3Entity); - } - - - public DamageSource setFireDamage() - { - this.fireDamage = true; - return this; - } - - public DamageSource setDamageBypassesArmor() - { - this.isUnblockable = true; - this.hungerDamage = 0.0F; - return this; - } -} diff --git a/src/api/java/thaumcraft/api/damagesource/DamageSourceThaumcraft.java b/src/api/java/thaumcraft/api/damagesource/DamageSourceThaumcraft.java deleted file mode 100644 index 7c277f28..00000000 --- a/src/api/java/thaumcraft/api/damagesource/DamageSourceThaumcraft.java +++ /dev/null @@ -1,46 +0,0 @@ -package thaumcraft.api.damagesource; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSource; - -public class DamageSourceThaumcraft extends DamageSource -{ - - public static DamageSource taint = new DamageSourceThaumcraft("taint").setDamageBypassesArmor().setMagicDamage(); - public static DamageSource tentacle = new DamageSourceThaumcraft("tentacle"); - public static DamageSource swarm = new DamageSourceThaumcraft("swarm"); - - protected DamageSourceThaumcraft(String par1Str) { - super(par1Str); - } - - /** This kind of damage can be blocked or not. */ - private boolean isUnblockable = false; - private boolean isDamageAllowedInCreativeMode = false; - private float hungerDamage = 0.3F; - - /** This kind of damage is based on fire or not. */ - private boolean fireDamage; - - /** This kind of damage is based on a projectile or not. */ - private boolean projectile; - - /** - * Whether this damage source will have its damage amount scaled based on the current difficulty. - */ - private boolean difficultyScaled; - private boolean magicDamage = false; - private boolean explosion = false; - - public static DamageSource causeSwarmDamage(EntityLivingBase par0EntityLiving) - { - return new EntityDamageSource("swarm", par0EntityLiving); - } - - public static DamageSource causeTentacleDamage(EntityLivingBase par0EntityLiving) - { - return new EntityDamageSource("tentacle", par0EntityLiving); - } - -} diff --git a/src/api/java/thaumcraft/api/entities/ITaintedMob.java b/src/api/java/thaumcraft/api/entities/ITaintedMob.java deleted file mode 100644 index 83fb1fcb..00000000 --- a/src/api/java/thaumcraft/api/entities/ITaintedMob.java +++ /dev/null @@ -1,5 +0,0 @@ -package thaumcraft.api.entities; - -public interface ITaintedMob { - -} diff --git a/src/api/java/thaumcraft/api/nodes/INode.java b/src/api/java/thaumcraft/api/nodes/INode.java deleted file mode 100644 index 8c71414d..00000000 --- a/src/api/java/thaumcraft/api/nodes/INode.java +++ /dev/null @@ -1,53 +0,0 @@ -package thaumcraft.api.nodes; - -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.aspects.IAspectContainer; - -public interface INode extends IAspectContainer { - - /** - * Unique identifier to distinguish nodes. Normal node id's are based on world id and coordinates - * @return - */ - public String getId(); - - public AspectList getAspectsBase(); - - /** - * Return the type of node - * @return - */ - public NodeType getNodeType(); - - /** - * Set the type of node - * @return - */ - public void setNodeType(NodeType nodeType); - - /** - * Return the node modifier - * @return - */ - public void setNodeModifier(NodeModifier nodeModifier); - - /** - * Set the node modifier - * @return - */ - public NodeModifier getNodeModifier(); - - /** - * Return the maximum capacity of each aspect the node can hold - * @return - */ - public int getNodeVisBase(Aspect aspect); - - /** - * Set the maximum capacity of each aspect the node can hold - * @return - */ - public void setNodeVisBase(Aspect aspect, short nodeVisBase); - -} diff --git a/src/api/java/thaumcraft/api/nodes/IRevealer.java b/src/api/java/thaumcraft/api/nodes/IRevealer.java deleted file mode 100644 index 14a19b54..00000000 --- a/src/api/java/thaumcraft/api/nodes/IRevealer.java +++ /dev/null @@ -1,22 +0,0 @@ -package thaumcraft.api.nodes; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * - * @author Azanor - * - * Equipped head slot items that extend this class will make nodes visible in world. - * - */ - -public interface IRevealer { - - /* - * If this method returns true the nodes will be visible. - */ - public boolean showNodes(ItemStack itemstack, EntityLivingBase player); - - -} diff --git a/src/api/java/thaumcraft/api/nodes/NodeModifier.java b/src/api/java/thaumcraft/api/nodes/NodeModifier.java deleted file mode 100644 index 885b8678..00000000 --- a/src/api/java/thaumcraft/api/nodes/NodeModifier.java +++ /dev/null @@ -1,6 +0,0 @@ -package thaumcraft.api.nodes; - -public enum NodeModifier -{ - BRIGHT, PALE, FADING -} \ No newline at end of file diff --git a/src/api/java/thaumcraft/api/nodes/NodeType.java b/src/api/java/thaumcraft/api/nodes/NodeType.java deleted file mode 100644 index 355324b5..00000000 --- a/src/api/java/thaumcraft/api/nodes/NodeType.java +++ /dev/null @@ -1,6 +0,0 @@ -package thaumcraft.api.nodes; - -public enum NodeType -{ - NORMAL, UNSTABLE, DARK, TAINTED, HUNGRY, PURE -} \ No newline at end of file diff --git a/src/api/java/thaumcraft/api/package-info.java b/src/api/java/thaumcraft/api/package-info.java deleted file mode 100644 index 0de39267..00000000 --- a/src/api/java/thaumcraft/api/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(owner = "Thaumcraft", apiVersion = "4.2.0.0", provides = "Thaumcraft|API") -package thaumcraft.api; - -import cpw.mods.fml.common.API; diff --git a/src/api/java/thaumcraft/api/potions/PotionFluxTaint.java b/src/api/java/thaumcraft/api/potions/PotionFluxTaint.java deleted file mode 100644 index b718de4b..00000000 --- a/src/api/java/thaumcraft/api/potions/PotionFluxTaint.java +++ /dev/null @@ -1,67 +0,0 @@ -package thaumcraft.api.potions; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import thaumcraft.api.damagesource.DamageSourceThaumcraft; -import thaumcraft.api.entities.ITaintedMob; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionFluxTaint extends Potion -{ - public static PotionFluxTaint instance = null; // will be instantiated at runtime - private int statusIconIndex = -1; - - public PotionFluxTaint(int par1, boolean par2, int par3) - { - super(par1,par2,par3); - setIconIndex(0, 0); - } - - public static void init() - { - instance.setPotionName("potion.fluxtaint"); - instance.setIconIndex(3, 1); - instance.setEffectiveness(0.25D); - } - - @Override - public boolean isBadEffect() { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft.getMinecraft().renderEngine.bindTexture(rl); - return super.getStatusIconIndex(); - } - - ResourceLocation rl = new ResourceLocation("thaumcraft","textures/misc/potions.png"); - - @Override - public void performEffect(EntityLivingBase target, int par2) { - if (target instanceof ITaintedMob) { - target.heal(1); - } else - if (!target.isEntityUndead() && !(target instanceof EntityPlayer)) - { - target.attackEntityFrom(DamageSourceThaumcraft.taint, 1); - } - else - if (!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer))) - { - target.attackEntityFrom(DamageSourceThaumcraft.taint, 1); - } - } - - public boolean isReady(int par1, int par2) - { - int k = 40 >> par2; - return k > 0 ? par1 % k == 0 : true; - } - -} diff --git a/src/api/java/thaumcraft/api/research/IScanEventHandler.java b/src/api/java/thaumcraft/api/research/IScanEventHandler.java deleted file mode 100644 index d0efac5f..00000000 --- a/src/api/java/thaumcraft/api/research/IScanEventHandler.java +++ /dev/null @@ -1,9 +0,0 @@ -package thaumcraft.api.research; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface IScanEventHandler { - ScanResult scanPhenomena(ItemStack stack, World world, EntityPlayer player); -} diff --git a/src/api/java/thaumcraft/api/research/ResearchCategories.java b/src/api/java/thaumcraft/api/research/ResearchCategories.java deleted file mode 100644 index 82309b36..00000000 --- a/src/api/java/thaumcraft/api/research/ResearchCategories.java +++ /dev/null @@ -1,101 +0,0 @@ -package thaumcraft.api.research; - -import java.util.Collection; -import java.util.LinkedHashMap; - -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.apache.logging.log4j.Level; - -import cpw.mods.fml.common.FMLLog; - -public class ResearchCategories { - - //Research - public static LinkedHashMap researchCategories = new LinkedHashMap (); - - /** - * @param key - * @return the research item linked to this key - */ - public static ResearchCategoryList getResearchList(String key) { - return researchCategories.get(key); - } - - /** - * @param key - * @return the name of the research category linked to this key. - * Must be stored as localization information in the LanguageRegistry. - */ - public static String getCategoryName(String key) { - return StatCollector.translateToLocal("tc.research_category."+key); - } - - /** - * @param key the research key - * @return the ResearchItem object. - */ - public static ResearchItem getResearch(String key) { - Collection rc = researchCategories.values(); - for (Object cat:rc) { - Collection rl = ((ResearchCategoryList)cat).research.values(); - for (Object ri:rl) { - if ((((ResearchItem)ri).key).equals(key)) return (ResearchItem)ri; - } - } - return null; - } - - /** - * This should only be done at the PostInit stage - * @param key the key used for this category - * @param icon the icon to be used for the research category tab - * @param background the resource location of the background image to use for this category - * @return the name of the research linked to this key - */ - public static void registerCategory(String key, ResourceLocation icon, ResourceLocation background) { - if (getResearchList(key)==null) { - ResearchCategoryList rl = new ResearchCategoryList(icon, background); - researchCategories.put(key, rl); - } - } - - public static void addResearch(ResearchItem ri) { - ResearchCategoryList rl = getResearchList(ri.category); - if (rl!=null && !rl.research.containsKey(ri.key)) { - - if (!ri.isVirtual()) { - for (ResearchItem rr:rl.research.values()) { - if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) { - FMLLog.log(Level.FATAL, "[Thaumcraft] Research ["+ri.getName()+"] not added as it overlaps with existing research ["+rr.getName()+"]"); - return; - } - } - } - - - rl.research.put(ri.key, ri); - - if (ri.displayColumn < rl.minDisplayColumn) - { - rl.minDisplayColumn = ri.displayColumn; - } - - if (ri.displayRow < rl.minDisplayRow) - { - rl.minDisplayRow = ri.displayRow; - } - - if (ri.displayColumn > rl.maxDisplayColumn) - { - rl.maxDisplayColumn = ri.displayColumn; - } - - if (ri.displayRow > rl.maxDisplayRow) - { - rl.maxDisplayRow = ri.displayRow; - } - } - } -} diff --git a/src/api/java/thaumcraft/api/research/ResearchCategoryList.java b/src/api/java/thaumcraft/api/research/ResearchCategoryList.java deleted file mode 100644 index 7eed0101..00000000 --- a/src/api/java/thaumcraft/api/research/ResearchCategoryList.java +++ /dev/null @@ -1,37 +0,0 @@ -package thaumcraft.api.research; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.util.ResourceLocation; - -public class ResearchCategoryList { - - /** Is the smallest column used on the GUI. */ - public int minDisplayColumn; - - /** Is the smallest row used on the GUI. */ - public int minDisplayRow; - - /** Is the biggest column used on the GUI. */ - public int maxDisplayColumn; - - /** Is the biggest row used on the GUI. */ - public int maxDisplayRow; - - /** display variables **/ - public ResourceLocation icon; - public ResourceLocation background; - - public ResearchCategoryList(ResourceLocation icon, ResourceLocation background) { - this.icon = icon; - this.background = background; - } - - //Research - public Map research = new HashMap(); - - - - -} diff --git a/src/api/java/thaumcraft/api/research/ResearchItem.java b/src/api/java/thaumcraft/api/research/ResearchItem.java deleted file mode 100644 index 55b3820c..00000000 --- a/src/api/java/thaumcraft/api/research/ResearchItem.java +++ /dev/null @@ -1,367 +0,0 @@ -package thaumcraft.api.research; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; - -public class ResearchItem -{ - /** - * A short string used as a key for this research. Must be unique - */ - public final String key; - - /** - * A short string used as a reference to the research category to which this must be added. - */ - public final String category; - - /** - * The aspect tags and their values required to complete this research - */ - public final AspectList tags; - - /** - * This links to any research that needs to be completed before this research can be discovered or learnt. - */ - public String[] parents = null; - - /** - * Like parent above, but a line will not be displayed in the thaumonomicon linking them. Just used to prevent clutter. - */ - public String[] parentsHidden = null; - /** - * any research linked to this that will be unlocked automatically when this research is complete - */ - public String[] siblings = null; - - /** - * the horizontal position of the research icon - */ - public final int displayColumn; - - /** - * the vertical position of the research icon - */ - public final int displayRow; - - /** - * the icon to be used for this research - */ - public final ItemStack icon_item; - - /** - * the icon to be used for this research - */ - public final ResourceLocation icon_resource; - - /** - * How large the research grid is. Valid values are 1 to 3. - */ - private int complexity; - - /** - * Special research has a spiky border. Used for important research milestones. - */ - private boolean isSpecial; - - /** - * Research that can be directly purchased with RP in normal research difficulty. - */ - private boolean isSecondary; - - /** - * This indicates if the research should use a circular icon border. Usually used for "passive" research - * that doesn't have recipes and grants passive effects, or that unlock automatically. - */ - private boolean isRound; - - /** - * Stub research cannot be discovered by normal means, but can be unlocked via the sibling system. - */ - private boolean isStub; - - /** - * This indicated that the research is completely hidden and cannot be discovered by any - * player-controlled means. The recipes will never show up in the thaumonomicon. - * Usually used to unlock "hidden" recipes via sibling unlocking, like - * the various cap and rod combos for wands. - */ - private boolean isVirtual; - - @Deprecated - private boolean isLost; - - /** - * Concealed research does not display in the thaumonomicon until parent researches are discovered. - */ - private boolean isConcealed; - - /** - * Hidden research can only be discovered via scanning or knowledge fragments - */ - private boolean isHidden; - - /** - * These research items will automatically unlock for all players on game start - */ - private boolean isAutoUnlock; - - /** - * Scanning these items will have a chance of revealing hidden knowledge in the thaumonomicon - */ - private ItemStack[] itemTriggers; - - /** - * Scanning these entities will have a chance of revealing hidden knowledge in the thaumonomicon - */ - private String[] entityTriggers; - - /** - * Scanning things with these aspects will have a chance of revealing hidden knowledge in the thaumonomicon - */ - private Aspect[] aspectTriggers; - - private ResearchPage[] pages = null; - - public ResearchItem(String key, String category) - { - this.key = key; - this.category = category; - this.tags = new AspectList(); - this.icon_resource = null; - this.icon_item = null; - this.displayColumn = 0; - this.displayRow = 0; - this.setVirtual(); - - } - - public ResearchItem(String key, String category, AspectList tags, int col, int row, int complex, ResourceLocation icon) - { - this.key = key; - this.category = category; - this.tags = tags; - this.icon_resource = icon; - this.icon_item = null; - this.displayColumn = col; - this.displayRow = row; - this.complexity = complex; - if (complexity < 1) this.complexity = 1; - if (complexity > 3) this.complexity = 3; - } - - public ResearchItem(String key, String category, AspectList tags, int col, int row, int complex, ItemStack icon) - { - this.key = key; - this.category = category; - this.tags = tags; - this.icon_item = icon; - this.icon_resource = null; - this.displayColumn = col; - this.displayRow = row; - this.complexity = complex; - if (complexity < 1) this.complexity = 1; - if (complexity > 3) this.complexity = 3; - } - - public ResearchItem setSpecial() - { - this.isSpecial = true; - return this; - } - - public ResearchItem setStub() - { - this.isStub = true; - return this; - } - - @Deprecated - public ResearchItem setLost() - { - this.isLost = true; - return this; - } - - public ResearchItem setConcealed() - { - this.isConcealed = true; - return this; - } - - public ResearchItem setHidden() - { - this.isHidden = true; - return this; - } - - public ResearchItem setVirtual() - { - this.isVirtual = true; - return this; - } - - public ResearchItem setParents(String... par) - { - this.parents = par; - return this; - } - - - - public ResearchItem setParentsHidden(String... par) - { - this.parentsHidden = par; - return this; - } - - public ResearchItem setSiblings(String... sib) - { - this.siblings = sib; - return this; - } - - public ResearchItem setPages(ResearchPage... par) - { - this.pages = par; - return this; - } - - public ResearchPage[] getPages() { - return pages; - } - - public ResearchItem setItemTriggers(ItemStack... par) - { - this.itemTriggers = par; - return this; - } - - public ResearchItem setEntityTriggers(String... par) - { - this.entityTriggers = par; - return this; - } - - public ResearchItem setAspectTriggers(Aspect... par) - { - this.aspectTriggers = par; - return this; - } - - public ItemStack[] getItemTriggers() { - return itemTriggers; - } - - public String[] getEntityTriggers() { - return entityTriggers; - } - - public Aspect[] getAspectTriggers() { - return aspectTriggers; - } - - public ResearchItem registerResearchItem() - { - ResearchCategories.addResearch(this); - return this; - } - - public String getName() - { - return StatCollector.translateToLocal("tc.research_name."+key); - } - - public String getText() - { - return StatCollector.translateToLocal("tc.research_text."+key); - } - - public boolean isSpecial() - { - return this.isSpecial; - } - - public boolean isStub() - { - return this.isStub; - } - - @Deprecated - public boolean isLost() - { - return this.isLost; - } - - public boolean isConcealed() - { - return this.isConcealed; - } - - public boolean isHidden() - { - return this.isHidden; - } - - public boolean isVirtual() - { - return this.isVirtual; - } - - public boolean isAutoUnlock() { - return isAutoUnlock; - } - - public ResearchItem setAutoUnlock() - { - this.isAutoUnlock = true; - return this; - } - - public boolean isRound() { - return isRound; - } - - public ResearchItem setRound() { - this.isRound = true; - return this; - } - - public boolean isSecondary() { - return isSecondary; - } - - public ResearchItem setSecondary() { - this.isSecondary = true; - return this; - } - - public int getComplexity() { - return complexity; - } - - public ResearchItem setComplexity(int complexity) { - this.complexity = complexity; - return this; - } - - /** - * @return the aspect aspects ordinal with the highest value. Used to determine scroll color and similar things - */ - public Aspect getResearchPrimaryTag() { - Aspect aspect=null; - int highest=0; - if (tags!=null) - for (Aspect tag:tags.getAspects()) { - if (tags.getAmount(tag)>highest) { - aspect=tag; - highest=tags.getAmount(tag); - }; - } - return aspect; - } - -} diff --git a/src/api/java/thaumcraft/api/research/ResearchPage.java b/src/api/java/thaumcraft/api/research/ResearchPage.java deleted file mode 100644 index fdada843..00000000 --- a/src/api/java/thaumcraft/api/research/ResearchPage.java +++ /dev/null @@ -1,193 +0,0 @@ -package thaumcraft.api.research; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.crafting.CrucibleRecipe; -import thaumcraft.api.crafting.IArcaneRecipe; -import thaumcraft.api.crafting.InfusionEnchantmentRecipe; -import thaumcraft.api.crafting.InfusionRecipe; - -public class ResearchPage { - public static enum PageType - { - TEXT, - TEXT_CONCEALED, - IMAGE, - CRUCIBLE_CRAFTING, - ARCANE_CRAFTING, - ASPECTS, - NORMAL_CRAFTING, - INFUSION_CRAFTING, - COMPOUND_CRAFTING, - INFUSION_ENCHANTMENT, - SMELTING - } - - public PageType type = PageType.TEXT; - - public String text=null; - public String research=null; - public ResourceLocation image=null; - public AspectList aspects=null; - public Object recipe=null; - public ItemStack recipeOutput=null; - - /** - * @param text this can (but does not have to) be a reference to a localization variable, not the actual text. - */ - public ResearchPage(String text) { - this.type = PageType.TEXT; - this.text = text; - } - - /** - * @param research this page will only be displayed if the player has discovered this research - * @param text this can (but does not have to) be a reference to a localization variable, not the actual text. - */ - public ResearchPage(String research, String text) { - this.type = PageType.TEXT_CONCEALED; - this.research = research; - this.text = text; - } - - /** - * @param recipe a vanilla crafting recipe. - */ - public ResearchPage(IRecipe recipe) { - this.type = PageType.NORMAL_CRAFTING; - this.recipe = recipe; - this.recipeOutput = recipe.getRecipeOutput(); - } - - /** - * @param recipe a collection of vanilla crafting recipes. - */ - public ResearchPage(IRecipe[] recipe) { - this.type = PageType.NORMAL_CRAFTING; - this.recipe = recipe; - } - - /** - * @param recipe a collection of arcane crafting recipes. - */ - public ResearchPage(IArcaneRecipe[] recipe) { - this.type = PageType.ARCANE_CRAFTING; - this.recipe = recipe; - } - - /** - * @param recipe a collection of arcane crafting recipes. - */ - public ResearchPage(CrucibleRecipe[] recipe) { - this.type = PageType.CRUCIBLE_CRAFTING; - this.recipe = recipe; - } - - /** - * @param recipe a collection of infusion crafting recipes. - */ - public ResearchPage(InfusionRecipe[] recipe) { - this.type = PageType.INFUSION_CRAFTING; - this.recipe = recipe; - } - - /** - * @param recipe a compound crafting recipe. - */ - public ResearchPage(List recipe) { - this.type = PageType.COMPOUND_CRAFTING; - this.recipe = recipe; - } - - /** - * @param recipe an arcane worktable crafting recipe. - */ - public ResearchPage(IArcaneRecipe recipe) { - this.type = PageType.ARCANE_CRAFTING; - this.recipe = recipe; - this.recipeOutput = recipe.getRecipeOutput(); - } - - /** - * @param recipe an alchemy crafting recipe. - */ - public ResearchPage(CrucibleRecipe recipe) { - this.type = PageType.CRUCIBLE_CRAFTING; - this.recipe = recipe; - this.recipeOutput = recipe.getRecipeOutput(); - } - - /** - * @param recipe a furnace smelting crafting recipe. - */ - public ResearchPage(ItemStack input) { - this.type = PageType.SMELTING; - this.recipe = input; - this.recipeOutput = FurnaceRecipes.smelting().getSmeltingResult(input); - } - - /** - * @param recipe an infusion crafting recipe. - */ - public ResearchPage(InfusionRecipe recipe) { - this.type = PageType.INFUSION_CRAFTING; - this.recipe = recipe; - if (recipe.getRecipeOutput() instanceof ItemStack) { - this.recipeOutput = (ItemStack) recipe.getRecipeOutput(); - } else { - this.recipeOutput = recipe.getRecipeInput(); - } - } - - /** - * @param recipe an infusion crafting recipe. - */ - public ResearchPage(InfusionEnchantmentRecipe recipe) { - this.type = PageType.INFUSION_ENCHANTMENT; - this.recipe = recipe; -// if (recipe.recipeOutput instanceof ItemStack) { -// this.recipeOutput = (ItemStack) recipe.recipeOutput; -// } else { -// this.recipeOutput = recipe.recipeInput; -// } - } - - /** - * @param image - * @param caption this can (but does not have to) be a reference to a localization variable, not the actual text. - */ - public ResearchPage(ResourceLocation image, String caption) { - this.type = PageType.IMAGE; - this.image = image; - this.text = caption; - } - - /** - * This function should really not be called directly - used internally - */ - public ResearchPage(AspectList as) { - this.type = PageType.ASPECTS; - this.aspects = as; - } - - /** - * returns a localized text of the text field (if one exists). Returns the text field itself otherwise. - * @return - */ - public String getTranslatedText() { - String ret=""; - if (text != null) { - ret = StatCollector.translateToLocal(text); - if (ret.isEmpty()) ret = text; - } - return ret; - } - - -} diff --git a/src/api/java/thaumcraft/api/research/ScanResult.java b/src/api/java/thaumcraft/api/research/ScanResult.java deleted file mode 100644 index e1498f31..00000000 --- a/src/api/java/thaumcraft/api/research/ScanResult.java +++ /dev/null @@ -1,39 +0,0 @@ -package thaumcraft.api.research; - -import net.minecraft.entity.Entity; - -public class ScanResult { - public byte type = 0; //1=blocks,2=entities,3=phenomena - public int id; - public int meta; - public Entity entity; - public String phenomena; - - public ScanResult(byte type, int blockId, int blockMeta, Entity entity, - String phenomena) { - super(); - this.type = type; - this.id = blockId; - this.meta = blockMeta; - this.entity = entity; - this.phenomena = phenomena; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof ScanResult) { - ScanResult sr = (ScanResult) obj; - if (type != sr.type) - return false; - if (type == 1 - && (id != sr.id || meta != sr.meta)) - return false; - if (type == 2 && entity.getEntityId() != sr.entity.getEntityId()) - return false; - if (type == 3 && !phenomena.equals(sr.phenomena)) - return false; - } - return true; - } - -} diff --git a/src/api/java/thaumcraft/api/visnet/TileVisNode.java b/src/api/java/thaumcraft/api/visnet/TileVisNode.java deleted file mode 100644 index 84b1400d..00000000 --- a/src/api/java/thaumcraft/api/visnet/TileVisNode.java +++ /dev/null @@ -1,188 +0,0 @@ -package thaumcraft.api.visnet; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.HashMap; - -import thaumcraft.api.TileThaumcraft; -import thaumcraft.api.WorldCoordinates; -import thaumcraft.api.aspects.Aspect; - -/** - * @author Azanor - * - * The tile entity used by nodes in the vis energy network. A node is either a source (like an aura node), - * a transport relay or vis receiver (like the infernal furnace). - * - */ -public abstract class TileVisNode extends TileThaumcraft { - - WeakReference parent = null; - ArrayList> children = new ArrayList>(); - - /** - * @return the WorldCoordinates location of where this node is located - */ - public WorldCoordinates getLocation() { - return new WorldCoordinates(this); - } - - /** - * @return the number of blocks away this node will check for parent nodes to connect to. - */ - public abstract int getRange(); - - /** - * @return true if this is the source or root node of the vis network. - */ - public abstract boolean isSource(); - - /** - * This method should never be called directly. Use VisNetHandler.drainVis() instead - * @param aspect what aspect to drain - * @param vis how much to drain - * @return how much was actually drained - */ - public int consumeVis(Aspect aspect, int vis) { - if (VisNetHandler.isNodeValid(getParent())) { - int out = getParent().get().consumeVis(aspect, vis); - if (out>0) { - triggerConsumeEffect(aspect); - } - return out; - } - return 0; - } - - public void removeThisNode() { - for (WeakReference n:getChildren()) { - if (n!=null && n.get()!=null) { - n.get().removeThisNode(); - } - } - - children = new ArrayList>(); - if (VisNetHandler.isNodeValid(this.getParent())) { - this.getParent().get().nodeRefresh=true; - } - this.setParent(null); - this.parentChanged(); - - if (this.isSource()) { - HashMap> sourcelist = VisNetHandler.sources.get(worldObj.provider.dimensionId); - if (sourcelist==null) { - sourcelist = new HashMap>(); - } - sourcelist.remove(getLocation()); - VisNetHandler.sources.put( worldObj.provider.dimensionId, sourcelist ); - } - - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - - - @Override - public void invalidate() { - removeThisNode(); - super.invalidate(); - } - - public void triggerConsumeEffect(Aspect aspect) { } - - /** - * @return - */ - public WeakReference getParent() { - return parent; - } - - /** - * @return - */ - public WeakReference getRootSource() { - return VisNetHandler.isNodeValid(getParent()) ? - getParent().get().getRootSource() : this.isSource() ? - new WeakReference(this) : null; - } - - /** - * @param parent - */ - public void setParent(WeakReference parent) { - this.parent = parent; - } - - /** - * @return - */ - public ArrayList> getChildren() { - return children; - } - - @Override - public boolean canUpdate() { - return true; - } - - protected int nodeCounter = 0; - private boolean nodeRegged = false; - public boolean nodeRefresh = false; - - @Override - public void updateEntity() { - - if (!worldObj.isRemote && ((nodeCounter++) % 40==0 || nodeRefresh)) { - //check for changes - if (!nodeRefresh && children.size()>0) { - for (WeakReference n:children) { - if (n==null || n.get()==null) { - nodeRefresh=true; - break; - } - } - } - - //refresh linked nodes - if (nodeRefresh) { - for (WeakReference n:children) { - if (n.get()!=null) { - n.get().nodeRefresh=true; - } - } - children.clear(); - parent=null; - } - - //redo stuff - if (isSource() && !nodeRegged) { - VisNetHandler.addSource(getWorldObj(), this); - nodeRegged = true; - } else - if (!isSource() && !VisNetHandler.isNodeValid(getParent())) { - setParent(VisNetHandler.addNode(getWorldObj(), this)); - nodeRefresh=true; - } - - if (nodeRefresh) { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - parentChanged(); - } - nodeRefresh=false; - } - - } - - public void parentChanged() { } - - /** - * @return the type of shard this is attuned to: - * none -1, air 0, fire 1, water 2, earth 3, order 4, entropy 5 - * Should return -1 for most implementations - */ - public byte getAttunement() { - return -1; - } - - -} diff --git a/src/api/java/thaumcraft/api/visnet/VisNetHandler.java b/src/api/java/thaumcraft/api/visnet/VisNetHandler.java deleted file mode 100644 index 23e01ccf..00000000 --- a/src/api/java/thaumcraft/api/visnet/VisNetHandler.java +++ /dev/null @@ -1,284 +0,0 @@ -package thaumcraft.api.visnet; - -import java.lang.ref.WeakReference; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.world.World; -import thaumcraft.api.WorldCoordinates; -import thaumcraft.api.aspects.Aspect; -import cpw.mods.fml.common.FMLLog; - -public class VisNetHandler { - - // / NODE DRAINING - /** - * This method drains vis from a relay or source near the passed in - * location. The amount received can be less than the amount requested so - * take that into account. - * - * @param world - * @param x the x position of the draining block or entity - * @param y the y position of the draining block or entity - * @param z the z position of the draining block or entity - * @param aspect what aspect to drain - * @param vis how much to drain - * @return how much was actually drained - */ - public static int drainVis(World world, int x, int y, int z, Aspect aspect, int amount) { - - int drainedAmount = 0; - - WorldCoordinates drainer = new WorldCoordinates(x, y, z, - world.provider.dimensionId); - if (!nearbyNodes.containsKey(drainer)) { - calculateNearbyNodes(world, x, y, z); - } - - ArrayList> nodes = nearbyNodes.get(drainer); - if (nodes!=null && nodes.size()>0) - for (WeakReference noderef : nodes) { - - TileVisNode node = noderef.get(); - - if (node == null) continue; - - int a = node.consumeVis(aspect, amount); - drainedAmount += a; - amount -= a; - if (a>0) { - int color = Aspect.getPrimalAspects().indexOf(aspect); - generateVisEffect(world.provider.dimensionId, x, y, z, node.xCoord, node.yCoord, node.zCoord, color); - } - if (amount <= 0) { - break; - } - } - - return drainedAmount; - } - - static Method generateVisEffect; - public static void generateVisEffect(int dim, int x, int y, int z, int x2, int y2, int z2, int color) { - try { - if(generateVisEffect == null) { - Class fake = Class.forName("thaumcraft.common.lib.Utils"); - generateVisEffect = fake.getMethod("generateVisEffect", int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class); - } - generateVisEffect.invoke(null, dim, x,y,z,x2,y2,z2,color); - } catch(Exception ex) { - FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.Utils method generateVisEffect"); - } - } - - public static HashMap>> sources = new HashMap>>(); - - public static void addSource(World world, TileVisNode vs) { - HashMap> sourcelist = sources - .get(world.provider.dimensionId); - if (sourcelist == null) { - sourcelist = new HashMap>(); - } - sourcelist.put(vs.getLocation(), new WeakReference(vs)); - sources.put(world.provider.dimensionId, sourcelist); - nearbyNodes.clear(); - } - - public static boolean isNodeValid(WeakReference node) { - if (node == null || node.get() == null || node.get().isInvalid()) - return false; - return true; - } - - public static WeakReference addNode(World world, TileVisNode vn) { - WeakReference ref = new WeakReference(vn); - - HashMap> sourcelist = sources - .get(world.provider.dimensionId); - if (sourcelist == null) { - sourcelist = new HashMap>(); - return null; - } - - ArrayList nearby = new ArrayList(); - - for (WeakReference root : sourcelist.values()) { - if (!isNodeValid(root)) - continue; - - TileVisNode source = root.get(); - - float r = inRange(world, vn.getLocation(), source.getLocation(), - vn.getRange()); - if (r > 0) { - nearby.add(new Object[] { source, r - vn.getRange() * 2 }); - } - nearby = findClosestNodes(vn, source, nearby); - } - - float dist = Float.MAX_VALUE; - TileVisNode closest = null; - if (nearby.size() > 0) { - for (Object[] o : nearby) { - if ((Float) o[1] < dist) {// && canNodeBeSeen(vn,(TileVisNode) - // o[0])) { - dist = (Float) o[1]; - closest = (TileVisNode) o[0]; - } - } - } - if (closest != null) { - closest.getChildren().add(ref); - nearbyNodes.clear(); - return new WeakReference(closest); - } - - return null; - } - - public static ArrayList findClosestNodes(TileVisNode target, - TileVisNode root, ArrayList in) { - TileVisNode closestChild = null; - - for (WeakReference child : root.getChildren()) { - TileVisNode n = child.get(); - - if (n != null - && !n.equals(target) - && !n.equals(root) - && (target.getAttunement() == -1 || n.getAttunement() == -1 || n - .getAttunement() == target.getAttunement())) { - - float r2 = inRange(n.getWorldObj(), n.getLocation(), - target.getLocation(), target.getRange()); - if (r2 > 0) { - in.add(new Object[] { n, r2 }); - } - - in = findClosestNodes(target, n, in); - } - } - return in; - } - - private static float inRange(World world, WorldCoordinates cc1, - WorldCoordinates cc2, int range) { - float distance = cc1.getDistanceSquaredToWorldCoordinates(cc2); - return distance > range * range ? -1 : distance; - } - - private static HashMap>> nearbyNodes = new HashMap>>(); - - private static void calculateNearbyNodes(World world, int x, int y, int z) { - - HashMap> sourcelist = sources - .get(world.provider.dimensionId); - if (sourcelist == null) { - sourcelist = new HashMap>(); - return; - } - - ArrayList> cn = new ArrayList>(); - WorldCoordinates drainer = new WorldCoordinates(x, y, z, - world.provider.dimensionId); - - ArrayList nearby = new ArrayList(); - - for (WeakReference root : sourcelist.values()) { - - if (!isNodeValid(root)) - continue; - - TileVisNode source = root.get(); - - TileVisNode closest = null; - float range = Float.MAX_VALUE; - - float r = inRange(world, drainer, source.getLocation(), - source.getRange()); - if (r > 0) { - range = r; - closest = source; - } - - ArrayList> children = new ArrayList>(); - children = getAllChildren(source,children); - - for (WeakReference child : children) { - TileVisNode n = child.get(); - if (n != null && !n.equals(root)) { - - float r2 = inRange(n.getWorldObj(), n.getLocation(), - drainer, n.getRange()); - if (r2 > 0 && r2 < range) { - range = r2; - closest = n; - } - } - } - - if (closest != null) { - - cn.add(new WeakReference(closest)); - } - } - - nearbyNodes.put(drainer, cn); - } - - private static ArrayList> getAllChildren(TileVisNode source, ArrayList> list) { - for (WeakReference child : source.getChildren()) { - TileVisNode n = child.get(); - if (n != null) { - list.add(child); - list = getAllChildren(n,list); - } - } - return list; - } - - // public static boolean canNodeBeSeen(TileVisNode source,TileVisNode - // target) - // { - // double d = Math.sqrt(source.getDistanceFrom(target.xCoord, target.yCoord, - // target.zCoord)); - // double xd = (source.xCoord-target.xCoord) / d; - // double yd = (source.yCoord-target.yCoord) / d; - // double zd = (source.zCoord-target.zCoord) / d; - // return source.getWorldObj().rayTraceBlocks( - // SpellHelper.createVec3(source.xCoord-xd+.5+.5, source.yCoord-yd, - // source.zCoord-zd), - // SpellHelper.createVec3(target.xCoord+.5, target.yCoord+.5, - // target.zCoord+.5)) == null; - // } - - // public static HashMap> - // noderef = new HashMap>(); - // - // public static TileVisNode getClosestNodeWithinRadius(World world, int x, - // int y, int z, int radius) { - // TileVisNode out = null; - // WorldCoordinates wc = null; - // float cd = Float.MAX_VALUE; - // for (int sx = x - radius; sx <= x + radius; sx++) { - // for (int sy = y - radius; sy <= y + radius; sy++) { - // for (int sz = z - radius; sz <= z + radius; sz++) { - // wc = new WorldCoordinates(sx,sy,sz,world.provider.dimensionId); - // if (noderef.containsKey(wc)) { - // float d = wc.getDistanceSquared(x, y, z); - // if (dAs a guide build the sort string from two alphanumeric characters followed by - * two numeric characters based on... whatever. - */ - public String getSortingHelper(ItemStack itemstack); - - boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player); - - public boolean acceptsEnchant(int id); - - - - - -} diff --git a/src/api/java/thaumcraft/api/wands/IWandRodOnUpdate.java b/src/api/java/thaumcraft/api/wands/IWandRodOnUpdate.java deleted file mode 100644 index 4ef8c849..00000000 --- a/src/api/java/thaumcraft/api/wands/IWandRodOnUpdate.java +++ /dev/null @@ -1,16 +0,0 @@ -package thaumcraft.api.wands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * - * @author azanor - * - * Implemented by a class that you wish to be called whenever a wand with this rod performs its - * update tick. - * - */ -public interface IWandRodOnUpdate { - void onUpdate(ItemStack itemstack, EntityPlayer player); -} diff --git a/src/api/java/thaumcraft/api/wands/IWandTriggerManager.java b/src/api/java/thaumcraft/api/wands/IWandTriggerManager.java deleted file mode 100644 index 47465552..00000000 --- a/src/api/java/thaumcraft/api/wands/IWandTriggerManager.java +++ /dev/null @@ -1,12 +0,0 @@ -package thaumcraft.api.wands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface IWandTriggerManager { - - public boolean performTrigger(World world, ItemStack wand, EntityPlayer player, - int x, int y, int z, int side, int event); - -} diff --git a/src/api/java/thaumcraft/api/wands/IWandable.java b/src/api/java/thaumcraft/api/wands/IWandable.java deleted file mode 100644 index aeb9bac7..00000000 --- a/src/api/java/thaumcraft/api/wands/IWandable.java +++ /dev/null @@ -1,25 +0,0 @@ -package thaumcraft.api.wands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * - * @author azanor - * - * Add this to a tile entity that you wish wands to interact with in some way. - * - */ - -public interface IWandable { - - public int onWandRightClick(World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side, int md); - - public ItemStack onWandRightClick(World world, ItemStack wandstack, EntityPlayer player); - - public void onUsingWandTick(ItemStack wandstack, EntityPlayer player, int count); - - public void onWandStoppedUsing(ItemStack wandstack, World world, EntityPlayer player, int count); - -} diff --git a/src/api/java/thaumcraft/api/wands/ItemFocusBasic.java b/src/api/java/thaumcraft/api/wands/ItemFocusBasic.java deleted file mode 100644 index 35900520..00000000 --- a/src/api/java/thaumcraft/api/wands/ItemFocusBasic.java +++ /dev/null @@ -1,166 +0,0 @@ -package thaumcraft.api.wands; - -import java.text.DecimalFormat; -import java.util.List; -import java.util.Map; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import thaumcraft.api.ThaumcraftApi; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemFocusBasic extends Item implements IWandFocus { - - public ItemFocusBasic () - { - super(); - maxStackSize = 1; - canRepair=false; - this.setMaxDamage(0); - } - - public IIcon icon; - - @SideOnly(Side.CLIENT) - @Override - public IIcon getIconFromDamage(int par1) { - return icon; - } - - @Override - public boolean isItemTool(ItemStack par1ItemStack) - { - return true; - } - - @Override - public boolean isDamageable() { - return true; - } - - @Override - public void addInformation(ItemStack stack,EntityPlayer player, List list, boolean par4) { - AspectList al = this.getVisCost(); - if (al!=null && al.size()>0) { - list.add(StatCollector.translateToLocal(isVisCostPerTick()?"item.Focus.cost2":"item.Focus.cost1")); - for (Aspect aspect:al.getAspectsSorted()) { - DecimalFormat myFormatter = new DecimalFormat("#####.##"); - String amount = myFormatter.format(al.getAmount(aspect)/100f); - list.add(" \u00A7"+aspect.getChatcolor()+aspect.getName()+"\u00A7r x "+ amount); - - } - } - } - - @Override - public int getItemEnchantability() { - return 5; - } - - @Override - public EnumRarity getRarity(ItemStack itemstack) - { - return EnumRarity.rare; - } - - - @Override - public int getFocusColor() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public AspectList getVisCost() { - // TODO Auto-generated method stub - return null; - } - - @Override - public ItemStack onFocusRightClick(ItemStack itemstack, World world, - EntityPlayer player, MovingObjectPosition movingobjectposition) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, - int count) { - // TODO Auto-generated method stub - } - - @Override - public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, - EntityPlayer player, int count) { - // TODO Auto-generated method stub - - } - - /** - * Just insert two alphanumeric characters before this string in your focus item class - */ - @Override - public String getSortingHelper(ItemStack itemstack) { - Map ench = EnchantmentHelper.getEnchantments(itemstack); - String out=""; - for (Integer lvl:ench.values()) { - out = out + lvl + ""; - } - return out; - } - - @Override - public boolean isVisCostPerTick() { - return false; - } - - @Override - public IIcon getOrnament() { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, - int z, EntityPlayer player) { - // TODO Auto-generated method stub - return false; - } - - @Override - public WandFocusAnimation getAnimation() { - return WandFocusAnimation.WAVE; - } - - @Override - public IIcon getFocusDepthLayerIcon() { - // TODO Auto-generated method stub - return null; - } - - /** - * @see thaumcraft.api.wands.IWandFocus#acceptsEnchant(int) - * By default fortune is off for all wands - **/ - @Override - public boolean acceptsEnchant(int id) { - if (id==ThaumcraftApi.enchantFrugal|| - id==ThaumcraftApi.enchantPotency) return true; - return false; - } - - - - - -} diff --git a/src/api/java/thaumcraft/api/wands/StaffRod.java b/src/api/java/thaumcraft/api/wands/StaffRod.java deleted file mode 100644 index e7ae90f0..00000000 --- a/src/api/java/thaumcraft/api/wands/StaffRod.java +++ /dev/null @@ -1,48 +0,0 @@ -package thaumcraft.api.wands; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -/** - * - * @author Azanor - * - * This class is used to keep the material information for the various rods. - * It is also used to generate the wand recipes ingame. - * - */ -public class StaffRod extends WandRod { - - boolean runes=false; - - public StaffRod(String tag, int capacity, ItemStack item, int craftCost) { - super(tag+"_staff", capacity, item, craftCost); - this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+tag+".png"); - } - - public StaffRod(String tag, int capacity, ItemStack item, int craftCost, - IWandRodOnUpdate onUpdate, ResourceLocation texture) { - super(tag+"_staff", capacity, item, craftCost, onUpdate, texture); - } - - public StaffRod(String tag, int capacity, ItemStack item, int craftCost, - IWandRodOnUpdate onUpdate) { - super(tag+"_staff", capacity, item, craftCost, onUpdate); - this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+tag+".png"); - } - - public StaffRod(String tag, int capacity, ItemStack item, int craftCost, - ResourceLocation texture) { - super(tag+"_staff", capacity, item, craftCost, texture); - } - - public boolean hasRunes() { - return runes; - } - - public void setRunes(boolean hasRunes) { - this.runes = hasRunes; - } - - -} diff --git a/src/api/java/thaumcraft/api/wands/WandCap.java b/src/api/java/thaumcraft/api/wands/WandCap.java deleted file mode 100644 index 17b4581c..00000000 --- a/src/api/java/thaumcraft/api/wands/WandCap.java +++ /dev/null @@ -1,129 +0,0 @@ -package thaumcraft.api.wands; - -import java.util.LinkedHashMap; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import thaumcraft.api.aspects.Aspect; - -/** - * This class is used to keep the material information for the various caps. - * It is also used to generate the wand recipes ingame. - * @author Azanor - * - */ -public class WandCap { - - private String tag; - - /** - * Cost to craft this wand. Combined with the rod cost. - */ - private int craftCost; - - /** - * the amount by which all aspect costs are multiplied - */ - float baseCostModifier; - - /** - * specifies a list of primal aspects that use the special discount figure instead of the normal discount. - */ - List specialCostModifierAspects; - - /** - * the amount by which the specified aspect costs are multiplied - */ - float specialCostModifier; - - /** - * The texture that will be used for the ingame wand cap - */ - ResourceLocation texture; - - /** - * the actual item that makes up this cap and will be used to generate the wand recipes - */ - ItemStack item; - - public static LinkedHashMap caps = new LinkedHashMap(); - - public WandCap (String tag, float discount, ItemStack item, int craftCost) { - this.setTag(tag); - this.baseCostModifier = discount; - this.specialCostModifierAspects = null; - texture = new ResourceLocation("thaumcraft","textures/models/wand_cap_"+getTag()+".png"); - this.item=item; - this.setCraftCost(craftCost); - caps.put(tag, this); - } - - public WandCap (String tag, float discount, List specialAspects, float discountSpecial, ItemStack item, int craftCost) { - this.setTag(tag); - this.baseCostModifier = discount; - this.specialCostModifierAspects = specialAspects; - this.specialCostModifier = discountSpecial; - texture = new ResourceLocation("thaumcraft","textures/models/wand_cap_"+getTag()+".png"); - this.item=item; - this.setCraftCost(craftCost); - caps.put(tag, this); - } - - public float getBaseCostModifier() { - return baseCostModifier; - } - - public List getSpecialCostModifierAspects() { - return specialCostModifierAspects; - } - - public float getSpecialCostModifier() { - return specialCostModifier; - } - - public ResourceLocation getTexture() { - return texture; - } - - public void setTexture(ResourceLocation texture) { - this.texture = texture; - } - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - - - public ItemStack getItem() { - return item; - } - - public void setItem(ItemStack item) { - this.item = item; - } - - public int getCraftCost() { - return craftCost; - } - - public void setCraftCost(int craftCost) { - this.craftCost = craftCost; - } - - /** - * The research a player needs to have finished to be able to craft a wand with this cap. - */ - public String getResearch() { - return "CAP_"+getTag(); - } - - // Some examples: - // WandCap WAND_CAP_IRON = new WandCap("iron", 1.1f, Arrays.asList(Aspect.ORDER),1, new ItemStack(ConfigItems.itemWandCap,1,0),1); - // WandCap WAND_CAP_GOLD = new WandCap("gold", 1f, new ItemStack(ConfigItems.itemWandCap,1,1),3); - -} diff --git a/src/api/java/thaumcraft/api/wands/WandRod.java b/src/api/java/thaumcraft/api/wands/WandRod.java deleted file mode 100644 index 85954e46..00000000 --- a/src/api/java/thaumcraft/api/wands/WandRod.java +++ /dev/null @@ -1,158 +0,0 @@ -package thaumcraft.api.wands; - -import java.util.LinkedHashMap; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -/** - * - * @author Azanor - * - * This class is used to keep the material information for the various rods. - * It is also used to generate the wand recipes ingame. - * - */ -public class WandRod { - - - private String tag; - - /** - * Cost to craft this wand. Combined with the rod cost. - */ - private int craftCost; - - /** - * The amount of vis that can be stored - this number is actually multiplied - * by 100 for use by the wands internals - */ - int capacity; - - /** - * The texture that will be used for the ingame wand rod - */ - protected ResourceLocation texture; - - /** - * the actual item that makes up this rod and will be used to generate the wand recipes - */ - ItemStack item; - - /** - * A class that will be called whenever the wand onUpdate tick is run - */ - IWandRodOnUpdate onUpdate; - - /** - * Does the rod glow in the dark? - */ - boolean glow; - - public static LinkedHashMap rods = new LinkedHashMap(); - - public WandRod (String tag, int capacity, ItemStack item, int craftCost, ResourceLocation texture) { - this.setTag(tag); - this.capacity = capacity; - this.texture = texture; - this.item=item; - this.setCraftCost(craftCost); - rods.put(tag, this); - } - - public WandRod (String tag, int capacity, ItemStack item, int craftCost, IWandRodOnUpdate onUpdate, ResourceLocation texture) { - this.setTag(tag); - this.capacity = capacity; - this.texture = texture; - this.item=item; - this.setCraftCost(craftCost); - rods.put(tag, this); - this.onUpdate = onUpdate; - } - - public WandRod (String tag, int capacity, ItemStack item, int craftCost) { - this.setTag(tag); - this.capacity = capacity; - this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+getTag()+".png"); - this.item=item; - this.setCraftCost(craftCost); - rods.put(tag, this); - } - - public WandRod (String tag, int capacity, ItemStack item, int craftCost, IWandRodOnUpdate onUpdate) { - this.setTag(tag); - this.capacity = capacity; - this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+getTag()+".png"); - this.item=item; - this.setCraftCost(craftCost); - rods.put(tag, this); - this.onUpdate = onUpdate; - } - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - - public int getCapacity() { - return capacity; - } - - public void setCapacity(int capacity) { - this.capacity = capacity; - } - - public ResourceLocation getTexture() { - return texture; - } - - public void setTexture(ResourceLocation texture) { - this.texture = texture; - } - - public ItemStack getItem() { - return item; - } - - public void setItem(ItemStack item) { - this.item = item; - } - - public int getCraftCost() { - return craftCost; - } - - public void setCraftCost(int craftCost) { - this.craftCost = craftCost; - } - - public IWandRodOnUpdate getOnUpdate() { - return onUpdate; - } - - public void setOnUpdate(IWandRodOnUpdate onUpdate) { - this.onUpdate = onUpdate; - } - - public boolean isGlowing() { - return glow; - } - - public void setGlowing(boolean hasGlow) { - this.glow = hasGlow; - } - - /** - * The research a player needs to have finished to be able to craft a wand with this rod. - */ - public String getResearch() { - return "ROD_"+getTag(); - } - - // Some examples: - // WandRod WAND_ROD_WOOD = new WandRod("wood",25,new ItemStack(Item.stick),1); - // WandRod WAND_ROD_BLAZE = new WandRod("blaze",100,new ItemStack(Item.blazeRod),7,new WandRodBlazeOnUpdate()); -} diff --git a/src/api/java/thaumcraft/api/wands/WandTriggerRegistry.java b/src/api/java/thaumcraft/api/wands/WandTriggerRegistry.java deleted file mode 100644 index 68655cb7..00000000 --- a/src/api/java/thaumcraft/api/wands/WandTriggerRegistry.java +++ /dev/null @@ -1,72 +0,0 @@ -package thaumcraft.api.wands; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * This class serves a similar function to IWandable in that it allows wands to interact - * with object in the world. In this case it is most useful for adding interaction with non-mod - * blocks where you can't control what happens in their code. - * Example where it is used is in crafting the thaumonomicon from a bookshelf and the - * crucible from a cauldron - * - * @author azanor - * - */ -public class WandTriggerRegistry { - - /** - * Registers an action to perform when a casting wand right clicks on a specific block. - * A manager class needs to be created that implements IWandTriggerManager. - * @param manager - * @param event a logical number that you can use to differentiate different events or actions - * @param block - * @param meta send -1 as a wildcard value for all possible meta values - */ - public static void registerWandBlockTrigger(IWandTriggerManager manager, int event, Block block, int meta) { - triggers.put(Arrays.asList(block,meta), - Arrays.asList(manager,event)); - - } - - private static HashMap triggers = new HashMap(); - - public static boolean hasTrigger(Block block, int meta) { - if (triggers.containsKey(Arrays.asList(block,meta)) || - triggers.containsKey(Arrays.asList(block,-1))) return true; - return false; - } - - /** - * This is called by the onItemUseFirst function in wands. - * Parameters and return value functions like you would expect for that function. - * @param world - * @param wand - * @param player - * @param x - * @param y - * @param z - * @param side - * @param block - * @param meta - * @return - */ - public static boolean performTrigger(World world, ItemStack wand, EntityPlayer player, - int x, int y, int z, int side, Block block, int meta) { - - List l = triggers.get(Arrays.asList(block,meta)); - if (l==null) l = triggers.get(Arrays.asList(block,-1)); - if (l==null) return false; - - IWandTriggerManager manager = (IWandTriggerManager) l.get(0); - int event = (Integer) l.get(1); - return manager.performTrigger(world, wand, player, x, y, z, side, event); - } - -} diff --git a/src/api/java/vazkii/botania/api/BotaniaAPI.java b/src/api/java/vazkii/botania/api/BotaniaAPI.java deleted file mode 100644 index 36f5aa5a..00000000 --- a/src/api/java/vazkii/botania/api/BotaniaAPI.java +++ /dev/null @@ -1,363 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:15:28 PM (GMT)] - */ -package vazkii.botania.api; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.EnumHelper; -import vazkii.botania.api.internal.DummyMethodHandler; -import vazkii.botania.api.internal.DummySubTile; -import vazkii.botania.api.internal.IInternalMethodHandler; -import vazkii.botania.api.lexicon.KnowledgeType; -import vazkii.botania.api.lexicon.LexiconCategory; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.api.subtile.SubTileEntity; -import vazkii.botania.api.wiki.IWikiProvider; -import vazkii.botania.api.wiki.SimpleWikiProvider; -import vazkii.botania.api.wiki.WikiHooks; - -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; - -public final class BotaniaAPI { - - private static List categories = new ArrayList(); - private static List allEntries = new ArrayList(); - - public static Map knowledgeTypes = new HashMap(); - - public static List petalRecipes = new ArrayList(); - public static List runeAltarRecipes = new ArrayList(); - public static List manaInfusionRecipes = new ArrayList(); - public static List elvenTradeRecipes = new ArrayList(); - - private static BiMap> subTiles = HashBiMap.> create(); - public static Set subtilesForCreativeMenu = new LinkedHashSet(); - - public static Map oreWeights = new HashMap(); - - public static Map seeds = new HashMap(); - - public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20); - - public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", 18, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20); - - public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26); - public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 3, 2300, 9F, 3F, 26); - - public static KnowledgeType basicKnowledge, elvenKnowledge; - - static { - registerSubTile("", DummySubTile.class); - - basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true); - elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false); - - addOreWeight("oreAluminum", 3940); // Tinkers' Construct - addOreWeight("oreAmber", 2075); // Thaumcraft - addOreWeight("oreApatite", 1595); // Forestry - addOreWeight("oreBlueTopaz", 3195); // Ars Magica - addOreWeight("oreCassiterite", 1634); // GregTech - addOreWeight("oreCertusQuartz", 3975); // Applied Energistics - addOreWeight("oreChimerite", 3970); // Ars Magica - addOreWeight("oreCinnabar", 2585); // Thaumcraft - addOreWeight("oreCoal", 46525); // Vanilla - addOreWeight("oreCooperite", 5); // GregTech - addOreWeight("oreCopper", 8325); // IC2, Thermal Expansion, Tinkers' Construct, etc. - addOreWeight("oreDarkIron", 1700); // Factorization - addOreWeight("oreDiamond", 1265); // Vanilla - addOreWeight("oreEmerald", 780); // Vanilla - addOreWeight("oreEmery", 415); // GregTech - addOreWeight("oreGalena", 1000); // Factorization - addOreWeight("oreGold", 2970); // Vanilla - addOreWeight("oreInfusedAir", 925); // Thaumcraft - addOreWeight("oreInfusedEarth", 925); // Thaumcraft - addOreWeight("oreInfusedEntropy", 925); // Thaumcraft - addOreWeight("oreInfusedFire", 925); // Thaumcraft - addOreWeight("oreInfusedOrder", 925); // Thaumcraft - addOreWeight("oreInfusedWater", 925); // Thaumcraft - addOreWeight("oreIridium", 30); // GregTech - addOreWeight("oreIron", 20665); // Vanilla - addOreWeight("oreLapis", 1285); // Vanilla - addOreWeight("oreLead", 7985); // IC2, Thermal Expansion, Factorization, etc. - addOreWeight("oreMCropsEssence", 3085); // Magical Crops - addOreWeight("oreNickel", 2275); // Thermal Expansion - addOreWeight("oreOlivine", 1100); // Project RED - addOreWeight("oreRedstone", 6885); // Vanilla - addOreWeight("oreRuby", 1100); // Project RED - addOreWeight("oreSapphire", 1100); // Project RED - addOreWeight("oreSilver", 6300); // Thermal Expansion, Factorization, etc. - addOreWeight("oreSphalerite", 25); // GregTech - addOreWeight("oreSulfur", 1105); // Railcraft - addOreWeight("oreTetrahedrite", 4040); // GregTech - addOreWeight("oreTin", 9450); // IC2, Thermal Expansion, etc. - addOreWeight("oreTungstate", 20); // GregTech - addOreWeight("oreUranium", 1337); // IC2 - addOreWeight("oreVinteum", 5925); // Ars Magica - addOreWeight("oreYellorite", 3520); // Big Reactors - addOreWeight("oreZinc", 6485); // Flaxbeard's Steam Power - - addSeed(Items.wheat_seeds, Blocks.wheat); - addSeed(Items.potato, Blocks.potatoes); - addSeed(Items.carrot, Blocks.carrots); - addSeed(Items.nether_wart, Blocks.nether_wart); - addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem); - addSeed(Items.melon_seeds, Blocks.melon_stem); - - registerModWiki("Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s")); - - IWikiProvider technicWiki = new SimpleWikiProvider("Technic Wiki", "http://wiki.technicpack.net/%s"); - IWikiProvider mekanismWiki = new SimpleWikiProvider("Mekanism Wiki", "http://wiki.aidancbrady.com/wiki/%s"); - IWikiProvider buildcraftWiki = new SimpleWikiProvider("BuildCraft Wiki", "http://www.mod-buildcraft.com/wiki/doku.php?id=%s"); - - registerModWiki("Mekanism", mekanismWiki); - registerModWiki("MekanismGenerators", mekanismWiki); - registerModWiki("MekanismTools", mekanismWiki); - registerModWiki("EnderIO", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s")); - registerModWiki("TropiCraft", new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s")); - registerModWiki("RandomThings", new SimpleWikiProvider("Random Things Wiki", "http://randomthingsminecraftmod.wikispaces.com/%s")); - registerModWiki("Witchery", new SimpleWikiProvider("Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-")); - registerModWiki("AppliedEnergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s")); - registerModWiki("BigReactors", technicWiki); - registerModWiki("BuildCraft|Core", buildcraftWiki); - registerModWiki("BuildCraft|Builders", buildcraftWiki); - registerModWiki("BuildCraft|Energy", buildcraftWiki); - registerModWiki("BuildCraft|Factory", buildcraftWiki); - registerModWiki("BuildCraft|Silicon", buildcraftWiki); - registerModWiki("BuildCraft|Transport", buildcraftWiki); - registerModWiki("ArsMagica2", new SimpleWikiProvider("ArsMagica2 Wiki", "http://wiki.arsmagicamod.com/wiki/%s")); - registerModWiki("PneumaticCraft", new SimpleWikiProvider("PneumaticCraft Wiki", "http://www.minemaarten.com/wikis/pneumaticcraft-wiki/pneumaticcraft-wiki-%s")); - registerModWiki("StevesCarts2", new SimpleWikiProvider("Steve's Carts Wiki", "http://stevescarts2.wikispaces.com/%s")); - registerModWiki("GanysSurface", new SimpleWikiProvider("Gany's Surface Wiki", "http://ganys-surface.wikia.com/wiki/%s")); - registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s")); - registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s")); - } - - /** - * The internal method handler in use. Do not overwrite. - * @see IInternalMethodHandler - */ - public static IInternalMethodHandler internalHandler = new DummyMethodHandler(); - - - /** - * Registers a new Knowledge Type. - * @param id The ID for this knowledge type. - * @param color The color to display this knowledge type as. - */ - public static KnowledgeType registerKnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { - KnowledgeType type = new KnowledgeType(id, color, autoUnlock); - knowledgeTypes.put(id, type); - return type; - } - - /** - * Registers a Petal Recipe. - * @param output The ItemStack to craft. - * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper - * or String (case for Ore Dictionary). The array can't be larger than 16. - * @return The recipe created. - */ - public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) { - RecipePetals recipe = new RecipePetals(output, inputs); - petalRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Rune Altar - * @param output The ItemStack to craft. - * @param mana The amount of mana required. Don't go over 100000! - * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper - * or String (case for Ore Dictionary). The array can't be larger than 16. - * @return The recipe created. - */ - public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) { - RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs); - runeAltarRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Mana Infusion Recipe (throw an item in a mana pool) - * @param output The ItemStack to craft - * @param input The input item, be it an ItemStack or an ore dictionary entry String. - * @param mana The amount of mana required. Don't go over 100000! - * @return The recipe created. - */ - public static RecipeManaInfusion registerManaInfusionRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana); - manaInfusionRecipes.add(recipe); - return recipe; - } - - /** - * Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an - * Alchemy Catalyst below the pool). - * @see BotaniaAPI#registerManaInfusionRecipe - */ - public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setAlchemy(true); - return recipe; - } - - /** - * Register a Mana Infusion Recipe and flags it as an Conjuration recipe (requires a - * Conjuration Catalyst below the pool). - * @see BotaniaAPI#registerManaInfusionRecipe - */ - public static RecipeManaInfusion registerManaConjurationRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setConjuration(true); - return recipe; - } - - /** - * Registers a Elven Trade recipe (throw an item in an Alfheim Portal). - * @param output The ItemStack to return. - * @param inputs The items required, can be ItemStack or ore dictionary entry string. - * @return The recipe created. - */ - public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) { - RecipeElvenTrade recipe = new RecipeElvenTrade(output, inputs); - elvenTradeRecipes.add(recipe); - return recipe; - } - - /** - * Registers a SubTileEntity, a new special flower. Look in the subtile package of the API. - */ - public static void registerSubTile(String key, Class subtileClass) { - subTiles.put(key, subtileClass); - } - - /** - * Adds the key for a SubTileEntity into the creative menu. This goes into the - * subtilesForCreativeMenu Set. - */ - public static void addSubTileToCreativeMenu(String key) { - subtilesForCreativeMenu.add(key); - } - - /** - * Adds a category to the list of registered categories to appear in the Lexicon. - */ - public static void addCategory(LexiconCategory category) { - categories.add(category); - } - - /** - * Gets all registered categories. - */ - public static List getAllCategories() { - return categories; - } - - /** - * Gets all registered entries. - */ - public static List getAllEntries() { - return allEntries; - } - - /** - * Registers a Lexicon Entry and adds it to the category passed in. - */ - public static void addEntry(LexiconEntry entry, LexiconCategory category) { - allEntries.add(entry); - category.entries.add(entry); - } - - /** - * Maps an ore (ore dictionary key) to it's weight on the world generation. This - * is used for the Orechid flower. Check the static block in the BotaniaAPI class - * to get the weights for the vanilla blocks.
- * Alternatively get the values with the OreDetector mod:
- * https://gist.github.com/Vazkii/9493322 - */ - public static void addOreWeight(String ore, int weight) { - oreWeights.put(ore, weight); - } - - public static int getOreWeight(String ore) { - return oreWeights.get(ore); - } - - /** - * Allows an item to be counted as a seed. Any item in this list can be - * dispensed by a dispenser, the block is the block to be placed. - */ - public static void addSeed(Item item, Block block) { - seeds.put(item, block); - } - - /** - * Gets the last recipe to have been added to the recipe list. - */ - public static IRecipe getLatestAddedRecipe() { - List list = CraftingManager.getInstance().getRecipeList(); - return list.get(list.size() - 1); - } - - /** - * Gets the last x recipes added to the recipe list. - */ - public static List getLatestAddedRecipes(int x) { - List list = CraftingManager.getInstance().getRecipeList(); - List newList = new ArrayList(); - for(int i = x - 1; i >= 0; i--) - newList.add(list.get(list.size() - 1 - i)); - - return newList; - } - - /** - * Registers a Wiki provider for a mod so it uses that instead of the fallback - * FTB wiki. Make sure to call this on PostInit only! - */ - public static void registerModWiki(String mod, IWikiProvider provider) { - WikiHooks.registerModWiki(mod, provider); - } - - public static Class getSubTileMapping(String key) { - if(!subTiles.containsKey(key)) - key = ""; - - return subTiles.get(key); - } - - public static String getSubTileStringMapping(Class clazz) { - return subTiles.inverse().get(clazz); - } -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java b/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java deleted file mode 100644 index 53a8e421..00000000 --- a/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 7, 2014, 3:47:43 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.mana.TileSignature; - -public class DummyManaNetwork implements IManaNetwork { - - public static final DummyManaNetwork instance = new DummyManaNetwork(); - - @Override - public void clear() { - // NO-OP - } - - @Override - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit) { - return null; - } - - @Override - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit) { - return null; - } - - @Override - public List getAllCollectorsInWorld(World world) { - return new ArrayList(); - } - - @Override - public List getAllPoolsInWorld(World world) { - return new ArrayList(); - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java b/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java deleted file mode 100644 index 549bd197..00000000 --- a/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:43:03 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconPage; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; - -public class DummyMethodHandler implements IInternalMethodHandler { - - @Override - public LexiconPage textPage(String key) { - return dummyPage(key); - } - - @Override - public LexiconPage imagePage(String key, String resource) { - return dummyPage(key); - } - - @Override - public LexiconPage craftingRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage craftingRecipePage(String key, IRecipe recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage petalRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage petalRecipePage(String key, RecipePetals recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage runeRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage manaInfusionRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage elvenTradePage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe) { - return dummyPage(key); - } - - private LexiconPage dummyPage(String key) { - return new DummyPage(key); - } - - @Override - public ItemStack getSubTileAsStack(String subTile) { - return new ItemStack(Blocks.stone, 0, 0); - } - - @Override - public IIcon getSubTileIconForName(String name) { - return Blocks.red_flower.getIcon(0, 0); - } - - @Override - public IManaNetwork getManaNetworkInstance() { - return DummyManaNetwork.instance; - } - - @Override - public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) { - // NO-OP - } - - @Override - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) { - // NO-OP - } - - @Override - public IInventory getBaublesInventory(EntityPlayer player) { - return null; - } - - @Override - public boolean shouldForceCheck() { - return true; - } - - @Override - public int getPassiveFlowerDecay() { - return 0; - } -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyPage.java b/src/api/java/vazkii/botania/api/internal/DummyPage.java deleted file mode 100644 index 33cbcf84..00000000 --- a/src/api/java/vazkii/botania/api/internal/DummyPage.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:41:23 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import vazkii.botania.api.lexicon.LexiconPage; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A dummy page. It does absolutely nothing and is only - * existant to make sure everything goes right even if - * Botania isn't loaded. - */ -public class DummyPage extends LexiconPage { - - public DummyPage(String unlocalizedName) { - super(unlocalizedName); - } - - @Override - @SideOnly(Side.CLIENT) - public void renderScreen(IGuiLexiconEntry gui, int x, int y) { - // NO-OP - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummySubTile.java b/src/api/java/vazkii/botania/api/internal/DummySubTile.java deleted file mode 100644 index d23adced..00000000 --- a/src/api/java/vazkii/botania/api/internal/DummySubTile.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 24, 2014, 4:17:33 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import vazkii.botania.api.subtile.SubTileEntity; - -public class DummySubTile extends SubTileEntity { - -} diff --git a/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java b/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java deleted file mode 100644 index c8bf6da1..00000000 --- a/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:48:41 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import vazkii.botania.api.lexicon.LexiconEntry; - -/** - * Internal interface for the Lexicon Entry GUI. This contains - * everything that can be accessed from it. It's safe to cast - * this type to GuiScreen. - */ -public interface IGuiLexiconEntry { - - /** - * Gets the entry currently portrayed in this gui. - */ - public LexiconEntry getEntry(); - - /** - * Gets the current page the lexicon GUI is browsing. - */ - public int getPageOn(); - - /** - * Gets the leftmost part of the GUI. - */ - public int getLeft(); - - /** - * Gets the topmost part of the GUI. - */ - public int getTop(); - - /** - * Gets the GUI's width. - */ - public int getWidth(); - - /** - * Gets the GUI's height - */ - public int getHeight(); - - /** - * Gets the GUI's Z level for rendering. - */ - public float getZLevel(); -} diff --git a/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java b/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java deleted file mode 100644 index 00a16a29..00000000 --- a/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:34:34 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconPage; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Any methods that refer to internal methods in Botania are here. - * This is defaulted to a dummy handler, whose methods do nothing. - * This handler is set to a proper one on PreInit. Make sure to - * make your mod load after Botania if you have any intention of - * doing anythign with this on PreInit. - */ -public interface IInternalMethodHandler { - - public LexiconPage textPage(String key); - - public LexiconPage imagePage(String key, String resource); - - public LexiconPage craftingRecipesPage(String key, List recipes); - - public LexiconPage craftingRecipePage(String key, IRecipe recipe); - - public LexiconPage petalRecipesPage(String key, List recipes); - - public LexiconPage petalRecipePage(String key, RecipePetals recipe); - - public LexiconPage runeRecipesPage(String key, List recipes); - - public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe); - - public LexiconPage manaInfusionRecipesPage(String key, List recipes); - - public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe); - - public LexiconPage elvenTradePage(String key, List recipes); - - public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe); - - public IManaNetwork getManaNetworkInstance(); - - public ItemStack getSubTileAsStack(String subTile); - - public IIcon getSubTileIconForName(String name); - - public boolean shouldForceCheck(); - - public int getPassiveFlowerDecay(); - - public IInventory getBaublesInventory(EntityPlayer player); - - @SideOnly(Side.CLIENT) - public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res); - - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m); - -} diff --git a/src/api/java/vazkii/botania/api/internal/IManaBurst.java b/src/api/java/vazkii/botania/api/internal/IManaBurst.java deleted file mode 100644 index 38c5fd8c..00000000 --- a/src/api/java/vazkii/botania/api/internal/IManaBurst.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 31, 2014, 4:36:13 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; - -/** - * Interface for the Mana Burst entity. This can safely be casted to EntityThrowable. - */ -public interface IManaBurst { - - public boolean isFake(); - - public void setMotion(double x, double y, double z); - - public int getColor(); - - public void setColor(int color); - - public int getMana(); - - public void setMana(int mana); - - public int getStartingMana(); - - public void setStartingMana(int mana); - - public int getMinManaLoss(); - - public void setMinManaLoss(int minManaLoss); - - public float getManaLossPerTick(); - - public void setManaLossPerTick(float mana); - - public float getGravity(); - - public void setGravity(float gravity); - - public ChunkCoordinates getBurstSourceChunkCoordinates(); - - public void setBurstSourceCoords(int x, int y, int z); - - public ItemStack getSourceLens(); - - public void setSourceLens(ItemStack lens); - - public boolean hasAlreadyCollidedAt(int x, int y, int z); - - public int getTicksExisted(); - -} diff --git a/src/api/java/vazkii/botania/api/internal/IManaNetwork.java b/src/api/java/vazkii/botania/api/internal/IManaNetwork.java deleted file mode 100644 index 38e94197..00000000 --- a/src/api/java/vazkii/botania/api/internal/IManaNetwork.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 7, 2014, 3:39:48 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.mana.TileSignature; - -/** - * A basic interface for a world's Mana Network. - * @see IInternalMethodHandler#getManaNetworkInstance() - */ -public interface IManaNetwork { - - /** - * Clears the entire Mana Network of all it's contents, you probably - * don't want to call this unless you have a very good reason. - */ - public void clear(); - - /** - * Gets the closest Mana Collector (eg. Mana Spreader) in the network to the Chunk - * Coordinates passed in, in the given dimension.
- * A way of getting the dimension is via worldObj.provider.dimensionId
- * Note that this function *can* get performance intensive, it's reccomended you - * call it sparingly and take cache of the value returned. - * @param limit The maximum distance the closest block can be, if the closest block - * is farther away than that, null will be returned instead. - */ - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit); - - /** - * Gets the closest Mana Pool in the network to the Chunk Coordinates passed in, - * in the given dimension.
- * A way of getting the dimension is via worldObj.provider.dimensionId
- * Note that this function *can* get performance intensive, it's reccomended you - * call it sparingly and take cache of the value returned. - * @param limit The maximum distance the closest block can be, if the closest block - * is farther away than that, null will be returned instead. - */ - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit); - - /** - * Gets the list of all Mana Collectors (eg. Mana Spreader) in the dimension - * passed in. Note that this is the actual list and not a copy, make sure to - * clone the list if you intend to change it in any way. - */ - public List getAllCollectorsInWorld(World world); - - /** - * Gets the list of all Mana Pools in the dimension passed in. Note that this - * is the actual list and not a copy, make sure to clone the list if you intend - * to change it in any way. - */ - public List getAllPoolsInWorld(World world); -} diff --git a/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java b/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java deleted file mode 100644 index eb4815c6..00000000 --- a/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 30, 2014, 4:28:29 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * A TileEntity that implements this can be heated by an Exoflame flower. - */ -public interface IExoflameHeatable { - - /** - * Can this TileEntity smelt its contents. If true, the Exoflame is allowed - * to fuel it. - */ - public boolean canSmelt(); - - /** - * Gets the amount of ticks left for the fuel. If below 2, the exoflame - * will call boostBurnTime. - */ - public int getBurnTime(); - - /** - * Called to increase the amount of time this furnace should be burning - * the fuel for. Even if it doesn't have any fuel. - */ - public void boostBurnTime(); - - /** - * Called once every two ticks to increase the speed of the furnace. Feel - * free to not do anything if all you want is to allow the exoflame to feed - * it, not make it faster. - */ - public void boostCookTime(); - -} diff --git a/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java b/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java deleted file mode 100644 index 67db3e64..00000000 --- a/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 6, 2014, 6:02:29 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * An interface that defines an instance of PlayerControllerMP with - * the ability to modify reach. See vazkii.botania.client.core.handler.BotaniaPlayerController - */ -public interface IExtendedPlayerController { - - /** - * Sets the extra reach the player should have. - */ - public void setReachDistanceExtension(float f); - - /** - * Gets the current reach extension. - */ - public float getReachDistanceExtension(); -} diff --git a/src/api/java/vazkii/botania/api/item/IPetalApothecary.java b/src/api/java/vazkii/botania/api/item/IPetalApothecary.java deleted file mode 100644 index d96f73f1..00000000 --- a/src/api/java/vazkii/botania/api/item/IPetalApothecary.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 30, 2014, 4:22:15 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * Base Interface for the Petal Apothecary block. Can - * be safely casted to TileEntity. - */ -public interface IPetalApothecary { - - /** - * Sets if the the apothecary has water or not. - */ - public void setWater(boolean water); - - /** - * Does the apothecary have water in it? - */ - public boolean hasWater(); - -} diff --git a/src/api/java/vazkii/botania/api/item/IPixieSpawner.java b/src/api/java/vazkii/botania/api/item/IPixieSpawner.java deleted file mode 100644 index c0d47f87..00000000 --- a/src/api/java/vazkii/botania/api/item/IPixieSpawner.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 6, 2014, 6:06:27 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * Any item that implements this allows for pixies to be spawned when the player takes damage when...
- * - Case the item is armor, having it equipped.
- * - Case the item is a bauble, having it worn.
- * - On any other case, having the item being the current held item. - */ -public interface IPixieSpawner { - - /** - * The chance this item adds for pixies to be spawned. From 0.0 to 1.0. All values - * are put together when calculating. - */ - public float getPixieChance(ItemStack stack); - -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java b/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java deleted file mode 100644 index fe2167b1..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jun 8, 2014, 7:02:48 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -/** - * Have a LexiconEntry implement this to signify it's an "Addon entry", as - * in, one provided by an Addon. This allows it to draw a subtitle of - * sorts, to prevent the [Mod tag here] nonsense that happened with thaumcraft - * addons. It can also be used for other purposes, such as stating an - * entry is WIP. - */ -public interface IAddonEntry { - - /** - * Returns the unlocalized subtitle to show below the title. Here you'd - * return something like "(This Entry is provided by the Botanic Tinkerer addon)". - */ - public String getSubtitle(); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexicon.java b/src/api/java/vazkii/botania/api/lexicon/ILexicon.java deleted file mode 100644 index ee07e17f..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/ILexicon.java +++ /dev/null @@ -1,21 +0,0 @@ -package vazkii.botania.api.lexicon; - -import net.minecraft.item.ItemStack; - -/** - * Basic interface for the Lexica Botania. - */ -public interface ILexicon { - - /** - * Gets if a specific knowledge is unlocked. Check the knowledge types in - * BotaniaAPI. - */ - public boolean isKnowledgeUnlocked(ItemStack stack, KnowledgeType knowledge); - - /** - * Unlocks a specfic type of knowledge. - */ - public void unlockKnowledge(ItemStack stack, KnowledgeType knowledge); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java b/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java deleted file mode 100644 index e8777db2..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 20, 2014, 7:05:44 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Any block that implements this can be right clicked with - * a Lexica Botania to open a entry page. - */ -public interface ILexiconable { - - /** - * Gets the lexicon entry to open at this location. null works too. - */ - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java b/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java deleted file mode 100644 index d07c0325..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 20, 2014, 6:08:48 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import net.minecraft.item.ItemStack; - -/** - * Have an Item implement this so that the method used for mapping it into - * the lexicon recipe mappings isn't the typical id:meta key. - */ -public interface IRecipeKeyProvider { - - public String getKey(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java b/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java deleted file mode 100644 index 5a08c9ce..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java +++ /dev/null @@ -1,20 +0,0 @@ -package vazkii.botania.api.lexicon; - -import net.minecraft.util.EnumChatFormatting; - -public class KnowledgeType { - - public final String id; - public final EnumChatFormatting color; - public final boolean autoUnlock; - - public KnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { - this.id = id; - this.color = color; - this.autoUnlock = autoUnlock; - } - - public String getUnlocalizedName() { - return "botania.knowledge." + id; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java b/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java deleted file mode 100644 index 76273419..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:23:47 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.ArrayList; -import java.util.List; - -public final class LexiconCategory { - - public final String unlocalizedName; - public final List entries = new ArrayList(); - - /** - * @param unlocalizedName The unlocalized name of this category. This will be localized by the client display. - */ - public LexiconCategory(String unlocalizedName) { - this.unlocalizedName = unlocalizedName; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java b/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java deleted file mode 100644 index bbc475c4..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:17:06 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import net.minecraft.util.StatCollector; -import vazkii.botania.api.BotaniaAPI; - -public class LexiconEntry implements Comparable { - - public final String unlocalizedName; - public final LexiconCategory category; - - private KnowledgeType type = BotaniaAPI.basicKnowledge; - - public List pages = new ArrayList(); - private boolean priority = false; - - /** - * @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display. - */ - public LexiconEntry(String unlocalizedName, LexiconCategory category) { - this.unlocalizedName = unlocalizedName; - this.category = category; - } - - /** - * Sets this page as prioritized, as in, will appear before others in the lexicon. - */ - public LexiconEntry setPriority() { - priority = true; - return this; - } - - /** - * Sets the Knowledge type of this entry. - */ - public LexiconEntry setKnowledgeType(KnowledgeType type) { - this.type = type; - return this; - } - - public KnowledgeType getKnowledgeType() { - return type; - } - - public boolean isPriority() { - return priority; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - /** - * Sets what pages you want this entry to have. - */ - public LexiconEntry setLexiconPages(LexiconPage... pages) { - this.pages.addAll(Arrays.asList(pages)); - - for(int i = 0; i < this.pages.size(); i++) { - LexiconPage page = this.pages.get(i); - if(!page.skipRegistry) - page.onPageAdded(this, i); - } - - return this; - } - - /** - * Adds a page to the list of pages. - */ - public void addPage(LexiconPage page) { - pages.add(page); - } - - public final String getNameForSorting() { - return (priority ? 0 : 1) + StatCollector.translateToLocal(getUnlocalizedName()); - } - - @Override - public int compareTo(LexiconEntry o) { - return getNameForSorting().compareTo(o.getNameForSorting()); - } -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java b/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java deleted file mode 100644 index f17f0c5e..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 14, 2014, 6:17:24 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import vazkii.botania.api.internal.IGuiLexiconEntry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class LexiconPage { - - public String unlocalizedName; - public boolean skipRegistry; - - public LexiconPage(String unlocalizedName) { - this.unlocalizedName = unlocalizedName; - } - - /** - * Does the rendering for this page. - * @param gui The active GuiScreen - * @param mx The mouse's relative X position. - * @param my The mouse's relative Y position. - */ - @SideOnly(Side.CLIENT) - public abstract void renderScreen(IGuiLexiconEntry gui, int mx, int my); - - /** - * Called per update tick. - */ - @SideOnly(Side.CLIENT) - public void updateScreen() { - // NO-OP - } - - /** - * Called when a key is pressed. - */ - @SideOnly(Side.CLIENT) - public void onKeyPressed(char c, int key) { - // NO-OP - } - - /** - * Called when {@link LexiconEntry#setLexiconPages(LexiconPage...)} is called. - */ - public void onPageAdded(LexiconEntry entry, int index) { - // NO-OP - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - public LexiconPage setSkipRegistry() { - skipRegistry = true; - return this; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java b/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java deleted file mode 100644 index 49b2a133..00000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 6, 2014, 3:54:12 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.item.ItemStack; - -/** - * This class contains mappings for which entry and page correspond to each - * craftable ItemStack. Use the map method to map an ItemStack to a page in - * an entry in the lexicon. - */ -public final class LexiconRecipeMappings { - - private static Map mappings = new HashMap(); - - /** - * Maps the given stack to the given page of the entry. - */ - public static void map(ItemStack stack, LexiconEntry entry, int page, boolean force) { - EntryData data = new EntryData(entry, page); - String str = stackToString(stack); - - if(force || !mappings.containsKey(str)) - mappings.put(str, data); - } - - public static void map(ItemStack stack, LexiconEntry entry, int page) { - map(stack, entry, page, false); - } - - - public static EntryData getDataForStack(ItemStack stack) { - return mappings.get(stackToString(stack)); - } - - public static String stackToString(ItemStack stack) { - if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) - return ((IRecipeKeyProvider) stack.getItem()).getKey(stack); - - return stack.getUnlocalizedName() + "~" + stack.getItemDamage(); - } - - public static class EntryData { - - public final LexiconEntry entry; - public final int page; - - public EntryData(LexiconEntry entry, int page) { - this.entry = entry; - this.page = page; - } - - } -} diff --git a/src/api/java/vazkii/botania/api/mana/BurstProperties.java b/src/api/java/vazkii/botania/api/mana/BurstProperties.java deleted file mode 100644 index eed74809..00000000 --- a/src/api/java/vazkii/botania/api/mana/BurstProperties.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 31, 2014, 3:49:30 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * The properties of a mana burst, when shot. This is passed to the lens - * currently on the mana spreader to apply changes. - */ -public final class BurstProperties { - - public int maxMana; - public int ticksBeforeManaLoss; - public float manaLossPerTick; - public float gravity; - public float motionModifier; - - public int color; - - public BurstProperties(int maxMana, int ticksBeforeManaLoss, float manaLossPerTick, float gravity, float motionModifier, int color) { - this.maxMana = maxMana; - this.ticksBeforeManaLoss = ticksBeforeManaLoss; - this.manaLossPerTick = manaLossPerTick; - this.gravity = gravity; - this.motionModifier = motionModifier; - this.color = color; - } - -} diff --git a/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java b/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java deleted file mode 100644 index 889cfb51..00000000 --- a/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jul 2, 2014, 5:26:02 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this will get it's recieveMana call - * called on both client and server. If this is not implemented - * the call will only occur on the server. - */ -public interface IClientManaHandler extends IManaReceiver { - -} diff --git a/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java b/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java deleted file mode 100644 index 51f3cce9..00000000 --- a/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [May 25, 2014, 7:34:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Have an item implement this to flag it as an infinite - * mana source for the purposes of the HUD rendered when - * an IManaUserItem implementing item is present. - */ -public interface ICreativeManaProvider { - - public boolean isCreative(ItemStack stack); - -} - diff --git a/src/api/java/vazkii/botania/api/mana/IKeyLocked.java b/src/api/java/vazkii/botania/api/mana/IKeyLocked.java deleted file mode 100644 index a7870e6b..00000000 --- a/src/api/java/vazkii/botania/api/mana/IKeyLocked.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jul 11, 2014, 4:29:32 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this interface has an IO key lock. This - * interface defines an input and output key.

- * - * A Spreader can only shoot mana into a IKeyLocked interfaced TE if the Input - * key of the TE is equal to the Output key of the Spreader.

- * - * A Spreader can only pull mana from a IKeyLocked interfaced IManaPool TE if the - * Output key of the IManaPool is equal to the Input key of the Spreader. - */ -public interface IKeyLocked { - - public String getInputKey(); - - public String getOutputKey(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java b/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java deleted file mode 100644 index 91cb0b93..00000000 --- a/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jul 26, 2014, 9:51:58 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.world.World; - -/** - * A block that implements this has a flag for whether it can be moved by the Shard of Laputa. - */ -public interface ILaputaImmobile { - - public boolean canMove(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILens.java b/src/api/java/vazkii/botania/api/mana/ILens.java deleted file mode 100644 index 628d102b..00000000 --- a/src/api/java/vazkii/botania/api/mana/ILens.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 31, 2014, 3:03:04 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Have an Item implement this to be counted as a lens for the mana spreader. - */ -public interface ILens extends ILensEffect { - - @SideOnly(Side.CLIENT) - public int getLensColor(ItemStack stack); - - /** - * Can the source lens be combined with the composite lens? This is called - * for both the ILens instance of ItemStack.getItem() of sourceLens and compositeLens. - */ - public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens); - - /** - * Gets the composite lens in the stack passed in, return null for none. - */ - public ItemStack getCompositeLens(ItemStack stack); - - /** - * Sets the composite lens for the sourceLens as the compositeLens, returns - * the ItemStack with the combination. - */ - public ItemStack setCompositeLens(ItemStack sourceLens, ItemStack compositeLens); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILensEffect.java b/src/api/java/vazkii/botania/api/mana/ILensEffect.java deleted file mode 100644 index d97095b2..00000000 --- a/src/api/java/vazkii/botania/api/mana/ILensEffect.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Apr 14, 2014, 7:30:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import vazkii.botania.api.internal.IManaBurst; - -/** - * Have an item implement this for it to count as a lens effect and - * be able to change the properties of Mana Bursts. - */ -public interface ILensEffect { - - /** - * Called when a mana spreader that has this focus shoots a burst. This is where - * you change the properties of the burst. - */ - public void apply(ItemStack stack, BurstProperties props); - - /** - * Called when a mana burst fired from a mana spreader with this focus collides against - * any block. This is called after the collision is handled. - * @return True to kill the burst. False to keep it alive. - */ - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack); - - /** - * Called when a mana burst fired from a mana spreader with this focus is updated. - * This is called before the update is handled. - */ - public void updateBurst(IManaBurst burst, ItemStack stack); - - /** - * Called when the mana burst should do it's particles. Return false to not - * do any particles. - */ - public boolean doParticles(IManaBurst burst, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaBlock.java b/src/api/java/vazkii/botania/api/mana/IManaBlock.java deleted file mode 100644 index 6896f059..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaBlock.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 4:59:05 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this is considered a Mana Block. - * Just being a Mana Block doesn't mean much, look at the other IMana - * interfaces. - */ -public interface IManaBlock { - - /** - * Gets the amount of mana currently in this block. - */ - public int getCurrentMana(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollector.java b/src/api/java/vazkii/botania/api/mana/IManaCollector.java deleted file mode 100644 index a54d8c93..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaCollector.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 5:01:19 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import vazkii.botania.api.internal.IManaBurst; - -/** - * Any TileEntity that implements this is considered a mana collector, by - * which nearby generating flowers will pump mana into it.

- * - * Implementation Instructions:
- * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removeCollector(this); on both.
- * - On the first tick of onUpdate(), call ManaNetworkEvent.addCollector(this); - */ -public interface IManaCollector extends IManaReceiver { - - /** - * Called every tick on the client case the player is holding a Wand of the Forest. - */ - public void onClientDisplayTick(); - - /** - * Get the multiplier of mana to input into the block, 1.0 is the original amount of mana - * in the burst. 0.9, for example, is 90%, so 10% of the mana in the burst will get - * dissipated. - */ - public float getManaYieldMultiplier(IManaBurst burst); - - /** - * Gets the maximum amount of mana this collector can have. - */ - public int getMaxMana(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java b/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java deleted file mode 100644 index 420f683c..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 10, 2014, 7:49:19 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this can be counted as a "ghost" block of - * sorts, that won't call the collision code for the mana bursts. - */ -public interface IManaCollisionGhost { - - public boolean isGhost(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaItem.java b/src/api/java/vazkii/botania/api/mana/IManaItem.java deleted file mode 100644 index 42dfef15..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaItem.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 6, 2014, 9:07:40 AM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -/** - * An item that implements this can be counted as an item that can - * contain mana. - */ -public interface IManaItem { - - /** - * Gets the amount of mana this item contains - */ - public int getMana(ItemStack stack); - - /** - * Gets the max amount of mana this item can hold. - */ - public int getMaxMana(ItemStack stack); - - /** - * Adds mana to this item. - */ - public void addMana(ItemStack stack, int mana); - - /** - * Can this item receive mana from a mana Pool? - * @param pool The pool it's receiving mana from, can be casted to IManaPool. - * @see IManaPool#isOutputtingPower() - */ - public boolean canReceiveManaFromPool(ItemStack stack, TileEntity pool); - - /** - * Can this item recieve mana from another item? - */ - public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack); - - /** - * Can this item export mana to a mana Pool? - * @param pool The pool it's exporting mana to, can be casted to IManaPool. - * @see IManaPool#isOutputtingPower() - */ - public boolean canExportManaToPool(ItemStack stack,TileEntity pool); - - /** - * Can this item export mana to another item? - */ - public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack); - - /** - * If this item simply does not export mana at all, set this to true. This is - * used to skip items that contain mana but can't export it when drawing the - * mana bar above the XP bar. - */ - public boolean isNoExport(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaPool.java b/src/api/java/vazkii/botania/api/mana/IManaPool.java deleted file mode 100644 index b93bf6e8..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaPool.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 5:03:09 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this is considered a Mana Pool, - * by which nearby functional flowers will pull mana from it.
- * Mana Distributors will also accept it as valid output.

- * - * Implementation Instructions:
- * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removePool(this); on both.
- * - On the first tick of onUpdate(), call ManaNetworkEvent.addPool(this); - */ -public interface IManaPool extends IManaReceiver { - - /** - * Returns false if the mana pool is accepting power from other power items, - * true if it's sending power into them. - */ - public boolean isOutputtingPower(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaReceiver.java b/src/api/java/vazkii/botania/api/mana/IManaReceiver.java deleted file mode 100644 index 2838c7b7..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaReceiver.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 4:55:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this can receive mana from mana bursts. - */ -public interface IManaReceiver extends IManaBlock { - - /** - * Is this Mana Receiver is full? Being full means no mana bursts will be sent. - */ - public boolean isFull(); - - /** - * Called when this receiver receives mana. - */ - public void recieveMana(int mana); - - /** - * Can this tile receive mana from bursts? Generally set to false for - * implementations of IManaCollector. - */ - public boolean canRecieveManaFromBursts(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaTrigger.java b/src/api/java/vazkii/botania/api/mana/IManaTrigger.java deleted file mode 100644 index 684a2c1d..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaTrigger.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [May 16, 2014, 7:52:53 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.world.World; -import vazkii.botania.api.internal.IManaBurst; - -/** - * Have a block implement this class to make it do something when a mana burst collides with it. - */ -public interface IManaTrigger { - - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java b/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java deleted file mode 100644 index d06cf744..00000000 --- a/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [May 25, 2014, 7:32:10 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Any item that implements this interface is an item that would use mana - * from the player's inventory. If there's any items in the inventory or - * equipped in either the baubles or armor inventories that implement - * this interface, a mana bar will be rendered. - */ -public interface IManaUsingItem { - - public boolean usesMana(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java b/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java deleted file mode 100644 index f677c3ee..00000000 --- a/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jul 2, 2014, 6:36:54 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -/** - * A block that implements this can provide an IIcon (block icons only) - * to be used as an overlay for the mana pool, similarly to the mana void - * and catalysts. - */ -public interface IPoolOverlayProvider { - - public IIcon getIcon(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java b/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java deleted file mode 100644 index 004c52ed..00000000 --- a/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jul 22, 2014, 2:26:14 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Any Item that implements ILensEffect and this will have - * a check before being pulled by the Tiny Planet. - */ -public interface ITinyPlanetExcempt { - - public boolean shouldPull(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java b/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java deleted file mode 100644 index 74fb0053..00000000 --- a/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java +++ /dev/null @@ -1,201 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 13, 2014, 5:32:24 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.BotaniaAPI; - -public final class ManaItemHandler { - - /** - * Requests mana from items in a given player's inventory. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * the amount of mana existent will be returned instead, if you want exact values use requestManaExact. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return The amount of mana received from the request. - */ - public static int requestMana(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if(stack == null) - return 0; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItem = (IManaItem) stackInSlot.getItem(); - if(manaItem.canExportManaToItem(stackInSlot, stack) && manaItem.getMana(stackInSlot) > 0) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) - continue; - - int mana = Math.min(manaToGet, manaItem.getMana(stackInSlot)); - - if(remove) - manaItem.addMana(stackInSlot, -mana); - - return mana; - } - } - } - - return 0; - } - - /** - * Requests an exact amount of mana from items in a given player's inventory. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * false will be returned instead, and nothing will happen. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return If the request was succesful. - */ - public static boolean requestManaExact(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if(stack == null) - return false; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - if(manaItemSlot.canExportManaToItem(stackInSlot, stack) && manaItemSlot.getMana(stackInSlot) > manaToGet) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) - continue; - - if(remove) - manaItemSlot.addMana(stackInSlot, -manaToGet); - - return true; - } - } - } - - return false; - } - - /** - * Dispatches mana to items in a given player's inventory. Note that this method - * does not automatically remove mana from the item which is exporting. - * @param manaToSend How much mana is to be sent. - * @param remove If true, the mana will be added from the target item. Set to false to just check. - * @return The amount of mana actually sent. - */ - public static int dispatchMana(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { - if(stack == null) - return 0; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - - if(manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) - continue; - - int received = 0; - if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot)) - received = manaToSend; - else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot)); - - - if(add) - manaItemSlot.addMana(stackInSlot, manaToSend); - - return received; - } - } - } - - return 0; - } - - /** - * Dispatches an exact amount of mana to items in a given player's inventory. Note that this method - * does not automatically remove mana from the item which is exporting. - * @param manaToSend How much mana is to be sent. - * @param remove If true, the mana will be added from the target item. Set to false to just check. - * @return If an item received the mana sent. - */ - public static boolean dispatchManaExact(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { - if(stack == null) - return false; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot) && manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) - continue; - - if(add) - manaItemSlot.addMana(stackInSlot, manaToSend); - - return true; - } - } - } - - return false; - } -} diff --git a/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java b/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java deleted file mode 100644 index e04253a7..00000000 --- a/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 5:04:30 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.MinecraftForge; -import cpw.mods.fml.common.eventhandler.Event; - -public class ManaNetworkEvent extends Event { - - public final TileEntity tile; - public final ManaBlockType type; - public final Action action; - - public ManaNetworkEvent(TileEntity tile, ManaBlockType type, Action action) { - this.tile = tile; - this.type = type; - this.action = action; - } - - public static void addCollector(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.ADD); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void removeCollector(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.REMOVE); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void addPool(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.ADD); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void removePool(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.REMOVE); - MinecraftForge.EVENT_BUS.post(event); - } - - public enum ManaBlockType { - POOL, COLLECTOR - } - - public enum Action { - REMOVE, ADD - } -} diff --git a/src/api/java/vazkii/botania/api/mana/TileSignature.java b/src/api/java/vazkii/botania/api/mana/TileSignature.java deleted file mode 100644 index 5573670d..00000000 --- a/src/api/java/vazkii/botania/api/mana/TileSignature.java +++ /dev/null @@ -1,15 +0,0 @@ -package vazkii.botania.api.mana; - -import net.minecraft.tileentity.TileEntity; - -public class TileSignature { - - public final TileEntity tile; - public final boolean remoteWorld; - - public TileSignature(TileEntity tile, boolean remoteWorld) { - this.tile = tile; - this.remoteWorld = remoteWorld; - } - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java deleted file mode 100644 index 4353f01c..00000000 --- a/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 21, 2014, 5:44:13 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaReceiver; - -/** - * A TileEntity that implements this can have a Spark attached to it. - * For the Spark to be allowed to have upgrades, it needs to be an IManaPool. - */ -public interface ISparkAttachable extends IManaReceiver { - - /** - * Can this block have a Spark attached to it. Note that this will not - * unattach the Spark if it's changed later. - */ - public boolean canAttachSpark(ItemStack stack); - - /** - * Called when the Spark is attached. - */ - public void attachSpark(ISparkEntity entity); - - /** - * Gets the Spark that is attached to this block. A common implementation is - * to check for Spark entities above: - * - List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); - if(sparks.size() == 1) { - Entity e = (Entity) sparks.get(0); - return (ISparkEntity) e; - } - - return null; - */ - public ISparkEntity getAttachedSpark(); - - /** - * Return true if this Tile no longer requires mana and all Sparks - * transferring mana to it should cancel their transfer. - */ - public boolean areIncomingTranfersDone(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java deleted file mode 100644 index 084b827c..00000000 --- a/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 21, 2014, 5:44:07 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import java.util.Collection; - -/** - * An Entity that implements this is considered a Spark. - */ -public interface ISparkEntity { - - /** - * Which TileEntity is this Spark attached to? A common implementation is checking the block below. - * - int x = MathHelper.floor_double(posX); - int y = MathHelper.floor_double(posY) - 1; - int z = MathHelper.floor_double(posZ); - TileEntity tile = worldObj.getTileEntity(x, y, z); - if(tile != null && tile instanceof ISparkAttachable) - return (ISparkAttachable) tile; - - return null; - */ - public ISparkAttachable getAttachedTile(); - - /** - * Gets a collection of all Sparks this is tranfering to. - */ - public Collection getTransfers(); - - /** - * Registers the Spark passed in as a Spark meant for mana to be transfered towards. - */ - public void registerTransfer(ISparkEntity entity); - - /** - * Gets which upgrade is in this Spark.
- * 0: None
- * 1: Dispersive
- * 2: Dominant
- * 3: Recessive
- * 4: Isolated - */ - public int getUpgrade(); - - /** - * Sets the upgrade on this Spark. See {@link ISparkEntity#getUpgrade} - */ - public void setUpgrade(int upgrade); - - /** - * See {@link ISparkAttachable#areIncomingTranfersDone()} - */ - public boolean areIncomingTransfersDone(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java b/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java deleted file mode 100644 index 6bb3196a..00000000 --- a/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 21, 2014, 7:16:11 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import java.util.List; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public final class SparkHelper { - - public static final int SPARK_SCAN_RANGE = 12; - - public static List getSparksAround(World world, double x, double y, double z) { - return SparkHelper.getEntitiesAround(ISparkEntity.class, world, x, y, z); - } - - public static List getEntitiesAround(Class clazz, World world, double x, double y, double z) { - int r = SPARK_SCAN_RANGE; - List entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r)); - return entities; - } - -} diff --git a/src/api/java/vazkii/botania/api/package-info.java b/src/api/java/vazkii/botania/api/package-info.java deleted file mode 100644 index 82da263c..00000000 --- a/src/api/java/vazkii/botania/api/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(owner = "Botania", apiVersion = "18", provides = "BotaniaAPI") -package vazkii.botania.api; -import cpw.mods.fml.common.API; - diff --git a/src/api/java/vazkii/botania/api/recipe/IElvenItem.java b/src/api/java/vazkii/botania/api/recipe/IElvenItem.java deleted file mode 100644 index e614014d..00000000 --- a/src/api/java/vazkii/botania/api/recipe/IElvenItem.java +++ /dev/null @@ -1,14 +0,0 @@ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; - -/** - * Any Item that implements this is classified as an "Elven Item", by which, - * it'll not go through the alfheim portal. Any item that comes out of it - * must implement this or it'll just go back in. - */ -public interface IElvenItem { - - public boolean isElvenItem(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java b/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java deleted file mode 100644 index fe5bf3cd..00000000 --- a/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Feb 15, 2014, 2:36:35 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * Have an Item implement this to allow it to be used in the Petal Apothecary. - */ -public interface IFlowerComponent { - - public boolean canFit(ItemStack stack, IInventory apothecary); - - public int getParticleColor(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java b/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java deleted file mode 100644 index dbea13e8..00000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java +++ /dev/null @@ -1,94 +0,0 @@ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipeElvenTrade { - - ItemStack output; - List inputs; - - public RecipeElvenTrade(ItemStack output, Object... inputs) { - this.output = output; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(List stacks, boolean remove) { - List inputsMissing = new ArrayList(inputs); - List stacksToRemove = new ArrayList(); - - for(ItemStack stack : stacks) { - if(stack == null) { - continue; - } - if(inputsMissing.isEmpty()) - break; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - if(!stacksToRemove.contains(stack)) - stacksToRemove.add(stack); - oredictIndex = j; - found = true; - break; - } - } - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - if(!stacksToRemove.contains(stack)) - stacksToRemove.add(stack); - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - } - - if(remove) - for(ItemStack r : stacksToRemove) - stacks.remove(r); - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public ItemStack getOutput() { - return output; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java b/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java deleted file mode 100644 index e87b002d..00000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 30, 2014, 5:57:07 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipeManaInfusion { - - ItemStack output; - Object input; - int mana; - boolean isAlchemy = false; - boolean isConjuration = false; - - public RecipeManaInfusion(ItemStack output, Object input, int mana) { - this.output = output; - this.input = input; - this.mana = mana; - } - - public boolean matches(ItemStack stack) { - if(input instanceof ItemStack) - return stack.isItemEqual((ItemStack) input); - - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) - return true; - } - } - - return false; - } - - public void setAlchemy(boolean alchemy) { - isAlchemy = alchemy; - } - - public boolean isAlchemy() { - return isAlchemy; - } - - public void setConjuration(boolean conjuration) { - isConjuration = conjuration; - } - - public boolean isConjuration() { - return isConjuration; - } - - public Object getInput() { - return input; - } - - public ItemStack getOutput() { - return output; - } - - public int getManaToConsume() { - return mana; - } -} - diff --git a/src/api/java/vazkii/botania/api/recipe/RecipePetals.java b/src/api/java/vazkii/botania/api/recipe/RecipePetals.java deleted file mode 100644 index 0dba51ac..00000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipePetals.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 2:02:44 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipePetals { - - ItemStack output; - List inputs; - - public RecipePetals(ItemStack output, Object... inputs) { - this.output = output; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(IInventory inv) { - List inputsMissing = new ArrayList(inputs); - - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if(stack == null) - break; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - oredictIndex = j; - found = true; - break; - } - } - - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - else return false; - } - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public ItemStack getOutput() { - return output; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java b/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java deleted file mode 100644 index 745c9573..00000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Feb 5, 2014, 1:41:14 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; - -public class RecipeRuneAltar extends RecipePetals { - - ItemStack output; - int mana; - - public RecipeRuneAltar(ItemStack output, int mana, Object... inputs) { - super(output, inputs); - this.output = output; - this.mana = mana; - } - - public int getManaUsage() { - return mana; - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java b/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java deleted file mode 100644 index 0ef31493..00000000 --- a/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 7:12:28 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -/** - * The special flowers in botania implement this. Used for cases where - * BlockFlower would be checked against, but isn't convenient for - * the special flowers with effects. For Azanor and Lycaon. - */ -public interface ISpecialFlower { - -} diff --git a/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java b/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java deleted file mode 100644 index ddfaee7f..00000000 --- a/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Aug 26, 2014, 5:42:16 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -/** - * A TileEntity that implements this contains a SubTileEntity. - */ -public interface ISubTileContainer { - - /** - * Gets the SubTile in this block. Generally shouldn't return null, but in that - * case use the fallback DummySubTile. - */ - public SubTileEntity getSubTile(); - - /** - * Sets the SubTile on this block from it's name. - */ - public void setSubTile(String name); - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java b/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java deleted file mode 100644 index 619d00f3..00000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 24, 2014, 3:59:06 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.wand.IWandBindable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Sub-TileEntity, this is used for the flower system. Make sure to map subclasses - * of this using BotaniaAPI.mapSubTile(String, Class). Any subclass of this must have - * a no parameter constructor. - */ -public class SubTileEntity { - - protected TileEntity supertile; - - /** The Tag items should use to store which sub tile they are. **/ - public static final String TAG_TYPE = "type"; - - public void setSupertile(TileEntity tile) { - supertile = tile; - } - - public boolean canUpdate() { - return false; - } - - public void onUpdate() { } - - /** - * Writes some extra data to a network packet. This data is read - * by readFromPacketNBT on the client that receives the packet. - * Note: This method is also used to write to the world NBT. - */ - public void writeToPacketNBT(NBTTagCompound cmp) { } - - /** - * Reads data from a network packet. This data is written by - * writeToPacketNBT in the server. Note: This method is also used - * to read from the world NBT. - */ - public void readFromPacketNBT(NBTTagCompound cmp) { } - - public void sync() { - supertile.getWorldObj().markBlockForUpdate(supertile.xCoord, supertile.yCoord, supertile.zCoord); - } - - public String getUnlocalizedName() { - return BotaniaAPI.getSubTileStringMapping(getClass()); - } - - /** - * Gets the icon for this SubTileEntity, this is a block icon. - */ - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName()); - } - - /** - * Called when a Wand of the Forest is used on this sub tile. Note that the - * player parameter can be null if this is called from a dispenser. - */ - public boolean onWanded(EntityPlayer player, ItemStack wand) { - return false; - } - - /** - * Gets which Lexicon Entry to open when this sub tile is right clicked with a lexicon. - */ - public LexiconEntry getEntry() { - return null; - } - - /** - * Gets the block coordinates this is bound to, for use with the wireframe render - * when the sub tile is being hovered with a wand of the forest. - */ - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding() { - return null; - } - - /** - * @see IWandBindable#canSelect(EntityPlayer, ItemStack, int, int, int, int) - */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return false; - } - - /** - * @see IWandBindable#bindTo(EntityPlayer, ItemStack, int, int, int, int) - */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return false; - } - - /** - * Called on the client when the block being pointed at is the one with this sub tile. - * Used to render a HUD portraying some data from this sub tile. - */ - @SideOnly(Side.CLIENT) - public void renderHUD(Minecraft mc, ScaledResolution res) { - // NO-OP - } -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java deleted file mode 100644 index 7d95afe7..00000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 24, 2014, 8:03:44 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.awt.Color; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.IManaNetwork; -import vazkii.botania.api.mana.IManaPool; - -/** - * The basic class for a Functional Flower. - */ -public class SubTileFunctional extends SubTileEntity { - - private static final String TAG_MANA = "mana"; - - private static final String TAG_POOL_X = "poolX"; - private static final String TAG_POOL_Y = "poolY"; - private static final String TAG_POOL_Z = "poolZ"; - - public int mana; - - public int redstoneSignal = 0; - - int sizeLastCheck = -1; - TileEntity linkedPool = null; - public int knownMana = -1; - - ChunkCoordinates cachedPoolCoordinates = null; - - @Override - public boolean canUpdate() { - return true; - } - - /** - * If set to true, redstoneSignal will be updated every tick. - */ - public boolean acceptsRedstone() { - return false; - } - - @Override - public void onUpdate() { - super.onUpdate(); - - linkPool(); - - if(linkedPool != null) { - IManaPool pool = (IManaPool) linkedPool; - int manaInPool = pool.getCurrentMana(); - int manaMissing = getMaxMana() - mana; - int manaToRemove = Math.min(manaMissing, manaInPool); - pool.recieveMana(-manaToRemove); - addMana(manaToRemove); - } - - if(acceptsRedstone()) { - redstoneSignal = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); - redstoneSignal = Math.max(redstoneSignal, redstoneSide); - } - } - - if(supertile.getWorldObj().isRemote) { - double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; - Color color = new Color(getColor()); - if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); - } - } - - public void linkPool() { - final int range = 10; - - boolean needsNew = false; - if(linkedPool == null) { - needsNew = true; - - if(cachedPoolCoordinates != null && supertile.getWorldObj().blockExists(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ)) { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); - if(tileAt != null && tileAt instanceof IManaPool) { - linkedPool = tileAt; - needsNew = false; - } - cachedPoolCoordinates = null; - } - } - - if(!needsNew) { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - if(!(tileAt instanceof IManaPool)) { - linkedPool = null; - needsNew = true; - } else linkedPool = tileAt; - } - - if(needsNew) { - IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); - if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), range); - sizeLastCheck = size; - } - } - } - - public void addMana(int mana) { - this.mana = Math.min(getMaxMana(), this.mana + mana); - } - - @Override - public boolean onWanded(EntityPlayer player, ItemStack wand) { - if(player == null) - return false; - - knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); - - return super.onWanded(player, wand); - } - - public int getMaxMana() { - return 20; - } - - public int getColor() { - return 0xFFFFFF; - } - - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - mana = cmp.getInteger(TAG_MANA); - - int x = cmp.getInteger(TAG_POOL_X); - int y = cmp.getInteger(TAG_POOL_Y); - int z = cmp.getInteger(TAG_POOL_Z); - - cachedPoolCoordinates = new ChunkCoordinates(x, y, z); - } - - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_MANA, mana); - - int x = linkedPool == null ? 0 : linkedPool.xCoord; - int y = linkedPool == null ? -1 : linkedPool.yCoord; - int z = linkedPool == null ? 0 : linkedPool.zCoord; - - cmp.setInteger(TAG_POOL_X, x); - cmp.setInteger(TAG_POOL_Y, y); - cmp.setInteger(TAG_POOL_Z, z); - } - - @Override - public ChunkCoordinates getBinding() { - if(linkedPool == null) - return null; - return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - } - - @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return true; - } - - @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - int range = 10; - range *= range; - - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); - if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); - if(tile instanceof IManaPool) { - linkedPool = tile; - return true; - } - } - - return false; - } - - @Override - public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); - int color = 0x66000000 | getColor(); - BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java deleted file mode 100644 index 9c44868d..00000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 24, 2014, 8:03:36 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.awt.Color; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.IManaNetwork; -import vazkii.botania.api.mana.IManaCollector; - -/** - * The basic class for a Generating Flower. - */ -public class SubTileGenerating extends SubTileEntity { - - private static final String TAG_MANA = "mana"; - private static final String TAG_TICKS_EXISTED = "ticksExisted"; - - private static final String TAG_COLLECTOR_X = "collectorX"; - private static final String TAG_COLLECTOR_Y = "collectorY"; - private static final String TAG_COLLECTOR_Z = "collectorZ"; - - protected int mana; - - int ticksExisted = 0; - int sizeLastCheck = -1; - protected TileEntity linkedCollector = null; - public int knownMana = -1; - - ChunkCoordinates cachedCollectorCoordinates = null; - - @Override - public boolean canUpdate() { - return true; - } - - @Override - public void onUpdate() { - super.onUpdate(); - - linkCollector(); - - if(canGeneratePassively()) { - int delay = getDelayBetweenPassiveGeneration(); - if(delay > 0 && supertile.getWorldObj().getWorldTime() % delay == 0) { - if(shouldSyncPassiveGeneration()) - sync(); - addMana(getValueForPassiveGeneration()); - } - } - emptyManaIntoCollector(); - - if(supertile.getWorldObj().isRemote) { - double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; - Color color = new Color(getColor()); - if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); - } - - if(!supertile.getWorldObj().isRemote) { - ++ticksExisted; - int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay(); - - if(isPassiveFlower() && muhBalance > 0 && ticksExisted > muhBalance) { - supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType())); - supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); - } - } - } - - public void linkCollector() { - final int range = 6; - - boolean needsNew = false; - if(linkedCollector == null) { - needsNew = true; - - if(cachedCollectorCoordinates != null && supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); - if(tileAt != null && tileAt instanceof IManaCollector) { - linkedCollector = tileAt; - needsNew = false; - } - cachedCollectorCoordinates = null; - } - } - - if(!needsNew) { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); - if(!(tileAt instanceof IManaCollector)) { - linkedCollector = null; - needsNew = true; - } else linkedCollector = tileAt; - } - - if(needsNew) { - IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size(); - if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), range); - sizeLastCheck = size; - } - } - } - - public void addMana(int mana) { - this.mana = Math.min(getMaxMana(), this.mana + mana); - } - - public void emptyManaIntoCollector() { - if(linkedCollector != null) { - IManaCollector collector = (IManaCollector) linkedCollector; - if(!collector.isFull() && mana > 0) { - int manaval = Math.min(mana, collector.getMaxMana() - collector.getCurrentMana()); - mana -= manaval; - collector.recieveMana(manaval); - } - } - } - - public boolean isPassiveFlower() { - return false; - } - - public boolean shouldSyncPassiveGeneration() { - return false; - } - - public boolean canGeneratePassively() { - return false; - } - - public int getDelayBetweenPassiveGeneration() { - return 20; - } - - public int getValueForPassiveGeneration() { - return 1; - } - - @Override - public boolean onWanded(EntityPlayer player, ItemStack wand) { - if(player == null) - return false; - - if(!player.worldObj.isRemote) - sync(); - - knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); - - return super.onWanded(player, wand); - } - - public int getMaxMana() { - return 20; - } - - public int getColor() { - return 0xFFFFFF; - } - - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - mana = cmp.getInteger(TAG_MANA); - if(!cmp.hasKey(TAG_TICKS_EXISTED)) - ticksExisted = cmp.getInteger(TAG_TICKS_EXISTED); - - int x = cmp.getInteger(TAG_COLLECTOR_X); - int y = cmp.getInteger(TAG_COLLECTOR_Y); - int z = cmp.getInteger(TAG_COLLECTOR_Z); - - cachedCollectorCoordinates = new ChunkCoordinates(x, y, z); - } - - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_MANA, mana); - cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted); - - int x = linkedCollector == null ? 0 : linkedCollector.xCoord; - int y = linkedCollector == null ? -1 : linkedCollector.yCoord; - int z = linkedCollector == null ? 0 : linkedCollector.zCoord; - - cmp.setInteger(TAG_COLLECTOR_X, x); - cmp.setInteger(TAG_COLLECTOR_Y, y); - cmp.setInteger(TAG_COLLECTOR_Z, z); - } - - @Override - public ChunkCoordinates getBinding() { - if(linkedCollector == null) - return null; - return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); - } - - @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return true; - } - - @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - int range = 6; - range *= range; - - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); - if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); - if(tile instanceof IManaCollector) { - linkedCollector = tile; - return true; - } - } - - return false; - } - - @Override - public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); - int color = 0x66000000 | getColor(); - BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); - } - -} diff --git a/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java b/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java deleted file mode 100644 index f7c8036d..00000000 --- a/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java +++ /dev/null @@ -1,18 +0,0 @@ -package vazkii.botania.api.wand; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * The item equivalent of ITileBound, renders when the - * item is in hand. - * @see ITileBound - */ -public interface ICoordBoundItem { - - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/wand/ITileBound.java b/src/api/java/vazkii/botania/api/wand/ITileBound.java deleted file mode 100644 index 25a8683c..00000000 --- a/src/api/java/vazkii/botania/api/wand/ITileBound.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Mar 24, 2014, 6:47:53 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Any TileEntity that implements this is technically bound - * to something, and the binding will be shown when hovering - * over with a Wand of the Forest. - */ -public interface ITileBound { - - /** - * Gets where this block is bound to, can return null. - */ - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandBindable.java b/src/api/java/vazkii/botania/api/wand/IWandBindable.java deleted file mode 100644 index 02d0771c..00000000 --- a/src/api/java/vazkii/botania/api/wand/IWandBindable.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Oct 9, 2014, 3:01:58 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; - -/** - * A TileEntity that implements this can be bound to another block - * via the Wand of the Forest. Also see IWireframeAABBProvider to change - * the displayed bounding box. - */ -public interface IWandBindable extends ITileBound { - - /** - * Return true if the Wand can select this tile. - */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); - - /** - * Call to bind the TileEntity to where the player clicked. Return true to deselect - * the TileEntity for another bind or false case the TileEntity should stay selected. - */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandHUD.java b/src/api/java/vazkii/botania/api/wand/IWandHUD.java deleted file mode 100644 index 57c7e313..00000000 --- a/src/api/java/vazkii/botania/api/wand/IWandHUD.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Feb 5, 2014, 1:34:44 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.world.World; - -/** - * Any block that implements this has a HUD rendered when being hovered - * with a Wand of the Forest. - */ -public interface IWandHUD { - - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandable.java b/src/api/java/vazkii/botania/api/wand/IWandable.java deleted file mode 100644 index 0cdcf1f1..00000000 --- a/src/api/java/vazkii/botania/api/wand/IWandable.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jan 22, 2014, 5:12:53 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Any block that implements this can be used with the Wand for the Forest for some purpose. - */ -public interface IWandable { - - /** - * Called when the block is used by a wand. Note that the player parameter can be null - * if this function is called from a dispenser. - */ - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java b/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java deleted file mode 100644 index d20b6660..00000000 --- a/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Apr 19, 2014, 7:23:59 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -/** - * A block that implements this can provide a custom AABB - * for rendering the wireframe with ITileBound. - */ -public interface IWireframeAABBProvider { - - public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java deleted file mode 100644 index 42e61147..00000000 --- a/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Sep 2, 2014, 5:57:35 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -/** - * An interface for a Wiki Provider, these are registered to allow a mod to provide a wiki - * for all the blocks in them, used for the world interaction with the Lexica Botania. - * A simple, mostly all-inclusive implementation can be found on SimpleWikiProvider. - */ -public interface IWikiProvider { - - /** - * Gets the name of the block being looked at for display. - */ - public String getBlockName(World world, MovingObjectPosition pos); - - /** - * Gets the URL to open when the block is clicked. - */ - public String getWikiURL(World world, MovingObjectPosition pos); - - /** - * Gets the name of the wiki for display. - */ - public String getWikiName(World world, MovingObjectPosition pos); - -} diff --git a/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java deleted file mode 100644 index 6105c718..00000000 --- a/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Sep 2, 2014, 5:58:39 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import org.apache.commons.lang3.text.WordUtils; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -public class SimpleWikiProvider implements IWikiProvider { - - final String name, urlBase, replacement; - - public SimpleWikiProvider(String name, String urlBase) { - this(name, urlBase, "%20"); - } - - public SimpleWikiProvider(String name, String urlBase, String replacement) { - this.name = name; - this.urlBase = urlBase; - this.replacement = replacement; - } - - @Override - public String getBlockName(World world, MovingObjectPosition pos) { - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; - - Block block = world.getBlock(x, y, z); - if(block == null) - return null; - - ItemStack stack = block.getPickBlock(pos, world, x, y, z); - - if(stack == null || stack.getItem() == null) - stack = new ItemStack(block, 1, world.getBlockMetadata(x, y, z)); - - if(stack.getItem() == null) - return null; - - String name = stack.getDisplayName(); - if(name == null || name.isEmpty()) - return null; - - return name; - } - - @Override - public String getWikiURL(World world, MovingObjectPosition pos) { - String name = getBlockName(world, pos); - if(name == null) - return null; - return String.format(urlBase, WordUtils.capitalizeFully(name).replaceAll(" ", replacement)); - } - - @Override - public String getWikiName(World world, MovingObjectPosition pos) { - return name; - } - -} diff --git a/src/api/java/vazkii/botania/api/wiki/WikiHooks.java b/src/api/java/vazkii/botania/api/wiki/WikiHooks.java deleted file mode 100644 index 40f586e6..00000000 --- a/src/api/java/vazkii/botania/api/wiki/WikiHooks.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Sep 2, 2014, 6:05:03 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; - -public class WikiHooks { - - private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://wiki.feed-the-beast.com/%s"); - - private static final Map modWikis = new HashMap(); - - public static IWikiProvider getWikiFor(Block block) { - UniqueIdentifier mod = GameRegistry.findUniqueIdentifierFor(block); - return getWikiFor(mod.modId.toLowerCase()); - } - - public static IWikiProvider getWikiFor(String mod) { - if(!modWikis.containsKey(mod)) - modWikis.put(mod, FALLBACK_PROVIDER); - - return modWikis.get(mod); - } - - public static void registerModWiki(String mod, IWikiProvider provider) { - modWikis.put(mod.toLowerCase(), provider); - } - -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 8bfd9b9f..0a44d55d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -66,7 +66,6 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.cse.ice.*; import WayofTime.alchemicalWizardry.common.spell.complex.effect.cse.wind.*; import WayofTime.alchemicalWizardry.common.spell.simple.*; import WayofTime.alchemicalWizardry.common.summoning.SummoningHelperAW; -import WayofTime.alchemicalWizardry.common.thread.CommandDownloadGAPI; import WayofTime.alchemicalWizardry.common.tileEntity.*; import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler; import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration; @@ -104,7 +103,7 @@ import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; -@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.3", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") +@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "GRADLETOKEN_VERSION", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") public class AlchemicalWizardry { public static boolean parseTextFiles = false; @@ -1824,7 +1823,6 @@ public class AlchemicalWizardry // event.registerServerCommand(new CommandBind()); // event.registerServerCommand(new CommandUnbind()); // event.registerServerCommand(new CommandSN()); - event.registerServerCommand(new CommandDownloadGAPI()); event.registerServerCommand(new CommandBloodMagic()); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java index 9c1112ff..db2fb9d6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java @@ -84,7 +84,6 @@ import WayofTime.alchemicalWizardry.common.renderer.model.ModelWingedFireDemon; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBazookaMainProjectile; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor; -import WayofTime.alchemicalWizardry.common.thread.GAPIChecker; import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; @@ -196,6 +195,5 @@ public class ClientProxy extends CommonProxy MinecraftForge.EVENT_BUS.register(ob); KeyBindings.init(); MinecraftForge.EVENT_BUS.register(new ScrollHelper()); - new GAPIChecker().init(); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java index 1a10f2da..b8b156fa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java @@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items.forestry; import java.util.List; +import forestry.api.apiculture.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,13 +12,11 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IHiveFrame; public class ItemBloodFrame extends EnergyItems implements IHiveFrame { + private final IBeeModifier beeModifier = new BloodFrameBeeModifier(); + public ItemBloodFrame() { super(); @@ -27,6 +26,59 @@ public class ItemBloodFrame extends EnergyItems implements IHiveFrame setCreativeTab(AlchemicalWizardry.tabBloodMagic); } + private static class BloodFrameBeeModifier implements IBeeModifier { + + @Override + public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { + return 1; + } + + @Override + public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { + return 0.0001f; + } + + @Override + public float getProductionModifier(IBeeGenome genome, float currentModifier) { + return 0; + } + + @Override + public float getFloweringModifier(IBeeGenome genome, float currentModifier) { + return 1; + } + + @Override + public float getGeneticDecay(IBeeGenome genome, float currentModifier) { + return 1; + } + + @Override + public boolean isSealed() { + return false; + } + + @Override + public boolean isSelfLighted() { + return false; + } + + @Override + public boolean isSunlightSimulated() { + return false; + } + + @Override + public boolean isHellish() { + return false; + } + + @Override + public float getTerritoryModifier(IBeeGenome genome, float currentModifier) { + return 1; + } + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -61,85 +113,23 @@ public class ItemBloodFrame extends EnergyItems implements IHiveFrame return par1ItemStack; } - @Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } - - @Override public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } - - @Override public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - // TODO Auto-generated method stub - return 0.0001f; - } - - @Override public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 0; - } - - @Override public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } - - @Override public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } - - @Override public boolean isSealed() - { - // TODO Auto-generated method stub - return false; - } - - @Override public boolean isSelfLighted() - { - // TODO Auto-generated method stub - return false; - } - - @Override public boolean isSunlightSimulated() - { - // TODO Auto-generated method stub - return false; - } - - @Override public boolean isHellish() - { - // TODO Auto-generated method stub - return false; - } - - @Override public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) - { - // TODO Auto-generated method stub - if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear)) - { - EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear); - return frame; - }else - { - frame.setItemDamage(frame.getItemDamage() + wear); - if(frame.getItemDamage()>=frame.getMaxDamage()) - { - return null; - } - return frame; - } - - } - - + @Override + public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) { + // TODO Auto-generated method stub + if (EnergyItems.canSyphonInContainer(frame, getEnergyUsed() * wear)) { + EnergyItems.syphonWhileInContainer(frame, getEnergyUsed() * wear); + return frame; + } else { + frame.setItemDamage(frame.getItemDamage() + wear); + if (frame.getItemDamage() >= frame.getMaxDamage()) { + return null; + } + return frame; + } + } + @Override + public IBeeModifier getBeeModifier() { + return beeModifier; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/thread/CommandDownloadGAPI.java b/src/main/java/WayofTime/alchemicalWizardry/common/thread/CommandDownloadGAPI.java deleted file mode 100644 index 97f5f683..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/thread/CommandDownloadGAPI.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 31, 2014, 10:22:44 PM (GMT)] - */ -package WayofTime.alchemicalWizardry.common.thread; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; - -public class CommandDownloadGAPI extends CommandBase -{ - private static final boolean ENABLED = true; - - @Override - public String getCommandName() - { - return "bloodmagic-download-g-api"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - return "/bloodmagic-download-g-api"; - } - - @Override - public void processCommand(ICommandSender var1, String[] var2) - { - if (!ENABLED) - var1.addChatMessage(new ChatComponentTranslation("bm.versioning.disabled").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); - - else - if (GAPIChecker.downloadedFile) - var1.addChatMessage(new ChatComponentTranslation("bm.versioning.downloadedAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); - else if (GAPIChecker.startedDownload) - var1.addChatMessage(new ChatComponentTranslation("bm.versioning.downloadingAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); - else new ThreadDownloadGAPI("Guide-API-1.7.10-" + GAPIChecker.onlineVersion + ".jar"); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/thread/GAPIChecker.java b/src/main/java/WayofTime/alchemicalWizardry/common/thread/GAPIChecker.java deleted file mode 100644 index a8a063d5..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/thread/GAPIChecker.java +++ /dev/null @@ -1,113 +0,0 @@ -package WayofTime.alchemicalWizardry.common.thread; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.*; - -import java.io.*; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -public class GAPIChecker -{ - public static boolean doneChecking = false; - public static String onlineVersion = "@VERSION@"; - public static boolean triedToWarnPlayer = false; - - public static boolean startedDownload = false; - public static boolean downloadedFile = false; - - private File modsDir; - - public void init() - { - FMLCommonHandler.instance().bus().register(this); - File mcDir = (File)cpw.mods.fml.relauncher.FMLInjectionData.data()[6]; - - this.modsDir = new File(mcDir, "mods"); - - scanDepInfos(); - } - - private void scanDepInfos() - { - for (File file : modFiles()) - { - if ((file.getName().endsWith(".jar")) && file.getName().contains("BloodMagic")) - { - scanDepInfo(file); - } - } - } - - private void scanDepInfo(File file) - { - try - { - ZipFile zip = new ZipFile(file); - ZipEntry e = zip.getEntry("Guide-API-Version.info"); - if (e == null) - { - e = zip.getEntry("Guide-API-Version.info"); - } - if (e != null) - { - readConfigFile(zip.getInputStream(e)); - } - zip.close(); - } - catch (Exception e) - { - System.err.println("Failed to load dependencies.info from " + file.getName() + " as JSON"); - e.printStackTrace(); - } - } - - private List modFiles() - { - List list = new LinkedList(); - list.addAll(Arrays.asList(this.modsDir.listFiles())); - return list; - } - - private void readConfigFile(InputStream inputStream) throws IOException - { - if (inputStream != null) - { - try - { - BufferedReader r = new BufferedReader(new InputStreamReader(inputStream)); - onlineVersion = r.readLine(); - doneChecking = true; - r.close(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) - { - if (!Loader.isModLoaded("guideapi")) - { - if (event.phase == TickEvent.Phase.END && Minecraft.getMinecraft().thePlayer != null && !triedToWarnPlayer) - { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - IChatComponent component = IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("bm.versioning.getGAPI")); - player.addChatComponentMessage(component); - } - - triedToWarnPlayer = true; - } - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/thread/ThreadDownloadGAPI.java b/src/main/java/WayofTime/alchemicalWizardry/common/thread/ThreadDownloadGAPI.java deleted file mode 100644 index 7ea67b5c..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/thread/ThreadDownloadGAPI.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 31, 2014, 10:22:44 PM (GMT)] - */ -package WayofTime.alchemicalWizardry.common.thread; - -import net.minecraft.client.Minecraft; -import net.minecraft.util.*; -import net.minecraftforge.common.MinecraftForge; - -import java.awt.*; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -public class ThreadDownloadGAPI extends Thread -{ - String fileName; - - byte[] buffer = new byte[10240]; - - int totalBytesDownloaded; - int bytesJustDownloaded; - - InputStream webReader; - - public ThreadDownloadGAPI(String fileName) - { - setName("Blood Magic Download Guide-API Thread"); - this.fileName = fileName; - setDaemon(true); - start(); - } - - @Override - public void run() - { - try - { - IChatComponent component = IChatComponent.Serializer.func_150699_a(String.format(StatCollector.translateToLocal("bm.versioning.startingDownload"), fileName)); - - if (Minecraft.getMinecraft().thePlayer != null) - { - Minecraft.getMinecraft().thePlayer.addChatMessage(component); - } - - GAPIChecker.startedDownload = true; - - String base = "http://minecraft.curseforge.com/mc-mods/228832-guide-api"; - URL url = new URL(base + "/files/latest"); - - try - { - url.openStream().close(); // Add to DL Counter - } - catch(IOException e) {} - - webReader = url.openStream(); - - File dir = new File(".", "mods"); - File f = new File(dir, "Guide-API-" + MinecraftForge.MC_VERSION + "-" + GAPIChecker.onlineVersion + ".jar"); - f.createNewFile(); - - FileOutputStream outputStream = new FileOutputStream(f.getAbsolutePath()); - - while ((bytesJustDownloaded = webReader.read(buffer)) > 0) - { - outputStream.write(buffer, 0, bytesJustDownloaded); - buffer = new byte[10240]; - totalBytesDownloaded += bytesJustDownloaded; - } - - if (Minecraft.getMinecraft().thePlayer != null) - { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentTranslation("bm.versioning.doneDownloading", fileName).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN))); - } - - Desktop.getDesktop().open(dir); - GAPIChecker.downloadedFile = true; - - outputStream.close(); - webReader.close(); - finalize(); - } - catch (Throwable e) - { - e.printStackTrace(); - } - } - - private void sendError() - { - if (Minecraft.getMinecraft().thePlayer != null) - { - Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentTranslation("bm.versioning.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); - } - } -} diff --git a/src/main/resources/Guide-API-Version.info b/src/main/resources/Guide-API-Version.info deleted file mode 100644 index 27323dad..00000000 --- a/src/main/resources/Guide-API-Version.info +++ /dev/null @@ -1 +0,0 @@ -@VERSION@ \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 94acc845..a3d8e89e 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,10 +1,10 @@ [ { - "modid": "AWWayofTime", - "name": "Blood Magic: Alchemical Wizardry", + "modid": "${modId}", + "name": "${modName}", "description": "Rituals, spells, and more!", - "version": "${version}", - "mcversion": "${mcversion}", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", "url": "http://www.minecraftforum.net/topic/1899223-", "updateUrl": "", "authorList": ["WayofTime"], diff --git a/src/main/resources/todo.txt b/src/main/resources/todo.txt deleted file mode 100644 index 8c06bf8c..00000000 --- a/src/main/resources/todo.txt +++ /dev/null @@ -1,2 +0,0 @@ --Create effect for the light ritual block. --Create effect for the fire ritual block. \ No newline at end of file