Rewrite is Go!

Just moving over all my changes from my fork
1.12
Nick 2015-10-29 20:22:14 -07:00
parent 8bdd1f8b8f
commit e3d4afa123
973 changed files with 3313 additions and 82171 deletions

View File

@ -1,70 +1,59 @@
buildscript {
repositories {
mavenCentral()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "http://files.minecraftforge.net/maven" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'org.ajoberstar:gradle-git:0.10.1'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.0-SNAPSHOT'
classpath 'org.ajoberstar:gradle-git:0.10.1'
}
}
apply plugin: 'forge'
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
plugins {
id 'com.matthewprenger.cursegradle' version '1.0.1'
id "net.minecraftforge.gradle.forge" version "2.0.2"
id 'net.franz-becker.gradle-lombok' version '1.5'
}
version = config.mc_version + "-" + config.mod_version + "-" + config.build_number
group= config.package_group
archivesBaseName = config.mod_name
apply plugin: 'maven-publish'
import org.ajoberstar.grgit.Grgit
def build_number = 'CUSTOM'
if (System.getenv('BUILD_NUMBER') != null)
build_number = System.getenv('BUILD_NUMBER')
group = package_group
archivesBaseName = mod_name
version = "${mc_version}-${mod_version}-${build_number}"
// Ignore this error. It'll work just fine when building.
import org.ajoberstar.grgit.*
ext.repo = Grgit.open(project.file('.'))
def gitHash = 'unknown'
if (new File(projectDir, '.git').exists()) {
def repo = Grgit.open(project.file('.'))
if (new File(projectDir, '.git').exists())
gitHash = repo.log().find().abbreviatedId
}
repositories {
maven {
name 'CB Maven FS'
url "http://chickenbones.net/maven/"
}
maven {
name 'DVS1 Maven FS'
url 'http://dvs1.progwml6.com/files/maven'
}
maven {
name 'TehNut Repo'
url 'http://tehnut.info/maven/'
}
ivy {
name "MineTweaker3"
artifactPattern "http://minetweaker3.powerofbytes.com/download/[module]-[revision].[ext]"
}
}
dependencies {
// compile "codechicken:CodeChickenLib:" + config.mc_version + "-" + config.cclib_version + ":dev"
// compile "codechicken:CodeChickenCore:" + config.mc_version + "-" + config.ccc_version + ":dev"
// compile "codechicken:NotEnoughItems:" + config.mc_version + "-" + config.nei_version + ":dev"
// compile name: 'MineTweaker3', version: config.minetweaker_version, ext: 'jar'
// compile "codechicken:ForgeMultipart:1.7.10-1.1.0.314:dev"
// compile "info.amerifrance.guideapi:Guide-API:" + config.mc_version + "-" + config.guideapi_version + ":deobf"
}
minecraft {
version = config.mc_version + "-" + config.forge_version
version = "${mc_version}-${forge_version}"
runDir = "run"
replaceIn "GAPIChecker.java"
replace "@VERSION@", config.guideapi_version
replace "@VERSION@", project.version
replaceIn "AlchemicalWizardry.java"
replaceIn "AlchemicalWizardryAPI.java"
if (project.hasProperty('mappings_version'))
mappings = project.mappings_version
}
processResources {
@ -77,61 +66,91 @@ processResources {
expand 'version': project.version, 'mcversion': project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
exclude '**/*.db'
}
}
jar {
dependsOn "incrementBuildNumber"
classifier = ''
manifest.mainAttributes(
"Built-By": System.getProperty('user.name'),
"Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})",
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Git-Hash": gitHash
classifier = ''
manifest.mainAttributes(
"Built-By": System.getProperty('user.name'),
"Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})",
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Git-Hash": gitHash
)
}
// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
lombok {
version = "1.16.6"
sha256 = "e0a471be03e1e6b02bf019480cec7a3ac9801702bf7bf62f15d077ad4df8dd5d"
}
// add a javadoc jar
// Ignore this one, too
import net.franz_becker.gradle.lombok.task.DelombokTask
task delombok(type: DelombokTask) {
args("src/main/java", "-d", "build/sources/delomboked/java")
}
tasks.eclipse.dependsOn installLombok
// Javadoc jar
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier = 'javadoc'
}
// because the normal output has been made to be obfuscated
// Deobfuscated jar
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
javadoc {
source = projectDir.path + "/build/sources/delomboked/java"
}
tasks.javadoc.dependsOn delombok
tasks.build.dependsOn sourceJar, javadocJar, deobfJar
tasks.withType(JavaCompile) { task ->
task.options.encoding = 'UTF-8'
}
task("incrementBuildNumber") {
// increment build number
doFirst {
// increment
config.build_number = (config.build_number.toString().toInteger()) + 1
// write back to the file
configFile.withWriter {
config.toProperties().store(it, "")
}
}
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourceJar
artifact javadocJar
artifact deobfJar
}
}
repositories {
if (project.hasProperty('maven_repo')) {
maven { url maven_repo }
} else {
mavenLocal()
}
}
}
// Uncomment this line if you want to auto-upload to CurseForge when you build. This requires you to setup curse.gradle yourself.
// fileTree('gradle').include('curse.gradle').collect().sort().each { apply from: it }
curseforge {
if (project.hasProperty('curse_key'))
apiKey = project.curse_key
project {
id = "${curse_id}"
changelog = project.hasProperty('changelog') ? project.changelog : ''
releaseType = 'alpha'
addArtifact deobfJar
addArtifact sourceJar
addArtifact javadocJar
}
}

View File

@ -1,14 +0,0 @@
#
#Thu Aug 13 06:05:36 EDT 2015
mod_name=BloodMagic
forge_version=11.14.3.1499
ccc_version=1.0.5.34
cclib_version=1.1.2.133
nei_version=1.0.5.82
//=Dependency Information
guideapi_version=1.0.1-20
package_group=com.wayoftime.bloodmagic
mod_version=1.4.0
minetweaker_version=Dev-1.7.10-3.0.9B
build_number=2
mc_version=1.8

8
gradle.properties Normal file
View File

@ -0,0 +1,8 @@
mod_name=BloodMagic
package_group=com.wayoftime.bloodmagic
mod_version=2.0.0
mc_version=1.8
forge_version=latest
curse_id=224791
mappings_version=snapshot_20141130

1
settings.gradle Normal file
View File

@ -0,0 +1 @@
rootProject.name = 'BloodMagic'

View File

