Compare commits

...
35 Commits
Author SHA1 Message Date
Ruling-0 1e4e8abb57 Merge remote-tracking branch 'origin/master' into mu 2026-11-21 15:46:37 -06:00
UltraProdigy 0c361f2482 ci: run build and test on release branches 2026-11-09 00:56:31 -05:00
koolkrafter5andNikolay S. d299b0a1b0 Make bound tools truly ignore durability damage rather than just repairing the damage when held for free (#150)
Co-authored-by: Nikolay S. <[email protected]>
2026-11-01 20:16:32 -06:00
Eldrinn ElanteyandNikolay S. 927e531af8 Chemistry Set: look up the recipe once per tick (#149)
Co-authored-by: Nikolay S. <[email protected]>
2026-10-26 16:04:07 +01:00
Mykhailo BalakerandNikolay S. 395f258893 Fix spectral block placing a raw meta block (#154)
Co-authored-by: Nikolay S. <[email protected]>
2026-10-25 00:53:29 -05:00
Mykhailo Balaker 56a268bcda Make Altar packet write the ItemStack to NBT (#155) 2026-10-25 00:39:49 -05:00
Ruling-0 329016558a Bump MaterialLib to 0.24.0-mu 2026-10-11 18:25:12 -05:00
Ruling-0 dc710016aa Bump MaterialLib to 0.21.0-mu 2026-10-09 21:16:25 -05:00
Ruling-0 78e3ca73a5 Bump MaterialLib to 0.20.0-mu 2026-10-09 19:02:20 -05:00
Ruling-0 1c2a3049b6 Drop the legacy GregTech ore variant match from the meteor NEI handler 2026-10-07 00:55:13 -05:00
Ruling-0 0f380724f9 Bump MaterialLib to 0.19.0-mu 2026-10-06 14:55:43 -05:00
Ruling-0 749b205a26 Drop the GregTech legacy ore block checks 2026-10-06 13:56:49 -05:00
Ruling-0 e0505b0726 Bump MaterialLib to 0.18.0-mu 2026-10-04 12:34:37 -05:00
Ruling-0 c9272dc1c5 Bump MaterialLib to 0.17.0-mu 2026-10-04 12:15:39 -05:00
Ruling-0 a1e224cf53 Bump MaterialLib to 0.16.0-mu 2026-10-04 02:48:09 -05:00
Ruling-0 63a294bd54 Bump MaterialLib to 0.15.0-mu 2026-09-30 13:01:44 -05:00
Ruling-0 447e8f5831 Merge remote-tracking branch 'origin/master' into mu 2026-09-30 11:40:42 -05:00
Ruling-0 43925d2a3a Bump MaterialLib to 0.14.0-mu 2026-09-30 11:03:24 -05:00
Ruling-0 0e3fd9f00a Bump MaterialLib to 0.13.0-mu 2026-09-29 16:57:02 -05:00
Ruling-0 e234b53bfc Bump MaterialLib to 0.12.0-mu 2026-09-29 07:22:31 -05:00
Martin Robertz 10a36f6413 update+gradle+bs+deps+gitignore 2026-09-29 08:45:57 +02:00
micvogandkoolkrafter5 951367919f Fix inverted owner check in Teleport, Watery Grave and Lightning Bolt spells (#152)
Co-authored-by: koolkrafter5 <[email protected]>
2026-09-28 22:40:10 -04:00
micvog 7fee341e50 Fix item foci not being recognised by the spell table (#151) 2026-09-28 21:02:14 -04:00
Ruling-0 f686f6f827 Build demon village loot on first use 2026-09-27 12:28:50 -05:00
Ruling-0 77969bb205 Bump MaterialLib to 0.11.0-mu 2026-09-22 09:54:07 -05:00
Ruling-0 00c9c9bf49 Bump MaterialLib to 0.10.0-mu 2026-08-29 22:33:25 -05:00
Ruling-0 62efdaf29d Merge remote-tracking branch 'origin/master' into mu 2026-08-29 22:19:21 -05:00
Mykhailo Balakerandboubou19 6776676ef2 Fix drowning effect interval math (#147)
Co-authored-by: boubou19 <[email protected]>
2026-08-21 18:49:55 +02:00
431bc8fb41 Allow using ints directly in orb crafting table recipes to set the orb level (#143)
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: boubou19 <[email protected]>
2026-08-21 15:36:28 +00:00
Ruling-0 e40bde9c84 Doc and code style pass 2026-08-20 17:50:50 -05:00
Ruling-0 421478e6fa Support MaterialLib ml references in meteor configs 2026-08-17 20:19:51 -05:00
Ruling-0 c99578e04d Add MaterialLib as a compile-only dependency 2026-08-17 20:19:16 -05:00
boubou19 9b7b10e5c3 Cache enum .values() (#146) 2026-08-10 20:58:12 +02:00
__felix__andgithub-actions[bot] fc58f5346c fix loader check (#144)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-29 11:52:12 -04:00
koolkrafter5 aec32b9149 Make blood orb stacks in NEI size 0 (#142) 2026-07-26 22:59:16 +00:00
41 changed files with 355 additions and 410 deletions

No files matched your search

+2 -2
View File
@@ -3,9 +3,9 @@ name: Build and test
on: on:
pull_request: pull_request:
branches: [ master, main ] branches: [ master, main, release/** ]
push: push:
branches: [ master, main ] branches: [ master, main, release/** ]
jobs: jobs:
build-and-test: build-and-test:
+1
View File
@@ -27,4 +27,5 @@ whitelist.json
*.iws *.iws
src/main/resources/mixins.*.json src/main/resources/mixins.*.json
*.bat *.bat
*.sh
layout.json layout.json
+12 -10
View File
@@ -23,22 +23,24 @@
*/ */
dependencies { dependencies {
api("com.github.GTNewHorizons:waila:1.19.25:dev") api("com.github.GTNewHorizons:waila:1.19.34:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.8.93-GTNH:dev") api("com.github.GTNewHorizons:NotEnoughItems:2.8.152-GTNH:dev")
compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.57:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:GTNHLib:0.11.52:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.480:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.189:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.13.16-GTNH:api") {transitive = false } compileOnly("com.github.GTNewHorizons:Botania:1.13.36-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.19:api") {transitive = false } compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.38:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.7.15:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.17.26-GTNH:api") {transitive = false } compileOnly("com.github.GTNewHorizons:Chisel:2.17.33-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.7:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.8:dev") {transitive = false }
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false } compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false } compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false }
compileOnly("curse.maven:endlessids-665730:7585931") {transitive = false } compileOnly("curse.maven:endlessids-665730:7585931") {transitive = false }
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.34:dev") compileOnly("com.github.GTNewHorizons:StructureLib:1.4.45:dev")
compileOnly("com.ruling_0:MaterialLib:0.24.0-mu:dev") {transitive = false }
} }
+5
View File
@@ -186,6 +186,11 @@ modrinthRelations =
# Leave this empty if you don't want to publish on CurseForge. # Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId = curseForgeProjectId =
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
# Use client or server for mods that only support one environment. Defaults to client,server.
# These tags describe where the mod can run, not whether installation is required on both sides.
curseForgeEnvironments = client,server
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge. # The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;... # Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible], # Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
+10 -10
View File
@@ -1,12 +1,12 @@
#This file is generated by updateDaemonJvm #This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
toolchainVersion=25 toolchainVersion=25
Binary file not shown.
+3 -1
View File
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000 networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
Vendored
+3 -3
View File
@@ -20,7 +20,7 @@
############################################################################## ##############################################################################
# #
# Gradle start up script for POSIX generated by Gradle. # gradlew start up script for POSIX generated by Gradle.
# #
# Important for running: # Important for running:
# #
@@ -29,7 +29,7 @@
# bash, then to run this script, type that shell name before the whole # bash, then to run this script, type that shell name before the whole
# command line, like: # command line, like:
# #
# ksh Gradle # ksh gradlew
# #
# Busybox and similar reduced shells will NOT work, because this script # Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features: # requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
Vendored
+12 -23
View File
@@ -19,12 +19,12 @@
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem gradlew startup script for Windows
@rem @rem
@rem ########################################################################## @rem ##########################################################################
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables, and ensure extensions are enabled
if "%OS%"=="Windows_NT" setlocal setlocal EnableExtensions
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@@ -51,7 +51,7 @@ echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2 echo location of your Java installation. 1>&2
goto fail "%COMSPEC%" /c exit 1
:findJavaFromJavaHome :findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
@@ -65,29 +65,18 @@ echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2 echo location of your Java installation. 1>&2
goto fail "%COMSPEC%" /c exit 1
:execute :execute
@rem Setup the command line @rem Setup the command line
@rem Execute Gradle @rem Execute gradlew
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* @rem endlocal doesn't take effect until after the line is parsed and variables are expanded
@rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
:end :exitWithErrorLevel
@rem End local scope for the variables with windows NT shell @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
if %ERRORLEVEL% equ 0 goto mainEnd "%COMSPEC%" /c exit %ERRORLEVEL%
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+1
View File
@@ -1,4 +1,5 @@
// Add any additional repositories for your dependencies here // Add any additional repositories for your dependencies here
repositories { repositories {
mavenLocal()
} }
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
} }
plugins { plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24' id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.32'
} }
@@ -86,7 +86,6 @@ import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityM
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianWind; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianWind;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntIce; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntIce;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntWind; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntWind;
import WayofTime.alchemicalWizardry.common.demonVillage.loot.DemonVillageLootRegistry;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonChest; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonChest;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
import WayofTime.alchemicalWizardry.common.entity.mob.EntityAirElemental; import WayofTime.alchemicalWizardry.common.entity.mob.EntityAirElemental;
@@ -479,7 +478,7 @@ public class AlchemicalWizardry {
public static int ritualWeakCostThunderstorm; public static int ritualWeakCostThunderstorm;
public static int ritualWeakCostZombie; public static int ritualWeakCostZombie;
public static boolean isGregTechLoaded; public static boolean isGregTech5UnofficialNewHorizonsLoaded;
public static boolean isThaumcraftLoaded; public static boolean isThaumcraftLoaded;
public static boolean isForestryLoaded; public static boolean isForestryLoaded;
public static boolean isBotaniaLoaded; public static boolean isBotaniaLoaded;
@@ -773,11 +772,8 @@ public class AlchemicalWizardry {
ItemStack reedStack = new ItemStack(Items.reeds); ItemStack reedStack = new ItemStack(Items.reeds);
ItemStack blankSlateStack = new ItemStack(ModItems.blankSlate, 1, craftingConstant); ItemStack blankSlateStack = new ItemStack(ModItems.blankSlate, 1, craftingConstant);
ItemStack reinforcedSlateStack = new ItemStack(ModItems.reinforcedSlate, 1, craftingConstant); ItemStack reinforcedSlateStack = new ItemStack(ModItems.reinforcedSlate, 1, craftingConstant);
ItemStack weakBloodOrbStack = new ItemStack(ModItems.weakBloodOrb, 1, craftingConstant);
ItemStack imbuedSlateStack = new ItemStack(ModItems.imbuedSlate, 1, craftingConstant); ItemStack imbuedSlateStack = new ItemStack(ModItems.imbuedSlate, 1, craftingConstant);
ItemStack demonSlateStack = new ItemStack(ModItems.demonicSlate, 1, craftingConstant); ItemStack demonSlateStack = new ItemStack(ModItems.demonicSlate, 1, craftingConstant);
ItemStack apprenticeBloodOrbStack = new ItemStack(ModItems.apprenticeBloodOrb, 1, craftingConstant);
ItemStack magicianBloodOrbStack = new ItemStack(ModItems.magicianBloodOrb, 1, craftingConstant);
ItemStack waterSigilStackCrafted = new ItemStack(ModItems.waterSigil); ItemStack waterSigilStackCrafted = new ItemStack(ModItems.waterSigil);
ItemStack lavaSigilStackCrafted = new ItemStack(ModItems.lavaSigil); ItemStack lavaSigilStackCrafted = new ItemStack(ModItems.lavaSigil);
ItemStack voidSigilStackCrafted = new ItemStack(ModItems.voidSigil); ItemStack voidSigilStackCrafted = new ItemStack(ModItems.voidSigil);
@@ -824,7 +820,6 @@ public class AlchemicalWizardry {
lavaCrystalStackCrafted.setItemDamage(lavaCrystalStackCrafted.getMaxDamage()); lavaCrystalStackCrafted.setItemDamage(lavaCrystalStackCrafted.getMaxDamage());
miningSigilStackCrafted.setItemDamage(miningSigilStackCrafted.getMaxDamage()); miningSigilStackCrafted.setItemDamage(miningSigilStackCrafted.getMaxDamage());
sigilOfElementalAffinityStackCrafted.setItemDamage(sigilOfElementalAffinityStackCrafted.getMaxDamage()); sigilOfElementalAffinityStackCrafted.setItemDamage(sigilOfElementalAffinityStackCrafted.getMaxDamage());
ItemStack archmageBloodOrbStack = new ItemStack(ModItems.archmageBloodOrb);
ItemStack sanctusStack = new ItemStack(ModItems.sanctus); ItemStack sanctusStack = new ItemStack(ModItems.sanctus);
ItemStack aetherStack = new ItemStack(ModItems.aether); ItemStack aetherStack = new ItemStack(ModItems.aether);
ItemStack terraeStack = new ItemStack(ModItems.terrae); ItemStack terraeStack = new ItemStack(ModItems.terrae);
@@ -857,7 +852,7 @@ public class AlchemicalWizardry {
'l', 'l',
lavaBucketStack, lavaBucketStack,
'b', 'b',
weakBloodOrbStack, 1,
'd', 'd',
diamondStack, diamondStack,
'o', 'o',
@@ -873,7 +868,7 @@ public class AlchemicalWizardry {
'b', 'b',
blankSlateStack, blankSlateStack,
'o', 'o',
weakBloodOrbStack)); 1));
GameRegistry.addRecipe( GameRegistry.addRecipe(
lavaSigilStackCrafted, lavaSigilStackCrafted,
"lml", "lml",
@@ -898,7 +893,7 @@ public class AlchemicalWizardry {
'r', 'r',
reinforcedSlateStack, reinforcedSlateStack,
'o', 'o',
apprenticeBloodOrbStack, 2,
's', 's',
stringStack)); stringStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -923,7 +918,7 @@ public class AlchemicalWizardry {
's', 's',
stoneStack, stoneStack,
'o', 'o',
weakBloodOrbStack, 1,
'r', 'r',
blankSlateStack)); blankSlateStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -948,7 +943,7 @@ public class AlchemicalWizardry {
's', 's',
stoneStack, stoneStack,
'o', 'o',
magicianBloodOrbStack, 3,
'b', 'b',
emptyBucketStack, emptyBucketStack,
'r', 'r',
@@ -962,7 +957,7 @@ public class AlchemicalWizardry {
's', 's',
stoneStack, stoneStack,
'o', 'o',
magicianBloodOrbStack, 3,
'b', 'b',
waterBucketStack, waterBucketStack,
'r', 'r',
@@ -976,9 +971,9 @@ public class AlchemicalWizardry {
's', 's',
stoneStack, stoneStack,
'o', 'o',
new ItemStack(ModItems.masterBloodOrb), 4,
'w', 'w',
weakBloodOrbStack, 1,
'r', 'r',
new ItemStack(ModItems.demonicSlate))); new ItemStack(ModItems.demonicSlate)));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -990,7 +985,7 @@ public class AlchemicalWizardry {
's', 's',
obsidianStack, obsidianStack,
'o', 'o',
new ItemStack(ModItems.masterBloodOrb), 4,
'r', 'r',
new ItemStack(ModItems.demonicSlate), new ItemStack(ModItems.demonicSlate),
'b', 'b',
@@ -1010,7 +1005,7 @@ public class AlchemicalWizardry {
's', 's',
reinforcedSlateStack, reinforcedSlateStack,
'o', 'o',
apprenticeBloodOrbStack)); 2));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapedBloodOrbRecipe( new ShapedBloodOrbRecipe(
miningSigilStackCrafted, miningSigilStackCrafted,
@@ -1018,7 +1013,7 @@ public class AlchemicalWizardry {
"hra", "hra",
"sos", "sos",
'o', 'o',
apprenticeBloodOrbStack, 2,
's', 's',
stoneStack, stoneStack,
'p', 'p',
@@ -1040,7 +1035,7 @@ public class AlchemicalWizardry {
'g', 'g',
goldIngotStack, goldIngotStack,
'o', 'o',
apprenticeBloodOrbStack, 2,
'r', 'r',
reinforcedSlateStack)); reinforcedSlateStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1054,7 +1049,7 @@ public class AlchemicalWizardry {
'g', 'g',
glowstoneDustStack, glowstoneDustStack,
'o', 'o',
apprenticeBloodOrbStack, 2,
'r', 'r',
reinforcedSlateStack)); reinforcedSlateStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1068,7 +1063,7 @@ public class AlchemicalWizardry {
's', 's',
blankSlateStack, blankSlateStack,
'o', 'o',
weakBloodOrbStack)); 1));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapedBloodOrbRecipe( new ShapedBloodOrbRecipe(
seerSigilStackCrafted, seerSigilStackCrafted,
@@ -1080,7 +1075,7 @@ public class AlchemicalWizardry {
's', 's',
divinationSigilStackCrafted, divinationSigilStackCrafted,
'o', 'o',
apprenticeBloodOrbStack, 2,
'b', 'b',
new ItemStack(ModItems.bucketLife))); new ItemStack(ModItems.bucketLife)));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1092,7 +1087,7 @@ public class AlchemicalWizardry {
's', 's',
obsidianStack, obsidianStack,
'o', 'o',
apprenticeBloodOrbStack, 2,
'r', 'r',
reinforcedSlateStack)); reinforcedSlateStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1104,7 +1099,7 @@ public class AlchemicalWizardry {
'b', 'b',
obsidianStack, obsidianStack,
'o', 'o',
magicianBloodOrbStack, 3,
'r', 'r',
ritualStoneStack)); ritualStoneStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1118,7 +1113,7 @@ public class AlchemicalWizardry {
'b', 'b',
obsidianStack, obsidianStack,
'o', 'o',
weakBloodOrbStack)); 1));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapedBloodOrbRecipe( new ShapedBloodOrbRecipe(
sigilOfElementalAffinityStackCrafted, sigilOfElementalAffinityStackCrafted,
@@ -1134,7 +1129,7 @@ public class AlchemicalWizardry {
'l', 'l',
lavaSigilStack, lavaSigilStack,
'r', 'r',
magicianBloodOrbStack, 3,
's', 's',
imbuedSlateStack)); imbuedSlateStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1150,7 +1145,7 @@ public class AlchemicalWizardry {
'r', 'r',
imbuedSlateStack, imbuedSlateStack,
'o', 'o',
magicianBloodOrbStack)); 3));
GameRegistry.addRecipe( GameRegistry.addRecipe(
emptySocketStack, emptySocketStack,
"bgb", "bgb",
@@ -1173,7 +1168,7 @@ public class AlchemicalWizardry {
's', 's',
stoneStack, stoneStack,
'o', 'o',
magicianBloodOrbStack)); 3));
GameRegistry.addShapelessRecipe(largeBloodStoneBrickStackCrafted, weakBloodShardStack, stoneStack); GameRegistry.addShapelessRecipe(largeBloodStoneBrickStackCrafted, weakBloodShardStack, stoneStack);
GameRegistry.addRecipe(bloodStoneBrickStackCrafted, "bb", "bb", 'b', largeBloodStoneBrickStack); GameRegistry.addRecipe(bloodStoneBrickStackCrafted, "bb", "bb", 'b', largeBloodStoneBrickStack);
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1187,7 +1182,7 @@ public class AlchemicalWizardry {
'r', 'r',
reedStack, reedStack,
'o', 'o',
apprenticeBloodOrbStack, 2,
'e', 'e',
reinforcedSlateStack)); reinforcedSlateStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1203,7 +1198,7 @@ public class AlchemicalWizardry {
'r', 'r',
bloodRuneStack, bloodRuneStack,
'o', 'o',
apprenticeBloodOrbStack)); 2));
GameRegistry.addShapelessRecipe( GameRegistry.addShapelessRecipe(
new ItemStack(Items.skull, 1, 2), new ItemStack(Items.skull, 1, 2),
new ItemStack(Items.skull, 1, 1), new ItemStack(Items.skull, 1, 1),
@@ -1232,7 +1227,7 @@ public class AlchemicalWizardry {
'r', 'r',
obsidianStack, obsidianStack,
'o', 'o',
weakBloodOrbStack)); 1));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ItemStack(ModBlocks.blockPedestal), new ItemStack(ModBlocks.blockPedestal),
"ooo", "ooo",
@@ -1272,7 +1267,7 @@ public class AlchemicalWizardry {
'r', 'r',
obsidianStack, obsidianStack,
'o', 'o',
new ItemStack(ModItems.masterBloodOrb))); 4));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapedBloodOrbRecipe( new ShapedBloodOrbRecipe(
new ItemStack(ModItems.sigilOfWind), new ItemStack(ModItems.sigilOfWind),
@@ -1286,13 +1281,13 @@ public class AlchemicalWizardry {
'a', 'a',
new ItemStack(ModItems.airSigil), new ItemStack(ModItems.airSigil),
'o', 'o',
new ItemStack(ModItems.masterBloodOrb), 4,
'r', 'r',
ModItems.demonicSlate)); ModItems.demonicSlate));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapelessBloodOrbRecipe( new ShapelessBloodOrbRecipe(
new ItemStack(ModItems.weakBloodShard, 5, 0), new ItemStack(ModItems.weakBloodShard, 5, 0),
new ItemStack(ModItems.masterBloodOrb), 4,
new ItemStack(ModItems.weakBloodShard), new ItemStack(ModItems.weakBloodShard),
imbuedSlateStack)); imbuedSlateStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -1327,7 +1322,7 @@ public class AlchemicalWizardry {
's', 's',
imbuedSlateStack, imbuedSlateStack,
'o', 'o',
magicianBloodOrbStack)); 3));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ItemStack(ModItems.armourInhibitor), new ItemStack(ModItems.armourInhibitor),
" gg", " gg",
@@ -1378,7 +1373,7 @@ public class AlchemicalWizardry {
's', 's',
new ItemStack(ModItems.imbuedSlate), new ItemStack(ModItems.imbuedSlate),
'o', 'o',
magicianBloodOrbStack)); 3));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapedBloodOrbRecipe( new ShapedBloodOrbRecipe(
new ItemStack(ModItems.energyBazooka), new ItemStack(ModItems.energyBazooka),
@@ -1386,7 +1381,7 @@ public class AlchemicalWizardry {
"cb ", "cb ",
"d w", "d w",
'O', 'O',
archmageBloodOrbStack, 5,
'c', 'c',
crepitousStack, crepitousStack,
'b', 'b',
@@ -1402,7 +1397,7 @@ public class AlchemicalWizardry {
"sss", "sss",
"bob", "bob",
'o', 'o',
magicianBloodOrbStack, 3,
'b', 'b',
glowstoneBlockStack, glowstoneBlockStack,
't', 't',
@@ -1472,9 +1467,6 @@ public class AlchemicalWizardry {
customPotionAmphibian = (new PotionAmphibian(customPotionAmphibianID, false, 0)).setIconIndex(0, 0) customPotionAmphibian = (new PotionAmphibian(customPotionAmphibianID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.amphibian"); .setPotionName("bm.buff.amphibian");
ItemStack masterBloodOrbStack = new ItemStack(ModItems.masterBloodOrb);
ItemStack transcendentBloodOrbStack = new ItemStack(ModItems.transcendentBloodOrb);
// ModBlocks.blockLifeEssence.setUnlocalizedName("lifeEssenceBlock"); // ModBlocks.blockLifeEssence.setUnlocalizedName("lifeEssenceBlock");
FluidContainerRegistry.registerFluidContainer( FluidContainerRegistry.registerFluidContainer(
lifeEssenceFluid, lifeEssenceFluid,
@@ -2134,7 +2126,7 @@ public class AlchemicalWizardry {
'm', 'm',
magicalesStack, magicalesStack,
'o', 'o',
magicianBloodOrbStack, 3,
'a', 'a',
new ItemStack(Items.arrow))); new ItemStack(Items.arrow)));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -2150,7 +2142,7 @@ public class AlchemicalWizardry {
'b', 'b',
weakBloodShardStack, weakBloodShardStack,
'o', 'o',
magicianBloodOrbStack, 3,
'n', 'n',
glowstoneDustStack)); glowstoneDustStack));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -2166,7 +2158,7 @@ public class AlchemicalWizardry {
'b', 'b',
weakBloodShardStack, weakBloodShardStack,
'o', 'o',
magicianBloodOrbStack, 3,
'n', 'n',
new ItemStack(Items.fire_charge))); new ItemStack(Items.fire_charge)));
GameRegistry.addRecipe( GameRegistry.addRecipe(
@@ -2182,7 +2174,7 @@ public class AlchemicalWizardry {
'b', 'b',
weakBloodShardStack, weakBloodShardStack,
'o', 'o',
magicianBloodOrbStack, 3,
'n', 'n',
new ItemStack(Blocks.obsidian))); new ItemStack(Blocks.obsidian)));
@@ -2222,7 +2214,7 @@ public class AlchemicalWizardry {
'c', 'c',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
'd', 'd',
diamondStack, diamondStack,
's', 's',
@@ -2238,7 +2230,7 @@ public class AlchemicalWizardry {
'c', 'c',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
'd', 'd',
diamondStack, diamondStack,
's', 's',
@@ -2254,7 +2246,7 @@ public class AlchemicalWizardry {
'c', 'c',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
'd', 'd',
diamondStack, diamondStack,
's', 's',
@@ -2270,7 +2262,7 @@ public class AlchemicalWizardry {
'c', 'c',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
'd', 'd',
diamondStack, diamondStack,
's', 's',
@@ -2301,7 +2293,7 @@ public class AlchemicalWizardry {
'e', 'e',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
's', 's',
weakBloodShardStack, weakBloodShardStack,
'g', 'g',
@@ -2317,7 +2309,7 @@ public class AlchemicalWizardry {
'e', 'e',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
's', 's',
weakBloodShardStack, weakBloodShardStack,
'g', 'g',
@@ -2333,7 +2325,7 @@ public class AlchemicalWizardry {
'e', 'e',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
's', 's',
weakBloodShardStack, weakBloodShardStack,
'g', 'g',
@@ -2349,7 +2341,7 @@ public class AlchemicalWizardry {
'e', 'e',
emptyCoreStack, emptyCoreStack,
'o', 'o',
magicianBloodOrbStack, 3,
's', 's',
weakBloodShardStack, weakBloodShardStack,
'g', 'g',
@@ -2366,7 +2358,7 @@ public class AlchemicalWizardry {
'e', 'e',
emptyCoreStack, emptyCoreStack,
'o', 'o',
masterBloodOrbStack, 4,
's', 's',
weakBloodShardStack, weakBloodShardStack,
'g', 'g',
@@ -2382,7 +2374,7 @@ public class AlchemicalWizardry {
'e', 'e',
emptyCoreStack, emptyCoreStack,
'o', 'o',
masterBloodOrbStack, 4,
's', 's',
weakBloodShardStack, weakBloodShardStack,
'g', 'g',
@@ -2398,7 +2390,7 @@ public class AlchemicalWizardry {
'e', 'e',
emptyCoreStack, emptyCoreStack,
'o', 'o',
masterBloodOrbStack, 4,
's', 's',
weakBloodShardStack, weakBloodShardStack,
'g', 'g',
@@ -2413,7 +2405,7 @@ public class AlchemicalWizardry {
's', 's',
etherealSlateStack, etherealSlateStack,
'o', 'o',
archmageBloodOrbStack, 5,
'g', 'g',
new ItemStack(Items.golden_hoe), new ItemStack(Items.golden_hoe),
'm', 'm',
@@ -2427,7 +2419,7 @@ public class AlchemicalWizardry {
's', 's',
etherealSlateStack, etherealSlateStack,
'o', 'o',
archmageBloodOrbStack, 5,
'r', 'r',
speedRuneStack, speedRuneStack,
'b', 'b',
@@ -2441,7 +2433,7 @@ public class AlchemicalWizardry {
"csc", "csc",
"obo", "obo",
'b', 'b',
masterBloodOrbStack, 4,
'p', 'p',
new ItemStack(Blocks.piston), new ItemStack(Blocks.piston),
'c', 'c',
@@ -2464,7 +2456,7 @@ public class AlchemicalWizardry {
'a', 'a',
accelerationRuneStack, accelerationRuneStack,
'o', 'o',
archmageBloodOrbStack)); 5));
AlchemyRecipeRegistry.registerRecipe( AlchemyRecipeRegistry.registerRecipe(
crackedRunicPlateStackCrafted, crackedRunicPlateStackCrafted,
@@ -2959,7 +2951,7 @@ public class AlchemicalWizardry {
't', 't',
new ItemStack(ModBlocks.blockTeleposer), new ItemStack(ModBlocks.blockTeleposer),
'o', 'o',
masterBloodOrbStack, 4,
'l', 'l',
lavaBucketStack, lavaBucketStack,
'w', 'w',
@@ -2975,7 +2967,7 @@ public class AlchemicalWizardry {
't', 't',
weakBloodShardStack, weakBloodShardStack,
'o', 'o',
masterBloodOrbStack, 4,
'e', 'e',
new ItemStack(Items.ender_eye), new ItemStack(Items.ender_eye),
'p', 'p',
@@ -3057,7 +3049,7 @@ public class AlchemicalWizardry {
"grg", "grg",
"bob", "bob",
'o', 'o',
transcendentBloodOrbStack, 6,
'r', 'r',
bloodRuneStack, bloodRuneStack,
'1', '1',
@@ -3075,7 +3067,7 @@ public class AlchemicalWizardry {
"grg", "grg",
"bob", "bob",
'o', 'o',
transcendentBloodOrbStack, 6,
'r', 'r',
bloodRuneStack, bloodRuneStack,
'g', 'g',
@@ -3093,7 +3085,7 @@ public class AlchemicalWizardry {
"grg", "grg",
"bob", "bob",
'o', 'o',
transcendentBloodOrbStack, 6,
'r', 'r',
bloodRuneStack, bloodRuneStack,
'g', 'g',
@@ -3246,7 +3238,7 @@ public class AlchemicalWizardry {
@EventHandler @EventHandler
public void postInit(FMLPostInitializationEvent event) { public void postInit(FMLPostInitializationEvent event) {
proxy.registerPostSideObjects(); proxy.registerPostSideObjects();
isGregTechLoaded = Loader.isModLoaded("gregtech"); isGregTech5UnofficialNewHorizonsLoaded = Loader.isModLoaded("gregtech_nh");
isEndlessIdsLoaded = Loader.isModLoaded("endlessids"); isEndlessIdsLoaded = Loader.isModLoaded("endlessids");
// TODO Thaumcraft Integration // TODO Thaumcraft Integration
if (Loader.isModLoaded("Thaumcraft")) { if (Loader.isModLoaded("Thaumcraft")) {
@@ -3351,10 +3343,9 @@ public class AlchemicalWizardry {
BloodMagicConfiguration.blacklistRituals(); BloodMagicConfiguration.blacklistRituals();
BloodMagicConfiguration.loadCustomLPValues(); BloodMagicConfiguration.loadCustomLPValues();
DemonVillageLootRegistry.init();
MeteorRegistry.loadConfig(); MeteorRegistry.loadConfig();
MeteorReagentRegistry.loadConfig(); MeteorReagentRegistry.loadConfig();
MeteorRegistry.logMaterialLibTally();
this.initCompressionHandlers(); this.initCompressionHandlers();
} }
@@ -114,7 +114,7 @@ public class BloodMagicConfiguration {
The block to use for filler in meteors if none is provided in the meteor's config file and that The block to use for filler in meteors if none is provided in the meteor's config file and that
meteor's fillerChance is greater than 0. Also used as a fallback for empty ore lists in meteor configs. meteor's fillerChance is greater than 0. Also used as a fallback for empty ore lists in meteor configs.
Specify the block with the format: Specify the block with the format:
"modId:itemName:meta" "modId:itemName:meta", or "ml:material:shape" for a MaterialLib block.
Defaults to minecraft:stone:0 if no block is provided or the provided block cannot be found."""); Defaults to minecraft:stone:0 if no block is provided or the provided block cannot be found.""");
MeteorComponent.setDefaultMeteorBlock(); MeteorComponent.setDefaultMeteorBlock();
AlchemicalWizardry.allowedCrushedOresArray = config.get( AlchemicalWizardry.allowedCrushedOresArray = config.get(
@@ -1,11 +1,12 @@
package WayofTime.alchemicalWizardry.api.alchemy; package WayofTime.alchemicalWizardry.api.alchemy;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
public class AlchemyRecipe { public class AlchemyRecipe {
private static final int MAX_INPUT_SLOTS = 5;
private final ItemStack output; private final ItemStack output;
private final ItemStack[] recipe; private final ItemStack[] recipe;
private final int bloodOrbLevel; private final int bloodOrbLevel;
@@ -23,35 +24,13 @@ public class AlchemyRecipe {
return false; return false;
} }
ItemStack[] recipe; if (items.length < MAX_INPUT_SLOTS) {
if (items.length < 5) {
return false; return false;
} }
if (this.recipe.length != 5) { boolean[] checkList = new boolean[MAX_INPUT_SLOTS];
ItemStack[] newRecipe = new ItemStack[5];
for (int i = 0; i < 5; i++) { for (int i = 0; i < Math.min(recipe.length, MAX_INPUT_SLOTS); i++) {
if (i + 1 > this.recipe.length) {
newRecipe[i] = null;
} else {
newRecipe[i] = this.recipe[i];
}
}
recipe = newRecipe;
} else {
recipe = this.recipe;
}
boolean[] checkList = new boolean[5];
for (int i = 0; i < 5; i++) {
checkList[i] = false;
}
for (int i = 0; i < 5; i++) {
ItemStack recipeItemStack = recipe[i]; ItemStack recipeItemStack = recipe[i];
if (recipeItemStack == null) { if (recipeItemStack == null) {
@@ -60,7 +39,7 @@ public class AlchemyRecipe {
boolean test = false; boolean test = false;
for (int j = 0; j < 5; j++) { for (int j = 0; j < MAX_INPUT_SLOTS; j++) {
if (checkList[j]) { if (checkList[j]) {
continue; continue;
} }
@@ -71,20 +50,6 @@ public class AlchemyRecipe {
continue; continue;
} }
boolean quickTest = false;
if (recipeItemStack.getItem() instanceof ItemBlock) {
if (checkedItemStack.getItem() instanceof ItemBlock) {
quickTest = true;
}
} else if (!(checkedItemStack.getItem() instanceof ItemBlock)) {
quickTest = true;
}
if (!quickTest) {
continue;
}
if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage() if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage()
|| OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage()) || OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage())
&& checkedItemStack.getItem() == recipeItemStack.getItem()) { && checkedItemStack.getItem() == recipeItemStack.getItem()) {
@@ -15,7 +15,7 @@ public class AlchemyRecipeRegistry {
recipes.add(new AlchemyRecipe(output, amountNeeded, recipe, bloodOrbLevel)); recipes.add(new AlchemyRecipe(output, amountNeeded, recipe, bloodOrbLevel));
} }
public static ItemStack getResult(ItemStack[] recipe, ItemStack bloodOrb) { public static AlchemyRecipe findRecipe(ItemStack[] recipe, ItemStack bloodOrb) {
if (bloodOrb == null) { if (bloodOrb == null) {
return null; return null;
} }
@@ -28,31 +28,23 @@ public class AlchemyRecipeRegistry {
for (AlchemyRecipe ar : recipes) { for (AlchemyRecipe ar : recipes) {
if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) { if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) {
return (ar.getResult()); return ar;
} }
} }
return null; return null;
} }
public static ItemStack getResult(ItemStack[] recipe, ItemStack bloodOrb) {
AlchemyRecipe ar = findRecipe(recipe, bloodOrb);
return ar == null ? null : ar.getResult();
}
public static int getAmountNeeded(ItemStack[] recipe, ItemStack bloodOrb) { public static int getAmountNeeded(ItemStack[] recipe, ItemStack bloodOrb) {
if (bloodOrb == null) { AlchemyRecipe ar = findRecipe(recipe, bloodOrb);
return 0;
}
if (!(bloodOrb.getItem() instanceof IBloodOrb)) { return ar == null ? 0 : ar.getAmountNeeded();
return 0;
}
int bloodOrbLevel = ((IBloodOrb) bloodOrb.getItem()).getOrbLevel();
for (AlchemyRecipe ar : recipes) {
if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) {
return (ar.getAmountNeeded());
}
}
return 0;
} }
public static ItemStack[] getRecipeForItemStack(ItemStack itemStack) { public static ItemStack[] getRecipeForItemStack(ItemStack itemStack) {
@@ -86,25 +86,23 @@ public class ShapedBloodOrbRecipe implements IRecipe {
Character chr = (Character) recipe[idx]; Character chr = (Character) recipe[idx];
Object in = recipe[idx + 1]; Object in = recipe[idx + 1];
if (in instanceof IBloodOrb orb) { switch (in) {
itemMap.put(chr, orb.getOrbLevel()); case IBloodOrb orb -> itemMap.put(chr, orb.getOrbLevel());
} else if (in instanceof ItemStack stack && stack.getItem() instanceof IBloodOrb orb) { case ItemStack stack when stack.getItem() instanceof IBloodOrb orb ->
itemMap.put(chr, orb.getOrbLevel()); itemMap.put(chr, orb.getOrbLevel());
} else if (in instanceof ItemStack stack) { case ItemStack stack -> itemMap.put(chr, stack.copy());
itemMap.put(chr, stack.copy()); case Integer i -> itemMap.put(chr, i);
} else if (in instanceof Item item) { case Item item -> itemMap.put(chr, new ItemStack(item));
itemMap.put(chr, new ItemStack(item)); case Block block -> itemMap.put(chr, new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE));
} else if (in instanceof Block block) { case String string -> itemMap.put(chr, OreDictionary.getOres(string));
itemMap.put(chr, new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE)); case null, default -> {
} else if (in instanceof String string) { StringBuilder ret = new StringBuilder("Invalid shaped ore recipe: ");
itemMap.put(chr, OreDictionary.getOres(string)); for (Object tmp : recipe) {
} else { ret.append(tmp).append(", ");
StringBuilder ret = new StringBuilder("Invalid shaped ore recipe: "); }
for (Object tmp : recipe) { ret.append(output);
ret.append(tmp).append(", "); throw new RuntimeException(ret.toString());
} }
ret.append(output);
throw new RuntimeException(ret.toString());
} }
} }
@@ -34,25 +34,22 @@ public class ShapelessBloodOrbRecipe implements IRecipe {
public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe) { public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe) {
output = result.copy(); output = result.copy();
for (Object in : recipe) { for (Object in : recipe) {
if (in instanceof IBloodOrb orb) { switch (in) {
input.add(orb.getOrbLevel()); case IBloodOrb orb -> input.add(orb.getOrbLevel());
} else if (in instanceof ItemStack stack && stack.getItem() instanceof IBloodOrb orb) { case ItemStack stack when stack.getItem() instanceof IBloodOrb orb -> input.add(orb.getOrbLevel());
input.add(orb.getOrbLevel()); case Integer i -> input.add(i);
} else if (in instanceof ItemStack stack) { case ItemStack stack -> input.add(stack.copy());
input.add(stack.copy()); case Item item -> input.add(new ItemStack(item));
} else if (in instanceof Item item) { case Block block -> input.add(new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE));
input.add(new ItemStack(item)); case String string -> input.add(OreDictionary.getOres(string));
} else if (in instanceof Block block) { case null, default -> {
input.add(new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE)); StringBuilder ret = new StringBuilder("Invalid shapeless ore recipe: ");
} else if (in instanceof String string) { for (Object tmp : recipe) {
input.add(OreDictionary.getOres(string)); ret.append(tmp).append(", ");
} else { }
StringBuilder ret = new StringBuilder("Invalid shapeless ore recipe: "); ret.append(output);
for (Object tmp : recipe) { throw new RuntimeException(ret.toString());
ret.append(tmp).append(", ");
} }
ret.append(output);
throw new RuntimeException(ret.toString());
} }
} }
} }
@@ -43,7 +43,7 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
ArrayList<ItemStack> orbs = new ArrayList<>(); ArrayList<ItemStack> orbs = new ArrayList<>();
for (Item item : getBloodOrbs()) { for (Item item : getBloodOrbs()) {
if (((IBloodOrb) item).getOrbLevel() >= i) { if (((IBloodOrb) item).getOrbLevel() >= i) {
orbs.add(new ItemStack(item)); orbs.add(new ItemStack(item, 0));
} }
} }
PositionedStack stack = new PositionedStack(orbs, 25 + x * 18, 6 + y * 18, false); PositionedStack stack = new PositionedStack(orbs, 25 + x * 18, 6 + y * 18, false);
@@ -42,7 +42,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
ArrayList<ItemStack> orbs = new ArrayList<>(); ArrayList<ItemStack> orbs = new ArrayList<>();
for (Item item : NEIConfig.getBloodOrbs()) { for (Item item : NEIConfig.getBloodOrbs()) {
if (((IBloodOrb) item).getOrbLevel() >= i) { if (((IBloodOrb) item).getOrbLevel() >= i) {
orbs.add(new ItemStack(item)); orbs.add(new ItemStack(item, 0));
} }
} }
@@ -214,12 +214,6 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
return true; return true;
} }
// Ignore GregTech ore variants (like basalt ore)
if (compared.getUnlocalizedName().startsWith("gt.blockores")
&& compareTo.getUnlocalizedName().startsWith("gt.blockores")) {
return compared.getItemDamage() % 1000 == compareTo.getItemDamage() % 1000;
}
// Check oredicts for ores. Checks for direct matches (oreIron with oreIron) as well as IC2/GT crushed ores // Check oredicts for ores. Checks for direct matches (oreIron with oreIron) as well as IC2/GT crushed ores
// (crushedGold with oreGold), EFR raw ores (rawCopper with oreCopper (although those all seem to have oreX // (crushedGold with oreGold), EFR raw ores (rawCopper with oreCopper (although those all seem to have oreX
// anyways)), and GT:NH raw ores (rawOreDiamond with oreDiamond). // anyways)), and GT:NH raw ores (rawOreDiamond with oreDiamond).
@@ -485,10 +485,12 @@ public class AlchemicalWizardryEventHooks {
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionDrowning) if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionDrowning)
&& !event.entityLiving.isPotionActive(Potion.waterBreathing)) { && !event.entityLiving.isPotionActive(Potion.waterBreathing)) {
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier(); int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier();
int amplifier = Math.max(1, (i + 1));
int interval = Math.max(1, (20 / amplifier));
if (event.entityLiving.worldObj.getWorldTime() % (20 / (i + 1)) == 0) { if (event.entityLiving.worldObj.getWorldTime() % interval == 0) {
event.entityLiving.attackEntityFrom(DamageSource.drown, 2); event.entityLiving.attackEntityFrom(DamageSource.drown, 2);
event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1)); event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, interval);
} }
} }
@@ -11,6 +11,7 @@ import java.util.stream.IntStream;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -34,6 +35,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.FMLEmbeddedChannel; import cpw.mods.fml.common.network.FMLEmbeddedChannel;
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
import cpw.mods.fml.common.network.FMLOutboundHandler; import cpw.mods.fml.common.network.FMLOutboundHandler;
@@ -106,7 +108,7 @@ public enum NewPacketHandler {
World world = AlchemicalWizardry.proxy.getClientWorld(); World world = AlchemicalWizardry.proxy.getClientWorld();
TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z);
if (te instanceof TEAltar altar) { if (te instanceof TEAltar altar) {
altar.handlePacketData(msg.items, msg.fluids, msg.capacity); altar.handlePacketData(msg.itemStack, msg.fluids, msg.capacity);
} }
} }
} }
@@ -317,7 +319,7 @@ public enum NewPacketHandler {
int y; int y;
int z; int z;
int[] items; ItemStack itemStack;
int[] fluids; int[] fluids;
int capacity; int capacity;
} }
@@ -482,11 +484,7 @@ public enum NewPacketHandler {
target.writeInt(m.y); target.writeInt(m.y);
target.writeInt(m.z); target.writeInt(m.z);
target.writeBoolean(m.items != null); ByteBufUtils.writeItemStack(target, m.itemStack);
if (m.items != null) {
int[] items = m.items;
Arrays.stream(items).forEach(target::writeInt);
}
target.writeBoolean(m.fluids != null); target.writeBoolean(m.fluids != null);
if (m.fluids != null) { if (m.fluids != null) {
@@ -658,13 +656,8 @@ public enum NewPacketHandler {
m.x = dat.readInt(); m.x = dat.readInt();
m.y = dat.readInt(); m.y = dat.readInt();
m.z = dat.readInt(); m.z = dat.readInt();
boolean hasStacks = dat.readBoolean();
m.items = new int[TEAltar.sizeInv * 3]; m.itemStack = ByteBufUtils.readItemStack(dat);
if (hasStacks) {
m.items = new int[TEAltar.sizeInv * 3];
IntStream.range(0, m.items.length).forEach(i -> m.items[i] = dat.readInt());
}
boolean hasFluids = dat.readBoolean(); boolean hasFluids = dat.readBoolean();
m.fluids = new int[6]; m.fluids = new int[6];
@@ -841,7 +834,7 @@ public enum NewPacketHandler {
msg.x = tileAltar.xCoord; msg.x = tileAltar.xCoord;
msg.y = tileAltar.yCoord; msg.y = tileAltar.yCoord;
msg.z = tileAltar.zCoord; msg.z = tileAltar.zCoord;
msg.items = tileAltar.buildIntDataList(); msg.itemStack = tileAltar.getStackInSlot(0);
msg.fluids = tileAltar.buildFluidList(); msg.fluids = tileAltar.buildFluidList();
msg.capacity = tileAltar.getCapacity(); msg.capacity = tileAltar.getCapacity();
@@ -6,9 +6,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Facing; import net.minecraft.util.Facing;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@@ -72,34 +69,7 @@ public class SpectralBlock extends BlockContainer {
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, public boolean isReplaceable(IBlockAccess world, int x, int y, int z) {
float these, float are) {
if (player.isSneaking()) {
return false;
}
ItemStack playerItem = player.getCurrentEquippedItem();
if (playerItem != null) {
if (playerItem.getItem() instanceof ItemBlock) {
world.setBlock(
x,
y,
z,
((ItemBlock) (playerItem.getItem())).field_150939_a,
playerItem.getItemDamage(),
3);
if (!player.capabilities.isCreativeMode) {
playerItem.stackSize--;
}
return true;
} else {
return false;
}
}
return true; return true;
} }
@@ -13,8 +13,13 @@ import WayofTime.alchemicalWizardry.ModItems;
public class DemonVillageLootRegistry { public class DemonVillageLootRegistry {
public static ArrayList<WeightedRandomChestContent> list1 = new ArrayList<>(); public static ArrayList<WeightedRandomChestContent> list1 = new ArrayList<>();
private static boolean built = false;
public static void init() { /// Copies the dungeon and desert-pyramid loot on first use rather than while loading, so the copy carries every
/// change other mods make to those tables during loading.
private static void build() {
if (built) return;
built = true;
String[] tier1Strings = new String[] { ChestGenHooks.DUNGEON_CHEST, ChestGenHooks.PYRAMID_DESERT_CHEST }; String[] tier1Strings = new String[] { ChestGenHooks.DUNGEON_CHEST, ChestGenHooks.PYRAMID_DESERT_CHEST };
for (String str : tier1Strings) { for (String str : tier1Strings) {
WeightedRandomChestContent[] contents = ChestGenHooks.getItems(str, new Random()); WeightedRandomChestContent[] contents = ChestGenHooks.getItems(str, new Random());
@@ -30,6 +35,7 @@ public class DemonVillageLootRegistry {
} }
public static void populateChest(IInventory tile, int tier) { public static void populateChest(IInventory tile, int tier) {
build();
WeightedRandomChestContent WeightedRandomChestContent
.generateChestContents(new Random(), toArray(list1), tile, tile.getSizeInventory() / 3); .generateChestContents(new Random(), toArray(list1), tile, tile.getSizeInventory() / 3);
} }
@@ -46,6 +46,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
setEnergyUsed(5); setEnergyUsed(5);
this.setHarvestLevel("axe", 7); this.setHarvestLevel("axe", 7);
setMaxDamage(0);
} }
public void setEnergyUsed(int i) { public void setEnergyUsed(int i) {
@@ -143,7 +144,6 @@ public class BoundAxe extends ItemAxe implements IBindable {
} }
checkPassiveDrain(item, world, player); checkPassiveDrain(item, world, player);
item.setItemDamage(0);
} }
/** /**
@@ -28,7 +28,6 @@ import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import gregtech.common.blocks.GTBlockOre;
public class BoundPickaxe extends ItemPickaxe implements IBindable { public class BoundPickaxe extends ItemPickaxe implements IBindable {
@@ -49,6 +48,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.setEnergyUsed(5); this.setEnergyUsed(5);
setHarvestLevel("pickaxe", 7); setHarvestLevel("pickaxe", 7);
setMaxDamage(0);
} }
public void setEnergyUsed(int i) { public void setEnergyUsed(int i) {
@@ -124,12 +124,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) { if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
dropMultiset.add(new ItemType(block, meta)); dropMultiset.add(new ItemType(block, meta));
} else { } else {
ArrayList<ItemStack> itemDropList; ArrayList<ItemStack> itemDropList = block.getDrops(world, x, y, z, meta, fortuneLvl);
if (AlchemicalWizardry.isGregTechLoaded && block instanceof GTBlockOre ore) {
itemDropList = ore.getDropsForPlayer(world, x, y, z, meta, fortuneLvl, player);
} else {
itemDropList = block.getDrops(world, x, y, z, meta, fortuneLvl);
}
if (itemDropList != null) { if (itemDropList != null) {
for (ItemStack stack : itemDropList) for (ItemStack stack : itemDropList)
@@ -182,7 +177,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
} }
checkPassiveDrain(item, world, player); checkPassiveDrain(item, world, player);
item.setItemDamage(0);
} }
/** /**
@@ -11,7 +11,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
@@ -46,6 +45,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
setEnergyUsed(5); setEnergyUsed(5);
setHarvestLevel("shovel", 7); setHarvestLevel("shovel", 7);
setMaxDamage(0);
} }
public void setEnergyUsed(int i) { public void setEnergyUsed(int i) {
@@ -145,13 +145,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
return; return;
} }
if (item.getTagCompound() == null) {
item.setTagCompound(new NBTTagCompound());
}
checkPassiveDrain(item, world, player); checkPassiveDrain(item, world, player);
item.setItemDamage(0);
} }
/** /**
@@ -34,7 +34,7 @@ public class EnergySword extends ItemSword implements IBindable {
setCreativeTab(AlchemicalWizardry.tabBloodMagic); setCreativeTab(AlchemicalWizardry.tabBloodMagic);
setEnergyUsed(50); setEnergyUsed(50);
setFull3D(); setFull3D();
setMaxDamage(100); setMaxDamage(0);
} }
public void setEnergyUsed(int i) { public void setEnergyUsed(int i) {
@@ -106,7 +106,6 @@ public class EnergySword extends ItemSword implements IBindable {
} }
checkPassiveDrain(item, world, player); checkPassiveDrain(item, world, player);
item.setItemDamage(0);
} }
@Override @Override
@@ -159,7 +159,7 @@ public class ItemIncense extends Item implements IIncense {
new ItemStack(Items.redstone), new ItemStack(Items.redstone),
leavesStack, leavesStack,
leavesStack, leavesStack,
new ItemStack(ModItems.weakBloodOrb))); 1));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapelessBloodOrbRecipe( new ShapelessBloodOrbRecipe(
new ItemStack(ModItems.itemIncense, 1, 2), new ItemStack(ModItems.itemIncense, 1, 2),
@@ -171,7 +171,7 @@ public class ItemIncense extends Item implements IIncense {
glowstoneStack, glowstoneStack,
stringStack, stringStack,
stringStack, stringStack,
new ItemStack(ModItems.apprenticeBloodOrb))); 2));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapelessBloodOrbRecipe( new ShapelessBloodOrbRecipe(
new ItemStack(ModItems.itemIncense, 1, 3), new ItemStack(ModItems.itemIncense, 1, 3),
@@ -182,7 +182,7 @@ public class ItemIncense extends Item implements IIncense {
gunpowderStack, gunpowderStack,
fermentedEyeStack, fermentedEyeStack,
blankSlateStack, blankSlateStack,
new ItemStack(ModItems.apprenticeBloodOrb))); 2));
GameRegistry.addRecipe( GameRegistry.addRecipe(
new ShapelessBloodOrbRecipe( new ShapelessBloodOrbRecipe(
new ItemStack(ModItems.itemIncense, 1, 4), new ItemStack(ModItems.itemIncense, 1, 4),
@@ -194,7 +194,7 @@ public class ItemIncense extends Item implements IIncense {
blazePowderStack, blazePowderStack,
fracturedBoneStack, fracturedBoneStack,
reinforcedSlateStack, reinforcedSlateStack,
new ItemStack(ModItems.magicianBloodOrb))); 3));
} }
public enum EnumIncense { public enum EnumIncense {
@@ -205,6 +205,8 @@ public class ItemIncense extends Item implements IIncense {
GREEN(1500, 2400, 4.0f, 2000, 0, 1.0f, 0), GREEN(1500, 2400, 4.0f, 2000, 0, 1.0f, 0),
PURPLE(2400, 3500, 5.0f, 2000, 1.0f, 0, 1.0f); PURPLE(2400, 3500, 5.0f, 2000, 1.0f, 0, 1.0f);
public static final EnumIncense[] VALUES = values();
public final int minValue; public final int minValue;
public final int maxValue; public final int maxValue;
public final float tickRate; public final float tickRate;
@@ -226,10 +228,10 @@ public class ItemIncense extends Item implements IIncense {
} }
public static EnumIncense getEnumForIndex(int index) { public static EnumIncense getEnumForIndex(int index) {
if (index > EnumIncense.values().length || index < 0) { if (index > EnumIncense.VALUES.length || index < 0) {
return WOODASH; return WOODASH;
} else { } else {
return EnumIncense.values()[index]; return EnumIncense.VALUES[index];
} }
} }
} }
@@ -23,7 +23,6 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
import gregtech.common.blocks.GTBlockOre;
public class RitualEffectMagnetic extends RitualEffect { public class RitualEffectMagnetic extends RitualEffect {
@@ -35,8 +34,7 @@ public class RitualEffectMagnetic extends RitualEffect {
public static boolean isBlockOre(Block block, int meta) { public static boolean isBlockOre(Block block, int meta) {
// Special case for lit redstone ore // Special case for lit redstone ore
if (block instanceof BlockOre || block instanceof BlockRedstoneOre if (block instanceof BlockOre || block instanceof BlockRedstoneOre) {
|| (AlchemicalWizardry.isGregTechLoaded && block instanceof GTBlockOre)) {
return true; return true;
} }
@@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class HomSpellRegistry { public class HomSpellRegistry {
@@ -22,7 +21,7 @@ public class HomSpellRegistry {
for (HomSpellComponent hsc : spellList) { for (HomSpellComponent hsc : spellList) {
ItemStack item = hsc.item(); ItemStack item = hsc.item();
if (item != null && item.getItem() instanceof ItemBlock && testItem.getItem() == item.getItem()) { if (item != null && testItem.getItem() == item.getItem()) {
return hsc.spell(); return hsc.spell();
} }
} }
@@ -23,7 +23,7 @@ public class SpellLightningBolt extends HomSpell {
@Override @Override
public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -43,7 +43,7 @@ public class SpellLightningBolt extends HomSpell {
@Override @Override
public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) {
// TODO Make it work better...? // TODO Make it work better...?
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -30,7 +30,7 @@ public class SpellTeleport extends HomSpell {
@Override @Override
public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -45,7 +45,7 @@ public class SpellTeleport extends HomSpell {
@Override @Override
public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -59,7 +59,7 @@ public class SpellTeleport extends HomSpell {
@Override @Override
public ItemStack onDefensiveRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onDefensiveRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -91,7 +91,7 @@ public class SpellTeleport extends HomSpell {
@Override @Override
public ItemStack onEnvironmentalRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onEnvironmentalRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -29,7 +29,7 @@ public class SpellWateryGrave extends HomSpell {
@Override @Override
public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -44,7 +44,7 @@ public class SpellWateryGrave extends HomSpell {
@Override @Override
public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -75,7 +75,7 @@ public class SpellWateryGrave extends HomSpell {
@Override @Override
public ItemStack onDefensiveRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onDefensiveRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -129,7 +129,7 @@ public class SpellWateryGrave extends HomSpell {
@Override @Override
public ItemStack onEnvironmentalRightClick(ItemStack item, World world, EntityPlayer player) { public ItemStack onEnvironmentalRightClick(ItemStack item, World world, EntityPlayer player) {
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) { if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
return item; return item;
} }
@@ -22,6 +22,19 @@ class ItemStackAdapter extends TypeAdapter<ItemStack> {
.warn("Unable to read item stack \"{}\". Valid format is \"modid:name(:meta optional)\"", str); .warn("Unable to read item stack \"{}\". Valid format is \"modid:name(:meta optional)\"", str);
return null; return null;
} }
if (input[0].equals("ml")) {
if (input.length != 3) {
AlchemicalWizardry.logger.warn(
"Unable to read item stack \"{}\". Valid MaterialLib format is \"ml:material:shape\"",
str);
return null;
}
ItemStack resolved = MeteorRegistry.resolveMaterialLibStack(input[1], input[2]);
if (resolved == null) {
AlchemicalWizardry.logger.warn("Unable to find item stack \"{}\".", str);
}
return resolved;
}
ItemStack itemStack = GameRegistry.findItemStack(input[0], input[1], 1); ItemStack itemStack = GameRegistry.findItemStack(input[0], input[1], 1);
if (itemStack == null) { if (itemStack == null) {
AlchemicalWizardry.logger.warn("Unable to find item stack \"{}\".", str); AlchemicalWizardry.logger.warn("Unable to find item stack \"{}\".", str);
@@ -160,7 +160,8 @@ public class Meteor {
if (blockStack != null && blockStack.getItem() instanceof ItemBlock) { if (blockStack != null && blockStack.getItem() instanceof ItemBlock) {
((ItemBlock) blockStack.getItem()) ((ItemBlock) blockStack.getItem())
.placeBlockAt(blockStack, null, world, x, y, z, 0, 0, 0, 0, blockStack.getItemDamage()); .placeBlockAt(blockStack, null, world, x, y, z, 0, 0, 0, 0, blockStack.getItemDamage());
if (AlchemicalWizardry.isGregTechLoaded) setGTOresNaturalIfNeeded(world, x, y, z); if (AlchemicalWizardry.isGregTech5UnofficialNewHorizonsLoaded)
setGTOresNaturalIfNeeded(world, x, y, z);
world.markBlockForUpdate(x, y, z); world.markBlockForUpdate(x, y, z);
break; break;
} }
@@ -230,7 +231,7 @@ public class Meteor {
this.fillerChance = Math.max(0f, Math.min(100f * (1 - ((float) getTotalListWeight(ores) / maxWeight)), 100.0f)); this.fillerChance = Math.max(0f, Math.min(100f * (1 - ((float) getTotalListWeight(ores) / maxWeight)), 100.0f));
} }
@Optional.Method(modid = "gregtech") @Optional.Method(modid = "gregtech_nh")
private static void setGTOresNaturalIfNeeded(World world, int x, int y, int z) { private static void setGTOresNaturalIfNeeded(World world, int x, int y, int z) {
try (OreInfo<?> info = OreManager.getOreInfo(world, x, y, z)) { try (OreInfo<?> info = OreManager.getOreInfo(world, x, y, z)) {
if (info == null) return; if (info == null) return;
@@ -18,13 +18,19 @@ import cpw.mods.fml.common.registry.GameRegistry;
public class MeteorComponent { public class MeteorComponent {
private final int weight; private final int weight;
private final ItemStack itemStack; private ItemStack itemStack;
private final String materialName;
private final String shapeToken;
private final ArrayList<Reagent> reagent; private final ArrayList<Reagent> reagent;
public static MeteorComponent defaultMeteorBlock; public static MeteorComponent defaultMeteorBlock;
public static void setDefaultMeteorBlock() { public static void setDefaultMeteorBlock() {
String string = AlchemicalWizardry.defaultMeteorBlock; String string = AlchemicalWizardry.defaultMeteorBlock;
String[] split = string.split(":"); String[] split = string.split(":");
if (split.length == 3 && split[0].equals("ml")) {
defaultMeteorBlock = new MeteorComponent(split[1], split[2]);
return;
}
ItemStack stack = null; ItemStack stack = null;
if (!string.isEmpty() && split.length >= 3) { if (!string.isEmpty() && split.length >= 3) {
stack = GameRegistry.findItemStack(split[0], split[1], 1); stack = GameRegistry.findItemStack(split[0], split[1], 1);
@@ -43,10 +49,22 @@ public class MeteorComponent {
public MeteorComponent(ItemStack stack, int weight, ArrayList<Reagent> reagent) { public MeteorComponent(ItemStack stack, int weight, ArrayList<Reagent> reagent) {
this.itemStack = stack; this.itemStack = stack;
this.materialName = null;
this.shapeToken = null;
this.weight = weight; this.weight = weight;
this.reagent = reagent; this.reagent = reagent;
} }
/// The default meteor block named as `ml:<Material>:<shape>`. Its stack is resolved on the first [#getBlock]
/// call -- the config is read at preInit, before MaterialLib resolves its shapes.
private MeteorComponent(String materialName, String shapeToken) {
this.itemStack = null;
this.materialName = materialName;
this.shapeToken = shapeToken;
this.weight = 1;
this.reagent = new ArrayList<>();
}
public static List<MeteorComponent> parseStringArray(String[] blockArray) { public static List<MeteorComponent> parseStringArray(String[] blockArray) {
List<MeteorComponent> addList = new ArrayList<>(); List<MeteorComponent> addList = new ArrayList<>();
if (blockArray == null) { if (blockArray == null) {
@@ -65,10 +83,25 @@ public class MeteorComponent {
private static final Pattern itemNamePattern = Pattern.compile("(.*):(.*):(\\d+):(\\d+)(:.*)?"); private static final Pattern itemNamePattern = Pattern.compile("(.*):(.*):(\\d+):(\\d+)(:.*)?");
// OREDICT:oreDictName:weight(:reagent1, reagent2, ... optional) // OREDICT:oreDictName:weight(:reagent1, reagent2, ... optional)
private static final Pattern oredictPattern = Pattern.compile("OREDICT:(.*):(\\d+)(:.*)?"); private static final Pattern oredictPattern = Pattern.compile("OREDICT:(.*):(\\d+)(:.*)?");
// ml:material:shape:weight(:reagent1, reagent2, ... optional)
private static final Pattern materialLibPattern = Pattern.compile("ml:([^:]+):([^:]+):(\\d+)(:.*)?");
public static MeteorComponent parseString(String blockName) { public static MeteorComponent parseString(String blockName) {
Matcher matcher = itemNamePattern.matcher(blockName); Matcher matcher = materialLibPattern.matcher(blockName);
if (matcher.matches()) { if (matcher.matches()) {
String materialName = matcher.group(1);
String shapeToken = matcher.group(2);
int weight = Integer.parseInt(matcher.group(3));
String reagent = matcher.group(4);
ArrayList<Reagent> reagentList = MeteorReagent.parseReagents(reagent, blockName);
ItemStack stack = MeteorRegistry.resolveMaterialLibStack(materialName, shapeToken);
if (stack != null && stack.getItem() instanceof ItemBlock) {
return new MeteorComponent(stack, weight, reagentList);
}
} else if ((matcher = itemNamePattern.matcher(blockName)).matches()) {
String modID = matcher.group(1); String modID = matcher.group(1);
String itemName = matcher.group(2); String itemName = matcher.group(2);
int meta = Integer.parseInt(matcher.group(3)); int meta = Integer.parseInt(matcher.group(3));
@@ -100,7 +133,7 @@ public class MeteorComponent {
} }
AlchemicalWizardry.logger.warn("Unable to add Meteor Component \"{}\"", blockName); AlchemicalWizardry.logger.warn("Unable to add Meteor Component \"{}\"", blockName);
AlchemicalWizardry.logger.warn( AlchemicalWizardry.logger.warn(
"Valid formats are \"modId:itemName:meta:weight(:reagent1, reagent2, ... optional)\" and \"OREDICT:oreDictName:weight(:reagent1, reagent2, ... optional)\"."); "Valid formats are \"modId:itemName:meta:weight(:reagent1, reagent2, ... optional)\", \"OREDICT:oreDictName:weight(:reagent1, reagent2, ... optional)\" and \"ml:material:shape:weight(:reagent1, reagent2, ... optional)\".");
return null; return null;
} }
@@ -117,6 +150,16 @@ public class MeteorComponent {
} }
public ItemStack getBlock() { public ItemStack getBlock() {
if (itemStack == null && materialName != null) {
itemStack = MeteorRegistry.resolveMaterialLibStack(materialName, shapeToken);
if (itemStack == null || !(itemStack.getItem() instanceof ItemBlock)) {
AlchemicalWizardry.logger.warn(
"Unable to use \"ml:{}:{}\" as the default meteor block, falling back to stone.",
materialName,
shapeToken);
itemStack = new ItemStack(Blocks.stone);
}
}
return itemStack; return itemStack;
} }
@@ -17,11 +17,39 @@ import com.google.gson.JsonSyntaxException;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.compat.materiallib.MaterialLibStacks;
import cpw.mods.fml.common.Loader;
public class MeteorRegistry { public class MeteorRegistry {
public static List<Meteor> meteorList = new ArrayList<>(); public static List<Meteor> meteorList = new ArrayList<>();
private static int materialLibResolved;
private static int materialLibInvalid;
/// The stack a `ml:<Material>:<shape>` entry names, or null when MaterialLib is absent or the entry resolves to
/// nothing. Counts the outcome into the tally [#logMaterialLibTally] reports.
static ItemStack resolveMaterialLibStack(String materialName, String shapeToken) {
ItemStack stack = Loader.isModLoaded("materiallib") ? MaterialLibStacks.getStack(materialName, shapeToken)
: null;
if (stack == null) {
materialLibInvalid++;
} else {
materialLibResolved++;
}
return stack;
}
/// Logs the `ml:` entry tally and clears it. Call once every config that can carry such entries is loaded.
public static void logMaterialLibTally() {
if (materialLibResolved + materialLibInvalid > 0) {
AlchemicalWizardry.logger
.info("Resolved {} MaterialLib entries ({} invalid)", materialLibResolved, materialLibInvalid);
}
materialLibResolved = 0;
materialLibInvalid = 0;
}
public static void loadConfig() { public static void loadConfig() {
Gson gson = new GsonBuilder().setPrettyPrinting() Gson gson = new GsonBuilder().setPrettyPrinting()
.registerTypeAdapter(MeteorComponent.class, new MeteorComponentAdapter()) .registerTypeAdapter(MeteorComponent.class, new MeteorComponentAdapter())
@@ -5,7 +5,6 @@ import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
@@ -718,19 +717,8 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
return NewPacketHandler.getPacket(this); return NewPacketHandler.getPacket(this);
} }
public void handlePacketData(int[] intData, int[] fluidData, int capacity) { public void handlePacketData(ItemStack itemStack, int[] fluidData, int capacity) {
if (intData == null) { inv[0] = itemStack == null ? null : itemStack.copy();
return;
}
if (intData.length == 3) {
if (intData[2] != 0) {
ItemStack is = new ItemStack(Item.getItemById(intData[0]), intData[2], intData[1]);
inv[0] = is;
} else {
inv[0] = null;
}
}
FluidStack flMain = new FluidStack(fluidData[0], fluidData[1]); FluidStack flMain = new FluidStack(fluidData[0], fluidData[1]);
FluidStack flIn = new FluidStack(fluidData[2], fluidData[3]); FluidStack flIn = new FluidStack(fluidData[2], fluidData[3]);
@@ -743,25 +731,6 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
this.capacity = capacity; this.capacity = capacity;
} }
public int[] buildIntDataList() {
int[] sortList = new int[3]; // 1 * 3
int pos = 0;
for (ItemStack is : inv) {
if (is != null) {
sortList[pos++] = Item.getIdFromItem(is.getItem());
sortList[pos++] = is.getItemDamage();
sortList[pos++] = is.stackSize;
} else {
sortList[pos++] = 0;
sortList[pos++] = 0;
sortList[pos++] = 0;
}
}
return sortList;
}
@Override @Override
public void startCycle() { public void startCycle() {
if (worldObj != null) { if (worldObj != null) {
@@ -540,14 +540,22 @@ public class TEWritingTable extends TEInventory implements ISidedInventory, IBlo
} }
} }
} else { } else {
if (!isRecipeValid()) { ItemStack[] composedRecipe = new ItemStack[5];
System.arraycopy(inv, 1, composedRecipe, 0, 5);
AlchemyRecipe recipe = AlchemyRecipeRegistry.findRecipe(composedRecipe, inv[0]);
if (recipe == null) {
progress = 0; progress = 0;
return; return;
} }
ItemStack result = recipe.getResult();
if (progress <= 0) { if (progress <= 0) {
progress = 0; progress = 0;
amountUsed = this.getAmountNeeded(getStackInSlot(0)); amountUsed = recipe.getAmountNeeded();
if (worldObj != null) { if (worldObj != null) {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
@@ -580,60 +588,50 @@ public class TEWritingTable extends TEInventory implements ISidedInventory, IBlo
if (progress >= progressNeeded) { if (progress >= progressNeeded) {
progress = 0; progress = 0;
this.setInventorySlotContents(6, getResultingItemStack()); this.setInventorySlotContents(6, result.copy());
ItemStack[] composedRecipe = new ItemStack[5]; this.decrementSlots(recipe.getRecipe());
System.arraycopy(inv, 1, composedRecipe, 0, 5);
this.decrementSlots(this.getRecipeForItems(composedRecipe, inv[0]));
if (worldObj != null) { if (worldObj != null) {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
} }
} }
} else if (getStackInSlot(6).getItem() == getResultingItemStack().getItem() } else if (getStackInSlot(6).getItem() == result.getItem()
&& getResultingItemStack().stackSize && result.stackSize <= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize)) {
<= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize)) { if (worldTime % 4 == 0) {
if (worldTime % 4 == 0) { SpellHelper.sendIndexedParticleToAllAround(
SpellHelper.sendIndexedParticleToAllAround( worldObj,
worldObj, xCoord,
xCoord, yCoord,
yCoord, zCoord,
zCoord, 20,
20, worldObj.provider.dimensionId,
worldObj.provider.dimensionId, 1,
1, xCoord,
xCoord, yCoord,
yCoord, zCoord);
zCoord); }
}
if (!SoulNetworkHandler.syphonFromNetworkWhileInContainer( if (!SoulNetworkHandler
getStackInSlot(0), .syphonFromNetworkWhileInContainer(getStackInSlot(0), amountUsed * acceleration)) {
amountUsed * acceleration)) { return;
return; }
}
progress += acceleration; progress += acceleration;
if (progress >= progressNeeded) { if (progress >= progressNeeded) {
progress = 0; progress = 0;
ItemStack result = getResultingItemStack().copy(); ItemStack mergedResult = result.copy();
result.stackSize += getStackInSlot(6).stackSize; mergedResult.stackSize += getStackInSlot(6).stackSize;
this.setInventorySlotContents(6, result); this.setInventorySlotContents(6, mergedResult);
ItemStack[] composedRecipe = new ItemStack[5]; this.decrementSlots(recipe.getRecipe());
System.arraycopy(inv, 1, composedRecipe, 0, 5); if (worldObj != null) {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
this.decrementSlots(this.getRecipeForItems(composedRecipe, inv[0]));
if (worldObj != null) {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
} }
}
}
} }
} }
@@ -667,26 +665,6 @@ public class TEWritingTable extends TEInventory implements ISidedInventory, IBlo
} }
} }
public ItemStack[] getRecipeForItems(ItemStack[] recipe, ItemStack bloodOrb) {
if (bloodOrb == null) {
return null;
}
if (!(bloodOrb.getItem() instanceof IBloodOrb)) {
return null;
}
int bloodOrbLevel = ((IBloodOrb) bloodOrb.getItem()).getOrbLevel();
for (AlchemyRecipe ar : AlchemyRecipeRegistry.recipes) {
if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) {
return ar.getRecipe();
}
}
return null;
}
public int getSpeedIncrease() { public int getSpeedIncrease() {
return accelerationTime > 0 ? 5 : 1; return accelerationTime > 0 ? 5 : 1;
} }
@@ -0,0 +1,19 @@
package WayofTime.alchemicalWizardry.compat.materiallib;
import net.minecraft.item.ItemStack;
import com.ruling_0.materiallib.api.StackResolver;
/// Resolves a MaterialLib item from a material name and a shape token.
///
/// MaterialLib types are named only in this class, so it loads only where `materiallib` is present.
public final class MaterialLibStacks {
private MaterialLibStacks() {}
/// A single item of the named material in the named shape; see [StackResolver#getStack] for the naming rules and
/// the null cases.
public static ItemStack getStack(String materialName, String shapeToken) {
return StackResolver.getStack(materialName, shapeToken, 1);
}
}