Compare commits

..
12 Commits
Author SHA1 Message Date
Martin Robertz 53f48697a1 Merge remote-tracking branch 'origin/meteor-nei-improvements' into dev 2022-08-15 16:13:45 +02:00
miozune 4a9e0c071c Meteor NEI improvements 2022-08-15 19:40:25 +09:00
DianeXD ec9c3f67ff Move dim blacklist config to AlchemicalWizardry.java (#29) 2022-08-15 12:04:18 +02:00
DianeXD 5b1be24b1d Move dim blacklist config to AlchemicalWizardry.java 2022-08-12 12:24:58 +08:00
Guinea Wheek 04baecf5ef Fix the Key of Binding in multiplayer (#28)
* Fix the Key of Binding in multiplayer

* Add suggested other refactors
2022-08-10 07:43:10 +02:00
Jason Mitchell 9cf6c3a5ab [ci skip] Migrate github actions to GTNH-Actions-Workflows 2022-07-16 10:47:06 -07:00
boubou19 23c3df2097 added a dim blacklist to demon portal ritual (#27) 2022-06-20 20:36:06 +02:00
glowredman 44002d238e Fix Altar NEI Handler (#25)
* Update build.gradle

* Fix Tooltip handling in NEIAltarRecipeHandler

* Cleanup

* Improve NEI Altar Handler

Using the mouse pos again but it now correctly handles >2 recipes per page and NEI 2.0+
2022-06-08 16:16:02 +02:00
miozune 23c1efe98b Add more slots for meteor NEI (#26) 2022-05-31 09:05:30 +02:00
MuXiu1997andKiwi f2cba48db8 Rituals Localization (#24)
* Rituals Localization

* Fix breaking change

* Update zh_CN.lang

Co-authored-by: Kiwi <[email protected]>

Co-authored-by: Kiwi <[email protected]>
2022-04-28 17:30:16 +02:00
MuXiu1997 209fed5f81 Add suport of using the GT miners to mine the ores from the BloodMagic ritual "Mark of the Falling Tower" (#23)
* Add suport of using the GT miners to mine the ores from the BloodMagic ritual "Mark of the Falling Tower"

* Optional GT
2022-04-28 15:45:37 +02:00
Kiwi adb6977425 Update zh_CN.lang (#22) 2022-04-14 22:35:25 +02:00
26 changed files with 536 additions and 346 deletions

No files matched your search

+2 -34
View File
@@ -1,5 +1,3 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build and test
@@ -11,35 +9,5 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Run server for 1.5 minutes
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 90 ./gradlew runServer | tee --append server.log || true
- name: Test no errors reported during server run
run: |
chmod +x .github/scripts/test-no-error-reports.sh
.github/scripts/test-no-error-reports.sh
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
secrets: inherit
+7 -44
View File
@@ -1,51 +1,14 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Release tagged build
on:
push:
tags:
- '*'
tags: [ '*' ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "${{ env.RELEASE_VERSION }}"
files: build/libs/*.jar
- name: Publish to Maven
run: ./gradlew publish
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
release-tags:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
secrets: inherit
+3
View File
@@ -0,0 +1,3 @@
compileJava {
options.encoding = "UTF-8"
}
+245 -91
View File
@@ -1,34 +1,36 @@
//version: 1642484596
//version: 1652851397
/*
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/GTNewHorizons/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 org.gradle.internal.logging.text.StyledTextOutput.Style
import org.gradle.internal.logging.text.StyledTextOutputFactory
import java.util.concurrent.TimeUnit
buildscript {
repositories {
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name = "Scala CI dependencies"
url = "https://repo1.maven.org/maven2/"
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}
maven {
name = "jitpack"
url = "https://jitpack.io"
name 'jitpack'
url 'https://jitpack.io'
}
}
dependencies {
@@ -37,14 +39,27 @@ buildscript {
}
plugins {
id 'java-library'
id 'idea'
id 'eclipse'
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")
id("maven-publish")
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false
id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false
id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false
id 'org.ajoberstar.grgit' version '4.1.1'
id 'com.github.johnrengelman.shadow' version '4.0.4'
id 'com.palantir.git-version' version '0.13.0' apply false
id 'de.undercouch.download' version '5.0.1'
id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false
}
if (project.file('.git/HEAD').isFile()) {
apply plugin: 'com.palantir.git-version'
}
def out = services.get(StyledTextOutputFactory).create('an-output')
apply plugin: 'forge'
def projectJavaVersion = JavaLanguageVersion.of(8)
@@ -89,27 +104,31 @@ checkPropertyExists("usesShadowedDependencies")
checkPropertyExists("developmentEnvironmentUserName")
boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
boolean usesMixinDebug = project.findProperty('usesMixinDebug') ?: project.usesMixins.toBoolean()
String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
if(apiPackage) {
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
}
if(accessTransformersFile) {
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
if(getFile(targetFile).exists() == false) {
if(!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
}
}
@@ -121,15 +140,17 @@ if(usesMixins.toBoolean()) {
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt"
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
}
}
@@ -137,8 +158,9 @@ if(coreModClass) {
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt"
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
}
}
@@ -151,17 +173,35 @@ configurations.all {
}
// 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()
try {
'git config core.fileMode false'.execute()
}
catch (Exception ignored) {
out.style(Style.Failure).println("git isn't installed at all")
}
// Pulls version first from the VERSION env and then git tag
String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null
try {
String versionOverride = System.getenv("VERSION") ?: null
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
version = minecraftVersion + "-" + identifiedVersion
}
catch (Exception e) {
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag, or the VERSION override must be set!");
catch (Exception ignored) {
out.style(Style.Failure).text(
'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' +
'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' +
'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)'
)
versionOverride = 'NO-GIT-TAG-SET'
identifiedVersion = versionOverride
}
version = minecraftVersion + '-' + identifiedVersion
ext {
modVersion = identifiedVersion
}
if(identifiedVersion == versionOverride) {
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
}
group = modGroup
@@ -172,9 +212,25 @@ else {
archivesBaseName = modId
}
def arguments = []
def jvmArguments = []
if (usesMixins.toBoolean()) {
arguments += [
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
]
if (usesMixinDebug.toBoolean()) {
jvmArguments += [
"-Dmixin.debug.countInjections=true",
"-Dmixin.debug.verbose=true",
"-Dmixin.debug.export=true"
]
}
}
minecraft {
version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion
runDir = "run"
version = minecraftVersion + '-' + forgeVersion + '-' + minecraftVersion
runDir = 'run'
if (replaceGradleTokenInFile) {
replaceIn replaceGradleTokenInFile
@@ -185,16 +241,30 @@ minecraft {
replace gradleTokenModName, modName
}
if(gradleTokenVersion) {
replace gradleTokenVersion, versionDetails().lastTag
replace gradleTokenVersion, modVersion
}
if(gradleTokenGroupName) {
replace gradleTokenGroupName, modGroup
}
}
clientIntellijRun {
args(arguments)
jvmArgs(jvmArguments)
if(developmentEnvironmentUserName) {
args("--username", developmentEnvironmentUserName)
}
}
serverIntellijRun {
args(arguments)
jvmArgs(jvmArguments)
}
}
if(file("addon.gradle").exists()) {
apply from: "addon.gradle"
if(file('addon.gradle').exists()) {
apply from: 'addon.gradle'
}
apply from: 'repositories.gradle'
@@ -207,58 +277,63 @@ configurations {
repositories {
maven {
name = "Overmind forge repo mirror"
url = "https://gregtech.overminddl1.com/"
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
}
if(usesMixins.toBoolean()) {
maven {
name = "sponge"
url = "https://repo.spongepowered.org/repository/maven-public"
name 'sponge'
url 'https://repo.spongepowered.org/repository/maven-public'
}
maven {
url = "https://jitpack.io"
url 'https://jitpack.io'
}
}
}
dependencies {
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")
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("com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH") {
compile('com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH') {
// 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"
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
exclude module: 'log4j-core'
}
compile("com.github.GTNewHorizons:SpongeMixins:1.5.0")
compile('com.github.GTNewHorizons:SpongeMixins:1.5.0')
}
}
apply from: 'dependencies.gradle'
def mixingConfigRefMap = "mixins." + modId + ".refmap.json"
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
task generateAssets {
if(usesMixins.toBoolean()) {
getFile("/src/main/resources/mixins." + modId + ".json").text = """{
if (usesMixins.toBoolean()) {
def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json");
if (!mixinConfigFile.exists()) {
mixinConfigFile.text = """{
"required": true,
"minVersion": "0.7.11",
"package": "${modGroup}.${mixinsPackage}",
"plugin": "${modGroup}.${mixinPlugin}",
"refmap": "${mixingConfigRefMap}",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
"compatibilityLevel": "JAVA_8",
"mixins": [],
"client": [],
"server": []
}
"""
}
}
}
@@ -322,15 +397,6 @@ afterEvaluate {
}
runClient {
def arguments = []
if(usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$modId-${version}.jar",
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
]
}
if(developmentEnvironmentUserName) {
arguments += [
"--username",
@@ -339,19 +405,12 @@ runClient {
}
args(arguments)
jvmArgs(jvmArguments)
}
runServer {
def arguments = []
if (usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$modId-${version}.jar",
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
]
}
args(arguments)
jvmArgs(jvmArguments)
}
tasks.withType(JavaExec).configureEach {
@@ -362,8 +421,7 @@ tasks.withType(JavaExec).configureEach {
)
}
processResources
{
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
@@ -372,18 +430,18 @@ processResources
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
// replace modVersion and minecraftVersion
expand "minecraftVersion": project.minecraft.version,
"modVersion": versionDetails().lastTag,
"modId": modId,
"modName": modName
"modVersion": modVersion,
"modId": modId,
"modName": modName
}
if(usesMixins.toBoolean()) {
from refMap
}
// copy everything else, thats not the mcmod.info
// copy everything else that's not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
@@ -391,7 +449,7 @@ processResources
def getManifestAttributes() {
def manifestAttributes = [:]
if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) {
if(!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
}
@@ -407,14 +465,14 @@ def getManifestAttributes() {
manifestAttributes += [
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs" : "mixins." + modId + ".json",
"ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false
"ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean()
]
}
return manifestAttributes
}
task sourcesJar(type: Jar) {
from (sourceSets.main.allJava)
from (sourceSets.main.allSource)
from (file("$projectDir/LICENSE"))
getArchiveClassifier().set('sources')
}
@@ -469,7 +527,7 @@ task devJar(type: Jar) {
}
task apiJar(type: Jar) {
from (sourceSets.main.allJava) {
from (sourceSets.main.allSource) {
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
}
@@ -494,13 +552,24 @@ artifacts {
}
}
// publishing
// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID),
// and isn't strictly needed with the POM so just disable it.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
// workaround variable hiding in pom processing
def projectConfigs = project.configurations
publishing {
publications {
maven(MavenPublication) {
artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: ""
from components.java
if(usesShadowedDependencies.toBoolean()) {
artifact source: shadowJar, classifier: ""
}
if(!noPublishedSources) {
artifact source: sourcesJar, classifier: "src"
artifact source: sourcesJar, classifier: "sources"
}
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
if (apiPackage) {
@@ -511,6 +580,25 @@ publishing {
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
// Using the identified version, not project.version as it has the prepended 1.7.10
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
// remove extra garbage from minecraft and minecraftDeps configuration
pom.withXml {
def badArtifacts = [:].withDefault {[] as Set<String>}
for (configuration in [projectConfigs.minecraft, projectConfigs.minecraftDeps]) {
for (dependency in configuration.allDependencies) {
badArtifacts[dependency.group == null ? "" : dependency.group] += dependency.name
}
}
// example for specifying extra stuff to ignore
// badArtifacts["org.example.group"] += "artifactName"
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
badArtifacts[it.groupId.text()].contains(it.artifactId.text())
}.each() {
it.parent().remove(it)
}
}
}
}
@@ -538,7 +626,7 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
if (autoUpdateBuildScript.toBoolean()) {
performBuildScriptUpdate(projectDir.toString())
} else {
println("Build script update available! Run 'gradle updateBuildScript'")
out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'")
}
}
@@ -550,7 +638,7 @@ boolean performBuildScriptUpdate(String projectDir) {
if (isNewBuildScriptVersionAvailable(projectDir)) {
def buildscriptFile = getFile("build.gradle")
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
return true
}
return false
@@ -581,10 +669,76 @@ configure(updateBuildScript) {
description = 'Updates the build script to the latest version'
}
// Deobfuscation
def deobf(String sourceURL) {
try {
URL url = new URL(sourceURL)
String fileName = url.getFile()
//get rid of directories:
int lastSlash = fileName.lastIndexOf("/")
if(lastSlash > 0) {
fileName = fileName.substring(lastSlash + 1)
}
//get rid of extension:
if(fileName.endsWith(".jar")) {
fileName = fileName.substring(0, fileName.lastIndexOf("."))
}
String hostName = url.getHost()
if(hostName.startsWith("www.")) {
hostName = hostName.substring(4)
}
List parts = Arrays.asList(hostName.split("\\."))
Collections.reverse(parts)
hostName = String.join(".", parts)
return deobf(sourceURL, hostName + "/" + fileName)
} catch(Exception e) {
return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode()))
}
}
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
def deobf(String sourceURL, String fileName) {
String cacheDir = System.getProperty("user.home") + "/.gradle/caches/"
String bon2Dir = cacheDir + "forge_gradle/deobf"
String bon2File = bon2Dir + "/BON2-2.5.0.jar"
String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar"
String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar"
if(file(deobfFile).exists()) {
return files(deobfFile)
}
download.run {
src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar'
dest bon2File
quiet true
overwrite false
}
download.run {
src sourceURL
dest obfFile
quiet true
overwrite false
}
exec {
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch'
workingDir bon2Dir
standardOutput = new ByteArrayOutputStream()
}
return files(deobfFile)
}
// Helper methods
def checkPropertyExists(String propertyName) {
if (project.hasProperty(propertyName) == false) {
if (!project.hasProperty(propertyName)) {
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/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties")
}
}
+8 -3
View File
@@ -1,7 +1,12 @@
// Add your dependencies here
dependencies {
compileOnly("com.github.GTNewHorizons:Botania:master-SNAPSHOT:api") {
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.31:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Botania:1.9.5-GTNH:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:api") {
@@ -12,14 +17,14 @@ dependencies {
}
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev")
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.7-GTNH:dev") {
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.20-GTNH:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Chisel:2.10.6-GTNH:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ZenScript:master-SNAPSHOT") {
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.6:dev") {
@@ -278,6 +278,7 @@ public class AlchemicalWizardry
public static int ritualWeakCostThunderstorm;
public static int ritualWeakCostZombie;
public static boolean isGregTechLoaded;
public static boolean isThaumcraftLoaded;
public static boolean isForestryLoaded;
public static boolean isBotaniaLoaded;
@@ -403,6 +404,7 @@ public class AlchemicalWizardry
public static String entityMinorDemonGruntGuardianEarthID = "AW024";
public static boolean isDemonRitualCreativeOnly = false;
public static int[] demonRitualDimensionBlacklist = new int[]{0};
public static Fluid lifeEssenceFluid;
@@ -1061,6 +1063,7 @@ public class AlchemicalWizardry
public void postInit(FMLPostInitializationEvent event)
{
proxy.registerPostSideObjects();
isGregTechLoaded = Loader.isModLoaded("gregtech");
//TODO Thaumcraft Integration
if (Loader.isModLoaded("Thaumcraft"))
{
@@ -15,6 +15,7 @@ import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks;
import WayofTime.alchemicalWizardry.common.demonVillage.DemonVillagePath;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectDemonPortal;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -202,7 +203,7 @@ public class BloodMagicConfiguration
TEDemonPortal.demonLimit = config.get(tempDemonConfigs, "demonHoardLimit", 100).getInt();
AlchemicalWizardry.isDemonRitualCreativeOnly = config.get(tempDemonConfigs, "IsDemonRitualCreativeOnly", false).getBoolean();
AlchemicalWizardry.demonRitualDimensionBlacklist = config.get(tempDemonConfigs, "dimension blacklist for the demon portal activation", new int[]{0}).getIntList();
BoundArmour.tryComplexRendering = config.get("WimpySettings", "UseFancyBoundArmour", true).getBoolean(true);
// ItemIncense.itemDuration = config.get("TestIncenseSettings", "ItemDuration", 100).getInt();
@@ -9,8 +9,8 @@ import net.minecraft.item.ItemStack;
public class AltarRecipeRegistry
{
public static List<AltarRecipe> altarRecipes = new LinkedList();
public static Map<Integer, ItemStack> orbMap = new HashMap();
public static List<AltarRecipe> altarRecipes = new LinkedList<>();
public static Map<Integer, ItemStack> orbMap = new HashMap<>();
public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled)
{
@@ -8,6 +8,7 @@ import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import WayofTime.alchemicalWizardry.api.event.RitualRunEvent;
@@ -21,6 +22,7 @@ public class Rituals
public final int actCost;
public final RitualEffect effect;
public final String name;
public String localizedName = "";
public final MRSRenderer customRenderer;
@@ -64,6 +66,7 @@ public class Rituals
ritual.removeRitualFromList();
ritualMap.put(key, ritual);
keyList.add(key);
ritual.setRitualLocalizedName(StatCollector.translateToLocal("ritual." + key + ".name"));
return true;
}
}
@@ -79,6 +82,7 @@ public class Rituals
ritual.removeRitualFromList();
ritualMap.put(key, ritual);
keyList.add(key);
ritual.setRitualLocalizedName(StatCollector.translateToLocal("ritual." + key + ".name"));
return true;
}
}
@@ -291,6 +295,15 @@ public class Rituals
{
return this.name;
}
public void setRitualLocalizedName(String localizedName)
{
this.localizedName = localizedName;
}
public String getRitualLocalizedName()
{
return localizedName.isEmpty() ? this.name : localizedName;
}
public static String getNameOfRitual(String id)
{
@@ -305,6 +318,20 @@ public class Rituals
return "";
}
public static String getLocalizedNameOfRitual(String id)
{
if (ritualMap.containsKey(id))
{
Rituals ritual = ritualMap.get(id);
if (ritual != null)
{
return ritual.getRitualLocalizedName();
}
}
return "";
}
public static String getNextRitualKey(String key)
{
@@ -5,18 +5,31 @@ import net.minecraft.nbt.NBTTagCompound;
public class IMCForNEI {
public static void IMCSender() {
setNBTAndSend("WayofTime.alchemicalWizardry.client.nei.NEIMeteorRecipeHandler", "AWWayofTime:masterStone", 130);
sendHandler("alchemicalwizardry.meteor", "AWWayofTime:masterStone", 130);
sendCatalyst("alchemicalwizardry.meteor", "AWWayofTime:masterStone");
}
private static void setNBTAndSend(String handlerName, String aBlock, int height) {
private static void sendHandler(String handlerName, String stack, int height) {
NBTTagCompound NBT = new NBTTagCompound();
NBT.setString("handler", handlerName);
NBT.setString("modName", "Blood Magic");
NBT.setString("modId", "AWWayofTime");
NBT.setBoolean("modRequired", true);
NBT.setString("itemName", aBlock);
NBT.setString("itemName", stack);
NBT.setInteger("handlerHeight", height);
NBT.setInteger("maxRecipesPerPage", 1);
FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", NBT);
}
private static void sendCatalyst(String handlerName, String stack, int priority) {
NBTTagCompound aNBT = new NBTTagCompound();
aNBT.setString("handlerID", handlerName);
aNBT.setString("itemName", stack);
aNBT.setInteger("priority", priority);
FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT);
}
private static void sendCatalyst(String handlerName, String stack) {
sendCatalyst(handlerName, stack, 0);
}
}
@@ -16,7 +16,6 @@ import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiWritingTable;
import codechicken.nei.ItemList;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
@@ -1,25 +1,20 @@
package WayofTime.alchemicalWizardry.client.nei;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.lang.reflect.Field;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Mouse;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.GuiRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
/**
* NEI Altar Recipe Handler by joshie *
@@ -81,51 +76,6 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler {
}
}
//Mouse Position helper
public Point getMouse(int width, int height) {
Point mousepos = getMousePosition();
int guiLeft = (width - 176) / 2;
int guiTop = (height - 166) / 2;
Point relMouse = new Point(mousepos.x - guiLeft, mousepos.y - guiTop);
return relMouse;
}
//width helper, getting width normal way hates me on compile
public int getGuiWidth(GuiRecipe gui) {
try {
Field f = gui.getClass().getField("width");
return (Integer) f.get(gui);
} catch (NoSuchFieldException e) {
try {
Field f = gui.getClass().getField("field_146294_l");
return (Integer) f.get(gui);
} catch (Exception e2) {
return 0;
}
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
//height helper, getting height normal way hates me on compile
public int getGuiHeight(GuiRecipe gui) {
try {
Field f = gui.getClass().getField("height");
return (Integer) f.get(gui);
} catch (NoSuchFieldException e) {
try {
Field f = gui.getClass().getField("field_146295_m");
return (Integer) f.get(gui);
} catch (Exception e2) {
return 0;
}
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
@Override
public void drawExtras(int id) {
CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id);
@@ -134,19 +84,19 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler {
}
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int id) {
currenttip = super.handleTooltip(gui, currenttip, id);
Point mouse = getMouse(getGuiWidth(gui), getGuiHeight(gui));
CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id);
int yLow = id % 2 == 0 ? 38 : 102;
int yHigh = id % 2 == 0 ? 72 : 136;
if(mouse.x >= 19 && mouse.x <= 80 && mouse.y >= yLow && mouse.y <= yHigh) {
currenttip.add(StatCollector.translateToLocal("bm.string.consume") + ": " + recipe.consumption + "LP/t");
currenttip.add(StatCollector.translateToLocal("bm.string.drain") + ": " + recipe.drain + "LP/t");
}
return currenttip;
}
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> currenttip, int id) {
super.handleTooltip(gui, currenttip, id);
Point mouse = GuiDraw.getMousePosition();
Point root = gui.getRecipePosition(id);
int offsetX = gui.guiLeft + root.x;
int offsetY = gui.guiTop + root.y;
if(mouse.x >= 14 + offsetX && mouse.x <= 75 + offsetX && mouse.y >= 22 + offsetY && mouse.y <= 56 + offsetY) {
CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id);
currenttip.add(StatCollector.translateToLocal("bm.string.consume") + ": " + recipe.consumption + "LP/t");
currenttip.add(StatCollector.translateToLocal("bm.string.drain") + ": " + recipe.drain + "LP/t");
}
return currenttip;
}
@Override
public String getOverlayIdentifier() {
@@ -167,21 +117,4 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler {
public String getGuiTexture() {
return new ResourceLocation("alchemicalwizardry", "gui/nei/altar.png").toString();
}
public static Point getMousePosition() {
Dimension size = displaySize();
Dimension res = displayRes();
return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1);
}
public static Dimension displaySize() {
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
return new Dimension(res.getScaledWidth(), res.getScaledHeight());
}
public static Dimension displayRes() {
Minecraft mc = Minecraft.getMinecraft();
return new Dimension(mc.displayWidth, mc.displayHeight);
}
}
@@ -1,17 +1,14 @@
package WayofTime.alchemicalWizardry.client.nei;
import java.awt.Rectangle;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Mouse;
import java.awt.*;
/**
* Binding Ritual Handler by Arcaratus
@@ -113,24 +110,4 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler
{
return new ResourceLocation("alchemicalwizardry", "gui/nei/bindingRitual.png").toString();
}
public static Point getMousePosition()
{
Dimension size = displaySize();
Dimension res = displayRes();
return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1);
}
public static Dimension displaySize()
{
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
return new Dimension(res.getScaledWidth(), res.getScaledHeight());
}
public static Dimension displayRes()
{
Minecraft mc = Minecraft.getMinecraft();
return new Dimension(mc.displayWidth, mc.displayHeight);
}
}
@@ -1,24 +1,22 @@
package WayofTime.alchemicalWizardry.client.nei;
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getBloodOrbs;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import codechicken.nei.ItemList;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.ShapedRecipeHandler;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.StatCollector;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getBloodOrbs;
/**
* NEI Blood Orb Shaped Recipe Handler by joshie *
*/
@@ -60,7 +58,8 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("crafting") && getClass() == NEIBloodOrbShapedHandler.class) {
for (IRecipe irecipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
@@ -78,7 +77,8 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes(ItemStack result) {
for (IRecipe irecipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
if (irecipe instanceof ShapedBloodOrbRecipe) {
@@ -92,7 +92,8 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (IRecipe irecipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
CachedShapedRecipe recipe = null;
@@ -4,16 +4,16 @@ import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.StatCollector;
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.ShapelessRecipeHandler;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.StatCollector;
/**
* NEI Blood Orb Shapeless Recipe Handler by joshie *
@@ -54,7 +54,8 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("crafting") && getClass() == NEIBloodOrbShapelessHandler.class) {
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
@@ -73,7 +74,8 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes(ItemStack result) {
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes) {
@@ -90,7 +92,8 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void loadUsageRecipes(ItemStack ingredient) {
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes) {
@@ -16,6 +16,7 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
@@ -25,34 +26,42 @@ import java.util.stream.Collectors;
public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
public class CachedMeteorRecipe extends CachedRecipe {
private final List<MeteorParadigmComponent> components;
private final List<PositionedStack> input = new ArrayList<>();
private final List<PositionedStack> outputs = new ArrayList<>();
private final int cost;
private final int radius;
private Point focus;
public CachedMeteorRecipe(MeteorParadigm meteor) {
this.components = meteor.componentList;
public CachedMeteorRecipe(MeteorParadigm meteor, ItemStack focusStack) {
this.input.add(new PositionedStack(meteor.focusStack, 74, 4));
int row = 0;
int col = 0;
float totalMeteorWeight = meteor.getTotalMeteorWeight();
for (MeteorParadigmComponent component : meteor.componentList) {
List<MeteorParadigmComponent> sortedComponents = new ArrayList<>(meteor.componentList);
sortedComponents.sort(Comparator.comparingInt(c -> -c.chance));
for (MeteorParadigmComponent component : sortedComponents) {
ItemStack stack = component.getValidBlockParadigm();
int xPos = 3 + 18 * col;
int yPos = 37 + 18 * row;
List<String> tooltips = new ArrayList<>();
if (stack == null) {
stack = new ItemStack(Blocks.fire);
tooltips.add(String.format("no entries found for oredict \"%s\"", component.getOreDictName()));
}
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(component.getChance() / totalMeteorWeight)));
this.outputs.add(new TooltipStack(stack, 3 + 18 * col, 37 + 18 * row, tooltips));
this.outputs.add(new TooltipStack(stack, xPos, yPos, tooltips));
col++;
if (col > 8) {
col = 0;
row++;
}
if (focusStack != null && matchItem(focusStack, stack)) {
this.focus = new Point(xPos - 1, yPos - 1);
}
}
this.radius = meteor.radius;
this.cost = meteor.cost;
@@ -73,10 +82,6 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
return this.outputs;
}
public List<MeteorParadigmComponent> getComponents() {
return components;
}
public int getCost() {
return cost;
}
@@ -95,7 +100,7 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals(getOverlayIdentifier()) && getClass() == NEIMeteorRecipeHandler.class) {
for (MeteorParadigm meteor : getSortedMeteors()) {
arecipes.add(new CachedMeteorRecipe(meteor));
arecipes.add(new CachedMeteorRecipe(meteor, null));
}
} else {
super.loadCraftingRecipes(outputId, results);
@@ -105,8 +110,8 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(ItemStack result) {
for (MeteorParadigm meteor : getSortedMeteors()) {
if (meteor.componentList.stream().anyMatch(m -> NEIServerUtils.areStacksSameTypeCrafting(result, m.getValidBlockParadigm()))) {
arecipes.add(new CachedMeteorRecipe(meteor));
if (meteor.componentList.stream().anyMatch(m -> matchItem(result, m.getValidBlockParadigm()))) {
arecipes.add(new CachedMeteorRecipe(meteor, result));
}
}
}
@@ -114,12 +119,24 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (MeteorParadigm meteor : getSortedMeteors()) {
if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, meteor.focusStack)) {
arecipes.add(new CachedMeteorRecipe(meteor));
if (matchItem(ingredient, meteor.focusStack)) {
arecipes.add(new CachedMeteorRecipe(meteor, null));
}
}
}
private boolean matchItem(ItemStack compared, ItemStack compareTo) {
if (NEIServerUtils.areStacksSameTypeCrafting(compared, compareTo)) {
return true;
}
// ignore ore variants (like basalt ore)
if (compared.getUnlocalizedName().startsWith("gt.blockores")
&& compareTo.getUnlocalizedName().startsWith("gt.blockores")) {
return compared.getItemDamage() % 1000 == compareTo.getItemDamage() % 1000;
}
return false;
}
@Override
public String getGuiTexture() {
return new ResourceLocation("alchemicalwizardry", "gui/nei/meteor.png").toString();
@@ -135,19 +152,25 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
int cost = meteorRecipe.getCost();
int radius = meteorRecipe.getRadius();
Minecraft.getMinecraft().fontRenderer.drawString(I18n.format("nei.recipe.meteor.cost", String.format("%,d", cost)), 2, 96, 0x000000);
Minecraft.getMinecraft().fontRenderer.drawString(I18n.format("nei.recipe.meteor.radius", radius), 2, 107, 0x000000);
Minecraft.getMinecraft().fontRenderer.drawString(I18n.format("nei.recipe.meteor.cost", String.format("%,d", cost)), 2, 168, 0x000000);
Minecraft.getMinecraft().fontRenderer.drawString(I18n.format("nei.recipe.meteor.radius", radius), 2, 179, 0x000000);
}
@Override
public void drawBackground(int recipe) {
public void drawBackground(int recipeIndex) {
GL11.glColor4f(1, 1, 1, 1);
GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 172, 130);
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 166, 202);
CachedMeteorRecipe recipe = (CachedMeteorRecipe) this.arecipes.get(recipeIndex);
Point focus = recipe.focus;
if (focus != null) {
GuiDraw.drawTexturedModalRect(focus.x, focus.y, 172, 0, 18, 18);
}
}
@Override
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe) {
public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack stack, List<String> currenttip, int recipe) {
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
for (PositionedStack pStack : meteorRecipe.outputs) {
if (!gui.isMouseOver(pStack, recipe)) continue;
@@ -174,10 +197,7 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
.collect(Collectors.toList());
}
private String getFormattedChance(float chance) {
float percentage = chance * 100.0f;
boolean isInteger = percentage - (int) percentage <= 0.01;
if (isInteger) return String.format("%,d", (int) percentage);
else return String.format("%,.1f", percentage);
private String getFormattedChance(double chance) {
return new DecimalFormat("0.##").format(chance * 100);
}
}
@@ -1,11 +1,9 @@
package WayofTime.alchemicalWizardry.client.nei;
import codechicken.nei.PositionedStack;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import codechicken.nei.PositionedStack;
public class TooltipStack extends PositionedStack {
private final List<String> tooltips;
@@ -50,7 +50,7 @@ public class ItemDiabloKey extends EnergyItems
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
World world = par3EntityPlayer.worldObj;
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP)
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer)
{
return par1ItemStack;
}
@@ -64,7 +64,7 @@ public class ItemDiabloKey extends EnergyItems
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
}
if (!par3EntityPlayer.worldObj.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class)))
if (par3EntityPlayer.worldObj.isRemote)
{
return par1ItemStack;
}
@@ -103,6 +103,7 @@ public class ItemDiabloKey extends EnergyItems
EnergyItems.checkAndSetItemOwner(itemStack, ownerName);
}
}
par3EntityPlayer.inventoryContainer.detectAndSendChanges();
return par1ItemStack;
}
@@ -4,6 +4,7 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.resources.I18n;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -158,7 +159,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
{
return super.getItemStackDisplayName(stack);
}
return "Ritual: " + Rituals.getNameOfRitual(ritualID);
return I18n.format("bm.string.ritualDiviner", Rituals.getLocalizedNameOfRitual(ritualID));
} else
{
return super.getItemStackDisplayName(stack);
@@ -412,7 +413,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
if (world.isRemote)
{
IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(stack)));
IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getLocalizedNameOfRitual(this.getCurrentRitual(stack)));
player.addChatComponentMessage(chatmessagecomponent);
}
}
@@ -30,7 +30,7 @@ public class RitualEffectDemonPortal extends RitualEffect
public static final int drainRate = 50;
public static final Reagent[] reagents = new Reagent[]{ReagentRegistry.aetherReagent, ReagentRegistry.aquasalusReagent, ReagentRegistry.terraeReagent, ReagentRegistry.incendiumReagent, ReagentRegistry.sanctusReagent, ReagentRegistry.tenebraeReagent, ReagentRegistry.magicalesReagent, ReagentRegistry.potentiaReagent};
public static final Int3[] jarLocations = new Int3[]{new Int3(4, 5, 4), new Int3(-4, 5, 4), new Int3(4, 5, -4), new Int3(-4, 5, -4), new Int3(0, 5, 6), new Int3(0, 5, -6), new Int3(6, 5, 0), new Int3(-6, 5, 0)};
@Override
public void performEffect(IMasterRitualStone ritualStone)
{
@@ -123,6 +123,10 @@ public class RitualEffectDemonPortal extends RitualEffect
@Override
public boolean startRitual(IMasterRitualStone ritualStone, EntityPlayer player)
{
for (int dim : AlchemicalWizardry.demonRitualDimensionBlacklist) {
if (player.dimension == dim) return false;
}
if(!checkJars(ritualStone))
{
player.addChatMessage(new ChatComponentTranslation("message.ritualdemonportal.missingjar"));
@@ -4,9 +4,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.common.Optional;
import gregtech.common.blocks.GT_TileEntity_Ores;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
@@ -123,7 +126,9 @@ public class MeteorParadigm
ItemStack blockStack = mpc.getValidBlockParadigm();
if(blockStack != null && blockStack.getItem() instanceof ItemBlock)
{
((ItemBlock)blockStack.getItem()).placeBlockAt(blockStack, null, world, x + i, y + j, z + k, 0, 0, 0, 0, blockStack.getItemDamage());
((ItemBlock)blockStack.getItem()).placeBlockAt(blockStack, null, world, x + i, y + j, z + k, 0, 0, 0, 0, blockStack.getItemDamage());
if (AlchemicalWizardry.isGregTechLoaded)
setGTOresNaturalIfNeeded(world, x + i, y + j, z + k);
world.markBlockForUpdate(x + i, y + j, z + k);
hasPlacedBlock = true;
break;
@@ -179,4 +184,12 @@ public class MeteorParadigm
}
}
}
@Optional.Method(modid = "gregtech")
private static void setGTOresNaturalIfNeeded(World world, int x, int y, int z) {
final TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof GT_TileEntity_Ores) {
((GT_TileEntity_Ores) tileEntity).mNatural = true;
}
}
}
+15
View File
@@ -0,0 +1,15 @@
# NEI Access Transformer configuration file
public net.minecraft.client.gui.inventory.GuiContainer field_146999_f #xSize
public net.minecraft.client.gui.inventory.GuiContainer field_147000_g #ySize
public net.minecraft.client.gui.inventory.GuiContainer field_147003_i #guiLeft
public net.minecraft.client.gui.inventory.GuiContainer field_147009_r #guiTop
public net.minecraft.client.gui.inventory.GuiContainer field_147007_t #spreading
public net.minecraft.client.gui.inventory.GuiContainer field_147008_s #spreadingSlots
public net.minecraft.client.gui.inventory.GuiContainer func_146975_c(II)Lnet/minecraft/inventory/Slot; #getSlotAtPosition
public net.minecraft.client.gui.GuiScreen field_146292_n #buttonList
public net.minecraft.entity.EntityList field_75624_e #classToIDMapping
public net.minecraft.client.renderer.Tessellator field_78415_z #isDrawing
public net.minecraft.client.multiplayer.PlayerControllerMP field_78779_k #currentGameType
public net.minecraft.nbt.NBTTagCompound field_74784_a #tagMap
public net.minecraft.nbt.NBTTagList field_74747_a #taglist
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

@@ -256,6 +256,7 @@ bm.string.drain=Drain
bm.string.tier=Tier
bm.string.crafting.orb.shaped=Shaped Orb Crafting
bm.string.crafting.orb.shapeless=Shapeless Orb Crafting
bm.string.ritualDiviner=Radius: %s
text.recipe.altar=Blood Altar
text.recipe.altar.tier=Tier: %s
text.recipe.altar.bloodRequired=LP: %s
@@ -265,6 +266,44 @@ nei.recipe.meteor.cost=Cost: %s LP
nei.recipe.meteor.radius=Radius: %s
nei.recipe.meteor.chance=Chance: %s%%
#Rituals
ritual.AW001Water.name=Ritual of the Full Spring
ritual.AW002Lava.name=Serenade of the Nether
ritual.AW003GreenGrove.name=Ritual of the Green Grove
ritual.AW004Interdiction.name=Interdiction Ritual
ritual.AW005Containment.name=Ritual of Containment
ritual.AW006Binding.name=Ritual of Binding
ritual.AW007Unbinding.name=Ritual of Unbinding
ritual.AW008HighJump.name=Ritual of the High Jump
ritual.AW009Magnetism.name=Ritual of Magnetism
ritual.AW010Crusher.name=Ritual of the Crusher
ritual.AW011Speed.name=Ritual of Speed
ritual.AW012AnimalGrowth.name=Ritual of the Shepherd
ritual.AW013Suffering.name=Well of Suffering
ritual.AW014Regen.name=Ritual of Regeneration
ritual.AW015FeatheredKnife.name=Ritual of the Feathered Knife
ritual.AW016FeatheredEarth.name=Ritual of the Feathered Earth
ritual.AW017Gaia.name=Ritual of Gaia's Transformation
ritual.AW018Condor.name=Reverence of the Condor
ritual.AW019FallingTower.name=Mark of the Falling Tower
ritual.AW020BalladOfAlchemy.name=Ballad of Alchemy
ritual.AW021Expulsion.name=Aura of Expulsion
ritual.AW022Supression.name=Dome of Supression
ritual.AW023Zephyr.name=Call of the Zephyr
ritual.AW024Harvest.name=Reap of the Harvest Moon
ritual.AW025Conduit.name=Cry of the Eternal Soul
ritual.AW026Ellipsoid.name=Focus of the Ellipsoid
ritual.AW027Evaporation.name=Song of Evaporation
ritual.AW028SpawnWard.name=Ward of Sacrosanctity
ritual.AW029VeilOfEvil.name=Veil of Evil
ritual.AW030FullStomach.name=Requiem of the Satiated Stomach
ritual.AW031Convocation.name=Convocation of the Damned
ritual.AW032Symmetry.name=Symmetry of the Omega
ritual.AW033Stalling.name=Duet of the Fused Souls
ritual.AW034Crafting.name=Rhythm of the Beating Anvil
ritual.AW035PhantomHands.name=Orchestra of the Phantom Hands
ritual.AW036SphereIsland.name=Blood of the New Moon
#Entities
entity.AWWayofTime.EarthElemental.name=Earth Elemental
entity.AWWayofTime.FireElemental.name=Fire Elemental
@@ -1,4 +1,4 @@
#Block Localization
#Block Localization
tile.bloodAltar.name=血之祭坛
tile.bloodRune.blank.name=气血符文
tile.bloodRune.fill.name=增容符文
@@ -256,10 +256,53 @@ bm.string.drain=消耗
bm.string.tier=层数
bm.string.crafting.orb.shaped=特定血宝珠合成
bm.string.crafting.orb.shapeless=不定血宝珠合成
bm.string.ritualDiviner=仪式: %s
text.recipe.altar=血之祭坛
text.recipe.altar.tier=层数: %s
text.recipe.altar.bloodRequired=LP: %s
text.recipe.shapedOrb=合适宝珠合成
nei.recipe.meteor.category=陨星仪式
nei.recipe.meteor.cost=消耗: %s LP
nei.recipe.meteor.radius=半径: %s
nei.recipe.meteor.chance=几率: %s%%
#Rituals
ritual.AW001Water.name=涌泉仪式
ritual.AW002Lava.name=下界夜曲
ritual.AW003GreenGrove.name=绿丛仪式
ritual.AW004Interdiction.name=禁止仪式
ritual.AW005Containment.name=牵制仪式
ritual.AW006Binding.name=绑定仪式
ritual.AW007Unbinding.name=解绑仪式
ritual.AW008HighJump.name=高跳仪式
ritual.AW009Magnetism.name=磁矿仪式
ritual.AW010Crusher.name=挖掘仪式
ritual.AW011Speed.name=速移仪式
ritual.AW012AnimalGrowth.name=牧养仪式
ritual.AW013Suffering.name=苦难之井
ritual.AW014Regen.name=重生仪式
ritual.AW015FeatheredKnife.name=羽刀仪式
ritual.AW016FeatheredEarth.name=羽地仪式
ritual.AW017Gaia.name=盖亚仪式
ritual.AW018Condor.name=崇敬之鹰
ritual.AW019FallingTower.name=陨星仪式
ritual.AW020BalladOfAlchemy.name=炼金之谣
ritual.AW021Expulsion.name=驱逐氛场
ritual.AW022Supression.name=抑液仪式
ritual.AW023Zephyr.name=和风之唤
ritual.AW024Harvest.name=满月收割
ritual.AW025Conduit.name=永魂之泣
ritual.AW026Ellipsoid.name=幽影屏障
ritual.AW027Evaporation.name=蒸发之曲
ritual.AW028SpawnWard.name=神圣庇佑
ritual.AW029VeilOfEvil.name=罪恶遮纱
ritual.AW030FullStomach.name=盛宴之歌
ritual.AW031Convocation.name=恶魔入侵
ritual.AW032Symmetry.name=欧米伽仪式
ritual.AW033Stalling.name=熔魂合奏
ritual.AW034Crafting.name=工作节律
ritual.AW035PhantomHands.name=幻手乐团
ritual.AW036SphereIsland.name=新月之血
#Entities
entity.AWWayofTime.EarthElemental.name=土之元素精灵
@@ -439,7 +482,7 @@ tooltip.sacrificialdagger.desc2=只是刺一下手指
tooltip.sacrificialdagger.desc3=你就能获得力量...
tooltip.sanguinearmor.desc1=一双充满力量的护目镜
tooltip.sanguinearmor.desc2=灌入被禁止的力量的长袍
tooltip.sanguinearmor.visdisc=灵气减免:
tooltip.sanguinearmor.visdisc=魔力减免:
tooltip.scribetool.desc=书写是在墙壁上的...
tooltip.seersigil.desc=看到更多总会有所不足
tooltip.sigilofelementalaffinity.desc1=在火中呼吸的鱼
@@ -564,4 +607,5 @@ bm.versioning.doneDownloading=已完成下载 %s 重新加载您的游戏以进
bm.versioning.error=下载mod时出错!
bm.versioning.downloadedAlready=你已经拥有最新版本,重新加载游戏以进行更新!
bm.versioning.downloadingAlready=正在下载! 耐心点!
bm.versioning.disabled=此功能已禁用.
bm.versioning.disabled=此功能已禁用.
@@ -0,0 +1,5 @@
commands.forge.usage=指令:/forge <子命令>. 子命令包括:tps, track
commands.forge.usage.tracking=指令:/forge track <类型> <持续时间>. 可用类型有:te (实体方块). 持续时间 < 60.
commands.forge.tps.summary=%s : 平均tick耗时: %d ms. 平均TPS: %d
commands.forge.tracking.te.enabled=已启用实体方块追踪 %d 秒.