@ -1,301 +0,0 @@
package WayofTime.alchemicalWizardry;
import java.io.File;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold;
import WayofTime.alchemicalWizardry.client.renderer.RenderHelper;
import WayofTime.alchemicalWizardry.common.demonVillage.DemonVillagePath;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
/**
* Created with IntelliJ IDEA.
* User: Pokefenn
* Date: 17/01/14
* Time: 19:50
*/
public class BloodMagicConfiguration
{
private static final String DEFAULT_COLOR_LIST = "100,f; 80,7; 60,e; 40,6; 25,c; 10,4";
public static final List<ColourThreshold> colorList = new ArrayList<ColourThreshold>();
public static Configuration config;
public static String[] blocksToBeDisabled;
public static String[] itemsToBeDisabled;
public static String[] teleposerBlacklist;
public static String[] blacklist = {};
public static void init(File configFile)
{
for (String s : DEFAULT_COLOR_LIST.split(";"))
{
String[] ct = s.split(",");
colorList.add(new ColourThreshold(Integer.valueOf(ct[0].trim()), ct[1].trim()));
}
config = new Configuration(configFile);
try
{
config.load();
syncConfig();
} catch (Exception e)
{
AlchemicalWizardry.logger.error("There has been a problem loading the configuration, go ask on the forums :p");
} finally
{
config.save();
}
}
public static void syncConfig()
{
AlchemicalWizardry.standardBindingAgentDungeonChance = config.get("Dungeon Loot Chances", "standardBindingAgent", 30).getInt();
AlchemicalWizardry.mundanePowerCatalystDungeonChance = config.get("Dungeon Loot Chances", "mundanePowerCatalyst", 20).getInt();
AlchemicalWizardry.averagePowerCatalystDungeonChance = config.get("Dungeon Loot Chances", "averagePowerCatalyst", 10).getInt();
AlchemicalWizardry.greaterPowerCatalystDungeonChance = config.get("Dungeon Loot Chances", "greaterPowerCatalyst", 5).getInt();
AlchemicalWizardry.mundaneLengtheningCatalystDungeonChance = config.get("Dungeon Loot Chances", "mundaneLengtheningCatalyst", 20).getInt();
AlchemicalWizardry.averageLengtheningCatalystDungeonChance = config.get("Dungeon Loot Chances", "averageLengtheningCatalyst", 10).getInt();
AlchemicalWizardry.greaterLengtheningCatalystDungeonChance = config.get("Dungeon Loot Chances", "greaterLengtheningCatalyst", 5).getInt();
AlchemicalWizardry.customPotionDrowningID = config.get("Potion ID", "Drowning", 100).getInt();
AlchemicalWizardry.customPotionBoostID = config.get("Potion ID", "Boost", 101).getInt();
AlchemicalWizardry.customPotionProjProtID = config.get("Potion ID", "ProjProt", 102).getInt();
AlchemicalWizardry.customPotionInhibitID = config.get("Potion ID", "Inhibit", 103).getInt();
AlchemicalWizardry.customPotionFlightID = config.get("Potion ID", "Flight", 104).getInt();
AlchemicalWizardry.customPotionReciprocationID = config.get("Potion ID", "Reciprocation", 105).getInt();
AlchemicalWizardry.customPotionFlameCloakID = config.get("Potion ID", "FlameCloak", 106).getInt();
AlchemicalWizardry.customPotionIceCloakID = config.get("Potion ID", "IceCloak", 107).getInt();
AlchemicalWizardry.customPotionHeavyHeartID = config.get("Potion ID", "HeavyHeart", 108).getInt();
AlchemicalWizardry.customPotionFireFuseID = config.get("Potion ID", "FireFuse", 109).getInt();
AlchemicalWizardry.customPotionPlanarBindingID = config.get("Potion ID", "PlanarBinding", 110).getInt();
AlchemicalWizardry.customPotionSoulFrayID = config.get("Potion ID", "SoulFray", 111).getInt();
AlchemicalWizardry.customPotionSoulHardenID = config.get("Potion ID", "SoulHarden", 112).getInt();
AlchemicalWizardry.customPotionDeafID = config.get("Potion ID", "Deaf", 113).getInt();
AlchemicalWizardry.customPotionFeatherFallID = config.get("Potion ID", "FeatherFall", 114).getInt();
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.diamondMeteorArray = config.get("meteor", "diamondMeteor", new String[]{"oreDiamond", "100", "oreEmerald", "75", "oreCinnabar", "200", "oreAmber", "200"}).getStringList();
AlchemicalWizardry.diamondMeteorRadius = config.get("meteor", "diamondMeteorRadius", 5).getInt();
AlchemicalWizardry.stoneMeteorArray = config.get("meteor", "stoneBlockMeteor", new String[]{"oreCoal", "150", "oreApatite", "50", "oreIron", "50"}).getStringList();
AlchemicalWizardry.stoneMeteorRadius = config.get("meteor", "stoneMeteorRadius", 16).getInt();
AlchemicalWizardry.ironBlockMeteorArray = config.get("meteor", "ironBlockMeteor", new String[]{"oreIron", "400", "oreGold", "30", "oreCopper", "200", "oreTin", "140", "oreSilver", "70", "oreLead", "80", "oreLapis", "60", "oreRedstone", "100"}).getStringList();
AlchemicalWizardry.ironBlockMeteorRadius = config.get("meteor", "ironBlockMeteorRadius", 7).getInt();
AlchemicalWizardry.netherStarMeteorArray = config.get("meteor", "netherStarMeteor", new String[]{"oreDiamond", "150", "oreEmerald", "100", "oreQuartz", "250", "oreSunstone", "5", "oreMoonstone", "50", "oreIridium", "5", "oreCertusQuartz", "150"}).getStringList();
AlchemicalWizardry.netherStarMeteorRadius = config.get("meteor", "netherStarMeteorRadius", 3).getInt();
AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron", "gold", "copper", "tin", "lead", "silver", "osmium"}).getStringList();
AlchemicalWizardry.wimpySettings = config.get("WimpySettings", "IDontLikeFun", false).getBoolean(false);
AlchemicalWizardry.respawnWithDebuff = config.get("WimpySettings", "RespawnWithDebuff", true).getBoolean();
AlchemicalWizardry.causeHungerWithRegen = config.get("WimpySettings", "causeHungerWithRegen", true).getBoolean();
AlchemicalWizardry.causeHungerChatMessage = config.get("WimpySettings", "causeHungerChatMessage", true).getBoolean();
// AlchemicalWizardry.lockdownAltar = config.get("WimpySettings", "LockdownAltarWithRegen", true).getBoolean();
AlchemicalWizardry.lockdownAltar = false;
AlchemicalWizardry.ritualDisabledWater = config.get("Ritual Blacklist", "Ritual of the Full Spring", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledLava = config.get("Ritual Blacklist", "Serenade of the Nether", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledGreenGrove = config.get("Ritual Blacklist", "Ritual of the Green Grove", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledInterdiction = config.get("Ritual Blacklist", "Interdiction Ritual", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledContainment = config.get("Ritual Blacklist", "Ritual of Containment", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledBinding = config.get("Ritual Blacklist", "Ritual of Binding", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledUnbinding = config.get("Ritual Blacklist", "Ritual of Unbinding", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledHighJump = config.get("Ritual Blacklist", "Ritual of the High Jump", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledMagnetism = config.get("Ritual Blacklist", "Ritual of Magnetism", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledCrusher = config.get("Ritual Blacklist", "Ritual of the Crusher", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledSpeed = config.get("Ritual Blacklist", "Ritual of Speed", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledAnimalGrowth = config.get("Ritual Blacklist", "Ritual of the Shepherd", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledSuffering = config.get("Ritual Blacklist", "Well of Suffering", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledRegen = config.get("Ritual Blacklist", "Ritual of Regeneration", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledFeatheredKnife = config.get("Ritual Blacklist", "Ritual of the Feathered Knife", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledFeatheredEarth = config.get("Ritual Blacklist", "Ritual of the Feathered Earth", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledGaia = config.get("Ritual Blacklist", "Ritual of Gaia's Transformation", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledCondor = config.get("Ritual Blacklist", "Reverence of the Condor", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledFallingTower = config.get("Ritual Blacklist", "Mark of the Falling Tower", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledBalladOfAlchemy = config.get("Ritual Blacklist", "Ballad of Alchemy", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledExpulsion = config.get("Ritual Blacklist", "Aura of Expulsion", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledSuppression = config.get("Ritual Blacklist", "Dome of Supression", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledZephyr = config.get("Ritual Blacklist", "Call of the Zephyr", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledHarvest = config.get("Ritual Blacklist", "Reap of the Harvest Moon", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledConduit = config.get("Ritual Blacklist", "Cry of the Eternal Soul", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledEllipsoid = config.get("Ritual Blacklist", "Focus of the Ellipsoid", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledEvaporation = config.get("Ritual Blacklist", "Song of Evaporation", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledSpawnWard = config.get("Ritual Blacklist", "Ward of Sacrosanctity", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledVeilOfEvil = config.get("Ritual Blacklist", "Veil of Evil", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledFullStomach = config.get("Ritual Blacklist", "Requiem of the Satiated Stomach", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledConvocation = config.get("Ritual Blacklist", "Convocation of the Damned", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledSymmetry = config.get("Ritual Blacklist", "Symmetry of the Omega", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledStalling = config.get("Ritual Blacklist", "Duet of the Fused Souls", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledCrafting = config.get("Ritual Blacklist", "Rhythm of the Beating Anvil", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledPhantomHands = config.get("Ritual Blacklist", "Orchestra of the Phantom Hands", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledSphereIsland = config.get("Ritual Blacklist", "Birth of the Bastion", false).getBoolean(false);
AlchemicalWizardry.potionDisableRegen = config.get("Alchemy Potion Blacklist", "Regeneration", false).getBoolean(false);
AlchemicalWizardry.potionDisableNightVision = config.get("Alchemy Potion Blacklist", "Night Vision", false).getBoolean(false);
AlchemicalWizardry.potionDisableFireResistance = config.get("Alchemy Potion Blacklist", "Fire Resistance", false).getBoolean(false);
AlchemicalWizardry.potionDisableWaterBreathing = config.get("Alchemy Potion Blacklist", "Water Breathing", false).getBoolean(false);
AlchemicalWizardry.potionDisableMoveSpeed = config.get("Alchemy Potion Blacklist", "Move Speed", false).getBoolean(false);
AlchemicalWizardry.potionDisableInstantHealth = config.get("Alchemy Potion Blacklist", "Instant Health", false).getBoolean(false);
AlchemicalWizardry.potionDisablePoison = config.get("Alchemy Potion Blacklist", "Poison", false).getBoolean(false);
AlchemicalWizardry.potionDisableBlindness = config.get("Alchemy Potion Blacklist", "Blindness", false).getBoolean(false);
AlchemicalWizardry.potionDisableWeakness = config.get("Alchemy Potion Blacklist", "Weakness", false).getBoolean(false);
AlchemicalWizardry.potionDisableStrength = config.get("Alchemy Potion Blacklist", "Strength", false).getBoolean(false);
AlchemicalWizardry.potionDisableJumpBoost = config.get("Alchemy Potion Blacklist", "Jump Boost", false).getBoolean(false);
AlchemicalWizardry.potionDisableSlowness = config.get("Alchemy Potion Blacklist", "Slowness", false).getBoolean(false);
AlchemicalWizardry.potionDisableMining = config.get("Alchemy Potion Blacklist", "Mining Speed", false).getBoolean(false);
AlchemicalWizardry.potionDisableDrowning = config.get("Alchemy Potion Blacklist", "Drowning", false).getBoolean(false);
AlchemicalWizardry.potionDisableInvisibility = config.get("Alchemy Potion Blacklist", "Invisibility", false).getBoolean(false);
AlchemicalWizardry.potionDisableResistance = config.get("Alchemy Potion Blacklist", "Resistance", false).getBoolean(false);
AlchemicalWizardry.potionDisableSaturation = config.get("Alchemy Potion Blacklist", "Saturation", false).getBoolean(false);
AlchemicalWizardry.potionDisableHealthBoost = config.get("Alchemy Potion Blacklist", "Health Boost", false).getBoolean(false);
AlchemicalWizardry.potionDisableAbsorption = config.get("Alchemy Potion Blacklist", "Absorption", false).getBoolean(false);
AlchemicalWizardry.potionDisableBoost = config.get("Alchemy Potion Blacklist", "Boost", false).getBoolean(false);
AlchemicalWizardry.potionDisableFlight = config.get("Alchemy Potion Blacklist", "Flight", false).getBoolean(false);
AlchemicalWizardry.potionDisableReciprocation = config.get("Alchemy Potion Blacklist", "Reciprocation", false).getBoolean(false);
AlchemicalWizardry.potionDisablePlanarBinding = config.get("Alchemy Potion Blacklist", "Planar Binding", false).getBoolean(false);
AlchemicalWizardry.potionDisableSoulFray = config.get("Alchemy Potion Blacklist", "Soul Fray", false).getBoolean(false);
AlchemicalWizardry.potionDisableSoulHarden = config.get("Alchemy Potion Blacklist", "Soul Harden", false).getBoolean(false);
AlchemicalWizardry.potionDisableDeafness = config.get("Alchemy Potion Blacklist", "Deafness", false).getBoolean(false);
teleposerBlacklist = config.get("Teleposer Blacklist", "Blacklist", blacklist, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is: \nmodid:blockname:meta").getStringList();
String tempDemonConfigs = "Demon Configs";
TEDemonPortal.buildingGridDelay = config.get(tempDemonConfigs, "Building Grid Delay", 25).getInt();
TEDemonPortal.roadGridDelay = config.get(tempDemonConfigs, "Road Grid Delay", 10).getInt();
TEDemonPortal.demonHoardDelay = config.get(tempDemonConfigs, "Demon Hoard Delay", 40).getInt();
TEDemonPortal.demonRoadChance = (float)(config.get(tempDemonConfigs, "Demon Road Chance", 0.3f).getDouble());
TEDemonPortal.demonHouseChance = (float)(config.get(tempDemonConfigs, "Demon House Chance", 0.6f).getDouble());
TEDemonPortal.demonPortalChance = (float)(config.get(tempDemonConfigs, "Demon Portal Chance", 0.5f).getDouble());
TEDemonPortal.demonHoardChance = (float)(config.get(tempDemonConfigs, "Demon Hoard Chance", 0.8f).getDouble());
TEDemonPortal.portalTickRate = (float)(config.get(tempDemonConfigs, "Portal Tick Rate", 0.1f).getDouble());
DemonVillagePath.canGoDown = config.get(tempDemonConfigs, "canRoadGoDown", true).getBoolean();
DemonVillagePath.tunnelIfObstructed = config.get(tempDemonConfigs, "tunnelIfObstructed", false).getBoolean();
DemonVillagePath.createBridgeInAirIfObstructed = config.get(tempDemonConfigs, "createBridgeInAirIfObstructed", false).getBoolean();
TEDemonPortal.limit = config.get(tempDemonConfigs, "demonGridSpaceLimit", 100).getInt();
TEDemonPortal.demonLimit = config.get(tempDemonConfigs, "demonHoardLimit", 100).getInt();
AlchemicalWizardry.isDemonRitualCreativeOnly = config.get(tempDemonConfigs, "IsDemonRitualCreativeOnly", false).getBoolean();
BoundArmour.tryComplexRendering = config.get("WimpySettings", "UseFancyBoundArmour", true).getBoolean(true);
blocksToBeDisabled = config.getStringList("Disable blocks here", "WimpySettings", new String[]{""}, "Type in the unlocalized name of the block you want disabled here (separate them using ENTER)");
itemsToBeDisabled = config.getStringList("Disable items here", "WimpySettings", new String[]{""}, "Type in the unlocalized name of the item you want disabled (separate them using ENTER)");
// ItemIncense.itemDuration = config.get("TestIncenseSettings", "ItemDuration", 100).getInt();
// ItemIncense.minValue = config.get("TestIncenseSettings", "MinValue", 0).getInt();
// ItemIncense.maxValue = config.get("TestIncenseSettings", "MaxValue", 100).getInt();
// PlayerSacrificeHandler.scalingOfSacrifice = (float) config.get("TestIncenseSettings", "ScalingFactor", 0.0025f).getDouble();
// PlayerSacrificeHandler.soulFrayDuration = config.get("TestIncenseSettings", "SoulFrayDuration", 400).getInt();
Side side = FMLCommonHandler.instance().getSide();
if (side == Side.CLIENT)
{
RenderHelper.xOffset = config.get("ClientSettings", "AlchemyHUDxOffset", 50).getInt();
RenderHelper.yOffset = config.get("ClientSettings", "AlchemyHUDyOffset", 2).getInt();
RenderHelper.lpBarX = config.get("ClientSettings", "LPHUDxOffset", 12).getInt();
RenderHelper.lpBarY = config.get("ClientSettings", "LPHUDyOffset", 75).getInt();
}
config.save();
}
public static void set(String categoryName, String propertyName, String newValue)
{
config.load();
if (config.getCategoryNames().contains(categoryName))
{
if (config.getCategory(categoryName).containsKey(propertyName))
{
config.getCategory(categoryName).get(propertyName).set(newValue);
}
}
config.save();
}
public static void loadBlacklist()
{
AlchemicalWizardry.wellBlacklist = new ArrayList<Class>();
for (Object o : EntityList.stringToClassMapping.entrySet())
{
Entry entry = (Entry) o;
Class curClass = (Class) entry.getValue();
boolean valid = EntityLivingBase.class.isAssignableFrom(curClass) && !Modifier.isAbstract(curClass.getModifiers());
if (valid)
{
boolean blacklisted = config.get("wellOfSufferingBlackList", entry.getKey().toString(), false).getBoolean();
if (blacklisted)
AlchemicalWizardry.wellBlacklist.add(curClass);
}
}
config.save();
}
public static void blacklistRituals()
{
if (AlchemicalWizardry.ritualDisabledWater) r("AW001Water");
if (AlchemicalWizardry.ritualDisabledLava) r("AW002Lava");
if (AlchemicalWizardry.ritualDisabledGreenGrove) r("AW003GreenGrove");
if (AlchemicalWizardry.ritualDisabledInterdiction) r("AW004Interdiction");
if (AlchemicalWizardry.ritualDisabledContainment) r("AW005Containment");
if (AlchemicalWizardry.ritualDisabledBinding) r("AW006Binding");
if (AlchemicalWizardry.ritualDisabledUnbinding) r("AW007Unbinding"); // "A medium dry martini, lemon peel. Shaken, not stirred."
if (AlchemicalWizardry.ritualDisabledHighJump) r("AW008HighJump");
if (AlchemicalWizardry.ritualDisabledMagnetism) r("AW009Magnetism");
if (AlchemicalWizardry.ritualDisabledCrusher) r("AW010Crusher");
if (AlchemicalWizardry.ritualDisabledSpeed) r("AW011Speed");
if (AlchemicalWizardry.ritualDisabledAnimalGrowth) r("AW012AnimalGrowth");
if (AlchemicalWizardry.ritualDisabledSuffering) r("AW013Suffering");
if (AlchemicalWizardry.ritualDisabledRegen) r("AW014Regen");
if (AlchemicalWizardry.ritualDisabledFeatheredKnife) r("AW015FeatheredKnife");
if (AlchemicalWizardry.ritualDisabledFeatheredEarth) r("AW016FeatheredEarth");
if (AlchemicalWizardry.ritualDisabledGaia) r("AW017Gaia");
if (AlchemicalWizardry.ritualDisabledCondor) r("AW018Condor");
if (AlchemicalWizardry.ritualDisabledFallingTower) r("AW019FallingTower");
if (AlchemicalWizardry.ritualDisabledBalladOfAlchemy) r("AW020BalladOfAlchemy");
if (AlchemicalWizardry.ritualDisabledExpulsion) r("AW021Expulsion");
if (AlchemicalWizardry.ritualDisabledSuppression) r("AW022Suppression");
if (AlchemicalWizardry.ritualDisabledZephyr) r("AW023Zephyr");
if (AlchemicalWizardry.ritualDisabledHarvest) r("AW024Harvest");
if (AlchemicalWizardry.ritualDisabledConduit) r("AW025Conduit");
if (AlchemicalWizardry.ritualDisabledEllipsoid) r("AW026Ellipsoid");
if (AlchemicalWizardry.ritualDisabledEvaporation) r("AW027Evaporation");
if (AlchemicalWizardry.ritualDisabledSpawnWard) r("AW028SpawnWard");
if (AlchemicalWizardry.ritualDisabledVeilOfEvil) r("AW029VeilOfEvil");
if (AlchemicalWizardry.ritualDisabledFullStomach) r("AW030FullStomach");
if (AlchemicalWizardry.ritualDisabledConvocation) r("AW031Convocation");
if (AlchemicalWizardry.ritualDisabledSymmetry) r("AW032Symmetry");
if (AlchemicalWizardry.ritualDisabledStalling) r("AW033Stalling");
if (AlchemicalWizardry.ritualDisabledCrafting) r("AW034Crafting");
if (AlchemicalWizardry.ritualDisabledPhantomHands) r("AW035PhantomHands");
if (AlchemicalWizardry.ritualDisabledSphereIsland) r("AW036SphereIsland");
}
private static void r(String ritualID)
{
Rituals.ritualMap.remove(ritualID);
Rituals.keyList.remove(ritualID);
}
}

View File

@ -0,0 +1,195 @@
package WayofTime.alchemicalWizardry;
import WayofTime.alchemicalWizardry.api.AlchemicalWizardryAPI;
import WayofTime.alchemicalWizardry.api.BlockStack;
import WayofTime.alchemicalWizardry.registry.ModPotions;
import WayofTime.alchemicalWizardry.util.Utils;
import net.minecraft.block.Block;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ConfigHandler {
public static Configuration config;
// Teleposer
public static String[] teleposerBlacklisting;
public static ArrayList<BlockStack> teleposerBlacklist = new ArrayList<BlockStack>();
// Item/Block Disabling
public static List itemBlacklist;
public static List blockBlacklist;
// Potion ID's
public static int customPotionDrowningID;
public static int customPotionBoostID;
public static int customPotionProjProtID;
public static int customPotionInhibitID;
public static int customPotionFlightID;
public static int customPotionReciprocationID;
public static int customPotionFlameCloakID;
public static int customPotionIceCloakID;
public static int customPotionHeavyHeartID;
public static int customPotionFireFuseID;
public static int customPotionPlanarBindingID;
public static int customPotionSoulFrayID;
public static int customPotionSoulHardenID;
public static int customPotionDeafID;
public static int customPotionFeatherFallID;
public static int customPotionDemonCloakID;
public static int customPotionAmphibianID;
// Potion toggles
public static boolean customPotionDrowningEnabled;
public static boolean customPotionBoostEnabled;
public static boolean customPotionProjProtEnabled;
public static boolean customPotionInhibitEnabled;
public static boolean customPotionFlightEnabled;
public static boolean customPotionReciprocationEnabled;
public static boolean customPotionFlameCloakEnabled;
public static boolean customPotionIceCloakEnabled;
public static boolean customPotionHeavyHeartEnabled;
public static boolean customPotionFireFuseEnabled;
public static boolean customPotionPlanarBindingEnabled;
public static boolean customPotionSoulFrayEnabled;
public static boolean customPotionSoulHardenEnabled;
public static boolean customPotionDeafEnabled;
public static boolean customPotionFeatherFallEnabled;
public static boolean customPotionDemonCloakEnabled;
public static boolean customPotionAmphibianEnabled;
public static boolean vanillaPotionRegenerationEnabled;
public static boolean vanillaPotionNightVisionEnabled;
public static boolean vanillaPotionFireResistEnabled;
public static boolean vanillaPotionWaterBreathingEnabled;
public static boolean vanillaPotionSpeedEnabled;
public static boolean vanillaPotionHealthEnabled;
public static boolean vanillaPotionPoisonEnabled;
public static boolean vanillaPotionBlindnessEnabled;
public static boolean vanillaPotionWeaknessEnabled;
public static boolean vanillaPotionStrengthEnabled;
public static boolean vanillaPotionJumpBoostEnabled;
public static boolean vanillaPotionSlownessEnabled;
public static boolean vanillaPotionMiningEnabled;
public static boolean vanillaPotionInvisibilityEnabled;
public static boolean vanillaPotionResistanceEnabled;
public static boolean vanillaPotionSaturationEnabled;
public static boolean vanillaPotionHealthBoostEnabled;
public static boolean vanillaPotionAbsorptionEnabled;
public static void init(File file) {
config = new Configuration(file);
syncConfig();
}
public static void syncConfig() {
String category;
category = "Item/Block Blacklisting";
config.addCustomCategoryComment(category, "Allows disabling of specific Blocks/Items.\nNote that using this may result in crashes. Use is not supported.");
config.setCategoryRequiresMcRestart(category, true);
itemBlacklist = Arrays.asList(config.getStringList("itemBlacklist", category, new String[]{}, "Items to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode."));
blockBlacklist = Arrays.asList(config.getStringList("blockBlacklist", category, new String[]{}, "Blocks to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode."));
category = "Teleposer Blacklist";
config.addCustomCategoryComment(category, "Block blacklisting");
teleposerBlacklisting = config.getStringList("teleposerBlacklist", category, new String[] {"minecraft:bedrock"}, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is:\nmodid:blockname:meta");
buildTeleposerBlacklist();
category = "Potions";
config.addCustomCategoryComment(category, "Potion settings");
config.addCustomCategoryComment(category + ".id", "Potion ID settings");
customPotionDrowningID = config.getInt("customPotionDrowningID", category + ".id", 100, 20, ModPotions.getArraySize(), "ID of the Drowning potion");
customPotionBoostID = config.getInt("customPotionBoostID", category + ".id", 101, 20, ModPotions.getArraySize(), "ID of the Boost potion");
customPotionProjProtID = config.getInt("customPotionProjProtID", category + ".id", 102, 20, ModPotions.getArraySize(), "ID of the Projectile Protection potion");
customPotionInhibitID = config.getInt("customPotionInhibitID", category + ".id", 103, 20, ModPotions.getArraySize(), "ID of the Inhibit potion");
customPotionFlightID = config.getInt("customPotionFlightID", category + ".id", 104, 20, ModPotions.getArraySize(), "ID of the Flight potion");
customPotionReciprocationID = config.getInt("customPotionReciprocationID", category + ".id", 105, 20, ModPotions.getArraySize(), "ID of the Reciprocation potion");
customPotionFlameCloakID = config.getInt("customPotionFlameCloakID", category + ".id", 106, 20, ModPotions.getArraySize(), "ID of the Flame Cloak potion");
customPotionIceCloakID = config.getInt("customPotionIceCloakID", category + ".id", 107, 20, ModPotions.getArraySize(), "ID of the Ice Cloak potion");
customPotionHeavyHeartID = config.getInt("customPotionHeavyHeartID", category + ".id", 108, 20, ModPotions.getArraySize(), "ID of the Heavy Heart potion");
customPotionFireFuseID = config.getInt("customPotionFireFuseID", category + ".id", 109, 20, ModPotions.getArraySize(), "ID of the Fire Fuse potion");
customPotionPlanarBindingID = config.getInt("customPotionPlanarBindingID", category + ".id", 110, 20, ModPotions.getArraySize(), "ID of the Planar Binding potion");
customPotionSoulFrayID = config.getInt("customPotionSoulFrayID", category + ".id", 111, 20, ModPotions.getArraySize(), "ID of the Soul Fray potion");
customPotionSoulHardenID = config.getInt("customPotionSoulHardenID", category + ".id", 112, 20, ModPotions.getArraySize(), "ID of the Soul Harden potion");
customPotionDeafID = config.getInt("customPotionDeafID", category + ".id", 113, 20, ModPotions.getArraySize(), "ID of the Deaf potion");
customPotionFeatherFallID = config.getInt("customPotionFeatherFallID", category + ".id", 114, 20, ModPotions.getArraySize(), "ID of the Feather Fall potion");
customPotionDemonCloakID = config.getInt("customPotionDemonCloakID", category + ".id", 115, 20, ModPotions.getArraySize(), "ID of the Demon Cloak potion");
customPotionAmphibianID = config.getInt("customPotionAmphibianID", category + ".id", 116, 20, ModPotions.getArraySize(), "ID of the Amphibian potion");
config.addCustomCategoryComment(category + ".toggle", "Toggle potions available in Alchemy");
customPotionDrowningEnabled = config.getBoolean("customPotionDrowningEnabled", category + ".toggle", true, "Enables the Drowning potion in Alchemy");
customPotionBoostEnabled = config.getBoolean("customPotionBoostEnabled", category + ".toggle", true, "Enables the Boost potion in Alchemy");
customPotionProjProtEnabled = config.getBoolean("customPotionProjProtEnabled", category + ".toggle", true, "Enables the Projectile Protection potion in Alchemy");
customPotionInhibitEnabled = config.getBoolean("customPotionInhibitEnabled", category + ".toggle", true, "Enables the Inhibit potion in Alchemy");
customPotionFlightEnabled = config.getBoolean("customPotionFlightEnabled", category + ".toggle", true, "Enables the Flight potion in Alchemy");
customPotionReciprocationEnabled = config.getBoolean("customPotionReciprocationEnabled", category + ".toggle", true, "Enables the Reciprocation potion in Alchemy");
customPotionFlameCloakEnabled = config.getBoolean("customPotionFlameCloakEnabled", category + ".toggle", true, "Enables the Flame Cloak potion in Alchemy");
customPotionIceCloakEnabled = config.getBoolean("customPotionIceCloakEnabled", category + ".toggle", true, "Enables the Ice Cloak potion in Alchemy");
customPotionHeavyHeartEnabled = config.getBoolean("customPotionHeavyHeartEnabled", category + ".toggle", true, "Enables the Heavy Heart potion in Alchemy");
customPotionFireFuseEnabled = config.getBoolean("customPotionFireFuseEnabled", category + ".toggle", true, "Enables the Fire Fuse potion in Alchemy");
customPotionPlanarBindingEnabled = config.getBoolean("customPotionPlanarBindingEnabled", category + ".toggle", true, "Enables the Planar Binding potion in Alchemy");
customPotionSoulFrayEnabled = config.getBoolean("customPotionSoulFrayEnabled", category + ".toggle", true, "Enables the Soul Fray potion in Alchemy");
customPotionSoulHardenEnabled = config.getBoolean("customPotionSoulHardenEnabled", category + ".toggle", true, "Enables the Soul Harden potion in Alchemy");
customPotionDeafEnabled = config.getBoolean("customPotionDeafEnabled", category + ".toggle", true, "Enables the Deaf potion in Alchemy");
customPotionFeatherFallEnabled = config.getBoolean("customPotionFeatherFallEnabled", category + ".toggle", true, "Enables the Feather Fall potion in Alchemy");
customPotionDemonCloakEnabled = config.getBoolean("customPotionDemonCloakEnabled", category + ".toggle", true, "Enables the Demon Cloak potion in Alchemy");
customPotionAmphibianEnabled = config.getBoolean("customPotionAmphibianEnabled", category + ".toggle", true, "Enables the Amphibian potion in Alchemy");
vanillaPotionAbsorptionEnabled = config.getBoolean("vanillaPotionAbsorptionEnabled", category + ".toggle", true, "Enables the Absorption potion in Alchemy");
vanillaPotionBlindnessEnabled = config.getBoolean("vanillaPotionBlindnessEnabled", category + ".toggle", true, "Enables the Blindness potion in Alchemy");
vanillaPotionFireResistEnabled = config.getBoolean("vanillaPotionFireResistEnabled", category + ".toggle", true, "Enables the Fire Resistance potion in Alchemy");
vanillaPotionHealthBoostEnabled = config.getBoolean("vanillaPotionHealthBoostEnabled", category + ".toggle", true, "Enables the Health Boost potion in Alchemy");
vanillaPotionHealthEnabled = config.getBoolean("vanillaPotionHealthEnabled", category + ".toggle", true, "Enables the Instant Health potion in Alchemy");
vanillaPotionInvisibilityEnabled = config.getBoolean("vanillaPotionInvisibilityEnabled", category + ".toggle", true, "Enables the Invisibility potion in Alchemy");
vanillaPotionJumpBoostEnabled = config.getBoolean("vanillaPotionJumpBoostEnabled", category + ".toggle", true, "Enables the Jump Boost potion in Alchemy");
vanillaPotionMiningEnabled = config.getBoolean("vanillaPotionMiningEnabled", category + ".toggle", true, "Enables the Mining potion in Alchemy");
vanillaPotionPoisonEnabled = config.getBoolean("vanillaPotionPoisonEnabled", category + ".toggle", true, "Enables the Poison potion in Alchemy");
vanillaPotionRegenerationEnabled = config.getBoolean("vanillaPotionRegenerationEnabled", category + ".toggle", true, "Enables the Regeneration potion in Alchemy");
vanillaPotionNightVisionEnabled = config.getBoolean("vanillaPotionNightVisionEnabled", category + ".toggle", true, "Enables the Night Vision potion in Alchemy");
vanillaPotionResistanceEnabled = config.getBoolean("vanillaPotionResistanceEnabled", category + ".toggle", true, "Enables the Resistance potion in Alchemy");
vanillaPotionSaturationEnabled = config.getBoolean("vanillaPotionSaturationEnabled", category + ".toggle", true, "Enables the Saturation potion in Alchemy");
vanillaPotionSlownessEnabled = config.getBoolean("vanillaPotionSlownessEnabled", category + ".toggle", true, "Enables the Slowness potion in Alchemy");
vanillaPotionSpeedEnabled = config.getBoolean("vanillaPotionSpeedEnabled", category + ".toggle", true, "Enables the Speed potion in Alchemy");
vanillaPotionStrengthEnabled = config.getBoolean("vanillaPotionStrengthEnabled", category + ".toggle", true, "Enables the Strength potion in Alchemy");
vanillaPotionWaterBreathingEnabled = config.getBoolean("vanillaPotionWaterBreathingEnabled", category + ".toggle", true, "Enables the Water Breathing potion in Alchemy");
vanillaPotionWeaknessEnabled = config.getBoolean("vanillaPotionWeaknessEnabled", category + ".toggle", true, "Enables the Weakness potion in Alchemy");
category = "General";
config.addCustomCategoryComment(category, "General settings");
AlchemicalWizardryAPI.setLoggingEnabled(config.getBoolean("enableLogging", category, true, "Allows logging information to the console. Fatal errors will bypass this"));
config.save();
}
private static void buildTeleposerBlacklist() {
// Make sure it's empty before setting the blacklist.
// Otherwise, reloading the config while in-game will duplicate the list.
teleposerBlacklist.clear();
for (String blockSet : teleposerBlacklisting) {
String[] blockData = blockSet.split(":");
Block block = GameRegistry.findBlock(blockData[0], blockData[1]);
int meta = 0;
// If the block follows full syntax: modid:blockname:meta
if (blockData.length == 3) {
// Check if it's an int, if so, parse it. If not, set meta to 0 to avoid crashing.
if (Utils.isInteger(blockData[2]))
meta = Integer.parseInt(blockData[2]);
else if (blockData[2].equals("*"))
meta = OreDictionary.WILDCARD_VALUE;
else
meta = 0;
}
teleposerBlacklist.add(new BlockStack(block, meta));
}
}
}

View File

@ -1,200 +0,0 @@
package WayofTime.alchemicalWizardry;
import WayofTime.alchemicalWizardry.client.BlockRenderer;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.registry.GameRegistry;
import WayofTime.alchemicalWizardry.common.block.BlockArmourForge;
import WayofTime.alchemicalWizardry.common.block.BlockAlchemicalCalcinator;
import WayofTime.alchemicalWizardry.common.block.BlockAltar;
import WayofTime.alchemicalWizardry.common.block.BlockBelljar;
import WayofTime.alchemicalWizardry.common.block.BlockBloodLightSource;
import WayofTime.alchemicalWizardry.common.block.BlockConduit;
import WayofTime.alchemicalWizardry.common.block.BlockIncenseCrucible;
import WayofTime.alchemicalWizardry.common.block.BlockCrystal;
import WayofTime.alchemicalWizardry.common.block.BlockDemonPortal;
import WayofTime.alchemicalWizardry.common.block.BlockEnchantmentGlyph;
import WayofTime.alchemicalWizardry.common.block.BlockSpellTable;
import WayofTime.alchemicalWizardry.common.block.BlockMasterStone;
import WayofTime.alchemicalWizardry.common.block.BlockPedestal;
import WayofTime.alchemicalWizardry.common.block.BlockPlinth;
import WayofTime.alchemicalWizardry.common.block.BlockReagentConduit;
import WayofTime.alchemicalWizardry.common.block.BlockSchematicSaver;
import WayofTime.alchemicalWizardry.common.block.BlockFilledSocket;
import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer;
import WayofTime.alchemicalWizardry.common.block.BlockSpellEffect;
import WayofTime.alchemicalWizardry.common.block.BlockSpellEnhancement;
import WayofTime.alchemicalWizardry.common.block.BlockSpellModifier;
import WayofTime.alchemicalWizardry.common.block.BlockSpellParadigm;
import WayofTime.alchemicalWizardry.common.block.BlockStabilityGlyph;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
import WayofTime.alchemicalWizardry.common.block.BlockChemistrySet;
import WayofTime.alchemicalWizardry.common.block.BlockBloodRune;
import WayofTime.alchemicalWizardry.common.block.BlockBloodStoneBrick;
import WayofTime.alchemicalWizardry.common.block.BlockEfficiencyRune;
import WayofTime.alchemicalWizardry.common.block.BlockEmptySocket;
import WayofTime.alchemicalWizardry.common.block.BlockImperfectRitualStone;
import WayofTime.alchemicalWizardry.common.block.BlockLargeBloodStoneBrick;
import WayofTime.alchemicalWizardry.common.block.BlockLifeEssence;
import WayofTime.alchemicalWizardry.common.block.BlockMimic;
import WayofTime.alchemicalWizardry.common.block.BlockRitualStone;
import WayofTime.alchemicalWizardry.common.block.BlockRuneOfSacrifice;
import WayofTime.alchemicalWizardry.common.block.BlockRuneOfSelfSacrifice;
import WayofTime.alchemicalWizardry.common.block.BlockSpectral;
import WayofTime.alchemicalWizardry.common.block.BlockSpeedRune;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.BlockDemonChest;
import WayofTime.alchemicalWizardry.common.items.ItemBlockCrystalBelljar;
import WayofTime.alchemicalWizardry.common.items.ItemBloodRuneBlock;
import WayofTime.alchemicalWizardry.common.items.ItemCrystalBlock;
import WayofTime.alchemicalWizardry.common.items.ItemEnchantmentGlyphBlock;
import WayofTime.alchemicalWizardry.common.items.ItemSpellEffectBlock;
import WayofTime.alchemicalWizardry.common.items.ItemSpellEnhancementBlock;
import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock;
import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock;
import WayofTime.alchemicalWizardry.common.items.ItemStabilityGlyphBlock;
import java.util.ArrayList;
/**
* Created with IntelliJ IDEA.
* User: Pokefenn
* Date: 17/01/14
* Time: 19:48
*/
public class ModBlocks
{
public static Block bloodStoneBrick;
public static Block largeBloodStoneBrick;
public static BlockAltar blockAltar;
public static BlockBloodRune bloodRune;
public static BlockSpeedRune speedRune;
public static BlockEfficiencyRune efficiencyRune;
public static BlockRuneOfSacrifice runeOfSacrifice;
public static BlockRuneOfSelfSacrifice runeOfSelfSacrifice;
public static Block blockMasterStone;
public static Block ritualStone;
public static Block imperfectRitualStone;
public static Block bloodSocket;
public static Block emptySocket;
public static Block armourForge;
public static Block blockWritingTable;
public static Block blockSpellTable;
public static Block blockPedestal;
public static Block blockPlinth;
public static Block blockLifeEssence;
public static Block blockTeleposer;
public static Block spectralBlock;
public static Block blockConduit;
public static Block blockBloodLight;
public static Block blockSpellEffect;
public static Block blockSpellParadigm;
public static Block blockSpellModifier;
public static Block blockSpellEnhancement;
public static Block blockSpectralContainer;
public static Block blockBuildingSchematicSaver;
public static Block blockDemonPortal;
public static Block blockReagentConduit;
public static Block blockAlchemicalCalcinator;
public static Block blockCrystalBelljar;
public static Block blockDemonChest;
public static Block blockCrystal;
public static Block blockMimic;
public static Block blockEnchantmentGlyph;
public static Block blockStabilityGlyph;
public static Block blockCrucible;
public static ArrayList<String> blocksNotToBeRegistered = new ArrayList<String>();
public static void init()
{
blockAltar = (BlockAltar) registerBlock(new BlockAltar(), "altar");
bloodRune = (BlockBloodRune) registerBlock(new BlockBloodRune(), ItemBloodRuneBlock.class, "base_rune");
speedRune = (BlockSpeedRune) registerBlock(new BlockSpeedRune(), "speed_rune");
efficiencyRune = (BlockEfficiencyRune) registerBlock(new BlockEfficiencyRune(), "efficiency_rune");
runeOfSacrifice = (BlockRuneOfSacrifice) registerBlock(new BlockRuneOfSacrifice(), "sacrifice_rune");
runeOfSelfSacrifice = (BlockRuneOfSelfSacrifice) registerBlock(new BlockRuneOfSelfSacrifice(), "self_sacrifice_rune");
blockTeleposer = registerBlock(new BlockTeleposer(), "teleposer");
spectralBlock = registerBlock(new BlockSpectral(), "spectral_block");
ritualStone = registerBlock(new BlockRitualStone(), "ritual_stone");
blockMasterStone = registerBlock(new BlockMasterStone(), "master_ritual_stone");
imperfectRitualStone = registerBlock(new BlockImperfectRitualStone(), "imperfect_ritual_stone");
emptySocket = registerBlock(new BlockEmptySocket(), "empty_socket");
bloodSocket = registerBlock(new BlockFilledSocket(), "filled_socket");
armourForge = registerBlock(new BlockArmourForge(), "soul_armour_forge");
largeBloodStoneBrick = registerBlock(new BlockLargeBloodStoneBrick(), "large_bloodstone_brick");
bloodStoneBrick = registerBlock(new BlockBloodStoneBrick(), "bloodstone_brick");
blockWritingTable = registerBlock(new BlockChemistrySet(), "chemistry_set");
blockSpellTable = registerBlock(new BlockSpellTable(), "spell_table");
blockPedestal = registerBlock(new BlockPedestal(), "pedestal");
blockPlinth = registerBlock(new BlockPlinth(), "plinth");
blockConduit = registerBlock(new BlockConduit(), "spell_conduit");
blockBloodLight = registerBlock(new BlockBloodLightSource(), "blood_light");
blockSpellEffect = registerBlock(new BlockSpellEffect(), "spell_effect");
blockSpellParadigm = registerBlock(new BlockSpellParadigm(), ItemSpellParadigmBlock.class, "spell_paradigm");
blockSpellModifier = registerBlock(new BlockSpellModifier(), ItemSpellEnhancementBlock.class, "spell_modifier");
blockSpellEnhancement = registerBlock(new BlockSpellEnhancement(), ItemSpellModifierBlock.class, "spell_enhancement");
blockSpectralContainer = registerBlock(new BlockSpectralContainer(), ItemSpellEffectBlock.class, "spectral_container");
blockDemonPortal = registerBlock(new BlockDemonPortal(), "demon_portal");
blockBuildingSchematicSaver = registerBlock(new BlockSchematicSaver(), "schematic_saver");
blockReagentConduit = registerBlock(new BlockReagentConduit(), "reagent_conduit");
blockAlchemicalCalcinator = registerBlock(new BlockAlchemicalCalcinator(), "alchemical_calcinator");
blockCrystalBelljar = registerBlock(new BlockBelljar(), ItemBlockCrystalBelljar.class, "belljar");
blockDemonChest = registerBlock(new BlockDemonChest(), "demon_chest");
blockCrystal = registerBlock(new BlockCrystal(), ItemCrystalBlock.class, "crystal_block");
blockMimic = registerBlock(new BlockMimic(), "mimic_block");
blockLifeEssence = registerBlock(new BlockLifeEssence(), "life_essence");
blockEnchantmentGlyph = registerBlock(new BlockEnchantmentGlyph(), ItemEnchantmentGlyphBlock.class, "enchantment_glyph");
blockStabilityGlyph = registerBlock(new BlockStabilityGlyph(), ItemStabilityGlyphBlock.class, "stability_glyph");
blockCrucible = registerBlock(new BlockIncenseCrucible(), "incense_crucible");
}
public static Block registerBlock(Block block, String unlocalizedName)
{
//TODO Insert Model Code here
block.setUnlocalizedName(unlocalizedName);
// if (!) //creative tab blacklist
// {
block.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
// }
blocksNotToBeRegistered.clear();
for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled)
{
if (unlocName.equals(unlocalizedName))
{
blocksNotToBeRegistered.add(unlocName);
}
}
if (!blocksNotToBeRegistered.contains(unlocalizedName))
{
GameRegistry.registerBlock(block, unlocalizedName);
}
// BlockRenderer.registerBlock(block);
return block;
}
public static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlockClass, String unlocalizedName)
{
block.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled)
{
if (unlocName.equals(unlocalizedName))
{
blocksNotToBeRegistered.add(unlocName);
}
}
if (!blocksNotToBeRegistered.contains(unlocalizedName))
{
GameRegistry.registerBlock(block, itemBlockClass, unlocalizedName);
}
// BlockRenderer.registerBlock(block);
return block;
}
}

View File

@ -1,406 +0,0 @@
package WayofTime.alchemicalWizardry;
import java.util.ArrayList;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
import WayofTime.alchemicalWizardry.api.spell.SpellParadigmTool;
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
import WayofTime.alchemicalWizardry.common.items.AirScribeTool;
import WayofTime.alchemicalWizardry.common.items.ApprenticeBloodOrb;
import WayofTime.alchemicalWizardry.common.items.ArchmageBloodOrb;
import WayofTime.alchemicalWizardry.common.items.ArmourInhibitor;
import WayofTime.alchemicalWizardry.common.items.BaseItems;
import WayofTime.alchemicalWizardry.common.items.BlankSpell;
import WayofTime.alchemicalWizardry.common.items.BloodShard;
import WayofTime.alchemicalWizardry.common.items.BoundAxe;
import WayofTime.alchemicalWizardry.common.items.BoundBlade;
import WayofTime.alchemicalWizardry.common.items.BoundPickaxe;
import WayofTime.alchemicalWizardry.common.items.BoundShovel;
import WayofTime.alchemicalWizardry.common.items.CreativeDagger;
import WayofTime.alchemicalWizardry.common.items.CreativeOrb;
import WayofTime.alchemicalWizardry.common.items.DaggerOfSacrifice;
import WayofTime.alchemicalWizardry.common.items.DawnScribeTool;
import WayofTime.alchemicalWizardry.common.items.DemonCrystal;
import WayofTime.alchemicalWizardry.common.items.DemonicTelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.DuskScribeTool;
import WayofTime.alchemicalWizardry.common.items.EarthScribeTool;
import WayofTime.alchemicalWizardry.common.items.EnergyBazooka;
import WayofTime.alchemicalWizardry.common.items.EnergyBlaster;
import WayofTime.alchemicalWizardry.common.items.EnhancedTelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.FireScribeTool;
import WayofTime.alchemicalWizardry.common.items.ItemAlchemyBase;
import WayofTime.alchemicalWizardry.common.items.ItemBloodLetterPack;
import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal;
import WayofTime.alchemicalWizardry.common.items.ItemComponents;
import WayofTime.alchemicalWizardry.common.items.ItemIncense;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDismantler;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
import WayofTime.alchemicalWizardry.common.items.KeyOfBinding;
import WayofTime.alchemicalWizardry.common.items.LavaCrystal;
import WayofTime.alchemicalWizardry.common.items.LifeBucket;
import WayofTime.alchemicalWizardry.common.items.MagicianBloodOrb;
import WayofTime.alchemicalWizardry.common.items.MasterBloodOrb;
import WayofTime.alchemicalWizardry.common.items.Orb;
import WayofTime.alchemicalWizardry.common.items.ReinforcedTelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.SacrificialDagger;
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.TranscendentBloodOrb;
import WayofTime.alchemicalWizardry.common.items.WaterScribeTool;
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourEarth;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourFire;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourWater;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourWind;
import WayofTime.alchemicalWizardry.common.items.energy.AlchemicalCleanser;
import WayofTime.alchemicalWizardry.common.items.energy.AlchemicalRouter;
import WayofTime.alchemicalWizardry.common.items.energy.AlchemicalSegmenter;
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyReagent;
import WayofTime.alchemicalWizardry.common.items.potion.AverageLengtheningCatalyst;
import WayofTime.alchemicalWizardry.common.items.potion.AveragePowerCatalyst;
import WayofTime.alchemicalWizardry.common.items.potion.CombinationalCatalyst;
import WayofTime.alchemicalWizardry.common.items.potion.EnhancedFillingAgent;
import WayofTime.alchemicalWizardry.common.items.potion.GreaterLengtheningCatalyst;
import WayofTime.alchemicalWizardry.common.items.potion.GreaterPowerCatalyst;
import WayofTime.alchemicalWizardry.common.items.potion.MundaneLengtheningCatalyst;
import WayofTime.alchemicalWizardry.common.items.potion.MundanePowerCatalyst;
import WayofTime.alchemicalWizardry.common.items.potion.StandardBindingAgent;
import WayofTime.alchemicalWizardry.common.items.potion.StandardFillingAgent;
import WayofTime.alchemicalWizardry.common.items.potion.WeakBindingAgent;
import WayofTime.alchemicalWizardry.common.items.potion.WeakFillingAgent;
import WayofTime.alchemicalWizardry.common.items.routing.InputRoutingFocus;
import WayofTime.alchemicalWizardry.common.items.routing.OutputRoutingFocus;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilAir;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilBloodLight;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilCompress;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilFluid;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilHarvest;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilLava;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfElementalAffinity;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfEnderSeverance;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfGrowth;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHaste;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfMagnetism;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfSupression;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheAssassin;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheBridge;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheFastMiner;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfWind;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilSeer;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilVoid;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilWater;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
/**
* Created with IntelliJ IDEA.
* User: Pokefenn
* Date: 17/01/14
* Time: 19:48
*/
public class ModItems
{
public static Item weakBloodOrb;
public static Item apprenticeBloodOrb;
public static Item magicianBloodOrb;
public static Item energyBlaster;
public static Item energySword;
public static Item lavaCrystal;
public static Item waterSigil;
public static Item lavaSigil;
public static Item voidSigil;
public static Item blankSlate;
public static Item reinforcedSlate;
public static Item sacrificialDagger;
public static Item daggerOfSacrifice;
public static Item airSigil;
public static Item sigilOfTheFastMiner;
public static Item sigilOfElementalAffinity;
public static Item sigilOfHaste;
public static Item sigilOfHolding;
public static Item divinationSigil;
public static Item waterScribeTool;
public static Item fireScribeTool;
public static Item earthScribeTool;
public static Item airScribeTool;
public static Item dawnScribeTool;
public static Item activationCrystal;
public static Item boundPickaxe;
public static Item boundAxe;
public static Item boundShovel;
public static Item boundHelmet;
public static Item boundChestplate;
public static Item boundLeggings;
public static Item boundBoots;
public static Item weakBloodShard;
public static Item growthSigil;
public static Item blankSpell;
public static Item masterBloodOrb;
public static Item alchemyFlask;
public static Item standardBindingAgent;
public static Item mundanePowerCatalyst;
public static Item averagePowerCatalyst;
public static Item greaterPowerCatalyst;
public static Item mundaneLengtheningCatalyst;
public static Item averageLengtheningCatalyst;
public static Item greaterLengtheningCatalyst;
public static Item incendium;
public static Item magicales;
public static Item sanctus;
public static Item aether;
public static Item simpleCatalyst;
public static Item crepitous;
public static Item crystallos;
public static Item terrae;
public static Item aquasalus;
public static Item tennebrae;
public static Item demonBloodShard;
public static Item archmageBloodOrb;
public static Item sigilOfWind;
public static Item telepositionFocus;
public static Item enhancedTelepositionFocus;
public static Item reinforcedTelepositionFocus;
public static Item demonicTelepositionFocus;
public static Item imbuedSlate;
public static Item demonicSlate;
public static Item duskScribeTool;
public static Item sigilOfTheBridge;
public static Item armourInhibitor;
public static Item creativeFiller;
public static Item demonPlacer;
public static Item creativeDagger;
public static Item baseItems;
public static Item baseAlchemyItems;
public static Item weakFillingAgent;
public static Item standardFillingAgent;
public static Item enhancedFillingAgent;
public static Item weakBindingAgent;
public static Item itemRitualDiviner;
public static Item sanguineHelmet;
public static Item sanguineRobe;
public static Item sanguinePants;
public static Item sanguineBoots;
public static Item focusBloodBlast;
public static Item focusGravityWell;
public static Item sigilOfMagnetism;
public static Item itemKeyOfDiablo;
public static Item energyBazooka;
public static Item itemBloodLightSigil;
public static Item itemComplexSpellCrystal;
public static Item itemBloodFrame;
public static Item itemSigilOfEnderSeverance;
public static Item itemSigilOfSupression;
public static Item itemFluidSigil;
public static Item itemSeerSigil;
public static Item itemCombinationalCatalyst;
public static ItemSpellMultiTool customTool;
public static Item itemAttunedCrystal;
public static Item itemTankSegmenter;
public static Item itemDestinationClearer;
public static Item itemHarvestSigil;
public static Item itemCompressionSigil;
public static Item bucketLife;
public static Item itemBloodPack;
public static Item transcendentBloodOrb;
public static Item itemAssassinSigil;
public static Item boundHelmetWater;
public static Item boundChestplateWater;
public static Item boundLeggingsWater;
public static Item boundBootsWater;
public static Item boundHelmetEarth;
public static Item boundChestplateEarth;
public static Item boundLeggingsEarth;
public static Item boundBootsEarth;
public static Item boundHelmetWind;
public static Item boundChestplateWind;
public static Item boundLeggingsWind;
public static Item boundBootsWind;
public static Item boundHelmetFire;
public static Item boundChestplateFire;
public static Item boundLeggingsFire;
public static Item boundBootsFire;
public static Item inputRoutingFocus;
public static Item outputRoutingFocus;
public static Item itemMailCatalogue;
public static Item itemIncense;
public static Item ritualDismantler;
public static ArrayList<String> itemsNotToBeRegistered = new ArrayList<String>();
public static void init()
{
weakBloodOrb = registerItem(new Orb(5000), "weak_blood_orb");
apprenticeBloodOrb = registerItem(new ApprenticeBloodOrb(25000), "apprentice_blood_orb");
magicianBloodOrb = registerItem(new MagicianBloodOrb(150000), "magician_blood_orb");
masterBloodOrb = registerItem(new MasterBloodOrb(1000000), "master_blood_orb");
archmageBloodOrb = registerItem(new ArchmageBloodOrb(10000000), "archmage_blood_orb");
transcendentBloodOrb = registerItem(new TranscendentBloodOrb(30000000), "transcendent_blood_orb");
energyBlaster = registerItem(new EnergyBlaster(), "energy_blaster");
energySword = registerItem(new BoundBlade(), "bound_blade");
lavaCrystal = registerItem(new LavaCrystal(), "lava_crystal");
waterSigil = registerItem(new SigilWater(), "water_sigil");
lavaSigil = registerItem(new SigilLava(), "lava_sigil");
voidSigil = registerItem(new SigilVoid(), "void_sigil");
blankSlate = registerItem(new BaseItems(), "blank_slate");
reinforcedSlate = registerItem(new BaseItems(), "reinforced_slate");
sacrificialDagger = registerItem(new SacrificialDagger(), "sacrificial_dagger");
daggerOfSacrifice = registerItem(new DaggerOfSacrifice(), "dagger_of_sacrifice");
airSigil = registerItem(new SigilAir(), "air_sigil");
sigilOfTheFastMiner = registerItem(new SigilOfTheFastMiner(), "sigil_of_the_fast_miner");
sigilOfElementalAffinity = registerItem(new SigilOfElementalAffinity(), "sigil_of_elemental_affinity");
sigilOfHaste = registerItem(new SigilOfHaste(), "sigil_of_haste");
sigilOfHolding = registerItem(new SigilOfHolding(), "sigil_of_holding");
divinationSigil = registerItem(new SigilDivination(), "divination_sigil");
waterScribeTool = registerItem(new WaterScribeTool(), "water_scribe_tool");
fireScribeTool = registerItem(new FireScribeTool(), "fire_scribe_tool");
earthScribeTool = registerItem(new EarthScribeTool(), "earth_scribe_tool");
airScribeTool = registerItem(new AirScribeTool(), "air_scribe_tool");
activationCrystal = registerItem(new ActivationCrystal(), "activation_crystal");
boundPickaxe = registerItem(new BoundPickaxe(), "bound_pickaxe");
boundAxe = registerItem(new BoundAxe(), "bound_axe");
boundShovel = registerItem(new BoundShovel(), "bound_shovel");
boundHelmet = registerItem(new BoundArmour(0), "bound_helmet");
boundChestplate = registerItem(new BoundArmour(1), "bound_chestplate");
boundLeggings = registerItem(new BoundArmour(2), "bound_leggings");
boundBoots = registerItem(new BoundArmour(3), "bound_boots");
weakBloodShard = registerItem(new BloodShard(), "weak_blood_shard");
growthSigil = registerItem(new SigilOfGrowth(), "growth_sigil");
blankSpell = registerItem(new BlankSpell(), "blank_spell");
alchemyFlask = registerItem(new AlchemyFlask(), "alchemy_flask");
standardBindingAgent = registerItem(new StandardBindingAgent(), "standard_binding_agent");
mundanePowerCatalyst = registerItem(new MundanePowerCatalyst(), "mundane_power_catalyst");
averagePowerCatalyst = registerItem(new AveragePowerCatalyst(), "average_power_catalyst");
greaterPowerCatalyst = registerItem(new GreaterPowerCatalyst(), "greater_power_catalyst");
mundaneLengtheningCatalyst = registerItem(new MundaneLengtheningCatalyst(), "mundane_lengthening_catalyst");
averageLengtheningCatalyst = registerItem(new AverageLengtheningCatalyst(), "average_lengthening_catalyst");
greaterLengtheningCatalyst = registerItem(new GreaterLengtheningCatalyst(), "greater_lengthening_catalyst");
incendium = registerItem(new AlchemyReagent(), "incendium");
magicales = registerItem(new AlchemyReagent(), "magicales");
sanctus = registerItem(new AlchemyReagent(), "sanctus");
aether = registerItem(new AlchemyReagent(), "aether");
simpleCatalyst = registerItem(new AlchemyReagent(), "simple_catalyst");
crepitous = registerItem(new AlchemyReagent(), "crepitous");
crystallos = registerItem(new AlchemyReagent(), "crystallos");
terrae = registerItem(new AlchemyReagent(), "terrae");
aquasalus = registerItem(new AlchemyReagent(), "aquasalus");
tennebrae = registerItem(new AlchemyReagent(), "tennebrae");
demonBloodShard = registerItem(new BloodShard(), "demon_blood_shard");
sigilOfWind = registerItem(new SigilOfWind(), "sigil_of_wind");
telepositionFocus = registerItem(new TelepositionFocus(1), "teleposition_focus");
enhancedTelepositionFocus = registerItem(new EnhancedTelepositionFocus(), "enhanced_teleposition_focus");
reinforcedTelepositionFocus = registerItem(new ReinforcedTelepositionFocus(), "reinforced_teleposition_focus");
demonicTelepositionFocus = registerItem(new DemonicTelepositionFocus(), "demonic_teleposition_focus");
imbuedSlate = registerItem(new BaseItems(), "imbued_slate");
demonicSlate = registerItem(new BaseItems(), "demonic_slate");
duskScribeTool = registerItem(new DuskScribeTool(), "dusk_scribe_tool");
sigilOfTheBridge = registerItem(new SigilOfTheBridge(), "sigil_of_the_bridge");
armourInhibitor = registerItem(new ArmourInhibitor(), "armour_inhibitor");
creativeFiller = registerItem(new CreativeOrb(), "creative_orb");
demonPlacer = registerItem(new DemonCrystal(), "demon_crystal");
creativeDagger = registerItem(new CreativeDagger(), "creative_dagger");
weakFillingAgent = registerItem(new WeakFillingAgent(), "weak_filling_agent");
standardFillingAgent = registerItem(new StandardFillingAgent(), "standard_filling_agent");
enhancedFillingAgent = registerItem(new EnhancedFillingAgent(), "enhanced_filling_agent");
weakBindingAgent = registerItem(new WeakBindingAgent(), "weak_binding_agent");
itemRitualDiviner = registerItem(new ItemRitualDiviner(), "ritual_diviner");
sigilOfMagnetism = registerItem(new SigilOfMagnetism(), "sigil_of_magnetism");
itemKeyOfDiablo = registerItem(new KeyOfBinding(), "key_of_binding");
energyBazooka = registerItem(new EnergyBazooka(), "energy_bazooka");
itemBloodLightSigil = registerItem(new SigilBloodLight(), "blood_light_sigil");
itemComplexSpellCrystal = registerItem(new ItemComplexSpellCrystal(), "complex_spell_crystal");
bucketLife = registerItem(new LifeBucket(ModBlocks.blockLifeEssence), "bucket_life").setContainerItem(Items.bucket).setCreativeTab(CreativeTabs.tabMisc);
itemSigilOfEnderSeverance = registerItem(new SigilOfEnderSeverance(), "sigil_of_ender_severance");
baseItems = registerItem(new ItemComponents(), "base_items");
baseAlchemyItems = registerItem(new ItemAlchemyBase(), "base_alchemy_items");
itemSigilOfSupression = registerItem(new SigilOfSupression(), "sigil_of_suppression");
itemFluidSigil = registerItem(new SigilFluid(), "fluid_sigil");
itemSeerSigil = registerItem(new SigilSeer(), "sigil_of_sight");
customTool = (ItemSpellMultiTool) registerItem(new ItemSpellMultiTool(), "multi_tool");
SpellParadigmTool.customTool = customTool;
itemCombinationalCatalyst = registerItem(new CombinationalCatalyst(), "combinational_catalyst");
itemAttunedCrystal = registerItem(new AlchemicalRouter(), "alchemical_router");
itemTankSegmenter = registerItem(new AlchemicalSegmenter(), "alchemical_segmenter");
itemDestinationClearer = registerItem(new AlchemicalCleanser(), "alchemical_cleanser");
dawnScribeTool = registerItem(new DawnScribeTool(), "dawn_scribe_tool");
itemBloodPack = registerItem(new ItemBloodLetterPack(), "blood_pack");
itemHarvestSigil = registerItem(new SigilHarvest(), "harvest_sigil");
itemCompressionSigil = registerItem(new SigilCompress(), "compression_sigil");
itemAssassinSigil = registerItem(new SigilOfTheAssassin(), "assassin_sigil");
boundHelmetWater = registerItem(new OmegaArmourWater(0), "bound_helmet_water");
boundChestplateWater = registerItem(new OmegaArmourWater(1), "bound_chestplate_water");
boundLeggingsWater = registerItem(new OmegaArmourWater(2), "bound_leggings_water");
boundBootsWater = registerItem(new OmegaArmourWater(3), "bound_boots_water");
boundHelmetEarth = registerItem(new OmegaArmourEarth(0), "bound_helmet_earth");
boundChestplateEarth = registerItem(new OmegaArmourEarth(1), "bound_chestplate_earth");
boundLeggingsEarth = registerItem(new OmegaArmourEarth(2), "bound_leggings_earth");
boundBootsEarth = registerItem(new OmegaArmourEarth(3), "bound_boots_earth");
boundHelmetWind = registerItem(new OmegaArmourWind(0), "bound_helmet_wind");
boundChestplateWind = registerItem(new OmegaArmourWind(1), "bound_chestplate_wind");
boundLeggingsWind = registerItem(new OmegaArmourWind(2), "bound_leggings_wind");
boundBootsWind = registerItem(new OmegaArmourWind(3), "bound_boots_wind");
boundHelmetFire = registerItem(new OmegaArmourFire(0), "bound_helmet_fire");
boundChestplateFire = registerItem(new OmegaArmourFire(1), "bound_chestplate_fire");
boundLeggingsFire = registerItem(new OmegaArmourFire(2), "bound_leggings_fire");
boundBootsFire = registerItem(new OmegaArmourFire(3), "bound_boots_fire");
inputRoutingFocus = registerItem(new InputRoutingFocus(), "input_routing_focus");
outputRoutingFocus = registerItem(new OutputRoutingFocus(), "output_routing_focus");
itemIncense = registerItem(new ItemIncense(), "incense");
ritualDismantler = registerItem(new ItemRitualDismantler(), "ritual_dismantler");
}
public static Item registerItem(Item item, String unlocalizedName)
{
item.setUnlocalizedName(unlocalizedName);
item.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
// itemsNotToBeRegistered.clear();
// for (String unlocName : BloodMagicConfiguration.itemsToBeDisabled)
{
// if (unlocName.equals(unlocalizedName))
{
// itemsNotToBeRegistered.add(unlocName);
}
}
// if (!itemsNotToBeRegistered.contains(unlocalizedName))
{
GameRegistry.registerItem(item, unlocalizedName);
}
return item;
}
}

View File

@ -0,0 +1,131 @@
package WayofTime.alchemicalWizardry.altar;
import WayofTime.alchemicalWizardry.api.BlockStack;
import WayofTime.alchemicalWizardry.api.altar.AltarComponent;
import WayofTime.alchemicalWizardry.api.iface.IAltarComponent;
import WayofTime.alchemicalWizardry.api.enumeration.EnumAltarComponent;
import WayofTime.alchemicalWizardry.api.enumeration.EnumAltarTier;
import net.minecraft.block.BlockBeacon;
import net.minecraft.block.BlockGlowstone;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
public class BloodAltar {
public static EnumAltarTier getAltarTier(World world, BlockPos pos) {
for (int i = EnumAltarTier.MAXTIERS; i >= 2; i--)
if (checkAltarIsValid(world, pos, i))
return EnumAltarTier.values()[i];
return EnumAltarTier.ONE;
}
public static boolean checkAltarIsValid(World world, BlockPos worldPos, int altarTier) {
for (AltarComponent altarComponent : EnumAltarTier.values()[altarTier].getAltarComponents()) {
BlockPos componentPos = worldPos.add(altarComponent.getOffset());
BlockStack worldBlock = new BlockStack(world.getBlockState(componentPos).getBlock(), world.getBlockState(componentPos).getBlock().getMetaFromState(world.getBlockState(componentPos)));
if (altarComponent.isBloodRune()) {
if (!checkRune(altarComponent, worldBlock))
return false;
} else {
if (((altarComponent.getBlockStack().getBlock() != worldBlock.getBlock()) || (altarComponent.getBlockStack().getMeta() != worldBlock.getMeta())) && (altarComponent.getBlockStack().getBlock() == Blocks.air && !world.isAirBlock(componentPos)))
if (!checkSpecials(altarComponent, worldBlock))
return false;
}
}
return true;
}
// public static AltarUpgrade getUpgrades(World world, BlockPos pos, int altarTier) {
// if(world.isRemote)
// return null;
//
// AltarUpgrade upgrades = new AltarUpgrade();
// List<AltarComponent> list = EnumAltarTier.values()[altarTier].getAltarComponents();
//
// for (AltarComponent altarComponent : list) {
// BlockPos componentPos = pos.add(altarComponent.getOffset());
//
// if (altarComponent.isUpgradeSlot()) {
// BlockStack worldBlock = new BlockStack(world.getBlockState(componentPos).getBlock(), world.getBlockState(componentPos).getBlock().getMetaFromState(world.getBlockState(componentPos)));
//
// if (worldBlock.getBlock() instanceof BlockBloodRune) {
// if (worldBlock.getBlock() instanceof IFadedRune && altarTier > ((IFadedRune)worldBlock.getBlock()).getAltarTierLimit(worldBlock.getMeta()))
// return getUpgrades(world, pos, ((IFadedRune) worldBlock.getBlock()).getAltarTierLimit(worldBlock.getMeta()));
//
// switch (((BlockBloodRune) worldBlock.getBlock()).getRuneEffect(worldBlock.getMeta())) {
// case 1:
// upgrades.addSpeed();
// break;
//
// case 2:
// upgrades.addEfficiencyUpgrade();
// break;
//
// case 3:
// upgrades.addSacrificeUpgrade();
// break;
//
// case 4:
// upgrades.addSelfSacrificeUpgrade();
// break;
//
// case 5:
// upgrades.addaltarCapacitiveUpgrade();
// break;
//
// case 6:
// upgrades.addDisplacementUpgrade();
// break;
//
// case 7:
// upgrades.addorbCapacitiveUpgrade();
// break;
//
// case 8:
// upgrades.addBetterCapacitiveUpgrade();
// break;
//
// case 9:
// upgrades.addAccelerationUpgrade();
// break;
// }
// }
// }
// }
//
// return upgrades;
// }
private static boolean checkRune(AltarComponent altarComponent, BlockStack blockStack) {
// if (altarComponent.getBlockStack().getBlock() == ModBlocks.rune)
// if (blockStack.getBlock() instanceof BlockBloodRune || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType(blockStack.getMeta()) == EnumAltarComponent.BLOODRUNE)))
// return true;
return false;
}
private static boolean checkSpecials(AltarComponent altarComponent, BlockStack blockStack) {
// if (altarComponent.getBlockStack().getBlock() == ModBlocks.bloodStone)
// if (blockStack.getBlock() instanceof BlockBloodStone || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType(blockStack.getMeta()) == EnumAltarComponent.BLOODSTONE)))
// return true;
// if (altarComponent.getBlockStack().getBlock() == ModBlocks.crystal)
// if (blockStack.getBlock() instanceof BlockCrystal || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType(blockStack.getMeta()) == EnumAltarComponent.CRYSTAL)))
// return true;
if (altarComponent.getBlockStack().getBlock() == Blocks.glowstone)
if (blockStack.getBlock() instanceof BlockGlowstone || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType(blockStack.getMeta()) == EnumAltarComponent.GLOWSTONE)))
return true;
if (altarComponent.getBlockStack().getBlock() == Blocks.beacon)
if (blockStack.getBlock() instanceof BlockBeacon || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType(blockStack.getMeta()) == EnumAltarComponent.BEACON)))
return true;
return false;
}
}

View File

@ -0,0 +1,26 @@
package WayofTime.alchemicalWizardry.api;
import WayofTime.alchemicalWizardry.api.util.helper.LogHelper;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.item.Item;
import net.minecraft.util.DamageSource;
import net.minecraftforge.fluids.Fluid;
public class AlchemicalWizardryAPI {
@Getter @Setter
private static boolean loggingEnabled;
@Getter
private static LogHelper logger = new LogHelper("AlchemicalWizardry|API");
@Getter
private static DamageSource damageSource = new DamageSourceBloodMagic();
@Getter @Setter
private static Item orbItem;
@Getter @Setter
private static Fluid lifeEssence;
}

View File

@ -0,0 +1,28 @@
package WayofTime.alchemicalWizardry.api;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import net.minecraft.block.Block;
import net.minecraftforge.fml.common.registry.GameData;
@Getter
@EqualsAndHashCode
public class BlockStack {
private final Block block;
private final int meta;
public BlockStack(Block block, int meta) {
this.block = block;
this.meta = meta;
}
public BlockStack(Block block) {
this(block, 0);
}
@Override
public String toString() {
return GameData.getBlockRegistry().getNameForObject(block) + ":" + meta;
}
}

View File

@ -1,45 +0,0 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.nbt.NBTTagCompound;
public class ColourAndCoords
{
public int colourRed;
public int colourGreen;
public int colourBlue;
public int colourIntensity;
public int xCoord;
public int yCoord;
public int zCoord;
public ColourAndCoords(int red, int green, int blue, int intensity, int x, int y, int z)
{
this.colourRed = red;
this.colourGreen = green;
this.colourBlue = blue;
this.colourIntensity = intensity;
this.xCoord = x;
this.yCoord = y;
this.zCoord = z;
}
public static ColourAndCoords readFromNBT(NBTTagCompound tag)
{
return new ColourAndCoords(tag.getInteger("colourRed"), tag.getInteger("colourGreen"), tag.getInteger("colourBlue"), tag.getInteger("colourIntensity"), tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord"));
}
public NBTTagCompound writeToNBT(NBTTagCompound tag)
{
tag.setInteger("colourRed", colourRed);
tag.setInteger("colourGreen", colourGreen);
tag.setInteger("colourBlue", colourBlue);
tag.setInteger("colourIntensity", colourIntensity);
tag.setInteger("xCoord", xCoord);
tag.setInteger("yCoord", yCoord);
tag.setInteger("zCoord", zCoord);
return tag;
}
}

View File

@ -0,0 +1,12 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.util.DamageSource;
public class DamageSourceBloodMagic extends DamageSource {
public DamageSourceBloodMagic() {
super("bloodMagic");
setDamageBypassesArmor();
}
}

View File

@ -1,6 +0,0 @@
package WayofTime.alchemicalWizardry.api;
public interface ILimitingLogic
{
int getRoutingLimit();
}

View File

@ -1,49 +0,0 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
public class Int3
{
public int xCoord;
public int yCoord;
public int zCoord;
public Int3(BlockPos pos)
{
this(pos.getX(), pos.getY(), pos.getZ());
}
public Int3(int xCoord, int yCoord, int zCoord)
{
this.xCoord = xCoord;
this.yCoord = yCoord;
this.zCoord = zCoord;
}
public static Int3 readFromNBT(NBTTagCompound tag)
{
return new Int3(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord"));
}
public NBTTagCompound writeToNBT(NBTTagCompound tag)
{
tag.setInteger("xCoord", xCoord);
tag.setInteger("yCoord", yCoord);
tag.setInteger("zCoord", zCoord);
return tag;
}
@Override
public boolean equals(Object o)
{
return o instanceof Int3 ? ((Int3) o).xCoord == this.xCoord && ((Int3) o).yCoord == this.yCoord && ((Int3) o).zCoord == this.zCoord : false;
}
@Override
public int hashCode()
{
return this.xCoord + this.yCoord << 8 + this.zCoord << 16;
}
}

View File

@ -0,0 +1,24 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class NBTHolder {
public static final String NBT_OWNER = "ownerName";
public static final String NBT_USES = "uses";
public static final String NBT_SACRIFICE = "sacrifice";
public static final String NBT_DIMID = "dimensionId";
public static final String NBT_COORDX = "xCoord";
public static final String NBT_COORDY = "yCoord";
public static final String NBT_COORDZ = "zCoord";
public static final String NBT_MAXORB = "maxOrb";
public static final String NBT_CURRENTESSENCE = "currentEssence";
public static ItemStack checkNBT(ItemStack stack) {
if (stack.getTagCompound() == null)
stack.setTagCompound(new NBTTagCompound());
return stack;
}
}

View File

@ -1,16 +0,0 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.item.ItemStack;
public class RoutingFocusLogic
{
public boolean getDefaultMatch(ItemStack keyStack, ItemStack checkedStack)
{
return (keyStack != null ? checkedStack != null && keyStack.getItem() == checkedStack.getItem() && (keyStack.getItem().getHasSubtypes() ? keyStack.getItemDamage() == checkedStack.getItemDamage() : true) : false);
}
public boolean doesItemMatch(boolean previous, ItemStack keyStack, ItemStack checkedStack)
{
return previous || this.getDefaultMatch(keyStack, checkedStack);
}
}

View File

@ -1,64 +0,0 @@
package WayofTime.alchemicalWizardry.api;
import java.util.LinkedList;
import java.util.List;
import net.minecraft.item.ItemStack;
public class RoutingFocusParadigm
{
public List<RoutingFocusLogic> logicList = new LinkedList<RoutingFocusLogic>();
public List<RoutingFocusPosAndFacing> locationList = new LinkedList<RoutingFocusPosAndFacing>();
public int maximumAmount = 0;
public void addRoutingFocusPosAndFacing(RoutingFocusPosAndFacing facing)
{
locationList.add(facing);
}
public void addLogic(RoutingFocusLogic logic)
{
if(logic instanceof ILimitingLogic)
{
maximumAmount += ((ILimitingLogic)logic).getRoutingLimit();
}
logicList.add(logic);
}
public boolean doesItemMatch(ItemStack keyStack, ItemStack checkedStack)
{
boolean isGood = false;
boolean isFirst = true;
for(RoutingFocusLogic logic : logicList)
{
if(isFirst)
{
isGood = logic.getDefaultMatch(keyStack, checkedStack);
isFirst = false;
continue;
}
isGood = logic.doesItemMatch(isGood, keyStack, checkedStack);
}
return isGood;
}
public void clear()
{
logicList.clear();
locationList.clear();
maximumAmount = 0;
}
public void setMaximumAmount(int amt)
{
this.maximumAmount = amt;
}
public int getMaximumAmount()
{
return this.maximumAmount;
}
}

View File

@ -1,21 +0,0 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.util.EnumFacing;
public class RoutingFocusPosAndFacing
{
public Int3 location;
public EnumFacing facing;
public RoutingFocusPosAndFacing(Int3 location, EnumFacing facing)
{
this.location = location;
this.facing = facing;
}
@Override
public boolean equals(Object obj)
{
return obj instanceof RoutingFocusPosAndFacing ? facing.equals(((RoutingFocusPosAndFacing)obj).facing) && location.equals(((RoutingFocusPosAndFacing)obj).location) : false;
}
}

View File

@ -1,45 +0,0 @@
package WayofTime.alchemicalWizardry.api;
/*
* Created in Scala by Alex-Hawks
* Translated and implemented by Arcaratus
*/
public class Vector3
{
public int x, y, z;
public Vector3(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
public Vector3 add(Vector3 vec1)
{
return new Vector3(this.x + vec1.x, this.y + vec1.y, this.z + vec1.z);
}
@Override
public String toString()
{
return "V3(" + x + "}, " + y + "}," + z + "})";
}
private boolean canEqual(Object object)
{
return object instanceof Vector3;
}
@Override
public boolean equals(Object object)
{
return object == this || object instanceof Vector3 && canEqual(this) && this.x == ((Vector3) object).x && this.y == ((Vector3) object).y && this.z == ((Vector3) object).z;
}
@Override
public int hashCode()
{
return 48131 * x - 95021 * y + z;
}
}

View File

@ -1,79 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
public class AlchemicalPotionCreationHandler
{
public static ArrayList<AlchemyPotionHandlerComponent> registeredPotionEffects = new ArrayList<AlchemyPotionHandlerComponent>();
public static void addPotion(ItemStack itemStack, int potionID, int tickDuration)
{
registeredPotionEffects.add(new AlchemyPotionHandlerComponent(itemStack, potionID, tickDuration));
}
public static int getPotionIDForStack(ItemStack itemStack)
{
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
{
if (aphc.compareItemStack(itemStack))
{
return aphc.getPotionID();
}
}
return -1;
}
public static int getPotionTickDurationForStack(ItemStack itemStack)
{
{
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
{
if (aphc.compareItemStack(itemStack))
{
return aphc.getTickDuration();
}
}
return -1;
}
}
public static boolean containsRegisteredPotionIngredient(ItemStack[] stackList)
{
for (ItemStack is : stackList)
{
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
{
if (aphc.compareItemStack(is))
{
return true;
}
}
}
return false;
}
public static int getRegisteredPotionIngredientPosition(ItemStack[] stackList)
{
int i = 0;
for (ItemStack is : stackList)
{
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
{
if (aphc.compareItemStack(is))
{
return i;
}
}
i++;
}
return -1;
}
}

View File

@ -1,52 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class AlchemyPotionHandlerComponent
{
private ItemStack itemStack;
private int potionID;
private int tickDuration;
public AlchemyPotionHandlerComponent(ItemStack itemStack, int potionID, int tickDuration)
{
this.itemStack = itemStack;
this.potionID = potionID;
this.tickDuration = tickDuration;
}
public boolean compareItemStack(ItemStack comparedStack)
{
if (comparedStack != null && itemStack != null)
{
if (comparedStack.getItem() instanceof ItemBlock)
{
if (itemStack.getItem() instanceof ItemBlock)
{
return comparedStack.getItem().equals(itemStack.getItem()) && comparedStack.getItemDamage() == itemStack.getItemDamage();
}
} else if (!(itemStack.getItem() instanceof ItemBlock))
{
return comparedStack.getItem().equals(itemStack.getItem()) && comparedStack.getItemDamage() == itemStack.getItemDamage();
}
}
return false;
}
public ItemStack getItemStack()
{
return itemStack;
}
public int getPotionID()
{
return this.potionID;
}
public int getTickDuration()
{
return this.tickDuration;
}
}

View File

@ -1,76 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
public class AlchemyPotionHelper
{
private int potionID;
private int tickDuration;
private int concentration;
private int durationFactor;
public AlchemyPotionHelper(int potionID, int tickDuration, int concentration, int durationFactor)
{
this.potionID = potionID;
this.tickDuration = tickDuration;
this.concentration = concentration;
this.durationFactor = durationFactor;
}
public void setConcentration(int concentration)
{
this.concentration = concentration;
}
public void setDurationFactor(int durationFactor)
{
this.durationFactor = durationFactor;
}
public int getPotionID()
{
return this.potionID;
}
public int getTickDuration()
{
return this.tickDuration;
}
public int getConcentration()
{
return this.concentration;
}
public int getdurationFactor()
{
return this.durationFactor;
}
public PotionEffect getPotionEffect()
{
if (potionID == Potion.heal.id || potionID == Potion.harm.id)
{
return (new PotionEffect(potionID, 1, concentration));
}
return (new PotionEffect(potionID, (int) (tickDuration * Math.pow(0.5f, concentration) * Math.pow(8.0f / 3.0f, durationFactor)), concentration));
}
public static AlchemyPotionHelper readEffectFromNBT(NBTTagCompound tagCompound)
{
return new AlchemyPotionHelper(tagCompound.getInteger("potionID"), tagCompound.getInteger("tickDuration"), tagCompound.getInteger("concentration"), tagCompound.getInteger("durationFactor"));
}
public static NBTTagCompound setEffectToNBT(AlchemyPotionHelper aph)
{
NBTTagCompound tagCompound = new NBTTagCompound();
tagCompound.setInteger("potionID", aph.getPotionID());
tagCompound.setInteger("tickDuration", aph.getTickDuration());
tagCompound.setInteger("concentration", aph.getConcentration());
tagCompound.setInteger("durationFactor", aph.getdurationFactor());
return tagCompound;
}
}

View File

@ -1,143 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class AlchemyRecipe
{
private ItemStack output;
private ItemStack[] recipe;
private int bloodOrbLevel;
private int amountNeeded;
public AlchemyRecipe(ItemStack output, int amountNeeded, ItemStack[] recipe, int bloodOrbLevel)
{
this.output = output;
this.recipe = recipe;
this.amountNeeded = amountNeeded;
this.bloodOrbLevel = bloodOrbLevel;
}
public boolean doesRecipeMatch(ItemStack[] items, int slottedBloodOrbLevel)
{
if (slottedBloodOrbLevel < bloodOrbLevel)
{
return false;
}
ItemStack[] recipe;
if (items.length < 5)
{
return false;
}
if (this.recipe.length != 5)
{
ItemStack[] newRecipe = new ItemStack[5];
for (int i = 0; i < 5; 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];
if (recipeItemStack == null)
{
continue;
}
boolean test = false;
for (int j = 0; j < 5; j++)
{
if (checkList[j])
{
continue;
}
ItemStack checkedItemStack = items[j];
if (checkedItemStack == null)
{
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() || OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage()) && checkedItemStack.getItem() == recipeItemStack.getItem())
{
test = true;
checkList[j] = true;
break;
}
}
if (!test)
{
return false;
}
}
return true;
}
public ItemStack getResult()
{
return output.copy();
}
public int getAmountNeeded()
{
return this.amountNeeded;
}
public ItemStack[] getRecipe()
{
return this.recipe;
}
public int getOrbLevel()
{
return this.bloodOrbLevel;
}
}

View File

@ -1,85 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class AlchemyRecipeRegistry
{
public static List<AlchemyRecipe> recipes = new ArrayList<AlchemyRecipe>();
public static void registerRecipe(ItemStack output, int amountNeeded, ItemStack[] recipe, int bloodOrbLevel)
{
recipes.add(new AlchemyRecipe(output, amountNeeded, recipe, bloodOrbLevel));
}
public static ItemStack getResult(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 : recipes)
{
if (ar.doesRecipeMatch(recipe, bloodOrbLevel))
{
return (ar.getResult());
}
}
return null;
}
public static int getAmountNeeded(ItemStack[] recipe, ItemStack bloodOrb)
{
if (bloodOrb == null)
{
return 0;
}
if (!(bloodOrb.getItem() instanceof IBloodOrb))
{
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)
{
for (AlchemyRecipe ar : recipes)
{
ItemStack result = ar.getResult();
if (result != null)
{
if (result.isItemEqual(itemStack))
{
return ar.getRecipe();
}
}
}
return null;
}
}

View File

@ -1,10 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface IAlchemyGoggles
{
boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player);
}

View File

@ -1,16 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
public interface IReagentContainer
{
ReagentStack getReagent();
int getReagentStackAmount();
int getCapacity();
int fill(ReagentStack resource, boolean doFill);
ReagentStack drain(int maxDrain, boolean doDrain);
ReagentContainerInfo getInfo();
}

View File

@ -1,18 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import net.minecraft.util.EnumFacing;
public interface IReagentHandler
{
int fill(EnumFacing from, ReagentStack resource, boolean doFill);
ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain);
ReagentStack drain(EnumFacing from, int maxDrain, boolean doDrain);
boolean canFill(EnumFacing from, Reagent reagent);
boolean canDrain(EnumFacing from, Reagent reagent);
ReagentContainerInfo[] getContainerInfo(EnumFacing from);
}

View File

@ -1,14 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import java.util.Map;
public interface ISegmentedReagentHandler extends IReagentHandler
{
int getNumberOfTanks();
int getTanksTunedToReagent(Reagent reagent);
void setTanksTunedToReagent(Reagent reagent, int total);
Map<Reagent, Integer> getAttunedTankMap();
}

View File

@ -1,52 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
public class Reagent
{
public final String name;
public static final int REAGENT_SIZE = 1000;
private int colourRed = 0;
private int colourGreen = 0;
private int colourBlue = 0;
private int colourIntensity = 255;
public Reagent(String name)
{
this.name = name;
}
public void setColour(int red, int green, int blue, int intensity)
{
this.colourRed = red;
this.colourGreen = green;
this.colourBlue = blue;
this.colourIntensity = intensity;
}
public int getColourRed()
{
return colourRed;
}
public int getColourGreen()
{
return colourGreen;
}
public int getColourBlue()
{
return colourBlue;
}
public int getColourIntensity()
{
return colourIntensity;
}
@Override
public boolean equals(Object o)
{
return o instanceof Reagent && this == o && name.equals(((Reagent) o).name);
}
}

View File

@ -1,153 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import net.minecraft.nbt.NBTTagCompound;
public class ReagentContainer implements IReagentContainer
{
protected ReagentStack reagentStack;
protected int capacity;
public ReagentContainer(int capacity)
{
this(null, capacity);
}
public ReagentContainer(ReagentStack stack, int capacity)
{
this.reagentStack = stack;
this.capacity = capacity;
}
public ReagentContainer(Reagent reagent, int amount, int capacity)
{
this(new ReagentStack(reagent, amount), capacity);
}
public static ReagentContainer readFromNBT(NBTTagCompound nbt)
{
ReagentStack reagent = ReagentStack.loadReagentStackFromNBT(nbt);
int capacity = nbt.getInteger("capacity");
if (reagent != null)
{
return new ReagentContainer(reagent, capacity);
} else
{
return new ReagentContainer(null, capacity);
}
}
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
if (reagentStack != null)
{
reagentStack.writeToNBT(nbt);
}
nbt.setInteger("capacity", capacity);
return nbt;
}
@Override
public ReagentStack getReagent()
{
return reagentStack;
}
@Override
public int getReagentStackAmount()
{
if (reagentStack == null)
{
return 0;
}
return reagentStack.amount;
}
@Override
public int getCapacity()
{
return capacity;
}
@Override
public int fill(ReagentStack resource, boolean doFill)
{
if (resource == null)
{
return 0;
}
if (!doFill)
{
if (reagentStack == null)
{
return Math.min(capacity, resource.amount);
}
if (!reagentStack.isReagentEqual(resource))
{
return 0;
}
return Math.min(capacity - reagentStack.amount, resource.amount);
}
if (reagentStack == null)
{
reagentStack = new ReagentStack(resource, Math.min(capacity, resource.amount));
return reagentStack.amount;
}
if (!reagentStack.isReagentEqual(resource))
{
return 0;
}
int filled = capacity - reagentStack.amount;
if (resource.amount < filled)
{
reagentStack.amount += resource.amount;
filled = resource.amount;
} else
{
reagentStack.amount = capacity;
}
return filled;
}
@Override
public ReagentStack drain(int maxDrain, boolean doDrain)
{
if (reagentStack == null)
{
return null;
}
int drained = maxDrain;
if (reagentStack.amount < drained)
{
drained = reagentStack.amount;
}
ReagentStack stack = new ReagentStack(reagentStack, drained);
if (doDrain)
{
reagentStack.amount -= drained;
if (reagentStack.amount <= 0)
{
reagentStack = null;
}
}
return stack;
}
@Override
public ReagentContainerInfo getInfo()
{
return new ReagentContainerInfo(this);
}
}

View File

@ -1,19 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
public final class ReagentContainerInfo
{
public final ReagentStack reagent;
public final int capacity;
public ReagentContainerInfo(ReagentStack reagent, int capacity)
{
this.reagent = reagent;
this.capacity = capacity;
}
public ReagentContainerInfo(IReagentContainer tank)
{
this.reagent = tank.getReagent();
this.capacity = tank.getCapacity();
}
}

View File

@ -1,174 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import net.minecraft.item.ItemStack;
public class ReagentRegistry
{
public static Map<String, Reagent> reagentList = new HashMap<String, Reagent>();
public static Map<ItemStack, ReagentStack> itemToReagentMap = new HashMap<ItemStack, ReagentStack>();
public static Reagent sanctusReagent;
public static Reagent incendiumReagent;
public static Reagent aquasalusReagent;
public static Reagent magicalesReagent;
public static Reagent aetherReagent;
public static Reagent crepitousReagent;
public static Reagent crystallosReagent;
public static Reagent terraeReagent;
public static Reagent tenebraeReagent;
public static Reagent offensaReagent;
public static Reagent praesidiumReagent;
public static Reagent orbisTerraeReagent;
public static Reagent virtusReagent;
public static Reagent reductusReagent;
public static Reagent potentiaReagent;
public static void initReagents()
{
sanctusReagent = new Reagent("sanctus");
incendiumReagent = new Reagent("incendium");
aquasalusReagent = new Reagent("aquasalus");
magicalesReagent = new Reagent("magicales");
aetherReagent = new Reagent("aether");
crepitousReagent = new Reagent("crepitous");
crystallosReagent = new Reagent("crystallos");
terraeReagent = new Reagent("terrae");
tenebraeReagent = new Reagent("tenebrae");
offensaReagent = new Reagent("offensa");
praesidiumReagent = new Reagent("praesidium");
orbisTerraeReagent = new Reagent("orbisTerrae");
virtusReagent = new Reagent("virtus");
reductusReagent = new Reagent("reductus");
potentiaReagent = new Reagent("potentia");
sanctusReagent.setColour(255, 255, 0, 255);
incendiumReagent.setColour(255, 0, 0, 255);
aquasalusReagent.setColour(0, 0, 255, 255);
magicalesReagent.setColour(150, 0, 146, 255);
aetherReagent.setColour(105, 223, 86, 255);
crepitousReagent.setColour(145, 145, 145, 255);
crystallosReagent.setColour(135, 255, 231, 255);
terraeReagent.setColour(147, 48, 13, 255);
tenebraeReagent.setColour(86, 86, 86, 255);
offensaReagent.setColour(126, 0, 0, 255);
praesidiumReagent.setColour(135, 135, 135, 255);
orbisTerraeReagent.setColour(32, 94, 14, 255);
virtusReagent.setColour(180, 0, 0, 255);
reductusReagent.setColour(20, 93, 2, 255);
potentiaReagent.setColour(64, 81, 208, 255);
registerReagent("sanctus", sanctusReagent);
registerReagent("incendium", incendiumReagent);
registerReagent("aquasalus", aquasalusReagent);
registerReagent("magicales", magicalesReagent);
registerReagent("aether", aetherReagent);
registerReagent("crepitous", crepitousReagent);
registerReagent("crystallos", crystallosReagent);
registerReagent("terrae", terraeReagent);
registerReagent("tenebrae", tenebraeReagent);
registerReagent("offensa", offensaReagent);
registerReagent("praesidium", praesidiumReagent);
registerReagent("orbisTerrae", orbisTerraeReagent);
registerReagent("virtus", virtusReagent);
registerReagent("reductus", reductusReagent);
registerReagent("potentia", potentiaReagent);
}
public static boolean registerReagent(String key, Reagent reagent)
{
if (reagentList.containsKey(key) || reagent == null)
{
return false;
}
reagentList.put(key, reagent);
return true;
}
public static Reagent getReagentForKey(String key)
{
if (reagentList.containsKey(key))
{
return reagentList.get(key);
}
return null;
}
public static String getKeyForReagent(Reagent reagent)
{
if (reagentList.containsValue(reagent))
{
Set<Entry<String, Reagent>> set = reagentList.entrySet();
for (Entry<String, Reagent> entry : set)
{
if (entry.getValue().equals(reagent))
{
return entry.getKey();
}
}
}
return "";
}
public static void registerItemAndReagent(ItemStack stack, ReagentStack reagentStack)
{
itemToReagentMap.put(stack, reagentStack);
}
public static ReagentStack getReagentStackForItem(ItemStack stack)
{
if (stack == null)
{
return null;
}
for (Entry<ItemStack, ReagentStack> entry : itemToReagentMap.entrySet())
{
if (entry.getKey() != null && entry.getKey().isItemEqual(stack))
{
if (entry.getValue() == null)
{
return null;
} else
{
return entry.getValue().copy();
}
}
}
return null;
}
public static ItemStack getItemForReagent(Reagent reagent)
{
if (reagent == null)
{
return null;
}
for (Entry<ItemStack, ReagentStack> entry : itemToReagentMap.entrySet())
{
if (entry.getValue() != null && entry.getValue().reagent == reagent)
{
if (entry.getKey() == null)
{
return null;
} else
{
return entry.getKey().copy();
}
}
}
return null;
}
}

View File

@ -1,62 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import net.minecraft.nbt.NBTTagCompound;
public class ReagentStack
{
public Reagent reagent;
public int amount;
public ReagentStack(Reagent reagent, int amount)
{
this.reagent = reagent;
this.amount = amount;
}
public ReagentStack(ReagentStack reagentStack, int amount)
{
this(reagentStack.reagent, amount);
}
public static ReagentStack loadReagentStackFromNBT(NBTTagCompound tag)
{
Reagent reagent = ReagentRegistry.getReagentForKey(tag.getString("Reagent"));
if (reagent == null)
{
return null;
}
int amount = tag.getInteger("amount");
return new ReagentStack(reagent, amount);
}
public NBTTagCompound writeToNBT(NBTTagCompound tag)
{
tag.setString("Reagent", ReagentRegistry.getKeyForReagent(this.reagent));
tag.setInteger("amount", this.amount);
return tag;
}
public ReagentStack splitStack(int amount)
{
ReagentStack copyStack = this.copy();
int splitAmount = Math.min(amount, this.amount);
copyStack.amount = splitAmount;
this.amount -= splitAmount;
return copyStack;
}
public ReagentStack copy()
{
return new ReagentStack(this.reagent, this.amount);
}
public boolean isReagentEqual(ReagentStack other)
{
return other != null && this.reagent == other.reagent;
}
}

View File

@ -1,66 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
public class TileReagentHandler extends TileEntity implements IReagentHandler
{
protected ReagentContainer tank = new ReagentContainer(4000);
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT(tag);
tank.readFromNBT(tag);
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT(tag);
tank.writeToNBT(tag);
}
/* IReagentHandler */
@Override
public int fill(EnumFacing from, ReagentStack resource, boolean doFill)
{
return tank.fill(resource, doFill);
}
@Override
public ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain)
{
if (resource == null || !resource.isReagentEqual(tank.getReagent()))
{
return null;
}
return tank.drain(resource.amount, doDrain);
}
@Override
public ReagentStack drain(EnumFacing from, int maxDrain, boolean doDrain)
{
return tank.drain(maxDrain, doDrain);
}
@Override
public boolean canFill(EnumFacing from, Reagent reagent)
{
return true;
}
@Override
public boolean canDrain(EnumFacing from, Reagent reagent)
{
return true;
}
@Override
public ReagentContainerInfo[] getContainerInfo(EnumFacing from)
{
return new ReagentContainerInfo[]{tank.getInfo()};
}
}

View File

@ -1,283 +0,0 @@
package WayofTime.alchemicalWizardry.api.alchemy.energy;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.util.Constants;
public class TileSegmentedReagentHandler extends TileEntity implements ISegmentedReagentHandler
{
protected ReagentContainer[] tanks;
protected Map<Reagent, Integer> attunedTankMap;
public TileSegmentedReagentHandler()
{
this(1);
}
public TileSegmentedReagentHandler(int numberOfTanks)
{
this(numberOfTanks, 1000);
}
public TileSegmentedReagentHandler(int numberOfTanks, int tankSize)
{
super();
this.attunedTankMap = new HashMap<Reagent, Integer>();
this.tanks = new ReagentContainer[numberOfTanks];
for (int i = 0; i < numberOfTanks; i++)
{
this.tanks[i] = new ReagentContainer(tankSize);
}
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT(tag);
NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND);
int size = tagList.tagCount();
this.tanks = new ReagentContainer[size];
for (int i = 0; i < size; i++)
{
NBTTagCompound savedTag = tagList.getCompoundTagAt(i);
this.tanks[i] = ReagentContainer.readFromNBT(savedTag);
}
NBTTagList attunedTagList = tag.getTagList("attunedTankMap", Constants.NBT.TAG_COMPOUND);
for (int i = 0; i < attunedTagList.tagCount(); i++)
{
NBTTagCompound savedTag = attunedTagList.getCompoundTagAt(i);
Reagent reagent = ReagentRegistry.getReagentForKey(savedTag.getString("reagent"));
this.attunedTankMap.put(reagent, savedTag.getInteger("amount"));
}
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT(tag);
NBTTagList tagList = new NBTTagList();
for (int i = 0; i < this.tanks.length; i++)
{
NBTTagCompound savedTag = new NBTTagCompound();
if (this.tanks[i] != null)
{
this.tanks[i].writeToNBT(savedTag);
}
tagList.appendTag(savedTag);
}
tag.setTag("reagentTanks", tagList);
NBTTagList attunedTagList = new NBTTagList();
for (Entry<Reagent, Integer> entry : this.attunedTankMap.entrySet())
{
NBTTagCompound savedTag = new NBTTagCompound();
savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey()));
savedTag.setInteger("amount", entry.getValue());
attunedTagList.appendTag(savedTag);
}
tag.setTag("attunedTankMap", attunedTagList);
}
/* ISegmentedReagentHandler */
@Override
public int fill(EnumFacing from, ReagentStack resource, boolean doFill)
{
int totalFill = 0;
boolean useTankLimit = !this.attunedTankMap.isEmpty();
if (resource != null)
{
int totalTanksFillable = useTankLimit ? this.getTanksTunedToReagent(resource.reagent) : this.tanks.length;
int tanksFilled = 0;
int maxFill = resource.amount;
for (int i = this.tanks.length - 1; i >= 0; i--)
{
ReagentStack remainingStack = resource.copy();
remainingStack.amount = maxFill - totalFill;
boolean doesReagentMatch = tanks[i].getReagent() != null && tanks[i].getReagent().isReagentEqual(remainingStack);
if (doesReagentMatch)
{
totalFill += tanks[i].fill(remainingStack, doFill);
tanksFilled++;
} else
{
continue;
}
if (totalFill >= maxFill || tanksFilled >= totalTanksFillable)
{
return totalFill;
}
}
if (tanksFilled >= totalTanksFillable)
{
return totalFill;
}
for (int i = this.tanks.length - 1; i >= 0; i--)
{
ReagentStack remainingStack = resource.copy();
remainingStack.amount = maxFill - totalFill;
boolean isTankEmpty = tanks[i].getReagent() == null;
if (isTankEmpty)
{
totalFill += tanks[i].fill(remainingStack, doFill);
tanksFilled++;
} else
{
continue;
}
if (totalFill >= maxFill || tanksFilled >= totalTanksFillable)
{
return totalFill;
}
}
}
return totalFill;
}
@Override
public ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain)
{
if (resource == null)
{
return null;
}
int maxDrain = resource.amount;
Reagent reagent = resource.reagent;
int drained = 0;
for (int i = 0; i < tanks.length; i++)
{
if (drained >= maxDrain)
{
break;
}
if (resource.isReagentEqual(tanks[i].getReagent()))
{
ReagentStack drainStack = tanks[i].drain(maxDrain - drained, doDrain);
if (drainStack != null)
{
drained += drainStack.amount;
}
}
}
return new ReagentStack(reagent, drained);
}
/* Only returns the amount from the first available tank */
@Override
public ReagentStack drain(EnumFacing from, int maxDrain, boolean doDrain)
{
for (int i = 0; i < tanks.length; i++)
{
ReagentStack stack = tanks[i].drain(maxDrain, doDrain);
if (stack != null)
{
return stack;
}
}
return null;
}
@Override
public boolean canFill(EnumFacing from, Reagent reagent)
{
return true;
}
@Override
public boolean canDrain(EnumFacing from, Reagent reagent)
{
return true;
}
@Override
public ReagentContainerInfo[] getContainerInfo(EnumFacing from)
{
ReagentContainerInfo[] info = new ReagentContainerInfo[this.getNumberOfTanks()];
for (int i = 0; i < this.getNumberOfTanks(); i++)
{
info[i] = tanks[i].getInfo();
}
return info;
}
@Override
public int getNumberOfTanks()
{
return tanks.length;
}
@Override
public int getTanksTunedToReagent(Reagent reagent)
{
if (this.attunedTankMap.containsKey(reagent) && this.attunedTankMap.get(reagent) != null)
{
return this.attunedTankMap.get(reagent);
}
return 0;
}
@Override
public void setTanksTunedToReagent(Reagent reagent, int total)
{
if (total == 0 && this.attunedTankMap.containsKey(reagent))
{
this.attunedTankMap.remove(reagent);
return;
}
this.attunedTankMap.put(reagent, total);
}
@Override
public Map<Reagent, Integer> getAttunedTankMap()
{
return this.attunedTankMap;
}
public boolean areTanksEmpty()
{
for (int i = 0; i < this.tanks.length; i++)
{
if (tanks[i] != null && tanks[i].reagentStack != null)
{
return false;
}
}
return true;
}
}

View File

@ -0,0 +1,64 @@
package WayofTime.alchemicalWizardry.api.altar;
import WayofTime.alchemicalWizardry.api.BlockStack;
import lombok.Getter;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
/**
* Used for building the altar structure.
*/
@Getter
public class AltarComponent {
private BlockPos offset;
private BlockStack blockStack;
private boolean bloodRune;
private boolean upgradeSlot;
/**
* @param offset - The position in the world relative to the MasterRitualStone
* @param blockStack - The block and meta combination expected
*/
public AltarComponent(BlockPos offset, BlockStack blockStack) {
this.offset = offset;
this.blockStack = blockStack;
}
/**
* Non-meta based variant for ease of use.
*/
public AltarComponent(BlockPos offset, Block block) {
this(offset, new BlockStack(block));
}
/**
* Use for setting a location at which there must be a block, but the type
* of block does not matter.
*/
public AltarComponent(BlockPos offset) {
this(offset, new BlockStack(Blocks.air));
}
/**
* Sets the location to a Blood Rune. This does not mean that the location
* can be used as an upgrade.
*
* @return the current instance for further use.
*/
public AltarComponent setBloodRune() {
this.bloodRune = true;
return this;
}
/**
* Sets the location to an upgrade slot.
*
* @return the current instance for further use.
*/
public AltarComponent setUpgradeSlot() {
this.upgradeSlot = true;
return this;
}
}

View File

@ -0,0 +1,44 @@
package WayofTime.alchemicalWizardry.api.altar;
import lombok.Getter;
import net.minecraft.item.ItemStack;
import javax.annotation.Nullable;
@Getter
public class AltarRecipe {
public final int minTier, syphon, consumeRate, drainRate;
public final boolean useTag;
public final ItemStack input, output;
/**
* Allows creation of a recipe for the {@link WayofTime.alchemicalWizardry.block.BlockAltar} / {@link WayofTime.alchemicalWizardry.tile.TileAltar}.
* The output ItemStack is allowed to be null as some recipes do not contain an output. (Blood Orbs)
*
* @param input - The input ItemStack
* @param output - The ItemStack obtained from the recipe
* @param minTier - The minimum tier of Altar required
* @param syphon - The amount of LP to syphon from the Altar
* @param consumeRate - The rate at which LP is consumed during crafting
* @param drainRate - The rate at which LP is drained during crafting
* @param useTag -
*/
public AltarRecipe(ItemStack input, @Nullable ItemStack output, int minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
this.input = input;
this.output = output;
this.minTier = minTier;
this.syphon = syphon;
this.consumeRate = consumeRate;
this.drainRate = drainRate;
this.useTag = useTag;
}
public AltarRecipe(ItemStack input, ItemStack output, int minTier, int syphon, int consumeRate, int drainRate) {
this(input, output, minTier, syphon, consumeRate, drainRate, false);
}
public AltarRecipe (ItemStack input, int minTier, int consumeRate, int drainRate) {
this(input, null, minTier, 0, consumeRate, drainRate);
}
}

View File

@ -0,0 +1,20 @@
package WayofTime.alchemicalWizardry.api.altar;
import lombok.Getter;
@Getter
public class AltarUpgrade {
private int speedCount;
public AltarUpgrade() {
}
// Adders
public AltarUpgrade addSpeed() {
speedCount++;
return this;
}
}

View File

@ -1,136 +0,0 @@
package WayofTime.alchemicalWizardry.api.altarRecipeRegistry;
import java.util.ArrayList;
import java.util.Set;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
public class AltarRecipe
{
public int minTier;
public int liquidRequired;
public boolean canBeFilled; //Tells the system that the item is an orb
public int consumptionRate;
public int drainRate;
public ItemStack requiredItem;
public ItemStack result;
public boolean useTag;
public ArrayList<Object> input = new ArrayList<Object>();
public AltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled)
{
this(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled, false);
}
public AltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled, boolean useTag)
{
this.result = result;
this.requiredItem = requiredItem;
this.minTier = minTier;
this.liquidRequired = liquidRequired;
this.consumptionRate = consumptionRate;
this.drainRate = drainRate;
this.canBeFilled = canBeFilled;
this.useTag = useTag;
}
public ItemStack getResult()
{
return this.result;
}
public ItemStack getRequiredItem()
{
return this.requiredItem;
}
public boolean doesRequiredItemMatch(ItemStack comparedStack, int tierCheck)
{
if (comparedStack == null || this.requiredItem == null)
{
return false;
}
return tierCheck >= minTier && this.requiredItem.isItemEqual(comparedStack) && (this.useTag ? this.areRequiredTagsEqual(comparedStack) : true);
}
public boolean areRequiredTagsEqual(ItemStack comparedStack)
{
if(requiredItem.hasTagCompound())
{
NBTTagCompound tag = requiredItem.getTagCompound();
if(!comparedStack.hasTagCompound())
{
return false;
}
NBTTagCompound comparedTag = comparedStack.getTagCompound();
return this.areTagsEqual(tag, comparedTag);
}
return true;
}
protected boolean areTagsEqual(NBTTagCompound tag, NBTTagCompound comparedTag)
{
Set set = tag.getKeySet();
for(Object obj : set)
{
if(obj instanceof String)
{
String str = (String)obj;
NBTBase baseTag = comparedTag.getTag(str);
if(baseTag instanceof NBTTagCompound)
{
NBTBase comparedBaseTag = comparedTag.getTag(str);
if(comparedBaseTag instanceof NBTTagCompound)
{
if(!this.areTagsEqual(tag, comparedTag))
{
return false;
}
}
}else
{
if(baseTag != null && !baseTag.equals(comparedTag.getTag(str)))
{
return false;
}
}
}
}
return true;
}
public int getMinTier()
{
return this.minTier;
}
public int getLiquidRequired()
{
return this.liquidRequired;
}
public int getConsumptionRate()
{
return this.consumptionRate;
}
public int getDrainRate()
{
return this.drainRate;
}
public boolean getCanBeFilled()
{
return this.canBeFilled;
}
}

View File

@ -1,77 +0,0 @@
package WayofTime.alchemicalWizardry.api.altarRecipeRegistry;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import net.minecraft.item.ItemStack;
public class AltarRecipeRegistry
{
public static List<AltarRecipe> altarRecipes = new LinkedList<AltarRecipe>();
public static Map<Integer, ItemStack> orbMap = new HashMap<Integer, ItemStack>();
public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled)
{
altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled));
}
public static void registerNBTAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled)
{
altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled, true));
}
public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate)
{
if(!orbMap.containsKey(minTier))
{
orbMap.put(minTier, orbStack);
}
registerAltarRecipe(null, orbStack, minTier, 0, consumptionRate, 0, true);
}
public static boolean isRequiredItemValid(ItemStack testItem, int currentTierAltar)
{
if(testItem == null)
{
return false;
}
for (AltarRecipe recipe : altarRecipes)
{
if (recipe.doesRequiredItemMatch(testItem, currentTierAltar))
{
return true;
}
}
return false;
}
public static ItemStack getItemForItemAndTier(ItemStack testItem, int currentTierAltar)
{
for (AltarRecipe recipe : altarRecipes)
{
if (recipe.doesRequiredItemMatch(testItem, currentTierAltar))
{
return ItemStack.copyItemStack(recipe.getResult());
}
}
return null;
}
public static AltarRecipe getAltarRecipeForItemAndTier(ItemStack testItem, int currentTierAltar)
{
for (AltarRecipe recipe : altarRecipes)
{
if (recipe.doesRequiredItemMatch(testItem, currentTierAltar))
{
return recipe;
}
}
return null;
}
}

View File

@ -1,6 +0,0 @@
package WayofTime.alchemicalWizardry.api.altarRecipeRegistry;
public interface IFadedRune
{
int getAltarTierLimit(int meta);
}

View File

@ -1,30 +0,0 @@
package WayofTime.alchemicalWizardry.api.bindingRegistry;
import net.minecraft.item.ItemStack;
public class BindingRecipe
{
public ItemStack requiredItem;
public ItemStack outputItem;
public BindingRecipe(ItemStack outputItem, ItemStack requiredItem)
{
this.requiredItem = requiredItem;
this.outputItem = outputItem;
}
public boolean doesRequiredItemMatch(ItemStack testStack)
{
return !(testStack == null || this.requiredItem == null) && this.requiredItem.isItemEqual(testStack);
}
public ItemStack getResult(ItemStack inputItem)
{
return this.getResult();
}
public ItemStack getResult()
{
return this.outputItem;
}
}

View File

@ -1,67 +0,0 @@
package WayofTime.alchemicalWizardry.api.bindingRegistry;
import net.minecraft.item.ItemStack;
import java.util.LinkedList;
import java.util.List;
public class BindingRegistry
{
public static List<BindingRecipe> bindingRecipes = new LinkedList<BindingRecipe>();
public static void registerRecipe(ItemStack output, ItemStack input)
{
bindingRecipes.add(new BindingRecipe(output, input));
}
public static boolean isRequiredItemValid(ItemStack testItem)
{
for (BindingRecipe recipe : bindingRecipes)
{
if (recipe.doesRequiredItemMatch(testItem))
{
return true;
}
}
return false;
}
public static ItemStack getItemForItemAndTier(ItemStack testItem)
{
for (BindingRecipe recipe : bindingRecipes)
{
if (recipe.doesRequiredItemMatch(testItem))
{
return recipe.getResult(testItem).copy();
}
}
return null;
}
public static int getIndexForItem(ItemStack testItem)
{
int i = 0;
for (BindingRecipe recipe : bindingRecipes)
{
if (recipe.doesRequiredItemMatch(testItem))
{
return i;
}
i++;
}
return -1;
}
public static ItemStack getOutputForIndex(int index)
{
if (bindingRecipes.size() <= index)
{
return null;
}
return bindingRecipes.get(index).getResult();
}
}

View File

@ -1,30 +0,0 @@
package WayofTime.alchemicalWizardry.api.bindingRegistry;
import net.minecraft.item.ItemStack;
public class UnbindingRecipe
{
public ItemStack requiredItem;
public ItemStack outputItem;
public UnbindingRecipe(ItemStack outputItem, ItemStack requiredItem)
{
this.requiredItem = requiredItem;
this.outputItem = outputItem;
}
public boolean doesRequiredItemMatch(ItemStack testStack)
{
return !(testStack == null || this.requiredItem == null) && this.requiredItem.isItemEqual(testStack);
}
public ItemStack getResult(ItemStack inputItem)
{
return this.getResult();
}
public ItemStack getResult()
{
return this.outputItem;
}
}

View File

@ -1,62 +0,0 @@
package WayofTime.alchemicalWizardry.api.bindingRegistry;
import net.minecraft.item.ItemStack;
import java.util.LinkedList;
import java.util.List;
public class UnbindingRegistry
{
public static List<UnbindingRecipe> unbindingRecipes = new LinkedList<UnbindingRecipe>();
public static void addAllUnbindingRecipesFromBinding()
{
for (BindingRecipe bindingRecipe : BindingRegistry.bindingRecipes)
{
unbindingRecipes.add(new UnbindingRecipe(bindingRecipe.requiredItem, bindingRecipe.outputItem));
}
}
public static void registerRecipe(ItemStack output, ItemStack input)
{
unbindingRecipes.add(new UnbindingRecipe(output, input));
}
public static boolean isRequiredItemValid(ItemStack testItem)
{
for (UnbindingRecipe recipe : unbindingRecipes)
{
if (recipe.doesRequiredItemMatch(testItem))
{
return true;
}
}
return false;
}
public static int getIndexForItem(ItemStack testItem)
{
int i = 0;
for (UnbindingRecipe recipe : unbindingRecipes)
{
if (recipe.doesRequiredItemMatch(testItem))
{
return i;
}
i++;
}
return -1;
}
public static ItemStack getOutputForIndex(int index)
{
if (unbindingRecipes.size() <= index)
{
return null;
}
return unbindingRecipes.get(index).getResult();
}
}

View File

@ -1,14 +0,0 @@
package WayofTime.alchemicalWizardry.api.compress;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public abstract class CompressionHandler
{
/**
* Called to look at the inventory and syphons the required stack. Returns resultant stack if successful, and null if not.
* @param inv The inventory iterated through
* @return The result of the compression
*/
public abstract ItemStack compressInventory(ItemStack[] inv, World world);
}

View File

@ -1,67 +0,0 @@
package WayofTime.alchemicalWizardry.api.compress;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
* A registry aimed to help compress items in an inventory into its compressible form.
*
*/
public class CompressionRegistry
{
public static List<CompressionHandler> compressionRegistry = new ArrayList<CompressionHandler>();
public static Map<ItemStack, Integer> thresholdMap = new HashMap<ItemStack, Integer>();
public static void registerHandler(CompressionHandler handler)
{
compressionRegistry.add(handler);
}
/**
* Registers an item so that it only compresses while above this threshold
* @param stack
* @param threshold
*/
public static void registerItemThreshold(ItemStack stack, int threshold)
{
thresholdMap.put(stack, threshold);
}
public static ItemStack compressInventory(ItemStack[] inv, World world)
{
for(CompressionHandler handler : compressionRegistry)
{
ItemStack stack = handler.compressInventory(inv, world);
if(stack != null)
{
return stack;
}
}
return null;
}
public static int getItemThreshold(ItemStack stack)
{
for(Entry<ItemStack, Integer> entry : thresholdMap.entrySet())
{
if(areItemStacksEqual(entry.getKey(), stack))
{
return entry.getValue();
}
}
return 0;
}
public static boolean areItemStacksEqual(ItemStack stack, ItemStack compressedStack)
{
return stack.isItemEqual(compressedStack) && (stack.getTagCompound() == null ? compressedStack.getTagCompound() == null : stack.getTagCompound().equals(compressedStack.getTagCompound()));
}
}

View File

@ -0,0 +1,10 @@
package WayofTime.alchemicalWizardry.api.enumeration;
public enum EnumAltarComponent {
GLOWSTONE,
BLOODSTONE,
BEACON,
BLOODRUNE,
CRYSTAL
}

View File

@ -0,0 +1,136 @@
package WayofTime.alchemicalWizardry.api.enumeration;
import WayofTime.alchemicalWizardry.api.BlockStack;
import WayofTime.alchemicalWizardry.api.altar.AltarComponent;
import WayofTime.alchemicalWizardry.registry.ModBlocks;
import lombok.Getter;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import java.util.ArrayList;
@Getter
public enum EnumAltarTier {
ONE(),
TWO() {
@Override
public void buildComponents() {
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, -1), ModBlocks.rune).setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(0, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(1, -1, -1), ModBlocks.rune).setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 1), ModBlocks.rune).setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(0, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 1), ModBlocks.rune).setBloodRune());
}
},
THREE() {
@Override
public void buildComponents() {
altarComponents.addAll(TWO.getAltarComponents());
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(0, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(1, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(0, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-3, -1, -3)));
altarComponents.add(new AltarComponent(new BlockPos(-3, 0, -3)));
altarComponents.add(new AltarComponent(new BlockPos(3, -1, -3)));
altarComponents.add(new AltarComponent(new BlockPos(3, 0, -3)));
altarComponents.add(new AltarComponent(new BlockPos(-3, -1, 3)));
altarComponents.add(new AltarComponent(new BlockPos(-3, 0, 3)));
altarComponents.add(new AltarComponent(new BlockPos(3, -1, 3)));
altarComponents.add(new AltarComponent(new BlockPos(3, 0, 3)));
altarComponents.add(new AltarComponent(new BlockPos(-3, 1, -3), Blocks.glowstone));
altarComponents.add(new AltarComponent(new BlockPos(3, 1, -3), Blocks.glowstone));
altarComponents.add(new AltarComponent(new BlockPos(-3, 1, 3), Blocks.glowstone));
altarComponents.add(new AltarComponent(new BlockPos(3, 1, 3), Blocks.glowstone));
for (int i = -2; i <= 2; i++) {
altarComponents.add(new AltarComponent(new BlockPos(3, -2, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-3, -2, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -2, 3), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -2, -3), ModBlocks.rune).setUpgradeSlot().setBloodRune());
}
}
},
FOUR() {
@Override
public void buildComponents() {
altarComponents.addAll(THREE.getAltarComponents());
for (int i = -3; i <= 3; i++) {
altarComponents.add(new AltarComponent(new BlockPos(5, -3, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-5, -3, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -3, 5), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -3, -5), ModBlocks.rune).setUpgradeSlot().setBloodRune());
}
for (int i = -2; i <= 1; i++) {
altarComponents.add(new AltarComponent(new BlockPos(5, i, 5)));
altarComponents.add(new AltarComponent(new BlockPos(5, i, -5)));
altarComponents.add(new AltarComponent(new BlockPos(-5, i, -5)));
altarComponents.add(new AltarComponent(new BlockPos(-5, i, 5)));
}
altarComponents.add(new AltarComponent(new BlockPos(5, 2, 5), new BlockStack(ModBlocks.bloodStone, 1)));
altarComponents.add(new AltarComponent(new BlockPos(5, 2, -5), new BlockStack(ModBlocks.bloodStone, 1)));
altarComponents.add(new AltarComponent(new BlockPos(-5, 2, -5), new BlockStack(ModBlocks.bloodStone, 1)));
altarComponents.add(new AltarComponent(new BlockPos(-5, 2, 5), new BlockStack(ModBlocks.bloodStone, 1)));
}
},
FIVE() {
@Override
public void buildComponents() {
altarComponents.addAll(FOUR.getAltarComponents());
altarComponents.add(new AltarComponent(new BlockPos(-8, -3, 8), Blocks.beacon));
altarComponents.add(new AltarComponent(new BlockPos(-8, -3, -8), Blocks.beacon));
altarComponents.add(new AltarComponent(new BlockPos(8, -3, -8), Blocks.beacon));
altarComponents.add(new AltarComponent(new BlockPos(8, -3, 8), Blocks.beacon));
for (int i = -6; i <= 6; i++) {
altarComponents.add(new AltarComponent(new BlockPos(8, -4, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-8, -4, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -4, 8), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -4, -8), ModBlocks.rune).setUpgradeSlot().setBloodRune());
}
}
},
SIX() {
@Override
public void buildComponents() {
altarComponents.addAll(FIVE.getAltarComponents());
for(int i = -4; i <= 2; i++) {
altarComponents.add(new AltarComponent(new BlockPos(11, i, 11)));
altarComponents.add(new AltarComponent(new BlockPos(-11, i, -11)));
altarComponents.add(new AltarComponent(new BlockPos(11, i, -11)));
altarComponents.add(new AltarComponent(new BlockPos(-11, i, 11)));
}
altarComponents.add(new AltarComponent(new BlockPos(11, 3, 11), ModBlocks.crystal));
altarComponents.add(new AltarComponent(new BlockPos(-11, 3, -11), ModBlocks.crystal));
altarComponents.add(new AltarComponent(new BlockPos(11, 3, -11), ModBlocks.crystal));
altarComponents.add(new AltarComponent(new BlockPos(-11, 3, 11), ModBlocks.crystal));
for (int i = -9; i <= 9; i++) {
altarComponents.add(new AltarComponent(new BlockPos(11, -5, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(-11, -5, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -5, 11), ModBlocks.rune).setUpgradeSlot().setBloodRune());
altarComponents.add(new AltarComponent(new BlockPos(i, -5, -11), ModBlocks.rune).setUpgradeSlot().setBloodRune());
}
}
};
public static final int MAXTIERS = values().length;
ArrayList<AltarComponent> altarComponents = new ArrayList<AltarComponent>();
public void buildComponents() {
}
}

View File

@ -0,0 +1,33 @@
package WayofTime.alchemicalWizardry.api.enumeration;
import net.minecraft.util.IStringSerializable;
import java.util.Locale;
public enum EnumStoneType implements IStringSerializable {
BLANK,
WATER,
FIRE,
EARTH,
AIR,
DUSK,
DAWN;
@Override
public String toString() {
return name().toLowerCase(Locale.ENGLISH);
}
@Override
public String getName() {
return this.toString();
}
public static EnumStoneType byMetadata(int meta) {
if (meta < 0 || meta >= values().length)
meta = 0;
return values()[meta];
}
}

View File

@ -1,38 +1,24 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public class AddToNetworkEvent extends Event
{
public String ownerNetwork;
public int addedAmount;
public int maximum;
/**
* This event is called whenever the network is added to. If cancelled, no LP will be drained from the source. If result is set to Result.DENY,
* the LP will still be drained but the soul network will not be added to.
*
* @param ownerNetwork Key used for the soul network
* @param addedAmount Amount added
* @param maximum Ceiling that the network can add to
*/
public AddToNetworkEvent(String ownerNetwork, int addedAmount, int maximum)
{
super();
this.ownerNetwork = ownerNetwork;
this.addedAmount = addedAmount;
this.maximum = maximum;
}
public String getOwnerNetwork()
{
return this.ownerNetwork;
}
public int getAddedAmount()
{
return this.addedAmount;
}
public class AddToNetworkEvent extends Event {
public String ownerNetwork;
public int addedAmount;
public int maximum;
/**
* This event is called whenever the network is added to. If cancelled, no LP will be drained from the source. If result is set to Result.DENY,
* the LP will still be drained but the soul network will not be added to.
*
* @param ownerNetwork Key used for the soul network
* @param addedAmount Amount added
* @param maximum Ceiling that the network can add to
*/
public AddToNetworkEvent(String ownerNetwork, int addedAmount, int maximum) {
this.ownerNetwork = ownerNetwork;
this.addedAmount = addedAmount;
this.maximum = maximum;
}
}

View File

@ -6,17 +6,16 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public class ItemBindEvent extends Event
{
public final EntityPlayer player;
public String key;
public ItemStack itemStack;
public ItemBindEvent(EntityPlayer player, String key, ItemStack itemStack)
{
super();
this.player = player;
this.key = key;
this.itemStack = itemStack;
}
public class ItemBindEvent extends Event {
public final EntityPlayer player;
public String key;
public ItemStack itemStack;
public ItemBindEvent(EntityPlayer player, String key, ItemStack itemStack) {
super();
this.player = player;
this.key = key;
this.itemStack = itemStack;
}
}

View File

@ -1,15 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
@Cancelable
public class ItemDrainInContainerEvent extends SoulNetworkEvent
{
public ItemStack stack;
public ItemDrainInContainerEvent(ItemStack stack, String ownerNetwork, int drainAmount)
{
super(ownerNetwork, drainAmount);
this.stack = stack;
}
}

View File

@ -1,29 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
@Cancelable
public class ItemDrainNetworkEvent extends PlayerDrainNetworkEvent
{
public final ItemStack itemStack;
public boolean shouldDamage; //If true, will damage regardless of if the network had enough inside it
public float damageAmount; //Amount of damage that would incur if the network could not drain properly
/**
* Set result to deny the action i.e. damage/drain anyways. Cancelling event prevents action without penalties
*
* @param player Player using the item
* @param ownerNetwork Network that the item is tied to
* @param itemStack Item used
* @param drainAmount Original drain amount - change to alter cost
*/
public ItemDrainNetworkEvent(EntityPlayer player, String ownerNetwork, ItemStack itemStack, int drainAmount)
{
super(player, ownerNetwork, drainAmount);
this.itemStack = itemStack;
this.shouldDamage = false;
this.damageAmount = (float)(drainAmount) / 100.0f;
}
}

View File

@ -1,18 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
@Cancelable
public class PlayerAddToNetworkEvent extends AddToNetworkEvent
{
public final EntityPlayer player;
public ItemStack itemStack;
public PlayerAddToNetworkEvent(EntityPlayer player, ItemStack itemStack, String ownerNetwork, int addedAmount, int maximum)
{
super(ownerNetwork, addedAmount, maximum);
this.player = player;
this.itemStack = itemStack;
}
}

View File

@ -1,20 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
@Cancelable
public class PlayerDrainNetworkEvent extends SoulNetworkEvent
{
public final EntityPlayer player; //Player that activated the event
public PlayerDrainNetworkEvent(EntityPlayer player, String ownerNetwork, int drainAmount)
{
super(ownerNetwork, drainAmount);
this.player = player;
}
public EntityPlayer getPlayer()
{
return player;
}
}

View File

@ -1,23 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
@Cancelable
public class RitualActivatedEvent extends RitualEvent
{
public final EntityPlayer player;
public final ItemStack crystalStack;
public int crystalTier;
public RitualActivatedEvent(IMasterRitualStone mrs, String ownerKey, String ritualKey, EntityPlayer player, ItemStack activationCrystal, int crystalTier)
{
super(mrs, ownerKey, ritualKey);
this.player = player;
this.crystalStack = activationCrystal;
this.crystalTier = crystalTier;
}
}

View File

@ -1,18 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraftforge.fml.common.eventhandler.Event;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
public class RitualEvent extends Event
{
public final IMasterRitualStone mrs;
public String ownerKey;
public final String ritualKey;
public RitualEvent(IMasterRitualStone mrs, String ownerKey, String ritualKey)
{
this.mrs = mrs;
this.ownerKey = ownerKey;
this.ritualKey = ritualKey;
}
}

View File

@ -1,13 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
@Cancelable
public class RitualRunEvent extends RitualEvent
{
public RitualRunEvent(IMasterRitualStone mrs, String ownerKey, String ritualKey)
{
super(mrs, ownerKey, ritualKey);
}
}

View File

@ -1,15 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualBreakMethod;
public class RitualStopEvent extends RitualEvent
{
public final RitualBreakMethod method;
public RitualStopEvent(IMasterRitualStone mrs, String ownerKey, String ritualKey, RitualBreakMethod method)
{
super(mrs, ownerKey, ritualKey);
this.method = method;
}
}

View File

@ -1,22 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public class SacrificeKnifeUsedEvent extends Event
{
public final EntityPlayer player;
public boolean shouldDrainHealth;
public boolean shouldFillAltar;
public final int healthDrained;
public SacrificeKnifeUsedEvent(EntityPlayer player, boolean shouldDrainHealth, boolean shouldFillAltar, int hp)
{
this.player = player;
this.shouldDrainHealth = shouldDrainHealth;
this.shouldFillAltar = shouldFillAltar;
this.healthDrained = hp;
}
}

View File

@ -1,27 +1,62 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
public class SoulNetworkEvent extends Event {
public class SoulNetworkEvent extends Event
{
public String ownerNetwork;
public int drainAmount;
public SoulNetworkEvent(String ownerNetwork, int drainAmount)
{
super();
this.ownerNetwork = ownerNetwork;
this.drainAmount = drainAmount;
}
public String getOwnerNetwork()
{
return this.ownerNetwork;
}
public int getDrainAmount()
{
return this.drainAmount;
}
public String ownerName;
public int syphon;
public SoulNetworkEvent(String ownerName, int syphon) {
this.ownerName = ownerName;
this.syphon = syphon;
}
@Cancelable
public static class ItemDrainInContainerEvent extends SoulNetworkEvent {
public ItemStack stack;
public ItemDrainInContainerEvent(ItemStack stack, String ownerName, int syphon) {
super(ownerName, syphon);
this.stack = stack;
}
}
@Cancelable
public static class PlayerDrainNetworkEvent extends SoulNetworkEvent {
public final EntityPlayer player;
public PlayerDrainNetworkEvent(EntityPlayer player, String ownerNetwork, int drainAmount) {
super(ownerNetwork, drainAmount);
this.player = player;
}
}
@Cancelable
public static class ItemDrainNetworkEvent extends PlayerDrainNetworkEvent {
public final ItemStack itemStack;
public boolean shouldDamage; //If true, will damage regardless of if the network had enough inside it
public float damageAmount; //Amount of damage that would incur if the network could not drain properly
/**
* Set result to deny the action i.e. damage/drain anyways. Cancelling event prevents action without penalties
*
* @param player Player using the item
* @param ownerNetwork Network that the item is tied to
* @param itemStack Item used
* @param drainAmount Original drain amount - change to alter cost
*/
public ItemDrainNetworkEvent(EntityPlayer player, String ownerNetwork, ItemStack itemStack, int drainAmount) {
super(player, ownerNetwork, drainAmount);
this.itemStack = itemStack;
this.shouldDamage = false;
this.damageAmount = (float)(drainAmount) / 100.0f;
}
}
}

View File

@ -1,50 +0,0 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
/** Fired when a teleposer attempts to transpose two blocks. Use this to perform special cleanup or compensation,
or cancel it entirely to prevent the transposition. */
@Cancelable
public class TeleposeEvent extends Event
{
public final World initialWorld;
public final BlockPos initialPos;
public final Block initialBlock;
public final IBlockState initialState;
public final World finalWorld;
public final BlockPos finalPos;
public final Block finalBlock;
public final IBlockState finalState;
public TeleposeEvent(World wi, BlockPos posi, IBlockState statei, World wf, BlockPos posf, IBlockState statef)
{
initialWorld = wi;
initialPos = posi;
initialState = statei;
initialBlock = initialState.getBlock();
finalWorld = wf;
finalPos = posf;
finalState = statef;
finalBlock = finalState.getBlock();
}
public TileEntity getInitialTile() {
return initialWorld.getTileEntity(initialPos);
}
public TileEntity getFinalTile() {
return finalWorld.getTileEntity(finalPos);
}
}

View File

@ -1,135 +0,0 @@
//package WayofTime.alchemicalWizardry.api.guide;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import net.minecraft.client.Minecraft;
//import net.minecraft.client.gui.FontRenderer;
//import net.minecraft.item.ItemStack;
//import net.minecraft.item.crafting.IRecipe;
//import net.minecraft.util.ResourceLocation;
//import net.minecraft.util.StatCollector;
//import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
//import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
//import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
//import amerifrance.guideapi.ModInformation;
//import amerifrance.guideapi.api.abstraction.CategoryAbstract;
//import amerifrance.guideapi.api.abstraction.EntryAbstract;
//import amerifrance.guideapi.api.abstraction.IRecipeRenderer;
//import amerifrance.guideapi.api.base.Book;
//import amerifrance.guideapi.api.util.GuiHelper;
//import amerifrance.guideapi.gui.GuiBase;
//import cpw.mods.fml.relauncher.ReflectionHelper;
//
//public class OrbRecipeRenderer implements IRecipeRenderer
//{
// public IRecipe recipe;
//
// public OrbRecipeRenderer(IRecipe recipe)
// {
// this.recipe = recipe;
// }
//
// @Override
// public void draw(Book book, CategoryAbstract category, EntryAbstract entry,
// int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase,
// FontRenderer fontRenderer) {
// Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModInformation.GUITEXLOC + "recipe_elements.png"));
// guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 105, 65);
//
// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.shapedOrb"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
// if(recipe instanceof ShapelessBloodOrbRecipe)
// {
// ShapelessBloodOrbRecipe shapelessBloodOrbRecipe = (ShapelessBloodOrbRecipe) recipe;
// List<Object> list = shapelessBloodOrbRecipe.getInput();
//
// int width = 3;
// int height = 3;
// for (int y = 0; y < height; y++) {
// for (int x = 0; x < width; x++) {
// if(list.size() - 1 < y * width + x)
// {
// continue;
// }
//
// int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7);
// int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5);
//
// Object component = list.get(y * width + x);
// if (component != null) {
// if (component instanceof ItemStack) {
// GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
// guiBase.renderToolTip((ItemStack) component, stackX, stackY);
// }
// } else if (component instanceof Integer) {
// GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
// guiBase.renderToolTip(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
// }
// } else {
// if (((ArrayList<ItemStack>) component).isEmpty()) return;
// GuiHelper.drawItemStack(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
// guiBase.renderToolTip(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
// }
// }
// }
// }
// }
// int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7);
// int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5);
// GuiHelper.drawItemStack(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
// guiBase.renderToolTip(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
// }
// }else
// {
// ShapedBloodOrbRecipe shapedBloodOrbRecipe = (ShapedBloodOrbRecipe) recipe;
// int width = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 4);
// int height = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 5);
// for (int y = 0; y < height; y++) {
// for (int x = 0; x < width; x++) {
// int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7);
// int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5);
// Object component = shapedBloodOrbRecipe.getInput()[y * width + x];
// if (component != null) {
// if (component instanceof ItemStack) {
// GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
// guiBase.renderToolTip((ItemStack) component, stackX, stackY);
// }
// } else if (component instanceof Integer) {
// GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
// guiBase.renderToolTip(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
// }
// } else {
// if (((ArrayList<ItemStack>) component).isEmpty()) return;
// GuiHelper.drawItemStack(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
// guiBase.renderToolTip(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
// }
// }
// }
// }
// }
// int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7);
// int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5);
// GuiHelper.drawItemStack(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
// guiBase.renderToolTip(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
// }
// }
//
// }
//
// @Override
// public void drawExtras(Book book, CategoryAbstract category,
// EntryAbstract entry, int guiLeft, int guiTop, int mouseX,
// int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
// // TODO Auto-generated method stub
//
// }
//
//}

View File

@ -1,69 +0,0 @@
//package WayofTime.alchemicalWizardry.api.guide;
//
//
//import net.minecraft.client.Minecraft;
//import net.minecraft.client.gui.FontRenderer;
//import net.minecraft.init.Blocks;
//import net.minecraft.item.Item;
//import net.minecraft.item.ItemStack;
//import net.minecraft.util.ResourceLocation;
//import net.minecraft.util.StatCollector;
//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
//import amerifrance.guideapi.api.abstraction.CategoryAbstract;
//import amerifrance.guideapi.api.abstraction.EntryAbstract;
//import amerifrance.guideapi.api.base.Book;
//import amerifrance.guideapi.api.base.PageBase;
//import amerifrance.guideapi.api.util.GuiHelper;
//import amerifrance.guideapi.gui.GuiBase;
//import cpw.mods.fml.relauncher.Side;
//import cpw.mods.fml.relauncher.SideOnly;
//
//public class PageAltarRecipe extends PageBase {
//
// public ItemStack input;
// public ItemStack output;
// public int tier;
// public int bloodRequired;
//
// public PageAltarRecipe(AltarRecipe recipe) {
// this.input = recipe.getRequiredItem();
// this.output = recipe.getResult();
// this.tier = recipe.getMinTier();
// this.bloodRequired = recipe.getLiquidRequired();
// }
//
// @Override
// @SideOnly(Side.CLIENT)
// public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
//
// Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("alchemicalwizardry" + ":textures/gui/guide/altar.png"));
// guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104);
//
// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.altar"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
//
// int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7);
// int inputY = (20) + (guiTop + guiBase.ySize / 5); //1 * 20
// GuiHelper.drawItemStack(input, inputX, inputY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15)) {
// guiBase.renderToolTip(input, mouseX, mouseY);
// }
//
// if (output == null) {
// output = new ItemStack(Blocks.fire);
// }
// int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7);
// int outputY = (20) + (guiTop + guiBase.xSize / 5); // 1 * 20
// GuiHelper.drawItemStack(output, outputX, outputY);
// if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
// guiBase.renderToolTip(output, outputX, outputY);
// }
//
// if (output.getItem() == Item.getItemFromBlock(Blocks.fire)) {
// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D);
// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("bm.string.tier") + ": " + String.valueOf(tier), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
// guiBase.drawCenteredString(fontRenderer, "LP: " + String.valueOf(bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0);
// }
// guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.tier"), String.valueOf(tier)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0);
// guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.bloodRequired"), String.valueOf(bloodRequired)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
// }
//}

View File

@ -1,145 +0,0 @@
//package WayofTime.alchemicalWizardry.api.guide;
//
//import net.minecraft.client.Minecraft;
//import net.minecraft.client.gui.FontRenderer;
//import net.minecraft.client.renderer.RenderHelper;
//import net.minecraft.client.renderer.entity.RenderItem;
//import net.minecraft.item.ItemStack;
//
//import org.lwjgl.opengl.GL11;
//import org.lwjgl.opengl.GL12;
//
//import amerifrance.guideapi.api.abstraction.CategoryAbstract;
//import amerifrance.guideapi.api.abstraction.EntryAbstract;
//import amerifrance.guideapi.api.base.Book;
//import amerifrance.guideapi.api.base.PageBase;
//import amerifrance.guideapi.gui.GuiBase;
//import cpw.mods.fml.relauncher.Side;
//import cpw.mods.fml.relauncher.SideOnly;
//
//public class PageMultiBlock extends PageBase
//{
// ItemStack[][][] structure;
// boolean canTick = false;
// int tick = 0;
// int showLayer = -1;
// float scaleFactor = 1;
//
// boolean renderMouseOver = true;
//
// public PageMultiBlock(ItemStack[][][] structure)
// {
// this.structure = structure;
// initPage(structure);
// }
//
// int blockCount=0;
// int[] countPerLevel;
// int structureHeight = 0;
// int structureLength = 0;
// int structureWidth = 0;
//
// public void initPage(ItemStack[][][] structure)
// {
// structureHeight = structure.length;
// structureWidth=0;
// structureLength=0;
// countPerLevel = new int[structureHeight];
// blockCount=0;
// for(int h=0; h<structure.length; h++)
// {
// if(structure[h].length-1>structureLength)
// structureLength = structure[h].length-1;
// int perLvl=0;
// for(int l=0; l<structure[h].length; l++)
// {
// if(structure[h][l].length-1>structureWidth)
// structureWidth = structure[h][l].length-1;
// for(ItemStack ss : structure[h][l])
// if(ss!=null)
// perLvl++;
// }
// countPerLevel[h] = perLvl;
// blockCount += perLvl;
// }
// tick= (showLayer==-1?blockCount:countPerLevel[showLayer])*40;
//// int yOff = (structureHeight-1)*12+structureWidth*5+structureLength*5+16;
//// pageButtons.add(new GuiButtonManualNavigation(gui, 100, x+4,y+yOff/2-5, 10,10, 4));
//// pageButtons.add(new GuiButtonManualNavigation(gui, 101, x+4,y+yOff/2-8-16, 10,16, 3));
//// pageButtons.add(new GuiButtonManualNavigation(gui, 102, x+4,y+yOff/2+8, 10,16, 2));
// }
//
// @Override
// @SideOnly(Side.CLIENT)
// public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer)
// {
//// if(multiblock.getStructureManual()!=null)
// Minecraft mc = Minecraft.getMinecraft();
//
// int x = guiLeft + 32;
// int y = guiTop + 30;
// {
// if(canTick)
// tick++;
//
// int prevLayers = 0;
// if(showLayer!=-1)
// for(int ll=0; ll<showLayer; ll++)
// prevLayers+=countPerLevel[ll];
// int limiter = prevLayers+ (tick/40)% ((showLayer==-1?blockCount:countPerLevel[showLayer])+4);
//
// int xHalf = (structureWidth*5 - structureLength*5);
// int yOffPartial = (structureHeight-1)*12+structureWidth*5+structureLength*5;
//// int yOffTotal = yOffPartial+16;
//
// GL11.glDisable(GL11.GL_DEPTH_TEST);
//
// GL11.glPushMatrix();
// GL11.glTranslatef((1-scaleFactor)*(guiLeft + 64), (1-scaleFactor)*(guiTop+60), 0);
// GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
// GL11.glEnable(GL12.GL_RESCALE_NORMAL);
// RenderHelper.enableGUIStandardItemLighting();
// RenderItem.getInstance().renderWithColor=true;
// int i=0;
// ItemStack highlighted = null;
// for(int h=0; h<structure.length; h++)
// if(showLayer==-1 || h<=showLayer)
// {
// ItemStack[][] level = structure[h];
// for(int l=level.length-1; l>=0; l--)
// {
// ItemStack[] row = level[l];
// for(int w=row.length-1; w>=0; w--)
// {
// int xx = 60 +xHalf -10*w +10*l -7;
// int yy = yOffPartial - 5*w - 5*l -12*h;
// GL11.glTranslated(0, 0, 1);
// if(row[w]!=null && i<=limiter)
// {
// i++;
// RenderItem.getInstance().renderItemIntoGUI(mc.fontRendererObj, mc.renderEngine, row[w], x+xx, y+yy);
// if(mouseX>=x+xx&&mouseX<x+xx+16 && mouseY>=y+yy&&mouseY<y+yy+16)
// highlighted = row[w];
// }
// }
// }
// }
// GL11.glTranslated(0, 0, -i);
// RenderHelper.disableStandardItemLighting();
// GL11.glDisable(GL12.GL_RESCALE_NORMAL);
// GL11.glPopMatrix();
//
// GL11.glEnable(GL11.GL_BLEND);
// GL11.glEnable(GL11.GL_DEPTH_TEST);
//
// mc.fontRendererObj.setUnicodeFlag(false);
// if(highlighted!=null && renderMouseOver)
// guiBase.renderToolTip(highlighted, mouseX, mouseY);
// RenderHelper.disableStandardItemLighting();
//
//// mc.fontRendererObj.setUnicodeFlag(true);
//// if(localizedText!=null&&!localizedText.isEmpty())
//// manual.fontRendererObj.drawSplitString(localizedText, x,y+yOffTotal, 120, manual.getTextColour());
// }
// }
//}

View File

@ -1,96 +0,0 @@
//package WayofTime.alchemicalWizardry.api.guide;
//
//import java.util.List;
//
//import net.minecraft.item.ItemStack;
//import WayofTime.alchemicalWizardry.ModBlocks;
//import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
//import WayofTime.alchemicalWizardry.api.rituals.Rituals;
//
//public class PageRitualMultiBlock extends PageMultiBlock
//{
// private static ItemStack blankStone;
// private static ItemStack waterStone;
// private static ItemStack fireStone;
// private static ItemStack earthStone;
// private static ItemStack airStone;
// private static ItemStack duskStone;
// private static ItemStack dawnStone;
// static
// {
// blankStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.BLANK);
// waterStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.WATER);
// fireStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.FIRE);
// earthStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.EARTH);
// airStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.AIR);
// duskStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.DUSK);
// dawnStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.DAWN);
// }
//
// private PageRitualMultiBlock(ItemStack[][][] structure)
// {
// super(structure);
// }
//
// public static PageRitualMultiBlock getPageForRitual(String ritualID)
// {
// return getPageForRitual(Rituals.getRitualList(ritualID));
// }
//
// public static PageRitualMultiBlock getPageForRitual(List<RitualComponent> ritualComponents)
// {
// int minX = 0;
// int minY = 0;
// int minZ = 0;
//
// int maxX = 0;
// int maxY = 0;
// int maxZ = 0;
//
// for(RitualComponent comp : ritualComponents)
// {
// minX = Math.min(comp.getX(), minX);
// minY = Math.min(comp.getY(), minY);
// minZ = Math.min(comp.getZ(), minZ);
//
// maxX = Math.max(comp.getX(), maxX);
// maxY = Math.max(comp.getY(), maxY);
// maxZ = Math.max(comp.getZ(), maxZ);
// }
//
// System.out.println("Min: (" + minX + ", " + minY + ", " + minZ + "), Max: (" + maxX + ", " + maxY + ", " + maxZ + ")");
//
// ItemStack[][][] tempStructure = new ItemStack[maxY-minY+1][maxX-minX+1][maxZ-minZ+1]; //First value is vertical, second is down to the left, third is down to the right
//
// for(RitualComponent comp : ritualComponents)
// {
// tempStructure[comp.getY() - minY][comp.getX() - minX][comp.getZ() - minZ] = getStackForRitualStone(comp.getStoneType());
// }
//
// tempStructure[-minY][-minX][-minZ] = new ItemStack(ModBlocks.blockMasterStone);
//
// return new PageRitualMultiBlock(tempStructure);
// }
//
// private static ItemStack getStackForRitualStone(int type)
// {
// switch(type)
// {
// case RitualComponent.BLANK:
// return blankStone;
// case RitualComponent.WATER:
// return waterStone;
// case RitualComponent.FIRE:
// return fireStone;
// case RitualComponent.EARTH:
// return earthStone;
// case RitualComponent.AIR:
// return airStone;
// case RitualComponent.DUSK:
// return duskStone;
// case RitualComponent.DAWN:
// return dawnStone;
// }
// return blankStone;
// }
//}

View File

@ -1,35 +0,0 @@
package WayofTime.alchemicalWizardry.api.harvest;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
public class HarvestRegistry
{
public static List<IHarvestHandler> handlerList = new ArrayList<IHarvestHandler>();
public static void registerHarvestHandler(IHarvestHandler handler)
{
handlerList.add(handler);
}
public static boolean harvestBlock(World world, BlockPos pos)
{
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
for (IHarvestHandler handler : handlerList)
{
if (handler.harvestAndPlant(world, pos, block, state))
{
return true;
}
}
return false;
}
}

View File

@ -1,18 +0,0 @@
package WayofTime.alchemicalWizardry.api.harvest;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
public interface IHarvestHandler
{
/**
* A handler that is used to harvest and replant the block at the specified location
*
* @param world
* @param block block at this given location
* @return true if successfully harvested, false if not
*/
boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state);
}

View File

@ -0,0 +1,8 @@
package WayofTime.alchemicalWizardry.api.iface;
import WayofTime.alchemicalWizardry.api.enumeration.EnumAltarComponent;
public interface IAltarComponent {
EnumAltarComponent getType(int meta);
}

View File

@ -0,0 +1,17 @@
package WayofTime.alchemicalWizardry.api.iface;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Implement this interface on any Item that can be bound to a player.
*/
public interface IBindable {
/**
* Called when the player attempts to bind the item.
*
* If false, binding fails.
*/
boolean onBind(EntityPlayer player, ItemStack stack);
}

View File

@ -0,0 +1,40 @@
package WayofTime.alchemicalWizardry.api.iface;
public interface IBloodAltar {
int getCapacity();
int getCurrentBlood();
int getTier();
int getProgress();
float getSacrificeMultiplier();
float getSelfSacrificeMultiplier();
float getOrbMultiplier();
float getDislocationMultiplier();
int getBufferCapacity();
void sacrificialDaggerCall(int amount, boolean b);
void startCycle();
/**
* Will set the altar to initiate a cooldown cycle after it crafts before starting to craft again, giving the user time to interact with the altar.
* This can only be set while the altar is not active.
*
* @param cooldown - How long the cooldown should last
*/
void requestPauseAfterCrafting(int cooldown);
void addToDemonBloodDuration(int dur);
boolean hasDemonBlood();
void decrementDemonBlood();
}

View File

@ -1,6 +0,0 @@
package WayofTime.alchemicalWizardry.api.items;
public interface IAltarManipulator
{
}

View File

@ -1,803 +0,0 @@
package WayofTime.alchemicalWizardry.api.items;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.util.Constants;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.api.spell.SpellEffect;
import WayofTime.alchemicalWizardry.api.spell.SpellParadigmTool;
public class ItemSpellMultiTool extends Item
{
private static final String harvestLevelSuffix = "harvestLvl";
private static final String digLevelSuffix = "digLvl";
private static final String tagName = "BloodMagicTool";
private Random rand = new Random();
public ItemSpellMultiTool()
{
super();
this.setMaxDamage(0);
this.setMaxStackSize(1);
this.setFull3D();
}
@Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
float damage = this.getCustomItemAttack(par1ItemStack);
float f = (float)par3EntityLivingBase.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
SpellParadigmTool parad = this.loadParadigmFromStack(par1ItemStack);
if (parad != null)
{
parad.onLeftClickEntity(par1ItemStack, par2EntityLivingBase, par3EntityLivingBase);
}
damage += parad.getAddedDamageForEntity(par2EntityLivingBase);
if (rand.nextFloat() < this.getCritChance(par1ItemStack))
{
damage *= 1.75f;
}
damage *= f;
if (par3EntityLivingBase instanceof EntityPlayer)
{
par2EntityLivingBase.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) par3EntityLivingBase), damage);
} else
{
par2EntityLivingBase.attackEntityFrom(DamageSource.causeMobDamage(par3EntityLivingBase), damage);
}
return true;
}
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
SpellParadigmTool parad = this.loadParadigmFromStack(stack);
if (parad != null && entity instanceof EntityLivingBase)
{
parad.onLeftClickEntity(stack, (EntityLivingBase) entity, player);
}
return false;
}
@Override
public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player)
{
if (player.worldObj.isRemote)
{
return false;
}
if (!stack.hasTagCompound())
return false;
World world = player.worldObj;
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
if (block == null || block == Blocks.air)
return false;
int hlvl = -1;
float blockHardness = block.getBlockHardness(world, pos);
MovingObjectPosition mop = APISpellHelper.raytraceFromEntity(world, player, true, 5.0D);
IBlockState localState = world.getBlockState(pos);
Block localBlock = state.getBlock();
String toolClass = block.getHarvestTool(state);
if (toolClass != null && this.getHarvestLevel(stack, toolClass) != -1)
hlvl = block.getHarvestLevel(state);
int toolLevel = this.getHarvestLevel(stack, toolClass);
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, pos);
if (hlvl <= toolLevel && localHardness - 1.5 <= blockHardness)
{
boolean cancelHarvest = false;
if (!cancelHarvest)
{
if (localBlock != null && !(localHardness < 0))
{
boolean isEffective = false;
String localToolClass = this.getToolClassForMaterial(localBlock.getMaterial());
if (localToolClass != null && this.getHarvestLevel(stack, toolClass) >= localBlock.getHarvestLevel(localState))
{
isEffective = true;
}
if (localBlock.getMaterial().isToolNotRequired())
{
isEffective = true;
}
if (!player.capabilities.isCreativeMode)
{
if (isEffective)
{
if (localBlock.removedByPlayer(world, pos, player, true))
{
localBlock.onBlockDestroyedByPlayer(world, pos, localState);
}
localBlock.onBlockHarvested(world, pos, localState, player);
if (blockHardness > 0f)
onBlockDestroyed(stack, world, localBlock, pos, player);
List<ItemStack> items = APISpellHelper.getItemsFromBlock(world, pos, localBlock, localState, this.getSilkTouch(stack), this.getFortuneLevel(stack));
SpellParadigmTool parad = this.loadParadigmFromStack(stack);
List<ItemStack> newItems = parad.handleItemList(stack, items);
if (!world.isRemote)
{
APISpellHelper.spawnItemListInWorld(newItems, world, pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f);
}
world.markBlockForUpdate(pos);
int cost = 0;
cost += parad.digSurroundingArea(stack, world, player, mop, localToolClass, localHardness, toolLevel, this);
cost += parad.onBreakBlock(stack, world, player, localBlock, localState, pos, mop.field_178784_b);
if (cost > 0)
{
SoulNetworkHandler.syphonAndDamageFromNetwork(stack, player, cost);
}
} else
{
world.setBlockToAir(pos);
world.markBlockForUpdate(pos);
}
} else
{
world.setBlockToAir(pos);
world.markBlockForUpdate(pos);
}
}
}
}
// if (!world.isRemote)
// world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
return true;
}
public Material[] getMaterialsForToolclass(String toolClass)
{
if ("pickaxe".equals(toolClass))
{
return new Material[]{Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits};
} else if ("shovel".equals(toolClass))
{
return new Material[]{Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay};
} else if ("axe".equals(toolClass))
{
return new Material[]{Material.wood, Material.vine, Material.circuits, Material.cactus};
}
return new Material[0];
}
public String getToolClassForMaterial(Material mat)
{
String testString = "pickaxe";
Material[] matList = this.getMaterialsForToolclass(testString);
for (int i = 0; i < matList.length; i++)
{
if (matList[i] == mat)
{
return testString;
}
}
testString = "shovel";
matList = this.getMaterialsForToolclass(testString);
for (int i = 0; i < matList.length; i++)
{
if (matList[i] == mat)
{
return testString;
}
}
testString = "axe";
matList = this.getMaterialsForToolclass(testString);
for (int i = 0; i < matList.length; i++)
{
if (matList[i] == mat)
{
return testString;
}
}
return null;
}
public Set<String> getToolClasses(ItemStack stack)
{
Set<String> set = new HashSet<String>();
if (this.getHarvestLevel(stack, "pickaxe") > -1)
{
set.add("pickaxe");
}
if (this.getHarvestLevel(stack, "axe") > -1)
{
set.add("axe");
}
if (this.getHarvestLevel(stack, "shovel") > -1)
{
set.add("shovel");
}
return set;
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state)
{
Block block = state.getBlock();
String toolClass = block.getHarvestTool(state);
if (toolClass == null || toolClass.equals(""))
{
return 1.0f;
}
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
return tag.getFloat(digLevelSuffix + toolClass);
} else
{
stack.setTagCompound(new NBTTagCompound());
}
}
return 1.0f;
}
@Override
public int getHarvestLevel(ItemStack stack, String toolClass)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
if (tag.hasKey(harvestLevelSuffix + toolClass))
{
return tag.getInteger(harvestLevelSuffix + toolClass);
} else
{
return -1;
}
} else
{
stack.setTagCompound(new NBTTagCompound());
}
return -1;
}
@Override
public boolean canHarvestBlock(Block par1Block, ItemStack itemStack)
{
return true;
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return false;
}
@Override
public void onUpdate(ItemStack toolStack, World world, Entity par3Entity, int par4, boolean par5)
{
if (world.isRemote)
{
return;
}
SpellParadigmTool parad = this.loadParadigmFromStack(toolStack);
int cost = parad.onUpdate(toolStack, world, par3Entity, par4, par5);
if (par3Entity instanceof EntityPlayer && cost > 0)
SoulNetworkHandler.syphonAndDamageFromNetwork(toolStack, (EntityPlayer) par3Entity, cost);
int duration = Math.max(this.getDuration(toolStack, world), 0);
if (duration <= 0 && par3Entity instanceof EntityPlayer)
{
int banishCost = parad.onBanishTool(toolStack, world, par3Entity, par4, par5);
SoulNetworkHandler.syphonAndDamageFromNetwork(toolStack, (EntityPlayer) par3Entity, banishCost);
((EntityPlayer) par3Entity).inventory.mainInventory[par4] = this.getContainedCrystal(toolStack);
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (par3EntityPlayer.isSneaking())
{
par3EntityPlayer.setCurrentItemOrArmor(0, this.getContainedCrystal(par1ItemStack));
return par1ItemStack;
}
SpellParadigmTool parad = this.loadParadigmFromStack(par1ItemStack);
MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
int cost;
if (mop != null && mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK))
{
cost = parad.onRightClickBlock(par1ItemStack, par3EntityPlayer, par2World, mop);
} else
{
cost = parad.onRightClickAir(par1ItemStack, par2World, par3EntityPlayer);
}
if (cost > 0)
{
SoulNetworkHandler.syphonAndDamageFromNetwork(par1ItemStack, par3EntityPlayer, cost);
}
return par1ItemStack;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("A mace filled with ancient alchemy");
if (!(par1ItemStack.getTagCompound() == null))
{
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
{
par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName"));
}
for (String str : this.getToolListString(par1ItemStack))
{
par3List.add(str);
}
par3List.add("");
float damage = this.getCustomItemAttack(par1ItemStack);
par3List.add("\u00A79+" + ((int) (damage * 10)) / 10.0f + " " + "Attack Damage");
float critChance = ((int) (this.getCritChance(par1ItemStack) * 1000)) / 10.0f;
par3List.add("\u00A79+" + critChance + "% " + "Crit Chance");
}
}
//--------------Custom methods--------------//
public void setHarvestLevel(ItemStack stack, String toolClass, int harvestLevel)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setInteger(harvestLevelSuffix + toolClass, Math.max(-1, harvestLevel));
stack.getTagCompound().setTag(tagName, tag);
} else
{
stack.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setInteger(harvestLevelSuffix + toolClass, Math.max(-1, harvestLevel));
stack.getTagCompound().setTag(tagName, tag);
}
}
public void setDigSpeed(ItemStack stack, String toolClass, float digSpeed)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setFloat(digLevelSuffix + toolClass, digSpeed);
stack.getTagCompound().setTag(tagName, tag);
} else
{
stack.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setFloat(digLevelSuffix + toolClass, digSpeed);
stack.getTagCompound().setTag(tagName, tag);
}
}
public float getDigSpeed(ItemStack stack, String toolClass)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
return tag.getFloat(digLevelSuffix + toolClass);
} else
{
stack.setTagCompound(new NBTTagCompound());
return 0.0f;
}
}
public void setItemAttack(ItemStack stack, float damage)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setFloat("itemAttack", Math.max(damage, 0.0f));
stack.getTagCompound().setTag(tagName, tag);
} else
{
stack.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setFloat("itemAttack", Math.max(damage, 0.0f));
stack.getTagCompound().setTag(tagName, tag);
}
}
public float getCustomItemAttack(ItemStack stack)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
return tag.getFloat("itemAttack");
} else
{
stack.setTagCompound(new NBTTagCompound());
return 0.0f;
}
}
public ItemStack getContainedCrystal(ItemStack container)
{
if (container.hasTagCompound())
{
NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName).getCompoundTag("heldItem");
return ItemStack.loadItemStackFromNBT(tag);
} else
{
container.setTagCompound(new NBTTagCompound());
return null;
}
}
public void setContainedCrystal(ItemStack container, ItemStack crystal)
{
if (container.hasTagCompound())
{
NBTTagCompound compTag = container.getTagCompound().getCompoundTag(tagName);
NBTTagCompound tag = compTag.getCompoundTag("heldItem");
crystal.writeToNBT(tag);
compTag.setTag("heldItem", tag);
container.getTagCompound().setTag(tagName, compTag);
} else
{
container.setTagCompound(new NBTTagCompound());
NBTTagCompound compTag = container.getTagCompound().getCompoundTag(tagName);
NBTTagCompound tag = compTag.getCompoundTag("heldItem");
crystal.writeToNBT(tag);
compTag.setTag("heldItem", tag);
container.getTagCompound().setTag(tagName, compTag);
}
}
public void setDuration(ItemStack container, World world, int duration)
{
if (!world.isRemote)
{
World overWorld = DimensionManager.getWorld(0);
long worldtime = overWorld.getTotalWorldTime();
if (container.hasTagCompound())
{
NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName);
tag.setLong("duration", Math.max(duration + worldtime, worldtime));
container.getTagCompound().setTag(tagName, tag);
} else
{
container.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName);
tag.setLong("duration", Math.max(duration + worldtime, worldtime));
container.getTagCompound().setTag(tagName, tag);
}
}
}
public int getDuration(ItemStack container, World world)
{
if (world.isRemote)
{
return 0;
} else
{
World overWorld = DimensionManager.getWorld(0);
long worldtime = overWorld.getTotalWorldTime();
if (container.hasTagCompound())
{
NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName);
return (int) (tag.getLong("duration") - worldtime);
} else
{
container.setTagCompound(new NBTTagCompound());
return 0;
}
}
}
public void loadParadigmIntoStack(ItemStack container, List<SpellEffect> list)
{
if (!container.hasTagCompound())
{
container.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName);
NBTTagList effectList = new NBTTagList();
for (SpellEffect eff : list)
{
effectList.appendTag(eff.getTag());
}
tagiest.setTag("Effects", effectList);
container.getTagCompound().setTag(tagName, tagiest);
}
public SpellParadigmTool loadParadigmFromStack(ItemStack container)
{
if (!container.hasTagCompound())
{
container.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName);
NBTTagList tagList = tagiest.getTagList("Effects", Constants.NBT.TAG_COMPOUND);
List<SpellEffect> spellEffectList = new LinkedList<SpellEffect>();
for (int i = 0; i < tagList.tagCount(); i++)
{
NBTTagCompound tag = tagList.getCompoundTagAt(i);
SpellEffect eff = SpellEffect.getEffectFromTag(tag);
if (eff != null)
{
spellEffectList.add(eff);
}
}
return SpellParadigmTool.getParadigmForEffectArray(spellEffectList);
}
public void setSilkTouch(ItemStack stack, boolean silkTouch)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setBoolean("silkTouch", silkTouch);
stack.getTagCompound().setTag(tagName, tag);
} else
{
stack.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setBoolean("silkTouch", silkTouch);
stack.getTagCompound().setTag(tagName, tag);
}
}
public boolean getSilkTouch(ItemStack stack)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
return tag.getBoolean("silkTouch");
} else
{
stack.setTagCompound(new NBTTagCompound());
return false;
}
}
public void setFortuneLevel(ItemStack stack, int fortune)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setInteger("fortuneLevel", Math.max(fortune, 0));
stack.getTagCompound().setTag(tagName, tag);
} else
{
stack.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
tag.setInteger("fortuneLevel", Math.max(fortune, 0));
stack.getTagCompound().setTag(tagName, tag);
}
}
public int getFortuneLevel(ItemStack stack)
{
if (stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName);
return tag.getInteger("fortuneLevel");
} else
{
stack.setTagCompound(new NBTTagCompound());
return 0;
}
}
public List<String> getToolListString(ItemStack container)
{
if (!container.hasTagCompound())
{
container.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName);
NBTTagList tagList = tagiest.getTagList("ToolTips", Constants.NBT.TAG_COMPOUND);
List<String> toolTipList = new LinkedList<String>();
for (int i = 0; i < tagList.tagCount(); i++)
{
NBTTagCompound tag = tagList.getCompoundTagAt(i);
String str = tag.getString("tip");
if (str != null)
{
toolTipList.add(str);
}
}
return toolTipList;
}
public void setToolListString(ItemStack container, List<String> toolTipString)
{
if (!container.hasTagCompound())
{
container.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName);
NBTTagList stringList = new NBTTagList();
for (String str : toolTipString)
{
NBTTagCompound tag = new NBTTagCompound();
tag.setString("tip", str);
stringList.appendTag(tag);
}
tagiest.setTag("ToolTips", stringList);
container.getTagCompound().setTag(tagName, tagiest);
}
public void setCritChance(ItemStack container, float chance)
{
if (container.hasTagCompound())
{
NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName);
tag.setFloat("critChance", Math.max(chance, 0));
container.getTagCompound().setTag(tagName, tag);
} else
{
container.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName);
tag.setFloat("critChance", Math.max(chance, 0));
container.getTagCompound().setTag(tagName, tag);
}
}
public float getCritChance(ItemStack container)
{
if (container.hasTagCompound())
{
NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName);
return tag.getFloat("critChance");
} else
{
container.setTagCompound(new NBTTagCompound());
return 0;
}
}
}

