Compare commits

..
25 Commits
Author SHA1 Message Date
miozune 82d7520944 Add estimated amount display for meteor NEI (#31) 2022-09-02 13:52:12 +02:00
miozune 3994b2510e Meteor NEI improvements (#30) 2022-08-19 09:40:43 +02:00
DianeXD ec9c3f67ff Move dim blacklist config to AlchemicalWizardry.java (#29) 2022-08-15 12:04:18 +02: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
BigflufandScriptedPiky 595bd797fd Meteor weight changes (#21)
* Set "weight" to 0 for testing

What will happen if the weight is 0? Time to find out!

* Experimental Additions

Based on what BigFluf (211200168656240642) on Discord stated:
"If this works you should be able to change the weights in the configs to any number you like, and it'll just use those as relative chances and never add any 'filler' blocks like the stone
So for example if you have a meteor with just Black Granite with weight 1 and Iron Ore with weight 1, both would have 50% chance
Or you could put both at 1 million and it'd still be the same
Just make sure the new meteor GUI is changed in the same way if possible, otherwise the ore chances will be inaccurate"

* Update MeteorParadigm.java

Removed hardcoded maxChance and chance at fixed 1000 total weight, instead using dynamically calculated total weight of all the blocks in the meteor

* Update NEIMeteorRecipeHandler.java

* Update BloodMagicConfiguration.java

* Added getTotalMeteorWeight function

Moved loop to calculate total weight to it's own function, used in NEI tab as well

* Using getTotalMeteorWeight function

Changed copy-pasted weight calculation code to function call for getTotalMeteorWeight

Co-authored-by: ScriptedPiky <[email protected]>
2022-04-08 14:03:58 +02:00
ScriptedPiky 79cab43a65 Reflects to 100k cost in config (#19)
See: https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/pull/9960
2022-03-15 14:02:14 +01:00
ScriptedPiky 52ee540b52 Sanity adjusted Superior Capacity Rune (#18)
I realized that the buff was perhaps too insane prior lmao
2022-03-01 09:20:13 +01:00
miozuneandMartin Robertz fe303bba0f Add NEI handler for Meteor Ritual (#17)
* Add NEI handler for Meteor Ritual

* gradle 1.2.7

* Sort by LP cost

Co-authored-by: Martin Robertz <[email protected]>
2022-02-25 17:29:28 +01:00
Martin Robertz 806757b52c ignore bat files 2022-02-25 16:44:17 +01:00
miozune 77df089900 Fix irrelevant Botania flowers show up in NEI (#16) 2022-02-25 12:18:14 +01:00
Martin Robertz b096ac46bd Update dependencies.gradle 2022-02-05 11:18:54 +01:00
Martin Robertz 47dbd427f6 Update dependencies.gradle 2022-02-05 11:16:57 +01:00
ScriptedPikyandMartin Robertz 8a7e8cba6c Some buffs to the Altar upgrades (#15)
* Some buffs to the Altar upgrades

These are relatively small to mild, but should suffice for some nice buffs. Starting off relatively small for now to test the waters.

* Readjust some values

Reconfirmation:  `this.consumptionMultiplier = (float) (0.25 * upgrades.getSpeedUpgrades());` seems to be for Orb input? And `this.efficiencyMultiplier = (float) Math.pow(0.80, upgrades.getSpeedUpgrades());` seems to be for everything else like normal recipes.

* Update dependencies.gradle

* Update dependencies.gradle

Co-authored-by: Martin Robertz <[email protected]>
2022-02-05 11:15:46 +01:00
ScriptedPikyandMartin Robertz 8feac596bb Initial cost from 1 million to 10 thousand instead to prepare for more meteor changes & stuff (#14)
* Mark of the Falling Tower (meteors) LP Adjustment

Initial cost from 1 million to 10 thousand instead. This is to plan for more meteor summons & overall adjustments without insanity initial costs

* Increased MotFT cost from 10k to 50k

* Update dependencies.gradle

Co-authored-by: Martin Robertz <[email protected]>
2022-02-05 11:15:01 +01:00
Martin Robertz 260796cccb Update dependencies.gradle 2022-02-05 11:07:49 +01:00
Martin Robertz 6450243814 Update dependencies.gradle 2022-02-05 11:04:44 +01:00
Jason Mitchell 6c5c65b307 update to explicit dependencies 2022-01-18 08:57:22 -08:00
Jason Mitchell 8693f562c0 maven publish buildscript update 2022-01-18 08:55:58 -08:00
31 changed files with 887 additions and 369 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 -54
View File
@@ -1,61 +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: Set repository owner and name
run: |
echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Publish package
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_GROUP_ID: com.github.${{ env.REPOSITORY_OWNER }}
ARTIFACT_ID: "${{ env.REPOSITORY_NAME }}"
ARTIFACT_VERSION: "${{ env.RELEASE_VERSION }}"
REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}"
REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}"
release-tags:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
secrets: inherit
+1
View File
@@ -26,3 +26,4 @@ whitelist.json
*.ipr
*.iws
src/main/resources/mixins.*.json
*.bat
+3
View File
@@ -0,0 +1,3 @@
# Any Github changes require admin approval
/.github/** @GTNewHorizons/admin
+3
View File
@@ -0,0 +1,3 @@
compileJava {
options.encoding = "UTF-8"
}
+329 -110
View File
@@ -1,49 +1,65 @@
//version: 928ecf7feb33a1149538b0e2cd17e3bc5f281428
//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/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle for updates.
*/
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 {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4'
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
}
}
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 '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)
@@ -87,27 +103,32 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly")
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)
}
}
@@ -119,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)
}
}
@@ -135,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)
}
}
@@ -149,13 +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()
// Pulls version from git tag
try {
version = minecraftVersion + "-" + gitVersion()
'git config core.fileMode false'.execute()
}
catch (Exception e) {
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!");
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 {
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
}
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
@@ -166,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
@@ -179,78 +241,99 @@ 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'
configurations {
implementation.extendsFrom(shadowImplementation)
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
implementation.extendsFrom(shadowCompile)
implementation.extendsFrom(shadeCompile)
}
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("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
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.3.3:dev")
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": []
}
"""
}
}
}
@@ -260,16 +343,28 @@ task relocateShadowJar(type: ConfigureShadowRelocation) {
}
shadowJar {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
configurations = [project.configurations.shadowImplementation]
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
dependsOn(relocateShadowJar)
}
jar {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes(getManifestAttributes())
}
@@ -302,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",
@@ -319,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 {
@@ -342,36 +421,35 @@ tasks.withType(JavaExec).configureEach {
)
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
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 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
}
// replace modVersion and minecraftVersion
expand "minecraftVersion": project.minecraft.version,
"modVersion": modVersion,
"modId": modId,
"modName": modName
}
if(usesMixins.toBoolean()) {
from refMap
}
if(usesMixins.toBoolean()) {
from refMap
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
// copy everything else that's not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
def getManifestAttributes() {
def manifestAttributes = [:]
if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) {
if(!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
}
@@ -387,19 +465,25 @@ 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')
}
task shadowDevJar(type: ShadowJar) {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
from sourceSets.main.output
getArchiveClassifier().set("dev")
@@ -408,7 +492,7 @@ task shadowDevJar(type: ShadowJar) {
}
minimize() // This will only allow shading for actually used classes
configurations = [project.configurations.shadowImplementation]
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
}
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
@@ -423,6 +507,12 @@ task circularResolverJar(type: Jar) {
}
task devJar(type: Jar) {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
from sourceSets.main.output
getArchiveClassifier().set("dev")
@@ -437,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("\\.", "/") + '/**'
}
@@ -453,13 +543,76 @@ task apiJar(type: Jar) {
}
artifacts {
archives sourcesJar
if(!noPublishedSources) {
archives sourcesJar
}
archives devJar
if(apiPackage) {
archives apiJar
}
}
// 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) {
from components.java
if(usesShadowedDependencies.toBoolean()) {
artifact source: shadowJar, classifier: ""
}
if(!noPublishedSources) {
artifact source: sourcesJar, classifier: "sources"
}
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
if (apiPackage) {
artifact source: apiJar, classifier: "api"
}
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
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)
}
}
}
}
repositories {
maven {
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
credentials {
username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
}
}
}
}
// Updating
task updateBuildScript {
doLast {
@@ -473,19 +626,19 @@ 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'")
}
}
static URL availableBuildScriptUrl() {
new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle")
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle")
}
boolean performBuildScriptUpdate(String projectDir) {
if (isNewBuildScriptVersionAvailable(projectDir)) {
def buildscriptFile = getFile("build.gradle")
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
return true
}
return false
@@ -516,11 +669,77 @@ 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) {
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")
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")
}
}
+15 -7
View File
@@ -1,25 +1,33 @@
// 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:ForestryMC:master-SNAPSHOT:api") {
compileOnly("com.github.GTNewHorizons:Botania:1.9.5-GTNH:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ForgeMultipart:master-SNAPSHOT:dev") {
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev") {
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Chisel:master-SNAPSHOT:api") {
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev")
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.20-GTNH:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ZenScript:master-SNAPSHOT") {
compileOnly("com.github.GTNewHorizons:Chisel:2.10.6-GTNH:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:CraftTweaker:master-SNAPSHOT:dev") {
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.6:dev") {
transitive = false
}
+4
View File
@@ -1,6 +1,10 @@
// Add any additional repositories for your dependencies here
repositories {
maven {
name = "GTNH Maven"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
}
maven {
url "https://cursemaven.com"
}
@@ -13,6 +13,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import WayofTime.alchemicalWizardry.api.BlockStack;
import WayofTime.alchemicalWizardry.client.nei.IMCForNEI;
import WayofTime.alchemicalWizardry.common.summoning.meteor.Meteor;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
@@ -277,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;
@@ -402,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;
@@ -1050,12 +1053,17 @@ public class AlchemicalWizardry
ItemIncense.registerIncenseRecipes();
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrucible), "i i", "sis", " S ", 's', new ItemStack(Blocks.stone_slab), 'i', ironIngotStack, 'S', stoneStack);
if (Loader.isModLoaded("NotEnoughItems")) {
IMCForNEI.IMCSender();
}
}
@EventHandler
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;
@@ -101,7 +102,6 @@ public class BloodMagicConfiguration
AlchemicalWizardry.customPotionDemonCloakID = config.get("Potion ID", "DemonCloak", 115).getInt();
AlchemicalWizardry.customPotionAmphibianID = config.get("Potion ID", "Amphibian", 116).getInt();
MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt();
AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true);
AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron", "gold", "copper", "tin", "lead", "silver", "osmium"}).getStringList();
@@ -203,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();
@@ -249,7 +249,7 @@ public class BloodMagicConfiguration
AlchemicalWizardry.ritualCostFeatheredEarth = config.get(lpCosts, "Ritual of the Feathered Earth", new int[]{100000, 0}).getIntList();
AlchemicalWizardry.ritualCostGaia = config.get(lpCosts, "Gaia's Transformation", new int[]{1000000, 0}).getIntList();
AlchemicalWizardry.ritualCostCondor = config.get(lpCosts, "Reverence of the Condor", new int[]{1000000, 0}).getIntList();
AlchemicalWizardry.ritualCostFallingTower = config.get(lpCosts, "Mark of the Falling Tower", new int[]{1000000, 0}).getIntList();
AlchemicalWizardry.ritualCostFallingTower = config.get(lpCosts, "Mark of the Falling Tower", new int[]{100000, 0}).getIntList();
AlchemicalWizardry.ritualCostBalladOfAlchemy = config.get(lpCosts, "Ballad of Alchemy", new int[]{20000, 10}).getIntList();
AlchemicalWizardry.ritualCostExpulsion = config.get(lpCosts, "Aura of Expulsion", new int[]{1000000, 1000}).getIntList();
AlchemicalWizardry.ritualCostSuppression = config.get(lpCosts, "Dome of Suppression", new int[]{10000, 2}).getIntList();
@@ -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)
{
@@ -0,0 +1,35 @@
package WayofTime.alchemicalWizardry.client.nei;
import cpw.mods.fml.common.event.FMLInterModComms;
import net.minecraft.nbt.NBTTagCompound;
public class IMCForNEI {
public static void IMCSender() {
sendHandler("alchemicalwizardry.meteor", "AWWayofTime:masterStone", 130);
sendCatalyst("alchemicalwizardry.meteor", "AWWayofTime:masterStone");
}
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", 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;
@@ -111,7 +110,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
public void loadCraftingRecipes(ItemStack result) {
for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) {
if (recipe == null) continue;
if (NEIServerUtils.areStacksSameTypeCrafting(result, recipe.getResult())) {
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(result, recipe.getResult())) {
arecipes.add(new CachedAlchemyRecipe(recipe));
}
}
@@ -131,7 +130,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
if (recipe == null) continue;
ItemStack[] stacks = recipe.getRecipe();
for (ItemStack stack : stacks) {
if (NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) {
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(stack, ingredient)) {
arecipes.add(new CachedAlchemyRecipe(recipe));
break;
}
@@ -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 *
@@ -66,7 +61,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(ItemStack result) {
for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) {
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.result, result)) {
if(NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.result, result)) {
if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe));
}
}
@@ -75,57 +70,12 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) {
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.requiredItem, ingredient)) {
if(NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.requiredItem, ingredient)) {
if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe));
}
}
}
//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
@@ -65,7 +62,7 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler
{
for (BindingRecipe recipe: BindingRegistry.bindingRecipes)
{
if (NEIServerUtils.areStacksSameTypeCrafting(recipe.outputItem, result))
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.outputItem, result))
{
if (recipe != null && recipe.outputItem != null)
{
@@ -80,7 +77,7 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler
{
for (BindingRecipe recipe: BindingRegistry.bindingRecipes)
{
if (NEIServerUtils.areStacksSameTypeCrafting(recipe.requiredItem, ingredient))
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.requiredItem, ingredient))
{
if (recipe != null && recipe.outputItem != null)
{
@@ -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,12 +77,13 @@ 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) {
CachedBloodOrbRecipe recipe = forgeShapedRecipe((ShapedBloodOrbRecipe) irecipe);
if (recipe == null || !NEIServerUtils.areStacksSameTypeCrafting(recipe.result.item, result))
if (recipe == null || !NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.result.item, result))
continue;
recipe.computeVisuals();
@@ -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,11 +74,12 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes(ItemStack result) {
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes) {
if (NEIServerUtils.areStacksSameTypeCrafting(irecipe.getRecipeOutput(), result)) {
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(irecipe.getRecipeOutput(), result)) {
CachedBloodOrbRecipe recipe = null;
if (irecipe instanceof ShapelessBloodOrbRecipe)
recipe = forgeShapelessRecipe((ShapelessBloodOrbRecipe) irecipe);
@@ -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) {
@@ -54,6 +54,8 @@ public class NEIConfig implements IConfigureNEI {
API.registerUsageHandler(new NEIBloodOrbShapelessHandler());
API.registerRecipeHandler(new NEIBindingRitualHandler());
API.registerUsageHandler(new NEIBindingRitualHandler());
API.registerRecipeHandler(new NEIMeteorRecipeHandler());
API.registerUsageHandler(new NEIMeteorRecipeHandler());
}
@Override
@@ -0,0 +1,210 @@
package WayofTime.alchemicalWizardry.client.nei;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigmComponent;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
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.client.resources.I18n;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
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;
import java.util.List;
import java.util.stream.Collectors;
public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
public class CachedMeteorRecipe extends CachedRecipe {
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, ItemStack focusStack) {
this.input.add(new PositionedStack(meteor.focusStack, 74, 4));
int row = 0;
int col = 0;
float totalMeteorWeight = meteor.getTotalMeteorWeight();
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()));
}
float chance = component.getChance() / totalMeteorWeight;
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(chance)));
tooltips.add(I18n.format("nei.recipe.meteor.amount", getEstimatedAmount(chance, meteor.radius)));
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;
}
@Override
public List<PositionedStack> getIngredients() {
return this.input;
}
@Override
public PositionedStack getResult() {
return null;
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
public int getCost() {
return cost;
}
public int getRadius() {
return radius;
}
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(75, 22, 15, 13), getOverlayIdentifier()));
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals(getOverlayIdentifier()) && getClass() == NEIMeteorRecipeHandler.class) {
for (MeteorParadigm meteor : getSortedMeteors()) {
arecipes.add(new CachedMeteorRecipe(meteor, null));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for (MeteorParadigm meteor : getSortedMeteors()) {
if (meteor.componentList.stream().anyMatch(m -> matchItem(result, m.getValidBlockParadigm()))) {
arecipes.add(new CachedMeteorRecipe(meteor, result));
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (MeteorParadigm meteor : getSortedMeteors()) {
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();
}
@Override
public String getOverlayIdentifier() {
return "alchemicalwizardry.meteor";
}
@Override
public void drawExtras(int recipe) {
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, 168, 0x000000);
Minecraft.getMinecraft().fontRenderer.drawString(I18n.format("nei.recipe.meteor.radius", radius), 2, 179, 0x000000);
}
@Override
public void drawBackground(int recipeIndex) {
GL11.glColor4f(1, 1, 1, 1);
GuiDraw.changeTexture(getGuiTexture());
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) {
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
for (PositionedStack pStack : meteorRecipe.outputs) {
if (!gui.isMouseOver(pStack, recipe)) continue;
if (!(pStack instanceof TooltipStack)) break;
TooltipStack tStack = (TooltipStack) pStack;
if (Arrays.stream(tStack.items).anyMatch(s -> NEIServerUtils.areStacksSameTypeCrafting(s, stack))) {
currenttip.addAll(tStack.getTooltips());
break;
}
}
return currenttip;
}
@Override
public String getRecipeName() {
return I18n.format("nei.recipe.meteor.category");
}
private List<MeteorParadigm> getSortedMeteors() {
return MeteorRegistry.paradigmList
.stream()
.sorted(Comparator.comparing(m -> m.cost))
.collect(Collectors.toList());
}
private String getFormattedChance(float chance) {
return new DecimalFormat("0.##").format(chance * 100);
}
private int getEstimatedAmount(float chance, int radius) {
return (int) Math.ceil(3f / 4 * Math.PI * Math.pow(radius, 3) * chance);
}
}
@@ -0,0 +1,23 @@
package WayofTime.alchemicalWizardry.client.nei;
import java.util.List;
import codechicken.nei.PositionedStack;
public class TooltipStack extends PositionedStack {
private final List<String> tooltips;
public TooltipStack(Object object, int x, int y, boolean genPerms, List<String> tooltips) {
super(object, x, y, genPerms);
this.tooltips = tooltips;
}
public TooltipStack(Object object, int x, int y, List<String> tooltips) {
this(object, x, y, true, tooltips);
}
public List<String> getTooltips() {
return 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;
@@ -16,7 +19,6 @@ public class MeteorParadigm
public ItemStack focusStack;
public int radius;
public int cost;
public static int maxChance = 1000;
public static Random rand = new Random();
@@ -37,6 +39,21 @@ public class MeteorParadigm
componentList.add(mpc);
}
}
public int getTotalMeteorWeight()
{
int totalMeteorWeight = 0;
for (MeteorParadigmComponent mpc : componentList)
{
if (mpc == null || !mpc.isValidBlockParadigm())
{
continue;
}
totalMeteorWeight += mpc.getChance();
}
return totalMeteorWeight;
}
public void createMeteorImpact(World world, int x, int y, int z, boolean[] flags)
{
@@ -56,16 +73,13 @@ public class MeteorParadigm
}
int newRadius = radius;
int chance = maxChance;
if (hasOrbisTerrae)
{
newRadius += 2;
chance += 200;
} else if (hasTerrae)
{
newRadius += 1;
chance += 100;
}
world.createExplosion(null, x, y, z, newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks);
@@ -75,6 +89,8 @@ public class MeteorParadigm
float obsidChance = hasTennebrae ? 1 : 0;
float totalChance = iceChance + soulChance + obsidChance;
int totalMeteorWeight = getTotalMeteorWeight();
for (int i = -newRadius; i <= newRadius; i++)
{
@@ -92,7 +108,8 @@ public class MeteorParadigm
continue;
}
int randNum = world.rand.nextInt(chance);
int randNum = world.rand.nextInt(totalMeteorWeight);
boolean hasPlacedBlock = false;
for (MeteorParadigmComponent mpc : componentList)
@@ -109,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;
@@ -165,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;
}
}
}
@@ -797,13 +797,13 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
this.isUpgraded = checkUpgrade;
this.upgradeLevel = upgradeState;
this.consumptionMultiplier = (float) (0.20 * upgrades.getSpeedUpgrades());
this.efficiencyMultiplier = (float) Math.pow(0.85, upgrades.getSpeedUpgrades());
this.sacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSacrificeUpgrades());
this.selfSacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSelfSacrificeUpgrades());
this.capacityMultiplier = (float) ((1 * Math.pow(1.10, upgrades.getBetterCapacitiveUpgrades()) + 0.20 * upgrades.getAltarCapacitiveUpgrades()));
this.dislocationMultiplier = (float) (Math.pow(1.2, upgrades.getDisplacementUpgrades()));
this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades());
this.consumptionMultiplier = (float) (0.25 * upgrades.getSpeedUpgrades());
this.efficiencyMultiplier = (float) Math.pow(0.80, upgrades.getSpeedUpgrades());
this.sacrificeEfficiencyMultiplier = (float) (0.12 * upgrades.getSacrificeUpgrades());
this.selfSacrificeEfficiencyMultiplier = (float) (0.12 * upgrades.getSelfSacrificeUpgrades());
this.capacityMultiplier = (float) ((1 * Math.pow(1.14, upgrades.getBetterCapacitiveUpgrades()) + 0.35 * upgrades.getAltarCapacitiveUpgrades()));
this.dislocationMultiplier = (float) (Math.pow(1.5, upgrades.getDisplacementUpgrades()));
this.orbCapacityMultiplier = (float) (1 + 0.04 * upgrades.getOrbCapacitiveUpgrades());
this.capacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier);
this.bufferCapacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 1 * capacityMultiplier);
this.accelerationUpgrades = upgrades.getAccelerationUpgrades();
+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.

After

Width:  |  Height:  |  Size: 3.6 KiB

@@ -256,10 +256,54 @@ 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
text.recipe.shapedOrb=Shaped Orb Recipe
nei.recipe.meteor.category=Meteor Ritual
nei.recipe.meteor.cost=Cost: %s LP
nei.recipe.meteor.radius=Radius: %s
nei.recipe.meteor.chance=Chance: %s%%
nei.recipe.meteor.amount=Estimated amount: %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
@@ -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 秒.