mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e37a932d84 | ||
|
|
595bd797fd | ||
|
|
1593b5482b | ||
|
|
00f9fa1add | ||
|
|
5c930a479f | ||
|
|
d8b0fa1cc9 | ||
|
|
801a8548f2 | ||
|
|
366a22908f | ||
|
|
c72e20a7ef | ||
|
|
79cab43a65 | ||
|
|
52ee540b52 | ||
|
|
fe303bba0f | ||
|
|
806757b52c | ||
|
|
77df089900 | ||
|
|
b096ac46bd | ||
|
|
47dbd427f6 | ||
|
|
8a7e8cba6c | ||
|
|
8feac596bb | ||
|
|
260796cccb | ||
|
|
6450243814 | ||
|
|
6c5c65b307 | ||
|
|
8693f562c0 |
No files matched your search
@@ -44,18 +44,8 @@ jobs:
|
||||
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
|
||||
- name: Publish to Maven
|
||||
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 }}"
|
||||
|
||||
MAVEN_USER: ${{ secrets.MAVEN_USER }}
|
||||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
||||
@@ -26,3 +26,4 @@ whitelist.json
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
@@ -0,0 +1,3 @@
|
||||
# Any Github changes require admin approval
|
||||
/.github/** @GTNewHorizons/admin
|
||||
|
||||
+100
-35
@@ -1,9 +1,9 @@
|
||||
//version: 928ecf7feb33a1149538b0e2cd17e3bc5f281428
|
||||
//version: 1642484596
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4'
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ plugins {
|
||||
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")
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
@@ -87,6 +88,7 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly")
|
||||
checkPropertyExists("usesShadowedDependencies")
|
||||
checkPropertyExists("developmentEnvironmentUserName")
|
||||
|
||||
boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
|
||||
|
||||
String javaSourceDir = "src/main/java/"
|
||||
String scalaSourceDir = "src/main/scala/"
|
||||
@@ -150,12 +152,16 @@ 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
|
||||
|
||||
// Pulls version first from the VERSION env and then git tag
|
||||
String identifiedVersion
|
||||
try {
|
||||
version = minecraftVersion + "-" + gitVersion()
|
||||
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!");
|
||||
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!");
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
@@ -194,7 +200,9 @@ if(file("addon.gradle").exists()) {
|
||||
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 {
|
||||
@@ -220,7 +228,7 @@ dependencies {
|
||||
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"
|
||||
@@ -228,7 +236,7 @@ dependencies {
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,16 +268,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())
|
||||
}
|
||||
@@ -343,31 +363,31 @@ 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
|
||||
{
|
||||
// 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 version and mcversion
|
||||
expand "minecraftVersion": project.minecraft.version,
|
||||
"modVersion": versionDetails().lastTag,
|
||||
"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, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
def getManifestAttributes() {
|
||||
def manifestAttributes = [:]
|
||||
@@ -400,6 +420,12 @@ task sourcesJar(type: Jar) {
|
||||
}
|
||||
|
||||
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 +434,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 +449,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")
|
||||
|
||||
@@ -453,13 +485,46 @@ task apiJar(type: Jar) {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
if(!noPublishedSources) {
|
||||
archives sourcesJar
|
||||
}
|
||||
archives devJar
|
||||
if(apiPackage) {
|
||||
archives apiJar
|
||||
}
|
||||
}
|
||||
|
||||
// publishing
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: ""
|
||||
if(!noPublishedSources) {
|
||||
artifact source: sourcesJar, classifier: "src"
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -478,7 +543,7 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -520,7 +585,7 @@ configure(updateBuildScript) {
|
||||
|
||||
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")
|
||||
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
-5
@@ -4,22 +4,25 @@ dependencies {
|
||||
compileOnly("com.github.GTNewHorizons:Botania:master-SNAPSHOT:api") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:master-SNAPSHOT:api") {
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:api") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:master-SNAPSHOT:dev") {
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev") {
|
||||
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.7-GTNH:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:master-SNAPSHOT:api") {
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.10.6-GTNH:api") {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:ZenScript:master-SNAPSHOT") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:master-SNAPSHOT:dev") {
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.6:dev") {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -1050,6 +1051,10 @@ 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
|
||||
|
||||
@@ -101,7 +101,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();
|
||||
|
||||
@@ -249,7 +248,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();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class IMCForNEI {
|
||||
public static void IMCSender() {
|
||||
setNBTAndSend("WayofTime.alchemicalWizardry.client.nei.NEIMeteorRecipeHandler", "AWWayofTime:masterStone", 130);
|
||||
}
|
||||
|
||||
private static void setNBTAndSend(String handlerName, String aBlock, 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.setInteger("handlerHeight", height);
|
||||
NBT.setInteger("maxRecipesPerPage", 1);
|
||||
FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", NBT);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,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 +131,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;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,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,7 +75,7 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,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 +80,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)
|
||||
{
|
||||
|
||||
@@ -83,7 +83,7 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
|
||||
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();
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
|
||||
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);
|
||||
|
||||
@@ -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,183 @@
|
||||
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.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<MeteorParadigmComponent> components;
|
||||
private final List<PositionedStack> input = new ArrayList<>();
|
||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||
private final int cost;
|
||||
private final int radius;
|
||||
|
||||
public CachedMeteorRecipe(MeteorParadigm meteor) {
|
||||
this.components = meteor.componentList;
|
||||
this.input.add(new PositionedStack(meteor.focusStack, 74, 4));
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
float totalMeteorWeight = meteor.getTotalMeteorWeight();
|
||||
|
||||
for (MeteorParadigmComponent component : meteor.componentList) {
|
||||
ItemStack stack = component.getValidBlockParadigm();
|
||||
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));
|
||||
col++;
|
||||
if (col > 8) {
|
||||
col = 0;
|
||||
row++;
|
||||
}
|
||||
}
|
||||
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 List<MeteorParadigmComponent> getComponents() {
|
||||
return components;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
for (MeteorParadigm meteor : getSortedMeteors()) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, meteor.focusStack)) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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, 96, 0x000000);
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(I18n.format("nei.recipe.meteor.radius", radius), 2, 107, 0x000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 172, 130);
|
||||
}
|
||||
|
||||
@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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+19
-5
@@ -16,7 +16,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 +36,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 +70,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 +86,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 +105,8 @@ public class MeteorParadigm
|
||||
continue;
|
||||
}
|
||||
|
||||
int randNum = world.rand.nextInt(chance);
|
||||
int randNum = world.rand.nextInt(totalMeteorWeight);
|
||||
|
||||
boolean hasPlacedBlock = false;
|
||||
|
||||
for (MeteorParadigmComponent mpc : componentList)
|
||||
|
||||
@@ -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();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -260,6 +260,10 @@ 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%%
|
||||
|
||||
#Entities
|
||||
entity.AWWayofTime.EarthElemental.name=Earth Elemental
|
||||
|
||||
Reference in new issue
Block a user