View File

@ -1,287 +0,0 @@
package WayofTime.alchemicalWizardry.api.items;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import net.minecraft.block.Block;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
/**
* Shaped Blood Orb Recipe Handler by joshie *
*/
public class ShapedBloodOrbRecipe implements IRecipe
{
private static final int MAX_CRAFT_GRID_WIDTH = 3;
private static final int MAX_CRAFT_GRID_HEIGHT = 3;
private ItemStack output = null;
private Object[] input = null;
public int width = 0;
public int height = 0;
private boolean mirrored = true;
public ShapedBloodOrbRecipe(Block result, Object... recipe)
{
this(new ItemStack(result), recipe);
}
public ShapedBloodOrbRecipe(Item result, Object... recipe)
{
this(new ItemStack(result), recipe);
}
public ShapedBloodOrbRecipe(ItemStack result, Object... recipe)
{
output = result.copy();
String shape = "";
int idx = 0;
if (recipe[idx] instanceof Boolean)
{
mirrored = (Boolean) recipe[idx];
if (recipe[idx + 1] instanceof Object[])
{
recipe = (Object[]) recipe[idx + 1];
} else
{
idx = 1;
}
}
if (recipe[idx] instanceof String[])
{
String[] parts = ((String[]) recipe[idx++]);
for (String s : parts)
{
width = s.length();
shape += s;
}
height = parts.length;
} else
{
while (recipe[idx] instanceof String)
{
String s = (String) recipe[idx++];
shape += s;
width = s.length();
height++;
}
}
if (width * height != shape.length())
{
String ret = "Invalid shaped ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
HashMap<Character, Object> itemMap = new HashMap<Character, Object>();
for (; idx < recipe.length; idx += 2)
{
Character chr = (Character) recipe[idx];
Object in = recipe[idx + 1];
if (in instanceof IBloodOrb || (in instanceof ItemStack && ((ItemStack) in).getItem() instanceof IBloodOrb))
{ //If the item is an instanceof IBloodOrb then save the level of the orb
if (in instanceof ItemStack)
itemMap.put(chr, ((IBloodOrb) ((ItemStack) in).getItem()).getOrbLevel());
else itemMap.put(chr, ((IBloodOrb) in).getOrbLevel());
} else if (in instanceof ItemStack)
{
itemMap.put(chr, ((ItemStack) in).copy());
} else if (in instanceof Item)
{
itemMap.put(chr, new ItemStack((Item) in));
} else if (in instanceof Block)
{
itemMap.put(chr, new ItemStack((Block) in, 1, OreDictionary.WILDCARD_VALUE));
} else if (in instanceof String)
{
itemMap.put(chr, OreDictionary.getOres((String) in));
} else
{
String ret = "Invalid shaped ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
input = new Object[width * height];
int x = 0;
for (char chr : shape.toCharArray())
{
input[x++] = itemMap.get(chr);
}
}
ShapedBloodOrbRecipe(ShapedRecipes recipe, Map<ItemStack, String> replacements)
{
output = recipe.getRecipeOutput();
width = recipe.recipeWidth;
height = recipe.recipeHeight;
input = new Object[recipe.recipeItems.length];
for (int i = 0; i < input.length; i++)
{
ItemStack ingred = recipe.recipeItems[i];
if (ingred == null)
continue;
input[i] = recipe.recipeItems[i];
for (Entry<ItemStack, String> replace : replacements.entrySet())
{
if (OreDictionary.itemMatches(replace.getKey(), ingred, true))
{
input[i] = OreDictionary.getOres(replace.getValue());
break;
}
}
}
}
@Override
public ItemStack getCraftingResult(InventoryCrafting var1)
{
return output.copy();
}
@Override
public int getRecipeSize()
{
return input.length;
}
@Override
public ItemStack getRecipeOutput()
{
return output;
}
@Override
public boolean matches(InventoryCrafting inv, World world)
{
for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
{
for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
{
if (checkMatch(inv, x, y, false))
{
return true;
}
if (mirrored && checkMatch(inv, x, y, true))
{
return true;
}
}
}
return false;
}
@SuppressWarnings("unchecked")
private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror)
{
for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++)
{
for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++)
{
int subX = x - startX;
int subY = y - startY;
Object target = null;
if (subX >= 0 && subY >= 0 && subX < width && subY < height)
{
if (mirror)
{
target = input[width - subX - 1 + subY * width];
} else
{
target = input[subX + subY * width];
}
}
ItemStack slot = inv.getStackInRowAndColumn(x, y);
//If target is integer, then we should be check the blood orb value of the item instead
if (target instanceof Integer)
{
if (slot != null && slot.getItem() instanceof IBloodOrb)
{
IBloodOrb orb = (IBloodOrb) slot.getItem();
if (orb.getOrbLevel() < (Integer) target)
{
return false;
}
} else return false;
} else if (target instanceof ItemStack)
{
if (!OreDictionary.itemMatches((ItemStack) target, slot, false))
{
return false;
}
} else if (target instanceof ArrayList)
{
boolean matched = false;
Iterator<ItemStack> itr = ((ArrayList<ItemStack>) target).iterator();
while (itr.hasNext() && !matched)
{
matched = OreDictionary.itemMatches(itr.next(), slot, false);
}
if (!matched)
{
return false;
}
} else if (target == null && slot != null)
{
return false;
}
}
}
return true;
}
public ShapedBloodOrbRecipe setMirrored(boolean mirror)
{
mirrored = mirror;
return this;
}
public Object[] getInput()
{
return this.input;
}
@Override
public ItemStack[] func_179532_b(InventoryCrafting inventory)
{
return new ItemStack[1];
}
}

