Merge pull request #32 from GTNewHorizons/unified-build-script
Unified build script
No files matched your search
@@ -1,42 +1,29 @@
|
||||
#ant stuff
|
||||
/bin/
|
||||
/download/
|
||||
#Remove OS generated garbage
|
||||
*/.DS_Store
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
Icon?
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
#gradle stuff
|
||||
/.gradle
|
||||
.gradle
|
||||
.settings
|
||||
/.idea/
|
||||
/run/
|
||||
/build/
|
||||
/run*/
|
||||
/ui/
|
||||
gradle-app.setting
|
||||
#IDEA files from Gradle
|
||||
.idea/
|
||||
/*.iml
|
||||
/*.ipr
|
||||
/*.iws
|
||||
#Vim backups
|
||||
*~
|
||||
#manual version override
|
||||
version.properties
|
||||
#eclipse stuffs
|
||||
/.classpath
|
||||
/.project
|
||||
/.settings/
|
||||
/eclipse/
|
||||
/debug/
|
||||
*.lock
|
||||
/.metadata/
|
||||
.classpath
|
||||
.project
|
||||
/bin/
|
||||
/config/
|
||||
/crash-reports/
|
||||
/logs/
|
||||
options.txt
|
||||
/saves/
|
||||
/out
|
||||
libs/
|
||||
*.bat
|
||||
usernamecache.json
|
||||
banned-ips.json
|
||||
banned-players.json
|
||||
eula.txt
|
||||
ops.json
|
||||
server.properties
|
||||
servers.dat
|
||||
usercache.json
|
||||
whitelist.json
|
||||
world/
|
||||
/out/
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
@@ -1,20 +1,30 @@
|
||||
import org.codehaus.groovy.runtime.GStringImpl
|
||||
//version: a553e159ecaf0fc236cf25b2c124ea90f92bb140
|
||||
/*
|
||||
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
|
||||
import java.util.Properties
|
||||
import groovy.util.ConfigSlurper
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
maven {
|
||||
name = "gt"
|
||||
url = "https://gregtech.overminddl1.com/"
|
||||
}
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
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"
|
||||
@@ -22,17 +32,27 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT"
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4'
|
||||
}
|
||||
}
|
||||
|
||||
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'
|
||||
|
||||
def projectJavaVersion = JavaLanguageVersion.of(8)
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(projectJavaVersion)
|
||||
}
|
||||
}
|
||||
apply plugin: "java"
|
||||
apply plugin: "idea"
|
||||
apply plugin: "forge"
|
||||
apply plugin: "signing"
|
||||
|
||||
idea {
|
||||
module {
|
||||
@@ -42,139 +62,463 @@ idea {
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
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")
|
||||
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
resources {
|
||||
srcDir 'resources'
|
||||
|
||||
String javaSourceDir = "src/main/java/"
|
||||
String scalaSourceDir = "src/main/scala/"
|
||||
|
||||
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
if((new File(targetPackageJava).exists() || new File(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((new File(targetPackageJava).exists() || new File(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(new File(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((new File(targetPackageJava).exists() || new File(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((new File(targetFileJava).exists() || new File(targetFileScala).exists() || new File(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((new File(targetFileJava).exists() || new File(targetFileScala).exists() || new File(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
|
||||
version = minecraftVersion + "-" + gitVersion()
|
||||
group = modGroup
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Define properties file
|
||||
ext.configFile = file "build.properties"
|
||||
|
||||
configFile.withReader {
|
||||
// Load config. It shall from now be referenced as simply config or project.config
|
||||
def prop = new Properties()
|
||||
prop.load(it)
|
||||
project.ext.config = new ConfigSlurper().parse prop
|
||||
if(file("addon.gradle").exists()) {
|
||||
apply from: "addon.gradle"
|
||||
}
|
||||
|
||||
// Finds and sets version data
|
||||
task buildInfo {
|
||||
def cmd = "git rev-parse --short HEAD"
|
||||
def proc = cmd.execute()
|
||||
proc.waitFor()
|
||||
if (proc.exitValue() == 0) {
|
||||
ext.revision = proc.text.trim()
|
||||
} else {
|
||||
ext.revision = "GITBORK"
|
||||
}
|
||||
apply from: 'repositories.gradle'
|
||||
|
||||
if (System.getenv().BUILD_NUMBER != null) {
|
||||
ext.buildNum = "build${System.getenv().BUILD_NUMBER}"
|
||||
} else {
|
||||
ext.buildNum = "DEV.${project.buildInfo.revision}"
|
||||
}
|
||||
}
|
||||
ext.artifact_version = 'NFG'
|
||||
if (System.getenv().ARTIFACT_VERSION == null) {
|
||||
artifact_version = "${config.mod_version}.${project.buildInfo.buildNum}" as GStringImpl
|
||||
}
|
||||
if (System.getenv().ARTIFACT_VERSION != null) {
|
||||
artifact_version = "${System.getenv().ARTIFACT_VERSION}" as GStringImpl
|
||||
}
|
||||
|
||||
group = 'tconstruct'
|
||||
version = "${config.minecraft_version}-${artifact_version}"
|
||||
|
||||
minecraft {
|
||||
version = config.minecraft_version + "-" + config.forge_version
|
||||
runDir = 'run'
|
||||
replace '${version}', project.version
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
inputs.property "version", artifact_version
|
||||
inputs.property "MCversion", config.minecraft_version
|
||||
|
||||
// Replace stuff in text files, not binaries.
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include '**/*.info'
|
||||
// Replace version and MCversion
|
||||
expand 'version':artifact_version,'MCversion':config.minecraft_version
|
||||
}
|
||||
|
||||
// Copy everything else that's not text
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude '**/*.info'
|
||||
}
|
||||
configurations {
|
||||
implementation.extendsFrom(shadowImplementation)
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'CB Maven FS'
|
||||
url "http://chickenbones.net/maven/"
|
||||
name = "Overmind forge repo mirror"
|
||||
url = "https://gregtech.overminddl1.com/"
|
||||
}
|
||||
maven {
|
||||
name 'DVS1 Maven FS'
|
||||
url 'http://dvs1.progwml6.com/files/maven'
|
||||
}
|
||||
maven {
|
||||
name = 'code chicken lib'
|
||||
url 'https://maven.cil.li/'
|
||||
if(usesMixins.toBoolean()) {
|
||||
maven {
|
||||
name = "sponge"
|
||||
url = "https://repo.spongepowered.org/repository/maven-public"
|
||||
}
|
||||
maven {
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "mantle:Mantle:${config.minecraft_version}-${config.mantle_version}:deobf"
|
||||
compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.CCLIB_version}:dev"
|
||||
compile "codechicken:CodeChickenCore:${config.minecraft_version}-${config.ccc_version}:dev"
|
||||
compile "codechicken:NotEnoughItems:${config.minecraft_version}-${config.NEI_version}:dev"
|
||||
compile "codechicken:ForgeMultipart:${config.minecraft_version}-${config.fmp_version}:dev"
|
||||
//compile "mcp.mobius.waila:Waila:${config.waila_version}:dev"
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
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()) {
|
||||
new File(projectDir.toString() + "/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"
|
||||
}
|
||||
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
// Add Coremod Manifest
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'FMLAT': 'TConstruct_at.cfg'
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(shadowJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
// Create deobf dev jars
|
||||
task deobfJar(type: Jar) {
|
||||
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
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from (sourceSets.main.allJava)
|
||||
from (file("$projectDir/LICENSE"))
|
||||
getArchiveClassifier().set('sources')
|
||||
}
|
||||
|
||||
task shadowDevJar(type: ShadowJar) {
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("deobf")
|
||||
manifest {
|
||||
attributes 'FMLAT': 'TConstruct_at.cfg'
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation]
|
||||
}
|
||||
|
||||
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowDevJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
task circularResolverJar(type: Jar) {
|
||||
dependsOn(relocateShadowDevJar)
|
||||
dependsOn(shadowDevJar)
|
||||
enabled = false
|
||||
}
|
||||
|
||||
task devJar(type: Jar) {
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(circularResolverJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
// Create API library jar
|
||||
task libJar(type: Jar) {
|
||||
from(sourceSets.main.allSource) {
|
||||
include "tconstruct/library/**/*"
|
||||
task apiJar(type: Jar) {
|
||||
from (sourceSets.main.allJava) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**'
|
||||
}
|
||||
getArchiveClassifier().set 'lib'
|
||||
}
|
||||
|
||||
// Create Maven source jar
|
||||
task sourceJar(type: Jar, dependsOn:classes) {
|
||||
getArchiveClassifier().set 'sources'
|
||||
from sourceSets.main.allSource
|
||||
from (sourceSets.main.output) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.resources.srcDirs) {
|
||||
include("LICENSE")
|
||||
}
|
||||
|
||||
getArchiveClassifier().set('api')
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives deobfJar
|
||||
archives libJar
|
||||
archives sourceJar
|
||||
}
|
||||
archives sourcesJar
|
||||
archives devJar
|
||||
if(apiPackage) {
|
||||
archives apiJar
|
||||
}
|
||||
}
|
||||
|
||||
// Crude handler to append custom maven repositories to maven dependency
|
||||
install{
|
||||
repositories{
|
||||
mavenInstaller{
|
||||
pom.withXml {
|
||||
def repositoriesNode = asNode().appendNode("repositories")
|
||||
project.repositories.each { repository ->
|
||||
def repositoryNode = repositoriesNode.appendNode("repository")
|
||||
repositoryNode.appendNode("name", repository.name)
|
||||
repositoryNode.appendNode("url", repository.properties.get("url"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Updating
|
||||
task updateBuildScript {
|
||||
doLast {
|
||||
if (updateBuildScript()) return
|
||||
|
||||
print("Build script already up-to-date!")
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewBuildScriptVersionAvailable()) {
|
||||
if (autoUpdateBuildScript.toBoolean()) {
|
||||
updateBuildScript()
|
||||
} 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")
|
||||
}
|
||||
|
||||
static boolean updateBuildScript() {
|
||||
if (isNewBuildScriptVersionAvailable()) {
|
||||
def buildscriptFile = new File("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
|
||||
}
|
||||
|
||||
static boolean isNewBuildScriptVersionAvailable() {
|
||||
Map parameters = ["connectTimeout": 2000, "readTimeout": 2000]
|
||||
|
||||
String currentBuildScript = new File("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'
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
minecraft_version=1.7.10
|
||||
forge_version=10.13.4.1614-1.7.10
|
||||
mantle_version=0.3.2.jenkins187
|
||||
CCLIB_version=1.1.3.136
|
||||
NEI_version=1.0.4.106
|
||||
ccc_version=1.0.6.43
|
||||
mod_version=1.9.0.3-GTNH
|
||||
waila_version=1.5.3_1.7.10
|
||||
fmp_version=1.1.2.334
|
||||
@@ -0,0 +1,18 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile("com.github.GTNewHorizons:Mantle:master-SNAPSHOT:dev")
|
||||
compile("com.github.GTNewHorizons:ForgeMultipart:master-SNAPSHOT:dev")
|
||||
compileOnly("com.github.GTNewHorizons:inventory-tweaks:master-SNAPSHOT:api")
|
||||
compileOnly("com.github.GTNewHorizons:waila:master-SNAPSHOT:api")
|
||||
compileOnly("com.github.GTNewHorizons:Battlegear2:master-SNAPSHOT:api") {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
compile("curse.maven:cofh-core-69162:2388751")
|
||||
compileOnly("curse.maven:minefactory-reloaded-66672:2366150")
|
||||
compileOnly("curse.maven:zelda-sword-skills-220540:2384889")
|
||||
compileOnly("curse.maven:dynamic-sword-skills-226360:2495462")
|
||||
compileOnly("curse.maven:notenoughkeys-224614:2276280")
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
|
||||
}
|
||||
@@ -1,291 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="Tinker Style" version="12">
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="200"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -0,0 +1,60 @@
|
||||
modName = Tinkers' Construct
|
||||
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
modId = TConstruct
|
||||
|
||||
modGroup = tconstruct
|
||||
|
||||
# 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 = TConstruct.java
|
||||
gradleTokenModId = GRADLETOKEN_MODID
|
||||
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 = library
|
||||
|
||||
# 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 = TConstruct_at.cfg
|
||||
|
||||
# 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 IMixinPlugin. 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
|
||||
@@ -1,5 +1,5 @@
|
||||
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-5.6.4-all.zip
|
||||
@@ -1,5 +1,21 @@
|
||||
#!/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.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@@ -28,7 +44,7 @@ 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=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@@ -109,8 +125,8 @@ 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"`
|
||||
|
||||
@@ -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
|
||||
@@ -14,7 +30,7 @@ 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=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
before_install:
|
||||
- ./gradlew setupCIWorkspace
|
||||
@@ -0,0 +1,10 @@
|
||||
// Add any additional repositiroes for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "https://cursemaven.com"
|
||||
}
|
||||
maven {
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* This settings file was auto generated by the Gradle buildInit task
|
||||
* by 'sunstrike' at '21/11/13 14:14' with Gradle 1.9
|
||||
*
|
||||
* The settings file is used to specify which projects to include in your build.
|
||||
* In a single project build this file can be empty or even removed.
|
||||
*
|
||||
* Detailed information about configuring a multi-project build in Gradle can be found
|
||||
* in the user guide at http://gradle.org/docs/1.9/userguide/multi_project_builds.html
|
||||
*/
|
||||
|
||||
/*
|
||||
// To declare projects as part of a multi-project build use the 'include' method
|
||||
include 'shared'
|
||||
include 'api'
|
||||
include 'services:webservice'
|
||||
*/
|
||||
|
||||
rootProject.name = 'TConstruct'
|
||||
@@ -1,52 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes that support external manipulation of their internal energy storages.
|
||||
*
|
||||
* A reference implementation is provided {@link ItemEnergyContainer}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyContainerItem {
|
||||
|
||||
/**
|
||||
* Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be charged.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to be sent into the item.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received by the item.
|
||||
*/
|
||||
int receiveEnergy(ItemStack container, int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally
|
||||
* discharged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be discharged.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to be extracted from the item.
|
||||
* @param simulate
|
||||
* If TRUE, the discharge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted from the item.
|
||||
*/
|
||||
int extractEnergy(ItemStack container, int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Get the amount of energy currently stored in the container item.
|
||||
*/
|
||||
int getEnergyStored(ItemStack container);
|
||||
|
||||
/**
|
||||
* Get the max amount of energy that can be stored in the container item.
|
||||
*/
|
||||
int getMaxEnergyStored(ItemStack container);
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package cofh.core.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IEqualityOverrideItem {
|
||||
|
||||
public boolean isLastHeldItemEqual(ItemStack current, ItemStack previous);
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/**
|
||||
Copyright (C) <2015> <coolAlias>
|
||||
This file is part of coolAlias' Dynamic Sword Skills Minecraft Mod; as such,
|
||||
you can redistribute it and/or modify it under the terms of the GNU
|
||||
General Public License as published by the Free Software Foundation,
|
||||
either version 3 of the License, or (at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package dynamicswordskills.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* For the purpose of using certain skills, this item will be considered a sword.
|
||||
*
|
||||
* Skills which require a sword are:
|
||||
* {@link LeapingBlow}, {@link MortalDraw}, and {@link RisingCut}
|
||||
*
|
||||
*/
|
||||
public interface ISword {
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package invtweaks.api.container;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* A marker for containers that have a chest-like persistant storage component. Enables the Inventroy Tweaks sorting
|
||||
* buttons for this container.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface ChestContainer {
|
||||
// Set to true if the Inventory Tweaks sorting buttons should be shown for this container.
|
||||
boolean showButtons() default true;
|
||||
|
||||
// Size of a chest row
|
||||
int rowSize() default 9;
|
||||
|
||||
// Uses 'large chest' mode for sorting buttons
|
||||
// (Renders buttons vertically down the right side of the GUI)
|
||||
boolean isLargeChest() default false;
|
||||
|
||||
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
|
||||
// Signature int func()
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface RowSizeCallback {
|
||||
}
|
||||
|
||||
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
|
||||
// Signature int func()
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface IsLargeCallback {
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@Deprecated
|
||||
public interface IWailaBlock {
|
||||
/*
|
||||
* Use this method to return an item stack in case the default lookup system fails.
|
||||
* Return null if you want to use the default lookup system.
|
||||
* You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities
|
||||
*/
|
||||
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
|
||||
/* Waila HUD is divided into 3 zones. The head corresponds to the item name,
|
||||
* body to where you mostly want to put informations, and I reserve the tail for modname display
|
||||
*/
|
||||
|
||||
/* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD.
|
||||
* You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack().
|
||||
* ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info.
|
||||
* currenttip represents the current list of text lines in the tooltip zone.
|
||||
* For example, getWailaHead() will have the current item name as currenttip.
|
||||
* You can modify the tips, add more, remove some, etc.
|
||||
* When you are done, just returns the currenttip and it will display in Waila.
|
||||
*
|
||||
* Always return the currenttip is you don't want to modify the current zone.
|
||||
*/
|
||||
|
||||
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWailaBlockDecorator {
|
||||
|
||||
void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
public interface IWailaConfigHandler {
|
||||
/* Returns a set of all the currently loaded modules in the config handler */
|
||||
public Set<String> getModuleNames();
|
||||
|
||||
/* Returns all the currently available options for a given module */
|
||||
public HashMap<String, String> getConfigKeys(String modName);
|
||||
|
||||
/* Add a new option to a given module
|
||||
*
|
||||
* modName is the name of the module to add the option to (ie : Buildcraft, IndustrialCraft2, etc)
|
||||
* key is the config key (ie : bc.tankcontent, ic2.inputvalue)
|
||||
* name is the human readable name of the option (ie : "Tank content", "Max EU Input")
|
||||
* */
|
||||
//public void addConfig(String modName, String key, String name);
|
||||
|
||||
/* Returns the current value of an option (true/false) with a default value defvalue if not set*/
|
||||
public boolean getConfig(String key, boolean defvalue);
|
||||
|
||||
/* Returns the current value of an option (true/false) with a default value true if not set*/
|
||||
public boolean getConfig(String key);
|
||||
|
||||
//public void setConfig(String key, boolean value);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/* The Accessor is used to get some basic data out of the game without having to request
|
||||
* direct access to the game engine.
|
||||
* It will also return things that are unmodified by the overriding systems (like getWailaStack).
|
||||
*/
|
||||
|
||||
public interface IWailaDataAccessor {
|
||||
|
||||
World getWorld();
|
||||
EntityPlayer getPlayer();
|
||||
Block getBlock();
|
||||
int getBlockID();
|
||||
int getMetadata();
|
||||
TileEntity getTileEntity();
|
||||
MovingObjectPosition getPosition();
|
||||
Vec3 getRenderingPosition();
|
||||
NBTTagCompound getNBTData();
|
||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||
double getPartialFrame();
|
||||
ForgeDirection getSide();
|
||||
ItemStack getStack();
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWailaDataProvider{
|
||||
/*
|
||||
* Use this method to return an item stack in case the default lookup system fails.
|
||||
* Return null if you want to use the default lookup system.
|
||||
* You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities
|
||||
*/
|
||||
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
|
||||
/* Waila HUD is divided into 3 zones. The head corresponds to the item name,
|
||||
* body to where you mostly want to put informations, and I reserve the tail for modname display
|
||||
*/
|
||||
|
||||
/* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD.
|
||||
* You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack().
|
||||
* ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info.
|
||||
* currenttip represents the current list of text lines in the tooltip zone.
|
||||
* For example, getWailaHead() will have the current item name as currenttip.
|
||||
* You can modify the tips, add more, remove some, etc.
|
||||
* When you are done, just returns the currenttip and it will display in Waila.
|
||||
*
|
||||
* Always return the currenttip is you don't want to modify the current zone.
|
||||
*/
|
||||
|
||||
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/* The Accessor is used to get some basic data out of the game without having to request
|
||||
* direct access to the game engine.
|
||||
* It will also return things that are unmodified by the overriding systems (like getWailaStack).
|
||||
*/
|
||||
|
||||
public interface IWailaEntityAccessor {
|
||||
World getWorld();
|
||||
EntityPlayer getPlayer();
|
||||
Entity getEntity();
|
||||
MovingObjectPosition getPosition();
|
||||
Vec3 getRenderingPosition();
|
||||
NBTTagCompound getNBTData();
|
||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||
double getPartialFrame();
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface IWailaEntityProvider {
|
||||
|
||||
/* A way to get an override on the entity returned by the raytracing */
|
||||
Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
||||
|
||||
/* The classical HEAD/BODY/TAIL text getters */
|
||||
List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
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.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/* The Accessor is used to get some basic data out of the game without having to request
|
||||
* direct access to the game engine.
|
||||
* It will also return things that are unmodified by the overriding systems (like getWailaStack).
|
||||
*/
|
||||
|
||||
public interface IWailaFMPAccessor {
|
||||
World getWorld();
|
||||
EntityPlayer getPlayer();
|
||||
TileEntity getTileEntity();
|
||||
MovingObjectPosition getPosition();
|
||||
NBTTagCompound getNBTData();
|
||||
NBTTagCompound getFullNBTData();
|
||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||
double getPartialFrame();
|
||||
Vec3 getRenderingPosition();
|
||||
String getID();
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWailaFMPDecorator {
|
||||
void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWailaFMPProvider {
|
||||
/* The classical HEAD/BODY/TAIL text getters */
|
||||
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
public interface IWailaRegistrar {
|
||||
/* Add a config option in the section modname with displayed text configtext and access key keyname */
|
||||
public void addConfig(String modname, String keyname, String configtext);
|
||||
public void addConfigRemote(String modname, String keyname, String configtext);
|
||||
public void addConfig(String modname, String keyname);
|
||||
public void addConfigRemote(String modname, String keyname);
|
||||
|
||||
/* Register a stack overrider for the given blockID */
|
||||
public void registerStackProvider(IWailaDataProvider dataProvider, Class block);
|
||||
|
||||
/* Same thing, but works on a class hierarchy instead */
|
||||
public void registerHeadProvider (IWailaDataProvider dataProvider, Class block);
|
||||
public void registerBodyProvider (IWailaDataProvider dataProvider, Class block);
|
||||
public void registerTailProvider (IWailaDataProvider dataProvider, Class block);
|
||||
|
||||
/* Entity text registration methods */
|
||||
public void registerHeadProvider (IWailaEntityProvider dataProvider, Class entity);
|
||||
public void registerBodyProvider (IWailaEntityProvider dataProvider, Class entity);
|
||||
public void registerTailProvider (IWailaEntityProvider dataProvider, Class entity);
|
||||
public void registerOverrideEntityProvider (IWailaEntityProvider dataProvider, Class entity);
|
||||
|
||||
/* FMP Providers */
|
||||
public void registerHeadProvider(IWailaFMPProvider dataProvider, String name);
|
||||
public void registerBodyProvider(IWailaFMPProvider dataProvider, String name);
|
||||
public void registerTailProvider(IWailaFMPProvider dataProvider, String name);
|
||||
|
||||
/* The block decorators */
|
||||
public void registerDecorator (IWailaBlockDecorator decorator, Class block);
|
||||
public void registerDecorator (IWailaFMPDecorator decorator, String name);
|
||||
|
||||
/* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent).
|
||||
* Accept * as a ending wildcard
|
||||
* registerNBTKey("bob.*", MyBlock.class)
|
||||
* registerNBTKey("data.life", MyEntity.class)
|
||||
* registerNBTKey("*", MyTileEntity.class) will reproduce the full tag syncing from 1.4.5
|
||||
* */
|
||||
public void registerSyncedNBTKey(String key, Class target);
|
||||
|
||||
/* UNUSED FOR NOW (Will be used for the ingame wiki */
|
||||
public void registerDocTextFile (String filename);
|
||||
public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWailaSummaryProvider {
|
||||
/* This interface is used to control the display data in the description screen */
|
||||
|
||||
/* BASIC TOOLS & ITEMS DATA */
|
||||
//EnumToolMaterial getMaterial(ItemStack stack);
|
||||
//String getMaterialName(ItemStack stack);
|
||||
//String getEffectiveBlock(ItemStack stack);
|
||||
//int getHarvestLevel(ItemStack stack);
|
||||
//float getEfficiencyOnProperMaterial(ItemStack stack);
|
||||
//int getEnchantability(ItemStack stack);
|
||||
//int getDamageVsEntity(ItemStack stack);
|
||||
//int getDurability(ItemStack stack);
|
||||
|
||||
LinkedHashMap<String, String> getSummary(ItemStack stack, LinkedHashMap<String, String> currentSummary, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
public class SpecialChars {
|
||||
|
||||
public static String MCStyle = "\u00A7";
|
||||
|
||||
public static String BLACK = MCStyle + "0";
|
||||
public static String DBLUE = MCStyle + "1";
|
||||
public static String DGREEN = MCStyle + "2";
|
||||
public static String DAQUA = MCStyle + "3";
|
||||
public static String DRED = MCStyle + "4";
|
||||
public static String DPURPLE = MCStyle + "5";
|
||||
public static String GOLD = MCStyle + "6";
|
||||
public static String GRAY = MCStyle + "7";
|
||||
public static String DGRAY = MCStyle + "8";
|
||||
public static String BLUE = MCStyle + "9";
|
||||
public static String GREEN = MCStyle + "a";
|
||||
public static String AQUA = MCStyle + "b";
|
||||
public static String RED = MCStyle + "c";
|
||||
public static String LPURPLE = MCStyle + "d";
|
||||
public static String YELLOW = MCStyle + "e";
|
||||
public static String WHITE = MCStyle + "f";
|
||||
|
||||
public static String OBF = MCStyle + "k";
|
||||
public static String BOLD = MCStyle + "l";
|
||||
public static String STRIKE = MCStyle + "m";
|
||||
public static String UNDER = MCStyle + "n";
|
||||
public static String ITALIC = MCStyle + "o";
|
||||
public static String RESET = MCStyle + "r";
|
||||
|
||||
public static String WailaStyle = "\u00A4";
|
||||
public static String WailaIcon = "\u00A5";
|
||||
public static String TAB = WailaStyle + WailaStyle +"a";
|
||||
public static String ALIGNRIGHT = WailaStyle + WailaStyle +"b";
|
||||
public static String ALIGNCENTER = WailaStyle + WailaStyle +"c";
|
||||
public static String HEART = WailaStyle + WailaIcon +"a";
|
||||
public static String HHEART = WailaStyle + WailaIcon +"b";
|
||||
public static String EHEART = WailaStyle + WailaIcon +"c";
|
||||
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
@API(apiVersion="1.0",owner="Waila",provides="WailaAPI")
|
||||
package mcp.mobius.waila.api;
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -1,11 +0,0 @@
|
||||
package mods.battlegear2.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IAllowItem {
|
||||
|
||||
/**
|
||||
* Returns true if the mainhand {@link ItemStack} allows the offhand {@link ItemStack} to be placed in the partner offhand slot
|
||||
*/
|
||||
public boolean allowOffhand(ItemStack mainhand, ItemStack offhand);
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package mods.battlegear2.api;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
public interface IOffhandDual {
|
||||
/**
|
||||
* Returns true if this item can be dual wielded in the offhand slot
|
||||
* @param off The {@link ItemStack} holding this item
|
||||
*/
|
||||
public boolean isOffhandHandDual(ItemStack off);
|
||||
|
||||
/**
|
||||
* Perform any function when this item is held in the offhand and the user right clicks an entity.
|
||||
* This is generally used to attack an entity with the offhand item.
|
||||
* If this is the case the {@link PlayerEventChild.OffhandAttackEvent#parent} field should
|
||||
* be canceled (or {@link PlayerEventChild.OffhandAttackEvent#cancelParent} field left at true, to prevent any default right clicking events (Eg Villager Trading)
|
||||
*
|
||||
* @param event the OffhandAttackEvent that was generated
|
||||
* @param mainhandItem the {@link ItemStack} currently being held in the right hand
|
||||
* @param offhandItem the {@link ItemStack} currently being held in the left hand, holding this item
|
||||
* @return true if the off hand swing animation should be performed
|
||||
*/
|
||||
public boolean offhandAttackEntity(PlayerEventChild.OffhandAttackEvent event, ItemStack mainhandItem, ItemStack offhandItem);
|
||||
|
||||
/**
|
||||
* Perform any function when this item is held in the offhand and the user right clicks "Air".
|
||||
* Note: Called first on client-side, then on server side if {@link PlayerInteractEvent} is not cancelled and mainhandItem is not null,
|
||||
* following Forge rules for PlayerInteractEvent with Action==RIGHT_CLICK_AIR
|
||||
* Note: PlayerInteractEvent is already cancelled beforehand, and will be cancelled after if this method returns false
|
||||
* Note: Above issues will be fixed in next Minecraft versions by replacing first arg with a shallow copy
|
||||
* @param event the PlayerInteractEvent that was generated
|
||||
* @param mainhandItem the {@link ItemStack} currently being held in the right hand
|
||||
* @param offhandItem the {@link ItemStack} currently being held in the left hand, holding this item
|
||||
* @return true if the off hand swing animation should be performed
|
||||
*/
|
||||
public boolean offhandClickAir(PlayerInteractEvent event, ItemStack mainhandItem, ItemStack offhandItem);
|
||||
|
||||
/**
|
||||
* Perform any function when this item is held in the offhand and the user right clicks a block.
|
||||
* Note: this will happen prior to the activation of any activation functions of blocks
|
||||
* Note: Called first on client-side, then on server side if {@link PlayerInteractEvent} is not cancelled
|
||||
* Note: {@link PlayerInteractEvent#useItem} is already set on {@link Event.Result#DENY} before reaching this method, in order to avoid mainhandItem usage
|
||||
*
|
||||
* @param event the PlayerInteractEvent that was generated
|
||||
* @param mainhandItem the {@link ItemStack} currently being held in the right hand
|
||||
* @param offhandItem the {@link ItemStack} currently being held in the left hand, holding this item
|
||||
* @return true if the off hand swing animation should be performed
|
||||
*/
|
||||
public boolean offhandClickBlock(PlayerInteractEvent event, ItemStack mainhandItem, ItemStack offhandItem);
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
/**
|
||||
* Perform any passive effects on each game tick when this item is held in the offhand
|
||||
* @deprecated See {@link Item#onUpdate(ItemStack, World, Entity, int, boolean)}
|
||||
* @param effectiveSide the effective side the method was called from
|
||||
* @param mainhandItem the {@link ItemStack} currently being held in the right hand
|
||||
* @param offhandItem the {@link ItemStack} currently being held in the left hand
|
||||
*/
|
||||
public void performPassiveEffects(Side effectiveSide, ItemStack mainhandItem, ItemStack offhandItem);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package mods.battlegear2.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* When a {@link net.minecraft.entity.player.EntityPlayer} is not in "battlemode", the {@link ItemStack}s stored in Battlegear additional slots
|
||||
* and previously selected are displayed, either on the back (slightly moved depending on armor) or on the hip (opposite side to the hand slot it is stored in)
|
||||
* Note:Default behavior is dependent on Battlegear configuration
|
||||
* This interface can be implemented in a {@link net.minecraft.item.Item} instance to decide where to actually render it
|
||||
* See {@link mods.battlegear2.api.RenderPlayerEventChild.PreRenderSheathed} and {@link mods.battlegear2.api.RenderPlayerEventChild.PostRenderSheathed}
|
||||
* for more flexibility over the rendering
|
||||
*/
|
||||
public interface ISheathed {
|
||||
|
||||
/**
|
||||
* Returns true if this item should always be sheathed on the back, false if it should be sheathed on the hip
|
||||
* @param item the {@link ItemStack} to be sheathed
|
||||
*/
|
||||
public boolean sheatheOnBack(ItemStack item);
|
||||
}
|
||||
@@ -1,271 +0,0 @@
|
||||
package mods.battlegear2.api;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
public abstract class PlayerEventChild extends PlayerEvent{
|
||||
|
||||
/**
|
||||
* The event that this event is a child of
|
||||
*/
|
||||
public final PlayerEvent parent;
|
||||
|
||||
public PlayerEventChild(PlayerEvent parent) {
|
||||
super(parent.entityPlayer);
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void setCancelParentEvent(boolean cancel) {
|
||||
parent.setCanceled(cancel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCanceled(boolean cancel) {
|
||||
super.setCanceled(cancel);
|
||||
parent.setCanceled(cancel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setResult(Result value) {
|
||||
super.setResult(value);
|
||||
parent.setResult(value);
|
||||
}
|
||||
|
||||
public EntityPlayer getPlayer(){
|
||||
return parent.entityPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event fired when a shield successfully blocks an attack (in {@link LivingHurtEvent})
|
||||
*/
|
||||
public static class ShieldBlockEvent extends PlayerEventChild {
|
||||
public final ItemStack shield;
|
||||
public final DamageSource source;
|
||||
public final float ammount; // use same name as other Forge events
|
||||
public float ammountRemaining = 0.0F; // damage remaining after shield block event, if any
|
||||
/**
|
||||
* If the {@link IShield#blockAnimation(EntityPlayer, float)} should be called
|
||||
*/
|
||||
public boolean performAnimation = true;
|
||||
/**
|
||||
* If the shield should be damaged based on the ammount and the result of {@link IShield#getDamageReduction(ItemStack, DamageSource)}
|
||||
*/
|
||||
public boolean damageShield = true;
|
||||
public ShieldBlockEvent(PlayerEvent parent, ItemStack shield, DamageSource source, float ammount) {
|
||||
super(parent);
|
||||
this.shield = shield;
|
||||
this.source = source;
|
||||
this.ammount = ammount;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player right clicks in battlemode
|
||||
* The parent event can be either {@link PlayerInteractEvent} or {@link EntityInteractEvent} if the OffhandAttackEvent allowed swinging
|
||||
* Both {@link ItemStack} can be null
|
||||
* If cancelled, no offhand swinging will be performed
|
||||
*/
|
||||
@Cancelable
|
||||
public static class OffhandSwingEvent extends PlayerEventChild {
|
||||
public final ItemStack mainHand;
|
||||
public final ItemStack offHand;
|
||||
public OffhandSwingEvent(PlayerEvent parent, ItemStack mainHand, ItemStack offHand){
|
||||
super(parent);
|
||||
this.mainHand = mainHand;
|
||||
this.offHand = offHand;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player right clicks an entity in battlemode
|
||||
* Both {@link ItemStack} can be null
|
||||
* Cancelling will prevent any further processing and prevails over the boolean fields
|
||||
*/
|
||||
@Cancelable
|
||||
public static class OffhandAttackEvent extends PlayerEventChild {
|
||||
|
||||
/**
|
||||
* If we should call the OffhandSwingEvent and perform swinging
|
||||
*/
|
||||
public boolean swingOffhand = true;
|
||||
/**
|
||||
* If we should perform an attack on the entity with the offhand item
|
||||
* Note: Will post {@link AttackEntityEvent} and {@link Item#onLeftClickEntity(ItemStack, EntityPlayer, Entity)}
|
||||
* with {@link InventoryPlayer#currentItem} offset to the offhand
|
||||
*/
|
||||
public boolean shouldAttack = true;
|
||||
/**
|
||||
* If we should cancel the base entity interaction event
|
||||
*/
|
||||
public boolean cancelParent = true;
|
||||
/**
|
||||
* The base entity interaction event
|
||||
*/
|
||||
public final EntityInteractEvent event;
|
||||
/**
|
||||
* Content of the main hand slot
|
||||
*/
|
||||
public final ItemStack mainHand;
|
||||
/**
|
||||
* Content of the off hand slot
|
||||
*/
|
||||
public final ItemStack offHand;
|
||||
|
||||
public OffhandAttackEvent(EntityInteractEvent parent, ItemStack mainHand, ItemStack offHand) {
|
||||
super(parent);
|
||||
this.event = parent;
|
||||
this.mainHand = mainHand;
|
||||
this.offHand = offHand;
|
||||
}
|
||||
|
||||
public Entity getTarget() {
|
||||
return ((EntityInteractEvent)parent).target;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This event replicates the event usage of {@link PlayerInteractEvent} for the item in left hand on right click,
|
||||
* allowing support for other mods that use such event to customize item usage
|
||||
* {@link Item#onItemUseFirst}, {@link Item#onItemRightClick} and {@link Item#onItemUse} will then get called the same way as with the item in the player right hand for PlayerInteractEvent
|
||||
*/
|
||||
@Cancelable
|
||||
public static class UseOffhandItemEvent extends PlayerEventChild{
|
||||
/**
|
||||
* The {@link ItemStack} held in left hand
|
||||
*/
|
||||
public final ItemStack offhand;
|
||||
/**
|
||||
* The equivalent {@link PlayerInteractEvent} that would have been triggered if the offhand item was held in right hand and right click was pressed
|
||||
*/
|
||||
public final PlayerInteractEvent event;
|
||||
public UseOffhandItemEvent(PlayerInteractEvent event, ItemStack offhand){
|
||||
super(event);
|
||||
this.event = event;
|
||||
this.offhand = offhand;
|
||||
}
|
||||
}
|
||||
|
||||
public static class QuiverArrowEvent extends PlayerEventChild{
|
||||
/**
|
||||
* The event from which this occurred
|
||||
*/
|
||||
protected final ArrowLooseEvent event;
|
||||
public QuiverArrowEvent(ArrowLooseEvent event){
|
||||
super(event);
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the player using the bow
|
||||
*/
|
||||
public EntityPlayer getArcher(){
|
||||
return getPlayer();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the bow trying to fire
|
||||
*/
|
||||
public ItemStack getBow()
|
||||
{
|
||||
return event.bow;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the amount of charge in the bow
|
||||
*/
|
||||
public float getCharge()
|
||||
{
|
||||
return event.charge;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event fired after an arrow has been selected and taken from a {@link IArrowContainer2}, before it is actually spawned
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Firing extends QuiverArrowEvent {
|
||||
/**
|
||||
* Damage done to the bow after arrow is fired
|
||||
*/
|
||||
public int bowDamage = 1;
|
||||
/**
|
||||
* The volume of the sound emitted from the bow after arrow is fired
|
||||
*/
|
||||
public float bowSoundVolume = 1.0F;
|
||||
/**
|
||||
* Decides if standard enchantments can be added to the arrow
|
||||
*/
|
||||
public boolean addEnchantments = true;
|
||||
/**
|
||||
* Decides if critical state should be forced into the arrow
|
||||
*/
|
||||
public boolean isCritical = false;
|
||||
/**
|
||||
* The quiver from which the arrow was pulled from
|
||||
*/
|
||||
public final ItemStack quiver;
|
||||
/**
|
||||
* The arrow to be fired, can't be null
|
||||
*/
|
||||
public final EntityArrow arrow;
|
||||
|
||||
public Firing(ArrowLooseEvent parent, ItemStack quiver, EntityArrow arrow) {
|
||||
super(parent);
|
||||
this.quiver = quiver;
|
||||
this.arrow = arrow;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The DEFAULT result for this event is the vanilla charge calculated value
|
||||
* Use setNewCharge to override the value with the one provided
|
||||
* Change the event result to DENY to prevent further processing
|
||||
*/
|
||||
@HasResult
|
||||
public static class ChargeCalculations extends QuiverArrowEvent {
|
||||
/**
|
||||
* Returned value if the result is set to allow
|
||||
*/
|
||||
protected float charge;
|
||||
public ChargeCalculations(ArrowLooseEvent event){
|
||||
super(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getCharge(){
|
||||
MinecraftForge.EVENT_BUS.post(this);
|
||||
switch (this.getResult()){
|
||||
case ALLOW:
|
||||
return charge;
|
||||
case DENY:
|
||||
return 0;
|
||||
}
|
||||
float f = super.getCharge()/20.0F;
|
||||
f = (f * f + f * 2.0F) / 3.0F;
|
||||
if ((double)f < 0.1D)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (f > 1.0F)
|
||||
{
|
||||
f = 1.0F;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
public void setNewCharge(float charge){
|
||||
this.setResult(Result.ALLOW);
|
||||
this.charge = charge;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,451 +0,0 @@
|
||||
package mods.battlegear2.api.core;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
/**
|
||||
* User: nerd-boy
|
||||
* Date: 15/07/13
|
||||
* Time: 3:08 PM
|
||||
* Replacement for the player inventory
|
||||
*/
|
||||
public class InventoryPlayerBattle extends InventoryPlayer {
|
||||
//Mark the inventory content as dirty to be send to the client
|
||||
public boolean hasChanged = true;
|
||||
//The offsets used
|
||||
public static int ARMOR_OFFSET = 100;
|
||||
public static int OFFSET = 150;
|
||||
public static int WEAPON_SETS = 3;
|
||||
|
||||
public static int EXTRA_ITEMS = WEAPON_SETS * 2;
|
||||
public static int EXTRA_INV_SIZE = EXTRA_ITEMS + 6 + 6;
|
||||
//The "battle" extra slots
|
||||
public ItemStack[] extraItems;
|
||||
|
||||
public InventoryPlayerBattle(EntityPlayer entityPlayer) {
|
||||
super(entityPlayer);
|
||||
extraItems = new ItemStack[EXTRA_INV_SIZE];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the current item value is offset in the battle slot range
|
||||
*/
|
||||
public boolean isBattlemode() {
|
||||
return this.currentItem >= OFFSET && this.currentItem < OFFSET + EXTRA_ITEMS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new slot index according to the type
|
||||
* @param type determines which inventory array to expand
|
||||
* @return the new slot index, or Integer.MIN_VALUE if it is not possible to expand further
|
||||
*/
|
||||
public int requestNewSlot(InventorySlotType type){
|
||||
ItemStack[] temp;
|
||||
switch(type){
|
||||
case MAIN:
|
||||
if(mainInventory.length+1<ARMOR_OFFSET) {
|
||||
temp = new ItemStack[mainInventory.length + 1];
|
||||
System.arraycopy(mainInventory, 0, temp, 0, mainInventory.length);
|
||||
mainInventory = temp;
|
||||
return mainInventory.length - 1;//Between 36 and 99
|
||||
}
|
||||
break;
|
||||
case ARMOR:
|
||||
if(ARMOR_OFFSET+armorInventory.length+1<OFFSET) {
|
||||
temp = new ItemStack[armorInventory.length + 1];
|
||||
System.arraycopy(armorInventory, 0, temp, 0, armorInventory.length);
|
||||
armorInventory = temp;
|
||||
return ARMOR_OFFSET + armorInventory.length - 1;//Between 104 and 149
|
||||
}
|
||||
break;
|
||||
case BATTLE:
|
||||
temp = new ItemStack[extraItems.length+1];
|
||||
System.arraycopy(extraItems, 0, temp, 0, extraItems.length);
|
||||
extraItems = temp;
|
||||
return OFFSET + extraItems.length - 1;
|
||||
}
|
||||
return Integer.MIN_VALUE;//Impossible because of byte cast in inventory NBT
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch used for "set current slot" vanilla packets
|
||||
* @param id the value to test for currentItem setting
|
||||
* @return true if it is possible for currentItem to be set with this value
|
||||
*/
|
||||
public static boolean isValidSwitch(int id) {
|
||||
return (id >= 0 && id < getHotbarSize()) || (id >= OFFSET && id < OFFSET + EXTRA_ITEMS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a slot index in main inventory containing a specific itemID
|
||||
*/
|
||||
private int getInventorySlotContainItem(Item par1) {
|
||||
for (int j = 0; j < this.extraItems.length; ++j) {
|
||||
if (this.extraItems[j] != null && this.extraItems[j].getItem() == par1) {
|
||||
return j;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private int getInventorySlotContainItemAndDamage(Item par1, int par2) {
|
||||
for (int k = 0; k < this.extraItems.length; ++k) {
|
||||
if (this.extraItems[k] != null && this.extraItems[k].getItem() == par1 && this.extraItems[k].getItemDamage() == par2) {
|
||||
return k;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the item switching in "battlemode", delegates to parent method if in normal mode
|
||||
* @return the currently selected {@link ItemStack}
|
||||
*/
|
||||
@Override
|
||||
public ItemStack getCurrentItem() {
|
||||
return isBattlemode() ? extraItems[currentItem - OFFSET] : super.getCurrentItem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes currentItem and currentItemStack based on a given target
|
||||
* @param targetItem the newly selected item
|
||||
* @param targetDamage the newly selected item damage
|
||||
* @param compareWithDamage if item damage should matter when searching for the target in the inventory
|
||||
* @param forceInEmptySlots if the newly selected item should be forced in empty slots if it couldn't be found as-is
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void func_146030_a(Item targetItem, int targetDamage, boolean compareWithDamage, boolean forceInEmptySlots) {
|
||||
if (!isBattlemode())
|
||||
super.func_146030_a(targetItem, targetDamage, compareWithDamage, forceInEmptySlots);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll the currentItem possible values
|
||||
* @param direction if >0: in the natural order, if <0: in the opposite order
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void changeCurrentItem(int direction) {
|
||||
if (isBattlemode()) {
|
||||
|
||||
if (direction > 0){
|
||||
direction = 1;
|
||||
}else if (direction != 0){
|
||||
direction = -1;
|
||||
}
|
||||
|
||||
//noinspection StatementWithEmptyBody
|
||||
for (currentItem -= direction; currentItem < OFFSET; currentItem += WEAPON_SETS) {
|
||||
}
|
||||
|
||||
while (currentItem >= OFFSET + WEAPON_SETS) {
|
||||
currentItem -= WEAPON_SETS;
|
||||
}
|
||||
|
||||
} else {
|
||||
super.changeCurrentItem(direction);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all slots that contain the target item with given damage
|
||||
* @param targetId if null, not specific
|
||||
* @param targetDamage if <0, not specific
|
||||
* @return the total number of items cleared
|
||||
*/
|
||||
@Override
|
||||
public int clearInventory(Item targetId, int targetDamage) {
|
||||
int stacks = 0;
|
||||
|
||||
for (int i = 0; i < extraItems.length; i++) {
|
||||
if (extraItems[i] != null &&
|
||||
(targetId == null || extraItems[i].getItem() == targetId) &&
|
||||
(targetDamage <= -1 || extraItems[i].getItemDamage() == targetDamage)) {
|
||||
|
||||
stacks += extraItems[i].stackSize;
|
||||
extraItems[i] = null;
|
||||
}
|
||||
}
|
||||
hasChanged = stacks > 0;
|
||||
return super.clearInventory(targetId, targetDamage) + stacks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by EntityPlayer#onLivingUpdate(), to animate the item being picked up and tick it
|
||||
*/
|
||||
@Override
|
||||
public void decrementAnimations() {
|
||||
super.decrementAnimations();
|
||||
for (int i = 0; i < this.extraItems.length; ++i) {
|
||||
if (this.extraItems[i] != null) {
|
||||
this.extraItems[i].updateAnimation(this.player.worldObj, this.player, i + OFFSET, this.currentItem == i + OFFSET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removed one item of specified itemID from inventory (if it is in a stack, the stack size will reduce with 1)
|
||||
*/
|
||||
@Override
|
||||
public boolean consumeInventoryItem(Item par1) {
|
||||
int j = this.getInventorySlotContainItem(par1);
|
||||
|
||||
if (j < 0) {
|
||||
return super.consumeInventoryItem(par1);
|
||||
} else {
|
||||
hasChanged = true;
|
||||
if (--this.extraItems[j].stackSize <= 0) {
|
||||
this.extraItems[j] = null;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get if a specified item id is inside the inventory.
|
||||
* @param par1 the item to search for
|
||||
*/
|
||||
@Override
|
||||
public boolean hasItem(Item par1) {
|
||||
if (super.hasItem(par1)) {
|
||||
return true;
|
||||
} else {
|
||||
int j = this.getInventorySlotContainItem(par1);
|
||||
return j >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes from an inventory slot up to a specified number of items and returns them in a new stack.
|
||||
* @param slot to remove from
|
||||
* @param amount to remove in the item stack
|
||||
* @return the removed items in a item stack, if any
|
||||
*/
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
if (slot >= OFFSET) {
|
||||
ItemStack targetStack = extraItems[slot - OFFSET];
|
||||
|
||||
if (targetStack != null) {
|
||||
hasChanged = true;
|
||||
if (targetStack.stackSize <= amount) {
|
||||
extraItems[slot - OFFSET] = null;
|
||||
return targetStack;
|
||||
} else {
|
||||
targetStack = extraItems[slot - OFFSET].splitStack(amount);
|
||||
if (extraItems[slot - OFFSET].stackSize == 0) {
|
||||
extraItems[slot - OFFSET] = null;
|
||||
}
|
||||
return targetStack;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
} else {
|
||||
return super.decrStackSize(slot, amount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stack in given slot, when closing the container
|
||||
* @param slot to get the content from
|
||||
* @return the stack that is stored in given slot
|
||||
*/
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
if (slot >= OFFSET) {
|
||||
return extraItems[slot - OFFSET];
|
||||
} else {
|
||||
return super.getStackInSlotOnClosing(slot);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the given item stack to the specified slot in the inventory
|
||||
* @param slot whose content will change
|
||||
* @param itemStack to put in the slot
|
||||
*/
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack itemStack) {
|
||||
setInventorySlotContents(slot, itemStack, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the given item stack to the specified slot in the inventory, mark as dirty according to the boolean argument
|
||||
* @param slot whose content will change
|
||||
* @param itemStack to put in the slot
|
||||
* @param changed if the inventory packet should be sent next tick
|
||||
*/
|
||||
public void setInventorySlotContents(int slot, ItemStack itemStack, boolean changed) {
|
||||
if (slot >= OFFSET) {
|
||||
hasChanged = changed;
|
||||
extraItems[slot - OFFSET] = itemStack;
|
||||
} else {
|
||||
super.setInventorySlotContents(slot, itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* UNUSED
|
||||
* Get the current item "action value" against a block
|
||||
* @param block that the player is acting against
|
||||
* @return some action value of the current item against given block
|
||||
*/
|
||||
@Override
|
||||
public float func_146023_a(Block block) {
|
||||
if (isBattlemode()) {
|
||||
ItemStack currentItemStack = getCurrentItem();
|
||||
return currentItemStack != null ? currentItemStack.func_150997_a(block) : 1.0F;
|
||||
|
||||
} else {
|
||||
return super.func_146023_a(block);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the inventory out as a list of compound tags. This is where the slot indices are used (+100 for armor, +150
|
||||
* for battle slots).
|
||||
*/
|
||||
@Override
|
||||
public NBTTagList writeToNBT(NBTTagList par1nbtTagList) {
|
||||
NBTTagList nbtList = super.writeToNBT(par1nbtTagList);
|
||||
NBTTagCompound nbttagcompound;
|
||||
|
||||
for (int i = 0; i < extraItems.length; ++i) {
|
||||
if (extraItems[i] != null) {
|
||||
nbttagcompound = new NBTTagCompound();
|
||||
//This will be -ve, but meh still works
|
||||
nbttagcompound.setByte("Slot", (byte) (i + OFFSET));
|
||||
this.extraItems[i].writeToNBT(nbttagcompound);
|
||||
nbtList.appendTag(nbttagcompound);
|
||||
}
|
||||
}
|
||||
return nbtList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads from the given tag list, resize each arrays to maximum required and fills the slots in the inventory with the correct items.
|
||||
*/
|
||||
@Override
|
||||
public void readFromNBT(NBTTagList nbtTagList) {
|
||||
int highestMain = mainInventory.length, highestArmor = armorInventory.length, highestExtra = extraItems.length;
|
||||
for (int i = 0; i < nbtTagList.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound = nbtTagList.getCompoundTagAt(i);
|
||||
int j = nbttagcompound.getByte("Slot") & 255;
|
||||
if (j >= 0 && j < ARMOR_OFFSET) {
|
||||
if(j >= highestMain)
|
||||
highestMain = j + 1;
|
||||
}
|
||||
else if (j >= ARMOR_OFFSET && j < OFFSET) {
|
||||
if(j - ARMOR_OFFSET >= highestArmor)
|
||||
highestArmor = j + 1 - ARMOR_OFFSET;
|
||||
}
|
||||
else if (j >= OFFSET && j < 255) {
|
||||
if(j - OFFSET >= highestExtra)
|
||||
highestExtra = j + 1 - OFFSET;
|
||||
}
|
||||
}
|
||||
this.mainInventory = new ItemStack[highestMain];
|
||||
this.armorInventory = new ItemStack[highestArmor];
|
||||
this.extraItems = new ItemStack[highestExtra];
|
||||
for (int i = 0; i < nbtTagList.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound = nbtTagList.getCompoundTagAt(i);
|
||||
int j = nbttagcompound.getByte("Slot") & 255;
|
||||
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);
|
||||
|
||||
if (itemstack != null) {
|
||||
if (j >= 0 && j < this.mainInventory.length) {
|
||||
this.mainInventory[j] = itemstack;
|
||||
}
|
||||
else if (j >= ARMOR_OFFSET && j - ARMOR_OFFSET < this.armorInventory.length) {
|
||||
this.armorInventory[j - ARMOR_OFFSET] = itemstack;
|
||||
}
|
||||
else if (j >= OFFSET && j - OFFSET < this.extraItems.length) {
|
||||
this.extraItems[j - OFFSET] = itemstack;
|
||||
}
|
||||
else{
|
||||
MinecraftForge.EVENT_BUS.post(new UnhandledInventoryItemEvent(player, j, itemstack));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param slot to get the content from
|
||||
* @return the content of the given slot
|
||||
*/
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
if (slot >= OFFSET) {
|
||||
return extraItems[slot - OFFSET];
|
||||
} else {
|
||||
return super.getStackInSlot(slot);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the usual number of slots for vanilla inventory (not hardcoded)
|
||||
*/
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return this.mainInventory.length + this.armorInventory.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop all slots content, and clear them
|
||||
*/
|
||||
@Override
|
||||
public void dropAllItems() {
|
||||
hasChanged = true;
|
||||
super.dropAllItems();
|
||||
for (int i = 0; i < this.extraItems.length; ++i) {
|
||||
if (this.extraItems[i] != null) {
|
||||
this.player.func_146097_a(this.extraItems[i], true, false);
|
||||
this.extraItems[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the slots content from another instance, usually for changing dimensions
|
||||
* @param par1InventoryPlayer the instance to copy from
|
||||
*/
|
||||
@Override
|
||||
public void copyInventory(InventoryPlayer par1InventoryPlayer) {
|
||||
this.mainInventory = new ItemStack[par1InventoryPlayer.mainInventory.length];
|
||||
this.armorInventory = new ItemStack[par1InventoryPlayer.armorInventory.length];
|
||||
super.copyInventory(par1InventoryPlayer);
|
||||
if (par1InventoryPlayer instanceof InventoryPlayerBattle) {
|
||||
this.extraItems = new ItemStack[((InventoryPlayerBattle) par1InventoryPlayer).extraItems.length];
|
||||
for (int i = 0; i < extraItems.length; i++) {
|
||||
this.extraItems[i] = ItemStack.copyItemStack(par1InventoryPlayer.getStackInSlot(i + OFFSET));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the offset item (for the left hand)
|
||||
* @return the item held in left hand, if any
|
||||
*/
|
||||
public ItemStack getCurrentOffhandWeapon(){
|
||||
if(isBattlemode()){
|
||||
return getStackInSlot(currentItem+WEAPON_SETS);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package mods.battlegear2.api.core;
|
||||
|
||||
/**
|
||||
* Created by GotoLink on 24/04/2014.
|
||||
*/
|
||||
public enum InventorySlotType {
|
||||
/**
|
||||
* The main inventory space (slots 0 to 99)
|
||||
*/
|
||||
MAIN,
|
||||
/**
|
||||
* The armor inventory space (slots 100 to 149)
|
||||
*/
|
||||
ARMOR,
|
||||
/**
|
||||
* The inventory space added by battlegear (slots 150 and above)
|
||||
*/
|
||||
BATTLE
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package mods.battlegear2.api.core;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
/**
|
||||
* Created by GotoLink on 01/05/2014.
|
||||
* Event posted on {@link MinecraftForge.EVENT_BUS} from the player inventory {@link InventoryPlayerBattle#readFromNBT(NBTTagList)}
|
||||
* if the slot number is outside the expected boundaries
|
||||
*/
|
||||
public class UnhandledInventoryItemEvent extends PlayerEvent {
|
||||
/**
|
||||
* The slot number read from NBT, that is outside the arrays limits
|
||||
*/
|
||||
public final int inventorySlot;
|
||||
/**
|
||||
* The item read from the NBT, not null
|
||||
*/
|
||||
public final ItemStack item;
|
||||
public UnhandledInventoryItemEvent(EntityPlayer player, int slot, ItemStack itemStack) {
|
||||
super(player);
|
||||
inventorySlot = slot;
|
||||
item = itemStack;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
@API(owner = "battlegear2", provides = "DualWield", apiVersion = "0.1")
|
||||
package mods.battlegear2.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -1,13 +0,0 @@
|
||||
package mods.battlegear2.api.weapons;
|
||||
|
||||
import mods.battlegear2.api.IAllowItem;
|
||||
import mods.battlegear2.api.IOffhandDual;
|
||||
import mods.battlegear2.api.ISheathed;
|
||||
|
||||
/**
|
||||
* A generic flag for weapon
|
||||
* <strong>Not</strong> necessary for an item to be wielded in battlegear slots
|
||||
*/
|
||||
public interface IBattlegearWeapon extends ISheathed,IOffhandDual,IAllowItem{
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
@API(owner = "battlegear2", provides = "Weapons", apiVersion = "0.1")
|
||||
package mods.battlegear2.api.weapons;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -1,41 +0,0 @@
|
||||
package modwarriors.notenoughkeys.api;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Center of the API. Main api methods can be found in this class.
|
||||
*
|
||||
* @author TheTemportalist
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class Api {
|
||||
|
||||
/**
|
||||
* Checks if NotEnoughKeys is loaded in the current environment
|
||||
*
|
||||
* @return 'true' if loaded
|
||||
*/
|
||||
public static boolean isLoaded() {
|
||||
return Loader.isModLoaded("notenoughkeys");
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a mod's keys with NEK
|
||||
*
|
||||
* @param modname The NAME of the mod registering the key
|
||||
* @param keyDescriptions A String[] (Array[String]) of the key descriptions
|
||||
* as an inherit array. i.e. ("modName", "key.hotbar1", "key.hotbar2")
|
||||
*/
|
||||
public static void registerMod(String modname, String... keyDescriptions) {
|
||||
try {
|
||||
Class.forName("modwarriors.notenoughkeys.keys.KeyHelper").getMethod(
|
||||
"registerMod", String.class, String[].class
|
||||
).invoke(null, modname, keyDescriptions);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package modwarriors.notenoughkeys.api;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
|
||||
/**
|
||||
* Called when a keybinding is triggered with the passed with valid modifiers
|
||||
*
|
||||
* @author TheTemportalist
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Cancelable
|
||||
public class KeyBindingPressedEvent extends Event {
|
||||
|
||||
/**
|
||||
* The KeyBinding being triggered
|
||||
*/
|
||||
public KeyBinding keyBinding = null;
|
||||
/**
|
||||
* Tells whether a modifier was required AND was down when triggered
|
||||
*/
|
||||
public boolean shiftRequired = false, ctrlRequired = false, altRequired = false;
|
||||
/**
|
||||
* Use this variable to check if your key is pressed. DO NOT check KeyBinding.getIsKeyPressed().
|
||||
* That value will return only if the main key is pressed or not.
|
||||
* @see modwarriors.notenoughkeys.keys.KeyEvents refreshBindings
|
||||
*/
|
||||
public boolean isKeyBindingPressed;
|
||||
|
||||
/**
|
||||
* Called with the passed keyBinding and modifiers.
|
||||
* Subscribe to this event so activate a keybinding when triggered.
|
||||
*
|
||||
* @param keyBinding The KeyBinding being triggered. Stores the key's description and keycode
|
||||
* @param modifiers The modifiers (SHIFT, CTRL, ALT) that determine when a compatible key is pressed
|
||||
*/
|
||||
public KeyBindingPressedEvent(KeyBinding keyBinding, boolean[] modifiers, boolean isPressed) {
|
||||
super();
|
||||
this.keyBinding = keyBinding;
|
||||
this.shiftRequired = modifiers[0];
|
||||
this.ctrlRequired = modifiers[1];
|
||||
this.altRequired = modifiers[2];
|
||||
this.isKeyBindingPressed = isPressed;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
@API(owner = "Not Enough Keys", provides = "API_NEK",
|
||||
apiVersion = "1.1.0") package modwarriors.notenoughkeys.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -1,208 +0,0 @@
|
||||
package morph.api;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
*
|
||||
* Abstract ability class.
|
||||
* Think of it like the Entity class, extend it to make your own types.
|
||||
* Some abilities may seem more like traits, but let's just call it an ability for simplicity's sake.
|
||||
* Please take note that entities inherit their superclass' abilities.
|
||||
* @author iChun
|
||||
*
|
||||
*/
|
||||
public abstract class Ability
|
||||
{
|
||||
/**
|
||||
* Ability parent field. Will be null for instances used in registration. Ability is then cloned and parent assigned later on.
|
||||
*/
|
||||
private EntityLivingBase parent;
|
||||
|
||||
/**
|
||||
* Flag for Ability activity. If true, tick/postRender/kill will notbe called.
|
||||
*/
|
||||
public boolean inactive;
|
||||
|
||||
/**
|
||||
* Basic constructor (but you didn't really need me to tell you that ;D )
|
||||
*/
|
||||
public Ability()
|
||||
{
|
||||
parent = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for mod mob support, with args.
|
||||
*/
|
||||
public Ability parse(String[] args) { return this; }
|
||||
|
||||
/**
|
||||
* Since parent is private it needs a setter.
|
||||
* @param newParent
|
||||
*/
|
||||
public void setParent(EntityLivingBase ent)
|
||||
{
|
||||
parent = ent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get's the parent entity for this ability
|
||||
* @return Entity the ability takes effect on
|
||||
*/
|
||||
public EntityLivingBase getParent()
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Each ability has to return a String type.
|
||||
* This is used for comparison, saving, as well as construction/loading of Ability.
|
||||
* Think of it like the way Minecraft registers entities.
|
||||
* @return Ability type
|
||||
*/
|
||||
public abstract String getType();
|
||||
|
||||
/**
|
||||
* Ticks every world tick, basically an ability onUpdate, similar to Entity's onUpdate.
|
||||
* Will only tick if getParent() is not null.
|
||||
* Please remember that getParent is not necessarily a player.
|
||||
*/
|
||||
public abstract void tick();
|
||||
|
||||
/**
|
||||
* Called when the ability is finally removed when the parent demorphs or morphs into a state that does not have this ability type.
|
||||
* This will NOT be called if the parent morphs into another morph that has this type of ability.
|
||||
*/
|
||||
public abstract void kill();
|
||||
|
||||
/**
|
||||
* Creates a copy of this ability for use with parents.
|
||||
* As previously stated before the ability instance used during registration is a base so it needs to be cloned for use with parents.
|
||||
*/
|
||||
public abstract Ability clone();
|
||||
|
||||
/**
|
||||
* Return true for this if you need an inactive copy of this morph in-between morph states (abilities of the next morph are only swapped over when morph is complete)
|
||||
* Currently used for AbilitySwim to adjust the fog render.
|
||||
* @return requiresInactiveClone
|
||||
*/
|
||||
public boolean requiresInactiveClone()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saving of ability to NBTTagCompound.
|
||||
* Mainly used for synching Abilities between the client-server for mod mobs which do not use the API to add abilities.
|
||||
* The ability type (getType()) is appended to nbt before function is called.
|
||||
* Not actually used.
|
||||
* @param NBTTagCompound saveData
|
||||
*/
|
||||
public abstract void save(NBTTagCompound tag);
|
||||
|
||||
/**
|
||||
* Loading of ability from NBTTagCompound.
|
||||
* Mainly used to load custom fields from NBT.
|
||||
* Not actually used.
|
||||
* @param NBTTagCompound saveData
|
||||
*/
|
||||
public abstract void load(NBTTagCompound tag);
|
||||
|
||||
/**
|
||||
* Rendering to be done post-render.
|
||||
* EG: Used by AbilitySwim to render air bubbles whilst on land.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract void postRender();
|
||||
|
||||
/**
|
||||
* Icon location for ability. Can be null.
|
||||
* Mod's default icons are 32x32. Can be any resolution though.
|
||||
* @return resourcelocation for icon
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract ResourceLocation getIcon();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean entityHasAbility(EntityLivingBase living)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the ability so the mod can look up the class when attempting to load Ability save data.
|
||||
* Call this no later than PostInit.
|
||||
* @param ability type
|
||||
* @param AbilityClass
|
||||
*/
|
||||
public static void registerAbility(String name, Class<? extends Ability> clz)
|
||||
{
|
||||
try {
|
||||
Class.forName("morph.common.ability.AbilityHandler").getDeclaredMethod("registerAbility", String.class, Class.class).invoke(null, name, clz);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps abilities to an Entity.
|
||||
* Adds on to the previous ability list, so this allows you to add abilities to Entity classes which already have abilities mapped.
|
||||
* However, only one ability of the same type is allowed for each entity. This method will overwrite abilities of the same type that were already mapped.
|
||||
* This will also register new abilities which were not registered before (just in case).
|
||||
* Call this no later than PostInit.
|
||||
* @param entClass
|
||||
* @param abilities
|
||||
*/
|
||||
public static void mapAbilities(Class<? extends EntityLivingBase> entClass, Ability...abilities)
|
||||
{
|
||||
try {
|
||||
Class.forName("morph.common.ability.AbilityHandler").getDeclaredMethod("mapAbilities", Class.class, Ability[].class).invoke(null, entClass, abilities);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Superman's kryptonite.
|
||||
* @param Entity class to remove ability from
|
||||
* @param Ability type
|
||||
*/
|
||||
public static void removeAbility(Class<? extends EntityLivingBase> entClass, String type)
|
||||
{
|
||||
try {
|
||||
Class.forName("morph.common.ability.AbilityHandler").getDeclaredMethod("removeAbility", Class.class, String.class).invoke(null, entClass, type);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the entity class has a mapped ability type.
|
||||
* @param entClass
|
||||
* @param Ability type
|
||||
* @return Entity class has ability type
|
||||
*/
|
||||
public static boolean hasAbility(Class<? extends EntityLivingBase> entClass, String type)
|
||||
{
|
||||
try {
|
||||
return (Boolean)Class.forName("morph.common.ability.AbilityHandler").getDeclaredMethod("hasAbility", Class.class, String.class).invoke(null, entClass, type);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an ability by type.
|
||||
* Check out AbilityHandler to see each Ability type and the parse function in their respective classes for the arguments.
|
||||
* @return
|
||||
*/
|
||||
public static Ability createNewAbilityByType(String type, String[] arguments)
|
||||
{
|
||||
try {
|
||||
return (Ability)Class.forName("morph.common.ability.AbilityHandler").getDeclaredMethod("createNewAbilityByType", String.class, String[].class).invoke(null, type, arguments);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
package morph.api;
|
||||
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public final class Api
|
||||
{
|
||||
/**
|
||||
* Returns if a player is has a morph. If morph progress < 1.0F, player is mid-morphing.
|
||||
* Players demorphing are considered as a player with a morph until the demorph is complete.
|
||||
* @param Player Username
|
||||
* @param Clientside (false for Serverside)
|
||||
*/
|
||||
public static boolean hasMorph(String playerName, boolean isClient)
|
||||
{
|
||||
try {
|
||||
return (Boolean)Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("hasMorph", String.class, boolean.class).invoke(null, playerName, isClient);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns morph progression of a player. Time per morph is 80 ticks.
|
||||
* If player does not have a morph, 1.0F will be returned.
|
||||
* @param Player Username
|
||||
* @param Clientside (false for Serverside)
|
||||
*/
|
||||
public static float morphProgress(String playerName, boolean isClient)
|
||||
{
|
||||
try {
|
||||
return (Float)Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("morphProgress", String.class, boolean.class).invoke(null, playerName, isClient);
|
||||
} catch (Exception e) {
|
||||
return 1.0F;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns previous entity instance used to render the morph.
|
||||
* If player does not have a previous morph state, null will be returned.
|
||||
* @param Player Username
|
||||
* @param Clientside (false for Serverside)
|
||||
*/
|
||||
public static EntityLivingBase getPrevMorphEntity(String playerName, boolean isClient)
|
||||
{
|
||||
try {
|
||||
return (EntityLivingBase)Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("getPrevMorphEntity", String.class, boolean.class).invoke(null, playerName, isClient);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns entity instance used to render the morph.
|
||||
* If player does not have a morph, null will be returned.
|
||||
* @param Player Username
|
||||
* @param Clientside (false for Serverside)
|
||||
*/
|
||||
public static EntityLivingBase getMorphEntity(String playerName, boolean isClient)
|
||||
{
|
||||
try {
|
||||
return (EntityLivingBase)Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("getMorphEntity", String.class, boolean.class).invoke(null, playerName, isClient);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Blacklists an entity from being morphed into.
|
||||
* Previously saved morphs of the classtype will not be removed.
|
||||
* @param Class (extends EntityLivingBase)
|
||||
*/
|
||||
public static void blacklistEntity(Class<? extends EntityLivingBase> clz)
|
||||
{
|
||||
try {
|
||||
Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("blacklistEntity", Class.class).invoke(null, clz);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces a player to morph into an EntityLivingBase, also adds said entity to the morph list.
|
||||
* Called Serverside only.
|
||||
* @param player
|
||||
* @param living
|
||||
* @return morphSuccessful
|
||||
*/
|
||||
public static boolean forceMorph(EntityPlayerMP player, EntityLivingBase living)
|
||||
{
|
||||
try {
|
||||
return (Boolean)Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("forceMorph", EntityPlayerMP.class, EntityLivingBase.class).invoke(null, player, living);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces a player to demorph.
|
||||
* Called Serverside only.
|
||||
* @param player
|
||||
*/
|
||||
public static void forceDemorph(EntityPlayerMP player)
|
||||
{
|
||||
try {
|
||||
Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("forceDemorph", EntityPlayerMP.class).invoke(null, player);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entity passed on is a Morph.
|
||||
* If it is, the player name will be passed, else null.
|
||||
* @param EntityLivingBase instance
|
||||
* @param Clientside (false for Serverside)
|
||||
*/
|
||||
public static String isEntityAMorph(EntityLivingBase living, boolean isClient)
|
||||
{
|
||||
try {
|
||||
return (String)Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("isEntityAMorph", EntityLivingBase.class, boolean.class).invoke(null, living, isClient);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the rendering of the next player rendered.
|
||||
* Prevents Morph from cancelling the player render event to render the morphed entity.
|
||||
*/
|
||||
public static void allowNextPlayerRender()
|
||||
{
|
||||
try {
|
||||
Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("allowNextPlayerRender").invoke(null);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the black grainy morph skin that overlays the player when the player is morphing
|
||||
* @return Morph Skin Resource Location
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static ResourceLocation getMorphSkinTexture()
|
||||
{
|
||||
try {
|
||||
return (ResourceLocation)Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("getMorphSkinTexture").invoke(null);
|
||||
} catch (Exception e) {
|
||||
return AbstractClientPlayer.locationStevePng;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a specific arm to a model for rendering in First Person.
|
||||
* @param model Model which arm you are registering for
|
||||
* @param arm The arm in a ModelRenderer form.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void registerArmForModel(ModelBase model, ModelRenderer arm)
|
||||
{
|
||||
try {
|
||||
Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("registerArmForModel", ModelBase.class, ModelRenderer.class).invoke(null, model, arm);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @author PowerCrystals
|
||||
*
|
||||
* Class used to register plants and other farming-related things with MFR. Will do nothing if MFR does not exist.
|
||||
*
|
||||
*/
|
||||
public class FactoryRegistry
|
||||
{
|
||||
/*
|
||||
* This may be called at any time during pre-init, init or post-init, assuming all blocks and items
|
||||
* that are being accessed from the registry have been appropriately registered.
|
||||
* Possible messages:
|
||||
*
|
||||
* // Registration:
|
||||
* addLaserPreferredOre | NBTTag with an ItemStack saved on it, with the color on the "value" attribute,
|
||||
* | A ValuedItem with item and value set.
|
||||
* registerAutoSpawnerBlacklist | The String identifier of an entity,
|
||||
* | A subclass of EntityLivingBase.
|
||||
* registerFertilizable | An instance of IFactoryFertilizable.
|
||||
* registerFertilizer | An instance of IFactoryFertilizer.
|
||||
* registerFruitLog | The String identifier of a block.
|
||||
* registerGrindable | An instance of IFactoryGrindable.
|
||||
* registerGrinderBlacklist | A subclass of EntityLivingBase.
|
||||
* registerHarvestable | An instance of IFactoryHarvestable.
|
||||
* registerLaserOre | NBTTag with an ItemStack saved on it, with the weight on the "value" attribute,
|
||||
* | A ValuedItem with item and value set.
|
||||
* registerLiquidDrinkHandler | A ValuedItem with key and object set; ILiquidDrinkHandler expected.
|
||||
* registerMobEggHandler | An instance of IMobEggHandler.
|
||||
* registerPickableFruit | An instance of IFactoryFruit.
|
||||
* registerPlantable | An instance of IFactoryPlantable.
|
||||
* registerRanchable | An instance of IFactoryRanchable.
|
||||
* registerRedNetLogicCircuit | An instance of IRedNetLogicCircuit.
|
||||
* registerRubberTreeBiome | The biomeName field of a biome to white list for rubber trees to spawn in.
|
||||
* registerSafariNetBlacklist | A subclass of EntityLivingBase.
|
||||
* registerSafariNetHandler | An instance of ISafariNetHandler.
|
||||
* registerSludgeDrop | NBTTag with an ItemStack saved on it, with the weight on the "value" attribute,
|
||||
* | A ValuedItem with item and value set.
|
||||
* registerSpawnHandler | An instance of IMobSpawnHandler.
|
||||
* registerVillagerTradeMob | An instance of IRandomMobProvider.
|
||||
*
|
||||
* // Simple implementations:
|
||||
* { Harvestables
|
||||
* registerHarvestable_Standard | The String identifier of a block.
|
||||
* registerHarvestable_Log | The String identifier of a block.
|
||||
* registerHarvestable_Leaves | The String identifier of a block.
|
||||
* registerHarvestable_Vine | The String identifier of a block.
|
||||
* registerHarvestable_Shrub | The String identifier of a block.
|
||||
* registerHarvestable_Mushroom | The String identifier of a block.
|
||||
* registerHarvestable_Crop | An ItemStack of a block, with a damage value indicating the meta value to harvest at.
|
||||
* | A ValuedItem with value and object set; Block expected.
|
||||
* registerHarvestable_Gourd | An NBTTag with the stem and fruit attributes, both String identifiers of blocks.
|
||||
* }
|
||||
* { Plantables
|
||||
* registerPlantable_Standard | An NBTTag with the seed (Item, String identifier), and
|
||||
* crop (Block, String identifier) attributes set, optionally
|
||||
* also having the meta (Integer, placed metadata value) attribute set.
|
||||
* No special checks for location, just sustainability.
|
||||
* registerPlantable_Crop | An NBTTag with the seed (Item, String identifier), and
|
||||
* crop (Block, String identifier) attributes set, optionally
|
||||
* also having the meta (Integer, placed metadata value) attribute set.
|
||||
* Will automatically hoe dirt and grass into farmland when planting.
|
||||
* registerPlantable_Sapling | An NBTTag with the sapling (Block, String identifier), and optionally
|
||||
* the seed (Item, String identifier) attributes set.
|
||||
* }
|
||||
* { Fertilizer
|
||||
* registerFertilizer | An NBTTag with the fert (Item, String identifier), meta (Integer), and
|
||||
* type (Integer, index into FertilizerType.values()) attributes set.
|
||||
* }
|
||||
* { Fertilizables
|
||||
* registerFertilizable_Grass | The String identifier of a block. Will bonemeal the block and expect
|
||||
* tall grass be planted above and around it, must be IGrowable. Works with
|
||||
* the GrowPlant and Grass type fertilizers, not recommended for crop plants.
|
||||
* registerFertilizable_Gourd | The String identifier of a block. Must be IGrowable, and expects identical
|
||||
* behavior to vanilla stems. Works with the GrowPlant fertilizers.
|
||||
* registerFertilizable_Crop | An NBTTag with the plant (Block, String identifier, IGrowable), and
|
||||
* meta (Integer, max growth phase) attributes set, optionally also having
|
||||
* the type (Integer, index into FertilizerType) attribute set.
|
||||
* registerFertilizable_Cocoa | An NBTTag with the plant (Block, String identifier), and optionally also
|
||||
* the type (Integer, index into FertilizerType) attributes set.
|
||||
* Expects metadata of the block to exactly match cocoa pods.
|
||||
* registerFertilizable_Standard | An NBTTag with the plant (Block, String identifier, IGrowable), and
|
||||
* optionally also the type (Integer, index into FertilizerType) attributes set.
|
||||
* Expects the block to change when successfully grown (e.g., saplings).
|
||||
* }
|
||||
*/
|
||||
public static void sendMessage(String message, Object value)
|
||||
{
|
||||
if (!Loader.isModLoaded("MineFactoryReloaded") ||
|
||||
Loader.instance().activeModContainer() == null)
|
||||
return;
|
||||
try
|
||||
{
|
||||
Method m = FMLInterModComms.class.getDeclaredMethod("enqueueMessage", Object.class, String.class, IMCMessage.class);
|
||||
m.setAccessible(true);
|
||||
Constructor<IMCMessage> c = IMCMessage.class.getDeclaredConstructor(String.class, Object.class);
|
||||
c.setAccessible(true);
|
||||
m.invoke(null, Loader.instance().activeModContainer(), "MineFactoryReloaded", c.newInstance(message, value));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
/**
|
||||
* @author PowerCrystals
|
||||
*
|
||||
* Determines what algorithm the Harvester uses when it encounters this IFactoryHarvestable in the world.
|
||||
*/
|
||||
public enum HarvestType
|
||||
{
|
||||
/**
|
||||
* Just break the single block - no special action needed. e.g. Carrots, flowers, wheat.
|
||||
*/
|
||||
Normal,
|
||||
/**
|
||||
* Search for harvestable blocks adjacent to this block but leave this block. e.g. Pumpkin, melon
|
||||
*/
|
||||
Gourd,
|
||||
/**
|
||||
* Search for identical blocks above.
|
||||
*/
|
||||
Column,
|
||||
/**
|
||||
* Search for identical blocks above but leave the bottom one for the future. e.g. Cactus, sugarcane.
|
||||
*/
|
||||
LeaveBottom,
|
||||
/**
|
||||
* This block is the base of a tree and the harvester should enter tree-cutting mode.
|
||||
*/
|
||||
Tree,
|
||||
/**
|
||||
* This block is the base of the tree and the harvester should enter tree-cutting mode.
|
||||
* The tree is searched for in the negative y axis instead.
|
||||
*/
|
||||
TreeFlipped,
|
||||
/**
|
||||
* This block is part of a tree as above.
|
||||
*/
|
||||
TreeLeaf,
|
||||
/**
|
||||
* This block is part of a tree as above, but fruits are cut before logs. e.g. cocoa
|
||||
* The tree is not searched for.
|
||||
*/
|
||||
TreeFruit
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* @author PowerCrystals
|
||||
*
|
||||
* Defines a grindable entity for the Grinder.
|
||||
*/
|
||||
public interface IFactoryGrindable
|
||||
{
|
||||
/**
|
||||
* @return The class that this grindable instance is handling. This must be a subtype of EntityLivingBase or the entity will never
|
||||
* be noticed by the Grinder.
|
||||
*/
|
||||
public Class<? extends EntityLivingBase> getGrindableEntity();
|
||||
|
||||
/**
|
||||
* @param world The world this entity is in.
|
||||
* @param entity The entity instance being ground.
|
||||
* @param random A Random instance.
|
||||
* @return The drops generated when this entity is killed.
|
||||
*/
|
||||
public List<MobDrop> grind(World world, EntityLivingBase entity, Random random);
|
||||
|
||||
/**
|
||||
* @param entity The entity instance being ground.
|
||||
* @return Whether this entity has been fully processed or not.
|
||||
*/
|
||||
public boolean processEntity(EntityLivingBase entity);
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* @author PowerCrystals
|
||||
*
|
||||
* Defines a harvestable block for the Harvester.
|
||||
*/
|
||||
public interface IFactoryHarvestable
|
||||
{
|
||||
/**
|
||||
* @return The block this harvestable instance is managing.
|
||||
*/
|
||||
public Block getPlant();
|
||||
|
||||
/**
|
||||
* @return The type of harvest the Harvester should perform on this block.
|
||||
*/
|
||||
public HarvestType getHarvestType();
|
||||
|
||||
/**
|
||||
* @return Whether or not the Harvester should break the block when harvesting. If false, no changes will be performed by the Harvester itself.
|
||||
*/
|
||||
public boolean breakBlock();
|
||||
|
||||
/**
|
||||
* @param world The world this block is in.
|
||||
* @param harvesterSettings The harvester's current settings. Do not modify these.
|
||||
* @param x The X coordinate of the block being harvested.
|
||||
* @param y The Y coordinate of the block being harvested.
|
||||
* @param z The Z coordinate of the block being harvested.
|
||||
* @return True if this block can be harvested.
|
||||
*/
|
||||
public boolean canBeHarvested(World world, Map<String, Boolean> harvesterSettings, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @param world The world this block is in.
|
||||
* @param rand A Random instance to use when generating drops.
|
||||
* @param harvesterSettings The harvester's current settings. Do not modify these.
|
||||
* @param x The X coordinate of the block being harvested.
|
||||
* @param y The Y coordinate of the block being harvested.
|
||||
* @param z The Z coordinate of the block being harvested.
|
||||
* @return The drops generated by breaking this block. For a default implementation, calling Block.getBlockDropped() is usually sufficient.
|
||||
*/
|
||||
public List<ItemStack> getDrops(World world, Random rand, Map<String, Boolean> harvesterSettings, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* Called before the block is going to be harvested. Usually empty.
|
||||
* @param world The world this block is in.
|
||||
* @param x The X coordinate of the block being harvested.
|
||||
* @param y The Y coordinate of the block being harvested.
|
||||
* @param z The Z coordinate of the block being harvested.
|
||||
*/
|
||||
public void preHarvest(World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* Called after the block is going to be harvested. Used to re-till soil, for example.
|
||||
* @param world The world this block is in.
|
||||
* @param x The X coordinate of the block being harvested.
|
||||
* @param y The Y coordinate of the block being harvested.
|
||||
* @param z The Z coordinate of the block being harvested.
|
||||
*/
|
||||
public void postHarvest(World world, int x, int y, int z);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
public interface ILiquidDrinkHandler
|
||||
{
|
||||
public void onDrink(EntityLivingBase player);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
|
||||
public class MobDrop extends WeightedRandom.Item
|
||||
{
|
||||
private ItemStack _stack;
|
||||
|
||||
public MobDrop(int weight, ItemStack stack)
|
||||
{
|
||||
super(weight);
|
||||
_stack = stack;
|
||||
}
|
||||
|
||||
public ItemStack getStack()
|
||||
{
|
||||
if(_stack == null) return null;
|
||||
return _stack.copy();
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ValuedItem
|
||||
{
|
||||
public final int value;
|
||||
public final ItemStack item;
|
||||
public final String key;
|
||||
public final Object object;
|
||||
|
||||
public ValuedItem(int v, ItemStack i)
|
||||
{
|
||||
value = v;
|
||||
item = i;
|
||||
key = null;
|
||||
object = null;
|
||||
}
|
||||
|
||||
public ValuedItem(String v, Object i)
|
||||
{
|
||||
value = -1;
|
||||
item = null;
|
||||
key = v;
|
||||
object = i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Presently unused but included so that if they do get used in the future,
|
||||
* people including this in their jar and loading before MFR don't destroy everyone
|
||||
*/
|
||||
|
||||
public ValuedItem(int v, Object i)
|
||||
{
|
||||
value = v;
|
||||
item = null;
|
||||
key = null;
|
||||
object = i;
|
||||
}
|
||||
|
||||
public ValuedItem(String v, ItemStack i)
|
||||
{
|
||||
value = -1;
|
||||
item = i;
|
||||
key = v;
|
||||
object = null;
|
||||
}
|
||||
|
||||
public ValuedItem(int v, String k, ItemStack i)
|
||||
{
|
||||
value = v;
|
||||
item = i;
|
||||
key = k;
|
||||
object = null;
|
||||
}
|
||||
|
||||
public ValuedItem(int v, String k, Object i)
|
||||
{
|
||||
value = v;
|
||||
item = null;
|
||||
key = k;
|
||||
object = i;
|
||||
}
|
||||
|
||||
public ValuedItem(int v, String k, ItemStack i, Object o)
|
||||
{
|
||||
value = v;
|
||||
item = i;
|
||||
key = k;
|
||||
object = o;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
Copyright (C) <2014> <coolAlias>
|
||||
|
||||
This file is part of coolAlias' Zelda Sword Skills Minecraft Mod; as such,
|
||||
you can redistribute it and/or modify it under the terms of the GNU
|
||||
General Public License as published by the Free Software Foundation,
|
||||
either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package zeldaswordskills.api.item;
|
||||
|
||||
/**
|
||||
*
|
||||
* For the purpose of using certain skills, this item will be considered a sword.
|
||||
*
|
||||
* Skills which require a sword are:
|
||||
* {@link LeapingBlow}, {@link MortalDraw}, {@link RisingCut}, and {@link SwordBeam}
|
||||
*
|
||||
*/
|
||||
public interface ISword {
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
@API(owner = "zeldaswordskills", provides = "ZeldaItemAPI", apiVersion = "0.3")
|
||||
package zeldaswordskills.api.item;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -1,4 +0,0 @@
|
||||
@API(owner = "zeldaswordskills", provides = "ZeldaAPI", apiVersion = "0.3")
|
||||
package zeldaswordskills.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -69,7 +69,7 @@ import java.util.Random;
|
||||
* @author mDiyo
|
||||
*/
|
||||
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "${version}",
|
||||
@Mod(modid = TConstruct.modID, name = "TConstruct", version = TConstruct.modVersion,
|
||||
dependencies = "required-after:Forge@[10.13.3.1384,11.14);" +
|
||||
"required-after:Mantle@[1.7.10-0.3.2,);" +
|
||||
"after:MineFactoryReloaded@[1.7.10R2.8.0RC7,);" +
|
||||
@@ -88,7 +88,7 @@ import java.util.Random;
|
||||
)
|
||||
public class TConstruct
|
||||
{
|
||||
public static final String modVersion = "${version}";
|
||||
public static final String modVersion = "GRADLETOKEN_VERSION";
|
||||
/** The value of one ingot in millibuckets */
|
||||
public static final int ingotLiquidValue = 144;
|
||||
public static final int oreLiquidValue = ingotLiquidValue * 2;
|
||||
|
||||
@@ -4,8 +4,12 @@ import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.smeltery.logic.CastingBasinLogic;
|
||||
|
||||
@@ -65,4 +69,8 @@ public class BasinDataProvider implements IWailaDataProvider
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,12 @@ package tconstruct.plugins.waila;
|
||||
|
||||
import java.util.List;
|
||||
import mcp.mobius.waila.api.*;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.smeltery.logic.CastingChannelLogic;
|
||||
@@ -70,4 +74,8 @@ public class CastingChannelDataProvider implements IWailaDataProvider
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,12 @@ package tconstruct.plugins.waila;
|
||||
|
||||
import java.util.List;
|
||||
import mcp.mobius.waila.api.*;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.smeltery.logic.LavaTankLogic;
|
||||
|
||||
@@ -48,4 +52,8 @@ public class SearedTankDataProvider implements IWailaDataProvider
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,12 @@ package tconstruct.plugins.waila;
|
||||
|
||||
import java.util.List;
|
||||
import mcp.mobius.waila.api.*;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
|
||||
@@ -59,4 +63,8 @@ public class SmelteryDataProvider implements IWailaDataProvider
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,12 @@ package tconstruct.plugins.waila;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.smeltery.logic.CastingTableLogic;
|
||||
|
||||
import java.util.List;
|
||||
@@ -56,4 +60,8 @@ public class TableDataProvider implements IWailaDataProvider
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 233 KiB After Width: | Height: | Size: 233 KiB |