View File

@ -1,186 +0,0 @@
package WayofTime.alchemicalWizardry.api.items;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import net.minecraft.block.Block;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
/**
* Shapeless Blood Orb Recipe Handler by joshie *
*/
public class ShapelessBloodOrbRecipe implements IRecipe
{
private ItemStack output = null;
private ArrayList<Object> input = new ArrayList<Object>();
public ShapelessBloodOrbRecipe(Block result, Object... recipe)
{
this(new ItemStack(result), recipe);
}
public ShapelessBloodOrbRecipe(Item result, Object... recipe)
{
this(new ItemStack(result), recipe);
}
public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe)
{
output = result.copy();
for (Object in : recipe)
{
if (in instanceof IBloodOrb)
{ //If the item is an instanceof IBloodOrb then save the level of the orb
input.add(((IBloodOrb) in).getOrbLevel());
}
else if (in instanceof ItemStack)
{
if (((ItemStack)in).getItem() instanceof IBloodOrb)
{
input.add(((IBloodOrb) ((ItemStack)in).getItem()).getOrbLevel());
}
else input.add(((ItemStack) in).copy());
} else if (in instanceof Item)
{
input.add(new ItemStack((Item) in));
} else if (in instanceof Block)
{
input.add(new ItemStack((Block) in));
} else if (in instanceof String)
{
input.add(OreDictionary.getOres((String) in));
} else
{
String ret = "Invalid shapeless ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
}
@SuppressWarnings("unchecked")
ShapelessBloodOrbRecipe(ShapelessRecipes recipe, Map<ItemStack, String> replacements)
{
output = recipe.getRecipeOutput();
for (ItemStack ingred : ((List<ItemStack>) recipe.recipeItems))
{
Object finalObj = ingred;
for (Entry<ItemStack, String> replace : replacements.entrySet())
{
if (OreDictionary.itemMatches(replace.getKey(), ingred, false))
{
finalObj = OreDictionary.getOres(replace.getValue());
break;
}
}
input.add(finalObj);
}
}
@Override
public int getRecipeSize()
{
return input.size();
}
@Override
public ItemStack getRecipeOutput()
{
return output;
}
@Override
public ItemStack getCraftingResult(InventoryCrafting var1)
{
return output.copy();
}
@SuppressWarnings("unchecked")
@Override
public boolean matches(InventoryCrafting var1, World world)
{
ArrayList<Object> required = new ArrayList<Object>(input);
for (int x = 0; x < var1.getSizeInventory(); x++)
{
ItemStack slot = var1.getStackInSlot(x);
if (slot != null)
{
boolean inRecipe = false;
Iterator<Object> req = required.iterator();
while (req.hasNext())
{
boolean match = false;
Object next = req.next();
//If target is integer, then we should be check the blood orb value of the item instead
if (next instanceof Integer)
{
if (slot.getItem() instanceof IBloodOrb)
{
IBloodOrb orb = (IBloodOrb) slot.getItem();
if (orb.getOrbLevel() < (Integer) next)
{
return false;
}
} else return false;
match = true;
} else if (next instanceof ItemStack)
{
match = OreDictionary.itemMatches((ItemStack) next, slot, false);
} else if (next instanceof ArrayList)
{
Iterator<ItemStack> itr = ((ArrayList<ItemStack>) next).iterator();
while (itr.hasNext() && !match)
{
match = OreDictionary.itemMatches(itr.next(), slot, false);
}
}
if (match)
{
inRecipe = true;
required.remove(next);
break;
}
}
if (!inRecipe)
{
return false;
}
}
}
return required.isEmpty();
}
public ArrayList<Object> getInput()
{
return this.input;
}
@Override
public ItemStack[] func_179532_b(InventoryCrafting inventory)
{
return new ItemStack[1];
}
}

View File

@ -1,15 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface ArmourUpgrade
{
//Called when the armour ticks
void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack);
boolean isUpgrade();
int getEnergyForTenSeconds();
}

View File

@ -1,5 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
public interface IBindable
{
}

View File

@ -1,8 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
public interface IBloodOrb
{
int getMaxEssence();
int getOrbLevel();
}

View File

@ -1,6 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
public interface IHolding
{
}

View File

@ -1,8 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
import net.minecraft.item.ItemStack;
public interface ILPGauge
{
boolean canSeeLPBar(ItemStack itemStack);
}

View File

@ -1,9 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
/**
* Implement this interface to have reagent blocks return false on activating them, to allow manipulation of said block
*/
public interface IReagentManipulator
{
}

View File

@ -1,22 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
import net.minecraft.item.ItemStack;
public interface IRitualDiviner
{
int cycleDirection(ItemStack stack);
String getCurrentRitual(ItemStack stack);
int getDirection(ItemStack stack);
int getMaxRuneDisplacement(ItemStack stack);
String getNameForDirection(int direction);
void setCurrentRitual(ItemStack stack, String ritualID);
void setDirection(ItemStack stack, int direction);
void setMaxRuneDisplacement(ItemStack stack, int displacement);
}

View File

@ -1,4 +0,0 @@
package WayofTime.alchemicalWizardry.api.items.interfaces;
public interface ISigil {
}

View File

@ -0,0 +1,34 @@
package WayofTime.alchemicalWizardry.api.network;
import WayofTime.alchemicalWizardry.api.NBTHolder;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.WorldSavedData;
@Getter
@Setter
public class SoulNetwork extends WorldSavedData {
private int currentEssence;
private int maxOrb;
public SoulNetwork(String name) {
super(name);
currentEssence = 0;
maxOrb = 0;
}
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
currentEssence = nbttagcompound.getInteger(NBTHolder.NBT_CURRENTESSENCE);
maxOrb = nbttagcompound.getInteger(NBTHolder.NBT_MAXORB);
}
@Override
public void writeToNBT(NBTTagCompound nbttagcompound) {
nbttagcompound.setInteger(NBTHolder.NBT_CURRENTESSENCE, currentEssence);
nbttagcompound.setInteger(NBTHolder.NBT_MAXORB, maxOrb);
}
}

View File

@ -0,0 +1,69 @@
package WayofTime.alchemicalWizardry.api.orb;
import WayofTime.alchemicalWizardry.api.registry.OrbRegistry;
/**
* Base object for all Blood Orbs. Makes Orb creation quite a bit easier.
*
* Just create a new BloodOrb instance then register it with {@link OrbRegistry#registerOrb(BloodOrb)}
* This will allow the use of just one item ID for all orbs. If an addon dev needs more control over the intricacies
* of their orb (custom right clicking, renderers, etc), they can just create their own item as normal.
*
*/
public class BloodOrb {
private String name;
private int tier;
private int capacity;
private String owner = "AlchemicalWizardry";
/**
* A base object for BloodOrbs. A bit cleaner than the
* old way through EnergyItems.
*
* @param name - A name for the Orb. Gets put into an unlocalized name.
* @param tier - The tier of the Orb.
* @param capacity - The max amount of LP the Orb can store.
*/
public BloodOrb(String name, int tier, int capacity) {
this.name = name;
this.tier = tier;
this.capacity = capacity;
}
public String getName() {
return name;
}
public int getTier() {
return tier;
}
public int getCapacity() {
return capacity;
}
public String getOwner() {
return owner;
}
/**
* For setting the MODID of the mod that creates the Orb. Not required, but preferred.
*
* @return - The BloodOrb object for further use.
*/
public BloodOrb setOwner(String owner) {
this.owner = owner;
return this;
}
@Override
public String toString() {
return "BloodOrb{" +
"name='" + name + '\'' +
", tier=" + tier +
", capacity=" + capacity +
", owner=" + owner +
'}';
}
}

View File

@ -0,0 +1,10 @@
package WayofTime.alchemicalWizardry.api.orb;
public interface IBloodOrb {
BloodOrb getOrb(int meta);
int getMaxEssence(int meta);
int getOrbLevel(int meta);
}

View File

@ -0,0 +1,4 @@
@API(owner = "AlchemicalWizardry", provides = "AlchemicalWizardry|API", apiVersion = "@VERSION@")
package WayofTime.alchemicalWizardry.api;
import net.minecraftforge.fml.common.API;

View File

@ -0,0 +1,25 @@
package WayofTime.alchemicalWizardry.api.registry;
import WayofTime.alchemicalWizardry.api.AlchemicalWizardryAPI;
import WayofTime.alchemicalWizardry.api.altar.AltarRecipe;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import lombok.Getter;
import net.minecraft.item.ItemStack;
public class AltarRecipeRegistry {
@Getter
private static BiMap<ItemStack, AltarRecipe> recipes = HashBiMap.create();
public static void registerRecipe(AltarRecipe recipe) {
if (!recipes.containsValue(recipe))
recipes.put(recipe.input, recipe);
else
AlchemicalWizardryAPI.getLogger().error("Error adding recipe for " + recipe.input.getDisplayName() + (recipe.output == null ? "" : " -> " + recipe.output.getDisplayName()) + ". Recipe already exists.");
}
public static AltarRecipe getRecipeForInput(ItemStack input) {
return recipes.get(input);
}
}

View File

@ -0,0 +1,62 @@
package WayofTime.alchemicalWizardry.api.registry;
import WayofTime.alchemicalWizardry.api.AlchemicalWizardryAPI;
import WayofTime.alchemicalWizardry.api.orb.BloodOrb;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
/**
* This is only for those who wish to add a basic {@link BloodOrb}. If you need custom handling,
* you will need your own item class.
*/
public class OrbRegistry {
@Getter
private static List<BloodOrb> orbs = new ArrayList<BloodOrb>();
public static void registerOrb(BloodOrb orb) {
if (!orbs.contains(orb))
orbs.add(orb);
else
AlchemicalWizardryAPI.getLogger().error("Error adding orb: " + orb.toString() + ". Orb already exists!");
}
@SideOnly(Side.CLIENT)
public static void registerOrbTexture(BloodOrb orb, String resourceLocation) {
int meta = getIndexOf(orb);
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
ModelBakery.addVariantName(AlchemicalWizardryAPI.getOrbItem(), resourceLocation);
renderItem.getItemModelMesher().register(AlchemicalWizardryAPI.getOrbItem(), meta, new ModelResourceLocation(resourceLocation, "inventory"));
}
public static BloodOrb getOrb(int index) {
return orbs.get(index);
}
public static int getIndexOf(BloodOrb orb) {
return orbs.indexOf(orb);
}
public static boolean isEmpty() {
return orbs.isEmpty();
}
public static int getSize() {
return orbs.size();
}
public static ItemStack getOrbStack(BloodOrb orb) {
return new ItemStack(AlchemicalWizardryAPI.getOrbItem(), 1, getIndexOf(orb));
}
}

View File

@ -1,15 +0,0 @@
package WayofTime.alchemicalWizardry.api.renderer;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
public abstract class MRSRenderer
{
public abstract void renderAt(IMasterRitualStone tile, double x, double y, double z);
protected void bindTexture(ResourceLocation location)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(location);
}
}

View File

@ -1,41 +0,0 @@
package WayofTime.alchemicalWizardry.api.rituals;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler;
public interface IMasterRitualStone extends ISegmentedReagentHandler
{
void performRitual(World world, BlockPos pos, String ritualID);
String getOwner();
void setCooldown(int newCooldown);
int getCooldown();
void setVar1(int newVar1);
int getVar1();
void setActive(boolean active);
int getDirection();
World getWorldObj();
BlockPos getPosition();
NBTTagCompound getCustomRitualTag();
void setCustomRitualTag(NBTTagCompound tag);
boolean areTanksEmpty();
int getRunningTime();
LocalRitualStorage getLocalStorage();
void setLocalStorage(LocalRitualStorage storage);
}

View File

@ -1,18 +0,0 @@
package WayofTime.alchemicalWizardry.api.rituals;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
public interface IRitualStone
{
/**
* x, y, and z give the position of the Ritual Stone
* @param world
* @param pos
* @param state
* @param runeType
* @return
*/
boolean isRuneType(World world, BlockPos pos, IBlockState state, int runeType);
}

View File

@ -1,6 +0,0 @@
package WayofTime.alchemicalWizardry.api.rituals;
public interface ITileRitualStone
{
boolean isRuneType(int runeType);
}

View File

@ -1,36 +0,0 @@
package WayofTime.alchemicalWizardry.api.rituals;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
/**
* This class is used to pass ritual-specific data into the RitualEffect from the containing Master Ritual Stone. This is basically used as auxillarary storage,
* for when simply storing to NBT becomes... difficult.
*
*/
public class LocalRitualStorage
{
public BlockPos coords;
public void writeToNBT(NBTTagCompound tag)
{
tag.setInteger("xCoord", coords.getX());
tag.setInteger("yCoord", coords.getY());
tag.setInteger("zCoord", coords.getZ());
}
public void readFromNBT(NBTTagCompound tag)
{
this.coords = new BlockPos(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord"));
}
public BlockPos getLocation()
{
return coords;
}
public void setLocation(BlockPos location)
{
this.coords = location;
}
}

View File

@ -1,11 +0,0 @@
package WayofTime.alchemicalWizardry.api.rituals;
public enum RitualBreakMethod
{
REDSTONE,
BREAK_MRS,
BREAK_STONE,
ACTIVATE, //When an activation crystal activates the MRS, overwriting the current ritual
DEACTIVATE,
EXPLOSION, //When the MRS is destroyed by an explosion
}

View File

@ -1,72 +0,0 @@
package WayofTime.alchemicalWizardry.api.rituals;
public class RitualComponent
{
private int x;
private int y;
private int z;
private int stoneType;
public static final int BLANK = 0;
public static final int WATER = 1;
public static final int FIRE = 2;
public static final int EARTH = 3;
public static final int AIR = 4;
public static final int DUSK = 5;
public static final int DAWN = 6;
public RitualComponent(int x, int y, int z, int stoneType)
{
this.x = x;
this.y = y;
this.z = z;
this.stoneType = stoneType;
}
public int getX()
{
return this.x;
}
public int getY()
{
return this.y;
}
public int getZ()
{
return this.z;
}
public int getX(int direction)
{
switch(direction)
{
case 2:
return -this.getZ();
case 3:
return -this.getX();
case 4:
return this.getZ();
default: return this.getX();
}
}
public int getZ(int direction)
{
switch(direction)
{
case 2:
return this.getX();
case 3:
return -this.getZ();
case 4:
return -this.getX();
default: return this.getZ();
}
}
public int getStoneType()
{
return this.stoneType;
}
}

View File

@ -1,87 +0,0 @@
package WayofTime.alchemicalWizardry.api.rituals;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
public abstract class RitualEffect
{
public abstract void performEffect(IMasterRitualStone ritualStone);
public boolean startRitual(IMasterRitualStone ritualStone, EntityPlayer player)
{
return true;
}
public void onRitualBroken(IMasterRitualStone ritualStone, RitualBreakMethod method) {}
public abstract int getCostPerRefresh();
public int getInitialCooldown()
{
return 0;
}
public abstract List<RitualComponent> getRitualComponentList();
public boolean canDrainReagent(IMasterRitualStone ritualStone, Reagent reagent, int amount, boolean doDrain)
{
if (ritualStone == null || reagent == null || amount == 0)
{
return false;
}
ReagentStack reagentStack = new ReagentStack(reagent, amount);
ReagentStack stack = ritualStone.drain(EnumFacing.UP, reagentStack, false);
if (stack != null && stack.amount >= amount)
{
if (doDrain)
{
ritualStone.drain(EnumFacing.UP, reagentStack, true);
}
return true;
}
return false;
}
public LocalRitualStorage getNewLocalStorage()
{
return new LocalRitualStorage();
}
public void addOffsetRunes(ArrayList<RitualComponent> ritualList, int off1, int off2, int y, int rune)
{
ritualList.add(new RitualComponent(off1, y, off2, rune));
ritualList.add(new RitualComponent(off2, y, off1, rune));
ritualList.add(new RitualComponent(off1, y, -off2, rune));
ritualList.add(new RitualComponent(-off2, y, off1, rune));
ritualList.add(new RitualComponent(-off1, y, off2, rune));
ritualList.add(new RitualComponent(off2, y, -off1, rune));
ritualList.add(new RitualComponent(-off1, y, -off2, rune));
ritualList.add(new RitualComponent(-off2, y, -off1, rune));
}
public void addCornerRunes(ArrayList<RitualComponent> ritualList, int off1, int y, int rune)
{
ritualList.add(new RitualComponent(off1, y, off1, rune));
ritualList.add(new RitualComponent(off1, y, -off1, rune));
ritualList.add(new RitualComponent(-off1, y, -off1, rune));
ritualList.add(new RitualComponent(-off1, y, off1, rune));
}
public void addParallelRunes(ArrayList<RitualComponent> ritualList, int off1, int y, int rune)
{
ritualList.add(new RitualComponent(off1, y, 0, rune));
ritualList.add(new RitualComponent(-off1, y, 0, rune));
ritualList.add(new RitualComponent(0, y, -off1, rune));
ritualList.add(new RitualComponent(0, y, off1, rune));
}
}

Some files were not shown because too many files have changed in this diff Show More