diff --git a/.arsmagica2_temp b/.arsmagica2_temp new file mode 160000 index 0000000..6d6b680 --- /dev/null +++ b/.arsmagica2_temp @@ -0,0 +1 @@ +Subproject commit 6d6b68002363b2569c2f2300c8f9146ad800bbc6 diff --git a/.gitignore b/.gitignore index e07776c..8f3d537 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,10 @@ Desktop.ini $RECYCLE.BIN/ .DS_Store /fb/ + +# Local toolchain (do not commit) +/gradle-4.4.1/ +/gradle-4.4.1-bin.zip +/zulu8.94.0.17-ca-jdk8.0.492-macosx_aarch64/ +/zulu8.94.0.17-ca-jdk8.0.492-macosx_aarch64.tar.gz +/.arsmagica2_temp/ diff --git a/build.gradle b/build.gradle index 21d01ec..5aa67aa 100644 --- a/build.gradle +++ b/build.gradle @@ -3,15 +3,15 @@ buildscript { mavenCentral() maven { name = "forge" - url = "http://files.minecraftforge.net/maven" + url = "https://maven.minecraftforge.net/" } maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" + name = "anatawa12" + url = "https://maven.anatawa12.com/" } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + classpath 'com.anatawa12.forge:ForgeGradle:1.2-1.0.+' } } @@ -35,40 +35,16 @@ minecraft { repositories { mavenLocal() - maven { - name = "ic2" - url = "http://maven.ic2.player.to/" - } - ivy { - name "BuildCraft" - artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]" - } maven { name = "chickenbones" url = "http://chickenbones.net/maven/" } - maven{ - name "tterrag Repo" - url "http://maven.tterrag.com/" - } maven { - url "http://jcenter.bintray.com" + url "https://jcenter.bintray.com" } maven { name 'Forge' - url 'http://files.minecraftforge.net/maven' - } - maven { - name "Mobius Repo" - url "http://mobiusstrip.eu/maven/" - } - maven { - name = "K4 maven" - url = "http://maven.k-4u.nl/" - } - maven { - name "FireBall API Depot" - url "http://dl.tsr.me/artifactory/libs-release-local" + url 'https://maven.minecraftforge.net/' } } diff --git a/find_prefixes.py b/find_prefixes.py new file mode 100644 index 0000000..27ff077 --- /dev/null +++ b/find_prefixes.py @@ -0,0 +1,63 @@ +import re +import sys + +def parse_strokesets(filepath): + with open(filepath, 'r') as f: + content = f.read() + + # Find all SymbolEffect additions. + # We will look for new StrokeSet(..., new byte[]{...}) + strokes = [] + + # Regex to match new StrokeSet(level, new byte[]{(byte)X, (byte)Y, ...}) + # We want to keep track of the spell name if possible, or just the byte arrays. + + # Actually, we can just find all new byte[]{(byte)X, ...} inside StrokeSet + matches = re.finditer(r'new\s+StrokeSet\s*\(\s*(\d+)\s*,\s*new\s+byte\s*\[\s*\]\s*\{([^}]+)\}\s*\)', content) + + for m in matches: + level = int(m.group(1)) + bytes_str = m.group(2) + # Extract numbers + nums = re.findall(r'\d+', bytes_str) + # The first number in each (byte)X is the stroke direction. + # Wait, the regex \d+ will capture the stroke numbers. + # Let's just strip (byte) and spaces. + stroke_list = [int(x.strip()) for x in bytes_str.replace('(byte)', '').split(',')] + + strokes.append((m.group(0), stroke_list, m.start(), m.end())) + + return strokes + +def main(): + filepath = sys.argv[1] + strokes = parse_strokesets(filepath) + + prefixes = [] + + for i in range(len(strokes)): + for j in range(len(strokes)): + if i == j: + continue + + str1 = strokes[i][1] + str2 = strokes[j][1] + + if len(str1) < len(str2): + if str2[:len(str1)] == str1: + prefixes.append((strokes[i], strokes[j])) + + # Print out the prefixes to modify. + seen = set() + for p1, p2 in prefixes: + # We only need to modify p1 (the shorter one) to make it not a prefix, OR p2. + # The user wants them unique. Usually changing the last stroke of the shorter one, + # or just adding a stroke to the shorter one. + # Actually we should just print them out. + if tuple(p1[1]) not in seen: + print(f"Prefix: {p1[1]} (Found in {p1[0]})") + print(f" Is prefix of: {p2[1]}") + seen.add(tuple(p1[1])) + +if __name__ == "__main__": + main() diff --git a/fix_mop.py b/fix_mop.py new file mode 100644 index 0000000..07eec1a --- /dev/null +++ b/fix_mop.py @@ -0,0 +1,17 @@ +import re + +file_path = "/Users/brianchirinos/Documents/WitcheryRepo/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/EffectRegistry.java" + +with open(file_path, "r") as f: + content = f.read() + +# Pattern 1: if (mop.typeOfHit -> if (mop != null && mop.typeOfHit +content = re.sub(r'if \(\s*mop\.typeOfHit', 'if (mop != null && mop.typeOfHit', content) +content = re.sub(r'else if \(\s*mop\.typeOfHit', 'else if (mop != null && mop.typeOfHit', content) + +# Pattern 2: int cx = mop.typeOfHit == -> if (mop == null) return; int cx = mop.typeOfHit == +content = re.sub(r'(int cx = mop\.typeOfHit == MovingObjectPosition\.MovingObjectType\.BLOCK \? mop\.blockX : \(int\)spell\.posX;)', r'if (mop == null) return;\n \1', content) + +with open(file_path, "w") as f: + f.write(content) +print("Done") diff --git a/make_unique.py b/make_unique.py new file mode 100644 index 0000000..094f606 --- /dev/null +++ b/make_unique.py @@ -0,0 +1,73 @@ +import re +import sys + +def make_unique(filepath): + with open(filepath, 'r') as f: + content = f.read() + + # Find all StrokeSets + matches = list(re.finditer(r'new\s+StrokeSet\s*\(\s*(\d+)\s*,\s*new\s+byte\s*\[\s*\]\s*\{([^}]+)\}\s*\)', content)) + + strokes = [] + for m in matches: + level = int(m.group(1)) + bytes_str = m.group(2) + stroke_list = [int(x.strip()) for x in bytes_str.replace('(byte)', '').split(',')] + strokes.append((m, stroke_list)) + + prefixes = set() + + for i in range(len(strokes)): + for j in range(len(strokes)): + if i == j: continue + str1 = strokes[i][1] + str2 = strokes[j][1] + + if len(str1) < len(str2): + if str2[:len(str1)] == str1: + prefixes.add(i) + + # We will modify the shorter strokes by appending one stroke to them. + # We will append `(byte)3` (which is typically 'Left') or something else if it creates another conflict. + # Let's just append `(byte)X` where X is the opposite of the next byte in the longer spell, + # but actually just appending a byte is fine as long as we check if it conflicts. + + all_stroke_tuples = {tuple(s[1]) for s in strokes} + + replacements = [] + for idx in prefixes: + m, s = strokes[idx] + + # Try appending 0, 1, 2, 3 until we find one that is not a prefix of anything, and doesn't exist. + for candidate in [0, 1, 2, 3]: + new_stroke = s + [candidate] + # check if new_stroke is a prefix of any other + is_prefix = False + for j in range(len(strokes)): + if idx == j: continue + s2 = strokes[j][1] + if len(new_stroke) <= len(s2) and s2[:len(new_stroke)] == new_stroke: + is_prefix = True + break + + if not is_prefix and tuple(new_stroke) not in all_stroke_tuples: + replacements.append((m, new_stroke)) + all_stroke_tuples.add(tuple(new_stroke)) + all_stroke_tuples.remove(tuple(s)) + break + + # Now we apply replacements in reverse order of match position to not mess up offsets. + replacements.sort(key=lambda x: x[0].start(), reverse=True) + + for m, new_stroke in replacements: + bytes_str = ",".join(f"(byte){b}" for b in new_stroke) + replacement_str = f"new StrokeSet({m.group(1)}, new byte[]{{{bytes_str}}})" + content = content[:m.start()] + replacement_str + content[m.end():] + + with open(filepath, 'w') as f: + f.write(content) + + print(f"Made {len(replacements)} strokes unique.") + +if __name__ == "__main__": + make_unique(sys.argv[1]) diff --git a/patch_lang.py b/patch_lang.py new file mode 100644 index 0000000..8864f53 --- /dev/null +++ b/patch_lang.py @@ -0,0 +1,31 @@ +import re + +with open('src/main/resources/assets/witchery/lang/en_US.lang', 'r') as f: + content = f.read() + +new_rituals_list = """[br]> [url=ritualreparo Reparo][br]> [url=ritualidentify Identify][br]> [url=ritualaparecium Aparecium][br]> [url=ritualvociferador Vociferador][br]> [url=rituallumosmaxima Lumos Maxima][br]> [url=ritualdimensionalanchor Dimensional Anchor][br]> [url=ritualempaticlink Empatic Link][br]> [url=ritualherbivicus Herbivicus][br]> [url=ritualmagicalprison Magical Prison]""" + +content = content.replace( + "[br]> [url=ritualfind Find Structure]", + "[br]> [url=ritualfind Find Structure]" + new_rituals_list +) + +new_rituals_text = """ +witchery:cauldronbook.ritualreparo=[h1 Ritual: Reparo]Repair damaged items. Draw a line of 5 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Diamond and Spectral Dust. +witchery:cauldronbook.ritualidentify=[h1 Ritual: Identify]Identify an unknown item. Draw a polygon of 4 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop an Eye of Ender and Exhale of the Horned One. +witchery:cauldronbook.ritualaparecium=[h1 Ritual: Aparecium]Reveal hidden things. Draw a polygon of 3 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Golden Carrot and Tear of the Goddess. +witchery:cauldronbook.ritualvociferador=[h1 Ritual: Vociferador]Create a howler. Draw a line of 5 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Jukebox and Mandrake Root. +witchery:cauldronbook.rituallumosmaxima=[h1 Ritual: Lumos Maxima]Create a powerful light. Draw a polygon of 5 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop Glowstone Dust and Breath of the Goddess. +witchery:cauldronbook.ritualdimensionalanchor=[h1 Ritual: Dimensional Anchor]Anchor a dimension. Draw a polygon of 5 red chalk:[br][img=witchery:textures/gui/circles_tinyred.png|center|top|32|32][br]Drop an Ender Pearl, Obsidian, and Charged Attuned Stone. +witchery:cauldronbook.ritualempaticlink=[h1 Ritual: Empatic Link]Create an empathic link. Draw a polygon of 6 infernal chalk:[br][img=witchery:textures/gui/circles_tinyinfernal.png|center|top|32|32][br]Drop a Golden Apple, Drop of Luck, and Brew of Love. +witchery:cauldronbook.ritualherbivicus=[h1 Ritual: Herbivicus]Accelerate plant growth. Draw a polygon of 4 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop Bonemeal and Mutandis Extremis. +witchery:cauldronbook.ritualmagicalprison=[h1 Ritual: Magical Prison]Trap an entity. Draw a polygon of 4 red chalk:[br][img=witchery:textures/gui/circles_tinyred.png|center|top|32|32][br]Drop a Web and Soul Sand. +""" + +content = content.replace( + "witchery:cauldronbook.ritualfind=[h1 Ritual: Find Structure]Summon a spirit that flys towards the closest village (or nether fortress). Draw a 3x3 white-chalk circle:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Subdued Spirit or Attuned Stone in the center and wait.", + "witchery:cauldronbook.ritualfind=[h1 Ritual: Find Structure]Summon a spirit that flys towards the closest village (or nether fortress). Draw a 3x3 white-chalk circle:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Subdued Spirit or Attuned Stone in the center and wait." + new_rituals_text +) + +with open('src/main/resources/assets/witchery/lang/en_US.lang', 'w') as f: + f.write(content) diff --git a/patch_lang_text.py b/patch_lang_text.py new file mode 100644 index 0000000..aee85f0 --- /dev/null +++ b/patch_lang_text.py @@ -0,0 +1,23 @@ +import re + +with open('src/main/resources/assets/witchery/lang/en_US.lang', 'r') as f: + content = f.read() + +new_rituals_text = """ +witchery:cauldronbook.ritualreparo=[h1 Ritual: Reparo]Repair damaged items. Draw a line of 5 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Diamond and Spectral Dust. +witchery:cauldronbook.ritualidentify=[h1 Ritual: Identify]Identify an unknown item. Draw a polygon of 4 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop an Eye of Ender and Exhale of the Horned One. +witchery:cauldronbook.ritualaparecium=[h1 Ritual: Aparecium]Reveal hidden things. Draw a polygon of 3 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Golden Carrot and Tear of the Goddess. +witchery:cauldronbook.ritualvociferador=[h1 Ritual: Vociferador]Create a howler. Draw a line of 5 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Jukebox and Mandrake Root. +witchery:cauldronbook.rituallumosmaxima=[h1 Ritual: Lumos Maxima]Create a powerful light. Draw a polygon of 5 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop Glowstone Dust and Breath of the Goddess. +witchery:cauldronbook.ritualdimensionalanchor=[h1 Ritual: Dimensional Anchor]Anchor a dimension. Draw a polygon of 5 otherwhere chalk:[br][img=witchery:textures/gui/circles_tinyred.png|center|top|32|32][br]Drop an Ender Pearl, Obsidian, and Charged Attuned Stone. +witchery:cauldronbook.ritualempaticlink=[h1 Ritual: Empatic Link]Create an empathic link. Draw a polygon of 6 infernal chalk:[br][img=witchery:textures/gui/circles_tinyinfernal.png|center|top|32|32][br]Drop a Golden Apple, Drop of Luck, and Brew of Love. +witchery:cauldronbook.ritualherbivicus=[h1 Ritual: Herbivicus]Accelerate plant growth. Draw a polygon of 4 white chalk:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Dye and Mutandis Extremis. +witchery:cauldronbook.ritualmagicalprison=[h1 Ritual: Magical Prison]Trap an entity. Draw a polygon of 4 otherwhere chalk:[br][img=witchery:textures/gui/circles_tinyred.png|center|top|32|32][br]Drop a Web and Soul Sand. +""" + +target = "witchery:cauldronbook.ritualfind=[h1 Ritual: Find Structure]Summon a spirit that flys towards the closest village (or nether fortress). Draw a 3x3 white-chalk circle:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Subdued Spirit or Attuned Stone in the center and wait." + +content = content.replace(target, target + new_rituals_text) + +with open('src/main/resources/assets/witchery/lang/en_US.lang', 'w') as f: + f.write(content) diff --git a/src/main/java/com/emoniph/witchery/Witchery.java b/src/main/java/com/emoniph/witchery/Witchery.java index 37e2981..1af63fa 100644 --- a/src/main/java/com/emoniph/witchery/Witchery.java +++ b/src/main/java/com/emoniph/witchery/Witchery.java @@ -12,6 +12,7 @@ import com.emoniph.witchery.client.KeyboardHandler; import com.emoniph.witchery.client.PlayerRender; import com.emoniph.witchery.common.ChantCommand; +import com.emoniph.witchery.common.CommandWitcheryLevel; import com.emoniph.witchery.common.CommonProxy; import com.emoniph.witchery.common.PowerSources; import com.emoniph.witchery.common.ServerTickEvents; @@ -280,6 +281,11 @@ public void postInit(FMLPostInitializationEvent event) { @EventHandler public void serverLoad(FMLServerStartingEvent event) { event.registerServerCommand(new ChantCommand()); + event.registerServerCommand(new CommandWitcheryLevel()); + event.registerServerCommand(new com.emoniph.witchery.commands.CommandImperio()); + event.registerServerCommand(new com.emoniph.witchery.commands.CommandHobgoblin()); + event.registerServerCommand(new com.emoniph.witchery.commands.CommandPet()); + event.registerServerCommand(new com.emoniph.witchery.commands.CommandCrucio()); PowerSources.initiate(); BlockAreaMarker.AreaMarkerRegistry.serverStart(); worldGenerator.initiate(); diff --git a/src/main/java/com/emoniph/witchery/WitcheryBlocks.java b/src/main/java/com/emoniph/witchery/WitcheryBlocks.java index 8567d54..411f51b 100644 --- a/src/main/java/com/emoniph/witchery/WitcheryBlocks.java +++ b/src/main/java/com/emoniph/witchery/WitcheryBlocks.java @@ -26,6 +26,7 @@ import com.emoniph.witchery.blocks.BlockDreamCatcher; import com.emoniph.witchery.blocks.BlockEmberMoss; import com.emoniph.witchery.blocks.BlockFetish; +import com.emoniph.witchery.blocks.BlockFlooFire; import com.emoniph.witchery.blocks.BlockFlowingSpirit; import com.emoniph.witchery.blocks.BlockForce; import com.emoniph.witchery.blocks.BlockFumeFunnel; @@ -211,6 +212,7 @@ public final class WitcheryBlocks { public final Block GLYPH_RITUAL; public final Block GLYPH_OTHERWHERE; public final Block GLYPH_INFERNAL; + public final Block FLOO_FIRE; public final Block FLOWING_SPIRIT; public final Block HOLLOW_TEARS; public final Block DISEASE; @@ -306,6 +308,7 @@ public WitcheryBlocks() { this.GLYPH_RITUAL = (new BlockCircleGlyph(0, false)).setBlockName("witchery:circleglyphritual").setBlockTextureName("witchery:circleglyph"); this.GLYPH_OTHERWHERE = (new BlockCircleGlyph(1, false)).setBlockName("witchery:circleglyphotherwhere").setBlockTextureName("witchery:circleglyph"); this.GLYPH_INFERNAL = (new BlockCircleGlyph(2, false)).setBlockName("witchery:circleglyphinfernal").setBlockTextureName("witchery:circleglyph"); + this.FLOO_FIRE = (new BlockFlooFire()).setBlockName("witchery:floofire"); this.FLOWING_SPIRIT = (new BlockFlowingSpirit(Witchery.Fluids.FLOWING_SPIRIT, new PotionEffect(Potion.regeneration.id, 100, 1), new PotionEffect(Potion.weakness.id, 300, 1), true, true)).setBlockName("witchery:spiritflowing").setBlockTextureName("witchery:flowspirit"); this.HOLLOW_TEARS = (new BlockFlowingSpirit(Witchery.Fluids.HOLLOW_TEARS, new PotionEffect(Potion.weakness.id, 100, 1), new PotionEffect(Potion.regeneration.id, 100, 1), false, false)).setBlockName("witchery:hollowtears").setBlockTextureName("witchery:tears"); this.DISEASE = (new BlockDisease(Witchery.Fluids.DISEASE)).setBlockName("witchery:disease").setBlockTextureName("witchery:disease"); diff --git a/src/main/java/com/emoniph/witchery/WitcheryEntities.java b/src/main/java/com/emoniph/witchery/WitcheryEntities.java index 6f87112..9937a0d 100644 --- a/src/main/java/com/emoniph/witchery/WitcheryEntities.java +++ b/src/main/java/com/emoniph/witchery/WitcheryEntities.java @@ -150,10 +150,10 @@ public WitcheryEntities() { this.BABA_YAGA = (new WitcheryEntities.LivingRef(109, EntityBabaYaga.class, "babayaga", this.entities)).setEgg(7232598, 3881787); this.COVEN_WITCH = (new WitcheryEntities.LivingRef(110, EntityCovenWitch.class, "covenwitch", this.entities)).addSpawn(2, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]{BiomeGenBase.swampland}).addSpawn(1, 1, 1, EnumCreatureType.creature, BiomeDictionary.getBiomesForType(Type.FOREST)).setEgg(1118481, 11523); this.PLAYER_CORPSE = new WitcheryEntities.LivingRef(111, EntityCorpse.class, "corpse", this.entities); - this.NIGHTMARE = (new WitcheryEntities.LivingRef(112, EntityNightmare.class, "nightmare", this.entities)).setEgg(983101, 0); - this.SPECTRE = (new WitcheryEntities.LivingRef(113, EntitySpectre.class, "spectre", this.entities)).setEgg(1052688, 16299031); - this.POLTERGEIST = (new WitcheryEntities.LivingRef(114, EntityPoltergeist.class, "poltergeist", this.entities)).setEgg(12844917, 12844917); - this.BANSHEE = (new WitcheryEntities.LivingRef(115, EntityBanshee.class, "banshee", this.entities)).setEgg(13683116, 10136945); + this.NIGHTMARE = (new WitcheryEntities.LivingRef(112, EntityNightmare.class, "nightmare", this.entities)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.MESA)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.FOREST)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.PLAINS)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.SWAMP)).setEgg(983101, 0); + this.SPECTRE = (new WitcheryEntities.LivingRef(113, EntitySpectre.class, "spectre", this.entities)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.MESA)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.FOREST)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.PLAINS)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.SWAMP)).setEgg(1052688, 16299031); + this.POLTERGEIST = (new WitcheryEntities.LivingRef(114, EntityPoltergeist.class, "poltergeist", this.entities)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.MESA)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.FOREST)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.PLAINS)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.SWAMP)).setEgg(12844917, 12844917); + this.BANSHEE = (new WitcheryEntities.LivingRef(115, EntityBanshee.class, "banshee", this.entities)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.MESA)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.FOREST)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.PLAINS)).addSpawn(10, 1, 1, EnumCreatureType.monster, BiomeDictionary.getBiomesForType(Type.SWAMP)).setEgg(13683116, 10136945); this.SPIRIT = (new WitcheryEntities.LivingRef(116, EntitySpirit.class, "spirit", this.entities)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.MESA)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.FOREST)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.PLAINS)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.MOUNTAIN)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.HILLS)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.SWAMP)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.SANDY)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.SNOWY)).addSpawn(Config.instance().spawnWeightSpirit, 2, 5, EnumCreatureType.ambient, BiomeDictionary.getBiomesForType(Type.WASTELAND)).setEgg(16753968, 15649280); this.DEATH = (new WitcheryEntities.LivingRef(117, EntityDeath.class, "death", this.entities)).setEgg(0, 0); this.CROSSBOW_BOLT = new WitcheryEntities.EntityRef(118, EntityBolt.class, "bolt", 64, 10, this.entities); diff --git a/src/main/java/com/emoniph/witchery/WitcheryRecipes.java b/src/main/java/com/emoniph/witchery/WitcheryRecipes.java index 95e5817..c6a9abc 100644 --- a/src/main/java/com/emoniph/witchery/WitcheryRecipes.java +++ b/src/main/java/com/emoniph/witchery/WitcheryRecipes.java @@ -1,793 +1,846 @@ -package com.emoniph.witchery; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.crafting.DistilleryRecipes; -import com.emoniph.witchery.crafting.KettleRecipes; -import com.emoniph.witchery.crafting.RecipeAttachTaglock; -import com.emoniph.witchery.crafting.RecipeShapelessAddColor; -import com.emoniph.witchery.crafting.RecipeShapelessAddKeys; -import com.emoniph.witchery.crafting.RecipeShapelessAddPotion; -import com.emoniph.witchery.crafting.RecipeShapelessBiomeCopy; -import com.emoniph.witchery.crafting.RecipeShapelessPoppet; -import com.emoniph.witchery.crafting.RecipeShapelessRepair; -import com.emoniph.witchery.crafting.SpinningRecipes; -import com.emoniph.witchery.entity.EntityBabaYaga; -import com.emoniph.witchery.entity.EntityDemon; -import com.emoniph.witchery.entity.EntityEnt; -import com.emoniph.witchery.entity.EntityFamiliar; -import com.emoniph.witchery.entity.EntityImp; -import com.emoniph.witchery.entity.EntityOwl; -import com.emoniph.witchery.entity.EntityReflection; -import com.emoniph.witchery.entity.EntityToad; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.infusion.infusions.InfusionInfernal; -import com.emoniph.witchery.infusion.infusions.InfusionLight; -import com.emoniph.witchery.infusion.infusions.InfusionOtherwhere; -import com.emoniph.witchery.infusion.infusions.InfusionOverworld; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePower; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerBat; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerBlaze; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerCreeper; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerEnderman; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerGhast; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerHeal; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerJump; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerPigMan; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSkeleton; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSpeed; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSpider; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSquid; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerZombie; -import com.emoniph.witchery.predictions.PredictionArrow; -import com.emoniph.witchery.predictions.PredictionBuriedTreasure; -import com.emoniph.witchery.predictions.PredictionFall; -import com.emoniph.witchery.predictions.PredictionFallInLove; -import com.emoniph.witchery.predictions.PredictionFight; -import com.emoniph.witchery.predictions.PredictionManager; -import com.emoniph.witchery.predictions.PredictionMultiMine; -import com.emoniph.witchery.predictions.PredictionNetherTrip; -import com.emoniph.witchery.predictions.PredictionRescue; -import com.emoniph.witchery.predictions.PredictionWet; -import com.emoniph.witchery.ritual.Circle; -import com.emoniph.witchery.ritual.RiteRegistry; -import com.emoniph.witchery.ritual.RitualTraits; -import com.emoniph.witchery.ritual.Sacrifice; -import com.emoniph.witchery.ritual.SacrificeItem; -import com.emoniph.witchery.ritual.SacrificeLiving; -import com.emoniph.witchery.ritual.SacrificeMultiple; -import com.emoniph.witchery.ritual.SacrificeOptionalItem; -import com.emoniph.witchery.ritual.SacrificePower; -import com.emoniph.witchery.ritual.rites.RiteBanishDemon; -import com.emoniph.witchery.ritual.rites.RiteBindCircleToTalisman; -import com.emoniph.witchery.ritual.rites.RiteBindFamiliar; -import com.emoniph.witchery.ritual.rites.RiteBindSpiritsToFetish; -import com.emoniph.witchery.ritual.rites.RiteBlight; -import com.emoniph.witchery.ritual.rites.RiteBlindness; -import com.emoniph.witchery.ritual.rites.RiteCallCreatures; -import com.emoniph.witchery.ritual.rites.RiteCallFamiliar; -import com.emoniph.witchery.ritual.rites.RiteClimateChange; -import com.emoniph.witchery.ritual.rites.RiteCookItem; -import com.emoniph.witchery.ritual.rites.RiteCurseCreature; -import com.emoniph.witchery.ritual.rites.RiteCurseOfTheWolf; -import com.emoniph.witchery.ritual.rites.RiteCursePoppets; -import com.emoniph.witchery.ritual.rites.RiteEclipse; -import com.emoniph.witchery.ritual.rites.RiteFertility; -import com.emoniph.witchery.ritual.rites.RiteForestation; -import com.emoniph.witchery.ritual.rites.RiteGlyphicTransformation; -import com.emoniph.witchery.ritual.rites.RiteHellOnEarth; -import com.emoniph.witchery.ritual.rites.RiteInfusePlayers; -import com.emoniph.witchery.ritual.rites.RiteInfusionRecharge; -import com.emoniph.witchery.ritual.rites.RiteNaturesPower; -import com.emoniph.witchery.ritual.rites.RitePartEarth; -import com.emoniph.witchery.ritual.rites.RitePriorIncarnation; -import com.emoniph.witchery.ritual.rites.RiteProtectionCircleAttractive; -import com.emoniph.witchery.ritual.rites.RiteProtectionCircleBarrier; -import com.emoniph.witchery.ritual.rites.RiteProtectionCircleRepulsive; -import com.emoniph.witchery.ritual.rites.RiteRainOfToads; -import com.emoniph.witchery.ritual.rites.RiteRaiseColumn; -import com.emoniph.witchery.ritual.rites.RiteRaiseVolcano; -import com.emoniph.witchery.ritual.rites.RiteRemoveVampirism; -import com.emoniph.witchery.ritual.rites.RiteSetNBT; -import com.emoniph.witchery.ritual.rites.RiteSphereEffect; -import com.emoniph.witchery.ritual.rites.RiteSummonCreature; -import com.emoniph.witchery.ritual.rites.RiteSummonItem; -import com.emoniph.witchery.ritual.rites.RiteSummonSpectralStone; -import com.emoniph.witchery.ritual.rites.RiteTeleportEntity; -import com.emoniph.witchery.ritual.rites.RiteTeleportToWaystone; -import com.emoniph.witchery.ritual.rites.RiteTransposeOres; -import com.emoniph.witchery.ritual.rites.RiteWeatherCallStorm; -import com.emoniph.witchery.util.ClothColor; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.Dye; -import cpw.mods.fml.common.registry.GameRegistry; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Iterator; -import net.minecraft.block.Block; -import net.minecraft.entity.boss.EntityWither; -import net.minecraft.entity.monster.EntityCaveSpider; -import net.minecraft.entity.monster.EntityMagmaCube; -import net.minecraft.entity.monster.EntitySilverfish; -import net.minecraft.entity.monster.EntitySlime; -import net.minecraft.entity.monster.EntitySpider; -import net.minecraft.entity.monster.EntityWitch; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.EntityBat; -import net.minecraft.entity.passive.EntityChicken; -import net.minecraft.entity.passive.EntityCow; -import net.minecraft.entity.passive.EntityHorse; -import net.minecraft.entity.passive.EntityMooshroom; -import net.minecraft.entity.passive.EntityOcelot; -import net.minecraft.entity.passive.EntityPig; -import net.minecraft.entity.passive.EntitySheep; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.passive.EntityWolf; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.ShapedRecipes; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.RecipeSorter; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import net.minecraftforge.oredict.RecipeSorter.Category; - -public class WitcheryRecipes { - - public Infusion infusionEnder; - public Infusion infusionLight; - public Infusion infusionWorld; - public Infusion infusionBeast; - - - public void preInit() { - RecipeSorter.register("witchery:bindpoppet", RecipeShapelessPoppet.class, Category.SHAPELESS, "after:minecraft:shapeless"); - RecipeSorter.register("witchery:addpotion", RecipeShapelessAddPotion.class, Category.SHAPELESS, "after:minecraft:shapeless"); - RecipeSorter.register("witchery:repair", RecipeShapelessRepair.class, Category.SHAPELESS, "after:minecraft:shapeless"); - RecipeSorter.register("witchery:addcolor", RecipeShapelessAddColor.class, Category.SHAPELESS, "after:minecraft:shapeless"); - RecipeSorter.register("witchery:addkeys", RecipeShapelessAddKeys.class, Category.SHAPELESS, "after:minecraft:shapeless"); - RecipeSorter.register("witchery:attachtaglock", RecipeAttachTaglock.class, Category.SHAPELESS, "after:minecraft:shapeless"); - RecipeSorter.register("witchery:biomecopy", RecipeShapelessBiomeCopy.class, Category.SHAPELESS, "after:minecraft:shapeless"); - if(Config.instance().allowStatueGoddessRecipe) { - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.STATUE_GODDESS), new Object[]{"s#s", "shs", "###", Character.valueOf('h'), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Character.valueOf('#'), new ItemStack(Blocks.stone), Character.valueOf('s'), new ItemStack(Items.nether_star)}); - } - - ItemStack ash = Witchery.Items.GENERIC.itemAshWood.createStack(); - ItemStack bone = new ItemStack(Items.bone); - GameRegistry.addShapelessRecipe(Dye.BONE_MEAL.createStack(4), new Object[]{bone, ash, ash}); - GameRegistry.addShapelessRecipe(Dye.BONE_MEAL.createStack(5), new Object[]{bone, ash, ash, ash, ash}); - GameRegistry.addShapelessRecipe(Dye.BONE_MEAL.createStack(6), new Object[]{bone, ash, ash, ash, ash, ash, ash}); - GameRegistry.addShapelessRecipe(Dye.BONE_MEAL.createStack(7), new Object[]{bone, ash, ash, ash, ash, ash, ash, ash, ash}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Blocks.WICKER_BUNDLE, 1, 0), new Object[]{"###", "###", "###", Character.valueOf('#'), "treeSapling"})); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.WICKER_BUNDLE, 5, 1), new Object[]{"#b#", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Character.valueOf('b'), Witchery.Items.GENERIC.itemInfernalBlood.createStack()}); - this.addPlantMineRecipe(0, new ItemStack(Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfWebs.createStack()); - this.addPlantMineRecipe(1, new ItemStack(Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfInk.createStack()); - this.addPlantMineRecipe(2, new ItemStack(Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfThorns.createStack()); - this.addPlantMineRecipe(3, new ItemStack(Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack()); - this.addPlantMineRecipe(4, new ItemStack(Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfWebs.createStack()); - this.addPlantMineRecipe(5, new ItemStack(Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfInk.createStack()); - this.addPlantMineRecipe(6, new ItemStack(Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfThorns.createStack()); - this.addPlantMineRecipe(7, new ItemStack(Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack()); - this.addPlantMineRecipe(8, new ItemStack(Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfWebs.createStack()); - this.addPlantMineRecipe(9, new ItemStack(Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfInk.createStack()); - this.addPlantMineRecipe(10, new ItemStack(Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfThorns.createStack()); - this.addPlantMineRecipe(11, new ItemStack(Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack()); - GameRegistry.addShapelessRecipe(new ItemStack(Items.poisonous_potato, 2), new Object[]{new ItemStack(Items.poisonous_potato), new ItemStack(Items.potato), new ItemStack(Items.spider_eye)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.LEAPING_LILY, 5), new Object[]{"#p#", "c#c", "#b#", Character.valueOf('#'), new ItemStack(Blocks.waterlily), Character.valueOf('p'), new ItemStack(Items.potionitem, 1, 8194), Character.valueOf('b'), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Character.valueOf('c'), new ItemStack(Items.glowstone_dust)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemBoneNeedle.createStack(8), new Object[]{"ab", Character.valueOf('a'), new ItemStack(Items.bone), Character.valueOf('b'), new ItemStack(Items.flint)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.TAGLOCK_KIT), new Object[]{"ab", Character.valueOf('b'), Witchery.Items.GENERIC.itemBoneNeedle.createStack(), Character.valueOf('a'), new ItemStack(Items.glass_bottle)}); - ItemStack taglocks = new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1); - ItemStack unboundPoppet = Witchery.Items.POPPET.unboundPoppet.createStack(); - GameRegistry.addRecipe(unboundPoppet, new Object[]{"xyx", "ayb", "x x", Character.valueOf('x'), new ItemStack(Blocks.wool), Character.valueOf('y'), new ItemStack(Witchery.Blocks.SPANISH_MOSS), Character.valueOf('a'), Witchery.Items.GENERIC.itemBoneNeedle.createStack(), Character.valueOf('b'), new ItemStack(Items.string)}); - ItemStack earthPoppet = Witchery.Items.POPPET.earthPoppet.createStack(); - GameRegistry.addRecipe(Witchery.Items.POPPET.earthPoppet.createStack(), new Object[]{" a ", "b#b", " c ", Character.valueOf('#'), Witchery.Items.POPPET.unboundPoppet.createStack(), Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('a'), new ItemStack(Items.clay_ball), Character.valueOf('c'), new ItemStack(Blocks.dirt)}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(earthPoppet, new ItemStack[]{taglocks, earthPoppet})); - ItemStack waterPoppet = Witchery.Items.POPPET.waterPoppet.createStack(); - GameRegistry.addRecipe(waterPoppet, new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), Witchery.Items.POPPET.unboundPoppet.createStack(), Character.valueOf('a'), Witchery.Items.GENERIC.itemArtichoke.createStack(), Character.valueOf('b'), Dye.INK_SAC.createStack()}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(waterPoppet, new ItemStack[]{taglocks, waterPoppet})); - ItemStack foodPoppet = Witchery.Items.POPPET.foodPoppet.createStack(); - GameRegistry.addRecipe(foodPoppet, new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('b'), new ItemStack(Items.speckled_melon), Character.valueOf('a'), new ItemStack(Items.rotten_flesh)}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(foodPoppet, new ItemStack[]{taglocks, foodPoppet})); - ItemStack firePoppet = Witchery.Items.POPPET.firePoppet.createStack(); - GameRegistry.addRecipe(firePoppet, new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('b'), Witchery.Items.GENERIC.itemBatWool.createStack(), Character.valueOf('a'), new ItemStack(Witchery.Blocks.EMBER_MOSS)}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(firePoppet, new ItemStack[]{taglocks, firePoppet})); - ItemStack antiVoodooPoppet = Witchery.Items.POPPET.antiVoodooPoppet.createStack(); - GameRegistry.addRecipe(antiVoodooPoppet, new Object[]{"ced", "a#b", "dfc", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Character.valueOf('c'), new ItemStack(Blocks.yellow_flower), Character.valueOf('d'), new ItemStack(Blocks.red_flower), Character.valueOf('e'), new ItemStack(Blocks.red_mushroom), Character.valueOf('f'), new ItemStack(Blocks.brown_mushroom)}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(antiVoodooPoppet, new ItemStack[]{taglocks, antiVoodooPoppet})); - ItemStack poppetProectionPoppet = Witchery.Items.POPPET.poppetProtectionPoppet.createStack(); - GameRegistry.addRecipe(poppetProectionPoppet, new Object[]{"gfg", "e#e", "glg", Character.valueOf('#'), antiVoodooPoppet, Character.valueOf('l'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('e'), Witchery.Items.GENERIC.itemEnderDew.createStack(), Character.valueOf('g'), new ItemStack(Items.gold_nugget), Character.valueOf('f'), Witchery.Items.GENERIC.itemToeOfFrog.createStack()}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(poppetProectionPoppet, new ItemStack[]{taglocks, poppetProectionPoppet})); - ItemStack voodooPoppet = Witchery.Items.POPPET.voodooPoppet.createStack(); - GameRegistry.addRecipe(voodooPoppet, new Object[]{" d ", "a#b", " c ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Character.valueOf('c'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('d'), new ItemStack(Items.fermented_spider_eye)}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(voodooPoppet, new ItemStack[]{taglocks, voodooPoppet})); - ItemStack toolPoppet = Witchery.Items.POPPET.toolPoppet.createStack(); - GameRegistry.addRecipe(toolPoppet, new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDropOfLuck.createStack()}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(toolPoppet, new ItemStack[]{taglocks, toolPoppet})); - ItemStack armorPoppet = Witchery.Items.POPPET.armorPoppet.createStack(); - GameRegistry.addRecipe(armorPoppet, new Object[]{" a ", "b#b", " d ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(armorPoppet, new ItemStack[]{taglocks, armorPoppet})); - ItemStack avoidDeathPoppet = Witchery.Items.POPPET.deathPoppet.createStack(); - GameRegistry.addRecipe(avoidDeathPoppet, new Object[]{"axb", "x#x", " x ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('x'), new ItemStack(Items.gold_nugget)}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(avoidDeathPoppet, new ItemStack[]{taglocks, avoidDeathPoppet})); - ItemStack vampiricPoppet = Witchery.Items.POPPET.vampiricPoppet.createStack(); - GameRegistry.addRecipe(vampiricPoppet, new Object[]{" b ", "c#c", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('c'), Witchery.Items.GENERIC.itemBatWool.createStack()}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(vampiricPoppet, new ItemStack[]{taglocks, taglocks, vampiricPoppet})); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.POPPET_SHELF), new Object[]{"yzy", "zxz", "yzy", Character.valueOf('x'), ClothColor.GREEN.createStack(), Character.valueOf('y'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('z'), new ItemStack(Blocks.nether_brick)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.OVEN_IDLE), new Object[]{" z ", "xxx", "xzx", Character.valueOf('x'), new ItemStack(Items.iron_ingot), Character.valueOf('z'), new ItemStack(Blocks.iron_bars)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemSoftClayJar.createStack(4), new Object[]{" # ", "###", Character.valueOf('#'), new ItemStack(Items.clay_ball)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.PLANKS, 4, 0), new Object[]{"#", Character.valueOf('#'), new ItemStack(Witchery.Blocks.LOG, 1, 0)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.PLANKS, 4, 1), new Object[]{"#", Character.valueOf('#'), new ItemStack(Witchery.Blocks.LOG, 1, 1)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.PLANKS, 4, 2), new Object[]{"#", Character.valueOf('#'), new ItemStack(Witchery.Blocks.LOG, 1, 2)}); - CraftingManager.getInstance().getRecipeList().add(0, getShapedRecipe(Witchery.Items.GENERIC.itemDoorRowan.createStack(), new Object[]{"##", "##", "##", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 0)})); - CraftingManager.getInstance().getRecipeList().add(0, getShapedRecipe(Witchery.Items.GENERIC.itemDoorAlder.createStack(), new Object[]{"##", "##", "##", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 1)})); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.STAIRS_ALDER, 4, 0), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 1)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.STAIRS_HAWTHORN, 4, 0), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 2)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.STAIRS_ROWAN, 4, 0), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 0)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.SNOW_STAIRS, 4, 0), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Blocks.snow, 1, 0)}); - CraftingManager.getInstance().getRecipeList().add(0, getShapedRecipe(new ItemStack(Witchery.Blocks.SNOW_SLAB_SINGLE, 6, 0), new Object[]{"###", "###", Character.valueOf('#'), new ItemStack(Blocks.snow_layer, 1, 0)})); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.SNOW_PRESSURE_PLATE, 1, 0), new Object[]{"##", Character.valueOf('#'), new ItemStack(Blocks.snow, 1, 0)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemQuicklime.createStack(), new Object[]{"#", Character.valueOf('#'), Witchery.Items.GENERIC.itemAshWood.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.ALTAR, 3), new Object[]{"abc", "xyx", "xyx", Character.valueOf('a'), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Character.valueOf('b'), new ItemStack(Items.potionitem), Character.valueOf('c'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('x'), new ItemStack(Blocks.stonebrick, 1, 0), Character.valueOf('y'), new ItemStack(Witchery.Blocks.LOG, 1, 0)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemAttunedStone.createStack(), new Object[]{"a", "b", "c", Character.valueOf('a'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Character.valueOf('b'), new ItemStack(Items.diamond), Character.valueOf('c'), new ItemStack(Items.lava_bucket)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.DISTILLERY_IDLE), new Object[]{"bxb", "xxx", "yay", Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Character.valueOf('y'), new ItemStack(Items.gold_ingot), Character.valueOf('x'), new ItemStack(Items.iron_ingot)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.KETTLE), new Object[]{"bxb", "xax", " y ", Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('b'), new ItemStack(Items.stick), Character.valueOf('x'), new ItemStack(Items.string), Character.valueOf('y'), new ItemStack(Items.cauldron)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.BRAZIER), new Object[]{"#a#", " w ", "www", Character.valueOf('a'), Witchery.Items.GENERIC.itemNecroStone.createStack(), Character.valueOf('w'), new ItemStack(Items.stick), Character.valueOf('#'), new ItemStack(Items.iron_ingot)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.CHALK_RITUAL, 2, 0), new Object[]{"xax", "xyx", "xyx", Character.valueOf('a'), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), Character.valueOf('x'), Witchery.Items.GENERIC.itemAshWood.createStack(), Character.valueOf('y'), Witchery.Items.GENERIC.itemGypsum.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemWaystone.createStack(), new Object[]{"ab", Character.valueOf('a'), new ItemStack(Items.flint), Character.valueOf('b'), Witchery.Items.GENERIC.itemBoneNeedle.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.ARTHANA), new Object[]{" y ", "xbx", " a ", Character.valueOf('a'), new ItemStack(Items.stick), Character.valueOf('b'), new ItemStack(Items.emerald), Character.valueOf('y'), new ItemStack(Items.gold_ingot), Character.valueOf('x'), new ItemStack(Items.gold_nugget)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.BOLINE), new Object[]{"y", "a", "b", Character.valueOf('a'), new ItemStack(Items.bone), Character.valueOf('b'), new ItemStack(Items.emerald), Character.valueOf('y'), new ItemStack(Items.iron_ingot)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.CIRCLE_TALISMAN), new Object[]{"yxy", "xax", "yxy", Character.valueOf('a'), new ItemStack(Items.diamond), Character.valueOf('x'), new ItemStack(Items.gold_ingot), Character.valueOf('y'), new ItemStack(Items.gold_nugget)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemBroom.createStack(), new Object[]{" x ", " x ", "yyy", Character.valueOf('x'), new ItemStack(Items.stick), Character.valueOf('y'), new ItemStack(Witchery.Blocks.SAPLING, 1, 2)}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.rotten_flesh)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemOddPorkRaw.createStack()}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.chicken)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.chicken), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.beef)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.beef), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.porkchop)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemOddPorkCooked.createStack()}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.cooked_chicken)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_chicken), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.cooked_beef)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_beef), new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.cooked_porkchop)}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemOddPorkCooked.createStack(), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.rotten_flesh)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemOddPorkRaw.createStack()}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.chicken)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_chicken), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.beef)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_beef), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.porkchop)}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.rotten_flesh)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemOddPorkRaw.createStack()}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.chicken)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.chicken), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.beef)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.beef), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.porkchop)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemOddPorkCooked.createStack()}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_porkchop), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.cooked_chicken)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_chicken), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.cooked_beef)}); - GameRegistry.addShapelessRecipe(new ItemStack(Items.cooked_beef), new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.cooked_porkchop)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemCandelabra.createStack(), new Object[]{"xxx", "yay", " y ", Character.valueOf('x'), new ItemStack(Blocks.torch), Character.valueOf('y'), new ItemStack(Items.iron_ingot), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemChaliceEmpty.createStack(), new Object[]{"yay", "yxy", " x ", Character.valueOf('x'), new ItemStack(Items.gold_ingot), Character.valueOf('y'), new ItemStack(Items.gold_nugget), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemChaliceFull.createStack(), new Object[]{"b", "a", Character.valueOf('a'), Witchery.Items.GENERIC.itemChaliceEmpty.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemRedstoneSoup.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.DIVINER_WATER), new Object[]{"yay", "yay", "axa", Character.valueOf('a'), new ItemStack(Items.stick), Character.valueOf('y'), new ItemStack(Items.potionitem), Character.valueOf('x'), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.DIVINER_LAVA), new Object[]{" a ", " x ", "a a", Character.valueOf('x'), new ItemStack(Witchery.Items.DIVINER_WATER), Character.valueOf('a'), new ItemStack(Items.blaze_rod)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamMove.createStack(), new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack(Items.potionitem, 1, 16450), Character.valueOf('e'), new ItemStack(Items.potionitem, 1, 16458), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamMove.createStack(), new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack(Items.potionitem, 1, 16450), Character.valueOf('e'), new ItemStack(Items.potionitem, 1, 24650), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamDig.createStack(), new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack(Items.potionitem, 1, 16457), Character.valueOf('e'), new ItemStack(Items.potionitem, 1, 16456), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamDig.createStack(), new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack(Items.potionitem, 1, 16457), Character.valueOf('e'), new ItemStack(Items.potionitem, 1, 24648), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamEat.createStack(), new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack(Items.potionitem, 1, 16421), Character.valueOf('e'), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamEat.createStack(), new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack(Items.potionitem, 1, 16421), Character.valueOf('e'), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamNightmare.createStack(), new Object[]{"dxe", "bab", "cbc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack(Items.potionitem, 1, 16452), Character.valueOf('e'), new ItemStack(Items.potionitem, 1, 16454), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemDreamIntensity.createStack(), new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Character.valueOf('e'), Witchery.Items.GENERIC.itemBrewOfSleeping.createStack(), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Items.CAULDRON_BOOK), new Object[]{" c ", "a#b", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), new ItemStack(Blocks.dirt)})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookHerbology.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), new ItemStack(Blocks.red_flower), Character.valueOf('d'), new ItemStack(Blocks.yellow_flower)})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookWands.createStack(), new Object[]{" c ", "a#b", " ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBranchEnt.createStack()})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookBiomes.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), new ItemStack(Blocks.sapling), Character.valueOf('d'), new ItemStack(Blocks.stone)})); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Items.BIOME_BOOK), new Object[]{" d ", "d#d", " d ", Character.valueOf('#'), Witchery.Items.GENERIC.itemBookBiomes.createStack(), Character.valueOf('d'), new ItemStack(Blocks.stone)})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookBurning.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemAshWood.createStack(), Character.valueOf('d'), new ItemStack(Items.flint_and_steel)})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookOven.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), new ItemStack(Items.coal, 1, 1)})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookDistilling.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack()})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookCircleMagic.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookInfusions.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()})); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemWeb.createStack(), new Object[]{" s ", "sws", " s ", Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), new ItemStack(Blocks.web)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.ALLURING_SKULL), new Object[]{" a ", "bcb", " d ", Character.valueOf('a'), Witchery.Items.GENERIC.itemNecroStone.createStack(), Character.valueOf('d'), Witchery.Items.POPPET.voodooPoppet.createStack(), Character.valueOf('c'), new ItemStack(Items.skull), Character.valueOf('b'), new ItemStack(Items.glowstone_dust)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.ALLURING_SKULL), new Object[]{" a ", "bcb", " d ", Character.valueOf('a'), Witchery.Items.GENERIC.itemNecroStone.createStack(), Character.valueOf('d'), Witchery.Items.POPPET.voodooPoppet.createStack(), Character.valueOf('c'), new ItemStack(Items.skull, 1, 1), Character.valueOf('b'), new ItemStack(Items.glowstone_dust)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemSeedsTreefyd.createStack(2), new Object[]{"xax", "cyd", "xbx", Character.valueOf('x'), Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Character.valueOf('y'), Witchery.Items.GENERIC.itemArtichoke.createStack(), Character.valueOf('c'), new ItemStack(Witchery.Blocks.EMBER_MOSS), Character.valueOf('d'), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Character.valueOf('a'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.POLYNESIA_CHARM, 1), new Object[]{"nin", "p#p", "nwn", Character.valueOf('#'), new ItemStack(Items.fish), Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('p'), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Character.valueOf('w'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Character.valueOf('n'), new ItemStack(Items.nether_wart)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.DEVILS_TONGUE_CHARM, 1), new Object[]{"b#b", "dse", "btb", Character.valueOf('#'), new ItemStack(Witchery.Items.POLYNESIA_CHARM), Character.valueOf('d'), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Character.valueOf('t'), Witchery.Items.GENERIC.itemDogTongue.createStack(), Character.valueOf('e'), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), Character.valueOf('s'), new ItemStack(Items.skull), Character.valueOf('b'), new ItemStack(Items.blaze_powder)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.OVEN_FUMEFUNNEL), new Object[]{"ele", "ege", "bib", Character.valueOf('e'), new ItemStack(Items.bucket), Character.valueOf('l'), new ItemStack(Items.lava_bucket), Character.valueOf('b'), new ItemStack(Blocks.iron_block), Character.valueOf('g'), new ItemStack(Blocks.glowstone), Character.valueOf('i'), new ItemStack(Blocks.iron_bars)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemFumeFilter.createStack(), new Object[]{"ggg", "sas", "ggg", Character.valueOf('g'), new ItemStack(Blocks.glass), Character.valueOf('s'), new ItemStack(Items.iron_ingot), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.OVEN_FUMEFUNNEL_FILTERED), new Object[]{"b", "f", Character.valueOf('b'), new ItemStack(Witchery.Blocks.OVEN_FUMEFUNNEL), Character.valueOf('f'), Witchery.Items.GENERIC.itemFumeFilter.createStack()}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemPurifiedMilk.createStack(3), new Object[]{new ItemStack(Items.milk_bucket), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack()}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemPurifiedMilk.createStack(3), new Object[]{new ItemStack(Items.cake), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemImpregnatedLeather.createStack(4), new Object[]{"mlm", "ldl", "mlm", Character.valueOf('l'), new ItemStack(Items.leather), Character.valueOf('d'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('m'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.WITCH_HAT), new Object[]{" l ", "sls", "lgl", Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('l'), Witchery.Items.GENERIC.itemImpregnatedLeather.createStack(), Character.valueOf('g'), new ItemStack(Items.glowstone_dust)}); - if(Config.instance().allowVoidBrambleRecipe) { - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.VOID_BRAMBLE, 4), new Object[]{"lml", "r#r", "lml", Character.valueOf('#'), new ItemStack(Witchery.Blocks.BRAMBLE), Character.valueOf('r'), new ItemStack(Items.nether_star), Character.valueOf('l'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('m'), Witchery.Items.GENERIC.itemMutandisExtremis.createStack()}); - } - - GameRegistry.addRecipe(new ItemStack(Items.gunpowder, 5), new Object[]{"#", Character.valueOf('#'), Witchery.Items.GENERIC.itemCreeperHeart.createStack()}); - GameRegistry.addShapelessRecipe(new ItemStack(Blocks.netherrack), new Object[]{Witchery.Items.GENERIC.itemInfernalBlood.createStack(), new ItemStack(Blocks.gravel)}); - ItemStack impregLeather = Witchery.Items.GENERIC.itemImpregnatedLeather.createStack(); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.WITCH_ROBES), new Object[]{"lsl", "l#l", "lll", Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('l'), impregLeather, Character.valueOf('#'), Witchery.Items.GENERIC.itemCreeperHeart.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.NECROMANCERS_ROBES), new Object[]{"lsl", "l#l", "lll", Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('l'), impregLeather, Character.valueOf('#'), Witchery.Items.GENERIC.itemNecroStone.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemFrozenHeart.createStack(), new Object[]{"n", "h", "t", Character.valueOf('h'), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Character.valueOf('n'), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), Character.valueOf('t'), new ItemStack(Items.ghast_tear)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.ICY_SLIPPERS), new Object[]{"lsl", "l#l", "dod", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('#'), Witchery.Items.GENERIC.itemFrozenHeart.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('o'), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.BITING_BELT), new Object[]{"#lh", "lsl", "l l", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('h'), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Character.valueOf('#'), new ItemStack(Witchery.Items.PARASYTIC_LOUSE)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.SEEPING_SHOES), new Object[]{"lsl", "hrh", "mmm", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('h'), new ItemStack(Witchery.Items.WITCH_HAND), Character.valueOf('r'), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Character.valueOf('m'), new ItemStack(Items.milk_bucket)}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.RUBY_SLIPPERS), new Object[]{"aba", "tst", "aba", Character.valueOf('s'), new ItemStack(Witchery.Items.SEEPING_SHOES), Character.valueOf('t'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemInfernalBlood.createStack()}); - GameRegistry.addRecipe(new ItemStack(Witchery.Items.BARK_BELT), new Object[]{"ses", "gbg", "shs", Character.valueOf('b'), new ItemStack(Witchery.Items.BITING_BELT), Character.valueOf('s'), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Character.valueOf('g'), Witchery.Items.GENERIC.itemBranchEnt.createStack(), Character.valueOf('h'), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Character.valueOf('e'), new ItemStack(Items.emerald)}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemWormyApple.createStack(), new Object[]{new ItemStack(Items.apple), new ItemStack(Items.rotten_flesh), new ItemStack(Items.sugar)}); - ItemStack louse = new ItemStack(Witchery.Items.PARASYTIC_LOUSE, 1, 32767); - ItemStack belt = new ItemStack(Witchery.Items.BITING_BELT, 1, 32767); - int[] lousePotions = new int[]{8200, 8202, 8264, 8266, 8193, 8194, 8196, 8225, 8226, 8227, 8228, 8229, 8230, 8232, 8233, 8234, 8236, 8238, 8257, 8258, 8259, 8260, 8261, 8262, 8264, 8265, 8266, 8268, 8270, 8201, 8206}; - int[] logs = lousePotions; - int kobolditeIngot = lousePotions.length; - - int meats; - int hunterItems; - for(hunterItems = 0; hunterItems < kobolditeIngot; ++hunterItems) { - meats = logs[hunterItems]; - GameRegistry.addShapelessRecipe(new ItemStack(Witchery.Items.PARASYTIC_LOUSE, 1, meats), new Object[]{louse, new ItemStack(Items.potionitem, 1, meats)}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddPotion(new ItemStack(Witchery.Items.BITING_BELT, 1, meats), new ItemStack[]{belt, new ItemStack(Items.potionitem, 1, meats)})); - } - - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.WITCH_ROBES), new ItemStack[]{new ItemStack(Witchery.Items.WITCH_ROBES), impregLeather, impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.NECROMANCERS_ROBES), new ItemStack[]{new ItemStack(Witchery.Items.NECROMANCERS_ROBES), impregLeather, impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.WITCH_HAT), new ItemStack[]{new ItemStack(Witchery.Items.WITCH_HAT), impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.ICY_SLIPPERS), new ItemStack[]{new ItemStack(Witchery.Items.ICY_SLIPPERS), impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.RUBY_SLIPPERS), new ItemStack[]{new ItemStack(Witchery.Items.RUBY_SLIPPERS), impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.SEEPING_SHOES), new ItemStack[]{new ItemStack(Witchery.Items.SEEPING_SHOES), impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.BITING_BELT), new ItemStack[]{new ItemStack(Witchery.Items.BITING_BELT), impregLeather, impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.BARK_BELT), new ItemStack[]{new ItemStack(Witchery.Items.BARK_BELT), impregLeather, impregLeather, impregLeather, impregLeather})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack(Witchery.Items.BABAS_HAT), new ItemStack[]{new ItemStack(Witchery.Items.BABAS_HAT), impregLeather, impregLeather, impregLeather})); - Dye[] var29 = Dye.DYES; - kobolditeIngot = var29.length; - - for(hunterItems = 0; hunterItems < kobolditeIngot; ++hunterItems) { - Dye var32 = var29[hunterItems]; - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddColor(new ItemStack(Witchery.Items.BREW_BAG), new ItemStack[]{new ItemStack(Witchery.Items.BREW_BAG), var32.createStack()})); - } - - GameRegistry.addRecipe(new ItemStack(Witchery.Items.BREW_BAG), new Object[]{"lll", "lsl", "lll", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemCharmOfDisruptedDreams.createStack(), new Object[]{"lll", "lsl", "lll", Character.valueOf('l'), new ItemStack(Items.stick), Character.valueOf('s'), Witchery.Items.GENERIC.itemFancifulThread.createStack()}); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddKeys(Witchery.Items.GENERIC.itemDoorKeyring.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemDoorKey.createStack(), Witchery.Items.GENERIC.itemDoorKey.createStack()})); - CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddKeys(Witchery.Items.GENERIC.itemDoorKeyring.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemDoorKeyring.createStack(), Witchery.Items.GENERIC.itemDoorKey.createStack()})); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemQuartzSphere.createStack(), new Object[]{"qbq", "bgb", "qbq", Character.valueOf('q'), new ItemStack(Items.quartz), Character.valueOf('b'), new ItemStack(Blocks.quartz_block), Character.valueOf('g'), new ItemStack(Blocks.glass)}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemSleepingApple.createStack(), new Object[]{" g ", "mam", "gsg", Character.valueOf('a'), Witchery.Items.GENERIC.itemWormyApple.createStack(), Character.valueOf('g'), Witchery.Items.GENERIC.itemMutandis.createStack(), Character.valueOf('m'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('s'), Witchery.Items.GENERIC.itemBrewOfSleeping.createStack()}); - GameRegistry.addRecipe(Witchery.Items.GENERIC.itemBatBall.createStack(), new Object[]{"sbs", "b b", "sbs", Character.valueOf('s'), new ItemStack(Items.slime_ball), Character.valueOf('b'), new ItemStack(Witchery.Blocks.CRITTER_SNARE, 1, 1)}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Blocks.SPINNING_WHEEL), new Object[]{"aab", "aac", "wsw", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), new ItemStack(Blocks.wool), Character.valueOf('c'), "stickWood", Character.valueOf('w'), "plankWood", Character.valueOf('s'), Witchery.Items.GENERIC.itemAttunedStone.createStack()})); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemGraveyardDust.createStack(), new Object[]{Witchery.Items.GENERIC.itemSpectralDust.createStack(), Dye.BONE_MEAL.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack()}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Blocks.FETISH_SCARECROW), new Object[]{"w#w", "sls", "wsw", Character.valueOf('#'), new ItemStack(Blocks.lit_pumpkin), Character.valueOf('w'), new ItemStack(Blocks.wool), Character.valueOf('s'), "stickWood", Character.valueOf('l'), Witchery.Items.GENERIC.itemTormentedTwine.createStack()})); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.FETISH_WITCHS_LADDER), new Object[]{"fsf", "ftf", "fsf", Character.valueOf('f'), new ItemStack(Items.feather), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('t'), Witchery.Items.GENERIC.itemFancifulThread.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.FETISH_TREANT_IDOL), new Object[]{"o#o", "srs", "o o", Character.valueOf('#'), new ItemStack(Blocks.lit_pumpkin), Character.valueOf('o'), new ItemStack(Blocks.log, 1, 0), Character.valueOf('r'), new ItemStack(Witchery.Blocks.LOG, 1, 0), Character.valueOf('s'), Witchery.Items.GENERIC.itemTormentedTwine.createStack()}); - SpinningRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemFancifulThread.createStack(), new ItemStack(Witchery.Blocks.WISPY_COTTON, 4), new ItemStack[]{new ItemStack(Items.string), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()}); - SpinningRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Witchery.Items.GENERIC.itemDisturbedCotton.createStack(4), new ItemStack[]{new ItemStack(Items.string), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack()}); - SpinningRecipes.instance().addRecipe(new ItemStack(Blocks.web), new ItemStack(Items.string, 8), new ItemStack[0]); - SpinningRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemGoldenThread.createStack(3), new ItemStack(Blocks.hay_block), new ItemStack[]{Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemNullCatalyst.createStack(2), new Object[]{new ItemStack(Items.nether_star), new ItemStack(Items.diamond), new ItemStack(Items.flint), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream)}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemNullCatalyst.createStack(2), new Object[]{Witchery.Items.GENERIC.itemNullCatalyst.createStack(), new ItemStack(Items.magma_cream), new ItemStack(Items.blaze_powder)}); - GameRegistry.addShapedRecipe(Witchery.Items.GENERIC.itemNullifiedLeather.createStack(3), new Object[]{"lll", "lcl", "lll", Character.valueOf('l'), new ItemStack(Items.leather), Character.valueOf('c'), Witchery.Items.GENERIC.itemNullCatalyst.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.HUNTER_HAT), new Object[]{"lll", "l l", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.HUNTER_COAT), new Object[]{"l l", "lll", "lll", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.HUNTER_LEGS), new Object[]{"lll", "l l", "l l", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.HUNTER_BOOTS), new Object[]{"l l", "l l", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.SHELF_COMPASS), new Object[]{"gdg", "d#d", "gcg", Character.valueOf('g'), new ItemStack(Items.gold_ingot), Character.valueOf('d'), new ItemStack(Items.diamond), Character.valueOf('#'), new ItemStack(Items.clock), Character.valueOf('c'), Witchery.Items.GENERIC.itemNullCatalyst.createStack()}); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBoltStake.createStack(9), new Object[]{" s ", "www", "fff", Character.valueOf('f'), new ItemStack(Items.feather), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), "stickWood"})); - GameRegistry.addShapedRecipe(Witchery.Items.GENERIC.itemBoltSplitting.createStack(), new Object[]{" s ", "bbb", " f ", Character.valueOf('f'), new ItemStack(Items.feather), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('b'), Witchery.Items.GENERIC.itemBoltStake.createStack()}); - GameRegistry.addShapedRecipe(Witchery.Items.GENERIC.itemBoltHoly.createStack(12), new Object[]{"aba", "ata", "aba", Character.valueOf('t'), new ItemStack(Items.ghast_tear), Character.valueOf('a'), Witchery.Items.GENERIC.itemBoltStake.createStack(), Character.valueOf('b'), new ItemStack(Items.bone)}); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemBoltAntiMagic.createStack(3), new Object[]{Witchery.Items.GENERIC.itemNullCatalyst.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemBoltHoly.createStack(), Witchery.Items.GENERIC.itemBoltHoly.createStack(), Witchery.Items.GENERIC.itemBoltHoly.createStack()}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Items.CROSSBOW_PISTOL), new Object[]{"mbm", "swn", " m ", Character.valueOf('m'), new ItemStack(Items.iron_ingot), Character.valueOf('b'), new ItemStack(Items.bow), Character.valueOf('n'), Witchery.Items.GENERIC.itemBoneNeedle.createStack(), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), "stickWood"})); - GameRegistry.addShapelessRecipe(Witchery.Items.POTIONS.potionAntidote.createStack(2), new Object[]{Witchery.Items.GENERIC.itemNullCatalyst.createStack(), new ItemStack(Items.potionitem, 1, 8196), new ItemStack(Items.potionitem, 1, 8196)}); - GameRegistry.addShapedRecipe(Witchery.Items.GENERIC.itemContractOwnership.createStack(), new Object[]{"ppp", "pfp", "pps", Character.valueOf('f'), Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), Character.valueOf('p'), new ItemStack(Items.paper), Character.valueOf('s'), new ItemStack(Items.string)}); - GameRegistry.addRecipe(new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1)})); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemContractBlaze.createStack(), new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemHintOfRebirth.createStack()}); - GameRegistry.addRecipe(new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractBlaze.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemContractBlaze.createStack(), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1)})); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemContractResistFire.createStack(), new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.blaze_powder)}); - GameRegistry.addRecipe(new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractResistFire.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemContractResistFire.createStack(), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1)})); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemContractEvaporate.createStack(), new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.magma_cream), new ItemStack(Items.blaze_rod)}); - GameRegistry.addRecipe(new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractEvaporate.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemContractEvaporate.createStack(), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1)})); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemContractFieryTouch.createStack(), new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Witchery.Blocks.EMBER_MOSS), new ItemStack(Items.blaze_rod)}); - GameRegistry.addRecipe(new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractFieryTouch.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemContractFieryTouch.createStack(), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1)})); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemContractSmelting.createStack(), new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.lava_bucket)}); - GameRegistry.addRecipe(new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractSmelting.createStack(), new ItemStack[]{Witchery.Items.GENERIC.itemContractSmelting.createStack(), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1)})); - GameRegistry.addShapelessRecipe(new ItemStack(Witchery.Items.LEONARDS_URN, 1, 1), new Object[]{new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0), new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0)}); - GameRegistry.addShapelessRecipe(new ItemStack(Witchery.Items.LEONARDS_URN, 1, 2), new Object[]{new ItemStack(Witchery.Items.LEONARDS_URN, 1, 1), new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0)}); - GameRegistry.addShapelessRecipe(new ItemStack(Witchery.Items.LEONARDS_URN, 1, 3), new Object[]{new ItemStack(Witchery.Items.LEONARDS_URN, 1, 2), new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0)}); - GameRegistry.addRecipe(new RecipeAttachTaglock(new ItemStack(Witchery.Items.PLAYER_COMPASS), new ItemStack[]{new ItemStack(Witchery.Items.PLAYER_COMPASS, 1, 32767), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1)})); - ItemStack[] var28 = new ItemStack[]{new ItemStack(Blocks.log, 1, 0), new ItemStack(Blocks.log, 1, 1), new ItemStack(Blocks.log, 1, 2), new ItemStack(Blocks.log, 1, 3), new ItemStack(Witchery.Blocks.LOG, 1, 0), new ItemStack(Witchery.Blocks.LOG, 1, 1), new ItemStack(Witchery.Blocks.LOG, 1, 2), new ItemStack(Blocks.log2, 1, 0), new ItemStack(Blocks.log2, 1, 1)}; - - for(kobolditeIngot = 0; kobolditeIngot < var28.length; ++kobolditeIngot) { - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.STOCKADE, 9, kobolditeIngot), new Object[]{" w ", "wfw", "www", Character.valueOf('f'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('w'), var28[kobolditeIngot]}); - } - - ItemStack var30 = Witchery.Items.GENERIC.itemKobolditeIngot.createStack(); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.KOBOLDITE_PICKAXE), new Object[]{"bab", "iii", " s ", Character.valueOf('i'), var30, Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Character.valueOf('b'), new ItemStack(Items.lava_bucket), Character.valueOf('s'), new ItemStack(Items.stick)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.STATUE_OF_WORSHIP), new Object[]{"sks", " s ", "s s", Character.valueOf('k'), var30, Character.valueOf('s'), new ItemStack(Blocks.stone)}); - GameRegistry.addShapedRecipe(Witchery.Items.GENERIC.itemKobolditePentacle.createStack(), new Object[]{"sks", "kdk", "sks", Character.valueOf('k'), var30, Character.valueOf('s'), Witchery.Items.GENERIC.itemKobolditeNugget.createStack(), Character.valueOf('d'), new ItemStack(Items.diamond)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.KOBOLDITE_HELM), new Object[]{"iii", "iai", Character.valueOf('i'), var30, Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.EARMUFFS), new Object[]{"iii", "i i", "w w", Character.valueOf('i'), new ItemStack(Items.leather), Character.valueOf('w'), new ItemStack(Blocks.wool)}); - GameRegistry.addRecipe(new RecipeShapelessBiomeCopy(new ItemStack(Witchery.Items.BIOME_NOTE), new ItemStack[]{new ItemStack(Witchery.Items.BIOME_BOOK.setContainerItem(Witchery.Items.BIOME_BOOK)), new ItemStack(Items.paper)})); - GameRegistry.addShapelessRecipe(Witchery.Items.GENERIC.itemAnnointingPaste.createStack(), new Object[]{new ItemStack(Witchery.Items.SEEDS_ARTICHOKE), new ItemStack(Witchery.Items.SEEDS_MANDRAKE), new ItemStack(Witchery.Items.SEEDS_BELLADONNA), new ItemStack(Witchery.Items.SEEDS_SNOWBELL)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.SILVER_SWORD), new Object[]{"ddd", "dsd", "ddd", Character.valueOf('s'), new ItemStack(Items.golden_sword), Character.valueOf('d'), Witchery.Items.GENERIC.itemSilverDust.createStack()}); - Item[][] var31 = new Item[][]{{Witchery.Items.HUNTER_BOOTS, Witchery.Items.HUNTER_BOOTS_SILVERED}, {Witchery.Items.HUNTER_LEGS, Witchery.Items.HUNTER_LEGS_SILVERED}, {Witchery.Items.HUNTER_COAT, Witchery.Items.HUNTER_COAT_SILVERED}, {Witchery.Items.HUNTER_HAT, Witchery.Items.HUNTER_HAT_SILVERED}}; - - for(meats = 0; meats < var31.length; ++meats) { - CraftingManager.getInstance().addRecipe(new ItemStack(var31[meats][1]), new Object[]{"dwd", "w#w", "dsd", Character.valueOf('#'), new ItemStack(var31[meats][0]), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemSilverDust.createStack()}).func_92100_c(); - } - - GameRegistry.addShapedRecipe(Witchery.Items.GENERIC.itemBoltSilver.createStack(3), new Object[]{" s ", "bbb", Character.valueOf('b'), Witchery.Items.GENERIC.itemBoltStake.createStack(), Character.valueOf('s'), Witchery.Items.GENERIC.itemSilverDust.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.WOLF_ALTAR), new Object[]{" w ", "w#w", "#d#", Character.valueOf('w'), new ItemStack(Witchery.Blocks.WOLFHEAD, 1, 32767), Character.valueOf('#'), new ItemStack(Blocks.stone), Character.valueOf('d'), Witchery.Items.GENERIC.itemWolfsbane.createStack()}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.SILVER_VAT), new Object[]{"ibi", "ifi", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('b'), new ItemStack(Items.water_bucket), Character.valueOf('f'), new ItemStack(Blocks.furnace)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.BEARTRAP), new Object[]{"iii", "bpb", "iii", Character.valueOf('p'), new ItemStack(Blocks.heavy_weighted_pressure_plate), Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('b'), new ItemStack(Items.shears)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.WOLFTRAP), new Object[]{"sns", "w#w", "sns", Character.valueOf('#'), new ItemStack(Witchery.Blocks.BEARTRAP), Character.valueOf('s'), Witchery.Items.GENERIC.itemSilverDust.createStack(), Character.valueOf('n'), Witchery.Items.GENERIC.itemNullCatalyst.createStack(), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack()}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Blocks.GARLIC_GARLAND), new Object[]{"s s", "GsG", "GGG", Character.valueOf('G'), "cropGarlic", Character.valueOf('s'), new ItemStack(Items.string)})); - ItemStack[] var34 = new ItemStack[]{new ItemStack(Items.beef), new ItemStack(Items.chicken), new ItemStack(Items.porkchop), new ItemStack(Items.fish), new ItemStack(Items.fish, 1), Witchery.Items.GENERIC.itemMuttonRaw.createStack()}; - ItemStack[] hunterItemsSilvered = var34; - int cloth = var34.length; - - int DEFAULT_FORCE_CHANCE; - for(DEFAULT_FORCE_CHANCE = 0; DEFAULT_FORCE_CHANCE < cloth; ++DEFAULT_FORCE_CHANCE) { - ItemStack meat = hunterItemsSilvered[DEFAULT_FORCE_CHANCE]; - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Witchery.Items.STEW_RAW), new Object[]{"cropGarlic", meat, new ItemStack(Items.potato), new ItemStack(Items.carrot), new ItemStack(Items.bowl), new ItemStack(Blocks.brown_mushroom)})); - } - - Item[][] var33 = new Item[][]{{Witchery.Items.HUNTER_BOOTS_SILVERED, Witchery.Items.HUNTER_BOOTS_GARLICKED}, {Witchery.Items.HUNTER_LEGS_SILVERED, Witchery.Items.HUNTER_LEGS_GARLICKED}, {Witchery.Items.HUNTER_COAT_SILVERED, Witchery.Items.HUNTER_COAT_GARLICKED}, {Witchery.Items.HUNTER_HAT_SILVERED, Witchery.Items.HUNTER_HAT_GARLICKED}}; - - for(cloth = 0; cloth < var33.length; ++cloth) { - CraftingManager.getInstance().addRecipe(new ItemStack(var33[cloth][1]), new Object[]{" g ", "g#g", " s ", Character.valueOf('#'), new ItemStack(var33[cloth][0]), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('g'), new ItemStack(Witchery.Items.SEEDS_GARLIC)}).func_92100_c(); - } - - for(cloth = 0; cloth < 9; ++cloth) { - GameRegistry.addShapelessRecipe(new ItemStack(Witchery.Items.VAMPIRE_BOOK, 1, cloth + 1), new Object[]{new ItemStack(Witchery.Items.VAMPIRE_BOOK, 1, cloth), Witchery.Items.GENERIC.itemVampireBookPage.createStack()}); - } - - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.BLOOD_GOBLET), new Object[]{"b b", " b ", " g ", Character.valueOf('g'), new ItemStack(Blocks.glass), Character.valueOf('b'), new ItemStack(Items.glass_bottle)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.BLOOD_CRUCIBLE), new Object[]{"s s", "blb", Character.valueOf('s'), new ItemStack(Blocks.stone_brick_stairs), Character.valueOf('b'), new ItemStack(Blocks.stonebrick), Character.valueOf('l'), new ItemStack(Blocks.stone_slab, 1, 5)}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Items.COFFIN), new Object[]{"ppp", "lbl", "lll", Character.valueOf('b'), new ItemStack(Items.bed), Character.valueOf('p'), "plankWood", Character.valueOf('l'), "logWood"})); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.DAYLIGHT_COLLECTOR), new Object[]{"g g", " r ", "ici", Character.valueOf('g'), new ItemStack(Items.gold_ingot), Character.valueOf('r'), new ItemStack(Items.repeater), Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('c'), new ItemStack(Blocks.daylight_detector)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_HELMET), new Object[]{" i ", "i#i", " i ", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('#'), new ItemStack(Witchery.Items.VAMPIRE_HAT)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_COAT_CHAIN), new Object[]{" i ", "i#i", " i ", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('#'), new ItemStack(Witchery.Items.VAMPIRE_COAT)}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_COAT_FEMALE_CHAIN), new Object[]{" i ", "i#i", " i ", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('#'), new ItemStack(Witchery.Items.VAMPIRE_COAT_FEMALE)}); - ItemStack var35 = Witchery.Items.GENERIC.itemDarkCloth.createStack(); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_HAT), new Object[]{"###", "# #", Character.valueOf('#'), var35}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_COAT), new Object[]{"# #", "###", "###", Character.valueOf('#'), var35}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_COAT_FEMALE), new Object[]{"# #", "#l#", "###", Character.valueOf('l'), new ItemStack(Items.leather), Character.valueOf('#'), var35}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_LEGS), new Object[]{"###", "# #", "# #", Character.valueOf('#'), var35}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_LEGS_KILT), new Object[]{"###", "###", "# #", Character.valueOf('#'), var35}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_BOOTS), new Object[]{"# #", "# #", Character.valueOf('#'), var35}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.CANE_SWORD), new Object[]{" #g", "#d#", "## ", Character.valueOf('g'), new ItemStack(Items.gold_ingot), Character.valueOf('d'), new ItemStack(Items.diamond_sword), Character.valueOf('#'), var35}); - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Items.VAMPIRE_BOOK), new Object[]{"#s#", "#b#", "#g#", Character.valueOf('s'), new ItemStack(Items.nether_star), Character.valueOf('b'), new ItemStack(Items.book), Character.valueOf('g'), new ItemStack(Witchery.Items.SEEDS_GARLIC), Character.valueOf('#'), new ItemStack(Items.nether_wart)}); - - for(DEFAULT_FORCE_CHANCE = 0; DEFAULT_FORCE_CHANCE < 16; ++DEFAULT_FORCE_CHANCE) { - GameRegistry.addShapedRecipe(new ItemStack(Witchery.Blocks.SHADED_GLASS, 8, DEFAULT_FORCE_CHANCE), new Object[]{"###", "#r#", "###", Character.valueOf('r'), new ItemStack(Items.redstone), Character.valueOf('#'), new ItemStack(Blocks.stained_glass, 1, DEFAULT_FORCE_CHANCE)}); - } - - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemWoodenStake.createStack(), new Object[]{"GGG", "GsG", "GGG", Character.valueOf('G'), "cropGarlic", Character.valueOf('s'), new ItemStack(Items.stick)})); - OreDictionary.registerOre("plankWood", new ItemStack(Witchery.Blocks.PLANKS, 1, 32767)); - OreDictionary.registerOre("treeSapling", new ItemStack(Witchery.Blocks.SAPLING, 1, 32767)); - OreDictionary.registerOre("logWood", new ItemStack(Witchery.Blocks.LOG, 1, 32767)); - OreDictionary.registerOre("treeLeaves", new ItemStack(Witchery.Blocks.LEAVES, 1, 32767)); - OreDictionary.registerOre("stairWood", new ItemStack(Witchery.Blocks.STAIRS_ALDER, 1, 32767)); - OreDictionary.registerOre("stairWood", new ItemStack(Witchery.Blocks.STAIRS_HAWTHORN, 1, 32767)); - OreDictionary.registerOre("stairWood", new ItemStack(Witchery.Blocks.STAIRS_ROWAN, 1, 32767)); - OreDictionary.registerOre("cropGarlic", new ItemStack(Witchery.Items.SEEDS_GARLIC, 1, 32767)); - GameRegistry.addSmelting(Witchery.Items.GENERIC.itemSoftClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), 0.0F); - GameRegistry.addSmelting(Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), Witchery.Items.GENERIC.itemOddPorkCooked.createStack(), 0.0F); - GameRegistry.addSmelting(Witchery.Items.GENERIC.itemGoldenThread.createStack(), new ItemStack(Items.gold_nugget), 0.0F); - GameRegistry.addSmelting(Witchery.Items.GENERIC.itemMuttonRaw.createStack(), Witchery.Items.GENERIC.itemMuttonCooked.createStack(), 0.0F); - GameRegistry.addSmelting(new ItemStack(Witchery.Blocks.BLOODED_WOOL), Witchery.Items.GENERIC.itemDarkCloth.createStack(), 0.0F); - GameRegistry.addSmelting(new ItemStack(Witchery.Items.STEW_RAW), new ItemStack(Witchery.Items.STEW), 1.0F); - if(!Config.instance().smeltAllSaplingsToWoodAsh) { - GameRegistry.addSmelting(Blocks.sapling, Witchery.Items.GENERIC.itemAshWood.createStack(), 0.0F); - GameRegistry.addSmelting(new ItemStack(Witchery.Blocks.SAPLING), Witchery.Items.GENERIC.itemAshWood.createStack(), 0.0F); - } - - GameRegistry.addSmelting(new ItemStack(Witchery.Blocks.LOG, 1, 0), new ItemStack(Items.coal, 1, 1), 0.0F); - GameRegistry.addSmelting(new ItemStack(Witchery.Blocks.LOG, 1, 1), new ItemStack(Items.coal, 1, 1), 0.0F); - GameRegistry.addSmelting(new ItemStack(Witchery.Blocks.LOG, 1, 2), new ItemStack(Items.coal, 1, 1), 0.0F); - DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), 1, Witchery.Items.GENERIC.itemGypsum.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), new ItemStack(Items.slime_ball), (ItemStack)null); - DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Dye.LAPIS_LAZULI.createStack(), 3, Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemFoulFume.createStack()); - DistilleryRecipes.instance().addRecipe(new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), 3, Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), (ItemStack)null); - DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemDiamondVapour.createStack(), new ItemStack(Items.ghast_tear), 3, Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemRefinedEvil.createStack()); - DistilleryRecipes.instance().addRecipe(new ItemStack(Items.ender_pearl), (ItemStack)null, 6, Witchery.Items.GENERIC.itemEnderDew.createStack(2), Witchery.Items.GENERIC.itemEnderDew.createStack(2), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()); - DistilleryRecipes.instance().addRecipe(new ItemStack(Items.blaze_powder), new ItemStack(Items.gunpowder), 1, new ItemStack(Items.glowstone_dust), new ItemStack(Items.glowstone_dust), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), (ItemStack)null); - DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), 4, Witchery.Items.GENERIC.itemInfernalBlood.createStack(2), Witchery.Items.GENERIC.itemInfernalBlood.createStack(2), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), (ItemStack)null); - DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemDemonHeart.createStack(), new ItemStack(Blocks.netherrack), 2, new ItemStack(Blocks.soul_sand), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), (ItemStack)null); - DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), 2, Witchery.Items.GENERIC.itemFocusedWill.createStack(), Witchery.Items.GENERIC.itemCondensedFear.createStack(), Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(4), Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(4)); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfVines.createStack(3), 1, 0, 0.0F, -16753913, 0, new ItemStack[]{new ItemStack(Blocks.vine), new ItemStack(Blocks.red_mushroom), new ItemStack(Blocks.brown_mushroom), Witchery.Items.GENERIC.itemDogTongue.createStack(), new ItemStack(Items.wheat), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfWebs.createStack(3), 1, 0, 0.0F, -1, 0, new ItemStack[]{Witchery.Items.GENERIC.itemWeb.createStack(), new ItemStack(Blocks.red_mushroom), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack(Blocks.yellow_flower), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfThorns.createStack(3), 1, 0, 0.0F, -10027232, 0, new ItemStack[]{Dye.CACTUS_GREEN.createStack(), new ItemStack(Blocks.brown_mushroom), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), new ItemStack(Blocks.red_flower), Witchery.Items.GENERIC.itemMandrakeRoot.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfInk.createStack(3), 1, 0, 0.0F, -13421773, 0, new ItemStack[]{Dye.INK_SAC.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemRowanBerries.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(3), 1, 0, 0.0F, -11258073, 0, new ItemStack[]{new ItemStack(Witchery.Blocks.SAPLING, 1, 0), new ItemStack(Witchery.Blocks.SAPLING, 1, 1), new ItemStack(Witchery.Blocks.SAPLING, 1, 2), Witchery.Items.GENERIC.itemDogTongue.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), new ItemStack(Blocks.red_flower)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfErosion.createStack(3), 1, 0, 0.0F, -4456656, 0, new ItemStack[]{Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Blocks.yellow_flower), new ItemStack(Items.magma_cream)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfRaising.createStack(3), 1, 0, 500.0F, -12120505, 0, new ItemStack[]{Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.redstone), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), new ItemStack(Items.bone), new ItemStack(Items.rotten_flesh)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewGrotesque.createStack(3), 1, 0, 500.0F, -13491946, 0, new ItemStack[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), new ItemStack(Items.golden_apple), new ItemStack(Items.poisonous_potato)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfLove.createStack(3), 1, 0, 0.0F, -23044, 0, new ItemStack[]{new ItemStack(Blocks.red_flower), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), new ItemStack(Items.golden_carrot), new ItemStack(Blocks.waterlily), Dye.COCOA_BEANS.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfIce.createStack(3), 1, 0, 1000.0F, -13565953, 0, new ItemStack[]{Witchery.Items.GENERIC.itemIcyNeedle.createStack(), new ItemStack(Items.snowball), Witchery.Items.GENERIC.itemArtichoke.createStack(), new ItemStack(Items.speckled_melon), new ItemStack(Blocks.red_mushroom), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfTheDepths.createStack(3), 1, 0, 0.0F, -15260093, 0, new ItemStack[]{Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), new ItemStack(Blocks.waterlily), Dye.INK_SAC.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfInfection.createStack(3), 0, 0, 0.0F, -11112850, 0, new ItemStack[]{Witchery.Items.GENERIC.itemToeOfFrog.createStack(), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Witchery.Items.GENERIC.itemWormyApple.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Items.rotten_flesh), Witchery.Items.GENERIC.itemMutandis.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSleeping.createStack(3), 1, 0, 0.0F, -7710856, 0, new ItemStack[]{Witchery.Items.GENERIC.itemPurifiedMilk.createStack(), new ItemStack(Items.cookie), Witchery.Items.GENERIC.itemBrewOfLove.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(3), 0, 0, 0.0F, -16711834, Config.instance().dimensionDreamID, new ItemStack[]{Witchery.Items.GENERIC.itemFancifulThread.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS), new ItemStack(Witchery.Blocks.GLINT_WEED), Witchery.Items.GENERIC.itemBatWool.createStack()}).setUnlocalizedName("witchery.brew.flowingspirit"); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfWasting.createStack(3), 1, 0, 0.0F, -12440546, 0, new ItemStack[]{Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), new ItemStack(Items.rotten_flesh), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Witchery.Blocks.EMBER_MOSS), new ItemStack(Items.poisonous_potato), new ItemStack(Items.spider_eye)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfBats.createStack(3), 1, 0, 0.0F, -9809858, 0, new ItemStack[]{Witchery.Items.GENERIC.itemBatBall.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack(Items.apple), new ItemStack(Items.sugar), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.gunpowder)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewSubstitution.createStack(3), 1, 0, 0.0F, -7010720, 0, new ItemStack[]{Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.egg), new ItemStack(Items.magma_cream), Witchery.Items.GENERIC.itemBranchEnt.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewRevealing.createStack(3), 1, 0, 0.0F, -4079167, 0, new ItemStack[]{new ItemStack(Items.carrot), new ItemStack(Items.spider_eye), new ItemStack(Items.spider_eye), new ItemStack(Items.potionitem, 1, 8198), new ItemStack(Blocks.brown_mushroom), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidDirt.createStack(3), 1, 0, 2000.0F, -11720688, 0, true, new ItemStack[]{new ItemStack(Blocks.dirt), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)}).setUnlocalizedName("witchery.brew.solidification"); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidRock.createStack(3), 1, 0, 2000.0F, -8355712, 0, false, new ItemStack[]{new ItemStack(Blocks.stone), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidSand.createStack(3), 1, 0, 2000.0F, -3495323, 0, false, new ItemStack[]{new ItemStack(Blocks.sand), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidSandstone.createStack(3), 1, 0, 2000.0F, -8427008, 0, false, new ItemStack[]{new ItemStack(Blocks.sandstone), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidErosion.createStack(3), 1, 0, 2000.0F, -3300, 0, false, new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfErosion.createStack(), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfCursedLeaping.createStack(3), 1, 1, 0.0F, -16758145, 0, new ItemStack[]{new ItemStack(Items.bone), new ItemStack(Items.apple), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Items.feather), new ItemStack(Items.fish)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfFrogsTongue.createStack(3), 1, 2, 0.0F, -12938226, 0, new ItemStack[]{new ItemStack(Blocks.red_mushroom), new ItemStack(Items.wheat), Witchery.Items.GENERIC.itemBrewOfWebs.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemToeOfFrog.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfHitchcock.createStack(3), 1, 3, 0.0F, -3908582, 0, new ItemStack[]{new ItemStack(Blocks.brown_mushroom), new ItemStack(Items.wheat_seeds), Witchery.Items.GENERIC.itemBrewOfThorns.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack(Items.feather), Witchery.Items.GENERIC.itemOwletsWing.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemCongealedSpirit.createStack(), 0, 0, 2000.0F, -3096310, 0, new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), 0, 0, 1000.0F, -59882, 0, new ItemStack[]{new ItemStack(Items.redstone), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemFlyingOintment.createStack(), 0, 0, 3000.0F, -17620, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 8258), new ItemStack(Items.diamond), new ItemStack(Items.feather), Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemMysticUnguent.createStack(), 0, 0, 3000.0F, -14333109, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 8265), new ItemStack(Items.diamond), new ItemStack(Witchery.Blocks.SAPLING, 1, 0), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemHappenstanceOil.createStack(), 0, 0, 2000.0F, 8534058, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 8262), new ItemStack(Items.ender_eye), new ItemStack(Items.golden_carrot), new ItemStack(Items.spider_eye), Witchery.Items.GENERIC.itemMandrakeRoot.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemGhostOfTheLight.createStack(2), 0, 0, 4000.0F, -5584658, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 8270), new ItemStack(Items.potionitem, 1, 8259), Witchery.Items.POPPET.firePoppet.createStack(), new ItemStack(Blocks.torch), Witchery.Items.GENERIC.itemDogTongue.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemSoulOfTheWorld.createStack(2), 0, 0, 4000.0F, -16003328, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 8257), new ItemStack(Items.golden_apple, 1, 1), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), new ItemStack(Witchery.Blocks.SAPLING, 1, 0)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemSpiritOfOtherwhere.createStack(2), 0, 0, 4000.0F, -7128833, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 8258), new ItemStack(Items.ender_eye), new ItemStack(Items.ender_eye), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemSpiritOfOtherwhere.createStack(2), 0, 0, 4000.0F, -7128833, 0, false, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 16210), new ItemStack(Items.ender_eye), new ItemStack(Items.ender_eye), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfernalAnimus.createStack(2), 0, 0, 4000.0F, -7598080, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 8236), Witchery.Items.POPPET.voodooPoppet.createStack(), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_rod)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfernalAnimus.createStack(2), 0, 0, 4000.0F, -7598080, 0, false, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack(Items.potionitem, 1, 16172), Witchery.Items.POPPET.voodooPoppet.createStack(), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_rod)}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfusionBase.createStack(), 1, 0, 3000.0F, -10520657, 0, new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Witchery.Items.GENERIC.itemToeOfFrog.createStack(), Witchery.Items.GENERIC.itemOwletsWing.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack()}); - KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfusionBase.createStack(2), 0, 0, 3000.0F, -10520657, 0, new ItemStack[]{Witchery.Items.GENERIC.itemInfusionBase.createStack(), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack(Witchery.Blocks.BRAMBLE, 1, 1)}); - CreaturePower.Registry.instance().add(new CreaturePowerSpider(1, EntityCaveSpider.class)); - CreaturePower.Registry.instance().add(new CreaturePowerSpider(2, EntitySpider.class)); - CreaturePower.Registry.instance().add(new CreaturePowerCreeper(3)); - CreaturePower.Registry.instance().add(new CreaturePowerBat(4, EntityBat.class)); - CreaturePower.Registry.instance().add(new CreaturePowerSquid(5)); - CreaturePower.Registry.instance().add(new CreaturePowerGhast(6)); - CreaturePower.Registry.instance().add(new CreaturePowerBlaze(7)); - CreaturePower.Registry.instance().add(new CreaturePowerPigMan(8)); - CreaturePower.Registry.instance().add(new CreaturePowerZombie(9)); - CreaturePower.Registry.instance().add(new CreaturePowerSkeleton(10)); - CreaturePower.Registry.instance().add(new CreaturePowerJump(11, EntityMagmaCube.class)); - CreaturePower.Registry.instance().add(new CreaturePowerJump(12, EntitySlime.class)); - CreaturePower.Registry.instance().add(new CreaturePowerSpeed(13, EntitySilverfish.class)); - CreaturePower.Registry.instance().add(new CreaturePowerSpeed(14, EntityOcelot.class)); - CreaturePower.Registry.instance().add(new CreaturePowerSpeed(15, EntityWolf.class)); - CreaturePower.Registry.instance().add(new CreaturePowerSpeed(16, EntityHorse.class)); - CreaturePower.Registry.instance().add(new CreaturePowerEnderman(17)); - CreaturePower.Registry.instance().add(new CreaturePowerHeal(18, EntitySheep.class, 1)); - CreaturePower.Registry.instance().add(new CreaturePowerHeal(19, EntityCow.class, 1)); - CreaturePower.Registry.instance().add(new CreaturePowerHeal(20, EntityChicken.class, 1)); - CreaturePower.Registry.instance().add(new CreaturePowerHeal(21, EntityPig.class, 1)); - CreaturePower.Registry.instance().add(new CreaturePowerHeal(22, EntityVillager.class, 2)); - CreaturePower.Registry.instance().add(new CreaturePowerHeal(23, EntityMooshroom.class, 2)); - CreaturePower.Registry.instance().add(new CreaturePowerBat(24, EntityOwl.class)); - CreaturePower.Registry.instance().add(new CreaturePowerJump(25, EntityToad.class)); - RiteRegistry.addRecipe(1, 0, new RiteBindCircleToTalisman(), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.CIRCLE_TALISMAN), new ItemStack(Items.redstone)}), new SacrificePower(1000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[0]).setUnlocalizedName("witchery.rite.bindcircle"); - RiteRegistry.addRecipe(2, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(), RiteSummonItem.Binding.LOCATION), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.glowstone_dust)}), new SacrificePower(500.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.bindwaystone"); - RiteRegistry.addRecipe(3, 3, new RiteSummonItem(Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemAttunedStone.createStack(), new ItemStack(Items.glowstone_dust), new ItemStack(Items.redstone), Witchery.Items.GENERIC.itemAshWood.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.chargestone"); - RiteRegistry.addRecipe(4, 4, new RiteInfusionRecharge(10, 4, 40.0F, 0), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.potionitem, 1, 8193)}), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusionrecharge"); - RiteRegistry.addRecipe(5, 5, new RiteTeleportToWaystone(3), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystoneBound.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 16, 0)}).setUnlocalizedName("witchery.rite.teleporttowaystone"); - RiteRegistry.addRecipe(6, 6, new RiteTeleportEntity(3), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystone.createStack(), new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.iron_axe)}), new SacrificePower(3000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 28, 0)}).setUnlocalizedName("witchery.rite.teleportentity"); - RiteRegistry.addRecipe(7, 7, new RiteTransposeOres(8, 30, new Block[]{Blocks.iron_ore, Blocks.gold_ore}), new SacrificeItem(new ItemStack[]{new ItemStack(Items.ender_pearl), new ItemStack(Items.iron_ingot), new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 40, 0)}).setUnlocalizedName("witchery.rite.teleportironore"); - RiteRegistry.addRecipe(8, 8, new RiteProtectionCircleRepulsive(4, 0.8F, 0), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.feather), new ItemStack(Items.redstone)}), new SacrificePower(500.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.protection"); - RiteRegistry.addRecipe(9, 9, new RiteProtectionCircleAttractive(4, 0.8F, 0), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.slime_ball), new ItemStack(Items.redstone)}), new SacrificePower(500.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.imprisonment"); - RiteRegistry.addRecipe(10, 10, new RiteProtectionCircleBarrier(4, 5, 1.2F, false, 0), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.obsidian), new ItemStack(Items.redstone)}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(500.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.barrier"); - RiteRegistry.addRecipe(11, 11, new RiteProtectionCircleBarrier(6, 6, 1.4F, true, 0), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.obsidian), new ItemStack(Items.glowstone_dust)}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(1000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.barrierlarge"); - RiteRegistry.addRecipe(12, 12, new RiteProtectionCircleBarrier(6, 4, 0.0F, true, 60), new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.obsidian), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.barrierportable"); - RiteRegistry.addRecipe(13, 13, new RiteRaiseVolcano(8, 8), new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.stone), new ItemStack(Items.magma_cream), new ItemStack(Items.golden_sword), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16)}).setUnlocalizedName("witchery.rite.volcano"); - RiteRegistry.addRecipe(14, 14, new RiteWeatherCallStorm(0, 3, 8), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.wooden_sword), Witchery.Items.GENERIC.itemAshWood.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(1000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.storm"); - RiteRegistry.addRecipe(15, 15, new RiteWeatherCallStorm(3, 7, 18), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.stone_sword), Witchery.Items.GENERIC.itemAshWood.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.stormlarge"); - RiteRegistry.addRecipe(16, 16, new RiteWeatherCallStorm(3, 7, 18), new SacrificeItem(new ItemStack[]{new ItemStack(Items.iron_sword), Witchery.Items.GENERIC.itemAshWood.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.stormportable"); - RiteRegistry.addRecipe(17, 17, new RiteEclipse(), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.stone_axe), Witchery.Items.GENERIC.itemQuicklime.createStack()}), new SacrificePower(3000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_DAY), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.eclipse"); - RiteRegistry.addRecipe(18, 18, new RiteEclipse(), new SacrificeItem(new ItemStack[]{new ItemStack(Items.iron_axe), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.of(RitualTraits.ONLY_AT_DAY), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.eclipseportable"); - RiteRegistry.addRecipe(19, 19, new RitePartEarth(60, 1, 10), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfErosion.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.partearth"); - RiteRegistry.addRecipe(20, 20, new RiteRaiseColumn(4, 8), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Blocks.cactus), new ItemStack(Items.gunpowder)}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack())}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.raiseearth"); - RiteRegistry.addRecipe(21, 23, new RiteBanishDemon(9), new SacrificeItem(new ItemStack[]{new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.banishdemonportable"); - RiteRegistry.addRecipe(22, 24, new RiteBanishDemon(9), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemWaystone.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.banishdemon"); - RiteRegistry.addRecipe(23, 25, new RiteSummonCreature(EntityDemon.class, false), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_powder), new ItemStack(Items.ender_pearl)}), new SacrificeLiving(EntityVillager.class), new SacrificePower(3000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 40)}).setUnlocalizedName("witchery.rite.summondemon"); - RiteRegistry.addRecipe(24, 26, new RiteSummonCreature(EntityDemon.class, false), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_rod), new ItemStack(Items.ender_pearl), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), new SacrificePower(3000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 40)}).setUnlocalizedName("witchery.rite.summondemonexpensive"); - RiteRegistry.addRecipe(25, 27, new RiteSummonCreature(EntityWither.class, false), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.skull, 1, 1), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), new ItemStack(Items.ender_pearl)}), new SacrificeLiving(EntityVillager.class), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 28), new Circle(0, 0, 40)}).setUnlocalizedName("witchery.rite.summonwither"); - RiteRegistry.addRecipe(26, 28, new RiteSummonCreature(EntityWither.class, false), new SacrificeItem(new ItemStack[]{new ItemStack(Items.skull, 1, 1), new ItemStack(Items.diamond), new ItemStack(Items.ender_pearl), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 28), new Circle(0, 0, 40)}).setUnlocalizedName("witchery.rite.summonwitherexpensive"); - this.infusionLight = new InfusionLight(1); - Infusion.Registry.instance().add(this.infusionLight); - RiteRegistry.addRecipe(27, 31, new RiteInfusePlayers(this.infusionLight, 200, 4), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemGhostOfTheLight.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusionlight"); - this.infusionWorld = new InfusionOverworld(2); - Infusion.Registry.instance().add(this.infusionWorld); - RiteRegistry.addRecipe(28, 32, new RiteInfusePlayers(this.infusionWorld, 200, 4), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemSoulOfTheWorld.createStack()}), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusionearth"); - this.infusionEnder = new InfusionOtherwhere(3); - Infusion.Registry.instance().add(this.infusionEnder); - RiteRegistry.addRecipe(29, 33, new RiteInfusePlayers(this.infusionEnder, 200, 4), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemSpiritOfOtherwhere.createStack()}), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 16, 0), new Circle(0, 28, 0)}).setUnlocalizedName("witchery.rite.infusionender"); - this.infusionBeast = new InfusionInfernal(4); - Infusion.Registry.instance().add(this.infusionBeast); - RiteRegistry.addRecipe(30, 34, new RiteInfusePlayers(this.infusionBeast, 200, 4), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemInfernalAnimus.createStack()}), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16), new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.infusionhell"); - RiteRegistry.addRecipe(31, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemBroomEnchanted.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBroom.createStack(), Witchery.Items.GENERIC.itemFlyingOintment.createStack()}), new SacrificePower(3000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusionsky"); - RiteRegistry.addRecipe(32, 36, new RiteSummonItem(Witchery.Items.GENERIC.itemNecroStone.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemAttunedStone.createStack(), new ItemStack(Items.bone), new ItemStack(Items.rotten_flesh), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Items.iron_sword), Witchery.Items.GENERIC.itemSpectralDust.createStack()}), new SacrificePower(1000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.necrostone"); - RiteRegistry.addRecipe(33, 30, new RiteSummonCreature(EntityFamiliar.class, true), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemDropOfLuck.createStack(), new ItemStack(Items.porkchop), new ItemStack(Items.gold_ingot), new ItemStack(Witchery.Items.ARTHANA)}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.summonfamiliar"); - RiteRegistry.addRecipe(34, 2, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(2), RiteSummonItem.Binding.COPY_LOCATION), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystoneBound.createStack(), Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.redstone)}), new SacrificePower(500.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.bindwaystonecopy"); - RiteRegistry.addRecipe(35, 21, new RiteFertility(50, 15), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Dye.BONE_MEAL.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemGypsum.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack()}), new SacrificePower(3000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.fertility"); - RiteRegistry.addRecipe(36, 22, new RiteFertility(50, 15), new SacrificeItem(new ItemStack[]{Dye.BONE_MEAL.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemGypsum.createStack(), Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.fertilityportable"); - RiteRegistry.addRecipe(37, 37, new RiteBlight(80, 15), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.speckled_melon), new ItemStack(Items.rotten_flesh), new ItemStack(Items.diamond)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.curseblight"); - RiteRegistry.addRecipe(38, 38, new RiteBlindness(80, 15), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.GENERIC.itemBrewOfInk.createStack(), new ItemStack(Items.poisonous_potato), new ItemStack(Items.spider_eye), new ItemStack(Items.diamond)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16)}).setUnlocalizedName("witchery.rite.curseblindness"); - RiteRegistry.addRecipe(39, 39, new RiteHellOnEarth(20, 15, 200.0F), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemWaystone.createStack(), new ItemStack(Items.nether_star)}), new SacrificeLiving(EntityVillager.class), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(5000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_OVERWORLD, RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(0, 0, 16), new Circle(0, 28, 0), new Circle(0, 0, 40)}).setUnlocalizedName("witchery.rite.hellonearth"); - RiteRegistry.addRecipe(40, 29, new RiteSummonCreature(EntityWitch.class, false), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Items.magma_cream), new ItemStack(Witchery.Items.ARTHANA), new ItemStack(Items.fermented_spider_eye)}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16)}).setUnlocalizedName("witchery.rite.summonwitch"); - RiteRegistry.addRecipe(41, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(), RiteSummonItem.Binding.LOCATION), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.bindwaystoneportable"); - RiteRegistry.addRecipe(42, 2, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(2), RiteSummonItem.Binding.COPY_LOCATION), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystoneBound.createStack(), Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.bindwaystonecopyportable"); - RiteRegistry.addRecipe(43, 22, new RiteNaturesPower(14, 8, 150, 2), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Witchery.Blocks.SAPLING, 1, 0), new ItemStack(Witchery.Blocks.SAPLING, 1, 1), new ItemStack(Witchery.Blocks.SAPLING, 1, 2), new ItemStack(Blocks.sapling, 1, 0), new ItemStack(Blocks.sapling, 1, 1), new ItemStack(Blocks.sapling, 1, 2), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.naturespower"); - RiteRegistry.addRecipe(44, 36, new RitePriorIncarnation(5, 16), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemNecroStone.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), new ItemStack(Items.bone), Witchery.Items.GENERIC.itemSpectralDust.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16)}).setUnlocalizedName("witchery.rite.priorincarnation"); - RiteRegistry.addRecipe(45, 0, new RiteBindCircleToTalisman(), new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.CIRCLE_TALISMAN), new ItemStack(Items.glowstone_dust), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[0]).setUnlocalizedName("witchery.rite.bindcircleportable"); - RiteRegistry.addRecipe(46, 20, new RiteRaiseColumn(6, 8), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Blocks.cactus), new ItemStack(Items.redstone)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.raiseearth"); - RiteRegistry.addRecipe(47, 20, new RiteRaiseColumn(9, 8), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Blocks.cactus), new ItemStack(Items.glowstone_dust)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(40, 0, 0)}).setUnlocalizedName("witchery.rite.raiseearth"); - RiteRegistry.addRecipe(48, 48, new RiteCurseCreature(true, "witcheryCursed", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.gunpowder), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.cursecreature1"); - RiteRegistry.addRecipe(49, 49, new RiteCurseCreature(false, "witcheryCursed", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Items.spider_eye), new ItemStack(Items.gunpowder), Witchery.Items.GENERIC.itemBrewOfLove.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.removecurse1"); - RiteRegistry.addRecipe(50, 35, new RiteSummonItem(new ItemStack(Witchery.Items.MYSTIC_BRANCH), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBranchEnt.createStack(), Witchery.Items.GENERIC.itemMysticUnguent.createStack()}), new SacrificePower(3000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusiontree"); - RiteRegistry.addRecipe(51, 20, new RiteCookItem(5.0F, 0.08D), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Items.coal)}), new SacrificePower(1000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16)}).setUnlocalizedName("witchery.rite.cookfood"); - RiteRegistry.addRecipe(52, 48, new RiteCurseCreature(true, "witcheryInsanity", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Items.poisonous_potato), new ItemStack(Items.sugar), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.curseinsanity1"); - RiteRegistry.addRecipe(53, 49, new RiteCurseCreature(false, "witcheryInsanity", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Items.potato), new ItemStack(Items.sugar), Witchery.Items.GENERIC.itemBrewOfLove.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.removeinsanity1"); - RiteRegistry.addRecipe(54, 1, new RiteBindFamiliar(7), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemInfernalBlood.createStack()}), new SacrificePower(8000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.bindfamiliar"); - RiteRegistry.addRecipe(55, 30, new RiteCallFamiliar(7), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()}), new SacrificePower(1000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.callfamiliar"); - RiteRegistry.addRecipe(56, 50, new RiteCursePoppets(1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.POPPET.antiVoodooPoppet.createStack(), new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemSpectralDust.createStack()}), new SacrificePower(7000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.corruptvoodooprotection"); - RiteRegistry.addRecipe(57, 35, new RiteSummonItem(new ItemStack(Witchery.Blocks.CRYSTAL_BALL), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemQuartzSphere.createStack(), new ItemStack(Items.gold_ingot), Witchery.Items.GENERIC.itemHappenstanceOil.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusionfuture"); - RiteRegistry.addRecipe(58, 20, new RiteCookItem(5.0F, 0.16D), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Items.blaze_powder)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16)}).setUnlocalizedName("witchery.rite.cookfood"); - RiteRegistry.addRecipe(59, 48, new RiteCurseCreature(true, "witcherySinking", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Dye.INK_SAC.createStack(), new ItemStack(Items.nether_wart), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.cursesinking1"); - RiteRegistry.addRecipe(60, 49, new RiteCurseCreature(false, "witcherySinking", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Dye.BONE_MEAL.createStack(), new ItemStack(Items.nether_wart), Witchery.Items.GENERIC.itemBrewOfTheDepths.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.removesinking1"); - RiteRegistry.addRecipe(61, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemSeerStone.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemQuartzSphere.createStack(), new ItemStack(Blocks.obsidian), Witchery.Items.GENERIC.itemHappenstanceOil.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.infusionseerstone"); - RiteRegistry.addRecipe(62, 48, new RiteCurseCreature(true, "witcheryOverheating", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.curseoverheating"); - RiteRegistry.addRecipe(63, 49, new RiteCurseCreature(false, "witcheryOverheating", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemBrewOfTheDepths.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.cureoverheating"); - RiteRegistry.addRecipe(64, 22, new RiteClimateChange(16), new SacrificeItem(new ItemStack[]{new ItemStack(Items.spider_eye), Witchery.Items.GENERIC.itemToeOfFrog.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), Witchery.Items.GENERIC.itemOwletsWing.createStack(), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(40, 0, 0)}).setUnlocalizedName("witchery.rite.climatechange"); - RiteRegistry.addRecipe(65, 12, new RiteSphereEffect(8, Witchery.Blocks.PERPETUAL_ICE), new SacrificeItem(new ItemStack[]{new ItemStack(Items.diamond_sword), Witchery.Items.GENERIC.itemFrozenHeart.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.iceshell"); - RiteRegistry.addRecipe(66, 38, new RiteRainOfToads(5, 16, 10), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Witchery.Items.GENERIC.itemToeOfFrog.createStack(), new ItemStack(Items.water_bucket), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.rainoffrogs"); - RiteRegistry.addRecipe(67, 4, new RiteGlyphicTransformation(), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemGypsum.createStack(), new ItemStack(Witchery.Items.ARTHANA)}), new SacrificePower(1000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[0]).setUnlocalizedName("witchery.rite.glyphictransform"); - RiteRegistry.addRecipe(68, 7, new RiteCallCreatures(64.0F, new Class[]{EntityPig.class, EntityChicken.class, EntityCow.class, EntitySheep.class, EntityMooshroom.class, EntityWolf.class, EntityOcelot.class}), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Items.milk_bucket), new ItemStack(Blocks.hay_block), new ItemStack(Items.apple), new ItemStack(Items.beef), new ItemStack(Items.fish), new ItemStack(Blocks.red_mushroom), new ItemStack(Items.carrot), new ItemStack(Items.wheat_seeds)}), new SacrificePower(6000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 40, 0)}).setUnlocalizedName("witchery.rite.callbeasts"); - RiteRegistry.addRecipe(69, 7, new RiteSetNBT(5, "WITCManifestDuration", 150, 25), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemSpectralDust.createStack(), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Items.golden_pickaxe), new ItemStack(Witchery.Items.ARTHANA), new ItemStack(Items.gunpowder)}), new SacrificePower(5000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 16, 0)}).setUnlocalizedName("witchery.rite.manifest"); - RiteRegistry.addRecipe(70, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 0), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.sapling, 1, 0), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.forestation"); - RiteRegistry.addRecipe(71, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.sapling, 1, 1), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); - RiteRegistry.addRecipe(72, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 2), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.sapling, 1, 2), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); - RiteRegistry.addRecipe(73, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 3), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.sapling, 1, 3), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); - RiteRegistry.addRecipe(74, 22, new RiteForestation(20, 8, 60, Witchery.Blocks.SAPLING, 0), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Blocks.SAPLING, 1, 0), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); - RiteRegistry.addRecipe(75, 22, new RiteForestation(20, 8, 60, Witchery.Blocks.SAPLING, 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Blocks.SAPLING, 1, 1), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); - RiteRegistry.addRecipe(76, 22, new RiteForestation(20, 8, 60, Witchery.Blocks.SAPLING, 2), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Blocks.SAPLING, 1, 2), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); - RiteRegistry.addRecipe(77, 13, new RiteRaiseVolcano(8, 8), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Blocks.cobblestone), new ItemStack(Items.magma_cream), new ItemStack(Items.golden_sword)}), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 16)}).setUnlocalizedName("witchery.rite.volcano"); - RiteRegistry.addRecipe(78, 48, new RiteCurseCreature(true, "witcheryWakingNightmare", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()}), new SacrificePower(10000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.cursenightmare"); - RiteRegistry.addRecipe(79, 49, new RiteCurseCreature(false, "witcheryWakingNightmare", 1), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Items.golden_carrot), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Witchery.Items.GENERIC.itemBrewOfLove.createStack()}), new SacrificePower(2000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.curenightmare"); - RiteRegistry.addRecipe(80, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemBrewOfSoaring.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemInfusionBase.createStack(), Witchery.Items.GENERIC.itemBroom.createStack(), new ItemStack(Items.feather), new ItemStack(Witchery.Items.ARTHANA)}), new SacrificeLiving(EntityOwl.class), new SacrificePower(3000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusebrewsoaring"); - RiteRegistry.addRecipe(81, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemBrewGrave.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemInfusionBase.createStack(), new ItemStack(Items.bone), Witchery.Items.GENERIC.itemWeb.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack()}), new SacrificeLiving(EntityZombie.class), new SacrificePower(3000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0), new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusebrewgrave"); - RiteRegistry.addRecipe(82, 36, new RiteSummonItem(new ItemStack(Witchery.Items.SPECTRAL_STONE), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemNecroStone.createStack(), Witchery.Items.GENERIC.itemCongealedSpirit.createStack(), Witchery.Items.GENERIC.itemCondensedFear.createStack(), Witchery.Items.GENERIC.itemSpectralDust.createStack(), new ItemStack(Witchery.Items.BOLINE)}), new SacrificePower(6000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.spectralstone").setConsumeNecroStone(); - RiteRegistry.addRecipe(83, 1, new RiteSummonSpectralStone(5), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.SPECTRAL_STONE), Witchery.Items.GENERIC.itemSpectralDust.createStack(), new ItemStack(Witchery.Items.BOLINE)}), new SacrificePower(5000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.bindspectral"); - RiteRegistry.addRecipe(84, 1, new RiteBindSpiritsToFetish(5), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Blocks.FETISH_SCARECROW), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Witchery.Items.BOLINE)}), new SacrificePower(6000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.bindfetish"); - RiteRegistry.addRecipe(85, 1, new RiteBindSpiritsToFetish(5), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Blocks.FETISH_TREANT_IDOL), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Witchery.Items.BOLINE)}), new SacrificePower(6000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.bindfetish").setShowInBook(false); - RiteRegistry.addRecipe(86, 1, new RiteBindSpiritsToFetish(5), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Blocks.FETISH_WITCHS_LADDER), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Witchery.Items.BOLINE)}), new SacrificePower(6000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.bindfetish").setShowInBook(false); - RiteRegistry.addRecipe(87, 26, new RiteSummonCreature(EntityImp.class, false), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemRefinedEvil.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), new ItemStack(Items.ender_pearl), Witchery.Items.GENERIC.itemAttunedStone.createStack()}), new SacrificePower(5000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.summonimp"); - RiteRegistry.addRecipe(88, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystonePlayerBound.createStack(), RiteSummonItem.Binding.ENTITY), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.slime_ball), new ItemStack(Items.snowball)}), new SacrificePower(500.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.bindwaystonetoplayer"); - RiteRegistry.addRecipe(89, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystonePlayerBound.createStack(), RiteSummonItem.Binding.ENTITY), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.bindwaystonetoplayer"); - RiteRegistry.addRecipe(90, 1, new RiteSummonItem(new ItemStack(Witchery.Blocks.STATUE_OF_WORSHIP), RiteSummonItem.Binding.PLAYER), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Blocks.STATUE_OF_WORSHIP), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Blocks.red_flower), new ItemStack(Blocks.yellow_flower)}), new SacrificePower(4000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.bindstatuetoplayer"); - RiteRegistry.addRecipe(91, 5, new RiteTeleportToWaystone(3), new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemWaystonePlayerBound.createStack()}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 16, 0)}).setUnlocalizedName("witchery.rite.teleporttowaystone"); - RiteRegistry.addRecipe(92, 48, new RiteCurseOfTheWolf(true), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Witchery.Blocks.WOLFHEAD, 1, 1), Witchery.Items.GENERIC.itemWolfsbane.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()}), new SacrificePower(10000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(0, 0, 28)}).setUnlocalizedName("witchery.rite.wolfcurse.book"); - RiteRegistry.addRecipe(93, 49, new RiteCurseOfTheWolf(false), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Witchery.Items.SILVER_SWORD), Witchery.Items.GENERIC.itemWolfsbane.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewOfLove.createStack()}), new SacrificePower(10000.0F, 20)}), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.wolfcure.book"); - RiteRegistry.addRecipe(94, 49, new RiteRemoveVampirism(), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Witchery.Items.SILVER_SWORD), new ItemStack(Witchery.Items.SEEDS_GARLIC), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewOfLove.createStack()}), new SacrificePower(10000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(16, 0, 0)}).setUnlocalizedName("witchery.rite.vampirecure.book"); - RiteRegistry.addRecipe(95, 35, new RiteSummonItem(new ItemStack(Witchery.Items.MIRROR), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(), new ItemStack(Items.gold_ingot), new ItemStack(Blocks.glass_pane)}), new SacrificePower(2000.0F, 20), new SacrificeLiving(EntityDemon.class)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(28, 0, 0)}).setUnlocalizedName("witchery.rite.infusionmirror"); - RiteRegistry.addRecipe(96, 28, new RiteSummonCreature(EntityReflection.class, false), new SacrificeMultiple(new Sacrifice[]{new SacrificeItem(new ItemStack[]{new ItemStack(Witchery.Items.MIRROR), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemQuartzSphere.createStack()}), new SacrificePower(5000.0F, 20)}), EnumSet.noneOf(RitualTraits.class), new Circle[]{new Circle(0, 0, 40)}).setUnlocalizedName("witchery.rite.summonreflection"); - double var36 = 0.05D; - PredictionManager.instance().addPrediction(new PredictionFight(1, 13, 0.05D, "witchery.prediction.zombie", EntityZombie.class, false)); - PredictionManager.instance().addPrediction(new PredictionArrow(2, 13, 0.05D, "witchery.prediction.arrowhit")); - PredictionManager.instance().addPrediction(new PredictionFight(3, 3, 0.05D, "witchery.prediction.ent", EntityEnt.class, false)); - PredictionManager.instance().addPrediction(new PredictionFall(4, 13, 0.05D, "witchery.prediction.fall")); - PredictionManager.instance().addPrediction(new PredictionMultiMine(5, 8, 0.05D, "witchery.prediction.iron", 1212, 0.01D, Blocks.iron_ore, new ItemStack(Blocks.iron_ore), 8, 20)); - PredictionManager.instance().addPrediction(new PredictionMultiMine(6, 3, 0.05D, "witchery.prediction.diamond", 1208, 0.01D, Blocks.stone, new ItemStack(Items.diamond), 1, 1)); - PredictionManager.instance().addPrediction(new PredictionMultiMine(7, 3, 0.05D, "witchery.prediction.emerald", 1208, 0.01D, Blocks.stone, new ItemStack(Items.emerald), 1, 1)); - PredictionManager.instance().addPrediction(new PredictionBuriedTreasure(8, 2, 0.05D, "witchery.prediction.treasure", 1210, 0.01D, "mineshaftCorridor")); - PredictionManager.instance().addPrediction(new PredictionFallInLove(9, 2, 0.05D, "witchery.prediction.love", 1210, 0.01D)); - PredictionManager.instance().addPrediction(new PredictionFight(10, 2, 0.05D, "witchery.prediction.bababad", EntityBabaYaga.class, false)); - PredictionManager.instance().addPrediction(new PredictionFight(11, 2, 0.05D, "witchery.prediction.babagood", EntityBabaYaga.class, true)); - PredictionManager.instance().addPrediction(new PredictionFight(12, 3, 0.05D, "witchery.prediction.friend", EntityWolf.class, true)); - PredictionManager.instance().addPrediction(new PredictionRescue(13, 13, 0.05D, "witchery.prediction.rescued", 1208, 0.01D, EntityOwl.class)); - PredictionManager.instance().addPrediction(new PredictionRescue(14, 13, 0.05D, "witchery.prediction.rescued", 1208, 0.01D, EntityWolf.class)); - PredictionManager.instance().addPrediction(new PredictionWet(15, 13, 0.05D, "witchery.prediction.wet")); - PredictionManager.instance().addPrediction(new PredictionNetherTrip(16, 3, 0.05D, "witchery.prediction.tothenether")); - PredictionManager.instance().addPrediction(new PredictionMultiMine(17, 13, 0.05D, "witchery.prediction.coal", 1208, 0.01D, Blocks.coal_ore, new ItemStack(Items.coal), 10, 20)); - } - - public void init() { - ItemStack dust = Witchery.Items.GENERIC.itemSilverDust.createStack(); - ArrayList silverDust = OreDictionary.getOres("dustSilver"); - if(silverDust != null && !silverDust.isEmpty()) { - GameRegistry.addShapelessRecipe(((ItemStack)silverDust.get(0)).copy(), new Object[]{dust, dust, dust, dust, dust, dust, dust, dust, dust}); - } - - ArrayList silverIngots = OreDictionary.getOres("ingotSilver"); - if(silverIngots != null && !silverIngots.isEmpty()) { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Items.SILVER_SWORD), new Object[]{"s", "s", "b", Character.valueOf('s'), "ingotSilver", Character.valueOf('b'), new ItemStack(Items.golden_sword)})); - GameRegistry.addRecipe(new ShapedOreRecipe(Witchery.Items.GENERIC.itemBoltSilver.createStack(6), new Object[]{" s ", "bbb", "bbb", Character.valueOf('s'), "ingotSilver", Character.valueOf('b'), Witchery.Items.GENERIC.itemBoltStake.createStack()})); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Witchery.Blocks.WOLFTRAP), new Object[]{"sns", "w#w", "sns", Character.valueOf('#'), new ItemStack(Witchery.Blocks.BEARTRAP), Character.valueOf('s'), "ingotSilver", Character.valueOf('n'), Witchery.Items.GENERIC.itemNullCatalyst.createStack(), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack()})); - Item[][] hunterItems = new Item[][]{{Witchery.Items.HUNTER_BOOTS, Witchery.Items.HUNTER_BOOTS_SILVERED}, {Witchery.Items.HUNTER_LEGS, Witchery.Items.HUNTER_LEGS_SILVERED}, {Witchery.Items.HUNTER_COAT, Witchery.Items.HUNTER_COAT_SILVERED}, {Witchery.Items.HUNTER_HAT, Witchery.Items.HUNTER_HAT_SILVERED}}; - Item[][] arr$ = hunterItems; - int len$ = hunterItems.length; - - for(int i$ = 0; i$ < len$; ++i$) { - Item[] hunterItem = arr$[i$]; - ShapedOreRecipe recipe = new ShapedOreRecipe(new ItemStack(hunterItem[1]), new Object[]{"dwd", "w#w", "dsd", Character.valueOf('#'), new ItemStack(hunterItem[0]), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack(), Character.valueOf('d'), "ingotSilver"}) { - public ItemStack getCraftingResult(InventoryCrafting inv) { - ItemStack result = this.getRecipeOutput().copy(); - - for(int i = 0; i < inv.getSizeInventory(); ++i) { - ItemStack material = inv.getStackInSlot(i); - if(material != null && material.hasTagCompound()) { - result.setTagCompound((NBTTagCompound)material.stackTagCompound.copy()); - } - } - - return result; - } - }; - GameRegistry.addRecipe(recipe); - } - } - - } - - public void postInit() { - if(Config.instance().smeltAllSaplingsToWoodAsh) { - ArrayList saplingTypes = OreDictionary.getOres("treeSapling"); - Iterator i$ = saplingTypes.iterator(); - - while(i$.hasNext()) { - ItemStack stack = (ItemStack)i$.next(); - GameRegistry.addSmelting(stack, Witchery.Items.GENERIC.itemAshWood.createStack(), 0.0F); - } - } - - } - - private void addPlantMineRecipe(int damageValue, ItemStack plant, ItemStack brew) { - GameRegistry.addRecipe(new ItemStack(Witchery.Blocks.TRAPPED_PLANT, 4, damageValue), new Object[]{"ccc", "bab", Character.valueOf('a'), plant, Character.valueOf('b'), new ItemStack(Blocks.stone_pressure_plate), Character.valueOf('c'), brew}); - } - - private static ShapedRecipes getShapedRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { - String s = ""; - int i = 0; - int j = 0; - int k = 0; - if(par2ArrayOfObj[i] instanceof String[]) { - String[] hashmap = (String[])((String[])((String[])par2ArrayOfObj[i++])); - - for(int aitemstack = 0; aitemstack < hashmap.length; ++aitemstack) { - String shapedrecipes = hashmap[aitemstack]; - ++k; - j = shapedrecipes.length(); - s = s + shapedrecipes; - } - } else { - while(par2ArrayOfObj[i] instanceof String) { - String var11 = (String)par2ArrayOfObj[i++]; - ++k; - j = var11.length(); - s = s + var11; - } - } - - HashMap var10; - for(var10 = new HashMap(); i < par2ArrayOfObj.length; i += 2) { - Character var13 = (Character)par2ArrayOfObj[i]; - ItemStack var14 = null; - if(par2ArrayOfObj[i + 1] instanceof Item) { - var14 = new ItemStack((Item)par2ArrayOfObj[i + 1]); - } else if(par2ArrayOfObj[i + 1] instanceof Block) { - var14 = new ItemStack((Block)par2ArrayOfObj[i + 1], 1, 32767); - } else if(par2ArrayOfObj[i + 1] instanceof ItemStack) { - var14 = (ItemStack)par2ArrayOfObj[i + 1]; - } - - var10.put(var13, var14); - } - - ItemStack[] var12 = new ItemStack[j * k]; - - for(int var15 = 0; var15 < j * k; ++var15) { - char c0 = s.charAt(var15); - if(var10.containsKey(Character.valueOf(c0))) { - var12[var15] = ((ItemStack)var10.get(Character.valueOf(c0))).copy(); - } else { - var12[var15] = null; - } - } - - ShapedRecipes var16 = new ShapedRecipes(j, k, var12, par1ItemStack); - return var16; - } -} +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * cpw.mods.fml.common.registry.GameRegistry + * net.minecraft.block.Block + * net.minecraft.entity.boss.EntityWither + * net.minecraft.entity.monster.EntityCaveSpider + * net.minecraft.entity.monster.EntityMagmaCube + * net.minecraft.entity.monster.EntitySilverfish + * net.minecraft.entity.monster.EntitySlime + * net.minecraft.entity.monster.EntitySpider + * net.minecraft.entity.monster.EntityWitch + * net.minecraft.entity.monster.EntityZombie + * net.minecraft.entity.passive.EntityBat + * net.minecraft.entity.passive.EntityChicken + * net.minecraft.entity.passive.EntityCow + * net.minecraft.entity.passive.EntityHorse + * net.minecraft.entity.passive.EntityMooshroom + * net.minecraft.entity.passive.EntityOcelot + * net.minecraft.entity.passive.EntityPig + * net.minecraft.entity.passive.EntitySheep + * net.minecraft.entity.passive.EntityVillager + * net.minecraft.entity.passive.EntityWolf + * net.minecraft.init.Blocks + * net.minecraft.init.Items + * net.minecraft.inventory.InventoryCrafting + * net.minecraft.item.Item + * net.minecraft.item.ItemStack + * net.minecraft.item.crafting.CraftingManager + * net.minecraft.item.crafting.IRecipe + * net.minecraft.item.crafting.ShapedRecipes + * net.minecraft.nbt.NBTTagCompound + * net.minecraftforge.oredict.OreDictionary + * net.minecraftforge.oredict.RecipeSorter + * net.minecraftforge.oredict.RecipeSorter$Category + * net.minecraftforge.oredict.ShapedOreRecipe + * net.minecraftforge.oredict.ShapelessOreRecipe + */ +package com.emoniph.witchery; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.crafting.DistilleryRecipes; +import com.emoniph.witchery.crafting.KettleRecipes; +import com.emoniph.witchery.crafting.RecipeAttachTaglock; +import com.emoniph.witchery.crafting.RecipeShapelessAddColor; +import com.emoniph.witchery.crafting.RecipeShapelessAddKeys; +import com.emoniph.witchery.crafting.RecipeShapelessAddPotion; +import com.emoniph.witchery.crafting.RecipeShapelessBiomeCopy; +import com.emoniph.witchery.crafting.RecipeShapelessPoppet; +import com.emoniph.witchery.crafting.RecipeShapelessRepair; +import com.emoniph.witchery.crafting.SpinningRecipes; +import com.emoniph.witchery.entity.EntityBabaYaga; +import com.emoniph.witchery.entity.EntityDemon; +import com.emoniph.witchery.entity.EntityEnt; +import com.emoniph.witchery.entity.EntityFamiliar; +import com.emoniph.witchery.entity.EntityImp; +import com.emoniph.witchery.entity.EntityOwl; +import com.emoniph.witchery.entity.EntityReflection; +import com.emoniph.witchery.entity.EntityToad; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.infusion.infusions.InfusionInfernal; +import com.emoniph.witchery.infusion.infusions.InfusionLight; +import com.emoniph.witchery.infusion.infusions.InfusionOtherwhere; +import com.emoniph.witchery.infusion.infusions.InfusionOverworld; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePower; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerBat; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerBlaze; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerCreeper; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerEnderman; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerGhast; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerHeal; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerJump; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerIronGolem; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerFrost; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerPigMan; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSkeleton; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSpeed; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSpider; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerSquid; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePowerZombie; +//import com.emoniph.witchery.item.Phase4Items; +import com.emoniph.witchery.predictions.PredictionArrow; +import com.emoniph.witchery.predictions.PredictionBuriedTreasure; +import com.emoniph.witchery.predictions.PredictionFall; +import com.emoniph.witchery.predictions.PredictionFallInLove; +import com.emoniph.witchery.predictions.PredictionFight; +import com.emoniph.witchery.predictions.PredictionManager; +import com.emoniph.witchery.predictions.PredictionMultiMine; +import com.emoniph.witchery.predictions.PredictionNetherTrip; +import com.emoniph.witchery.predictions.PredictionRescue; +import com.emoniph.witchery.predictions.PredictionWet; +import com.emoniph.witchery.ritual.Circle; +import com.emoniph.witchery.ritual.RiteRegistry; +import com.emoniph.witchery.ritual.RitualTraits; +import com.emoniph.witchery.ritual.SacrificeItem; +import com.emoniph.witchery.ritual.SacrificeLiving; +import com.emoniph.witchery.ritual.SacrificeMultiple; +import com.emoniph.witchery.ritual.SacrificeOptionalItem; +import com.emoniph.witchery.ritual.SacrificePower; +import com.emoniph.witchery.ritual.rites.RiteAnnihilation; +import com.emoniph.witchery.ritual.rites.RiteBanishDemon; +import com.emoniph.witchery.ritual.rites.RiteBindCircleToTalisman; +import com.emoniph.witchery.ritual.rites.RiteBindFamiliar; +import com.emoniph.witchery.ritual.rites.RiteBindSpiritsToFetish; +import com.emoniph.witchery.ritual.rites.RiteBlight; +import com.emoniph.witchery.ritual.rites.RiteBlindness; +import com.emoniph.witchery.ritual.rites.RiteCallCreatures; +import com.emoniph.witchery.ritual.rites.RiteCallFamiliar; +import com.emoniph.witchery.ritual.rites.RiteClimateChange; +import com.emoniph.witchery.ritual.rites.RiteCookItem; +import com.emoniph.witchery.ritual.rites.RiteCurseCreature; +import com.emoniph.witchery.ritual.rites.RiteCurseOfTheWolf; +import com.emoniph.witchery.ritual.rites.RiteCursePoppets; +import com.emoniph.witchery.ritual.rites.RiteDementorKiss; +//import com.emoniph.witchery.ritual.rites.RiteDimensionalPocket; +import com.emoniph.witchery.ritual.rites.RiteEclipse; +import com.emoniph.witchery.ritual.rites.RiteFertility; +import com.emoniph.witchery.ritual.rites.RiteFidelio; +import com.emoniph.witchery.ritual.rites.RiteForestation; +import com.emoniph.witchery.ritual.rites.RiteGlyphicTransformation; +import com.emoniph.witchery.ritual.rites.RiteHellOnEarth; +import com.emoniph.witchery.ritual.rites.RiteHorrocrux; +import com.emoniph.witchery.ritual.rites.RiteInfusePlayers; +import com.emoniph.witchery.ritual.rites.RiteInfusionRecharge; +import com.emoniph.witchery.ritual.rites.RiteLegilimency; +import com.emoniph.witchery.ritual.rites.RiteMorsmordre; +import com.emoniph.witchery.ritual.rites.RiteNaturesPower; +import com.emoniph.witchery.ritual.rites.RitePartEarth; +//import com.emoniph.witchery.ritual.rites.RitePathDemon; +//import com.emoniph.witchery.ritual.rites.RitePathGhost; +//import com.emoniph.witchery.ritual.rites.RitePathLich; +import com.emoniph.witchery.ritual.rites.RitePhilosopherStone; +import com.emoniph.witchery.ritual.rites.RitePriorIncarnation; +import com.emoniph.witchery.ritual.rites.RitePromisedLand; +import com.emoniph.witchery.ritual.rites.RiteProtectionCircleAttractive; +import com.emoniph.witchery.ritual.rites.RiteProtectionCircleBarrier; +import com.emoniph.witchery.ritual.rites.RiteProtectionCircleRepulsive; +import com.emoniph.witchery.ritual.rites.RiteRainOfToads; +import com.emoniph.witchery.ritual.rites.RiteRaiseColumn; +import com.emoniph.witchery.ritual.rites.RiteRaiseVolcano; +import com.emoniph.witchery.ritual.rites.RiteRemoveVampirism; +import com.emoniph.witchery.ritual.rites.RiteSecretGuardian; +import com.emoniph.witchery.ritual.rites.RiteSetNBT; +import com.emoniph.witchery.ritual.rites.RiteSoulThief; +import com.emoniph.witchery.ritual.rites.RiteSphereEffect; +import com.emoniph.witchery.ritual.rites.RiteSummonCreature; +//import com.emoniph.witchery.ritual.rites.RiteSummonEntity; +import com.emoniph.witchery.ritual.rites.RiteSummonItem; +import com.emoniph.witchery.ritual.rites.RiteSummonSpectralStone; +import com.emoniph.witchery.ritual.rites.RiteTeleportEntity; +import com.emoniph.witchery.ritual.rites.RiteTeleportToWaystone; +import com.emoniph.witchery.ritual.rites.RiteTransposeOres; +import com.emoniph.witchery.ritual.rites.RiteUnbreakableVow; +import com.emoniph.witchery.ritual.rites.RiteWeatherCallStorm; + +import com.emoniph.witchery.ritual.PatternLine; +import com.emoniph.witchery.ritual.PatternPolygon; +import com.emoniph.witchery.util.ClothColor; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.Dye; +import cpw.mods.fml.common.registry.GameRegistry; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import net.minecraft.block.Block; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.monster.EntityCaveSpider; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.RecipeSorter; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +public class WitcheryRecipes { + public Infusion infusionEnder; + public Infusion infusionLight; + public Infusion infusionWorld; + public Infusion infusionBeast; + + /* + * Opcode count of 22698 triggered aggressive code reduction. Override with --aggressivesizethreshold. + */ + public void preInit() { + int DEFAULT_FORCE_CHANCE; + ItemStack[] var34; + int meats; + int hunterItems; + int[] lousePotions; + RecipeSorter.register((String)"witchery:bindpoppet", RecipeShapelessPoppet.class, (RecipeSorter.Category)RecipeSorter.Category.SHAPELESS, (String)"after:minecraft:shapeless"); + RecipeSorter.register((String)"witchery:addpotion", RecipeShapelessAddPotion.class, (RecipeSorter.Category)RecipeSorter.Category.SHAPELESS, (String)"after:minecraft:shapeless"); + RecipeSorter.register((String)"witchery:repair", RecipeShapelessRepair.class, (RecipeSorter.Category)RecipeSorter.Category.SHAPELESS, (String)"after:minecraft:shapeless"); + RecipeSorter.register((String)"witchery:addcolor", RecipeShapelessAddColor.class, (RecipeSorter.Category)RecipeSorter.Category.SHAPELESS, (String)"after:minecraft:shapeless"); + RecipeSorter.register((String)"witchery:addkeys", RecipeShapelessAddKeys.class, (RecipeSorter.Category)RecipeSorter.Category.SHAPELESS, (String)"after:minecraft:shapeless"); + RecipeSorter.register((String)"witchery:attachtaglock", RecipeAttachTaglock.class, (RecipeSorter.Category)RecipeSorter.Category.SHAPELESS, (String)"after:minecraft:shapeless"); + RecipeSorter.register((String)"witchery:biomecopy", RecipeShapelessBiomeCopy.class, (RecipeSorter.Category)RecipeSorter.Category.SHAPELESS, (String)"after:minecraft:shapeless"); + if (Config.instance().allowStatueGoddessRecipe) { + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.STATUE_GODDESS), (Object[])new Object[]{"s#s", "shs", "###", Character.valueOf('h'), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Character.valueOf('#'), new ItemStack(Blocks.stone), Character.valueOf('s'), new ItemStack(Items.nether_star)}); + } + ItemStack ash = Witchery.Items.GENERIC.itemAshWood.createStack(); + ItemStack bone = new ItemStack(Items.bone); + GameRegistry.addShapelessRecipe((ItemStack)Dye.BONE_MEAL.createStack(4), (Object[])new Object[]{bone, ash, ash}); + GameRegistry.addShapelessRecipe((ItemStack)Dye.BONE_MEAL.createStack(5), (Object[])new Object[]{bone, ash, ash, ash, ash}); + GameRegistry.addShapelessRecipe((ItemStack)Dye.BONE_MEAL.createStack(6), (Object[])new Object[]{bone, ash, ash, ash, ash, ash, ash}); + GameRegistry.addShapelessRecipe((ItemStack)Dye.BONE_MEAL.createStack(7), (Object[])new Object[]{bone, ash, ash, ash, ash, ash, ash, ash, ash}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Blocks.WICKER_BUNDLE, 1, 0), new Object[]{"###", "###", "###", Character.valueOf('#'), "treeSapling"})); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.WICKER_BUNDLE, 5, 1), (Object[])new Object[]{"#b#", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Character.valueOf('b'), Witchery.Items.GENERIC.itemInfernalBlood.createStack()}); + this.addPlantMineRecipe(0, new ItemStack((Block)Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfWebs.createStack()); + this.addPlantMineRecipe(1, new ItemStack((Block)Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfInk.createStack()); + this.addPlantMineRecipe(2, new ItemStack((Block)Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfThorns.createStack()); + this.addPlantMineRecipe(3, new ItemStack((Block)Blocks.red_flower), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack()); + this.addPlantMineRecipe(4, new ItemStack((Block)Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfWebs.createStack()); + this.addPlantMineRecipe(5, new ItemStack((Block)Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfInk.createStack()); + this.addPlantMineRecipe(6, new ItemStack((Block)Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfThorns.createStack()); + this.addPlantMineRecipe(7, new ItemStack((Block)Blocks.yellow_flower), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack()); + this.addPlantMineRecipe(8, new ItemStack((Block)Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfWebs.createStack()); + this.addPlantMineRecipe(9, new ItemStack((Block)Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfInk.createStack()); + this.addPlantMineRecipe(10, new ItemStack((Block)Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfThorns.createStack()); + this.addPlantMineRecipe(11, new ItemStack((Block)Blocks.deadbush), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack()); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.poisonous_potato, 2), (Object[])new Object[]{new ItemStack(Items.poisonous_potato), new ItemStack(Items.potato), new ItemStack(Items.spider_eye)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.LEAPING_LILY, 5), (Object[])new Object[]{"#p#", "c#c", "#b#", Character.valueOf('#'), new ItemStack(Blocks.waterlily), Character.valueOf('p'), new ItemStack((Item)Items.potionitem, 1, 8194), Character.valueOf('b'), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Character.valueOf('c'), new ItemStack(Items.glowstone_dust)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemBoneNeedle.createStack(8), (Object[])new Object[]{"ab", Character.valueOf('a'), new ItemStack(Items.bone), Character.valueOf('b'), new ItemStack(Items.flint)}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.TAGLOCK_KIT), (Object[])new Object[]{"ab", Character.valueOf('b'), Witchery.Items.GENERIC.itemBoneNeedle.createStack(), Character.valueOf('a'), new ItemStack(Items.glass_bottle)}); + ItemStack taglocks = new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1); + ItemStack unboundPoppet = Witchery.Items.POPPET.unboundPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)unboundPoppet, (Object[])new Object[]{"xyx", "ayb", "x x", Character.valueOf('x'), new ItemStack(Blocks.wool), Character.valueOf('y'), new ItemStack(Witchery.Blocks.SPANISH_MOSS), Character.valueOf('a'), Witchery.Items.GENERIC.itemBoneNeedle.createStack(), Character.valueOf('b'), new ItemStack(Items.string)}); + ItemStack earthPoppet = Witchery.Items.POPPET.earthPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)Witchery.Items.POPPET.earthPoppet.createStack(), (Object[])new Object[]{" a ", "b#b", " c ", Character.valueOf('#'), Witchery.Items.POPPET.unboundPoppet.createStack(), Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('a'), new ItemStack(Items.clay_ball), Character.valueOf('c'), new ItemStack(Blocks.dirt)}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(earthPoppet, taglocks, earthPoppet)); + ItemStack waterPoppet = Witchery.Items.POPPET.waterPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)waterPoppet, (Object[])new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), Witchery.Items.POPPET.unboundPoppet.createStack(), Character.valueOf('a'), Witchery.Items.GENERIC.itemArtichoke.createStack(), Character.valueOf('b'), Dye.INK_SAC.createStack()}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(waterPoppet, taglocks, waterPoppet)); + ItemStack foodPoppet = Witchery.Items.POPPET.foodPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)foodPoppet, (Object[])new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('b'), new ItemStack(Items.speckled_melon), Character.valueOf('a'), new ItemStack(Items.rotten_flesh)}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(foodPoppet, taglocks, foodPoppet)); + ItemStack firePoppet = Witchery.Items.POPPET.firePoppet.createStack(); + GameRegistry.addRecipe((ItemStack)firePoppet, (Object[])new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('b'), Witchery.Items.GENERIC.itemBatWool.createStack(), Character.valueOf('a'), new ItemStack(Witchery.Blocks.EMBER_MOSS)}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(firePoppet, taglocks, firePoppet)); + ItemStack antiVoodooPoppet = Witchery.Items.POPPET.antiVoodooPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)antiVoodooPoppet, (Object[])new Object[]{"ced", "a#b", "dfc", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Character.valueOf('c'), new ItemStack((Block)Blocks.yellow_flower), Character.valueOf('d'), new ItemStack((Block)Blocks.red_flower), Character.valueOf('e'), new ItemStack((Block)Blocks.red_mushroom), Character.valueOf('f'), new ItemStack((Block)Blocks.brown_mushroom)}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(antiVoodooPoppet, taglocks, antiVoodooPoppet)); + ItemStack poppetProectionPoppet = Witchery.Items.POPPET.poppetProtectionPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)poppetProectionPoppet, (Object[])new Object[]{"gfg", "e#e", "glg", Character.valueOf('#'), antiVoodooPoppet, Character.valueOf('l'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('e'), Witchery.Items.GENERIC.itemEnderDew.createStack(), Character.valueOf('g'), new ItemStack(Items.gold_nugget), Character.valueOf('f'), Witchery.Items.GENERIC.itemToeOfFrog.createStack()}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(poppetProectionPoppet, taglocks, poppetProectionPoppet)); + ItemStack voodooPoppet = Witchery.Items.POPPET.voodooPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)voodooPoppet, (Object[])new Object[]{" d ", "a#b", " c ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Character.valueOf('c'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('d'), new ItemStack(Items.fermented_spider_eye)}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(voodooPoppet, taglocks, voodooPoppet)); + ItemStack toolPoppet = Witchery.Items.POPPET.toolPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)toolPoppet, (Object[])new Object[]{" a ", "b#b", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDropOfLuck.createStack()}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(toolPoppet, taglocks, toolPoppet)); + ItemStack armorPoppet = Witchery.Items.POPPET.armorPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)armorPoppet, (Object[])new Object[]{" a ", "b#b", " d ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(armorPoppet, taglocks, armorPoppet)); + ItemStack avoidDeathPoppet = Witchery.Items.POPPET.deathPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)avoidDeathPoppet, (Object[])new Object[]{"axb", "x#x", " x ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('x'), new ItemStack(Items.gold_nugget)}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(avoidDeathPoppet, taglocks, avoidDeathPoppet)); + ItemStack vampiricPoppet = Witchery.Items.POPPET.vampiricPoppet.createStack(); + GameRegistry.addRecipe((ItemStack)vampiricPoppet, (Object[])new Object[]{" b ", "c#c", " a ", Character.valueOf('#'), unboundPoppet, Character.valueOf('a'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('c'), Witchery.Items.GENERIC.itemBatWool.createStack()}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessPoppet(vampiricPoppet, taglocks, taglocks, vampiricPoppet)); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.POPPET_SHELF), (Object[])new Object[]{"yzy", "zxz", "yzy", Character.valueOf('x'), ClothColor.GREEN.createStack(), Character.valueOf('y'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('z'), new ItemStack(Blocks.nether_brick)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.OVEN_IDLE), (Object[])new Object[]{" z ", "xxx", "xzx", Character.valueOf('x'), new ItemStack(Items.iron_ingot), Character.valueOf('z'), new ItemStack(Blocks.iron_bars)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemSoftClayJar.createStack(4), (Object[])new Object[]{" # ", "###", Character.valueOf('#'), new ItemStack(Items.clay_ball)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.PLANKS, 4, 0), (Object[])new Object[]{"#", Character.valueOf('#'), new ItemStack(Witchery.Blocks.LOG, 1, 0)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.PLANKS, 4, 1), (Object[])new Object[]{"#", Character.valueOf('#'), new ItemStack(Witchery.Blocks.LOG, 1, 1)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.PLANKS, 4, 2), (Object[])new Object[]{"#", Character.valueOf('#'), new ItemStack(Witchery.Blocks.LOG, 1, 2)}); + CraftingManager.getInstance().getRecipeList().add(0, WitcheryRecipes.getShapedRecipe(Witchery.Items.GENERIC.itemDoorRowan.createStack(), "##", "##", "##", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 0))); + CraftingManager.getInstance().getRecipeList().add(0, WitcheryRecipes.getShapedRecipe(Witchery.Items.GENERIC.itemDoorAlder.createStack(), "##", "##", "##", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 1))); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.STAIRS_ALDER, 4, 0), (Object[])new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 1)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.STAIRS_HAWTHORN, 4, 0), (Object[])new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 2)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.STAIRS_ROWAN, 4, 0), (Object[])new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Witchery.Blocks.PLANKS, 1, 0)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.SNOW_STAIRS, 4, 0), (Object[])new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Blocks.snow, 1, 0)}); + CraftingManager.getInstance().getRecipeList().add(0, WitcheryRecipes.getShapedRecipe(new ItemStack(Witchery.Blocks.SNOW_SLAB_SINGLE, 6, 0), "###", "###", Character.valueOf('#'), new ItemStack(Blocks.snow_layer, 1, 0))); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.SNOW_PRESSURE_PLATE, 1, 0), (Object[])new Object[]{"##", Character.valueOf('#'), new ItemStack(Blocks.snow, 1, 0)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemQuicklime.createStack(), (Object[])new Object[]{"#", Character.valueOf('#'), Witchery.Items.GENERIC.itemAshWood.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.ALTAR, 3), (Object[])new Object[]{"abc", "xyx", "xyx", Character.valueOf('a'), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Character.valueOf('b'), new ItemStack((Item)Items.potionitem), Character.valueOf('c'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('x'), new ItemStack(Blocks.stonebrick, 1, 0), Character.valueOf('y'), new ItemStack(Witchery.Blocks.LOG, 1, 0)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemAttunedStone.createStack(), (Object[])new Object[]{"a", "b", "c", Character.valueOf('a'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Character.valueOf('b'), new ItemStack(Items.diamond), Character.valueOf('c'), new ItemStack(Items.lava_bucket)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.DISTILLERY_IDLE), (Object[])new Object[]{"bxb", "xxx", "yay", Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Character.valueOf('y'), new ItemStack(Items.gold_ingot), Character.valueOf('x'), new ItemStack(Items.iron_ingot)}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Block)Witchery.Blocks.KETTLE), (Object[])new Object[]{"bxb", "xax", " y ", Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('b'), new ItemStack(Items.stick), Character.valueOf('x'), new ItemStack(Items.string), Character.valueOf('y'), new ItemStack(Items.cauldron)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.BRAZIER), (Object[])new Object[]{"#a#", " w ", "www", Character.valueOf('a'), Witchery.Items.GENERIC.itemNecroStone.createStack(), Character.valueOf('w'), new ItemStack(Items.stick), Character.valueOf('#'), new ItemStack(Items.iron_ingot)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.CHALK_RITUAL, 2, 0), (Object[])new Object[]{"xax", "xyx", "xyx", Character.valueOf('a'), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), Character.valueOf('x'), Witchery.Items.GENERIC.itemAshWood.createStack(), Character.valueOf('y'), Witchery.Items.GENERIC.itemGypsum.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemWaystone.createStack(), (Object[])new Object[]{"ab", Character.valueOf('a'), new ItemStack(Items.flint), Character.valueOf('b'), Witchery.Items.GENERIC.itemBoneNeedle.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.ARTHANA), (Object[])new Object[]{" y ", "xbx", " a ", Character.valueOf('a'), new ItemStack(Items.stick), Character.valueOf('b'), new ItemStack(Items.emerald), Character.valueOf('y'), new ItemStack(Items.gold_ingot), Character.valueOf('x'), new ItemStack(Items.gold_nugget)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.BOLINE), (Object[])new Object[]{"y", "a", "b", Character.valueOf('a'), new ItemStack(Items.bone), Character.valueOf('b'), new ItemStack(Items.emerald), Character.valueOf('y'), new ItemStack(Items.iron_ingot)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.CIRCLE_TALISMAN), (Object[])new Object[]{"yxy", "xax", "yxy", Character.valueOf('a'), new ItemStack(Items.diamond), Character.valueOf('x'), new ItemStack(Items.gold_ingot), Character.valueOf('y'), new ItemStack(Items.gold_nugget)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemBroom.createStack(), (Object[])new Object[]{" x ", " x ", "yyy", Character.valueOf('x'), new ItemStack(Items.stick), Character.valueOf('y'), new ItemStack(Witchery.Blocks.SAPLING, 1, 2)}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.rotten_flesh)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemOddPorkRaw.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.chicken)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.chicken), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.beef)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.beef), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.porkchop)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemOddPorkCooked.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.cooked_chicken)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_chicken), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.cooked_beef)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_beef), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.cooked_porkchop)}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemOddPorkCooked.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.rotten_flesh)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemOddPorkRaw.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.chicken)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_chicken), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.beef)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_beef), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.porkchop)}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.rotten_flesh)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemOddPorkRaw.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.chicken)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.chicken), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.beef)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.beef), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.porkchop)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemOddPorkCooked.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_porkchop), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.cooked_chicken)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_chicken), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.cooked_beef)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Items.cooked_beef), (Object[])new Object[]{Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.cooked_porkchop)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemCandelabra.createStack(), (Object[])new Object[]{"xxx", "yay", " y ", Character.valueOf('x'), new ItemStack(Blocks.torch), Character.valueOf('y'), new ItemStack(Items.iron_ingot), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemChaliceEmpty.createStack(), (Object[])new Object[]{"yay", "yxy", " x ", Character.valueOf('x'), new ItemStack(Items.gold_ingot), Character.valueOf('y'), new ItemStack(Items.gold_nugget), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemChaliceFull.createStack(), (Object[])new Object[]{"b", "a", Character.valueOf('a'), Witchery.Items.GENERIC.itemChaliceEmpty.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemRedstoneSoup.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.DIVINER_WATER), (Object[])new Object[]{"yay", "yay", "axa", Character.valueOf('a'), new ItemStack(Items.stick), Character.valueOf('y'), new ItemStack((Item)Items.potionitem), Character.valueOf('x'), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.DIVINER_LAVA), (Object[])new Object[]{" a ", " x ", "a a", Character.valueOf('x'), new ItemStack(Witchery.Items.DIVINER_WATER), Character.valueOf('a'), new ItemStack(Items.blaze_rod)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemDreamMove.createStack(), (Object[])new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack((Item)Items.potionitem, 1, 16450), Character.valueOf('e'), new ItemStack((Item)Items.potionitem, 1, 16458), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemDreamMove.createStack(), (Object[])new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack((Item)Items.potionitem, 1, 16450), Character.valueOf('e'), new ItemStack((Item)Items.potionitem, 1, 24650), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemDreamDig.createStack(), (Object[])new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack((Item)Items.potionitem, 1, 16457), Character.valueOf('e'), new ItemStack((Item)Items.potionitem, 1, 16456), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemDreamDig.createStack(), (Object[])new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack((Item)Items.potionitem, 1, 16457), Character.valueOf('e'), new ItemStack((Item)Items.potionitem, 1, 24648), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemDreamEat.createStack(), (Object[])new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack((Item)Items.potionitem, 1, 16421), Character.valueOf('e'), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemDreamNightmare.createStack(), (Object[])new Object[]{"dxe", "bab", "cbc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), new ItemStack((Item)Items.potionitem, 1, 16452), Character.valueOf('e'), new ItemStack((Item)Items.potionitem, 1, 16454), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemDreamIntensity.createStack(), (Object[])new Object[]{"dxe", "bab", "cfc", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), Witchery.Items.GENERIC.itemFancifulThread.createStack(), Character.valueOf('f'), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Character.valueOf('c'), new ItemStack(Items.feather), Character.valueOf('d'), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Character.valueOf('e'), Witchery.Items.GENERIC.itemBrewOfSleeping.createStack(), Character.valueOf('x'), Witchery.Items.GENERIC.itemDiamondVapour.createStack()}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Items.CAULDRON_BOOK), new Object[]{" c ", "a#b", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), new ItemStack(Blocks.dirt)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookHerbology.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), new ItemStack((Block)Blocks.red_flower), Character.valueOf('d'), new ItemStack((Block)Blocks.yellow_flower)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookWands.createStack(), new Object[]{" c ", "a#b", " ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBranchEnt.createStack()})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookBiomes.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), new ItemStack(Blocks.sapling), Character.valueOf('d'), new ItemStack(Blocks.stone)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Items.BIOME_BOOK), new Object[]{" d ", "d#d", " d ", Character.valueOf('#'), Witchery.Items.GENERIC.itemBookBiomes.createStack(), Character.valueOf('d'), new ItemStack(Blocks.stone)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookBurning.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemAshWood.createStack(), Character.valueOf('d'), new ItemStack(Items.flint_and_steel)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookOven.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), new ItemStack(Items.coal, 1, 1)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookDistilling.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack()})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookCircleMagic.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBookInfusions.createStack(), new Object[]{" c ", "a#b", " d ", Character.valueOf('#'), new ItemStack(Items.book), Character.valueOf('a'), "dyeBlack", Character.valueOf('b'), new ItemStack(Items.feather), Character.valueOf('c'), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()})); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemWeb.createStack(), (Object[])new Object[]{" s ", "sws", " s ", Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), new ItemStack(Blocks.web)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.ALLURING_SKULL), (Object[])new Object[]{" a ", "bcb", " d ", Character.valueOf('a'), Witchery.Items.GENERIC.itemNecroStone.createStack(), Character.valueOf('d'), Witchery.Items.POPPET.voodooPoppet.createStack(), Character.valueOf('c'), new ItemStack(Items.skull), Character.valueOf('b'), new ItemStack(Items.glowstone_dust)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.ALLURING_SKULL), (Object[])new Object[]{" a ", "bcb", " d ", Character.valueOf('a'), Witchery.Items.GENERIC.itemNecroStone.createStack(), Character.valueOf('d'), Witchery.Items.POPPET.voodooPoppet.createStack(), Character.valueOf('c'), new ItemStack(Items.skull, 1, 1), Character.valueOf('b'), new ItemStack(Items.glowstone_dust)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemSeedsTreefyd.createStack(2), (Object[])new Object[]{"xax", "cyd", "xbx", Character.valueOf('x'), Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Character.valueOf('y'), Witchery.Items.GENERIC.itemArtichoke.createStack(), Character.valueOf('c'), new ItemStack(Witchery.Blocks.EMBER_MOSS), Character.valueOf('d'), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Character.valueOf('a'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.POLYNESIA_CHARM, 1), (Object[])new Object[]{"nin", "p#p", "nwn", Character.valueOf('#'), new ItemStack(Items.fish), Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('p'), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Character.valueOf('w'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Character.valueOf('n'), new ItemStack(Items.nether_wart)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.DEVILS_TONGUE_CHARM, 1), (Object[])new Object[]{"b#b", "dse", "btb", Character.valueOf('#'), new ItemStack(Witchery.Items.POLYNESIA_CHARM), Character.valueOf('d'), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Character.valueOf('t'), Witchery.Items.GENERIC.itemDogTongue.createStack(), Character.valueOf('e'), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), Character.valueOf('s'), new ItemStack(Items.skull), Character.valueOf('b'), new ItemStack(Items.blaze_powder)}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.OVEN_FUMEFUNNEL), (Object[])new Object[]{"ele", "ege", "bib", Character.valueOf('e'), new ItemStack(Items.bucket), Character.valueOf('l'), new ItemStack(Items.lava_bucket), Character.valueOf('b'), new ItemStack(Blocks.iron_block), Character.valueOf('g'), new ItemStack(Blocks.glowstone), Character.valueOf('i'), new ItemStack(Blocks.iron_bars)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemFumeFilter.createStack(), (Object[])new Object[]{"ggg", "sas", "ggg", Character.valueOf('g'), new ItemStack(Blocks.glass), Character.valueOf('s'), new ItemStack(Items.iron_ingot), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.OVEN_FUMEFUNNEL_FILTERED), (Object[])new Object[]{"b", "f", Character.valueOf('b'), new ItemStack(Witchery.Blocks.OVEN_FUMEFUNNEL), Character.valueOf('f'), Witchery.Items.GENERIC.itemFumeFilter.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemPurifiedMilk.createStack(3), (Object[])new Object[]{new ItemStack(Items.milk_bucket), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemPurifiedMilk.createStack(3), (Object[])new Object[]{new ItemStack(Items.cake), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), Witchery.Items.GENERIC.itemEmptyClayJar.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemImpregnatedLeather.createStack(4), (Object[])new Object[]{"mlm", "ldl", "mlm", Character.valueOf('l'), new ItemStack(Items.leather), Character.valueOf('d'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('m'), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.WITCH_HAT), (Object[])new Object[]{" l ", "sls", "lgl", Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('l'), Witchery.Items.GENERIC.itemImpregnatedLeather.createStack(), Character.valueOf('g'), new ItemStack(Items.glowstone_dust)}); + if (Config.instance().allowVoidBrambleRecipe) { + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.VOID_BRAMBLE, 4), (Object[])new Object[]{"lml", "r#r", "lml", Character.valueOf('#'), new ItemStack(Witchery.Blocks.BRAMBLE), Character.valueOf('r'), new ItemStack(Items.nether_star), Character.valueOf('l'), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Character.valueOf('m'), Witchery.Items.GENERIC.itemMutandisExtremis.createStack()}); + } + GameRegistry.addRecipe((ItemStack)new ItemStack(Items.gunpowder, 5), (Object[])new Object[]{"#", Character.valueOf('#'), Witchery.Items.GENERIC.itemCreeperHeart.createStack()}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Blocks.netherrack), (Object[])new Object[]{Witchery.Items.GENERIC.itemInfernalBlood.createStack(), new ItemStack(Blocks.gravel)}); + ItemStack impregLeather = Witchery.Items.GENERIC.itemImpregnatedLeather.createStack(); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.WITCH_ROBES), (Object[])new Object[]{"lsl", "l#l", "lll", Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('l'), impregLeather, Character.valueOf('#'), Witchery.Items.GENERIC.itemCreeperHeart.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.NECROMANCERS_ROBES), (Object[])new Object[]{"lsl", "l#l", "lll", Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('l'), impregLeather, Character.valueOf('#'), Witchery.Items.GENERIC.itemNecroStone.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemFrozenHeart.createStack(), (Object[])new Object[]{"n", "h", "t", Character.valueOf('h'), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Character.valueOf('n'), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), Character.valueOf('t'), new ItemStack(Items.ghast_tear)}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.ICY_SLIPPERS), (Object[])new Object[]{"lsl", "l#l", "dod", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('#'), Witchery.Items.GENERIC.itemFrozenHeart.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Character.valueOf('o'), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.BITING_BELT), (Object[])new Object[]{"#lh", "lsl", "l l", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('h'), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Character.valueOf('#'), new ItemStack(Witchery.Items.PARASYTIC_LOUSE)}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.SEEPING_SHOES), (Object[])new Object[]{"lsl", "hrh", "mmm", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('h'), new ItemStack(Witchery.Items.WITCH_HAND), Character.valueOf('r'), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Character.valueOf('m'), new ItemStack(Items.milk_bucket)}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.RUBY_SLIPPERS), (Object[])new Object[]{"aba", "tst", "aba", Character.valueOf('s'), new ItemStack((Item)Witchery.Items.SEEPING_SHOES), Character.valueOf('t'), Witchery.Items.GENERIC.itemGoldenThread.createStack(), Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Character.valueOf('b'), Witchery.Items.GENERIC.itemInfernalBlood.createStack()}); + GameRegistry.addRecipe((ItemStack)new ItemStack((Item)Witchery.Items.BARK_BELT), (Object[])new Object[]{"ses", "gbg", "shs", Character.valueOf('b'), new ItemStack((Item)Witchery.Items.BITING_BELT), Character.valueOf('s'), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Character.valueOf('g'), Witchery.Items.GENERIC.itemBranchEnt.createStack(), Character.valueOf('h'), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Character.valueOf('e'), new ItemStack(Items.emerald)}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemWormyApple.createStack(), (Object[])new Object[]{new ItemStack(Items.apple), new ItemStack(Items.rotten_flesh), new ItemStack(Items.sugar)}); + ItemStack louse = new ItemStack(Witchery.Items.PARASYTIC_LOUSE, 1, Short.MAX_VALUE); + ItemStack belt = new ItemStack((Item)Witchery.Items.BITING_BELT, 1, Short.MAX_VALUE); + int[] logs = lousePotions = new int[]{8200, 8202, 8264, 8266, 8193, 8194, 8196, 8225, 8226, 8227, 8228, 8229, 8230, 8232, 8233, 8234, 8236, 8238, 8257, 8258, 8259, 8260, 8261, 8262, 8264, 8265, 8266, 8268, 8270, 8201, 8206}; + int kobolditeIngot = lousePotions.length; + for (hunterItems = 0; hunterItems < kobolditeIngot; ++hunterItems) { + meats = logs[hunterItems]; + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Witchery.Items.PARASYTIC_LOUSE, 1, meats), (Object[])new Object[]{louse, new ItemStack((Item)Items.potionitem, 1, meats)}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddPotion(new ItemStack((Item)Witchery.Items.BITING_BELT, 1, meats), belt, new ItemStack((Item)Items.potionitem, 1, meats))); + } + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.WITCH_ROBES), new ItemStack((Item)Witchery.Items.WITCH_ROBES), impregLeather, impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.NECROMANCERS_ROBES), new ItemStack((Item)Witchery.Items.NECROMANCERS_ROBES), impregLeather, impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.WITCH_HAT), new ItemStack((Item)Witchery.Items.WITCH_HAT), impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.ICY_SLIPPERS), new ItemStack((Item)Witchery.Items.ICY_SLIPPERS), impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.RUBY_SLIPPERS), new ItemStack((Item)Witchery.Items.RUBY_SLIPPERS), impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.SEEPING_SHOES), new ItemStack((Item)Witchery.Items.SEEPING_SHOES), impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.BITING_BELT), new ItemStack((Item)Witchery.Items.BITING_BELT), impregLeather, impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.BARK_BELT), new ItemStack((Item)Witchery.Items.BARK_BELT), impregLeather, impregLeather, impregLeather, impregLeather)); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessRepair(new ItemStack((Item)Witchery.Items.BABAS_HAT), new ItemStack((Item)Witchery.Items.BABAS_HAT), impregLeather, impregLeather, impregLeather)); + Dye[] var29 = Dye.DYES; + kobolditeIngot = var29.length; + for (hunterItems = 0; hunterItems < kobolditeIngot; ++hunterItems) { + Dye var32 = var29[hunterItems]; + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddColor(new ItemStack(Witchery.Items.BREW_BAG), new ItemStack(Witchery.Items.BREW_BAG), var32.createStack())); + } + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Items.BREW_BAG), (Object[])new Object[]{"lll", "lsl", "lll", Character.valueOf('l'), impregLeather, Character.valueOf('s'), Witchery.Items.GENERIC.itemGoldenThread.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemCharmOfDisruptedDreams.createStack(), (Object[])new Object[]{"lll", "lsl", "lll", Character.valueOf('l'), new ItemStack(Items.stick), Character.valueOf('s'), Witchery.Items.GENERIC.itemFancifulThread.createStack()}); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddKeys(Witchery.Items.GENERIC.itemDoorKeyring.createStack(), Witchery.Items.GENERIC.itemDoorKey.createStack(), Witchery.Items.GENERIC.itemDoorKey.createStack())); + CraftingManager.getInstance().getRecipeList().add(new RecipeShapelessAddKeys(Witchery.Items.GENERIC.itemDoorKeyring.createStack(), Witchery.Items.GENERIC.itemDoorKeyring.createStack(), Witchery.Items.GENERIC.itemDoorKey.createStack())); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemQuartzSphere.createStack(), (Object[])new Object[]{"qbq", "bgb", "qbq", Character.valueOf('q'), new ItemStack(Items.quartz), Character.valueOf('b'), new ItemStack(Blocks.quartz_block), Character.valueOf('g'), new ItemStack(Blocks.glass)}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemSleepingApple.createStack(), (Object[])new Object[]{" g ", "mam", "gsg", Character.valueOf('a'), Witchery.Items.GENERIC.itemWormyApple.createStack(), Character.valueOf('g'), Witchery.Items.GENERIC.itemMutandis.createStack(), Character.valueOf('m'), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Character.valueOf('s'), Witchery.Items.GENERIC.itemBrewOfSleeping.createStack()}); + GameRegistry.addRecipe((ItemStack)Witchery.Items.GENERIC.itemBatBall.createStack(), (Object[])new Object[]{"sbs", "b b", "sbs", Character.valueOf('s'), new ItemStack(Items.slime_ball), Character.valueOf('b'), new ItemStack(Witchery.Blocks.CRITTER_SNARE, 1, 1)}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Blocks.SPINNING_WHEEL), new Object[]{"aab", "aac", "wsw", Character.valueOf('a'), new ItemStack(Items.item_frame), Character.valueOf('b'), new ItemStack(Blocks.wool), Character.valueOf('c'), "stickWood", Character.valueOf('w'), "plankWood", Character.valueOf('s'), Witchery.Items.GENERIC.itemAttunedStone.createStack()})); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemGraveyardDust.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemSpectralDust.createStack(), Dye.BONE_MEAL.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack()}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Blocks.FETISH_SCARECROW), new Object[]{"w#w", "sls", "wsw", Character.valueOf('#'), new ItemStack(Blocks.lit_pumpkin), Character.valueOf('w'), new ItemStack(Blocks.wool), Character.valueOf('s'), "stickWood", Character.valueOf('l'), Witchery.Items.GENERIC.itemTormentedTwine.createStack()})); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.FETISH_WITCHS_LADDER), (Object[])new Object[]{"fsf", "ftf", "fsf", Character.valueOf('f'), new ItemStack(Items.feather), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('t'), Witchery.Items.GENERIC.itemFancifulThread.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.FETISH_TREANT_IDOL), (Object[])new Object[]{"o#o", "srs", "o o", Character.valueOf('#'), new ItemStack(Blocks.lit_pumpkin), Character.valueOf('o'), new ItemStack(Blocks.log, 1, 0), Character.valueOf('r'), new ItemStack(Witchery.Blocks.LOG, 1, 0), Character.valueOf('s'), Witchery.Items.GENERIC.itemTormentedTwine.createStack()}); + SpinningRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemFancifulThread.createStack(), new ItemStack(Witchery.Blocks.WISPY_COTTON, 4), new ItemStack(Items.string), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()); + SpinningRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Witchery.Items.GENERIC.itemDisturbedCotton.createStack(4), new ItemStack(Items.string), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack()); + SpinningRecipes.instance().addRecipe(new ItemStack(Blocks.web), new ItemStack(Items.string, 8), new ItemStack[0]); + SpinningRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemGoldenThread.createStack(3), new ItemStack(Blocks.hay_block), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemNullCatalyst.createStack(2), (Object[])new Object[]{new ItemStack(Items.nether_star), new ItemStack(Items.diamond), new ItemStack(Items.flint), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream), new ItemStack(Items.magma_cream)}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemNullCatalyst.createStack(2), (Object[])new Object[]{Witchery.Items.GENERIC.itemNullCatalyst.createStack(), new ItemStack(Items.magma_cream), new ItemStack(Items.blaze_powder)}); + GameRegistry.addShapedRecipe((ItemStack)Witchery.Items.GENERIC.itemNullifiedLeather.createStack(3), (Object[])new Object[]{"lll", "lcl", "lll", Character.valueOf('l'), new ItemStack(Items.leather), Character.valueOf('c'), Witchery.Items.GENERIC.itemNullCatalyst.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.HUNTER_HAT), (Object[])new Object[]{"lll", "l l", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.HUNTER_COAT), (Object[])new Object[]{"l l", "lll", "lll", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.HUNTER_LEGS), (Object[])new Object[]{"lll", "l l", "l l", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.HUNTER_BOOTS), (Object[])new Object[]{"l l", "l l", Character.valueOf('l'), Witchery.Items.GENERIC.itemNullifiedLeather.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Items.SHELF_COMPASS), (Object[])new Object[]{"gdg", "d#d", "gcg", Character.valueOf('g'), new ItemStack(Items.gold_ingot), Character.valueOf('d'), new ItemStack(Items.diamond), Character.valueOf('#'), new ItemStack(Items.clock), Character.valueOf('c'), Witchery.Items.GENERIC.itemNullCatalyst.createStack()}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBoltStake.createStack(9), new Object[]{" s ", "www", "fff", Character.valueOf('f'), new ItemStack(Items.feather), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), "stickWood"})); + GameRegistry.addShapedRecipe((ItemStack)Witchery.Items.GENERIC.itemBoltSplitting.createStack(), (Object[])new Object[]{" s ", "bbb", " f ", Character.valueOf('f'), new ItemStack(Items.feather), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('b'), Witchery.Items.GENERIC.itemBoltStake.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)Witchery.Items.GENERIC.itemBoltHoly.createStack(12), (Object[])new Object[]{"aba", "ata", "aba", Character.valueOf('t'), new ItemStack(Items.ghast_tear), Character.valueOf('a'), Witchery.Items.GENERIC.itemBoltStake.createStack(), Character.valueOf('b'), new ItemStack(Items.bone)}); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemBoltAntiMagic.createStack(3), (Object[])new Object[]{Witchery.Items.GENERIC.itemNullCatalyst.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemBoltHoly.createStack(), Witchery.Items.GENERIC.itemBoltHoly.createStack(), Witchery.Items.GENERIC.itemBoltHoly.createStack()}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Items.CROSSBOW_PISTOL), new Object[]{"mbm", "swn", " m ", Character.valueOf('m'), new ItemStack(Items.iron_ingot), Character.valueOf('b'), new ItemStack((Item)Items.bow), Character.valueOf('n'), Witchery.Items.GENERIC.itemBoneNeedle.createStack(), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), "stickWood"})); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.POTIONS.potionAntidote.createStack(2), (Object[])new Object[]{Witchery.Items.GENERIC.itemNullCatalyst.createStack(), new ItemStack((Item)Items.potionitem, 1, 8196), new ItemStack((Item)Items.potionitem, 1, 8196)}); + GameRegistry.addShapedRecipe((ItemStack)Witchery.Items.GENERIC.itemContractOwnership.createStack(), (Object[])new Object[]{"ppp", "pfp", "pps", Character.valueOf('f'), Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), Character.valueOf('p'), new ItemStack(Items.paper), Character.valueOf('s'), new ItemStack(Items.string)}); + GameRegistry.addRecipe((IRecipe)new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractOwnership.createStack(), Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1))); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemContractBlaze.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemHintOfRebirth.createStack()}); + GameRegistry.addRecipe((IRecipe)new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractBlaze.createStack(), Witchery.Items.GENERIC.itemContractBlaze.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1))); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemContractResistFire.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.blaze_powder)}); + GameRegistry.addRecipe((IRecipe)new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractResistFire.createStack(), Witchery.Items.GENERIC.itemContractResistFire.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1))); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemContractEvaporate.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.magma_cream), new ItemStack(Items.blaze_rod)}); + GameRegistry.addRecipe((IRecipe)new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractEvaporate.createStack(), Witchery.Items.GENERIC.itemContractEvaporate.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1))); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemContractFieryTouch.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Witchery.Blocks.EMBER_MOSS), new ItemStack(Items.blaze_rod)}); + GameRegistry.addRecipe((IRecipe)new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractFieryTouch.createStack(), Witchery.Items.GENERIC.itemContractFieryTouch.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1))); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemContractSmelting.createStack(), (Object[])new Object[]{Witchery.Items.GENERIC.itemContractOwnership.createStack(), new ItemStack(Items.lava_bucket)}); + GameRegistry.addRecipe((IRecipe)new RecipeAttachTaglock(Witchery.Items.GENERIC.itemContractSmelting.createStack(), Witchery.Items.GENERIC.itemContractSmelting.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1))); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Witchery.Items.LEONARDS_URN, 1, 1), (Object[])new Object[]{new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0), new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Witchery.Items.LEONARDS_URN, 1, 2), (Object[])new Object[]{new ItemStack(Witchery.Items.LEONARDS_URN, 1, 1), new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0)}); + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Witchery.Items.LEONARDS_URN, 1, 3), (Object[])new Object[]{new ItemStack(Witchery.Items.LEONARDS_URN, 1, 2), new ItemStack(Witchery.Items.LEONARDS_URN, 1, 0)}); + GameRegistry.addRecipe((IRecipe)new RecipeAttachTaglock(new ItemStack(Witchery.Items.PLAYER_COMPASS), new ItemStack(Witchery.Items.PLAYER_COMPASS, 1, Short.MAX_VALUE), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1))); + ItemStack[] var28 = new ItemStack[]{new ItemStack(Blocks.log, 1, 0), new ItemStack(Blocks.log, 1, 1), new ItemStack(Blocks.log, 1, 2), new ItemStack(Blocks.log, 1, 3), new ItemStack(Witchery.Blocks.LOG, 1, 0), new ItemStack(Witchery.Blocks.LOG, 1, 1), new ItemStack(Witchery.Blocks.LOG, 1, 2), new ItemStack(Blocks.log2, 1, 0), new ItemStack(Blocks.log2, 1, 1)}; + for (kobolditeIngot = 0; kobolditeIngot < var28.length; ++kobolditeIngot) { + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.STOCKADE, 9, kobolditeIngot), (Object[])new Object[]{" w ", "wfw", "www", Character.valueOf('f'), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Character.valueOf('w'), var28[kobolditeIngot]}); + } + ItemStack var30 = Witchery.Items.GENERIC.itemKobolditeIngot.createStack(); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Items.KOBOLDITE_PICKAXE), (Object[])new Object[]{"bab", "iii", " s ", Character.valueOf('i'), var30, Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Character.valueOf('b'), new ItemStack(Items.lava_bucket), Character.valueOf('s'), new ItemStack(Items.stick)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.STATUE_OF_WORSHIP), (Object[])new Object[]{"sks", " s ", "s s", Character.valueOf('k'), var30, Character.valueOf('s'), new ItemStack(Blocks.stone)}); + GameRegistry.addShapedRecipe((ItemStack)Witchery.Items.GENERIC.itemKobolditePentacle.createStack(), (Object[])new Object[]{"sks", "kdk", "sks", Character.valueOf('k'), var30, Character.valueOf('s'), Witchery.Items.GENERIC.itemKobolditeNugget.createStack(), Character.valueOf('d'), new ItemStack(Items.diamond)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Items.KOBOLDITE_HELM), (Object[])new Object[]{"iii", "iai", Character.valueOf('i'), var30, Character.valueOf('a'), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Items.EARMUFFS), (Object[])new Object[]{"iii", "i i", "w w", Character.valueOf('i'), new ItemStack(Items.leather), Character.valueOf('w'), new ItemStack(Blocks.wool)}); + GameRegistry.addRecipe((IRecipe)new RecipeShapelessBiomeCopy(new ItemStack(Witchery.Items.BIOME_NOTE), new ItemStack(Witchery.Items.BIOME_BOOK.setContainerItem(Witchery.Items.BIOME_BOOK)), new ItemStack(Items.paper))); + GameRegistry.addShapelessRecipe((ItemStack)Witchery.Items.GENERIC.itemAnnointingPaste.createStack(), (Object[])new Object[]{new ItemStack(Witchery.Items.SEEDS_ARTICHOKE), new ItemStack(Witchery.Items.SEEDS_MANDRAKE), new ItemStack(Witchery.Items.SEEDS_BELLADONNA), new ItemStack(Witchery.Items.SEEDS_SNOWBELL)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Items.SILVER_SWORD), (Object[])new Object[]{"ddd", "dsd", "ddd", Character.valueOf('s'), new ItemStack(Items.golden_sword), Character.valueOf('d'), Witchery.Items.GENERIC.itemSilverDust.createStack()}); + Item[][] var31 = new Item[][]{{Witchery.Items.HUNTER_BOOTS, Witchery.Items.HUNTER_BOOTS_SILVERED}, {Witchery.Items.HUNTER_LEGS, Witchery.Items.HUNTER_LEGS_SILVERED}, {Witchery.Items.HUNTER_COAT, Witchery.Items.HUNTER_COAT_SILVERED}, {Witchery.Items.HUNTER_HAT, Witchery.Items.HUNTER_HAT_SILVERED}}; + for (meats = 0; meats < var31.length; ++meats) { + CraftingManager.getInstance().addRecipe(new ItemStack(var31[meats][1]), new Object[]{"dwd", "w#w", "dsd", Character.valueOf('#'), new ItemStack(var31[meats][0]), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack(), Character.valueOf('d'), Witchery.Items.GENERIC.itemSilverDust.createStack()}).func_92100_c(); + } + GameRegistry.addShapedRecipe((ItemStack)Witchery.Items.GENERIC.itemBoltSilver.createStack(3), (Object[])new Object[]{" s ", "bbb", Character.valueOf('b'), Witchery.Items.GENERIC.itemBoltStake.createStack(), Character.valueOf('s'), Witchery.Items.GENERIC.itemSilverDust.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.WOLF_ALTAR), (Object[])new Object[]{" w ", "w#w", "#d#", Character.valueOf('w'), new ItemStack(Witchery.Blocks.WOLFHEAD, 1, Short.MAX_VALUE), Character.valueOf('#'), new ItemStack(Blocks.stone), Character.valueOf('d'), Witchery.Items.GENERIC.itemWolfsbane.createStack()}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.SILVER_VAT), (Object[])new Object[]{"ibi", "ifi", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('b'), new ItemStack(Items.water_bucket), Character.valueOf('f'), new ItemStack(Blocks.furnace)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.BEARTRAP), (Object[])new Object[]{"iii", "bpb", "iii", Character.valueOf('p'), new ItemStack(Blocks.heavy_weighted_pressure_plate), Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('b'), new ItemStack((Item)Items.shears)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.WOLFTRAP), (Object[])new Object[]{"sns", "w#w", "sns", Character.valueOf('#'), new ItemStack(Witchery.Blocks.BEARTRAP), Character.valueOf('s'), Witchery.Items.GENERIC.itemSilverDust.createStack(), Character.valueOf('n'), Witchery.Items.GENERIC.itemNullCatalyst.createStack(), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack()}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Blocks.GARLIC_GARLAND), new Object[]{"s s", "GsG", "GGG", Character.valueOf('G'), "cropGarlic", Character.valueOf('s'), new ItemStack(Items.string)})); + ItemStack[] hunterItemsSilvered = var34 = new ItemStack[]{new ItemStack(Items.beef), new ItemStack(Items.chicken), new ItemStack(Items.porkchop), new ItemStack(Items.fish), new ItemStack(Items.fish, 1), Witchery.Items.GENERIC.itemMuttonRaw.createStack()}; + int cloth = var34.length; + for (DEFAULT_FORCE_CHANCE = 0; DEFAULT_FORCE_CHANCE < cloth; ++DEFAULT_FORCE_CHANCE) { + ItemStack meat = hunterItemsSilvered[DEFAULT_FORCE_CHANCE]; + GameRegistry.addRecipe((IRecipe)new ShapelessOreRecipe(new ItemStack(Witchery.Items.STEW_RAW), new Object[]{"cropGarlic", meat, new ItemStack(Items.potato), new ItemStack(Items.carrot), new ItemStack(Items.bowl), new ItemStack((Block)Blocks.brown_mushroom)})); + } + Item[][] var33 = new Item[][]{{Witchery.Items.HUNTER_BOOTS_SILVERED, Witchery.Items.HUNTER_BOOTS_GARLICKED}, {Witchery.Items.HUNTER_LEGS_SILVERED, Witchery.Items.HUNTER_LEGS_GARLICKED}, {Witchery.Items.HUNTER_COAT_SILVERED, Witchery.Items.HUNTER_COAT_GARLICKED}, {Witchery.Items.HUNTER_HAT_SILVERED, Witchery.Items.HUNTER_HAT_GARLICKED}}; + for (cloth = 0; cloth < var33.length; ++cloth) { + CraftingManager.getInstance().addRecipe(new ItemStack(var33[cloth][1]), new Object[]{" g ", "g#g", " s ", Character.valueOf('#'), new ItemStack(var33[cloth][0]), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('g'), new ItemStack(Witchery.Items.SEEDS_GARLIC)}).func_92100_c(); + } + for (cloth = 0; cloth < 9; ++cloth) { + GameRegistry.addShapelessRecipe((ItemStack)new ItemStack(Witchery.Items.VAMPIRE_BOOK, 1, cloth + 1), (Object[])new Object[]{new ItemStack(Witchery.Items.VAMPIRE_BOOK, 1, cloth), Witchery.Items.GENERIC.itemVampireBookPage.createStack()}); + } + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.BLOOD_GOBLET), (Object[])new Object[]{"b b", " b ", " g ", Character.valueOf('g'), new ItemStack(Blocks.glass), Character.valueOf('b'), new ItemStack(Items.glass_bottle)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.BLOOD_CRUCIBLE), (Object[])new Object[]{"s s", "blb", Character.valueOf('s'), new ItemStack(Blocks.stone_brick_stairs), Character.valueOf('b'), new ItemStack(Blocks.stonebrick), Character.valueOf('l'), new ItemStack((Block)Blocks.stone_slab, 1, 5)}); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Items.COFFIN), new Object[]{"ppp", "lbl", "lll", Character.valueOf('b'), new ItemStack(Items.bed), Character.valueOf('p'), "plankWood", Character.valueOf('l'), "logWood"})); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.DAYLIGHT_COLLECTOR), (Object[])new Object[]{"g g", " r ", "ici", Character.valueOf('g'), new ItemStack(Items.gold_ingot), Character.valueOf('r'), new ItemStack(Items.repeater), Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('c'), new ItemStack((Block)Blocks.daylight_detector)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_HELMET), (Object[])new Object[]{" i ", "i#i", " i ", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('#'), new ItemStack((Item)Witchery.Items.VAMPIRE_HAT)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_COAT_CHAIN), (Object[])new Object[]{" i ", "i#i", " i ", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('#'), new ItemStack((Item)Witchery.Items.VAMPIRE_COAT)}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_COAT_FEMALE_CHAIN), (Object[])new Object[]{" i ", "i#i", " i ", Character.valueOf('i'), new ItemStack(Items.iron_ingot), Character.valueOf('#'), new ItemStack((Item)Witchery.Items.VAMPIRE_COAT_FEMALE)}); + ItemStack var35 = Witchery.Items.GENERIC.itemDarkCloth.createStack(); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_HAT), (Object[])new Object[]{"###", "# #", Character.valueOf('#'), var35}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_COAT), (Object[])new Object[]{"# #", "###", "###", Character.valueOf('#'), var35}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_COAT_FEMALE), (Object[])new Object[]{"# #", "#l#", "###", Character.valueOf('l'), new ItemStack(Items.leather), Character.valueOf('#'), var35}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_LEGS), (Object[])new Object[]{"###", "# #", "# #", Character.valueOf('#'), var35}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_LEGS_KILT), (Object[])new Object[]{"###", "###", "# #", Character.valueOf('#'), var35}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.VAMPIRE_BOOTS), (Object[])new Object[]{"# #", "# #", Character.valueOf('#'), var35}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack((Item)Witchery.Items.CANE_SWORD), (Object[])new Object[]{" #g", "#d#", "## ", Character.valueOf('g'), new ItemStack(Items.gold_ingot), Character.valueOf('d'), new ItemStack(Items.diamond_sword), Character.valueOf('#'), var35}); + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Items.VAMPIRE_BOOK), (Object[])new Object[]{"#s#", "#b#", "#g#", Character.valueOf('s'), new ItemStack(Items.nether_star), Character.valueOf('b'), new ItemStack(Items.book), Character.valueOf('g'), new ItemStack(Witchery.Items.SEEDS_GARLIC), Character.valueOf('#'), new ItemStack(Items.nether_wart)}); + for (DEFAULT_FORCE_CHANCE = 0; DEFAULT_FORCE_CHANCE < 16; ++DEFAULT_FORCE_CHANCE) { + GameRegistry.addShapedRecipe((ItemStack)new ItemStack(Witchery.Blocks.SHADED_GLASS, 8, DEFAULT_FORCE_CHANCE), (Object[])new Object[]{"###", "#r#", "###", Character.valueOf('r'), new ItemStack(Items.redstone), Character.valueOf('#'), new ItemStack((Block)Blocks.stained_glass, 1, DEFAULT_FORCE_CHANCE)}); + } + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemWoodenStake.createStack(), new Object[]{"GGG", "GsG", "GGG", Character.valueOf('G'), "cropGarlic", Character.valueOf('s'), new ItemStack(Items.stick)})); + OreDictionary.registerOre((String)"plankWood", (ItemStack)new ItemStack(Witchery.Blocks.PLANKS, 1, Short.MAX_VALUE)); + OreDictionary.registerOre((String)"treeSapling", (ItemStack)new ItemStack(Witchery.Blocks.SAPLING, 1, Short.MAX_VALUE)); + OreDictionary.registerOre((String)"logWood", (ItemStack)new ItemStack(Witchery.Blocks.LOG, 1, Short.MAX_VALUE)); + OreDictionary.registerOre((String)"treeLeaves", (ItemStack)new ItemStack(Witchery.Blocks.LEAVES, 1, Short.MAX_VALUE)); + OreDictionary.registerOre((String)"stairWood", (ItemStack)new ItemStack(Witchery.Blocks.STAIRS_ALDER, 1, Short.MAX_VALUE)); + OreDictionary.registerOre((String)"stairWood", (ItemStack)new ItemStack(Witchery.Blocks.STAIRS_HAWTHORN, 1, Short.MAX_VALUE)); + OreDictionary.registerOre((String)"stairWood", (ItemStack)new ItemStack(Witchery.Blocks.STAIRS_ROWAN, 1, Short.MAX_VALUE)); + OreDictionary.registerOre((String)"cropGarlic", (ItemStack)new ItemStack(Witchery.Items.SEEDS_GARLIC, 1, Short.MAX_VALUE)); + GameRegistry.addSmelting((ItemStack)Witchery.Items.GENERIC.itemSoftClayJar.createStack(), (ItemStack)Witchery.Items.GENERIC.itemEmptyClayJar.createStack(), (float)0.0f); + GameRegistry.addSmelting((ItemStack)Witchery.Items.GENERIC.itemOddPorkRaw.createStack(), (ItemStack)Witchery.Items.GENERIC.itemOddPorkCooked.createStack(), (float)0.0f); + GameRegistry.addSmelting((ItemStack)Witchery.Items.GENERIC.itemGoldenThread.createStack(), (ItemStack)new ItemStack(Items.gold_nugget), (float)0.0f); + GameRegistry.addSmelting((ItemStack)Witchery.Items.GENERIC.itemMuttonRaw.createStack(), (ItemStack)Witchery.Items.GENERIC.itemMuttonCooked.createStack(), (float)0.0f); + GameRegistry.addSmelting((ItemStack)new ItemStack(Witchery.Blocks.BLOODED_WOOL), (ItemStack)Witchery.Items.GENERIC.itemDarkCloth.createStack(), (float)0.0f); + GameRegistry.addSmelting((ItemStack)new ItemStack(Witchery.Items.STEW_RAW), (ItemStack)new ItemStack(Witchery.Items.STEW), (float)1.0f); + if (!Config.instance().smeltAllSaplingsToWoodAsh) { + GameRegistry.addSmelting((Block)Blocks.sapling, (ItemStack)Witchery.Items.GENERIC.itemAshWood.createStack(), (float)0.0f); + GameRegistry.addSmelting((ItemStack)new ItemStack(Witchery.Blocks.SAPLING), (ItemStack)Witchery.Items.GENERIC.itemAshWood.createStack(), (float)0.0f); + } + GameRegistry.addSmelting((ItemStack)new ItemStack(Witchery.Blocks.LOG, 1, 0), (ItemStack)new ItemStack(Items.coal, 1, 1), (float)0.0f); + GameRegistry.addSmelting((ItemStack)new ItemStack(Witchery.Blocks.LOG, 1, 1), (ItemStack)new ItemStack(Items.coal, 1, 1), (float)0.0f); + GameRegistry.addSmelting((ItemStack)new ItemStack(Witchery.Blocks.LOG, 1, 2), (ItemStack)new ItemStack(Items.coal, 1, 1), (float)0.0f); + DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), 1, Witchery.Items.GENERIC.itemGypsum.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), new ItemStack(Items.slime_ball), null); + DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Dye.LAPIS_LAZULI.createStack(), 3, Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemFoulFume.createStack()); + DistilleryRecipes.instance().addRecipe(new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), 3, Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), null); + DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemDiamondVapour.createStack(), new ItemStack(Items.ghast_tear), 3, Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemRefinedEvil.createStack()); + DistilleryRecipes.instance().addRecipe(new ItemStack(Items.ender_pearl), null, 6, Witchery.Items.GENERIC.itemEnderDew.createStack(2), Witchery.Items.GENERIC.itemEnderDew.createStack(2), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()); + DistilleryRecipes.instance().addRecipe(new ItemStack(Items.blaze_powder), new ItemStack(Items.gunpowder), 1, new ItemStack(Items.glowstone_dust), new ItemStack(Items.glowstone_dust), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), null); + DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), 4, Witchery.Items.GENERIC.itemInfernalBlood.createStack(2), Witchery.Items.GENERIC.itemInfernalBlood.createStack(2), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), null); + DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemDemonHeart.createStack(), new ItemStack(Blocks.netherrack), 2, new ItemStack(Blocks.soul_sand), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), null); + DistilleryRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), 2, Witchery.Items.GENERIC.itemFocusedWill.createStack(), Witchery.Items.GENERIC.itemCondensedFear.createStack(), Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(4), Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(4)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfVines.createStack(3), 1, 0, 0.0f, -16753913, 0, new ItemStack(Blocks.vine), new ItemStack((Block)Blocks.red_mushroom), new ItemStack((Block)Blocks.brown_mushroom), Witchery.Items.GENERIC.itemDogTongue.createStack(), new ItemStack(Items.wheat), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfWebs.createStack(3), 1, 0, 0.0f, -1, 0, Witchery.Items.GENERIC.itemWeb.createStack(), new ItemStack((Block)Blocks.red_mushroom), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack((Block)Blocks.yellow_flower), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfThorns.createStack(3), 1, 0, 0.0f, -10027232, 0, Dye.CACTUS_GREEN.createStack(), new ItemStack((Block)Blocks.brown_mushroom), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), new ItemStack((Block)Blocks.red_flower), Witchery.Items.GENERIC.itemMandrakeRoot.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfInk.createStack(3), 1, 0, 0.0f, -13421773, 0, Dye.INK_SAC.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemRowanBerries.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(3), 1, 0, 0.0f, -11258073, 0, new ItemStack(Witchery.Blocks.SAPLING, 1, 0), new ItemStack(Witchery.Blocks.SAPLING, 1, 1), new ItemStack(Witchery.Blocks.SAPLING, 1, 2), Witchery.Items.GENERIC.itemDogTongue.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), new ItemStack((Block)Blocks.red_flower)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfErosion.createStack(3), 1, 0, 0.0f, -4456656, 0, Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack((Block)Blocks.yellow_flower), new ItemStack(Items.magma_cream)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfRaising.createStack(3), 1, 0, 500.0f, -12120505, 0, Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), new ItemStack(Items.redstone), Witchery.Items.GENERIC.itemOilOfVitriol.createStack(), new ItemStack(Items.bone), new ItemStack(Items.rotten_flesh)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewGrotesque.createStack(3), 1, 0, 500.0f, -13491946, 0, Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), new ItemStack(Items.golden_apple), new ItemStack(Items.poisonous_potato)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfLove.createStack(3), 1, 0, 0.0f, -23044, 0, new ItemStack((Block)Blocks.red_flower), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), new ItemStack(Items.golden_carrot), new ItemStack(Blocks.waterlily), Dye.COCOA_BEANS.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfIce.createStack(3), 1, 0, 1000.0f, -13565953, 0, Witchery.Items.GENERIC.itemIcyNeedle.createStack(), new ItemStack(Items.snowball), Witchery.Items.GENERIC.itemArtichoke.createStack(), new ItemStack(Items.speckled_melon), new ItemStack((Block)Blocks.red_mushroom), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfTheDepths.createStack(3), 1, 0, 0.0f, -15260093, 0, Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), new ItemStack(Blocks.waterlily), Dye.INK_SAC.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfInfection.createStack(3), 0, 0, 0.0f, -11112850, 0, Witchery.Items.GENERIC.itemToeOfFrog.createStack(), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Witchery.Items.GENERIC.itemWormyApple.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Items.rotten_flesh), Witchery.Items.GENERIC.itemMutandis.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSleeping.createStack(3), 1, 0, 0.0f, -7710856, 0, Witchery.Items.GENERIC.itemPurifiedMilk.createStack(), new ItemStack(Items.cookie), Witchery.Items.GENERIC.itemBrewOfLove.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(3), 0, 0, 0.0f, -16711834, Config.instance().dimensionDreamID, new ItemStack(Items.ender_pearl), Witchery.Items.GENERIC.itemArtichoke.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), new ItemStack(Items.glowstone_dust), new ItemStack(Witchery.Blocks.GLINT_WEED), Witchery.Items.GENERIC.itemBatWool.createStack()).setUnlocalizedName("witchery.brew.flowingspirit"); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfWasting.createStack(3), 1, 0, 0.0f, -12440546, 0, Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), new ItemStack(Items.rotten_flesh), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Witchery.Blocks.EMBER_MOSS), new ItemStack(Items.poisonous_potato), new ItemStack(Items.spider_eye)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfBats.createStack(3), 1, 0, 0.0f, -9809858, 0, Witchery.Items.GENERIC.itemBatBall.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack(Items.apple), new ItemStack(Items.sugar), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.gunpowder)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewSubstitution.createStack(3), 1, 0, 0.0f, -7010720, 0, Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), new ItemStack(Items.egg), new ItemStack(Items.magma_cream), Witchery.Items.GENERIC.itemBranchEnt.createStack()); + //KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemOdourOfMeditation.createStack(3), 1, 0, 0.0f, -4079167, 0, Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemFocusedWill.createStack(), new ItemStack(Items.gold_nugget), new ItemStack(Items.dye, 1, 4)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewRevealing.createStack(3), 1, 0, 0.0f, -4079167, 0, new ItemStack(Items.carrot), new ItemStack(Items.spider_eye), new ItemStack(Items.spider_eye), new ItemStack((Item)Items.potionitem, 1, 8198), new ItemStack((Block)Blocks.brown_mushroom), Witchery.Items.GENERIC.itemOdourOfPurity.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidDirt.createStack(3), 1, 0, 2000.0f, -11720688, 0, true, new ItemStack(Blocks.dirt), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)).setUnlocalizedName("witchery.brew.solidification"); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidRock.createStack(3), 1, 0, 2000.0f, -8355712, 0, false, new ItemStack(Blocks.stone), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidSand.createStack(3), 1, 0, 2000.0f, -3495323, 0, false, new ItemStack((Block)Blocks.sand), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidSandstone.createStack(3), 1, 0, 2000.0f, -8427008, 0, false, new ItemStack(Blocks.sandstone), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfSolidErosion.createStack(3), 1, 0, 2000.0f, -3300, 0, false, Witchery.Items.GENERIC.itemBrewOfErosion.createStack(), Witchery.Items.GENERIC.itemFoulFume.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Witchery.Blocks.SPANISH_MOSS)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfCursedLeaping.createStack(3), 1, 1, 0.0f, -16758145, 0, new ItemStack(Items.bone), new ItemStack(Items.apple), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack(Items.feather), new ItemStack(Items.fish)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfFrogsTongue.createStack(3), 1, 2, 0.0f, -12938226, 0, new ItemStack((Block)Blocks.red_mushroom), new ItemStack(Items.wheat), Witchery.Items.GENERIC.itemBrewOfWebs.createStack(), Witchery.Items.GENERIC.itemArtichoke.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemToeOfFrog.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemBrewOfHitchcock.createStack(3), 1, 3, 0.0f, -3908582, 0, new ItemStack((Block)Blocks.brown_mushroom), new ItemStack(Items.wheat_seeds), Witchery.Items.GENERIC.itemBrewOfThorns.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack(Items.feather), Witchery.Items.GENERIC.itemOwletsWing.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemCongealedSpirit.createStack(), 0, 0, 2000.0f, -3096310, 0, Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack(), Witchery.Items.GENERIC.itemSubduedSpirit.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), 0, 0, 1000.0f, -59882, 0, new ItemStack(Items.redstone), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemFlyingOintment.createStack(), 0, 0, 3000.0f, -17620, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 8258), new ItemStack(Items.diamond), new ItemStack(Items.feather), Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemMysticUnguent.createStack(), 0, 0, 3000.0f, -14333109, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 8265), new ItemStack(Items.diamond), new ItemStack(Witchery.Blocks.SAPLING, 1, 0), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemHappenstanceOil.createStack(), 0, 0, 2000.0f, 8534058, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 8262), new ItemStack(Items.ender_eye), new ItemStack(Items.golden_carrot), new ItemStack(Items.spider_eye), Witchery.Items.GENERIC.itemMandrakeRoot.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemGhostOfTheLight.createStack(2), 0, 0, 4000.0f, -5584658, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 8270), new ItemStack((Item)Items.potionitem, 1, 8259), Witchery.Items.POPPET.firePoppet.createStack(), new ItemStack(Blocks.torch), Witchery.Items.GENERIC.itemDogTongue.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemSoulOfTheWorld.createStack(2), 0, 0, 4000.0f, -16003328, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 8257), new ItemStack(Items.golden_apple, 1, 1), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), new ItemStack(Witchery.Blocks.SAPLING, 1, 0)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemSpiritOfOtherwhere.createStack(2), 0, 0, 4000.0f, -7128833, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 8258), new ItemStack(Items.ender_eye), new ItemStack(Items.ender_eye), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemSpiritOfOtherwhere.createStack(2), 0, 0, 4000.0f, -7128833, 0, false, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 16210), new ItemStack(Items.ender_eye), new ItemStack(Items.ender_eye), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfernalAnimus.createStack(2), 0, 0, 4000.0f, -7598080, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 8236), Witchery.Items.POPPET.voodooPoppet.createStack(), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_rod)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfernalAnimus.createStack(2), 0, 0, 4000.0f, -7598080, 0, false, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), new ItemStack((Item)Items.potionitem, 1, 16172), Witchery.Items.POPPET.voodooPoppet.createStack(), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_rod)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfusionBase.createStack(), 1, 0, 3000.0f, -10520657, 0, Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Witchery.Items.GENERIC.itemCreeperHeart.createStack(), Witchery.Items.GENERIC.itemToeOfFrog.createStack(), Witchery.Items.GENERIC.itemOwletsWing.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack()); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemInfusionBase.createStack(2), 0, 0, 3000.0f, -10520657, 0, Witchery.Items.GENERIC.itemInfusionBase.createStack(), Witchery.Items.GENERIC.itemBrewOfFlowingSpirit.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), new ItemStack(Witchery.Blocks.BRAMBLE, 1, 1)); + KettleRecipes.instance().addRecipe(Witchery.Items.GENERIC.itemFlooPowder.createStack(4), 0, 0, 100.0f, 65280, 0, Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Items.redstone), new ItemStack(Items.glowstone_dust)).setUnlocalizedName("witchery.book.floopowder"); + //KettleRecipes.instance().addRecipe(new ItemStack(Phase4Items.itemGillyweed), 0, 0, 500.0f, 255, 0, new ItemStack(Blocks.waterlily), new ItemStack(Items.slime_ball), new ItemStack(Blocks.vine)).setUnlocalizedName("witchery.book.gillyweed"); + //KettleRecipes.instance().addRecipe(new ItemStack(Phase4Items.itemPolyjuice), 0, 0, 1000.0f, 0x555555, 0, new ItemStack((Item)Witchery.Items.GENERIC, 1, Witchery.Items.GENERIC.itemMandrakeRoot.damageValue), new ItemStack((Item)Items.potionitem, 1, 0), new ItemStack((Item)Witchery.Items.GENERIC, 1, Witchery.Items.GENERIC.itemCreeperHeart.damageValue)).setUnlocalizedName("witchery.book.polyjuice"); + //KettleRecipes.instance().addRecipe(new ItemStack(Phase4Items.itemPortkeyCrystal), 0, 0, 2000.0f, 0xFFFFFF, 0, new ItemStack(Items.quartz), new ItemStack(Items.ender_pearl), new ItemStack(Items.gold_ingot)).setUnlocalizedName("witchery.book.portkeycrystal"); + CreaturePower.Registry.instance().add(new CreaturePowerSpider(1, EntityCaveSpider.class)); + CreaturePower.Registry.instance().add(new CreaturePowerSpider(2, EntitySpider.class)); + CreaturePower.Registry.instance().add(new CreaturePowerCreeper(3)); + CreaturePower.Registry.instance().add(new CreaturePowerBat(4, EntityBat.class)); + CreaturePower.Registry.instance().add(new CreaturePowerSquid(5)); + CreaturePower.Registry.instance().add(new CreaturePowerGhast(6)); + CreaturePower.Registry.instance().add(new CreaturePowerBlaze(7)); + CreaturePower.Registry.instance().add(new CreaturePowerPigMan(8)); + CreaturePower.Registry.instance().add(new CreaturePowerZombie(9)); + CreaturePower.Registry.instance().add(new CreaturePowerSkeleton(10)); + CreaturePower.Registry.instance().add(new CreaturePowerJump(11, EntityMagmaCube.class)); + CreaturePower.Registry.instance().add(new CreaturePowerJump(12, EntitySlime.class)); + CreaturePower.Registry.instance().add(new CreaturePowerSpeed(13, EntitySilverfish.class)); + CreaturePower.Registry.instance().add(new CreaturePowerSpeed(14, EntityOcelot.class)); + CreaturePower.Registry.instance().add(new CreaturePowerSpeed(15, EntityWolf.class)); + CreaturePower.Registry.instance().add(new CreaturePowerSpeed(16, EntityHorse.class)); + CreaturePower.Registry.instance().add(new CreaturePowerEnderman(17)); + CreaturePower.Registry.instance().add(new CreaturePowerHeal(18, EntitySheep.class, 1)); + CreaturePower.Registry.instance().add(new CreaturePowerHeal(19, EntityCow.class, 1)); + CreaturePower.Registry.instance().add(new CreaturePowerHeal(20, EntityChicken.class, 1)); + CreaturePower.Registry.instance().add(new CreaturePowerHeal(21, EntityPig.class, 1)); + CreaturePower.Registry.instance().add(new CreaturePowerHeal(22, EntityVillager.class, 2)); + CreaturePower.Registry.instance().add(new CreaturePowerHeal(23, EntityMooshroom.class, 2)); + CreaturePower.Registry.instance().add(new CreaturePowerBat(24, EntityOwl.class)); + CreaturePower.Registry.instance().add(new CreaturePowerJump(25, EntityToad.class)); + CreaturePower.Registry.instance().add(new CreaturePowerIronGolem(26, EntityIronGolem.class)); + CreaturePower.Registry.instance().add(new CreaturePowerFrost(27, EntitySnowman.class)); + RiteRegistry.addRecipe(1, 0, new RiteBindCircleToTalisman(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Items.CIRCLE_TALISMAN), new ItemStack(Items.redstone)), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle[0]).setUnlocalizedName("witchery.rite.bindcircle"); + RiteRegistry.addRecipe(2, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(), RiteSummonItem.Binding.LOCATION), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.glowstone_dust)), new SacrificePower(500.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.bindwaystone"); + RiteRegistry.addRecipe(3, 3, new RiteSummonItem(Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemAttunedStone.createStack(), new ItemStack(Items.glowstone_dust), new ItemStack(Items.redstone), Witchery.Items.GENERIC.itemAshWood.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.chargestone"); + RiteRegistry.addRecipe(4, 4, new RiteInfusionRecharge(10, 4, 40.0f, 0), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Items.potionitem, 1, 8193)), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusionrecharge"); + RiteRegistry.addRecipe(5, 5, new RiteTeleportToWaystone(3), new SacrificeItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(0, 16, 0)).setUnlocalizedName("witchery.rite.teleporttowaystone"); + RiteRegistry.addRecipe(6, 6, new RiteTeleportEntity(3), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemWaystone.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.iron_axe)), new SacrificePower(3000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 28, 0)).setUnlocalizedName("witchery.rite.teleportentity"); + RiteRegistry.addRecipe(7, 7, new RiteTransposeOres(8, 30, new Block[]{Blocks.iron_ore, Blocks.gold_ore}), new SacrificeItem(new ItemStack(Items.ender_pearl), new ItemStack(Items.iron_ingot), new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(0, 40, 0)).setUnlocalizedName("witchery.rite.teleportironore"); + RiteRegistry.addRecipe(8, 8, new RiteProtectionCircleRepulsive(4, 0.8f, 0), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.feather), new ItemStack(Items.redstone)), new SacrificePower(500.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.protection"); + RiteRegistry.addRecipe(9, 9, new RiteProtectionCircleAttractive(4, 0.8f, 0), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.slime_ball), new ItemStack(Items.redstone)), new SacrificePower(500.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.imprisonment"); + RiteRegistry.addRecipe(10, 10, new RiteProtectionCircleBarrier(4, 5, 1.2f, false, 0), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.obsidian), new ItemStack(Items.redstone)), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(500.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.barrier"); + RiteRegistry.addRecipe(11, 11, new RiteProtectionCircleBarrier(6, 6, 1.4f, true, 0), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.obsidian), new ItemStack(Items.glowstone_dust)), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.barrierlarge"); + RiteRegistry.addRecipe(12, 12, new RiteProtectionCircleBarrier(6, 4, 0.0f, true, 60), new SacrificeItem(new ItemStack(Blocks.obsidian), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.barrierportable"); + RiteRegistry.addRecipe(13, 13, new RiteRaiseVolcano(8, 8), new SacrificeItem(new ItemStack(Blocks.stone), new ItemStack(Items.magma_cream), new ItemStack(Items.golden_sword), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.volcano"); + RiteRegistry.addRecipe(14, 14, new RiteWeatherCallStorm(0, 3, 8), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.wooden_sword), Witchery.Items.GENERIC.itemAshWood.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.storm"); + RiteRegistry.addRecipe(15, 15, new RiteWeatherCallStorm(3, 7, 18), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.stone_sword), Witchery.Items.GENERIC.itemAshWood.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.stormlarge"); + RiteRegistry.addRecipe(16, 16, new RiteWeatherCallStorm(3, 7, 18), new SacrificeItem(new ItemStack(Items.iron_sword), Witchery.Items.GENERIC.itemAshWood.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.stormportable"); + RiteRegistry.addRecipe(17, 17, new RiteEclipse(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.stone_axe), Witchery.Items.GENERIC.itemQuicklime.createStack()), new SacrificePower(3000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_DAY), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.eclipse"); + RiteRegistry.addRecipe(18, 18, new RiteEclipse(), new SacrificeItem(new ItemStack(Items.iron_axe), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.of(RitualTraits.ONLY_AT_DAY), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.eclipseportable"); + RiteRegistry.addRecipe(19, 19, new RitePartEarth(60, 1, 10), new SacrificeItem(Witchery.Items.GENERIC.itemBrewOfErosion.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.partearth"); + RiteRegistry.addRecipe(20, 20, new RiteRaiseColumn(4, 8), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Blocks.cactus), new ItemStack(Items.gunpowder)), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack())), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.raiseearth"); + RiteRegistry.addRecipe(21, 23, new RiteBanishDemon(9), new SacrificeItem(new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.banishdemonportable"); + RiteRegistry.addRecipe(22, 24, new RiteBanishDemon(9), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemWaystone.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.banishdemon"); + RiteRegistry.addRecipe(23, 25, new RiteSummonCreature(EntityDemon.class, false), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_powder), new ItemStack(Items.ender_pearl)), new SacrificeLiving(EntityVillager.class), new SacrificePower(3000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.summondemon"); + RiteRegistry.addRecipe(24, 26, new RiteSummonCreature(EntityDemon.class, false), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemRefinedEvil.createStack(), new ItemStack(Items.blaze_rod), new ItemStack(Items.ender_pearl), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), new SacrificePower(3000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.summondemonexpensive"); + RiteRegistry.addRecipe(25, 27, new RiteSummonCreature(EntityWither.class, false), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.skull, 1, 1), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), new ItemStack(Items.ender_pearl)), new SacrificeLiving(EntityVillager.class), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 28), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.summonwither"); + RiteRegistry.addRecipe(26, 28, new RiteSummonCreature(EntityWither.class, false), new SacrificeItem(new ItemStack(Items.skull, 1, 1), new ItemStack(Items.diamond), new ItemStack(Items.ender_pearl), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 28), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.summonwitherexpensive"); + this.infusionLight = new InfusionLight(1); + Infusion.Registry.instance().add(this.infusionLight); + RiteRegistry.addRecipe(27, 31, new RiteInfusePlayers(this.infusionLight, 200, 4), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemGhostOfTheLight.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusionlight"); + this.infusionWorld = new InfusionOverworld(2); + Infusion.Registry.instance().add(this.infusionWorld); + RiteRegistry.addRecipe(28, 32, new RiteInfusePlayers(this.infusionWorld, 200, 4), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemSoulOfTheWorld.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusionearth"); + this.infusionEnder = new InfusionOtherwhere(3); + Infusion.Registry.instance().add(this.infusionEnder); + RiteRegistry.addRecipe(29, 33, new RiteInfusePlayers(this.infusionEnder, 200, 4), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemSpiritOfOtherwhere.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 16, 0), new Circle(0, 28, 0)).setUnlocalizedName("witchery.rite.infusionender"); + this.infusionBeast = new InfusionInfernal(4); + Infusion.Registry.instance().add(this.infusionBeast); + RiteRegistry.addRecipe(30, 34, new RiteInfusePlayers(this.infusionBeast, 200, 4), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemInfernalAnimus.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.infusionhell"); + RiteRegistry.addRecipe(31, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemBroomEnchanted.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemBroom.createStack(), Witchery.Items.GENERIC.itemFlyingOintment.createStack()), new SacrificePower(3000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusionsky"); + RiteRegistry.addRecipe(32, 36, new RiteSummonItem(Witchery.Items.GENERIC.itemNecroStone.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemAttunedStone.createStack(), new ItemStack(Items.bone), new ItemStack(Items.rotten_flesh), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Items.iron_sword), Witchery.Items.GENERIC.itemSpectralDust.createStack()), new SacrificePower(1000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.necrostone"); + RiteRegistry.addRecipe(33, 30, new RiteSummonCreature(EntityFamiliar.class, true), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemDropOfLuck.createStack(), new ItemStack(Items.porkchop), new ItemStack(Items.gold_ingot), new ItemStack(Witchery.Items.ARTHANA)), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.summonfamiliar"); + RiteRegistry.addRecipe(34, 2, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(2), RiteSummonItem.Binding.COPY_LOCATION), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(), Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.redstone)), new SacrificePower(500.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.bindwaystonecopy"); + RiteRegistry.addRecipe(35, 21, new RiteFertility(50, 15), new SacrificeMultiple(new SacrificeItem(Dye.BONE_MEAL.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemGypsum.createStack(), Witchery.Items.GENERIC.itemMutandis.createStack()), new SacrificePower(3000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.fertility"); + RiteRegistry.addRecipe(36, 22, new RiteFertility(50, 15), new SacrificeItem(Dye.BONE_MEAL.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemGypsum.createStack(), Witchery.Items.GENERIC.itemMutandisExtremis.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.fertilityportable"); + RiteRegistry.addRecipe(37, 37, new RiteBlight(80, 15), new SacrificeItem(Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.speckled_melon), new ItemStack(Items.rotten_flesh), new ItemStack(Items.diamond)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.curseblight"); + RiteRegistry.addRecipe(38, 38, new RiteBlindness(80, 15), new SacrificeItem(Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.GENERIC.itemBrewOfInk.createStack(), new ItemStack(Items.poisonous_potato), new ItemStack(Items.spider_eye), new ItemStack(Items.diamond)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.curseblindness"); + RiteRegistry.addRecipe(39, 39, new RiteHellOnEarth(20, 15, 200.0f), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemWaystone.createStack(), new ItemStack(Items.nether_star)), new SacrificeLiving(EntityVillager.class), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(5000.0f, 20)), EnumSet.of(RitualTraits.ONLY_OVERWORLD, RitualTraits.ONLY_AT_NIGHT), new Circle(0, 0, 16), new Circle(0, 28, 0), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.hellonearth"); + RiteRegistry.addRecipe(40, 29, new RiteSummonCreature(EntityWitch.class, false), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemDiamondVapour.createStack(), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Items.magma_cream), new ItemStack(Witchery.Items.ARTHANA), new ItemStack(Items.fermented_spider_eye)), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.summonwitch"); + RiteRegistry.addRecipe(41, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(), RiteSummonItem.Binding.LOCATION), new SacrificeItem(Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemAshWood.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.bindwaystoneportable"); + RiteRegistry.addRecipe(42, 2, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(2), RiteSummonItem.Binding.COPY_LOCATION), new SacrificeItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack(), Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), Witchery.Items.GENERIC.itemQuicklime.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.bindwaystonecopyportable"); + RiteRegistry.addRecipe(43, 22, new RiteNaturesPower(14, 8, 150, 2), new SacrificeItem(Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Witchery.Blocks.SAPLING, 1, 0), new ItemStack(Witchery.Blocks.SAPLING, 1, 1), new ItemStack(Witchery.Blocks.SAPLING, 1, 2), new ItemStack(Blocks.sapling, 1, 0), new ItemStack(Blocks.sapling, 1, 1), new ItemStack(Blocks.sapling, 1, 2), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.naturespower"); + RiteRegistry.addRecipe(44, 36, new RitePriorIncarnation(5, 16), new SacrificeItem(Witchery.Items.GENERIC.itemNecroStone.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), new ItemStack(Items.bone), Witchery.Items.GENERIC.itemSpectralDust.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.priorincarnation"); + RiteRegistry.addRecipe(45, 0, new RiteBindCircleToTalisman(), new SacrificeItem(new ItemStack(Witchery.Items.CIRCLE_TALISMAN), new ItemStack(Items.glowstone_dust), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle[0]).setUnlocalizedName("witchery.rite.bindcircleportable"); + RiteRegistry.addRecipe(46, 20, new RiteRaiseColumn(6, 8), new SacrificeItem(Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Blocks.cactus), new ItemStack(Items.redstone)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.raiseearth"); + RiteRegistry.addRecipe(47, 20, new RiteRaiseColumn(9, 8), new SacrificeItem(Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), new ItemStack(Blocks.cactus), new ItemStack(Items.glowstone_dust)), EnumSet.noneOf(RitualTraits.class), new Circle(40, 0, 0)).setUnlocalizedName("witchery.rite.raiseearth"); + RiteRegistry.addRecipe(48, 48, new RiteCurseCreature(true, "witcheryCursed", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.gunpowder), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.cursecreature1"); + RiteRegistry.addRecipe(49, 49, new RiteCurseCreature(false, "witcheryCursed", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Items.spider_eye), new ItemStack(Items.gunpowder), Witchery.Items.GENERIC.itemBrewOfLove.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.removecurse1"); + RiteRegistry.addRecipe(50, 35, new RiteSummonItem(new ItemStack(Witchery.Items.MYSTIC_BRANCH), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemBranchEnt.createStack(), Witchery.Items.GENERIC.itemMysticUnguent.createStack()), new SacrificePower(3000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusiontree"); + RiteRegistry.addRecipe(51, 20, new RiteCookItem(5.0f, 0.08), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Items.coal)), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.cookfood"); + RiteRegistry.addRecipe(52, 48, new RiteCurseCreature(true, "witcheryInsanity", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Items.poisonous_potato), new ItemStack(Items.sugar), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.curseinsanity1"); + RiteRegistry.addRecipe(53, 49, new RiteCurseCreature(false, "witcheryInsanity", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Items.potato), new ItemStack(Items.sugar), Witchery.Items.GENERIC.itemBrewOfLove.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.removeinsanity1"); + RiteRegistry.addRecipe(54, 1, new RiteBindFamiliar(7), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemOdourOfPurity.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemInfernalBlood.createStack()), new SacrificePower(8000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.bindfamiliar"); + RiteRegistry.addRecipe(55, 30, new RiteCallFamiliar(7), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemHintOfRebirth.createStack(), Witchery.Items.GENERIC.itemWhiffOfMagic.createStack()), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.callfamiliar"); + RiteRegistry.addRecipe(56, 50, new RiteCursePoppets(1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.POPPET.antiVoodooPoppet.createStack(), new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemSpectralDust.createStack()), new SacrificePower(7000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.corruptvoodooprotection"); + RiteRegistry.addRecipe(57, 35, new RiteSummonItem(new ItemStack(Witchery.Blocks.CRYSTAL_BALL), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemQuartzSphere.createStack(), new ItemStack(Items.gold_ingot), Witchery.Items.GENERIC.itemHappenstanceOil.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusionfuture"); + RiteRegistry.addRecipe(58, 20, new RiteCookItem(5.0f, 0.16), new SacrificeItem(Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemAshWood.createStack(), new ItemStack(Items.blaze_powder)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.cookfood"); + RiteRegistry.addRecipe(59, 48, new RiteCurseCreature(true, "witcherySinking", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Dye.INK_SAC.createStack(), new ItemStack(Items.nether_wart), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.cursesinking1"); + RiteRegistry.addRecipe(60, 49, new RiteCurseCreature(false, "witcherySinking", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Dye.BONE_MEAL.createStack(), new ItemStack(Items.nether_wart), Witchery.Items.GENERIC.itemBrewOfTheDepths.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.removesinking1"); + RiteRegistry.addRecipe(61, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemSeerStone.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemQuartzSphere.createStack(), new ItemStack(Blocks.obsidian), Witchery.Items.GENERIC.itemHappenstanceOil.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.infusionseerstone"); + RiteRegistry.addRecipe(62, 48, new RiteCurseCreature(true, "witcheryOverheating", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.curseoverheating"); + RiteRegistry.addRecipe(63, 49, new RiteCurseCreature(false, "witcheryOverheating", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), new ItemStack(Items.blaze_rod), Witchery.Items.GENERIC.itemBrewOfTheDepths.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.cureoverheating"); + RiteRegistry.addRecipe(64, 22, new RiteClimateChange(16), new SacrificeItem(new ItemStack(Items.spider_eye), Witchery.Items.GENERIC.itemToeOfFrog.createStack(), Witchery.Items.GENERIC.itemBatWool.createStack(), Witchery.Items.GENERIC.itemDogTongue.createStack(), Witchery.Items.GENERIC.itemOwletsWing.createStack(), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(40, 0, 0)).setUnlocalizedName("witchery.rite.climatechange"); + RiteRegistry.addRecipe(65, 12, new RiteSphereEffect(8, Witchery.Blocks.PERPETUAL_ICE), new SacrificeItem(new ItemStack(Items.diamond_sword), Witchery.Items.GENERIC.itemFrozenHeart.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.iceshell"); + RiteRegistry.addRecipe(66, 38, new RiteRainOfToads(5, 16, 10), new SacrificeItem(Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), Witchery.Items.GENERIC.itemRedstoneSoup.createStack(), Witchery.Items.GENERIC.itemReekOfMisfortune.createStack(), Witchery.Items.GENERIC.itemToeOfFrog.createStack(), new ItemStack(Items.water_bucket), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.rainoffrogs"); + RiteRegistry.addRecipe(67, 4, new RiteGlyphicTransformation(), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemGypsum.createStack(), new ItemStack(Witchery.Items.ARTHANA)), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle[0]).setUnlocalizedName("witchery.rite.glyphictransform"); + RiteRegistry.addRecipe(68, 7, new RiteCallCreatures(64.0f, new Class[]{EntityPig.class, EntityChicken.class, EntityCow.class, EntitySheep.class, EntityMooshroom.class, EntityWolf.class, EntityOcelot.class}), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.milk_bucket), new ItemStack(Blocks.hay_block), new ItemStack(Items.apple), new ItemStack(Items.beef), new ItemStack(Items.fish), new ItemStack((Block)Blocks.red_mushroom), new ItemStack(Items.carrot), new ItemStack(Items.wheat_seeds)), new SacrificePower(6000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 40, 0)).setUnlocalizedName("witchery.rite.callbeasts"); + RiteRegistry.addRecipe(69, 7, new RiteSetNBT(5, "WITCManifestDuration", 450, 25), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemSpectralDust.createStack(), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Items.golden_pickaxe), new ItemStack(Witchery.Items.ARTHANA), new ItemStack(Items.gunpowder), new ItemStack(Items.diamond)), new SacrificePower(10000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 16, 0)).setUnlocalizedName("witchery.rite.manifest"); + RiteRegistry.addRecipe(70, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 0), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.sapling, 1, 0), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.forestation"); + RiteRegistry.addRecipe(71, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 1), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.sapling, 1, 1), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); + RiteRegistry.addRecipe(72, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 2), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.sapling, 1, 2), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); + RiteRegistry.addRecipe(73, 22, new RiteForestation(20, 8, 60, Blocks.sapling, 3), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.sapling, 1, 3), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); + RiteRegistry.addRecipe(74, 22, new RiteForestation(20, 8, 60, Witchery.Blocks.SAPLING, 0), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.SAPLING, 1, 0), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); + RiteRegistry.addRecipe(75, 22, new RiteForestation(20, 8, 60, Witchery.Blocks.SAPLING, 1), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.SAPLING, 1, 1), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); + RiteRegistry.addRecipe(76, 22, new RiteForestation(20, 8, 60, Witchery.Blocks.SAPLING, 2), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.SAPLING, 1, 2), new ItemStack(Witchery.Blocks.WICKER_BUNDLE), Witchery.Items.GENERIC.itemBrewOfSprouting.createStack(), Witchery.Items.GENERIC.itemBranchEnt.createStack()), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.forestation").setShowInBook(false); + RiteRegistry.addRecipe(77, 13, new RiteRaiseVolcano(8, 8), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.cobblestone), new ItemStack(Items.magma_cream), new ItemStack(Items.golden_sword)), new SacrificeOptionalItem(Witchery.Items.GENERIC.itemWaystoneBound.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.volcano"); + RiteRegistry.addRecipe(78, 48, new RiteCurseCreature(true, "witcheryWakingNightmare", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), Witchery.Items.GENERIC.itemMellifluousHunger.createStack(), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()), new SacrificePower(10000.0f, 20)), EnumSet.of(RitualTraits.ONLY_IN_STROM), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.cursenightmare"); + RiteRegistry.addRecipe(79, 49, new RiteCurseCreature(false, "witcheryWakingNightmare", 1), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Items.golden_carrot), Witchery.Items.GENERIC.itemTormentedTwine.createStack(), Witchery.Items.GENERIC.itemBrewOfLove.createStack()), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.curenightmare"); + RiteRegistry.addRecipe(80, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemBrewOfSoaring.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemInfusionBase.createStack(), Witchery.Items.GENERIC.itemBroom.createStack(), new ItemStack(Items.feather), new ItemStack(Witchery.Items.ARTHANA)), new SacrificeLiving(EntityOwl.class), new SacrificePower(3000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusebrewsoaring"); + RiteRegistry.addRecipe(81, 35, new RiteSummonItem(Witchery.Items.GENERIC.itemBrewGrave.createStack(), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemInfusionBase.createStack(), new ItemStack(Items.bone), Witchery.Items.GENERIC.itemWeb.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack()), new SacrificeLiving(EntityZombie.class), new SacrificePower(3000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusebrewgrave"); + RiteRegistry.addRecipe(82, 36, new RiteSummonItem(new ItemStack(Witchery.Items.SPECTRAL_STONE), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemNecroStone.createStack(), Witchery.Items.GENERIC.itemCongealedSpirit.createStack(), Witchery.Items.GENERIC.itemCondensedFear.createStack(), Witchery.Items.GENERIC.itemSpectralDust.createStack(), new ItemStack(Witchery.Items.BOLINE)), new SacrificePower(6000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.spectralstone").setConsumeNecroStone(); + RiteRegistry.addRecipe(83, 1, new RiteSummonSpectralStone(5), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Items.SPECTRAL_STONE), Witchery.Items.GENERIC.itemSpectralDust.createStack(), new ItemStack(Witchery.Items.BOLINE)), new SacrificePower(5000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.bindspectral"); + RiteRegistry.addRecipe(84, 1, new RiteBindSpiritsToFetish(5), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.FETISH_SCARECROW), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Witchery.Items.BOLINE)), new SacrificePower(6000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.bindfetish"); + RiteRegistry.addRecipe(85, 1, new RiteBindSpiritsToFetish(5), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.FETISH_TREANT_IDOL), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Witchery.Items.BOLINE)), new SacrificePower(6000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.bindfetish").setShowInBook(false); + RiteRegistry.addRecipe(86, 1, new RiteBindSpiritsToFetish(5), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.FETISH_WITCHS_LADDER), Witchery.Items.GENERIC.itemAttunedStone.createStack(), Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Witchery.Items.BOLINE)), new SacrificePower(6000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.bindfetish").setShowInBook(false); + RiteRegistry.addRecipe(87, 26, new RiteSummonCreature(EntityImp.class, false), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemRefinedEvil.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), new ItemStack(Items.ender_pearl), Witchery.Items.GENERIC.itemAttunedStone.createStack()), new SacrificePower(5000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.summonimp"); + RiteRegistry.addRecipe(88, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystonePlayerBound.createStack(), RiteSummonItem.Binding.ENTITY), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.slime_ball), new ItemStack(Items.snowball)), new SacrificePower(500.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.bindwaystonetoplayer"); + RiteRegistry.addRecipe(89, 1, new RiteSummonItem(Witchery.Items.GENERIC.itemWaystonePlayerBound.createStack(), RiteSummonItem.Binding.ENTITY), new SacrificeItem(Witchery.Items.GENERIC.itemWaystone.createStack(), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.slime_ball), Witchery.Items.GENERIC.itemIcyNeedle.createStack(), Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.bindwaystonetoplayer"); + RiteRegistry.addRecipe(90, 1, new RiteSummonItem(new ItemStack(Witchery.Blocks.STATUE_OF_WORSHIP), RiteSummonItem.Binding.PLAYER), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.STATUE_OF_WORSHIP), Witchery.Items.GENERIC.itemBelladonnaFlower.createStack(), new ItemStack((Block)Blocks.red_flower), new ItemStack((Block)Blocks.yellow_flower)), new SacrificePower(4000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.bindstatuetoplayer"); + RiteRegistry.addRecipe(91, 5, new RiteTeleportToWaystone(3), new SacrificeItem(Witchery.Items.GENERIC.itemWaystonePlayerBound.createStack()), EnumSet.noneOf(RitualTraits.class), new Circle(0, 16, 0)).setUnlocalizedName("witchery.rite.teleporttowaystone"); + RiteRegistry.addRecipe(92, 48, new RiteCurseOfTheWolf(true), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(), new ItemStack(Witchery.Blocks.WOLFHEAD, 1, 1), Witchery.Items.GENERIC.itemWolfsbane.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewGrotesque.createStack()), new SacrificePower(10000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(0, 0, 28)).setUnlocalizedName("witchery.rite.wolfcurse.book"); + RiteRegistry.addRecipe(93, 49, new RiteCurseOfTheWolf(false), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Witchery.Items.SILVER_SWORD), Witchery.Items.GENERIC.itemWolfsbane.createStack(), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewOfLove.createStack()), new SacrificePower(10000.0f, 20)), EnumSet.of(RitualTraits.ONLY_AT_NIGHT), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.wolfcure.book"); + RiteRegistry.addRecipe(94, 49, new RiteRemoveVampirism(), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), Witchery.Items.GENERIC.itemBreathOfTheGoddess.createStack(), new ItemStack(Witchery.Items.SILVER_SWORD), new ItemStack(Witchery.Items.SEEDS_GARLIC), new ItemStack(Items.diamond), Witchery.Items.GENERIC.itemBrewOfLove.createStack()), new SacrificePower(10000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.vampirecure.book"); + RiteRegistry.addRecipe(95, 35, new RiteSummonItem(new ItemStack(Witchery.Items.MIRROR), RiteSummonItem.Binding.NONE), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemBrewOfHollowTears.createStack(), new ItemStack(Items.gold_ingot), new ItemStack(Blocks.glass_pane)), new SacrificePower(2000.0f, 20), new SacrificeLiving(EntityDemon.class)), EnumSet.noneOf(RitualTraits.class), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.infusionmirror"); + RiteRegistry.addRecipe(96, 28, new RiteSummonCreature(EntityReflection.class, false), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Items.MIRROR), Witchery.Items.GENERIC.itemEnderDew.createStack(), new ItemStack(Items.blaze_powder), Witchery.Items.GENERIC.itemQuartzSphere.createStack()), new SacrificePower(5000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.summonreflection"); + RiteRegistry.addRecipe(97, 200, new RiteHorrocrux(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.nether_star), new ItemStack(Items.diamond), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1)), new SacrificeLiving(EntityVillager.class), new SacrificePower(10000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16), new Circle(0, 28, 0), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.horrocrux"); + RiteRegistry.addRecipe(98, 201, new RiteMorsmordre(), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemDemonHeart.createStack(), new ItemStack(Items.gunpowder), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1)), new SacrificePower(10000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16), new Circle(0, 0, 28), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.morsmordre"); + RiteRegistry.addRecipe(99, 202, new RiteDementorKiss(), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemSpectralDust.createStack(), new ItemStack(Items.bone), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1)), new SacrificePower(8000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 28, 0), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.dementorkiss"); + RiteRegistry.addRecipe(100, 203, new RiteSoulThief(), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Items.potionitem, 1, 8270), new ItemStack(Items.gold_ingot), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1)), new SacrificePower(5000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 28, 0), new Circle(0, 28, 0), new Circle(0, 28, 0)).setUnlocalizedName("witchery.rite.soulthief"); + RiteRegistry.addRecipe(101, 204, new RiteAnnihilation(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.redstone), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), Witchery.Items.GENERIC.itemAttunedStone.createStack()), new SacrificePower(20000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16), new Circle(0, 0, 28), new Circle(40, 0, 0)).setUnlocalizedName("witchery.rite.annihilation"); + RiteRegistry.addRecipe(102, 205, new RiteFidelio(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.obsidian, 4), Witchery.Items.GENERIC.itemDropOfLuck.createStack(), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1)), new SacrificePower(30000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0), new Circle(40, 0, 0)).setUnlocalizedName("witchery.rite.fidelio"); + RiteRegistry.addRecipe(103, 206, new RiteUnbreakableVow(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.gold_nugget, 2), new ItemStack((Item)Items.potionitem, 1, 8197)), new SacrificePower(5000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0), new Circle(0, 0, 40)).setUnlocalizedName("witchery.rite.unbreakablevow"); + RiteRegistry.addRecipe(104, 207, new RiteSecretGuardian(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.iron_block), Witchery.Items.GENERIC.itemSpectralDust.createStack(), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack()), new SacrificePower(6000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0)).setUnlocalizedName("witchery.rite.secretguardian"); + RiteRegistry.addRecipe(105, 208, new RiteLegilimency(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Items.spider_eye), new ItemStack(Items.redstone), new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1)), new SacrificePower(2000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 16, 0), new Circle(0, 28, 0)).setUnlocalizedName("witchery.rite.legilimency"); + RiteRegistry.addRecipe(106, 209, new RitePhilosopherStone(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Blocks.dirt), new ItemStack(Blocks.stone), new ItemStack(Items.glass_bottle)), new SacrificeLiving(EntityVillager.class), new SacrificePower(15000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0), new Circle(0, 28, 0)).setUnlocalizedName("witchery.rite.philosopherstone"); + RiteRegistry.addRecipe(107, 210, new RitePromisedLand(), new SacrificeMultiple(new SacrificeItem(new ItemStack(Witchery.Blocks.SAPLING, 1, 0), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.water_bucket)), new SacrificePower(10000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0), new Circle(28, 0, 0), new Circle(40, 0, 0)).setUnlocalizedName("witchery.rite.promisedland"); + //RiteRegistry.addRecipe(108, 211, new RiteSummonEntity(), new SacrificeMultiple(new SacrificeItem(new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1), new ItemStack(Items.ender_pearl))), EnumSet.noneOf(RitualTraits.class), new Circle(0, 16, 0)).setUnlocalizedName("witchery.rite.summonentity"); + //RiteRegistry.addReclacipe(109, 212, new RiteDimensionalPocket(), new SacrificeMultiple(new SacrificeItem(new ItemStack((Block)Blocks.chest), Witchery.Items.GENERIC.itemSpectralDust.createStack(), new ItemStack(Items.gold_ingot))), EnumSet.noneOf(RitualTraits.class), new Circle(0, 16, 0)).setUnlocalizedName("witchery.rite.dimensionalpocket"); + //RiteRegistry.addRecipe(110, 213, new RitePathGhost(16), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemSpectralDust.createStack(), Witchery.Items.GENERIC.itemWeb.createStack(), new ItemStack(Items.string)), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.pathghost"); + //RiteRegistry.addRecipe(111, 214, new RitePathDemon(16), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemDemonHeart.createStack(), Witchery.Items.GENERIC.itemInfernalBlood.createStack(), new ItemStack(Items.blaze_powder)), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(0, 0, 16)).setUnlocalizedName("witchery.rite.pathdemon"); + //RiteRegistry.addRecipe(112, 215, new RitePathLich(16), new SacrificeMultiple(new SacrificeItem(Witchery.Items.GENERIC.itemNecroStone.createStack(), new ItemStack(Items.bone), new ItemStack(Items.rotten_flesh)), new SacrificePower(1000.0f, 20)), EnumSet.noneOf(RitualTraits.class), new Circle(16, 0, 0)).setUnlocalizedName("witchery.rite.pathlich"); + + + PredictionManager.instance().addPrediction(new PredictionFight(1, 13, 0.05, "witchery.prediction.zombie", EntityZombie.class, false)); + PredictionManager.instance().addPrediction(new PredictionArrow(2, 13, 0.05, "witchery.prediction.arrowhit")); + PredictionManager.instance().addPrediction(new PredictionFight(3, 3, 0.05, "witchery.prediction.ent", EntityEnt.class, false)); + PredictionManager.instance().addPrediction(new PredictionFall(4, 13, 0.05, "witchery.prediction.fall")); + PredictionManager.instance().addPrediction(new PredictionMultiMine(5, 8, 0.05, "witchery.prediction.iron", 1212, 0.01, Blocks.iron_ore, new ItemStack(Blocks.iron_ore), 8, 20)); + PredictionManager.instance().addPrediction(new PredictionMultiMine(6, 3, 0.05, "witchery.prediction.diamond", 1208, 0.01, Blocks.stone, new ItemStack(Items.diamond), 1, 1)); + PredictionManager.instance().addPrediction(new PredictionMultiMine(7, 3, 0.05, "witchery.prediction.emerald", 1208, 0.01, Blocks.stone, new ItemStack(Items.emerald), 1, 1)); + PredictionManager.instance().addPrediction(new PredictionBuriedTreasure(8, 2, 0.05, "witchery.prediction.treasure", 1210, 0.01, "mineshaftCorridor")); + PredictionManager.instance().addPrediction(new PredictionFallInLove(9, 2, 0.05, "witchery.prediction.love", 1210, 0.01)); + PredictionManager.instance().addPrediction(new PredictionFight(10, 2, 0.05, "witchery.prediction.bababad", EntityBabaYaga.class, false)); + PredictionManager.instance().addPrediction(new PredictionFight(11, 2, 0.05, "witchery.prediction.babagood", EntityBabaYaga.class, true)); + PredictionManager.instance().addPrediction(new PredictionFight(12, 3, 0.05, "witchery.prediction.friend", EntityWolf.class, true)); + PredictionManager.instance().addPrediction(new PredictionRescue(13, 13, 0.05, "witchery.prediction.rescued", 1208, 0.01, EntityOwl.class)); + PredictionManager.instance().addPrediction(new PredictionRescue(14, 13, 0.05, "witchery.prediction.rescued", 1208, 0.01, EntityWolf.class)); + PredictionManager.instance().addPrediction(new PredictionWet(15, 13, 0.05, "witchery.prediction.wet")); + PredictionManager.instance().addPrediction(new PredictionNetherTrip(16, 3, 0.05, "witchery.prediction.tothenether")); + PredictionManager.instance().addPrediction(new PredictionMultiMine(17, 13, 0.05, "witchery.prediction.coal", 1208, 0.01, Blocks.coal_ore, new ItemStack(Items.coal), 10, 20)); + } + + public void init() { + ArrayList silverIngots; + ItemStack dust = Witchery.Items.GENERIC.itemSilverDust.createStack(); + ArrayList silverDust = OreDictionary.getOres((String)"dustSilver"); + if (silverDust != null && !silverDust.isEmpty()) { + GameRegistry.addShapelessRecipe((ItemStack)((ItemStack)silverDust.get(0)).copy(), (Object[])new Object[]{dust, dust, dust, dust, dust, dust, dust, dust, dust}); + } + if ((silverIngots = OreDictionary.getOres((String)"ingotSilver")) != null && !silverIngots.isEmpty()) { + Item[][] hunterItems; + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Items.SILVER_SWORD), new Object[]{"s", "s", "b", Character.valueOf('s'), "ingotSilver", Character.valueOf('b'), new ItemStack(Items.golden_sword)})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(Witchery.Items.GENERIC.itemBoltSilver.createStack(6), new Object[]{" s ", "bbb", "bbb", Character.valueOf('s'), "ingotSilver", Character.valueOf('b'), Witchery.Items.GENERIC.itemBoltStake.createStack()})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(Witchery.Blocks.WOLFTRAP), new Object[]{"sns", "w#w", "sns", Character.valueOf('#'), new ItemStack(Witchery.Blocks.BEARTRAP), Character.valueOf('s'), "ingotSilver", Character.valueOf('n'), Witchery.Items.GENERIC.itemNullCatalyst.createStack(), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack()})); + Item[][] arr$ = hunterItems = new Item[][]{{Witchery.Items.HUNTER_BOOTS, Witchery.Items.HUNTER_BOOTS_SILVERED}, {Witchery.Items.HUNTER_LEGS, Witchery.Items.HUNTER_LEGS_SILVERED}, {Witchery.Items.HUNTER_COAT, Witchery.Items.HUNTER_COAT_SILVERED}, {Witchery.Items.HUNTER_HAT, Witchery.Items.HUNTER_HAT_SILVERED}}; + int len$ = hunterItems.length; + for (int i$ = 0; i$ < len$; ++i$) { + Item[] hunterItem = arr$[i$]; + ShapedOreRecipe recipe = new ShapedOreRecipe(new ItemStack(hunterItem[1]), new Object[]{"dwd", "w#w", "dsd", Character.valueOf('#'), new ItemStack(hunterItem[0]), Character.valueOf('s'), new ItemStack(Items.string), Character.valueOf('w'), Witchery.Items.GENERIC.itemWolfsbane.createStack(), Character.valueOf('d'), "ingotSilver"}){ + + public ItemStack getCraftingResult(InventoryCrafting inv) { + ItemStack result = this.getRecipeOutput().copy(); + for (int i = 0; i < inv.getSizeInventory(); ++i) { + ItemStack material = inv.getStackInSlot(i); + if (material == null || !material.hasTagCompound()) continue; + result.setTagCompound((NBTTagCompound)material.stackTagCompound.copy()); + } + return result; + } + }; + GameRegistry.addRecipe((IRecipe)recipe); + } + } + } + + public void postInit() { + if (Config.instance().smeltAllSaplingsToWoodAsh) { + ArrayList saplingTypes = OreDictionary.getOres((String)"treeSapling"); + for (Object obj : saplingTypes) { + ItemStack stack = (ItemStack)obj; + if (stack != null) { + GameRegistry.addSmelting(stack.copy(), (ItemStack)Witchery.Items.GENERIC.itemAshWood.createStack(), (float)0.0f); + } + } + } + } + + private void addPlantMineRecipe(int damageValue, ItemStack plant, ItemStack brew) { + GameRegistry.addRecipe((ItemStack)new ItemStack(Witchery.Blocks.TRAPPED_PLANT, 4, damageValue), (Object[])new Object[]{"ccc", "bab", Character.valueOf('a'), plant, Character.valueOf('b'), new ItemStack(Blocks.stone_pressure_plate), Character.valueOf('c'), brew}); + } + + private static ShapedRecipes getShapedRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { + String s = ""; + int i = 0; + int j = 0; + int k = 0; + if (par2ArrayOfObj[i] instanceof String[]) { + String[] hashmap = (String[])par2ArrayOfObj[i++]; + for (int aitemstack = 0; aitemstack < hashmap.length; ++aitemstack) { + String shapedrecipes = hashmap[aitemstack]; + ++k; + j = shapedrecipes.length(); + s = s + shapedrecipes; + } + } else { + while (par2ArrayOfObj[i] instanceof String) { + String var11 = (String)par2ArrayOfObj[i++]; + ++k; + j = var11.length(); + s = s + var11; + } + } + HashMap var10 = new HashMap(); + while (i < par2ArrayOfObj.length) { + Character var13 = (Character)par2ArrayOfObj[i]; + ItemStack var14 = null; + if (par2ArrayOfObj[i + 1] instanceof Item) { + var14 = new ItemStack((Item)par2ArrayOfObj[i + 1]); + } else if (par2ArrayOfObj[i + 1] instanceof Block) { + var14 = new ItemStack((Block)par2ArrayOfObj[i + 1], 1, Short.MAX_VALUE); + } else if (par2ArrayOfObj[i + 1] instanceof ItemStack) { + var14 = (ItemStack)par2ArrayOfObj[i + 1]; + } + var10.put(var13, var14); + i += 2; + } + ItemStack[] var12 = new ItemStack[j * k]; + for (int var15 = 0; var15 < j * k; ++var15) { + char c0 = s.charAt(var15); + var12[var15] = var10.containsKey(Character.valueOf(c0)) ? ((ItemStack)var10.get(Character.valueOf(c0))).copy() : null; + } + ShapedRecipes var16 = new ShapedRecipes(j, k, var12, par1ItemStack); + return var16; + } +} + diff --git a/src/main/java/com/emoniph/witchery/blocks/BlockBrazier.java b/src/main/java/com/emoniph/witchery/blocks/BlockBrazier.java index b37436c..f1e2027 100644 --- a/src/main/java/com/emoniph/witchery/blocks/BlockBrazier.java +++ b/src/main/java/com/emoniph/witchery/blocks/BlockBrazier.java @@ -424,39 +424,49 @@ public void updateEntity() { BrazierRecipes.BrazierRecipe recipe = BrazierRecipes.instance().getRecipe(new ItemStack[]{this.slots[0], this.slots[1], this.slots[2]}); IPowerSource powerSource; if(recipe != null && this.getStackInSlot(3) != null) { - powerSource = this.getPowerSource(); - if(powerSource != null && !powerSource.isLocationEqual(this.powerSourceCoord)) { - this.powerSourceCoord = powerSource.getLocation(); + if (super.worldObj.isBlockIndirectlyGettingPowered(super.xCoord, super.yCoord, super.zCoord)) { + if (this.powerLevel > 0) { + this.powerLevel = 0; + super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord); + } } else { - this.powerSourceCoord = null; - } - - boolean needsPower = recipe.getNeedsPower(); - this.powerLevel = needsPower && powerSource == null?0:1; - if(recipe.getNeedsPower() && (powerSource == null || !powerSource.consumePower(1.0F))) { - this.powerLevel = 0; - if(powered != this.powerLevel > 0) { - update = true; + powerSource = this.getPowerSource(); + if(powerSource != null && !powerSource.isLocationEqual(this.powerSourceCoord)) { + this.powerSourceCoord = powerSource.getLocation(); + } else { + this.powerSourceCoord = null; } - } else { - update = this.furnaceCookTime == 0; - ++this.furnaceCookTime; - if((long)this.furnaceCookTime == (long)recipe.burnTicks + this.storage * 400L) { + + boolean needsPower = recipe.getNeedsPower(); + this.powerLevel = needsPower && powerSource == null?0:1; + if(recipe.getNeedsPower() && (powerSource == null || !powerSource.consumePower(1.0F))) { + this.powerLevel = 0; + if(powered != this.powerLevel > 0) { + update = true; + } + } else { + update = this.furnaceCookTime == 0; + ++this.furnaceCookTime; + if (recipe.burnTicks == -1 && this.furnaceCookTime > 1000) { + this.furnaceCookTime = 1; + } + if(recipe.burnTicks >= 0 && (long)this.furnaceCookTime == (long)recipe.burnTicks + this.storage * 400L) { this.furnaceCookTime = 0; recipe.onBurnt(super.worldObj, super.xCoord, super.yCoord, super.zCoord, super.ticks, this); this.setInventorySlotContents(0, (ItemStack)null); this.setInventorySlotContents(1, (ItemStack)null); this.setInventorySlotContents(2, (ItemStack)null); update = true; - } else { - this.storage += (long)recipe.onBurning(super.worldObj, super.xCoord, super.yCoord, super.zCoord, super.ticks, this); - if(this.storage == Long.MAX_VALUE) { - this.storage = 0L; + } else { + this.storage += (long)recipe.onBurning(super.worldObj, super.xCoord, super.yCoord, super.zCoord, super.ticks, this); + if(this.storage == Long.MAX_VALUE) { + this.storage = 0L; + } } - } - if(powered != this.powerLevel > 0) { - update = true; + if(powered != this.powerLevel > 0) { + update = true; + } } } } else { diff --git a/src/main/java/com/emoniph/witchery/blocks/BlockFetish.java b/src/main/java/com/emoniph/witchery/blocks/BlockFetish.java index 02c7cc7..08c831a 100644 --- a/src/main/java/com/emoniph/witchery/blocks/BlockFetish.java +++ b/src/main/java/com/emoniph/witchery/blocks/BlockFetish.java @@ -93,6 +93,10 @@ public void getSubBlocks(Item item, CreativeTabs tabs, List list) { list.add(InfusedSpiritEffect.setEffect(new ItemStack(item, 1, 0), InfusedSpiritEffect.GHOST_WALKER)); } + if(Item.getItemFromBlock(Witchery.Blocks.FETISH_SCARECROW) == item) { + list.add(InfusedSpiritEffect.setEffect(new ItemStack(item, 1, 0), InfusedSpiritEffect.CURSE_BRINGER)); + } + } public void onBlockAdded(World world, int posX, int posY, int posZ) { diff --git a/src/main/java/com/emoniph/witchery/blocks/BlockFlooFire.java b/src/main/java/com/emoniph/witchery/blocks/BlockFlooFire.java new file mode 100644 index 0000000..95c87fe --- /dev/null +++ b/src/main/java/com/emoniph/witchery/blocks/BlockFlooFire.java @@ -0,0 +1,103 @@ +package com.emoniph.witchery.blocks; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.WitcheryCreativeTab; +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.util.BlockUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFire; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFlooFire extends BlockFire { + + public BlockFlooFire() { + super(); + this.setTickRandomly(true); + this.setLightLevel(1.0F); + this.setHardness(0.0F); + this.setStepSound(Block.soundTypeCloth); + this.setCreativeTab(WitcheryCreativeTab.INSTANCE); + } + + public Block setBlockName(String blockName) { + BlockUtil.registerBlock(this, blockName); + return super.setBlockName(blockName); + } + + public boolean canPlaceBlockAt(World world, int x, int y, int z) { + return World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) || world.getBlock(x, y - 1, z) == Blocks.netherrack; + } + + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { + if(!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && world.getBlock(x, y - 1, z) != Blocks.netherrack) { + world.setBlockToAir(x, y, z); + } + + } + + public void updateTick(World world, int x, int y, int z, Random rand) { + // The verdant Floo flame does NOT spread like normal fire; it simply dies out over time. + if(!world.isRemote) { + if(!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && world.getBlock(x, y - 1, z) != Blocks.netherrack) { + world.setBlockToAir(x, y, z); + } else if(rand.nextInt(4) == 0) { + world.setBlockToAir(x, y, z); + } else { + world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); + } + } + + } + + public int tickRate(World world) { + return 40; + } + + public void onBlockAdded(World world, int x, int y, int z) { + world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); + } + + public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { + if(!world.isRemote && entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)entity; + ItemStack held = player.getHeldItem(); + if(held != null && (Witchery.Items.GENERIC.itemWaystone.isMatch(held) || Witchery.Items.GENERIC.itemWaystoneBound.isMatch(held)) && ItemGeneral.isWaystoneBound(held)) { + if(Witchery.Items.GENERIC.teleportToLocation(world, held, player, 0, true)) { + // The Waystone is the destination key, never consumed. + world.setBlockToAir(x, y, z); + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, player, 0.5D, 1.0D, 32); + } + } + } + + } + + public int colorMultiplier(IBlockAccess world, int x, int y, int z) { + return 5308749; + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World world, int x, int y, int z, Random rand) { + if(rand.nextInt(24) == 0) { + world.playSound((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), "fire.fire", 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false); + } + + for(int i = 0; i < 4; ++i) { + double d0 = (double)((float)x + rand.nextFloat()); + double d1 = (double)((float)y + rand.nextFloat() * 0.5F + 0.2F); + double d2 = (double)((float)z + rand.nextFloat()); + world.spawnParticle("happyVillager", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/blocks/BlockStatueOfWorship.java b/src/main/java/com/emoniph/witchery/blocks/BlockStatueOfWorship.java index a02d9c1..5c974b6 100644 --- a/src/main/java/com/emoniph/witchery/blocks/BlockStatueOfWorship.java +++ b/src/main/java/com/emoniph/witchery/blocks/BlockStatueOfWorship.java @@ -276,7 +276,7 @@ public void updateEntity() { super.updateEntity(); if(!super.worldObj.isRemote && this.hasOwner()) { boolean PULSE_INTERVAL_IN_SECS = true; - if(TimeUtil.secondsElapsed(5, super.ticks)) { + if(TimeUtil.secondsElapsed(2, super.ticks)) { int worshipCount = this.updateWorshippersAndGetLevel(); EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(this.owner); if(player != null) { @@ -284,17 +284,16 @@ public void updateEntity() { boolean WORSHIP_LEVEL_1 = true; boolean WORSHIP_LEVEL_2 = true; boolean WORSHIP_LEVEL_3 = true; - if(worshipCount >= 5) { + if(worshipCount >= 1) { boolean GODS_SUMMON_CHANCE = true; boolean RECHARGE_RADIUS_SQ = true; - if(player.getDistanceSq(0.5D + (double)super.xCoord, 0.5D + (double)super.yCoord, 0.5D + (double)super.zCoord) <= 4096.0D) { - int currentEnergy = Infusion.getCurrentEnergy(player); - int maxEnergy = Infusion.getMaxEnergy(player); - if(currentEnergy < maxEnergy) { - boolean ENERGY_PER_PULSE = true; - Infusion.setCurrentEnergy(player, Math.min(currentEnergy + 30, maxEnergy)); - ParticleEffect.INSTANT_SPELL.send(SoundEffect.NOTE_PLING, player, 1.0D, 2.0D, 8); - } + int currentEnergy = Infusion.getCurrentEnergy(player); + int maxEnergy = Infusion.getMaxEnergy(player); + if(currentEnergy < maxEnergy) { + boolean ENERGY_PER_PULSE = true; + // Give 40 energy multiplied by the number of worshipping hobgoblins + Infusion.setCurrentEnergy(player, Math.min(currentEnergy + (40 * worshipCount), maxEnergy)); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.NOTE_PLING, player, 1.0D, 2.0D, 8); } } diff --git a/src/main/java/com/emoniph/witchery/blocks/BlockWitchesOven.java b/src/main/java/com/emoniph/witchery/blocks/BlockWitchesOven.java index 40e55b0..5c3e339 100644 --- a/src/main/java/com/emoniph/witchery/blocks/BlockWitchesOven.java +++ b/src/main/java/com/emoniph/witchery/blocks/BlockWitchesOven.java @@ -533,7 +533,18 @@ private boolean canSmelt() { return false; } else { Item item = itemstack.getItem(); - if(item != Items.coal && !(item instanceof ItemFood) && !Witchery.Items.GENERIC.itemAshWood.isMatch(itemstack)) { + boolean isValidResult = item == Items.coal || item instanceof ItemFood || Witchery.Items.GENERIC.itemAshWood.isMatch(itemstack) || Witchery.Items.GENERIC.itemEmptyClayJar.isMatch(itemstack); + if (!isValidResult && item instanceof com.emoniph.witchery.item.ItemGeneral) isValidResult = true; + if (!isValidResult) { + int[] ids = net.minecraftforge.oredict.OreDictionary.getOreIDs(this.furnaceItemStacks[0]); + for (int id : ids) { + if (net.minecraftforge.oredict.OreDictionary.getOreName(id).equals("treeSapling")) { + isValidResult = true; + break; + } + } + } + if(!isValidResult) { return false; } else if(this.furnaceItemStacks[2] == null) { return true; diff --git a/src/main/java/com/emoniph/witchery/brewing/DispersalTriggered.java b/src/main/java/com/emoniph/witchery/brewing/DispersalTriggered.java index a5f7b49..4b7f1cb 100644 --- a/src/main/java/com/emoniph/witchery/brewing/DispersalTriggered.java +++ b/src/main/java/com/emoniph/witchery/brewing/DispersalTriggered.java @@ -56,6 +56,12 @@ public void onImpactSplashPotion(World world, NBTTagCompound nbtBrew, MovingObje return; } + if(block == Witchery.Blocks.GLYPH_RITUAL || block == Witchery.Blocks.GLYPH_OTHERWHERE || block == Witchery.Blocks.GLYPH_INFERNAL) { + if(impregnateItemsAbove(world, coord.x, coord.y, coord.z, nbtBrew)) { + return; + } + } + if(block.hasTileEntity(coord.getBlockMetadata(world))) { TileEntityCursedBlock y = (TileEntityCursedBlock)BlockUtil.getTileEntity(world, coord.x, coord.y, coord.z, TileEntityCursedBlock.class); if(y != null) { @@ -96,6 +102,10 @@ public String getUnlocalizedName() { } public RitualStatus onUpdateRitual(World world, int x, int y, int z, NBTTagCompound nbtBrew, ModifiersRitual modifiers, ModifiersImpact impactModifiers) { + return impregnateItemsAbove(world, x, y, z, nbtBrew)?RitualStatus.COMPLETE:RitualStatus.FAILED; + } + + public static boolean impregnateItemsAbove(World world, int x, int y, int z, NBTTagCompound nbtBrew) { AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)x, (double)(y + 1), (double)z, (double)(x + 1), (double)(y + 2), (double)(z + 1)); List items = world.getEntitiesWithinAABB(EntityItem.class, bounds); Iterator i$ = items.iterator(); @@ -104,7 +114,7 @@ public RitualStatus onUpdateRitual(World world, int x, int y, int z, NBTTagCompo ItemStack stack; do { if(!i$.hasNext()) { - return RitualStatus.FAILED; + return false; } item = (EntityItem)i$.next(); @@ -147,7 +157,7 @@ public RitualStatus onUpdateRitual(World world, int x, int y, int z, NBTTagCompo } ParticleEffect.EXPLODE.send(SoundEffect.RANDOM_ORB, item, 0.5D, 0.5D, 16); - return RitualStatus.COMPLETE; + return true; } public static class EventHooks { diff --git a/src/main/java/com/emoniph/witchery/brewing/WitcheryBrewRegistry.java b/src/main/java/com/emoniph/witchery/brewing/WitcheryBrewRegistry.java index 73bf590..dce0c2f 100644 --- a/src/main/java/com/emoniph/witchery/brewing/WitcheryBrewRegistry.java +++ b/src/main/java/com/emoniph/witchery/brewing/WitcheryBrewRegistry.java @@ -40,6 +40,7 @@ import com.emoniph.witchery.brewing.action.effect.BrewActionBlight; import com.emoniph.witchery.brewing.action.effect.BrewActionFelling; import com.emoniph.witchery.brewing.action.effect.BrewActionLilify; +import com.emoniph.witchery.brewing.action.effect.BrewActionRegrowth; import com.emoniph.witchery.brewing.action.effect.BrewActionPlanting; import com.emoniph.witchery.brewing.action.effect.BrewActionRaiseLand; import com.emoniph.witchery.brewing.action.effect.BrewActionRaising; @@ -370,6 +371,7 @@ public void applyToEntity(World world, EntityLivingBase targetEntity, ModifiersE this.register(new BrewPotionEffect(Witchery.Items.GENERIC.itemEnderDew.getBrewItemKey(), new BrewNamePart("witchery:potion.enderinhibition"), new AltarPower(200), new Probability(1.0D), Witchery.Potions.ENDER_INHIBITION, (long)TimeUtil.secsToTicks(90), new EffectLevel(1))); this.register(new BrewPotionEffect(new BrewItemKey(Items.wheat), new BrewNamePart("witchery:brew.moonshine"), new AltarPower(0), new Probability(1.0D), Witchery.Potions.FEEL_NO_PAIN, (long)TimeUtil.secsToTicks(90), new EffectLevel(1))); + this.register(new BrewActionEffect(new BrewItemKey(Items.coal), new BrewNamePart("witchery:brew.extinguish"), new AltarPower(0), new Probability(1.0D), new EffectLevel(1)) { protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { if(modifiers.getStrength() > 1 || !world.provider.isHellWorld) { @@ -588,6 +590,7 @@ public void onBlock(World world, int x, int y, int z) { } }); this.register(new BrewActionLilify(new BrewItemKey(Blocks.waterlily), new BrewNamePart("witchery:brew.lilify"), new AltarPower(200), new EffectLevel(1))); + this.register(new BrewActionRegrowth(new BrewItemKey(Items.melon_seeds), new BrewNamePart("witchery:brew.regrowth"), new AltarPower(200), new Probability(1.0D), new EffectLevel(1))); this.register(new BrewPotionEffect(Witchery.Items.GENERIC.itemWolfsbane.getBrewItemKey(), new BrewNamePart("witchery:potion.wolfsbane"), new AltarPower(0), new Probability(1.0D), Witchery.Potions.WOLFSBANE, (long)TimeUtil.secsToTicks(60), new EffectLevel(1))); this.register(new BrewActionEffect(Witchery.Items.GENERIC.itemPurifiedMilk.getBrewItemKey(), new BrewNamePart("witchery:brew.removedebuffs"), new AltarPower(200), new Probability(1.0D), new EffectLevel(2)) { protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { @@ -1374,6 +1377,7 @@ protected void doApplyToEntity(World world, EntityLivingBase targetEntity, Modif this.register(new BrewCurseEffect(new BrewItemKey(Items.rotten_flesh), new BrewNamePart("witchery:potion.diseased"), new AltarPower(2000), new Probability(1.0D), Witchery.Potions.DISEASED, (long)TimeUtil.minsToTicks(3), new EffectLevel(4), false)); this.register(new BrewCurseEffect(Witchery.Items.GENERIC.itemDisturbedCotton.getBrewItemKey(), new BrewNamePart("witchery:brew.sinking"), new AltarPower(3000), new Probability(1.0D), Witchery.Potions.SINKING, (long)TimeUtil.minsToTicks(3), new EffectLevel(4), false)); this.register(new BrewCurseEffect(new BrewItemKey(Witchery.Blocks.EMBER_MOSS), new BrewNamePart("witchery:brew.overheating"), new AltarPower(3000), new Probability(1.0D), Witchery.Potions.OVERHEATING, (long)TimeUtil.minsToTicks(3), new EffectLevel(4), false)); + this.register(new BrewCurseEffect(new BrewItemKey(Blocks.glass), new BrewNamePart("witchery:brew.brittle"), new AltarPower(2500), new Probability(1.0D), Witchery.Potions.BRITTLE, (long)TimeUtil.minsToTicks(2), new EffectLevel(4), false)); this.register(new BrewCurseEffect(Witchery.Items.GENERIC.itemMellifluousHunger.getBrewItemKey(), new BrewNamePart("witchery:brew.wakingnightmare"), new AltarPower(10000), new Probability(1.0D), Witchery.Potions.WAKING_NIGHTMARE, (long)TimeUtil.minsToTicks(3), new EffectLevel(4), false)); this.register(new BrewPotionEffect(Witchery.Items.GENERIC.itemToeOfFrog.getBrewItemKey(), new BrewNamePart("witchery:brew.frogsleg"), new AltarPower(500), new Probability(1.0D), Witchery.Potions.DOUBLE_JUMP, (long)TimeUtil.minsToTicks(6), new EffectLevel(4))); this.register(new BrewPotionEffect(new BrewItemKey(Items.golden_apple), new BrewNamePart("witchery:brew.absorbsion"), new AltarPower(1000), new Probability(1.0D), Potion.field_76444_x, (long)TimeUtil.secsToTicks(30), new EffectLevel(4))); @@ -1834,6 +1838,101 @@ public void prepareRitual(World world, int x, int y, int z, ModifiersRitual modi this.register(new BrewActionRitualRecipe(new BrewItemKey(Witchery.Items.WITCH_HAND), new AltarPower(0), new BrewActionRitualRecipe.Recipe[]{new BrewActionRitualRecipe.Recipe(new ItemStack(Items.rotten_flesh, 6), new ItemStack[0])})); this.register(new BrewActionRitualRecipe(Witchery.Items.GENERIC.itemTormentedTwine.getBrewItemKey(), new AltarPower(4000), new BrewActionRitualRecipe.Recipe[]{new BrewActionRitualRecipe.Recipe(new ItemStack(Witchery.Blocks.PIT_GRASS, 4), new ItemStack[]{new ItemStack(Items.nether_wart), new ItemStack(Blocks.dirt), new ItemStack(Blocks.yellow_flower)}), new BrewActionRitualRecipe.Recipe(new ItemStack(Witchery.Blocks.PIT_DIRT, 4), new ItemStack[]{Witchery.Items.GENERIC.itemMandrakeRoot.createStack(), new ItemStack(Blocks.dirt)})})); this.register(new BrewActionRitualRecipe(new BrewItemKey(Items.compass), new AltarPower(5000), new BrewActionRitualRecipe.Recipe[]{new BrewActionRitualRecipe.Recipe(new ItemStack(Witchery.Items.PLAYER_COMPASS), new ItemStack[]{new ItemStack(Items.nether_wart), Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), new ItemStack(Blocks.vine), new ItemStack(Items.spider_eye)})})); + this.register(new BrewPotionEffect(new BrewItemKey(Blocks.glass_pane), new BrewNamePart("witchery:brew.phasewalk", "witchery:brew.rooted"), new AltarPower(1500), new Probability(1.0D), Witchery.Potions.PHASE_WALK, (long)TimeUtil.secsToTicks(45), Witchery.Potions.ROOTED, (long)TimeUtil.secsToTicks(20), new EffectLevel(6))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.melon), new BrewNamePart("witchery:brew.lifesteal", "witchery:brew.frailty"), new AltarPower(1500), new Probability(1.0D), Witchery.Potions.LIFESTEAL, (long)TimeUtil.secsToTicks(60), Witchery.Potions.FRAILTY, (long)TimeUtil.secsToTicks(60), new EffectLevel(5))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.fire_charge), new BrewNamePart("witchery:brew.berserk", "witchery:brew.pacified"), new AltarPower(1500), new Probability(1.0D), Witchery.Potions.BERSERK, (long)TimeUtil.secsToTicks(60), Witchery.Potions.PACIFIED, (long)TimeUtil.secsToTicks(20), new EffectLevel(5))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.experience_bottle), new BrewNamePart("witchery:brew.manasiphon"), new AltarPower(2000), new Probability(1.0D), Witchery.Potions.MANA_SIPHON, (long)TimeUtil.secsToTicks(45), new EffectLevel(6))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.name_tag), new BrewNamePart("witchery:brew.comprehension", "witchery:brew.provoke"), new AltarPower(1000), new Probability(1.0D), Witchery.Potions.COMPREHENSION, (long)TimeUtil.minsToTicks(3), Witchery.Potions.PROVOKE, (long)TimeUtil.secsToTicks(60), new EffectLevel(4))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.glass_bottle), new BrewNamePart("witchery:brew.spectralsight"), new AltarPower(500), new Probability(1.0D), Witchery.Potions.SPECTRAL_SIGHT, (long)TimeUtil.minsToTicks(2), new EffectLevel(2))); + this.register(new BrewActionEffect(new BrewItemKey(Blocks.stonebrick), new BrewNamePart("witchery:brew.petrify"), new AltarPower(2000), new Probability(1.0D), new EffectLevel(6)) { + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if(!world.isRemote && !(targetEntity instanceof IBossDisplayData)) { + int ticks = modifiers.getModifiedDuration(TimeUtil.secsToTicks(6)); + targetEntity.addPotionEffect(new PotionEffect(Witchery.Potions.ROOTED.id, ticks, modifiers.getStrength(), modifiers.noParticles)); + targetEntity.addPotionEffect(new PotionEffect(Potion.weakness.id, ticks, modifiers.getStrength())); + if(modifiers.getStrength() >= 2) { + targetEntity.addPotionEffect(new PotionEffect(Potion.resistance.id, ticks, 4)); + targetEntity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, ticks, 4)); + } + + SoundEffect.RANDOM_FIZZ.playAt(world, targetEntity.posX, targetEntity.posY, targetEntity.posZ, 1.0F, 0.6F); + } + + } + }); + this.register(new BrewActionEffect(new BrewItemKey(Blocks.packed_ice), new BrewNamePart("witchery:brew.glaciate"), new AltarPower(750), new Probability(1.0D), new EffectLevel(4)) { + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if(!world.isRemote) { + BrewPotionEffect.applyPotionEffect(targetEntity, modifiers, Witchery.Potions.CHILLED, TimeUtil.secsToTicks(30), modifiers.noParticles, modifiers.caster); + } + + } + protected void doApplyToBlock(World world, int x, int y, int z, ForgeDirection side, final int radius, final ModifiersEffect modifiers, ItemStack stack) { + (new BlockActionCircle() { + public void onBlock(World world, int x, int y, int z) { + for(int dy = y - radius; dy <= y + radius; ++dy) { + Block block = world.getBlock(x, dy, z); + if(block.getMaterial() == Material.water && BlockProtect.checkModsForBreakOK(world, x, dy, z, block, world.getBlockMetadata(x, dy, z), modifiers.caster)) { + world.setBlock(x, dy, z, modifiers.getStrength() >= 1?Blocks.packed_ice:Blocks.ice); + } else if(block.getMaterial() == Material.lava && modifiers.getStrength() >= 2 && BlockProtect.checkModsForBreakOK(world, x, dy, z, block, world.getBlockMetadata(x, dy, z), modifiers.caster)) { + world.setBlock(x, dy, z, world.getBlockMetadata(x, dy, z) == 0?Blocks.obsidian:Blocks.cobblestone); + SoundEffect.RANDOM_FIZZ.playAt(world, (double)x, (double)dy, (double)z, 1.0F, 1.6F); + } + } + + } + }).processFilledCircle(world, x, y, z, radius + (modifiers.ritualised?4:0)); + } + }); + this.register(new BrewActionEffect(new BrewItemKey(Blocks.sandstone), new BrewNamePart("witchery:brew.glasswork"), new AltarPower(500), new Probability(1.0D), new EffectLevel(4)) { + protected void doApplyToBlock(World world, int x, int y, int z, ForgeDirection side, final int radius, final ModifiersEffect modifiers, ItemStack stack) { + (new BlockActionCircle() { + public void onBlock(World world, int x, int y, int z) { + for(int dy = y - radius; dy <= y + radius; ++dy) { + Block block = world.getBlock(x, dy, z); + if((block == Blocks.sand || block == Blocks.gravel || block == Blocks.sandstone) && BlockProtect.checkModsForBreakOK(world, x, dy, z, block, world.getBlockMetadata(x, dy, z), modifiers.caster) && BlockProtect.canBreak(block, world)) { + world.setBlock(x, dy, z, modifiers.getStrength() >= 1?Blocks.stained_glass:Blocks.glass, modifiers.getStrength() >= 1?world.rand.nextInt(16):0, 3); + SoundEffect.RANDOM_FIZZ.playAt(world, (double)x, (double)dy, (double)z, 1.0F, 1.8F); + } + } + + } + }).processFilledCircle(world, x, y, z, radius); + } + }); + this.register(new BrewActionEffect(new BrewItemKey(Items.clock), new BrewNamePart("witchery:brew.soultether"), new AltarPower(4000), new Probability(1.0D), new EffectLevel(8)) { + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if(!world.isRemote && !(targetEntity instanceof IBossDisplayData) && modifiers.caster != null && targetEntity != modifiers.caster) { + if(targetEntity.dimension == modifiers.caster.dimension) { + SoundEffect.WITCHERY_RANDOM_POOF.playAt(world, targetEntity.posX, targetEntity.posY, targetEntity.posZ, 1.0F, 1.0F); + targetEntity.setPositionAndUpdate(modifiers.caster.posX, modifiers.caster.posY, modifiers.caster.posZ); + SoundEffect.WITCHERY_RANDOM_POOF.playAt(world, modifiers.caster.posX, modifiers.caster.posY, modifiers.caster.posZ, 1.0F, 1.0F); + if(modifiers.getStrength() >= 1) { + targetEntity.addPotionEffect(new PotionEffect(Witchery.Potions.ROOTED.id, modifiers.getModifiedDuration(TimeUtil.secsToTicks(3)), 0)); + } + } + } + + } + }); + + // CUSTOM BREWS + this.register(new com.emoniph.witchery.brewing.action.effect.BrewActionSoulSwap(new BrewItemKey(Items.lead), new BrewNamePart("witchery:brew.soulswap"), new AltarPower(1000), new Probability(1.0D), new EffectLevel(4))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.bed), new BrewNamePart("witchery:brew.astralprojection"), new AltarPower(2000), new Probability(1.0D), Witchery.Potions.ASTRAL_PROJECTION, (long)com.emoniph.witchery.util.TimeUtil.secsToTicks(60), new EffectLevel(6))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.iron_door), new BrewNamePart("witchery:brew.banishment"), new AltarPower(3000), new Probability(1.0D), Witchery.Potions.BANISHMENT, (long)com.emoniph.witchery.util.TimeUtil.secsToTicks(30), new EffectLevel(8))); + this.register(new com.emoniph.witchery.brewing.action.effect.BrewActionVoodooLink(new BrewItemKey(Items.paper), new BrewNamePart("witchery:brew.voodoolink"), new AltarPower(2000), new Probability(1.0D), new EffectLevel(6))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.saddle), new BrewNamePart("witchery:brew.polymorph"), new AltarPower(1500), new Probability(1.0D), Witchery.Potions.POLYMORPH, (long)com.emoniph.witchery.util.TimeUtil.secsToTicks(60), new EffectLevel(6))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.iron_sword), new BrewNamePart("witchery:brew.frenzy"), new AltarPower(1500), new Probability(1.0D), Witchery.Potions.FRENZY, (long)com.emoniph.witchery.util.TimeUtil.secsToTicks(30), new EffectLevel(5))); + this.register(new com.emoniph.witchery.brewing.action.effect.BrewActionCovenCall(new BrewItemKey(Items.book), new BrewNamePart("witchery:brew.covencall"), new AltarPower(4000), new Probability(1.0D), new EffectLevel(6))); + + // NEW CUSTOM BREWS (Batch 2) + this.register(new com.emoniph.witchery.brewing.action.effect.BrewActionAmnesia(new BrewItemKey(Items.map), new BrewNamePart("witchery:brew.amnesia"), new AltarPower(1000), new Probability(1.0D), new EffectLevel(4))); + this.register(new com.emoniph.witchery.brewing.action.effect.BrewActionSpectralThief(new BrewItemKey(Items.shears), new BrewNamePart("witchery:brew.spectralthief"), new AltarPower(1500), new Probability(1.0D), new EffectLevel(5))); + this.register(new com.emoniph.witchery.brewing.action.effect.BrewActionDoppelganger(new BrewItemKey(Items.name_tag), new BrewNamePart("witchery:brew.doppelganger"), new AltarPower(2500), new Probability(1.0D), new EffectLevel(8))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.fishing_rod), new BrewNamePart("witchery:brew.etherealchains"), new AltarPower(2000), new Probability(1.0D), Witchery.Potions.ETHEREAL_CHAINS, (long)com.emoniph.witchery.util.TimeUtil.secsToTicks(30), new EffectLevel(6))); + this.register(new com.emoniph.witchery.brewing.action.effect.BrewActionMarionette(new BrewItemKey(Items.string), new BrewNamePart("witchery:brew.marionette"), new AltarPower(3000), new Probability(1.0D), new EffectLevel(8))); + this.register(new BrewPotionEffect(new BrewItemKey(Items.reeds), new BrewNamePart("witchery:brew.sirensong"), new AltarPower(2000), new Probability(1.0D), Witchery.Potions.SIREN_SONG, (long)com.emoniph.witchery.util.TimeUtil.secsToTicks(30), new EffectLevel(6))); + this.register(new BrewPotionEffect(new BrewItemKey(Blocks.sponge), new BrewNamePart("witchery:brew.silence"), new AltarPower(3000), new Probability(1.0D), Witchery.Potions.SILENCE, (long)com.emoniph.witchery.util.TimeUtil.secsToTicks(15), new EffectLevel(8))); } public List getRecipes() { diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionAmnesia.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionAmnesia.java new file mode 100644 index 0000000..23e939d --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionAmnesia.java @@ -0,0 +1,48 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import com.emoniph.witchery.brewing.ModifiersEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.Collections; + +public class BrewActionAmnesia extends BrewActionEffect { + + public BrewActionAmnesia(BrewItemKey itemKey, BrewNamePart namePart, AltarPower power, Probability prob, EffectLevel effectLevel) { + super(itemKey, namePart, power, prob, effectLevel); + } + + @Override + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if (!world.isRemote && targetEntity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) targetEntity; + ItemStack[] mainInv = player.inventory.mainInventory; + + ArrayList items = new ArrayList(); + for (int i = 0; i < mainInv.length; i++) { + items.add(mainInv[i]); + } + + Collections.shuffle(items); + + for (int i = 0; i < mainInv.length; i++) { + mainInv[i] = items.get(i); + } + + // Sync inventory to client + if (player instanceof net.minecraft.entity.player.EntityPlayerMP) { + ((net.minecraft.entity.player.EntityPlayerMP) player).sendContainerToPlayer(player.inventoryContainer); + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionCovenCall.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionCovenCall.java new file mode 100644 index 0000000..b16d688 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionCovenCall.java @@ -0,0 +1,36 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.ModifiersEffect; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import com.emoniph.witchery.entity.EntityCovenWitch; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BrewActionCovenCall extends BrewActionEffect { + + public BrewActionCovenCall(BrewItemKey itemKey, BrewNamePart namePart, AltarPower powerCost, Probability baseProbability, EffectLevel effectLevel) { + super(itemKey, namePart, powerCost, baseProbability, effectLevel); + } + + @Override + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if (!world.isRemote && targetEntity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) targetEntity; + int covenSize = EntityCovenWitch.getCovenSize(player); + + if (covenSize > 0) { + int toSummon = Math.min(covenSize, modifiers.getStrength() + 1); + for (int i = 0; i < toSummon; i++) { + EntityCovenWitch.summonCovenMember(world, player, 60); + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionDoppelganger.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionDoppelganger.java new file mode 100644 index 0000000..08081bf --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionDoppelganger.java @@ -0,0 +1,52 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import com.emoniph.witchery.brewing.ModifiersEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BrewActionDoppelganger extends BrewActionEffect { + + public BrewActionDoppelganger(BrewItemKey itemKey, BrewNamePart namePart, AltarPower power, Probability prob, EffectLevel effectLevel) { + super(itemKey, namePart, power, prob, effectLevel); + } + + @Override + protected void doApplyToBlock(World world, int x, int y, int z, ForgeDirection side, int radius, ModifiersEffect modifiers, ItemStack stack) { + spawnDoppelganger(world, x + 0.5D, y + 1.0D, z + 0.5D, modifiers.caster); + } + + @Override + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + spawnDoppelganger(world, targetEntity.posX, targetEntity.posY, targetEntity.posZ, modifiers.caster); + } + + private void spawnDoppelganger(World world, double x, double y, double z, EntityPlayer caster) { + if (!world.isRemote && caster != null) { + EntityZombie zombie = new EntityZombie(world); + zombie.setLocationAndAngles(x, y, z, caster.rotationYaw, caster.rotationPitch); + + for (int i = 0; i < 5; i++) { + ItemStack gear = caster.getEquipmentInSlot(i); + zombie.setCurrentItemOrArmor(i, gear != null ? gear.copy() : null); + zombie.setEquipmentDropChance(i, 0.0F); // Ensure no free dupes + } + + zombie.setCustomNameTag(caster.getCommandSenderName()); + world.spawnEntityInWorld(zombie); + + caster.addPotionEffect(new PotionEffect(Potion.invisibility.id, 200, 1)); // 10 seconds invis + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionMarionette.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionMarionette.java new file mode 100644 index 0000000..0c80b22 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionMarionette.java @@ -0,0 +1,33 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.ModifiersEffect; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class BrewActionMarionette extends BrewActionEffect { + + public BrewActionMarionette(BrewItemKey itemKey, BrewNamePart namePart, AltarPower powerCost, Probability baseProbability, EffectLevel effectLevel) { + super(itemKey, namePart, powerCost, baseProbability, effectLevel); + } + + @Override + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if (!world.isRemote && modifiers.caster != null && modifiers.caster != targetEntity) { + NBTTagCompound nbt = targetEntity.getEntityData(); + nbt.setLong("WitcheryMarionetteCasterMost", modifiers.caster.getUniqueID().getMostSignificantBits()); + nbt.setLong("WitcheryMarionetteCasterLeast", modifiers.caster.getUniqueID().getLeastSignificantBits()); + + targetEntity.addPotionEffect(new PotionEffect(Witchery.Potions.MARIONETTE.id, modifiers.getModifiedDuration(1200), modifiers.getStrength())); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionRegrowth.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionRegrowth.java new file mode 100644 index 0000000..ed2e741 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionRegrowth.java @@ -0,0 +1,70 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.ModifiersEffect; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import com.emoniph.witchery.util.BlockActionCircle; +import com.emoniph.witchery.util.BlockProtect; +import com.emoniph.witchery.util.BlockUtil; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BrewActionRegrowth extends BrewActionEffect { + + public BrewActionRegrowth(BrewItemKey itemKey, BrewNamePart namePart, AltarPower powerCost, Probability baseProbability, EffectLevel effectLevel) { + super(itemKey, namePart, powerCost, baseProbability, effectLevel); + } + + protected void doApplyToBlock(World world, int x, int y, int z, ForgeDirection side, int radius, final ModifiersEffect modifiers, ItemStack stack) { + if (BlockUtil.isReplaceableBlock(world, x, y, z)) { + --y; + } + + (new BlockActionCircle() { + public void onBlock(World world, int x, int y, int z) { + if (!BlockProtect.checkModsForBreakOK(world, x, y, z, modifiers.caster)) { + return; + } + Block ground = world.getBlock(x, y, z); + // Bring barren ground back to life. + if (ground == Blocks.dirt || ground == Blocks.sand || ground == Blocks.gravel) { + world.setBlock(x, y, z, Blocks.grass); + ground = Blocks.grass; + } + if (ground == Blocks.grass && world.isAirBlock(x, y + 1, z)) { + int roll = world.rand.nextInt(8); + if (roll == 0) { + world.setBlock(x, y + 1, z, Blocks.yellow_flower, 0, 3); + } else if (roll == 1) { + world.setBlock(x, y + 1, z, Blocks.red_flower, world.rand.nextInt(8), 3); + } else if (roll <= 4) { + world.setBlock(x, y + 1, z, Blocks.tallgrass, 1, 3); + } + } + } + }).processFilledCircle(world, x, y + 1, z, radius); + } + + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack actionStack) { + if (targetEntity instanceof EntityAnimal) { + // Nature's vigour: heal and hasten the breeding of beasts. + targetEntity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, modifiers.getStrength())); + EntityAnimal animal = (EntityAnimal)targetEntity; + if (!animal.isInLove() && !animal.isChild() && world.rand.nextInt(3) == 0) { + animal.func_146082_f((EntityPlayer)null); + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionSoulSwap.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionSoulSwap.java new file mode 100644 index 0000000..32f73fe --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionSoulSwap.java @@ -0,0 +1,50 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.ModifiersEffect; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.ParticleEffect; + +public class BrewActionSoulSwap extends BrewActionEffect { + + public BrewActionSoulSwap(BrewItemKey itemKey, BrewNamePart namePart, AltarPower powerCost, Probability baseProbability, EffectLevel effectLevel) { + super(itemKey, namePart, powerCost, baseProbability, effectLevel); + } + + @Override + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if (!world.isRemote && modifiers.caster != null && modifiers.caster != targetEntity && modifiers.caster.dimension == targetEntity.dimension) { + double casterX = modifiers.caster.posX; + double casterY = modifiers.caster.posY; + double casterZ = modifiers.caster.posZ; + float casterYaw = modifiers.caster.rotationYaw; + float casterPitch = modifiers.caster.rotationPitch; + + double targetX = targetEntity.posX; + double targetY = targetEntity.posY; + double targetZ = targetEntity.posZ; + float targetYaw = targetEntity.rotationYaw; + float targetPitch = targetEntity.rotationPitch; + + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, targetEntity, 1.0, 2.0, 16); + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, modifiers.caster, 1.0, 2.0, 16); + + modifiers.caster.setPositionAndRotation(targetX, targetY, targetZ, targetYaw, targetPitch); + modifiers.caster.setPositionAndUpdate(targetX, targetY, targetZ); + + targetEntity.setPositionAndRotation(casterX, casterY, casterZ, casterYaw, casterPitch); + targetEntity.setPositionAndUpdate(casterX, casterY, casterZ); + + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, targetEntity, 1.0, 2.0, 16); + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, modifiers.caster, 1.0, 2.0, 16); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionSpectralThief.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionSpectralThief.java new file mode 100644 index 0000000..288f09e --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionSpectralThief.java @@ -0,0 +1,32 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import com.emoniph.witchery.brewing.ModifiersEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BrewActionSpectralThief extends BrewActionEffect { + + public BrewActionSpectralThief(BrewItemKey itemKey, BrewNamePart namePart, AltarPower power, Probability prob, EffectLevel effectLevel) { + super(itemKey, namePart, power, prob, effectLevel); + } + + @Override + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if (!world.isRemote && modifiers.caster != null && targetEntity != modifiers.caster) { + ItemStack stolen = targetEntity.getEquipmentInSlot(0); + if (stolen != null) { + targetEntity.setCurrentItemOrArmor(0, null); + if (!modifiers.caster.inventory.addItemStackToInventory(stolen)) { + modifiers.caster.entityDropItem(stolen, 0.0F); + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionTranspose.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionTranspose.java index 613b623..b035069 100644 --- a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionTranspose.java +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionTranspose.java @@ -44,7 +44,7 @@ protected void doApplyRitualToBlock(World world, int x, int y, int z, ForgeDirec for(int dy = 0; dy < 3; ++dy) { for(int dx = -3; dx <= 3; ++dx) { for(int dz = -3; dz <= 3; ++dz) { - if(dx * dx + dy * dz < 9) { + if(dx * dx + dy * dy + dz * dz < 9) { int sx = midSource.x + dx; int sy = midSource.y + dy; int sz = midSource.z + dz; diff --git a/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionVoodooLink.java b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionVoodooLink.java new file mode 100644 index 0000000..38bd53d --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/action/effect/BrewActionVoodooLink.java @@ -0,0 +1,33 @@ +package com.emoniph.witchery.brewing.action.effect; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.brewing.AltarPower; +import com.emoniph.witchery.brewing.BrewItemKey; +import com.emoniph.witchery.brewing.BrewNamePart; +import com.emoniph.witchery.brewing.EffectLevel; +import com.emoniph.witchery.brewing.ModifiersEffect; +import com.emoniph.witchery.brewing.Probability; +import com.emoniph.witchery.brewing.action.BrewActionEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class BrewActionVoodooLink extends BrewActionEffect { + + public BrewActionVoodooLink(BrewItemKey itemKey, BrewNamePart namePart, AltarPower powerCost, Probability baseProbability, EffectLevel effectLevel) { + super(itemKey, namePart, powerCost, baseProbability, effectLevel); + } + + @Override + protected void doApplyToEntity(World world, EntityLivingBase targetEntity, ModifiersEffect modifiers, ItemStack stack) { + if (!world.isRemote && modifiers.caster != null && modifiers.caster != targetEntity) { + NBTTagCompound nbt = modifiers.caster.getEntityData(); + nbt.setLong("WitcheryVoodooTargetMost", targetEntity.getUniqueID().getMostSignificantBits()); + nbt.setLong("WitcheryVoodooTargetLeast", targetEntity.getUniqueID().getLeastSignificantBits()); + + modifiers.caster.addPotionEffect(new PotionEffect(Witchery.Potions.VOODOO_LINK.id, modifiers.getModifiedDuration(1200), modifiers.getStrength())); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionAstralProjection.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionAstralProjection.java new file mode 100644 index 0000000..7577a84 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionAstralProjection.java @@ -0,0 +1,73 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.item.ItemGeneral; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +public class PotionAstralProjection extends PotionBase { + + public PotionAstralProjection(int id, int color) { + super(id, false, color); + } + + @Override + public void applyAttributesModifiersToEntity(EntityLivingBase entity, BaseAttributeMap attributes, int amplifier) { + super.applyAttributesModifiersToEntity(entity, attributes, amplifier); + if (!entity.worldObj.isRemote) { + NBTTagCompound nbt = entity.getEntityData(); + if (!nbt.hasKey("WitcheryAstralX")) { + nbt.setDouble("WitcheryAstralX", entity.posX); + nbt.setDouble("WitcheryAstralY", entity.posY); + nbt.setDouble("WitcheryAstralZ", entity.posZ); + nbt.setInteger("WitcheryAstralDim", entity.dimension); + } + if (entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entity; + if (!player.capabilities.isCreativeMode) { + player.capabilities.allowFlying = true; + player.sendPlayerAbilities(); + } + } + entity.addPotionEffect(new PotionEffect(Potion.invisibility.id, 999999, 0, true)); + } + } + + @Override + public void removeAttributesModifiersFromEntity(EntityLivingBase entity, BaseAttributeMap attributes, int amplifier) { + super.removeAttributesModifiersFromEntity(entity, attributes, amplifier); + if (!entity.worldObj.isRemote) { + NBTTagCompound nbt = entity.getEntityData(); + if (nbt.hasKey("WitcheryAstralX")) { + double x = nbt.getDouble("WitcheryAstralX"); + double y = nbt.getDouble("WitcheryAstralY"); + double z = nbt.getDouble("WitcheryAstralZ"); + int dim = nbt.getInteger("WitcheryAstralDim"); + + nbt.removeTag("WitcheryAstralX"); + nbt.removeTag("WitcheryAstralY"); + nbt.removeTag("WitcheryAstralZ"); + nbt.removeTag("WitcheryAstralDim"); + + if (entity.dimension != dim) { + ItemGeneral.teleportToLocation(entity.worldObj, x, y, z, dim, entity, true); + } else { + entity.setPositionAndUpdate(x, y, z); + } + } + if (entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entity; + if (!player.capabilities.isCreativeMode) { + player.capabilities.allowFlying = false; + player.capabilities.isFlying = false; + player.sendPlayerAbilities(); + } + } + entity.removePotionEffect(Potion.invisibility.id); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionBanishment.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionBanishment.java new file mode 100644 index 0000000..b913b44 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionBanishment.java @@ -0,0 +1,51 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.nbt.NBTTagCompound; + +public class PotionBanishment extends PotionBase { + + public PotionBanishment(int id, int color) { + super(id, true, color); + } + + @Override + public void applyAttributesModifiersToEntity(EntityLivingBase entity, BaseAttributeMap attributes, int amplifier) { + super.applyAttributesModifiersToEntity(entity, attributes, amplifier); + if (!entity.worldObj.isRemote) { + NBTTagCompound nbt = entity.getEntityData(); + if (!nbt.hasKey("WitcheryBanishX")) { + nbt.setDouble("WitcheryBanishX", entity.posX); + nbt.setDouble("WitcheryBanishY", entity.posY); + nbt.setDouble("WitcheryBanishZ", entity.posZ); + nbt.setInteger("WitcheryBanishDim", entity.dimension); + } + ItemGeneral.teleportToLocation(entity.worldObj, entity.posX, entity.posY + 10, entity.posZ, -1, entity, true, ParticleEffect.PORTAL, SoundEffect.MOB_ENDERMEN_PORTAL); + } + } + + @Override + public void removeAttributesModifiersFromEntity(EntityLivingBase entity, BaseAttributeMap attributes, int amplifier) { + super.removeAttributesModifiersFromEntity(entity, attributes, amplifier); + if (!entity.worldObj.isRemote) { + NBTTagCompound nbt = entity.getEntityData(); + if (nbt.hasKey("WitcheryBanishX")) { + double x = nbt.getDouble("WitcheryBanishX"); + double y = nbt.getDouble("WitcheryBanishY"); + double z = nbt.getDouble("WitcheryBanishZ"); + int dim = nbt.getInteger("WitcheryBanishDim"); + + nbt.removeTag("WitcheryBanishX"); + nbt.removeTag("WitcheryBanishY"); + nbt.removeTag("WitcheryBanishZ"); + nbt.removeTag("WitcheryBanishDim"); + + ItemGeneral.teleportToLocation(entity.worldObj, x, y, z, dim, entity, true, ParticleEffect.PORTAL, SoundEffect.MOB_ENDERMEN_PORTAL); + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionBerserk.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionBerserk.java new file mode 100644 index 0000000..9ef6971 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionBerserk.java @@ -0,0 +1,34 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingHurt; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +public class PotionBerserk extends PotionBase implements IHandleLivingHurt { + + public PotionBerserk(int id, int color) { + super(id, color); + } + + public boolean handleAllHurtEvents() { + return true; + } + + public void onLivingHurt(World world, EntityLivingBase entity, LivingHurtEvent event, int amplifier) { + if(!world.isRemote && event.ammount > 0.0F) { + EntityLivingBase attacker = event.source.getEntity() != null && event.source.getEntity() instanceof EntityLivingBase?(EntityLivingBase)event.source.getEntity():null; + if(attacker != null && attacker != entity && !event.source.isProjectile() && attacker.isPotionActive(this.id)) { + int level = attacker.getActivePotionEffect(this).getAmplifier(); + event.ammount += event.ammount * 0.25F * (float)(level + 1); + } + + if(entity.isPotionActive(this.id) && !event.source.isUnblockable()) { + int defLevel = entity.getActivePotionEffect(this).getAmplifier(); + event.ammount += event.ammount * 0.2F * (float)(defLevel + 1); + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionBrittle.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionBrittle.java new file mode 100644 index 0000000..8b58b50 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionBrittle.java @@ -0,0 +1,31 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingHurt; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +public class PotionBrittle extends PotionBase implements IHandleLivingHurt { + + public PotionBrittle(int id, int color) { + super(id, true, color); + } + + protected boolean isDebuff() { + return true; + } + + public void onLivingHurt(World world, EntityLivingBase entity, LivingHurtEvent event, int amplifier) { + if (amplifier < 0) { + return; + } + // Brittle flesh: every wound bites deeper. + float multiplier = 1.0F + 0.5F * (float)(amplifier + 1); + event.ammount *= multiplier; + } + + public boolean handleAllHurtEvents() { + return false; + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionComprehension.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionComprehension.java new file mode 100644 index 0000000..aed5d2c --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionComprehension.java @@ -0,0 +1,24 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingSetAttackTarget; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; + +public class PotionComprehension extends PotionBase implements IHandleLivingSetAttackTarget { + + public PotionComprehension(int id, int color) { + super(id, color); + } + + public void onLivingSetAttackTarget(World world, EntityLiving entity, LivingSetAttackTargetEvent event, int amplifier) { + if(event.target != null && event.target instanceof EntityPlayer && !(entity instanceof IBossDisplayData) && event.target.isPotionActive(this.id)) { + entity.setAttackTarget((EntityLivingBase)null); + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionEtherealChains.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionEtherealChains.java new file mode 100644 index 0000000..b774a7b --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionEtherealChains.java @@ -0,0 +1,43 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import com.emoniph.witchery.item.ItemGeneral; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionEtherealChains extends PotionBase implements IHandleLivingUpdate { + + public PotionEtherealChains(int id, int color) { + super(id, true, color); + } + + @Override + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if (!world.isRemote) { + NBTTagCompound nbt = entity.getEntityData(); + + if (!nbt.hasKey("witcheryEtherealX")) { + nbt.setDouble("witcheryEtherealX", entity.posX); + nbt.setDouble("witcheryEtherealY", entity.posY); + nbt.setDouble("witcheryEtherealZ", entity.posZ); + } else { + double startX = nbt.getDouble("witcheryEtherealX"); + double startY = nbt.getDouble("witcheryEtherealY"); + double startZ = nbt.getDouble("witcheryEtherealZ"); + + if (entity.getDistanceSq(startX, startY, startZ) > 25.0D) { + ItemGeneral.teleportToLocation(world, startX, startY, startZ, entity.dimension, entity, true); + } + } + + if (duration <= 2) { + nbt.removeTag("witcheryEtherealX"); + nbt.removeTag("witcheryEtherealY"); + nbt.removeTag("witcheryEtherealZ"); + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionFrailty.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionFrailty.java new file mode 100644 index 0000000..75b8bb3 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionFrailty.java @@ -0,0 +1,33 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingHurt; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +public class PotionFrailty extends PotionBase implements IHandleLivingHurt { + + public PotionFrailty(int id, int color) { + super(id, true, color); + } + + public boolean handleAllHurtEvents() { + return true; + } + + public void onLivingHurt(World world, EntityLivingBase entity, LivingHurtEvent event, int amplifier) { + if(!world.isRemote && event.ammount > 0.0F && !event.source.isProjectile() && event.source != DamageSource.magic) { + EntityLivingBase attacker = event.source.getEntity() != null && event.source.getEntity() instanceof EntityLivingBase?(EntityLivingBase)event.source.getEntity():null; + if(attacker != null && attacker != entity && attacker.isPotionActive(this.id)) { + int level = attacker.getActivePotionEffect(this).getAmplifier(); + float recoil = event.ammount * 0.2F * (float)(level + 1); + if(recoil >= 1.0F) { + attacker.attackEntityFrom(DamageSource.magic, recoil); + } + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionFrenzy.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionFrenzy.java new file mode 100644 index 0000000..0285ee3 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionFrenzy.java @@ -0,0 +1,40 @@ +package com.emoniph.witchery.brewing.potions; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import java.util.List; + +public class PotionFrenzy extends PotionBase implements IHandleLivingUpdate { + + public PotionFrenzy(int id, int color) { + super(id, true, color); + } + + @Override + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if (!world.isRemote && entity instanceof EntityLiving && entity instanceof IMob) { + if (entity.ticksExisted % 20 == 0) { + EntityLiving mob = (EntityLiving) entity; + double radius = 10.0 + (amplifier * 2.0); + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, entity.boundingBox.expand(radius, radius, radius)); + + if (list != null && !list.isEmpty()) { + EntityLivingBase newTarget = null; + for (int i = 0; i < 5; i++) { + EntityLivingBase potential = list.get(world.rand.nextInt(list.size())); + if (potential != entity && mob.canEntityBeSeen(potential)) { + newTarget = potential; + break; + } + } + if (newTarget != null) { + mob.setAttackTarget(newTarget); + } + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionLifesteal.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionLifesteal.java new file mode 100644 index 0000000..64b33f0 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionLifesteal.java @@ -0,0 +1,32 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingHurt; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +public class PotionLifesteal extends PotionBase implements IHandleLivingHurt { + + public PotionLifesteal(int id, int color) { + super(id, color); + } + + public boolean handleAllHurtEvents() { + return true; + } + + public void onLivingHurt(World world, EntityLivingBase entity, LivingHurtEvent event, int amplifier) { + if(!world.isRemote && event.ammount > 0.0F && !event.source.isProjectile()) { + EntityLivingBase attacker = event.source.getEntity() != null && event.source.getEntity() instanceof EntityLivingBase?(EntityLivingBase)event.source.getEntity():null; + if(attacker != null && attacker != entity && attacker.isPotionActive(this.id)) { + int level = attacker.getActivePotionEffect(this).getAmplifier(); + float healed = event.ammount * 0.25F * (float)(level + 1); + if(healed > 0.0F) { + attacker.heal(Math.min(healed, attacker.getMaxHealth())); + } + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionManaSiphon.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionManaSiphon.java new file mode 100644 index 0000000..f88bf3f --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionManaSiphon.java @@ -0,0 +1,52 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionManaSiphon extends PotionBase implements IHandleLivingUpdate { + + public PotionManaSiphon(int id, int color) { + super(id, true, color); + } + + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if(!world.isRemote && world.getTotalWorldTime() % 40L == 0L) { + Collection active = entity.getActivePotionEffects(); + if(active != null && !active.isEmpty()) { + ArrayList toShorten = new ArrayList(); + Iterator i$ = active.iterator(); + + while(i$.hasNext()) { + PotionEffect effect = (PotionEffect)i$.next(); + int id = effect.getPotionID(); + if(id >= 0 && id < Potion.potionTypes.length && Potion.potionTypes[id] != null && id != this.id && !PotionBase.isDebuff(Potion.potionTypes[id]) && PotionBase.isCurable(Potion.potionTypes[id])) { + toShorten.add(effect); + } + } + + int drainPerTick = 20 * (amplifier + 1); + Iterator i$1 = toShorten.iterator(); + + while(i$1.hasNext()) { + PotionEffect effect = (PotionEffect)i$1.next(); + int remaining = effect.getDuration() - drainPerTick; + if(remaining <= 0) { + entity.removePotionEffect(effect.getPotionID()); + } else { + entity.removePotionEffect(effect.getPotionID()); + entity.addPotionEffect(new PotionEffect(effect.getPotionID(), remaining, effect.getAmplifier(), effect.getIsAmbient())); + } + } + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionMarionette.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionMarionette.java new file mode 100644 index 0000000..3298427 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionMarionette.java @@ -0,0 +1,52 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import java.util.UUID; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionMarionette extends PotionBase implements IHandleLivingUpdate { + + public PotionMarionette(int id, int color) { + super(id, true, color); + } + + @Override + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if (!world.isRemote) { + NBTTagCompound nbt = entity.getEntityData(); + if (nbt.hasKey("WitcheryMarionetteCasterMost") && nbt.hasKey("WitcheryMarionetteCasterLeast")) { + long most = nbt.getLong("WitcheryMarionetteCasterMost"); + long least = nbt.getLong("WitcheryMarionetteCasterLeast"); + UUID casterUUID = new UUID(most, least); + + EntityLivingBase caster = null; + for (Object obj : world.loadedEntityList) { + if (obj instanceof EntityLivingBase) { + EntityLivingBase living = (EntityLivingBase) obj; + if (living.getUniqueID().equals(casterUUID)) { + caster = living; + break; + } + } + } + + if (caster != null) { + entity.rotationYaw = caster.rotationYaw; + entity.rotationPitch = caster.rotationPitch; + entity.rotationYawHead = caster.rotationYawHead; + + double dx = caster.posX - caster.prevPosX; + double dz = caster.posZ - caster.prevPosZ; + + if (Math.abs(dx) > 0.01 || Math.abs(dz) > 0.01) { + entity.moveEntity(dx, 0, dz); + } + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionPacified.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionPacified.java new file mode 100644 index 0000000..6186b66 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionPacified.java @@ -0,0 +1,30 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingAttack; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingAttackEvent; + +public class PotionPacified extends PotionBase implements IHandleLivingAttack { + + public PotionPacified(int id, int color) { + super(id, true, color); + } + + public void onLivingAttack(World world, EntityLivingBase entity, LivingAttackEvent event, int amplifier) { + EntityLivingBase attacker = event.source.getEntity() != null && event.source.getEntity() instanceof EntityLivingBase?(EntityLivingBase)event.source.getEntity():null; + if(attacker != null && attacker.isPotionActive(this.id) && !(attacker instanceof IBossDisplayData)) { + int level = attacker.getActivePotionEffect(this).getAmplifier(); + if(!event.source.isProjectile() || level >= 1) { + event.setCanceled(true); + if(attacker instanceof EntityPlayer && level >= 2) { + attacker.attackEntityFrom(net.minecraft.util.DamageSource.magic, 1.0F); + } + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionPhaseWalk.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionPhaseWalk.java new file mode 100644 index 0000000..e11b026 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionPhaseWalk.java @@ -0,0 +1,47 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionPhaseWalk extends PotionBase implements IHandleLivingUpdate { + + public PotionPhaseWalk(int id, int color) { + super(id, color); + } + + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if(entity.isEntityInsideOpaqueBlock()) { + entity.setAir(300); + int x = MathHelper.floor_double(entity.posX); + int y = MathHelper.floor_double(entity.posY + (double)entity.getEyeHeight()); + int z = MathHelper.floor_double(entity.posZ); + double yaw = (double)(entity.rotationYaw + 90.0F) * Math.PI / 180.0D; + double dx = Math.cos(yaw); + double dz = Math.sin(yaw); + boolean clearAhead = isPassable(world, x + (int)Math.round(dx), y, z + (int)Math.round(dz)) && isPassable(world, x + (int)Math.round(dx), y - 1, z + (int)Math.round(dz)); + if(clearAhead) { + entity.motionX += dx * 0.18D; + entity.motionZ += dz * 0.18D; + } else { + entity.motionX -= dx * 0.18D; + entity.motionZ -= dz * 0.18D; + } + + if(amplifier >= 1 && entity instanceof EntityPlayer) { + entity.motionY += 0.08D; + } + } + + } + + private static boolean isPassable(World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); + return !block.getMaterial().isSolid() || !block.getMaterial().blocksMovement(); + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionPolymorph.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionPolymorph.java new file mode 100644 index 0000000..cf6739d --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionPolymorph.java @@ -0,0 +1,72 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.Witchery; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderLivingEvent.Pre; +import net.minecraftforge.client.event.RenderLivingEvent.Post; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import org.lwjgl.opengl.GL11; + +public class PotionPolymorph extends PotionBase implements IHandlePreRenderLiving, IHandleRenderLiving, IHandleLivingAttack { + + @SideOnly(Side.CLIENT) + private static EntityPig dummyPig; + @SideOnly(Side.CLIENT) + private static EntityChicken dummyChicken; + + public PotionPolymorph(int id, int color) { + super(id, true, color); + } + + @Override + @SideOnly(Side.CLIENT) + public void onLivingRender(World world, EntityLivingBase entity, Pre event, int amplifier) { + if (dummyPig == null || dummyPig.worldObj != world) { + dummyPig = new EntityPig(world); + } + if (dummyChicken == null || dummyChicken.worldObj != world) { + dummyChicken = new EntityChicken(world); + } + + event.setCanceled(true); + + EntityLivingBase dummyTarget = (entity.getEntityId() % 2 == 0) ? dummyPig : dummyChicken; + + dummyTarget.copyDataFrom(entity, true); + dummyTarget.renderYawOffset = entity.renderYawOffset; + dummyTarget.rotationYawHead = entity.rotationYawHead; + dummyTarget.prevRenderYawOffset = entity.prevRenderYawOffset; + dummyTarget.prevRotationYawHead = entity.prevRotationYawHead; + + GL11.glPushMatrix(); + RenderManager.instance.renderEntityWithPosYaw(dummyTarget, event.x, event.y, event.z, 0, 0.0f); + GL11.glPopMatrix(); + } + + @Override + @SideOnly(Side.CLIENT) + public void onLivingRender(World world, EntityLivingBase entity, Post event, int amplifier) { + } + + public boolean handleAllHurtEvents() { + return false; + } + + @Override + public void onLivingAttack(World world, EntityLivingBase entity, LivingAttackEvent event, int amplifier) { + if (!world.isRemote && event.source.getEntity() != null) { + if (event.source.getEntity() instanceof EntityLivingBase) { + EntityLivingBase attacker = (EntityLivingBase) event.source.getEntity(); + if (attacker.isPotionActive(this)) { + event.setCanceled(true); + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionProvoke.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionProvoke.java new file mode 100644 index 0000000..abfac31 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionProvoke.java @@ -0,0 +1,37 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionProvoke extends PotionBase implements IHandleLivingUpdate { + + public PotionProvoke(int id, int color) { + super(id, true, color); + } + + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if(!world.isRemote && entity instanceof EntityPlayer && world.getTotalWorldTime() % 20L == 0L) { + EntityPlayer player = (EntityPlayer)entity; + double range = (double)(8 + 4 * amplifier); + AxisAlignedBB bounds = player.boundingBox.expand(range, range, range); + List nearby = world.getEntitiesWithinAABB(EntityCreature.class, bounds); + if(nearby != null) { + for(int i = 0; i < nearby.size(); ++i) { + EntityCreature creature = (EntityCreature)nearby.get(i); + if(!(creature instanceof IBossDisplayData) && creature.getAttackTarget() == null && creature.getEntitySenses().canSee(player)) { + creature.setAttackTarget(player); + } + } + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionRooted.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionRooted.java new file mode 100644 index 0000000..5af53a5 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionRooted.java @@ -0,0 +1,46 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionRooted extends PotionBase implements IHandleLivingUpdate { + + public PotionRooted(int id, int color) { + super(id, true, color); + } + + public void postContructInitialize() { + this.func_111184_a(SharedMonsterAttributes.movementSpeed, "B17D31C2-7E44-4C0A-9F3E-2A0E8A4F1D6C", -100.0D, 2); + } + + public void applyAttributesModifiersToEntity(EntityLivingBase entity, BaseAttributeMap attributes, int amplifier) { + if(!(entity instanceof IBossDisplayData)) { + super.applyAttributesModifiersToEntity(entity, attributes, amplifier); + } + + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase entity, BaseAttributeMap attributes, int amplifier) { + if(!(entity instanceof IBossDisplayData)) { + super.removeAttributesModifiersFromEntity(entity, attributes, amplifier); + } + + } + + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if(!(entity instanceof IBossDisplayData)) { + entity.motionX = 0.0D; + entity.motionZ = 0.0D; + if(entity.onGround) { + entity.motionY = 0.0D; + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionSilence.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionSilence.java new file mode 100644 index 0000000..f9dd7aa --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionSilence.java @@ -0,0 +1,30 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionSilence extends PotionBase implements IHandleLivingUpdate { + + public PotionSilence(int id, int color) { + super(id, true, color); + } + + @Override + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if (!world.isRemote && entity.ticksExisted % 10 == 0) { + ItemStack heldItem = entity.getHeldItem(); + if (heldItem != null && heldItem.getItem() != null) { + String itemName = Item.itemRegistry.getNameForObject(heldItem.getItem()); + if (itemName != null && itemName.startsWith("witchery:")) { + entity.setCurrentItemOrArmor(0, null); + entity.entityDropItem(heldItem, 0.0F); + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionSirenSong.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionSirenSong.java new file mode 100644 index 0000000..6056e29 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionSirenSong.java @@ -0,0 +1,34 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +import java.util.List; + +public class PotionSirenSong extends PotionBase implements IHandleLivingUpdate { + + public PotionSirenSong(int id, int color) { + super(id, true, color); + } + + @Override + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if (!world.isRemote && entity.ticksExisted % 10 == 0) { + double radius = 16.0D; + List mobs = world.getEntitiesWithinAABB(EntityMob.class, entity.boundingBox.expand(radius, radius, radius)); + + for (Object obj : mobs) { + if (obj instanceof EntityMob) { + EntityMob mob = (EntityMob) obj; + mob.setAttackTarget(null); + mob.setTarget(null); + mob.getNavigator().tryMoveToEntityLiving(entity, 0.8D); + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionSpectralSight.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionSpectralSight.java new file mode 100644 index 0000000..8ec7fe4 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionSpectralSight.java @@ -0,0 +1,39 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.brewing.potions.IHandleLivingUpdate; +import com.emoniph.witchery.brewing.potions.PotionBase; +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + +public class PotionSpectralSight extends PotionBase implements IHandleLivingUpdate { + + public PotionSpectralSight(int id, int color) { + super(id, color); + } + + public void onLivingUpdate(World world, EntityLivingBase entity, LivingUpdateEvent event, int amplifier, int duration) { + if(entity instanceof EntityPlayer && world.getTotalWorldTime() % 10L == 0L) { + double range = (double)(6 + 3 * amplifier); + AxisAlignedBB bounds = entity.boundingBox.expand(range, range, range); + List nearby = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds); + if(nearby != null) { + for(int i = 0; i < nearby.size(); ++i) { + EntityLivingBase other = (EntityLivingBase)nearby.get(i); + if(other != entity && other.isInvisible()) { + for(int p = 0; p < 6; ++p) { + double ox = other.posX + (world.rand.nextDouble() - 0.5D) * (double)other.width; + double oy = other.posY + world.rand.nextDouble() * (double)other.height; + double oz = other.posZ + (world.rand.nextDouble() - 0.5D) * (double)other.width; + world.spawnParticle("witchMagic", ox, oy, oz, 0.0D, 0.0D, 0.0D); + } + } + } + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/PotionVoodooLink.java b/src/main/java/com/emoniph/witchery/brewing/potions/PotionVoodooLink.java new file mode 100644 index 0000000..9b4aa1a --- /dev/null +++ b/src/main/java/com/emoniph/witchery/brewing/potions/PotionVoodooLink.java @@ -0,0 +1,53 @@ +package com.emoniph.witchery.brewing.potions; + +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.UUID; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +public class PotionVoodooLink extends PotionBase implements IHandleLivingHurt { + + public PotionVoodooLink(int id, int color) { + super(id, true, color); + } + + @Override + public boolean handleAllHurtEvents() { + return false; + } + + @Override + public void onLivingHurt(World world, EntityLivingBase entity, LivingHurtEvent event, int amplifier) { + if (!world.isRemote && !event.isCanceled()) { + NBTTagCompound nbt = entity.getEntityData(); + if (nbt.hasKey("WitcheryVoodooTargetMost") && nbt.hasKey("WitcheryVoodooTargetLeast")) { + long most = nbt.getLong("WitcheryVoodooTargetMost"); + long least = nbt.getLong("WitcheryVoodooTargetLeast"); + UUID targetUUID = new UUID(most, least); + + EntityLivingBase target = null; + for (Object obj : world.loadedEntityList) { + if (obj instanceof EntityLivingBase) { + EntityLivingBase living = (EntityLivingBase) obj; + if (living.getUniqueID().equals(targetUUID)) { + target = living; + break; + } + } + } + + if (target != null && target != entity) { + target.attackEntityFrom(DamageSource.magic, event.ammount); + ParticleEffect.REDDUST.send(SoundEffect.DAMAGE_HIT, target, 1.0, 2.0, 16); + ParticleEffect.REDDUST.send(SoundEffect.NONE, entity, 1.0, 2.0, 16); + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/brewing/potions/WitcheryPotions.java b/src/main/java/com/emoniph/witchery/brewing/potions/WitcheryPotions.java index 2536a25..cc16fdf 100644 --- a/src/main/java/com/emoniph/witchery/brewing/potions/WitcheryPotions.java +++ b/src/main/java/com/emoniph/witchery/brewing/potions/WitcheryPotions.java @@ -16,9 +16,12 @@ import com.emoniph.witchery.brewing.potions.PotionAbsorbMagic; import com.emoniph.witchery.brewing.potions.PotionAttractProjectiles; import com.emoniph.witchery.brewing.potions.PotionBase; +import com.emoniph.witchery.brewing.potions.PotionBerserk; import com.emoniph.witchery.brewing.potions.PotionBrewingExpertise; +import com.emoniph.witchery.brewing.potions.PotionBrittle; import com.emoniph.witchery.brewing.potions.PotionChilled; import com.emoniph.witchery.brewing.potions.PotionColorful; +import com.emoniph.witchery.brewing.potions.PotionComprehension; import com.emoniph.witchery.brewing.potions.PotionDarknessAllergy; import com.emoniph.witchery.brewing.potions.PotionDiseased; import com.emoniph.witchery.brewing.potions.PotionEnderInhibition; @@ -27,6 +30,7 @@ import com.emoniph.witchery.brewing.potions.PotionFeelNoPain; import com.emoniph.witchery.brewing.potions.PotionFloating; import com.emoniph.witchery.brewing.potions.PotionFortune; +import com.emoniph.witchery.brewing.potions.PotionFrailty; import com.emoniph.witchery.brewing.potions.PotionGasMask; import com.emoniph.witchery.brewing.potions.PotionGrotesque; import com.emoniph.witchery.brewing.potions.PotionHellishAura; @@ -34,19 +38,26 @@ import com.emoniph.witchery.brewing.potions.PotionInsanity; import com.emoniph.witchery.brewing.potions.PotionKeepEffectsOnDeath; import com.emoniph.witchery.brewing.potions.PotionKeepInventory; +import com.emoniph.witchery.brewing.potions.PotionLifesteal; import com.emoniph.witchery.brewing.potions.PotionLove; +import com.emoniph.witchery.brewing.potions.PotionManaSiphon; import com.emoniph.witchery.brewing.potions.PotionMortalCoil; import com.emoniph.witchery.brewing.potions.PotionOverheating; +import com.emoniph.witchery.brewing.potions.PotionPacified; import com.emoniph.witchery.brewing.potions.PotionParalysis; +import com.emoniph.witchery.brewing.potions.PotionPhaseWalk; import com.emoniph.witchery.brewing.potions.PotionPoisonWeapons; +import com.emoniph.witchery.brewing.potions.PotionProvoke; import com.emoniph.witchery.brewing.potions.PotionQueasy; import com.emoniph.witchery.brewing.potions.PotionReflectDamage; import com.emoniph.witchery.brewing.potions.PotionReflectProjectiles; import com.emoniph.witchery.brewing.potions.PotionReincarnate; import com.emoniph.witchery.brewing.potions.PotionRepellAttacker; import com.emoniph.witchery.brewing.potions.PotionResizing; +import com.emoniph.witchery.brewing.potions.PotionRooted; import com.emoniph.witchery.brewing.potions.PotionSinking; import com.emoniph.witchery.brewing.potions.PotionSnowTrail; +import com.emoniph.witchery.brewing.potions.PotionSpectralSight; import com.emoniph.witchery.brewing.potions.PotionSpiked; import com.emoniph.witchery.brewing.potions.PotionSprouting; import com.emoniph.witchery.brewing.potions.PotionStoutBelly; @@ -55,6 +66,7 @@ import com.emoniph.witchery.brewing.potions.PotionVolatility; import com.emoniph.witchery.brewing.potions.PotionWakingNightmare; import com.emoniph.witchery.brewing.potions.PotionWorship; + import com.emoniph.witchery.brewing.potions.PotionWrappedInVine; import com.emoniph.witchery.common.ExtendedPlayer; import com.emoniph.witchery.infusion.Infusion; @@ -152,9 +164,31 @@ public class WitcheryPotions { public final Potion GAS_MASK = this.register("witchery:potion.gasmask", PotionGasMask.class); public final Potion DISEASED = this.register("witchery:potion.diseased", PotionDiseased.class); public final Potion FORTUNE = this.register("witchery:potion.fortune", PotionFortune.class); + public final Potion WORSHIP = this.register("witchery:potion.worship", PotionWorship.class); public final Potion KEEP_EFFECTS = this.register("witchery:potion.keepeffects", PotionKeepEffectsOnDeath.class); public final Potion WOLFSBANE = this.register("witchery:potion.wolfsbane", PotionBase.class); + public final Potion BRITTLE = this.register("witchery:potion.brittle", PotionBrittle.class); + public final Potion PHASE_WALK = this.register("witchery:potion.phasewalk", PotionPhaseWalk.class); + public final Potion ROOTED = this.register("witchery:potion.rooted", PotionRooted.class); + public final Potion LIFESTEAL = this.register("witchery:potion.lifesteal", PotionLifesteal.class); + public final Potion FRAILTY = this.register("witchery:potion.frailty", PotionFrailty.class); + public final Potion BERSERK = this.register("witchery:potion.berserk", PotionBerserk.class); + public final Potion PACIFIED = this.register("witchery:potion.pacified", PotionPacified.class); + public final Potion MANA_SIPHON = this.register("witchery:potion.manasiphon", PotionManaSiphon.class); + public final Potion COMPREHENSION = this.register("witchery:potion.comprehension", PotionComprehension.class); + public final Potion PROVOKE = this.register("witchery:potion.provoke", PotionProvoke.class); + public final Potion SPECTRAL_SIGHT = this.register("witchery:potion.spectralsight", PotionSpectralSight.class); + + public final Potion BANISHMENT = this.register("witchery:potion.banishment", PotionBanishment.class); + public final Potion ASTRAL_PROJECTION = this.register("witchery:potion.astralprojection", PotionAstralProjection.class); + public final Potion VOODOO_LINK = this.register("witchery:potion.voodoolink", PotionVoodooLink.class); + public final Potion POLYMORPH = this.register("witchery:potion.polymorph", PotionPolymorph.class); + public final Potion FRENZY = this.register("witchery:potion.frenzy", PotionFrenzy.class); + public final Potion ETHEREAL_CHAINS = this.register("witchery:potion.etherealchains", PotionEtherealChains.class); + public final Potion MARIONETTE = this.register("witchery:potion.marionette", PotionMarionette.class); + public final Potion SIREN_SONG = this.register("witchery:potion.sirensong", PotionSirenSong.class); + public final Potion SILENCE = this.register("witchery:potion.silence", PotionSilence.class); private Potion register(String unlocalisedName, Class clazz) { diff --git a/src/main/java/com/emoniph/witchery/client/ClientEvents.java b/src/main/java/com/emoniph/witchery/client/ClientEvents.java index 2dc00b5..19cc746 100644 --- a/src/main/java/com/emoniph/witchery/client/ClientEvents.java +++ b/src/main/java/com/emoniph/witchery/client/ClientEvents.java @@ -4,6 +4,7 @@ import com.emoniph.witchery.brewing.potions.ModelOverlayRenderer; import com.emoniph.witchery.brewing.potions.PotionResizing; import com.emoniph.witchery.client.TransformBat; +import com.emoniph.witchery.client.TransformSpirit; import com.emoniph.witchery.client.TransformOtherPlayer; import com.emoniph.witchery.client.TransformWolf; import com.emoniph.witchery.client.TransformWolfman; @@ -15,6 +16,10 @@ import com.emoniph.witchery.common.Shapeshift; import com.emoniph.witchery.dimension.WorldProviderDreamWorld; import com.emoniph.witchery.entity.EntityVillageGuard; +import com.emoniph.witchery.entity.EntityBanshee; +import com.emoniph.witchery.entity.EntitySpirit; +import com.emoniph.witchery.entity.EntityPoltergeist; +import com.emoniph.witchery.entity.EntityNightmare; import com.emoniph.witchery.infusion.Infusion; import com.emoniph.witchery.infusion.infusions.InfusionOtherwhere; import com.emoniph.witchery.util.Config; @@ -69,6 +74,7 @@ public class ClientEvents { TransformWolf wolf = new TransformWolf(); TransformWolfman wolfman = new TransformWolfman(); TransformBat bat = new TransformBat(); + TransformSpirit spirit = new TransformSpirit(); TransformOtherPlayer otherPlayer = new TransformOtherPlayer(); RenderVillagerBed renderBed = new RenderVillagerBed(); private static final ResourceLocation wolfSkin = new ResourceLocation("witchery", "textures/entities/werewolf_man.png"); @@ -238,6 +244,17 @@ public void onLivingJump(LivingJumpEvent event) { priority = EventPriority.HIGH ) public void onPlayerPreRender(net.minecraftforge.client.event.RenderLivingEvent.Pre event) { + EntityPlayer localPlayer = Minecraft.getMinecraft().thePlayer; + boolean canSeeSpirits = localPlayer != null && (localPlayer.dimension == Config.instance().dimensionDreamID || WorldProviderDreamWorld.getPlayerIsGhost(Infusion.getNBT(localPlayer)) || (ExtendedPlayer.get(localPlayer) != null && (ExtendedPlayer.get(localPlayer).isAstralProjecting() || ExtendedPlayer.get(localPlayer).getSpiritLevel() >= 1))); + + boolean isSpiritEntity = event.entity instanceof EntityBanshee || event.entity instanceof EntitySpirit || event.entity instanceof EntityPoltergeist || event.entity instanceof EntityNightmare; + boolean isGhostPlayer = event.entity instanceof EntityPlayer && (ExtendedPlayer.get((EntityPlayer)event.entity) != null && ExtendedPlayer.get((EntityPlayer)event.entity).isAstralProjecting() || WorldProviderDreamWorld.getPlayerIsGhost(Infusion.getNBT((EntityPlayer)event.entity))); + + if ((isSpiritEntity || isGhostPlayer) && !canSeeSpirits && event.entity != localPlayer) { + event.setCanceled(true); + return; + } + if(event.entity instanceof EntityVillager) { ExtendedVillager player = ExtendedVillager.get((EntityVillager)event.entity); GL11.glPushMatrix(); @@ -252,13 +269,20 @@ public void onPlayerPreRender(net.minecraftforge.client.event.RenderLivingEvent. } } else if(event.entity instanceof EntityPlayer) { EntityPlayer player1 = (EntityPlayer)event.entity; - if(WorldProviderDreamWorld.getPlayerIsGhost(Infusion.getNBT(player1))) { + ExtendedPlayer playerEx = ExtendedPlayer.get(player1); + if (playerEx != null && playerEx.isAstralProjecting()) { + RenderUtil.blend(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F); + } else if(WorldProviderDreamWorld.getPlayerIsGhost(Infusion.getNBT(player1))) { RenderUtil.blend(true); GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.51F); + } else if (playerEx != null && playerEx.getSpiritLevel() >= 7 && player1.isSneaking()) { + RenderUtil.blend(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F); } - - ExtendedPlayer playerEx = ExtendedPlayer.get(player1); - int creatureType = playerEx.getCreatureTypeOrdinal(); + + int creatureType = playerEx != null ? playerEx.getCreatureTypeOrdinal() : 0; + if(creatureType > 0 && !(event.renderer instanceof RenderOtherPlayer)) { event.setCanceled(true); PotionEffect pe = player1.getActivePotionEffect(Witchery.Potions.RESIZING); @@ -278,6 +302,8 @@ public void onPlayerPreRender(net.minecraftforge.client.event.RenderLivingEvent. this.wolfman.render(event.entity.worldObj, event.entity, event.x, event.y, event.z, event.renderer, partialTicks, gui1); } else if(creatureType == 3) { this.bat.render(event.entity.worldObj, event.entity, event.x, event.y, event.z, event.renderer, partialTicks, gui1); + } else if(creatureType == 6) { + this.spirit.render(event.entity.worldObj, event.entity, event.x, event.y, event.z, event.renderer, partialTicks, gui1); } else if(creatureType == 4 && playerEx.getOtherPlayerSkin() != null && !playerEx.getOtherPlayerSkin().equals("")) { this.otherPlayer.render(event.entity.worldObj, event.entity, event.x, event.y, event.z, event.renderer, partialTicks, gui1); } @@ -414,7 +440,8 @@ public void onPlayerPostRender(Post event) { GL11.glPopMatrix(); } else if(event.entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)event.entity; - if(WorldProviderDreamWorld.getPlayerIsGhost(Infusion.getNBT(player))) { + ExtendedPlayer playerEx = ExtendedPlayer.get(player); + if(WorldProviderDreamWorld.getPlayerIsGhost(Infusion.getNBT(player)) || (playerEx != null && playerEx.getSpiritLevel() >= 7 && player.isSneaking())) { RenderUtil.blend(false); } } diff --git a/src/main/java/com/emoniph/witchery/client/ClientProxy.java b/src/main/java/com/emoniph/witchery/client/ClientProxy.java index 979301d..7963768 100644 --- a/src/main/java/com/emoniph/witchery/client/ClientProxy.java +++ b/src/main/java/com/emoniph/witchery/client/ClientProxy.java @@ -1,483 +1,496 @@ -package com.emoniph.witchery.client; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockAlluringSkull; -import com.emoniph.witchery.blocks.BlockAltar; -import com.emoniph.witchery.blocks.BlockAltarGUI; -import com.emoniph.witchery.blocks.BlockAreaMarker; -import com.emoniph.witchery.blocks.BlockBeartrap; -import com.emoniph.witchery.blocks.BlockBloodCrucible; -import com.emoniph.witchery.blocks.BlockBrazier; -import com.emoniph.witchery.blocks.BlockCandelabra; -import com.emoniph.witchery.blocks.BlockChalice; -import com.emoniph.witchery.blocks.BlockCoffin; -import com.emoniph.witchery.blocks.BlockCrystalBall; -import com.emoniph.witchery.blocks.BlockDemonHeart; -import com.emoniph.witchery.blocks.BlockDistillery; -import com.emoniph.witchery.blocks.BlockDistilleryGUI; -import com.emoniph.witchery.blocks.BlockDreamCatcher; -import com.emoniph.witchery.blocks.BlockFetish; -import com.emoniph.witchery.blocks.BlockFumeFunnel; -import com.emoniph.witchery.blocks.BlockGarlicGarland; -import com.emoniph.witchery.blocks.BlockGrassper; -import com.emoniph.witchery.blocks.BlockKettle; -import com.emoniph.witchery.blocks.BlockLeechChest; -import com.emoniph.witchery.blocks.BlockMirror; -import com.emoniph.witchery.blocks.BlockPlacedItem; -import com.emoniph.witchery.blocks.BlockPoppetShelf; -import com.emoniph.witchery.blocks.BlockSilverVat; -import com.emoniph.witchery.blocks.BlockSpinningWheel; -import com.emoniph.witchery.blocks.BlockSpinningWheelGUI; -import com.emoniph.witchery.blocks.BlockStatueGoddess; -import com.emoniph.witchery.blocks.BlockStatueOfWorship; -import com.emoniph.witchery.blocks.BlockStatueWerewolf; -import com.emoniph.witchery.blocks.BlockWitchesOven; -import com.emoniph.witchery.blocks.BlockWitchesOvenGUI; -import com.emoniph.witchery.blocks.BlockWolfHead; -import com.emoniph.witchery.brewing.EntityBrew; -import com.emoniph.witchery.brewing.EntityDroplet; -import com.emoniph.witchery.brewing.EntitySplatter; -import com.emoniph.witchery.brewing.RenderBrew; -import com.emoniph.witchery.brewing.RenderBrewGas; -import com.emoniph.witchery.brewing.RenderBrewLiquid; -import com.emoniph.witchery.brewing.RenderCauldron; -import com.emoniph.witchery.brewing.RenderDroplet; -import com.emoniph.witchery.brewing.RenderSplatter; -import com.emoniph.witchery.brewing.RenderWitchVine; -import com.emoniph.witchery.brewing.TileEntityCauldron; -import com.emoniph.witchery.brewing.potions.WitcheryPotions; -import com.emoniph.witchery.client.ClientEvents; -import com.emoniph.witchery.client.gui.GuiScreenBiomeBook; -import com.emoniph.witchery.client.gui.GuiScreenMarkupBook; -import com.emoniph.witchery.client.gui.GuiScreenWitchcraftBook; -import com.emoniph.witchery.client.model.ModelDemon; -import com.emoniph.witchery.client.model.ModelEnt; -import com.emoniph.witchery.client.model.ModelFamiliarPig; -import com.emoniph.witchery.client.model.ModelGoblin; -import com.emoniph.witchery.client.model.ModelGoblinGulg; -import com.emoniph.witchery.client.model.ModelGoblinMog; -import com.emoniph.witchery.client.model.ModelHellhound; -import com.emoniph.witchery.client.model.ModelHornedAvatar; -import com.emoniph.witchery.client.model.ModelLeonard; -import com.emoniph.witchery.client.model.ModelLilith; -import com.emoniph.witchery.client.model.ModelMandrake; -import com.emoniph.witchery.client.model.ModelMonkey; -import com.emoniph.witchery.client.model.ModelOwl; -import com.emoniph.witchery.client.model.ModelToad; -import com.emoniph.witchery.client.model.ModelTreefyd; -import com.emoniph.witchery.client.model.ModelWolfman; -import com.emoniph.witchery.client.particle.NaturePowerFX; -import com.emoniph.witchery.client.renderer.RenderAlluringSkull; -import com.emoniph.witchery.client.renderer.RenderBabaYaga; -import com.emoniph.witchery.client.renderer.RenderBanshee; -import com.emoniph.witchery.client.renderer.RenderBeartrap; -import com.emoniph.witchery.client.renderer.RenderBlockItem; -import com.emoniph.witchery.client.renderer.RenderBloodCrucible; -import com.emoniph.witchery.client.renderer.RenderBolt; -import com.emoniph.witchery.client.renderer.RenderBrazier; -import com.emoniph.witchery.client.renderer.RenderBrewBottle; -import com.emoniph.witchery.client.renderer.RenderBroom; -import com.emoniph.witchery.client.renderer.RenderCandelabra; -import com.emoniph.witchery.client.renderer.RenderCaneSword; -import com.emoniph.witchery.client.renderer.RenderChalice; -import com.emoniph.witchery.client.renderer.RenderCoffin; -import com.emoniph.witchery.client.renderer.RenderCorpse; -import com.emoniph.witchery.client.renderer.RenderCovenWitch; -import com.emoniph.witchery.client.renderer.RenderCrystalBall; -import com.emoniph.witchery.client.renderer.RenderDarkMark; -import com.emoniph.witchery.client.renderer.RenderDeath; -import com.emoniph.witchery.client.renderer.RenderDeathsHand; -import com.emoniph.witchery.client.renderer.RenderDemon; -import com.emoniph.witchery.client.renderer.RenderDemonHeart; -import com.emoniph.witchery.client.renderer.RenderDistillery; -import com.emoniph.witchery.client.renderer.RenderDreamCatcher; -import com.emoniph.witchery.client.renderer.RenderEnt; -import com.emoniph.witchery.client.renderer.RenderFamiliar; -import com.emoniph.witchery.client.renderer.RenderFetish; -import com.emoniph.witchery.client.renderer.RenderFollower; -import com.emoniph.witchery.client.renderer.RenderFumeFunnel; -import com.emoniph.witchery.client.renderer.RenderGarlicGarland; -import com.emoniph.witchery.client.renderer.RenderGoblin; -import com.emoniph.witchery.client.renderer.RenderGoblinGulg; -import com.emoniph.witchery.client.renderer.RenderGoblinMog; -import com.emoniph.witchery.client.renderer.RenderGoddess; -import com.emoniph.witchery.client.renderer.RenderGrassper; -import com.emoniph.witchery.client.renderer.RenderGrenade; -import com.emoniph.witchery.client.renderer.RenderHandBow; -import com.emoniph.witchery.client.renderer.RenderHellhound; -import com.emoniph.witchery.client.renderer.RenderHornedAvatar; -import com.emoniph.witchery.client.renderer.RenderHuntsmanSpear; -import com.emoniph.witchery.client.renderer.RenderIllusion; -import com.emoniph.witchery.client.renderer.RenderImp; -import com.emoniph.witchery.client.renderer.RenderKettle; -import com.emoniph.witchery.client.renderer.RenderLeechChest; -import com.emoniph.witchery.client.renderer.RenderLeonard; -import com.emoniph.witchery.client.renderer.RenderLilith; -import com.emoniph.witchery.client.renderer.RenderLordOfTorment; -import com.emoniph.witchery.client.renderer.RenderMandrake; -import com.emoniph.witchery.client.renderer.RenderMindrake; -import com.emoniph.witchery.client.renderer.RenderMirror; -import com.emoniph.witchery.client.renderer.RenderMirrorFace; -import com.emoniph.witchery.client.renderer.RenderMysticBranch; -import com.emoniph.witchery.client.renderer.RenderNightmare; -import com.emoniph.witchery.client.renderer.RenderOwl; -import com.emoniph.witchery.client.renderer.RenderParasyticLouse; -import com.emoniph.witchery.client.renderer.RenderPitGrass; -import com.emoniph.witchery.client.renderer.RenderPlacedItem; -import com.emoniph.witchery.client.renderer.RenderPoltergeist; -import com.emoniph.witchery.client.renderer.RenderPoppetChest; -import com.emoniph.witchery.client.renderer.RenderReflection; -import com.emoniph.witchery.client.renderer.RenderSilverVat; -import com.emoniph.witchery.client.renderer.RenderSpectre; -import com.emoniph.witchery.client.renderer.RenderSpellEffect; -import com.emoniph.witchery.client.renderer.RenderSpinningWheel; -import com.emoniph.witchery.client.renderer.RenderSpirit; -import com.emoniph.witchery.client.renderer.RenderStatueMandrake; -import com.emoniph.witchery.client.renderer.RenderStatueOfWorship; -import com.emoniph.witchery.client.renderer.RenderStatueWerewolf; -import com.emoniph.witchery.client.renderer.RenderStatueWolf; -import com.emoniph.witchery.client.renderer.RenderStockade; -import com.emoniph.witchery.client.renderer.RenderToad; -import com.emoniph.witchery.client.renderer.RenderTreefyd; -import com.emoniph.witchery.client.renderer.RenderVampire; -import com.emoniph.witchery.client.renderer.RenderVillageGuard; -import com.emoniph.witchery.client.renderer.RenderWingedMonkey; -import com.emoniph.witchery.client.renderer.RenderWitchCat; -import com.emoniph.witchery.client.renderer.RenderWitchHand; -import com.emoniph.witchery.client.renderer.RenderWitchHunter; -import com.emoniph.witchery.client.renderer.RenderWitchProjectile; -import com.emoniph.witchery.client.renderer.RenderWitchesOven; -import com.emoniph.witchery.client.renderer.RenderWolfHead; -import com.emoniph.witchery.client.renderer.RenderWolfman; -import com.emoniph.witchery.common.CommonProxy; -import com.emoniph.witchery.entity.EntityAttackBat; -import com.emoniph.witchery.entity.EntityBabaYaga; -import com.emoniph.witchery.entity.EntityBanshee; -import com.emoniph.witchery.entity.EntityBolt; -import com.emoniph.witchery.entity.EntityBroom; -import com.emoniph.witchery.entity.EntityCorpse; -import com.emoniph.witchery.entity.EntityCovenWitch; -import com.emoniph.witchery.entity.EntityDarkMark; -import com.emoniph.witchery.entity.EntityDeath; -import com.emoniph.witchery.entity.EntityDemon; -import com.emoniph.witchery.entity.EntityEnt; -import com.emoniph.witchery.entity.EntityFamiliar; -import com.emoniph.witchery.entity.EntityFollower; -import com.emoniph.witchery.entity.EntityGoblin; -import com.emoniph.witchery.entity.EntityGoblinGulg; -import com.emoniph.witchery.entity.EntityGoblinMog; -import com.emoniph.witchery.entity.EntityGrenade; -import com.emoniph.witchery.entity.EntityHellhound; -import com.emoniph.witchery.entity.EntityHornedHuntsman; -import com.emoniph.witchery.entity.EntityIllusionCreeper; -import com.emoniph.witchery.entity.EntityIllusionSpider; -import com.emoniph.witchery.entity.EntityIllusionZombie; -import com.emoniph.witchery.entity.EntityImp; -import com.emoniph.witchery.entity.EntityLeonard; -import com.emoniph.witchery.entity.EntityLilith; -import com.emoniph.witchery.entity.EntityLordOfTorment; -import com.emoniph.witchery.entity.EntityLostSoul; -import com.emoniph.witchery.entity.EntityMandrake; -import com.emoniph.witchery.entity.EntityMindrake; -import com.emoniph.witchery.entity.EntityMirrorFace; -import com.emoniph.witchery.entity.EntityNightmare; -import com.emoniph.witchery.entity.EntityOwl; -import com.emoniph.witchery.entity.EntityParasyticLouse; -import com.emoniph.witchery.entity.EntityPoltergeist; -import com.emoniph.witchery.entity.EntityReflection; -import com.emoniph.witchery.entity.EntitySpectre; -import com.emoniph.witchery.entity.EntitySpellEffect; -import com.emoniph.witchery.entity.EntitySpirit; -import com.emoniph.witchery.entity.EntityToad; -import com.emoniph.witchery.entity.EntityTreefyd; -import com.emoniph.witchery.entity.EntityVampire; -import com.emoniph.witchery.entity.EntityVillageGuard; -import com.emoniph.witchery.entity.EntityVillagerWere; -import com.emoniph.witchery.entity.EntityWingedMonkey; -import com.emoniph.witchery.entity.EntityWitchCat; -import com.emoniph.witchery.entity.EntityWitchHunter; -import com.emoniph.witchery.entity.EntityWitchProjectile; -import com.emoniph.witchery.entity.EntityWolfman; -import com.emoniph.witchery.item.ItemBrewBag; -import com.emoniph.witchery.item.ItemBrewBagGUI; -import com.emoniph.witchery.item.ItemEarmuffs; -import com.emoniph.witchery.item.ItemLeonardsUrn; -import com.emoniph.witchery.item.ItemLeonardsUrnGUI; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import cpw.mods.fml.common.registry.VillagerRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelCreeper; -import net.minecraft.client.model.ModelOcelot; -import net.minecraft.client.model.ModelSpider; -import net.minecraft.client.model.ModelZombie; -import net.minecraft.client.particle.EntitySmokeFX; -import net.minecraft.client.renderer.entity.RenderBat; -import net.minecraft.client.renderer.entity.RenderVillager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.MinecraftForge; - -@SideOnly(Side.CLIENT) -public class ClientProxy extends CommonProxy { - - public static int RENDER_ID; - private static final int STOCKADE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - private static final int GAS_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - private static final int BREW_LIQUID_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - private static final int VINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - private static final int PITGRASS_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - public static final ResourceLocation APOTHECARY_TEXTURE = new ResourceLocation("witchery:textures/entities/apothecary.png"); - - - public void registerRenderers() { - RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - MinecraftForgeClient.registerItemRenderer(Witchery.Items.WITCH_HAND, new RenderWitchHand()); - MinecraftForgeClient.registerItemRenderer(Witchery.Items.DEATH_HAND, new RenderDeathsHand()); - MinecraftForgeClient.registerItemRenderer(Witchery.Items.BREW_BAG, new RenderBrewBottle()); - MinecraftForgeClient.registerItemRenderer(Witchery.Items.HUNTSMANS_SPEAR, new RenderHuntsmanSpear()); - MinecraftForgeClient.registerItemRenderer(Witchery.Items.MYSTIC_BRANCH, new RenderMysticBranch()); - MinecraftForgeClient.registerItemRenderer(Witchery.Items.CROSSBOW_PISTOL, new RenderHandBow()); - MinecraftForgeClient.registerItemRenderer(Witchery.Items.CANE_SWORD, new RenderCaneSword()); - RenderingRegistry.registerEntityRenderingHandler(EntityDemon.class, new RenderDemon(new ModelDemon(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityBroom.class, new RenderBroom()); - RenderingRegistry.registerEntityRenderingHandler(EntityWitchProjectile.class, new RenderWitchProjectile(Witchery.Items.GENERIC)); - RenderingRegistry.registerEntityRenderingHandler(EntityFamiliar.class, new RenderFamiliar(new ModelFamiliarPig(), 0.8F)); - RenderingRegistry.registerEntityRenderingHandler(EntityMandrake.class, new RenderMandrake(new ModelMandrake(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityTreefyd.class, new RenderTreefyd(new ModelTreefyd(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityHornedHuntsman.class, new RenderHornedAvatar(new ModelHornedAvatar(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntitySpellEffect.class, new RenderSpellEffect(0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityEnt.class, new RenderEnt(new ModelEnt(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityIllusionCreeper.class, new RenderIllusion(new ModelCreeper(), new ResourceLocation("textures/entity/creeper/creeper.png"))); - RenderingRegistry.registerEntityRenderingHandler(EntityIllusionSpider.class, new RenderIllusion(new ModelSpider(), new ResourceLocation("textures/entity/spider/spider.png"))); - RenderingRegistry.registerEntityRenderingHandler(EntityIllusionZombie.class, new RenderIllusion(new ModelZombie(), new ResourceLocation("textures/entity/zombie/zombie.png"))); - RenderingRegistry.registerEntityRenderingHandler(EntityOwl.class, new RenderOwl(new ModelOwl(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityToad.class, new RenderToad(new ModelToad(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityWitchCat.class, new RenderWitchCat(new ModelOcelot(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityParasyticLouse.class, new RenderParasyticLouse()); - RenderingRegistry.registerEntityRenderingHandler(EntityBabaYaga.class, new RenderBabaYaga()); - RenderingRegistry.registerEntityRenderingHandler(EntityCovenWitch.class, new RenderCovenWitch()); - RenderingRegistry.registerEntityRenderingHandler(EntityCorpse.class, new RenderCorpse()); - RenderingRegistry.registerEntityRenderingHandler(EntityNightmare.class, new RenderNightmare()); - RenderingRegistry.registerEntityRenderingHandler(EntitySpectre.class, new RenderSpectre()); - RenderingRegistry.registerEntityRenderingHandler(EntityPoltergeist.class, new RenderPoltergeist()); - RenderingRegistry.registerEntityRenderingHandler(EntityBanshee.class, new RenderBanshee()); - RenderingRegistry.registerEntityRenderingHandler(EntitySpirit.class, new RenderSpirit()); - RenderingRegistry.registerEntityRenderingHandler(EntityDeath.class, new RenderDeath()); - RenderingRegistry.registerEntityRenderingHandler(EntityBolt.class, new RenderBolt()); - RenderingRegistry.registerEntityRenderingHandler(EntityWitchHunter.class, new RenderWitchHunter()); - RenderingRegistry.registerEntityRenderingHandler(EntityLordOfTorment.class, new RenderLordOfTorment()); - RenderingRegistry.registerEntityRenderingHandler(EntityImp.class, new RenderImp()); - RenderingRegistry.registerEntityRenderingHandler(EntityDarkMark.class, new RenderDarkMark()); - RenderingRegistry.registerEntityRenderingHandler(EntityMindrake.class, new RenderMindrake()); - RenderingRegistry.registerEntityRenderingHandler(EntityGoblin.class, new RenderGoblin(new ModelGoblin(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityGoblinMog.class, new RenderGoblinMog(new ModelGoblinMog(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityGoblinGulg.class, new RenderGoblinGulg(new ModelGoblinGulg(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityBrew.class, new RenderBrew(Witchery.Items.BREW)); - RenderingRegistry.registerEntityRenderingHandler(EntityDroplet.class, new RenderDroplet(Witchery.Items.BREW)); - RenderingRegistry.registerEntityRenderingHandler(EntitySplatter.class, new RenderSplatter(Witchery.Items.BREW)); - RenderingRegistry.registerEntityRenderingHandler(EntityLeonard.class, new RenderLeonard(new ModelLeonard(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityLostSoul.class, new RenderSpirit()); - RenderingRegistry.registerEntityRenderingHandler(EntityWolfman.class, new RenderWolfman(new ModelWolfman(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityHellhound.class, new RenderHellhound(new ModelHellhound(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityVillagerWere.class, new RenderVillager()); - RenderingRegistry.registerEntityRenderingHandler(EntityVillageGuard.class, new RenderVillageGuard()); - RenderingRegistry.registerEntityRenderingHandler(EntityVampire.class, new RenderVampire()); - RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderGrenade(Witchery.Items.SUN_GRENADE)); - RenderingRegistry.registerEntityRenderingHandler(EntityLilith.class, new RenderLilith(new ModelLilith(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityFollower.class, new RenderFollower(new ModelBiped())); - RenderingRegistry.registerEntityRenderingHandler(EntityWingedMonkey.class, new RenderWingedMonkey(new ModelMonkey(), 0.5F)); - RenderingRegistry.registerEntityRenderingHandler(EntityAttackBat.class, new RenderBat()); - RenderingRegistry.registerEntityRenderingHandler(EntityMirrorFace.class, new RenderMirrorFace()); - RenderingRegistry.registerEntityRenderingHandler(EntityReflection.class, new RenderReflection()); - this.bindRenderer(BlockPoppetShelf.TileEntityPoppetShelf.class, new RenderPoppetChest(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.POPPET_SHELF)}); - this.bindRenderer(BlockGrassper.TileEntityGrassper.class, new RenderGrassper(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.GRASSPER)}); - this.bindRenderer(BlockDistillery.TileEntityDistillery.class, new RenderDistillery(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DISTILLERY_IDLE)}); - this.bindRenderer(BlockWitchesOven.TileEntityWitchesOven.class, new RenderWitchesOven(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.OVEN_IDLE)}); - this.bindRenderer(BlockDreamCatcher.TileEntityDreamCatcher.class, new RenderDreamCatcher(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DREAM_CATCHER)}); - this.bindRenderer(BlockChalice.TileEntityChalice.class, new RenderChalice(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CHALICE)}); - this.bindRenderer(BlockCandelabra.TileEntityCandelabra.class, new RenderCandelabra(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CANDELABRA)}); - this.bindRenderer(BlockCrystalBall.TileEntityCrystalBall.class, new RenderCrystalBall(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CRYSTAL_BALL)}); - this.bindRenderer(BlockKettle.TileEntityKettle.class, new RenderKettle(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.KETTLE)}); - this.bindRenderer(BlockLeechChest.TileEntityLeechChest.class, new RenderLeechChest(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.LEECH_CHEST)}); - this.bindRenderer(BlockStatueGoddess.TileEntityStatueGoddess.class, new RenderGoddess(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.STATUE_GODDESS)}); - this.bindRenderer(BlockSpinningWheel.TileEntitySpinningWheel.class, new RenderSpinningWheel(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.SPINNING_WHEEL)}); - this.bindRenderer(BlockBrazier.TileEntityBrazier.class, new RenderBrazier(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.BRAZIER)}); - this.bindRenderer(BlockAreaMarker.TileEntityAreaCurseProtect.class, new RenderStatueWolf(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DECURSE_DIRECTED)}); - this.bindRenderer(BlockAreaMarker.TileEntityAreaTeleportPullProtect.class, new RenderStatueMandrake(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DECURSE_TELEPORT)}); - this.bindRenderer(BlockStatueOfWorship.TileEntityStatueOfWorship.class, new RenderStatueOfWorship(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.STATUE_OF_WORSHIP)}); - this.bindRenderer(BlockPlacedItem.TileEntityPlacedItem.class, new RenderPlacedItem(), new Item[0]); - this.bindRenderer(BlockAlluringSkull.TileEntityAlluringSkull.class, new RenderAlluringSkull(), new Item[0]); - this.bindRenderer(BlockDemonHeart.TileEntityDemonHeart.class, new RenderDemonHeart(), new Item[0]); - this.bindRenderer(TileEntityCauldron.class, new RenderCauldron(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CAULDRON)}); - this.bindRenderer(BlockStatueWerewolf.TileEntityStatueWerewolf.class, new RenderStatueWerewolf(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.WOLF_ALTAR)}); - this.bindRenderer(BlockSilverVat.TileEntitySilverVat.class, new RenderSilverVat(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.SILVER_VAT)}); - this.bindRenderer(BlockBeartrap.TileEntityBeartrap.class, new RenderBeartrap(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.BEARTRAP), Item.getItemFromBlock(Witchery.Blocks.WOLFTRAP)}); - this.bindRenderer(BlockWolfHead.TileEntityWolfHead.class, new RenderWolfHead(), new Item[0]); - this.bindRenderer(BlockCoffin.TileEntityCoffin.class, new RenderCoffin(), new Item[0]); - this.bindRenderer(BlockGarlicGarland.TileEntityGarlicGarland.class, new RenderGarlicGarland(), new Item[0]); - this.bindRenderer(BlockBloodCrucible.TileEntityBloodCrucible.class, new RenderBloodCrucible(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.BLOOD_CRUCIBLE), Item.getItemFromBlock(Witchery.Blocks.BLOOD_CRUCIBLE)}); - this.bindRenderer(BlockMirror.TileEntityMirror.class, new RenderMirror(), new Item[0]); - RenderFumeFunnel funnelRenderer = new RenderFumeFunnel(false); - this.bindRenderer(BlockFumeFunnel.TileEntityFumeFunnel.class, funnelRenderer, new Item[0]); - BlockFumeFunnel.TileEntityFumeFunnel dummyFunnelTile = new BlockFumeFunnel.TileEntityFumeFunnel(); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.OVEN_FUMEFUNNEL), new RenderBlockItem(funnelRenderer, dummyFunnelTile)); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.OVEN_FUMEFUNNEL_FILTERED), new RenderBlockItem(funnelRenderer, new BlockFumeFunnel.TileEntityFumeFunnel())); - RenderFetish fetishRenderer = new RenderFetish(); - this.bindRenderer(BlockFetish.TileEntityFetish.class, fetishRenderer, new Item[0]); - BlockFetish.TileEntityFetish dummyFetishTile = new BlockFetish.TileEntityFetish(); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.FETISH_SCARECROW), new RenderFetish.RenderFetishBlockItem(Witchery.Blocks.FETISH_SCARECROW, fetishRenderer, dummyFetishTile)); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.FETISH_TREANT_IDOL), new RenderFetish.RenderFetishBlockItem(Witchery.Blocks.FETISH_TREANT_IDOL, fetishRenderer, dummyFetishTile)); - RenderingRegistry.registerBlockHandler(STOCKADE_RENDER_ID, new RenderStockade()); - RenderingRegistry.registerBlockHandler(GAS_RENDER_ID, new RenderBrewGas()); - RenderingRegistry.registerBlockHandler(BREW_LIQUID_RENDER_ID, new RenderBrewLiquid()); - RenderingRegistry.registerBlockHandler(VINE_RENDER_ID, new RenderWitchVine()); - RenderingRegistry.registerBlockHandler(PITGRASS_RENDER_ID, new RenderPitGrass()); - } - - public int getStockageRenderId() { - return STOCKADE_RENDER_ID; - } - - public int getPitGrassRenderId() { - return PITGRASS_RENDER_ID; - } - - public int getGasRenderId() { - return GAS_RENDER_ID; - } - - public int getBrewLiquidRenderId() { - return BREW_LIQUID_RENDER_ID; - } - - public int getVineRenderId() { - return VINE_RENDER_ID; - } - - private void bindRenderer(Class clazz, TileEntitySpecialRenderer render, Item ... items) { - ClientRegistry.bindTileEntitySpecialRenderer(clazz, render); - Item[] arr$ = items; - int len$ = items.length; - - for(int i$ = 0; i$ < len$; ++i$) { - Item item = arr$[i$]; - if(item != null) { - try { - MinecraftForgeClient.registerItemRenderer(item, new RenderBlockItem(render, (TileEntity)clazz.newInstance())); - } catch (IllegalAccessException var9) { - ; - } catch (InstantiationException var10) { - ; - } - } - } - - } - - public void registerHandlers() { - super.registerHandlers(); - } - - public void registerEvents() { - super.registerEvents(); - MinecraftForge.EVENT_BUS.register(new ClientEvents()); - MinecraftForge.EVENT_BUS.register(new WitcheryPotions.ClientEventHooks()); - MinecraftForge.EVENT_BUS.register(new ItemEarmuffs.ClientEventHooks()); - } - - public void postInit() {} - - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch(ID) { - case 0: - return new BlockAltarGUI((BlockAltar.TileEntityAltar)world.getTileEntity(x, y, z)); - case 1: - return new GuiScreenWitchcraftBook(player, player.getHeldItem()); - case 2: - return new BlockWitchesOvenGUI(player.inventory, (BlockWitchesOven.TileEntityWitchesOven)world.getTileEntity(x, y, z)); - case 3: - return new BlockDistilleryGUI(player.inventory, (BlockDistillery.TileEntityDistillery)world.getTileEntity(x, y, z)); - case 4: - return new BlockSpinningWheelGUI(player.inventory, (BlockSpinningWheel.TileEntitySpinningWheel)world.getTileEntity(x, y, z)); - case 5: - return new ItemBrewBagGUI(player.inventory, new ItemBrewBag.InventoryBrewBag(player)); - case 6: - return new GuiScreenBiomeBook(player, player.getHeldItem()); - case 7: - return new GuiScreenMarkupBook(player, player.getHeldItem()); - case 8: - return new ItemLeonardsUrnGUI(player.inventory, new ItemLeonardsUrn.InventoryLeonardsUrn(player)); - default: - return null; - } - } - - public boolean getGraphicsLevel() { - return Minecraft.getMinecraft().gameSettings.fancyGraphics; - } - - public void registerVillagers() { - super.registerVillagers(); - if(Config.instance().generateApothecaries) { - VillagerRegistry.instance().registerVillagerSkin(Config.instance().apothecaryID, APOTHECARY_TEXTURE); - } - - } - - public void generateParticle(World worldObj, double posX, double posY, double posZ, float r, float g, float b, int ttl, float gravity) { - if(worldObj.isRemote) { - NaturePowerFX sparkle = new NaturePowerFX(worldObj, posX, posY, posZ); - sparkle.setMaxAge(ttl); - sparkle.noClip = true; - sparkle.setRBGColorF(r, g, b); - sparkle.setGravity(gravity); - Minecraft.getMinecraft().effectRenderer.addEffect(sparkle); - } - - } - - public EntityPlayer getPlayer(MessageContext ctx) { - return (EntityPlayer)(ctx.side == Side.SERVER?ctx.getServerHandler().playerEntity:Minecraft.getMinecraft().thePlayer); - } - - public void showParticleEffect(World world, double x, double y, double z, double width, double height, SoundEffect sound, int color, ParticleEffect particle) { - if(sound != SoundEffect.NONE) { - world.playSound(x, y, z, sound.toString(), 0.5F, 0.4F / ((float)world.rand.nextDouble() * 0.4F + 0.8F), false); - } - - int effectCount = Math.min(MathHelper.ceiling_double_int(Math.max(width, 1.0D) * 20.0D), 300); - - for(int i = 0; i < effectCount; ++i) { - double d0 = world.rand.nextGaussian() * 0.02D; - double d1 = world.rand.nextGaussian() * 0.02D; - double d2 = world.rand.nextGaussian() * 0.02D; - if(particle == ParticleEffect.SPELL_COLORED) { - EntitySmokeFX sparkle = new EntitySmokeFX(world, x + world.rand.nextDouble() * width * 2.0D - width, y + world.rand.nextDouble() * height, z + (double)world.rand.nextFloat() * width * 2.0D - width, 0.0D, 0.0D, 0.0D); - sparkle.noClip = true; - float red = (float)(color >>> 16 & 255) / 256.0F; - float green = (float)(color >>> 8 & 255) / 256.0F; - float blue = (float)(color & 255) / 256.0F; - sparkle.setRBGColorF(red, green, blue); - Minecraft.getMinecraft().effectRenderer.addEffect(sparkle); - } else { - world.spawnParticle(particle.toString(), x + world.rand.nextDouble() * width * 2.0D - width, y + world.rand.nextDouble() * height, z + (double)world.rand.nextFloat() * width * 2.0D - width, 0.0D, 0.0D, 0.0D); - } - } - - } - -} +package com.emoniph.witchery.client; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockAlluringSkull; +import com.emoniph.witchery.blocks.BlockAltar; +import com.emoniph.witchery.blocks.BlockAltarGUI; +import com.emoniph.witchery.blocks.BlockAreaMarker; +import com.emoniph.witchery.blocks.BlockBeartrap; +import com.emoniph.witchery.blocks.BlockBloodCrucible; +import com.emoniph.witchery.blocks.BlockBrazier; +import com.emoniph.witchery.blocks.BlockCandelabra; +import com.emoniph.witchery.blocks.BlockChalice; +import com.emoniph.witchery.blocks.BlockCoffin; +import com.emoniph.witchery.blocks.BlockCrystalBall; +import com.emoniph.witchery.blocks.BlockDemonHeart; +import com.emoniph.witchery.blocks.BlockDistillery; +import com.emoniph.witchery.blocks.BlockDistilleryGUI; +import com.emoniph.witchery.blocks.BlockDreamCatcher; +import com.emoniph.witchery.blocks.BlockFetish; +import com.emoniph.witchery.blocks.BlockFumeFunnel; +import com.emoniph.witchery.blocks.BlockGarlicGarland; +import com.emoniph.witchery.blocks.BlockGrassper; +import com.emoniph.witchery.blocks.BlockKettle; +import com.emoniph.witchery.blocks.BlockLeechChest; +import com.emoniph.witchery.blocks.BlockMirror; +import com.emoniph.witchery.blocks.BlockPlacedItem; +import com.emoniph.witchery.blocks.BlockPoppetShelf; +import com.emoniph.witchery.blocks.BlockSilverVat; +import com.emoniph.witchery.blocks.BlockSpinningWheel; +import com.emoniph.witchery.blocks.BlockSpinningWheelGUI; +import com.emoniph.witchery.blocks.BlockStatueGoddess; +import com.emoniph.witchery.blocks.BlockStatueOfWorship; +import com.emoniph.witchery.blocks.BlockStatueWerewolf; +import com.emoniph.witchery.blocks.BlockWitchesOven; +import com.emoniph.witchery.blocks.BlockWitchesOvenGUI; +import com.emoniph.witchery.blocks.BlockWolfHead; +import com.emoniph.witchery.brewing.EntityBrew; +import com.emoniph.witchery.brewing.EntityDroplet; +import com.emoniph.witchery.brewing.EntitySplatter; +import com.emoniph.witchery.brewing.RenderBrew; +import com.emoniph.witchery.brewing.RenderBrewGas; +import com.emoniph.witchery.brewing.RenderBrewLiquid; +import com.emoniph.witchery.brewing.RenderCauldron; +import com.emoniph.witchery.brewing.RenderDroplet; +import com.emoniph.witchery.brewing.RenderSplatter; +import com.emoniph.witchery.brewing.RenderWitchVine; +import com.emoniph.witchery.brewing.TileEntityCauldron; +import com.emoniph.witchery.brewing.potions.WitcheryPotions; +import com.emoniph.witchery.client.ClientEvents; +import com.emoniph.witchery.client.gui.GuiScreenBiomeBook; +import com.emoniph.witchery.client.gui.GuiScreenMarkupBook; +import com.emoniph.witchery.client.gui.GuiScreenWitchcraftBook; +import com.emoniph.witchery.client.model.ModelDemon; +import com.emoniph.witchery.client.model.ModelEnt; +import com.emoniph.witchery.client.model.ModelFamiliarPig; +import com.emoniph.witchery.client.model.ModelGoblin; +import com.emoniph.witchery.client.model.ModelGoblinGulg; +import com.emoniph.witchery.client.model.ModelGoblinMog; +import com.emoniph.witchery.client.model.ModelHellhound; +import com.emoniph.witchery.client.model.ModelHornedAvatar; +import com.emoniph.witchery.client.model.ModelLeonard; +import com.emoniph.witchery.client.model.ModelLilith; +import com.emoniph.witchery.client.model.ModelMandrake; +import com.emoniph.witchery.client.model.ModelMonkey; +import com.emoniph.witchery.client.model.ModelOwl; +import com.emoniph.witchery.client.model.ModelToad; +import com.emoniph.witchery.client.model.ModelTreefyd; +import com.emoniph.witchery.client.model.ModelWolfman; +import com.emoniph.witchery.client.particle.NaturePowerFX; +import com.emoniph.witchery.client.renderer.RenderAlluringSkull; +import com.emoniph.witchery.client.renderer.RenderBabaYaga; +import com.emoniph.witchery.client.renderer.RenderBanshee; +import com.emoniph.witchery.client.renderer.RenderBeartrap; +import com.emoniph.witchery.client.renderer.RenderBlockItem; +import com.emoniph.witchery.client.renderer.RenderBloodCrucible; +import com.emoniph.witchery.client.renderer.RenderBolt; +import com.emoniph.witchery.client.renderer.RenderBrazier; +import com.emoniph.witchery.client.renderer.RenderBrewBottle; +import com.emoniph.witchery.client.renderer.RenderBroom; +import com.emoniph.witchery.client.renderer.RenderCandelabra; +import com.emoniph.witchery.client.renderer.RenderCaneSword; +import com.emoniph.witchery.client.renderer.RenderChalice; +import com.emoniph.witchery.client.renderer.RenderCoffin; +import com.emoniph.witchery.client.renderer.RenderCorpse; +import com.emoniph.witchery.client.renderer.RenderCovenWitch; +import com.emoniph.witchery.client.renderer.RenderCrystalBall; +import com.emoniph.witchery.client.renderer.RenderDarkMark; +import com.emoniph.witchery.client.renderer.RenderDeath; +import com.emoniph.witchery.client.renderer.RenderDeathsHand; +import com.emoniph.witchery.client.renderer.RenderDemon; +import com.emoniph.witchery.client.renderer.RenderDemonHeart; +import com.emoniph.witchery.client.renderer.RenderDistillery; +import com.emoniph.witchery.client.renderer.RenderDreamCatcher; +import com.emoniph.witchery.client.renderer.RenderEnt; +import com.emoniph.witchery.client.renderer.RenderFamiliar; +import com.emoniph.witchery.client.renderer.RenderFetish; +import com.emoniph.witchery.client.renderer.RenderFollower; +import com.emoniph.witchery.client.renderer.RenderFumeFunnel; +import com.emoniph.witchery.client.renderer.RenderGarlicGarland; +import com.emoniph.witchery.client.renderer.RenderGoblin; +import com.emoniph.witchery.client.renderer.RenderGoblinGulg; +import com.emoniph.witchery.client.renderer.RenderGoblinMog; +import com.emoniph.witchery.client.renderer.RenderGoddess; +import com.emoniph.witchery.client.renderer.RenderGrassper; +import com.emoniph.witchery.client.renderer.RenderGrenade; +import com.emoniph.witchery.client.renderer.RenderHandBow; +import com.emoniph.witchery.client.renderer.RenderHellhound; +import com.emoniph.witchery.client.renderer.RenderHornedAvatar; +import com.emoniph.witchery.client.renderer.RenderHuntsmanSpear; +import com.emoniph.witchery.client.renderer.RenderIllusion; +import com.emoniph.witchery.client.renderer.RenderImp; +import com.emoniph.witchery.client.renderer.RenderKettle; +import com.emoniph.witchery.client.renderer.RenderLeechChest; +import com.emoniph.witchery.client.renderer.RenderLeonard; +import com.emoniph.witchery.client.renderer.RenderLilith; +import com.emoniph.witchery.client.renderer.RenderLordOfTorment; +import com.emoniph.witchery.client.renderer.RenderMandrake; +import com.emoniph.witchery.client.renderer.RenderMindrake; +import com.emoniph.witchery.client.renderer.RenderMirror; +import com.emoniph.witchery.client.renderer.RenderMirrorFace; +import com.emoniph.witchery.client.renderer.RenderMysticBranch; +import com.emoniph.witchery.client.renderer.RenderNightmare; +import com.emoniph.witchery.client.renderer.RenderOwl; +import com.emoniph.witchery.client.renderer.RenderParasyticLouse; +import com.emoniph.witchery.client.renderer.RenderPitGrass; +import com.emoniph.witchery.client.renderer.RenderPlacedItem; +import com.emoniph.witchery.client.renderer.RenderPoltergeist; +import com.emoniph.witchery.client.renderer.RenderPoppetChest; +import com.emoniph.witchery.client.renderer.RenderReflection; +import com.emoniph.witchery.client.renderer.RenderSilverVat; +import com.emoniph.witchery.client.renderer.RenderSpectre; +import com.emoniph.witchery.client.renderer.RenderSpellEffect; +import com.emoniph.witchery.client.renderer.RenderSpinningWheel; +import com.emoniph.witchery.client.renderer.RenderSpirit; +import com.emoniph.witchery.client.renderer.RenderStatueMandrake; +import com.emoniph.witchery.client.renderer.RenderStatueOfWorship; +import com.emoniph.witchery.client.renderer.RenderStatueWerewolf; +import com.emoniph.witchery.client.renderer.RenderStatueWolf; +import com.emoniph.witchery.client.renderer.RenderStockade; +import com.emoniph.witchery.client.renderer.RenderToad; +import com.emoniph.witchery.client.renderer.RenderTreefyd; +import com.emoniph.witchery.client.renderer.RenderVampire; +import com.emoniph.witchery.client.renderer.RenderVillageGuard; +import com.emoniph.witchery.client.renderer.RenderWingedMonkey; +import com.emoniph.witchery.client.renderer.RenderWitchCat; +import com.emoniph.witchery.client.renderer.RenderWitchHand; +import com.emoniph.witchery.client.renderer.RenderWitchHunter; +import com.emoniph.witchery.client.renderer.RenderWitchProjectile; +import com.emoniph.witchery.client.renderer.RenderWitchesOven; +import com.emoniph.witchery.client.renderer.RenderWolfHead; +import com.emoniph.witchery.client.renderer.RenderWolfman; +import com.emoniph.witchery.common.CommonProxy; +import com.emoniph.witchery.entity.EntityAttackBat; +import com.emoniph.witchery.entity.EntityBabaYaga; +import com.emoniph.witchery.entity.EntityBanshee; +import com.emoniph.witchery.entity.EntityBolt; +import com.emoniph.witchery.entity.EntityBroom; +import com.emoniph.witchery.entity.EntityCorpse; +import com.emoniph.witchery.entity.EntityCovenWitch; +import com.emoniph.witchery.entity.EntityDarkMark; +import com.emoniph.witchery.entity.EntityDeath; +import com.emoniph.witchery.entity.EntityDemon; +import com.emoniph.witchery.entity.EntityEnt; +import com.emoniph.witchery.entity.EntityFamiliar; +import com.emoniph.witchery.entity.EntityFollower; +import com.emoniph.witchery.entity.EntityGoblin; +import com.emoniph.witchery.entity.EntityGoblinGulg; +import com.emoniph.witchery.entity.EntityGoblinMog; +import com.emoniph.witchery.entity.EntityGrenade; +import com.emoniph.witchery.entity.EntityHellhound; +import com.emoniph.witchery.entity.EntityHornedHuntsman; +import com.emoniph.witchery.entity.EntityIllusionCreeper; +import com.emoniph.witchery.entity.EntityIllusionSpider; +import com.emoniph.witchery.entity.EntityIllusionZombie; +import com.emoniph.witchery.entity.EntityImp; +import com.emoniph.witchery.entity.EntityLeonard; +import com.emoniph.witchery.entity.EntityLilith; +import com.emoniph.witchery.entity.EntityLordOfTorment; +import com.emoniph.witchery.entity.EntityLostSoul; +import com.emoniph.witchery.entity.EntityMandrake; +import com.emoniph.witchery.entity.EntityMindrake; +import com.emoniph.witchery.entity.EntityMirrorFace; +import com.emoniph.witchery.entity.EntityNightmare; +import com.emoniph.witchery.entity.EntityOwl; +import com.emoniph.witchery.entity.EntityParasyticLouse; +import com.emoniph.witchery.entity.EntityPoltergeist; +import com.emoniph.witchery.entity.EntityReflection; +import com.emoniph.witchery.entity.EntitySpectre; +import com.emoniph.witchery.entity.EntitySpellEffect; +import com.emoniph.witchery.entity.EntitySpirit; +import com.emoniph.witchery.entity.EntityToad; +import com.emoniph.witchery.entity.EntityTreefyd; +import com.emoniph.witchery.entity.EntityVampire; +import com.emoniph.witchery.entity.EntityVillageGuard; +import com.emoniph.witchery.entity.EntityVillagerWere; +import com.emoniph.witchery.entity.EntityWingedMonkey; +import com.emoniph.witchery.entity.EntityWitchCat; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.entity.EntityWitchProjectile; +import com.emoniph.witchery.entity.EntityWolfman; +import com.emoniph.witchery.item.ItemBrewBag; +import com.emoniph.witchery.item.ItemBrewBagGUI; +import com.emoniph.witchery.item.ItemEarmuffs; +import com.emoniph.witchery.item.ItemLeonardsUrn; +import com.emoniph.witchery.item.ItemLeonardsUrnGUI; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelCreeper; +import net.minecraft.client.model.ModelOcelot; +import net.minecraft.client.model.ModelSpider; +import net.minecraft.client.model.ModelZombie; +import net.minecraft.client.particle.EntitySmokeFX; +import net.minecraft.client.renderer.entity.RenderBat; +import net.minecraft.client.renderer.entity.RenderVillager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; + +@SideOnly(Side.CLIENT) +public class ClientProxy extends CommonProxy { + + public static int RENDER_ID; + private static final int STOCKADE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + private static final int GAS_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + private static final int BREW_LIQUID_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + private static final int VINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + private static final int PITGRASS_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + public static final ResourceLocation APOTHECARY_TEXTURE = new ResourceLocation("witchery:textures/entities/apothecary.png"); + + + public void registerRenderers() { + RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + MinecraftForgeClient.registerItemRenderer(Witchery.Items.WITCH_HAND, new RenderWitchHand()); + MinecraftForgeClient.registerItemRenderer(Witchery.Items.DEATH_HAND, new RenderDeathsHand()); + MinecraftForgeClient.registerItemRenderer(Witchery.Items.BREW_BAG, new RenderBrewBottle()); + MinecraftForgeClient.registerItemRenderer(Witchery.Items.HUNTSMANS_SPEAR, new RenderHuntsmanSpear()); + MinecraftForgeClient.registerItemRenderer(Witchery.Items.MYSTIC_BRANCH, new RenderMysticBranch()); + MinecraftForgeClient.registerItemRenderer(Witchery.Items.CROSSBOW_PISTOL, new RenderHandBow()); + MinecraftForgeClient.registerItemRenderer(Witchery.Items.CANE_SWORD, new RenderCaneSword()); + RenderingRegistry.registerEntityRenderingHandler(EntityDemon.class, new RenderDemon(new ModelDemon(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityBroom.class, new RenderBroom()); + RenderingRegistry.registerEntityRenderingHandler(EntityWitchProjectile.class, new RenderWitchProjectile(Witchery.Items.GENERIC)); + RenderingRegistry.registerEntityRenderingHandler(EntityFamiliar.class, new RenderFamiliar(new ModelFamiliarPig(), 0.8F)); + RenderingRegistry.registerEntityRenderingHandler(EntityMandrake.class, new RenderMandrake(new ModelMandrake(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityTreefyd.class, new RenderTreefyd(new ModelTreefyd(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHornedHuntsman.class, new RenderHornedAvatar(new ModelHornedAvatar(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntitySpellEffect.class, new RenderSpellEffect(0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityEnt.class, new RenderEnt(new ModelEnt(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityIllusionCreeper.class, new RenderIllusion(new ModelCreeper(), new ResourceLocation("textures/entity/creeper/creeper.png"))); + RenderingRegistry.registerEntityRenderingHandler(EntityIllusionSpider.class, new RenderIllusion(new ModelSpider(), new ResourceLocation("textures/entity/spider/spider.png"))); + RenderingRegistry.registerEntityRenderingHandler(EntityIllusionZombie.class, new RenderIllusion(new ModelZombie(), new ResourceLocation("textures/entity/zombie/zombie.png"))); + RenderingRegistry.registerEntityRenderingHandler(EntityOwl.class, new RenderOwl(new ModelOwl(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityToad.class, new RenderToad(new ModelToad(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityWitchCat.class, new RenderWitchCat(new ModelOcelot(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityParasyticLouse.class, new RenderParasyticLouse()); + RenderingRegistry.registerEntityRenderingHandler(EntityBabaYaga.class, new RenderBabaYaga()); + RenderingRegistry.registerEntityRenderingHandler(EntityCovenWitch.class, new RenderCovenWitch()); + RenderingRegistry.registerEntityRenderingHandler(EntityCorpse.class, new RenderCorpse()); + RenderingRegistry.registerEntityRenderingHandler(EntityNightmare.class, new RenderNightmare()); + RenderingRegistry.registerEntityRenderingHandler(EntitySpectre.class, new RenderSpectre()); + RenderingRegistry.registerEntityRenderingHandler(EntityPoltergeist.class, new RenderPoltergeist()); + RenderingRegistry.registerEntityRenderingHandler(EntityBanshee.class, new RenderBanshee()); + RenderingRegistry.registerEntityRenderingHandler(EntitySpirit.class, new RenderSpirit()); + RenderingRegistry.registerEntityRenderingHandler(EntityDeath.class, new RenderDeath()); + RenderingRegistry.registerEntityRenderingHandler(EntityBolt.class, new RenderBolt()); + RenderingRegistry.registerEntityRenderingHandler(EntityWitchHunter.class, new RenderWitchHunter()); + RenderingRegistry.registerEntityRenderingHandler(EntityLordOfTorment.class, new RenderLordOfTorment()); + RenderingRegistry.registerEntityRenderingHandler(EntityImp.class, new RenderImp()); + RenderingRegistry.registerEntityRenderingHandler(EntityDarkMark.class, new RenderDarkMark()); + RenderingRegistry.registerEntityRenderingHandler(EntityMindrake.class, new RenderMindrake()); + RenderingRegistry.registerEntityRenderingHandler(EntityGoblin.class, new RenderGoblin(new ModelGoblin(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityGoblinMog.class, new RenderGoblinMog(new ModelGoblinMog(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityGoblinGulg.class, new RenderGoblinGulg(new ModelGoblinGulg(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityBrew.class, new RenderBrew(Witchery.Items.BREW)); + RenderingRegistry.registerEntityRenderingHandler(EntityDroplet.class, new RenderDroplet(Witchery.Items.BREW)); + RenderingRegistry.registerEntityRenderingHandler(EntitySplatter.class, new RenderSplatter(Witchery.Items.BREW)); + RenderingRegistry.registerEntityRenderingHandler(EntityLeonard.class, new RenderLeonard(new ModelLeonard(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityLostSoul.class, new RenderSpirit()); + RenderingRegistry.registerEntityRenderingHandler(EntityWolfman.class, new RenderWolfman(new ModelWolfman(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHellhound.class, new RenderHellhound(new ModelHellhound(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityVillagerWere.class, new RenderVillager()); + RenderingRegistry.registerEntityRenderingHandler(EntityVillageGuard.class, new RenderVillageGuard()); + RenderingRegistry.registerEntityRenderingHandler(EntityVampire.class, new RenderVampire()); + RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderGrenade(Witchery.Items.SUN_GRENADE)); + RenderingRegistry.registerEntityRenderingHandler(EntityLilith.class, new RenderLilith(new ModelLilith(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityFollower.class, new RenderFollower(new ModelBiped())); + RenderingRegistry.registerEntityRenderingHandler(EntityWingedMonkey.class, new RenderWingedMonkey(new ModelMonkey(), 0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityAttackBat.class, new RenderBat()); + RenderingRegistry.registerEntityRenderingHandler(EntityMirrorFace.class, new RenderMirrorFace()); + RenderingRegistry.registerEntityRenderingHandler(EntityReflection.class, new RenderReflection()); + this.bindRenderer(BlockPoppetShelf.TileEntityPoppetShelf.class, new RenderPoppetChest(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.POPPET_SHELF)}); + this.bindRenderer(BlockGrassper.TileEntityGrassper.class, new RenderGrassper(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.GRASSPER)}); + this.bindRenderer(BlockDistillery.TileEntityDistillery.class, new RenderDistillery(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DISTILLERY_IDLE)}); + this.bindRenderer(BlockWitchesOven.TileEntityWitchesOven.class, new RenderWitchesOven(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.OVEN_IDLE)}); + this.bindRenderer(BlockDreamCatcher.TileEntityDreamCatcher.class, new RenderDreamCatcher(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DREAM_CATCHER)}); + this.bindRenderer(BlockChalice.TileEntityChalice.class, new RenderChalice(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CHALICE)}); +// this.bindRenderer(com.emoniph.witchery.brewing.TileEntityPortkey.class, new RenderChalice(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.PORTKEY)}); +// this.bindRenderer(com.emoniph.witchery.brewing.TileEntityPortkey.class, new RenderChalice(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.PORTKEY)}); + this.bindRenderer(BlockCandelabra.TileEntityCandelabra.class, new RenderCandelabra(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CANDELABRA)}); + this.bindRenderer(BlockCrystalBall.TileEntityCrystalBall.class, new RenderCrystalBall(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CRYSTAL_BALL)}); + this.bindRenderer(BlockKettle.TileEntityKettle.class, new RenderKettle(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.KETTLE)}); + this.bindRenderer(BlockLeechChest.TileEntityLeechChest.class, new RenderLeechChest(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.LEECH_CHEST)}); + this.bindRenderer(BlockStatueGoddess.TileEntityStatueGoddess.class, new RenderGoddess(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.STATUE_GODDESS)}); + this.bindRenderer(BlockSpinningWheel.TileEntitySpinningWheel.class, new RenderSpinningWheel(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.SPINNING_WHEEL)}); + this.bindRenderer(BlockBrazier.TileEntityBrazier.class, new RenderBrazier(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.BRAZIER)}); + this.bindRenderer(BlockAreaMarker.TileEntityAreaCurseProtect.class, new RenderStatueWolf(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DECURSE_DIRECTED)}); + this.bindRenderer(BlockAreaMarker.TileEntityAreaTeleportPullProtect.class, new RenderStatueMandrake(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.DECURSE_TELEPORT)}); + this.bindRenderer(BlockStatueOfWorship.TileEntityStatueOfWorship.class, new RenderStatueOfWorship(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.STATUE_OF_WORSHIP)}); + this.bindRenderer(BlockPlacedItem.TileEntityPlacedItem.class, new RenderPlacedItem(), new Item[0]); + this.bindRenderer(BlockAlluringSkull.TileEntityAlluringSkull.class, new RenderAlluringSkull(), new Item[0]); + this.bindRenderer(BlockDemonHeart.TileEntityDemonHeart.class, new RenderDemonHeart(), new Item[0]); + this.bindRenderer(TileEntityCauldron.class, new RenderCauldron(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.CAULDRON)}); + this.bindRenderer(BlockStatueWerewolf.TileEntityStatueWerewolf.class, new RenderStatueWerewolf(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.WOLF_ALTAR)}); + this.bindRenderer(BlockSilverVat.TileEntitySilverVat.class, new RenderSilverVat(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.SILVER_VAT)}); + this.bindRenderer(BlockBeartrap.TileEntityBeartrap.class, new RenderBeartrap(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.BEARTRAP), Item.getItemFromBlock(Witchery.Blocks.WOLFTRAP)}); + this.bindRenderer(BlockWolfHead.TileEntityWolfHead.class, new RenderWolfHead(), new Item[0]); + this.bindRenderer(BlockCoffin.TileEntityCoffin.class, new RenderCoffin(), new Item[0]); + this.bindRenderer(BlockGarlicGarland.TileEntityGarlicGarland.class, new RenderGarlicGarland(), new Item[0]); + this.bindRenderer(BlockBloodCrucible.TileEntityBloodCrucible.class, new RenderBloodCrucible(), new Item[]{Item.getItemFromBlock(Witchery.Blocks.BLOOD_CRUCIBLE), Item.getItemFromBlock(Witchery.Blocks.BLOOD_CRUCIBLE)}); + this.bindRenderer(BlockMirror.TileEntityMirror.class, new RenderMirror(), new Item[0]); + RenderFumeFunnel funnelRenderer = new RenderFumeFunnel(false); + this.bindRenderer(BlockFumeFunnel.TileEntityFumeFunnel.class, funnelRenderer, new Item[0]); + BlockFumeFunnel.TileEntityFumeFunnel dummyFunnelTile = new BlockFumeFunnel.TileEntityFumeFunnel(); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.OVEN_FUMEFUNNEL), new RenderBlockItem(funnelRenderer, dummyFunnelTile)); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.OVEN_FUMEFUNNEL_FILTERED), new RenderBlockItem(funnelRenderer, new BlockFumeFunnel.TileEntityFumeFunnel())); + RenderFetish fetishRenderer = new RenderFetish(); + this.bindRenderer(BlockFetish.TileEntityFetish.class, fetishRenderer, new Item[0]); + BlockFetish.TileEntityFetish dummyFetishTile = new BlockFetish.TileEntityFetish(); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.FETISH_SCARECROW), new RenderFetish.RenderFetishBlockItem(Witchery.Blocks.FETISH_SCARECROW, fetishRenderer, dummyFetishTile)); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Witchery.Blocks.FETISH_TREANT_IDOL), new RenderFetish.RenderFetishBlockItem(Witchery.Blocks.FETISH_TREANT_IDOL, fetishRenderer, dummyFetishTile)); + RenderingRegistry.registerBlockHandler(STOCKADE_RENDER_ID, new RenderStockade()); + RenderingRegistry.registerBlockHandler(GAS_RENDER_ID, new RenderBrewGas()); + RenderingRegistry.registerBlockHandler(BREW_LIQUID_RENDER_ID, new RenderBrewLiquid()); + RenderingRegistry.registerBlockHandler(VINE_RENDER_ID, new RenderWitchVine()); + RenderingRegistry.registerBlockHandler(PITGRASS_RENDER_ID, new RenderPitGrass()); + } + + public int getStockageRenderId() { + return STOCKADE_RENDER_ID; + } + + public int getPitGrassRenderId() { + return PITGRASS_RENDER_ID; + } + + public int getGasRenderId() { + return GAS_RENDER_ID; + } + + public int getBrewLiquidRenderId() { + return BREW_LIQUID_RENDER_ID; + } + + public int getVineRenderId() { + return VINE_RENDER_ID; + } + + private void bindRenderer(Class clazz, TileEntitySpecialRenderer render, Item ... items) { + ClientRegistry.bindTileEntitySpecialRenderer(clazz, render); + Item[] arr$ = items; + int len$ = items.length; + + for(int i$ = 0; i$ < len$; ++i$) { + Item item = arr$[i$]; + if(item != null) { + try { + MinecraftForgeClient.registerItemRenderer(item, new RenderBlockItem(render, (TileEntity)clazz.newInstance())); + } catch (IllegalAccessException var9) { + ; + } catch (InstantiationException var10) { + ; + } + } + } + + } + + public void registerHandlers() { + super.registerHandlers(); + } + + public void registerEvents() { + super.registerEvents(); + MinecraftForge.EVENT_BUS.register(new ClientEvents()); + MinecraftForge.EVENT_BUS.register(new WitcheryPotions.ClientEventHooks()); + MinecraftForge.EVENT_BUS.register(new ItemEarmuffs.ClientEventHooks()); + } + + public void postInit() {} + + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + switch(ID) { + case 0: + return new BlockAltarGUI((BlockAltar.TileEntityAltar)world.getTileEntity(x, y, z)); + case 1: + return new GuiScreenWitchcraftBook(player, player.getHeldItem()); + case 2: + return new BlockWitchesOvenGUI(player.inventory, (BlockWitchesOven.TileEntityWitchesOven)world.getTileEntity(x, y, z)); + case 3: + return new BlockDistilleryGUI(player.inventory, (BlockDistillery.TileEntityDistillery)world.getTileEntity(x, y, z)); + case 4: + return new BlockSpinningWheelGUI(player.inventory, (BlockSpinningWheel.TileEntitySpinningWheel)world.getTileEntity(x, y, z)); + case 5: + return new ItemBrewBagGUI(player.inventory, new ItemBrewBag.InventoryBrewBag(player)); + case 6: + return new GuiScreenBiomeBook(player, player.getHeldItem()); + case 7: + return new GuiScreenMarkupBook(player, player.getHeldItem()); + case 8: + return new ItemLeonardsUrnGUI(player.inventory, new ItemLeonardsUrn.InventoryLeonardsUrn(player)); + default: + return null; + } + } + + public boolean getGraphicsLevel() { + return Minecraft.getMinecraft().gameSettings.fancyGraphics; + } + + public void registerVillagers() { + super.registerVillagers(); + if(Config.instance().generateApothecaries) { + VillagerRegistry.instance().registerVillagerSkin(Config.instance().apothecaryID, APOTHECARY_TEXTURE); + } + + } + + public void generateParticle(World worldObj, double posX, double posY, double posZ, float r, float g, float b, int ttl, float gravity) { + if(worldObj.isRemote) { + NaturePowerFX sparkle = new NaturePowerFX(worldObj, posX, posY, posZ); + sparkle.setMaxAge(ttl); + sparkle.noClip = true; + sparkle.setRBGColorF(r, g, b); + sparkle.setGravity(gravity); + sparkle.setScale(1.4F); + Minecraft.getMinecraft().effectRenderer.addEffect(sparkle); + } + + } + + public EntityPlayer getPlayer(MessageContext ctx) { + return (EntityPlayer)(ctx.side == Side.SERVER?ctx.getServerHandler().playerEntity:Minecraft.getMinecraft().thePlayer); + } + + public void showParticleEffect(World world, double x, double y, double z, double width, double height, SoundEffect sound, int color, ParticleEffect particle) { + if(sound != SoundEffect.NONE) { + world.playSound(x, y, z, sound.toString(), 0.5F, 0.4F / ((float)world.rand.nextDouble() * 0.4F + 0.8F), false); + } + + int effectCount = Math.min(MathHelper.ceiling_double_int(Math.max(width, 1.0D) * 20.0D), 300); + + for(int i = 0; i < effectCount; ++i) { + double d0 = world.rand.nextGaussian() * 0.02D; + double d1 = world.rand.nextGaussian() * 0.02D; + double d2 = world.rand.nextGaussian() * 0.02D; + if(particle == ParticleEffect.SPELL_COLORED) { + double px = x + world.rand.nextDouble() * width * 2.0D - width; + double py = y + world.rand.nextDouble() * height; + double pz = z + (double)world.rand.nextFloat() * width * 2.0D - width; + NaturePowerFX sparkle = new NaturePowerFX(world, px, py, pz); + sparkle.noClip = true; + sparkle.setMaxAge(12 + world.rand.nextInt(8)); + sparkle.setScale(1.6F); + sparkle.setGravity(0.15F); + sparkle.setCanMove(true); + float red = (float)(color >>> 16 & 255) / 255.0F; + float green = (float)(color >>> 8 & 255) / 255.0F; + float blue = (float)(color & 255) / 255.0F; + sparkle.setRBGColorF(red, green, blue); + sparkle.motionX = (px - x) * 0.35D + world.rand.nextGaussian() * 0.04D; + sparkle.motionY = (py - y) * 0.35D + world.rand.nextGaussian() * 0.04D + 0.02D; + sparkle.motionZ = (pz - z) * 0.35D + world.rand.nextGaussian() * 0.04D; + Minecraft.getMinecraft().effectRenderer.addEffect(sparkle); + } else { + world.spawnParticle(particle.toString(), x + world.rand.nextDouble() * width * 2.0D - width, y + world.rand.nextDouble() * height, z + (double)world.rand.nextFloat() * width * 2.0D - width, 0.0D, 0.0D, 0.0D); + } + } + + } + +} diff --git a/src/main/java/com/emoniph/witchery/client/TransformSpirit.java b/src/main/java/com/emoniph/witchery/client/TransformSpirit.java new file mode 100644 index 0000000..fde7761 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/client/TransformSpirit.java @@ -0,0 +1,94 @@ +package com.emoniph.witchery.client; + +import com.emoniph.witchery.client.model.ModelSpectre; +import com.emoniph.witchery.entity.EntityBanshee; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.util.RenderUtil; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class TransformSpirit { + + private EntityBanshee proxyEntity; + private int currentColor = 0xFFFFFF; + + private RenderLiving proxyRenderer = new RenderLiving(new ModelSpectre(false), 0.0F) { + protected ResourceLocation getEntityTexture(Entity par1Entity) { + return new ResourceLocation("witchery", "textures/entities/banshee.png"); + } + public void doRender(EntityLivingBase entity, double x, double y, double z, float yaw, float partialTicks) { + GL11.glPushMatrix(); + RenderUtil.blend(true); + float r = (float)(currentColor >> 16 & 255) / 255.0F; + float g = (float)(currentColor >> 8 & 255) / 255.0F; + float b = (float)(currentColor & 255) / 255.0F; + GL11.glColor4f(r, g, b, 0.7F); + super.doRender(entity, x, y, z, yaw, partialTicks); + RenderUtil.blend(false); + GL11.glPopMatrix(); + } + }; + + public EntityLivingBase getModel() { + return this.proxyEntity; + } + + public void syncModelWith(EntityLivingBase entity, boolean frontface) { + if(this.proxyEntity == null) { + this.proxyEntity = new EntityBanshee(entity.worldObj); + } else if(this.proxyEntity.worldObj != entity.worldObj) { + this.proxyEntity.setWorld(entity.worldObj); + } + + this.proxyEntity.setPosition(entity.posX, entity.posY, entity.posZ); + this.proxyEntity.lastTickPosX = entity.lastTickPosX; + this.proxyEntity.lastTickPosY = entity.lastTickPosY; + this.proxyEntity.lastTickPosZ = entity.lastTickPosZ; + this.proxyEntity.motionX = entity.motionX; + this.proxyEntity.motionY = entity.motionY; + this.proxyEntity.motionZ = entity.motionZ; + this.proxyEntity.rotationPitch = entity.rotationPitch; + this.proxyEntity.rotationYaw = entity.rotationYaw; + this.proxyEntity.rotationYawHead = entity.rotationYawHead; + this.proxyEntity.prevRotationPitch = entity.prevRotationPitch; + this.proxyEntity.prevRotationYaw = entity.prevRotationYaw; + this.proxyEntity.prevRotationYawHead = entity.prevRotationYawHead; + this.proxyEntity.renderYawOffset = frontface ? 0.0F : entity.renderYawOffset; + this.proxyEntity.prevRenderYawOffset = frontface ? 0.0F : entity.prevRenderYawOffset; + this.proxyEntity.ticksExisted = entity.ticksExisted; + this.proxyEntity.isDead = false; + + if (entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)entity; + int infusionID = Infusion.getInfusionID(player); + int color = 0xFFFFFF; + if (infusionID == 4) { + color = 0xFF0000; + } else if (infusionID == 2) { + color = 0x00FF00; + } else if (infusionID == 3) { + color = 0x800080; + } + this.currentColor = color; + } + } + + public void render(World worldObj, EntityLivingBase entity, double x, double y, double z, RendererLivingEntity renderer, float partialTicks, boolean frontface) { + this.syncModelWith(entity, frontface); + this.proxyRenderer.setRenderManager(RenderManager.instance); + float f1 = this.proxyEntity.prevRotationYaw + (this.proxyEntity.rotationYaw - this.proxyEntity.prevRotationYaw) * partialTicks; + double d3 = -((double)this.proxyEntity.yOffset); + + this.proxyRenderer.doRender(this.proxyEntity, x, y + d3 + 0.5D, z, frontface ? 0.0F : f1, partialTicks); + } +} diff --git a/src/main/java/com/emoniph/witchery/client/gui/GuiScreenMarkupBook.java b/src/main/java/com/emoniph/witchery/client/gui/GuiScreenMarkupBook.java index 921bd83..9d8a633 100644 --- a/src/main/java/com/emoniph/witchery/client/gui/GuiScreenMarkupBook.java +++ b/src/main/java/com/emoniph/witchery/client/gui/GuiScreenMarkupBook.java @@ -143,7 +143,7 @@ private void constructPage() { while(var22.hasNext()) { GuiScreenMarkupBook.Element var23 = (GuiScreenMarkupBook.Element)var22.next(); - GuiScreenMarkupBook.NextPage var24 = var23.constructButtons(super.buttonList, this.itemstack); + GuiScreenMarkupBook.NextPage var24 = var23.constructButtons(super.buttonList, this.itemstack, super.fontRendererObj); if(var24 != null) { this.nextPage = var24; } @@ -227,7 +227,11 @@ public void drawScreen(int mouseX, int mouseY, float par3) { while(i$.hasNext()) { GuiScreenMarkupBook.Element element = (GuiScreenMarkupBook.Element)i$.next(); - element.draw(pos, marginX, 116, state); + try { + element.draw(pos, marginX, 116, state); + } catch (Exception var12) { + ; + } } super.drawScreen(mouseX, mouseY, par3); @@ -290,23 +294,34 @@ public void append(char c) { this.capture = GuiScreenMarkupBook.Element.Capture.ATTRIB; break; } + + this.appendChar(c); + break; case 9: case 32: if(this.capture == GuiScreenMarkupBook.Element.Capture.TAG || this.capture == GuiScreenMarkupBook.Element.Capture.ATTRIB) { this.capture = GuiScreenMarkupBook.Element.Capture.TEXT; break; } + + this.appendChar(c); + break; case 91: this.capture = GuiScreenMarkupBook.Element.Capture.TAG; break; default: - if(this.capture == GuiScreenMarkupBook.Element.Capture.TAG) { - this.tag.append(c); - } else if(this.capture == GuiScreenMarkupBook.Element.Capture.ATTRIB) { - this.attribute.append(c); - } else { - this.text.append(c); - } + this.appendChar(c); + } + + } + + private void appendChar(char c) { + if(this.capture == GuiScreenMarkupBook.Element.Capture.TAG) { + this.tag.append(c); + } else if(this.capture == GuiScreenMarkupBook.Element.Capture.ATTRIB) { + this.attribute.append(c); + } else { + this.text.append(c); } } @@ -337,7 +352,7 @@ private static Hashtable getFormats() { return formats; } - public GuiScreenMarkupBook.NextPage constructButtons(List buttonList, ItemStack stack) { + public GuiScreenMarkupBook.NextPage constructButtons(List buttonList, ItemStack stack, FontRenderer font) { String tag = this.tag.toString(); if(tag.equals("url")) { String attrib = this.attribute.toString(); @@ -347,6 +362,10 @@ public GuiScreenMarkupBook.NextPage constructButtons(List buttonList, ItemStack } this.button = new GuiButtonUrl(4, 0, 0, attrib, this.text.toString()); + if(font != null) { + this.button.height = font.FONT_HEIGHT; + this.button.width = Math.max(1, font.getStringWidth(this.text.toString())); + } buttonList.add(this.button); } else if(tag.equals("next")) { return new GuiScreenMarkupBook.NextPage(this.attribute.toString(), stack); @@ -463,7 +482,7 @@ public void draw(int[] pos, int marginX, int maxWidth, GuiScreenMarkupBook.Rende if(!postText.isEmpty()) { boolean var36 = postText.equals("empty"); Item item = !var36?(Item)Item.itemRegistry.getObject(postText):null; - ItemStack stack = !var36?new ItemStack(item, var30, var28):null; + ItemStack stack = (!var36 && item != null)?new ItemStack(item, var30, var28):null; byte width1 = 18; byte height = 18; if(var33.equals("right")) { @@ -485,7 +504,7 @@ public void draw(int[] pos, int marginX, int maxWidth, GuiScreenMarkupBook.Rende } } - if(!var36) { + if(!var36 && stack != null) { RenderItem words1 = new RenderItem(); GL11.glPushMatrix(); GL11.glEnable(3042); diff --git a/src/main/java/com/emoniph/witchery/client/model/ModelPortkey.java b/src/main/java/com/emoniph/witchery/client/model/ModelPortkey.java new file mode 100644 index 0000000..9f617c3 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/client/model/ModelPortkey.java @@ -0,0 +1,53 @@ +package com.emoniph.witchery.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelPortkey extends ModelBase { + + ModelRenderer chalice; + + + public ModelPortkey() { + super.textureWidth = 32; + super.textureHeight = 32; + this.setTextureOffset("chalice.sideRight", 0, -5); + this.setTextureOffset("chalice.sideLeft", 0, -5); + this.setTextureOffset("chalice.sideBack", 0, 0); + this.setTextureOffset("chalice.sideFront", 0, 0); + this.setTextureOffset("chalice.sideBottom", -5, 4); + this.setTextureOffset("chalice.neck", 4, 10); + this.setTextureOffset("chalice.base", 0, 13); + this.chalice = new ModelRenderer(this, "chalice"); + this.chalice.setRotationPoint(-1.0F, 23.0F, -1.0F); + this.setRotation(this.chalice, 0.0F, 0.0F, 0.0F); + this.chalice.mirror = true; + this.chalice.addBox("sideRight", 4.0F, -6.0F, -1.0F, 0, 4, 5); + this.chalice.addBox("sideLeft", -1.0F, -6.0F, -1.0F, 0, 4, 5); + this.chalice.addBox("sideBack", -1.0F, -6.0F, 4.0F, 5, 4, 0); + this.chalice.addBox("sideFront", -1.0F, -6.0F, -1.0F, 5, 4, 0); + this.chalice.addBox("sideBottom", -1.0F, -2.0F, -1.0F, 5, 0, 5); + this.chalice.addBox("neck", 1.0F, -2.0F, 1.0F, 1, 2, 1); + this.chalice.addBox("base", 0.0F, 0.0F, 0.0F, 3, 1, 3); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.chalice.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} \ No newline at end of file diff --git a/src/main/java/com/emoniph/witchery/client/particle/BubblesFX.java b/src/main/java/com/emoniph/witchery/client/particle/BubblesFX.java index f30d101..39c86a2 100644 --- a/src/main/java/com/emoniph/witchery/client/particle/BubblesFX.java +++ b/src/main/java/com/emoniph/witchery/client/particle/BubblesFX.java @@ -3,6 +3,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; @@ -11,6 +12,8 @@ public class BubblesFX extends EntityFX { public static final ResourceLocation particles = new ResourceLocation("witchery:textures/particle/power.png"); private boolean canMove = false; + private boolean fade = true; + private boolean pulseScale = true; public BubblesFX(World world, double x, double y, double z) { @@ -34,11 +37,24 @@ public void renderParticle(Tessellator tess, float partialTicks, float par3, flo float f7 = f6 + 0.0624375F; float f8 = (float)particleTextureIndexY / 16.0F; float f9 = f8 + 0.0624375F; + float lifeRatio = super.particleMaxAge > 0?Math.max(0.0F, Math.min(1.0F, ((float)super.particleAge + partialTicks) / (float)super.particleMaxAge)):0.0F; float scale = 0.1F * super.particleScale; + if(this.pulseScale) { + float pulse = MathHelper.sin(lifeRatio * (float)Math.PI); + scale *= 0.4F + 0.6F * pulse; + } + + float alpha = 1.0F; + if(this.fade) { + float fadeIn = Math.min(1.0F, lifeRatio / 0.15F); + float fadeOut = Math.min(1.0F, (1.0F - lifeRatio) / 0.3F); + alpha = Math.max(0.05F, Math.min(1.0F, fadeIn * fadeOut)); + } + float x = (float)(super.prevPosX + (super.posX - super.prevPosX) * (double)partialTicks - EntityFX.interpPosX); float y = (float)(super.prevPosY + (super.posY - super.prevPosY) * (double)partialTicks - EntityFX.interpPosY); float z = (float)(super.prevPosZ + (super.posZ - super.prevPosZ) * (double)partialTicks - EntityFX.interpPosZ); - tess.setColorRGBA_F(super.particleRed, super.particleGreen, super.particleBlue, 1.0F); + tess.setColorRGBA_F(super.particleRed, super.particleGreen, super.particleBlue, alpha); tess.addVertexWithUV((double)(x - par3 * scale - par6 * scale), (double)(y - par4 * scale), (double)(z - par5 * scale - par7 * scale), (double)f7, (double)f9); tess.addVertexWithUV((double)(x - par3 * scale + par6 * scale), (double)(y + par4 * scale), (double)(z - par5 * scale + par7 * scale), (double)f7, (double)f8); tess.addVertexWithUV((double)(x + par3 * scale + par6 * scale), (double)(y + par4 * scale), (double)(z + par5 * scale + par7 * scale), (double)f6, (double)f8); @@ -100,4 +116,14 @@ public BubblesFX setScale(float scale) { return this; } + public BubblesFX setFade(boolean fade) { + this.fade = fade; + return this; + } + + public BubblesFX setPulseScale(boolean pulseScale) { + this.pulseScale = pulseScale; + return this; + } + } diff --git a/src/main/java/com/emoniph/witchery/client/particle/NaturePowerFX.java b/src/main/java/com/emoniph/witchery/client/particle/NaturePowerFX.java index 7ccdea1..537ce86 100644 --- a/src/main/java/com/emoniph/witchery/client/particle/NaturePowerFX.java +++ b/src/main/java/com/emoniph/witchery/client/particle/NaturePowerFX.java @@ -5,6 +5,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -16,6 +17,8 @@ public class NaturePowerFX extends EntityFX { public static final ResourceLocation particles = new ResourceLocation("witchery:textures/particle/power.png"); private boolean canMove = false; private boolean circling = false; + private boolean fade = true; + private boolean pulseScale = true; public NaturePowerFX(World world, double x, double y, double z) { @@ -40,11 +43,24 @@ public void renderParticle(Tessellator tess, float partialTicks, float par3, flo float f7 = f6 + 0.0624375F; float f8 = (float)particleTextureIndexY / 16.0F; float f9 = f8 + 0.0624375F; + float lifeRatio = super.particleMaxAge > 0?Math.max(0.0F, Math.min(1.0F, ((float)super.particleAge + partialTicks) / (float)super.particleMaxAge)):0.0F; float scale = 0.1F * super.particleScale; + if(this.pulseScale) { + float pulse = MathHelper.sin(lifeRatio * (float)Math.PI); + scale *= 0.35F + 0.65F * pulse; + } + + float alpha = 1.0F; + if(this.fade) { + float fadeIn = Math.min(1.0F, lifeRatio / 0.15F); + float fadeOut = Math.min(1.0F, (1.0F - lifeRatio) / 0.3F); + alpha = Math.max(0.05F, Math.min(1.0F, fadeIn * fadeOut)); + } + float x = (float)(super.prevPosX + (super.posX - super.prevPosX) * (double)partialTicks - EntityFX.interpPosX); float y = (float)(super.prevPosY + (super.posY - super.prevPosY) * (double)partialTicks - EntityFX.interpPosY); float z = (float)(super.prevPosZ + (super.posZ - super.prevPosZ) * (double)partialTicks - EntityFX.interpPosZ); - tess.setColorRGBA_F(super.particleRed, super.particleGreen, super.particleBlue, 1.0F); + tess.setColorRGBA_F(super.particleRed, super.particleGreen, super.particleBlue, alpha); tess.addVertexWithUV((double)(x - par3 * scale - par6 * scale), (double)(y - par4 * scale), (double)(z - par5 * scale - par7 * scale), (double)f7, (double)f9); tess.addVertexWithUV((double)(x - par3 * scale + par6 * scale), (double)(y + par4 * scale), (double)(z - par5 * scale + par7 * scale), (double)f7, (double)f8); tess.addVertexWithUV((double)(x + par3 * scale + par6 * scale), (double)(y + par4 * scale), (double)(z + par5 * scale + par7 * scale), (double)f6, (double)f8); @@ -74,10 +90,10 @@ public void onUpdate() { if(!super.isDead && this.canMove) { if(this.circling) { Vec3 motion = Vec3.createVectorHelper(super.motionX, super.motionY, super.motionZ); - motion.rotateAroundY(0.5F); - super.motionX = motion.xCoord *= 1.08D; - super.motionY = motion.yCoord *= 0.85D; - super.motionZ = motion.zCoord *= 1.08D; + motion.rotateAroundY(0.35F); + super.motionX = motion.xCoord * 0.98D; + super.motionY = motion.yCoord * 0.92D; + super.motionZ = motion.zCoord * 0.98D; } else { super.motionY -= 0.04D * (double)super.particleGravity; } @@ -120,4 +136,14 @@ public NaturePowerFX setCircling(boolean circling) { return this; } + public NaturePowerFX setFade(boolean fade) { + this.fade = fade; + return this; + } + + public NaturePowerFX setPulseScale(boolean pulseScale) { + this.pulseScale = pulseScale; + return this; + } + } diff --git a/src/main/java/com/emoniph/witchery/client/renderer/RenderChalice.java b/src/main/java/com/emoniph/witchery/client/renderer/RenderChalice.java index e7686ff..1ac72ea 100644 --- a/src/main/java/com/emoniph/witchery/client/renderer/RenderChalice.java +++ b/src/main/java/com/emoniph/witchery/client/renderer/RenderChalice.java @@ -1,39 +1,39 @@ -package com.emoniph.witchery.client.renderer; - -import com.emoniph.witchery.blocks.BlockChalice; -import com.emoniph.witchery.client.model.ModelChalice; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class RenderChalice extends TileEntitySpecialRenderer { - - final ModelChalice model = new ModelChalice(); - private static final ResourceLocation TEXTURE_URL = new ResourceLocation("witchery", "textures/blocks/chalice.png"); - - - public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)d, (float)d1, (float)d2); - BlockChalice.TileEntityChalice tileEntityChalice = (BlockChalice.TileEntityChalice)tileEntity; - this.renderChalice(tileEntityChalice, tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - GL11.glPopMatrix(); - } - - public void renderChalice(BlockChalice.TileEntityChalice tileEntityChalice, World world, int x, int y, int z) { - GL11.glPushMatrix(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - this.bindTexture(TEXTURE_URL); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(0.0F, -1.0F, 0.0F); - this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, tileEntityChalice); - GL11.glPopMatrix(); - } - -} +package com.emoniph.witchery.client.renderer; + +import com.emoniph.witchery.blocks.BlockChalice; +import com.emoniph.witchery.client.model.ModelChalice; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderChalice extends TileEntitySpecialRenderer { + + final ModelChalice model = new ModelChalice(); + private static final ResourceLocation TEXTURE_URL = new ResourceLocation("witchery", "textures/blocks/chalice.png"); + + + public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)d, (float)d1, (float)d2); + BlockChalice.TileEntityChalice tileEntityChalice = tileEntity instanceof BlockChalice.TileEntityChalice ? (BlockChalice.TileEntityChalice)tileEntity : null; + this.renderChalice(tileEntityChalice, tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + GL11.glPopMatrix(); + } + + public void renderChalice(BlockChalice.TileEntityChalice tileEntityChalice, World world, int x, int y, int z) { + GL11.glPushMatrix(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + this.bindTexture(TEXTURE_URL); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, -1.0F, 0.0F); + this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, tileEntityChalice); + GL11.glPopMatrix(); + } + +} diff --git a/src/main/java/com/emoniph/witchery/client/renderer/RenderMysticBranch.java b/src/main/java/com/emoniph/witchery/client/renderer/RenderMysticBranch.java index 567180c..45ae9af 100644 --- a/src/main/java/com/emoniph/witchery/client/renderer/RenderMysticBranch.java +++ b/src/main/java/com/emoniph/witchery/client/renderer/RenderMysticBranch.java @@ -1,5 +1,6 @@ package com.emoniph.witchery.client.renderer; +import com.emoniph.witchery.Witchery; import com.emoniph.witchery.client.model.ModelMysticBranch; import com.emoniph.witchery.util.Config; import com.emoniph.witchery.util.RenderUtil; @@ -13,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.client.IItemRenderer.ItemRendererHelper; @@ -62,6 +64,7 @@ public void renderItem(ItemRenderType type, ItemStack item, Object ... data) { if(data.length > 1 && data[1] != null) { if(data[1] instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)data[1]; + this.spawnCastingFX(player); if((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && (!(Minecraft.getMinecraft().currentScreen instanceof GuiInventory) && !(Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) || RenderManager.instance.playerViewY != 180.0F)) { if(player.isInvisible()) { RenderUtil.blend(true); @@ -84,6 +87,22 @@ public void renderItem(ItemRenderType type, ItemStack item, Object ... data) { } } + private void spawnCastingFX(EntityPlayer player) { + if(player.worldObj != null && player.worldObj.isRemote && player.isUsingItem()) { + for(int i = 0; i < 2; ++i) { + if(player.worldObj.rand.nextInt(2) == 0) { + Vec3 look = player.getLook(1.0F); + double tipX = player.posX + look.xCoord * 1.1D + (player.worldObj.rand.nextDouble() - 0.5D) * 0.35D; + double tipY = player.posY + (double)player.getEyeHeight() - 0.15D + look.yCoord * 1.1D + (player.worldObj.rand.nextDouble() - 0.5D) * 0.35D; + double tipZ = player.posZ + look.zCoord * 1.1D + (player.worldObj.rand.nextDouble() - 0.5D) * 0.35D; + float white = 0.6F + player.worldObj.rand.nextFloat() * 0.4F; + Witchery.proxy.generateParticle(player.worldObj, tipX, tipY, tipZ, 0.6F * white, 0.3F * white, white, 6 + player.worldObj.rand.nextInt(5), 0.0F); + } + } + } + + } + private void renderModel(Entity player) { this.model.render(player, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); Minecraft mc = Minecraft.getMinecraft(); diff --git a/src/main/java/com/emoniph/witchery/client/renderer/RenderPortkey.java b/src/main/java/com/emoniph/witchery/client/renderer/RenderPortkey.java new file mode 100644 index 0000000..2939639 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/client/renderer/RenderPortkey.java @@ -0,0 +1,38 @@ +package com.emoniph.witchery.client.renderer; + +import com.emoniph.witchery.client.model.ModelPortkey; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderPortkey extends TileEntitySpecialRenderer { + + final ModelPortkey model = new ModelPortkey(); + // Reuse the chalice texture — same appearance + private static final ResourceLocation TEXTURE_URL = new ResourceLocation("witchery", "textures/blocks/chalice.png"); + + + public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)d, (float)d1, (float)d2); + this.renderPortkey(tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + GL11.glPopMatrix(); + } + + public void renderPortkey(World world, int x, int y, int z) { + GL11.glPushMatrix(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + this.bindTexture(TEXTURE_URL); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, -1.0F, 0.0F); + this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + +} diff --git a/src/main/java/com/emoniph/witchery/client/renderer/RenderSpellEffect.java b/src/main/java/com/emoniph/witchery/client/renderer/RenderSpellEffect.java index a24b470..612543b 100644 --- a/src/main/java/com/emoniph/witchery/client/renderer/RenderSpellEffect.java +++ b/src/main/java/com/emoniph/witchery/client/renderer/RenderSpellEffect.java @@ -1,5 +1,6 @@ package com.emoniph.witchery.client.renderer; +import com.emoniph.witchery.client.particle.NaturePowerFX; import com.emoniph.witchery.entity.EntitySpellEffect; import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; @@ -9,10 +10,8 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -21,6 +20,7 @@ public class RenderSpellEffect extends Render { private float field_77002_a; private static final ResourceLocation RESOURCE_LOCATION = new ResourceLocation("witchery", "textures/entities/spelleffect.png"); + private static final ResourceLocation ORB_TEXTURE = NaturePowerFX.particles; public RenderSpellEffect(float par1) { @@ -29,12 +29,13 @@ public RenderSpellEffect(float par1) { public void doRenderSpellEffect(EntitySpellEffect effectEntity, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix(); - this.bindEntityTexture(effectEntity); + super.bindTexture(ORB_TEXTURE); GL11.glTranslatef((float)par2, (float)par4, (float)par6); RenderUtil.blend(true); + GL11.glDepthMask(false); + GL11.glBlendFunc(770, 1); float scale = 1.0F; int color = 16711680; - IIcon icon2 = Items.snowball.getIconFromDamage(0); SymbolEffect effect = EffectRegistry.instance().getEffect(effectEntity.getEffectID()); if(effect != null && effect instanceof SymbolEffectProjectile) { SymbolEffectProjectile f2 = (SymbolEffectProjectile)effect; @@ -42,35 +43,53 @@ public void doRenderSpellEffect(EntitySpellEffect effectEntity, double par2, dou scale = f2.getSize(); } - float f21 = this.field_77002_a * scale * 0.65F; - GL11.glScalef(f21 / 1.0F, f21 / 1.0F, f21 / 1.0F); - float red = (float)(color >>> 16 & 255) / 256.0F; - float green = (float)(color >>> 8 & 255) / 256.0F; - float blue = (float)(color & 255) / 256.0F; - GL11.glColor4f(red, green, blue, 0.55F); - Tessellator tessellator = Tessellator.instance; - float f3 = icon2.getMinU(); - float f4 = icon2.getMaxU(); - float f5 = icon2.getMinV(); - float f6 = icon2.getMaxV(); - float f7 = 1.0F; - float f8 = 0.5F; - float f9 = 0.25F; + float age = (float)effectEntity.ticksExisted + par9; + float pulse = 0.85F + 0.15F * MathHelper.sin(age * 0.3F); + float f21 = this.field_77002_a * scale * 0.85F * pulse; + float red = (float)(color >>> 16 & 255) / 255.0F; + float green = (float)(color >>> 8 & 255) / 255.0F; + float blue = (float)(color & 255) / 255.0F; + + // First 16px frame of power.png is a soft round glow (tile 0 of a 16x16 atlas grid). + float u0 = 0.0F; + float u1 = 0.0624375F; + float v0 = 0.0F; + float v1 = 0.0624375F; + GL11.glRotatef(180.0F - super.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-super.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(age * 4.0F, 0.0F, 0.0F, 1.0F); + + Tessellator tessellator = Tessellator.instance; + + // Outer soft halo + this.drawOrbQuad(tessellator, f21 * 1.0F, red, green, blue, 0.35F, u0, u1, v0, v1); + // Bright inner core (counter-rotated for a shimmer effect) + GL11.glRotatef(-age * 7.0F, 0.0F, 0.0F, 1.0F); + float coreR = red + (1.0F - red) * 0.5F; + float coreG = green + (1.0F - green) * 0.5F; + float coreB = blue + (1.0F - blue) * 0.5F; + this.drawOrbQuad(tessellator, f21 * 0.55F, coreR, coreG, coreB, 0.7F, u0, u1, v0, v1); + + GL11.glDepthMask(true); + RenderUtil.blend(false); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + private void drawOrbQuad(Tessellator tessellator, float radius, float red, float green, float blue, float alpha, float u0, float u1, float v0, float v1) { + GL11.glColor4f(red, green, blue, alpha); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); - tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6); - tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6); - tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5); - tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5); + tessellator.addVertexWithUV((double)(-radius), (double)(-radius), 0.0D, (double)u0, (double)v1); + tessellator.addVertexWithUV((double)radius, (double)(-radius), 0.0D, (double)u1, (double)v1); + tessellator.addVertexWithUV((double)radius, (double)radius, 0.0D, (double)u1, (double)v0); + tessellator.addVertexWithUV((double)(-radius), (double)radius, 0.0D, (double)u0, (double)v0); tessellator.draw(); - RenderUtil.blend(false); - GL11.glPopMatrix(); } protected ResourceLocation getSpellEffectTextures(EntitySpellEffect effect) { - return TextureMap.locationItemsTexture; + return ORB_TEXTURE; } protected ResourceLocation getEntityTexture(Entity par1Entity) { diff --git a/src/main/java/com/emoniph/witchery/commands/CommandCrucio.java b/src/main/java/com/emoniph/witchery/commands/CommandCrucio.java new file mode 100644 index 0000000..8b3db3e --- /dev/null +++ b/src/main/java/com/emoniph/witchery/commands/CommandCrucio.java @@ -0,0 +1,63 @@ +package com.emoniph.witchery.commands; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; + +import java.util.HashMap; +import java.util.Map; + +public class CommandCrucio extends CommandBase { + + // Mapa para almacenar cuántos corazones de daño configuró cada jugador para su próximo hechizo Crucio. + public static final Map CRUCIO_POWER = new HashMap(); + + @Override + public String getCommandName() { + return "crucio"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/crucio "; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return sender instanceof EntityPlayer; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!(sender instanceof EntityPlayer)) return; + EntityPlayer player = (EntityPlayer) sender; + + if (args.length == 0) { + player.addChatMessage(new ChatComponentText("Uso: " + getCommandUsage(sender))); + return; + } + + try { + int corazones = Integer.parseInt(args[0]); + if (corazones < 1) corazones = 1; + + // Límite de corazones solicitado: 10 (20 de vida total) + if (corazones > 10) { + corazones = 10; + player.addChatMessage(new ChatComponentText("No puedes torturar por más de 10 corazones. ¡Para matar instantáneamente debes usar Avada Kedavra!")); + } + + CRUCIO_POWER.put(player, corazones); + player.addChatMessage(new ChatComponentText("Has configurado tu próxima Maldición Cruciatus a " + corazones + " corazones de agonía progresiva.")); + + } catch (NumberFormatException e) { + player.addChatMessage(new ChatComponentText("Por favor, introduce un número válido de corazones.")); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/commands/CommandHobgoblin.java b/src/main/java/com/emoniph/witchery/commands/CommandHobgoblin.java new file mode 100644 index 0000000..6a8a0b9 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/commands/CommandHobgoblin.java @@ -0,0 +1,145 @@ +package com.emoniph.witchery.commands; + +import com.emoniph.witchery.entity.EntityGoblin; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; + +import java.util.List; + +public class CommandHobgoblin extends CommandBase { + + @Override + public String getCommandName() { + return "hobgoblin"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/hobgoblin "; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return sender instanceof EntityPlayer; + } + + private EntityLivingBase getLookedAtEntity(EntityPlayer player, double range) { + Vec3 vec3 = Vec3.createVectorHelper(player.posX, player.posY, player.posZ); + vec3.yCoord += player.getEyeHeight(); + Vec3 vec31 = player.getLook(1.0F); + Vec3 vec32 = vec3.addVector(vec31.xCoord * range, vec31.yCoord * range, vec31.zCoord * range); + + EntityLivingBase pointedEntity = null; + List list = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.addCoord(vec31.xCoord * range, vec31.yCoord * range, vec31.zCoord * range).expand(1.0D, 1.0D, 1.0D)); + double d2 = range; + + for (int i = 0; i < list.size(); ++i) { + net.minecraft.entity.Entity entity = (net.minecraft.entity.Entity)list.get(i); + if (entity.canBeCollidedWith() && entity instanceof EntityLivingBase) { + float f1 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)f1, (double)f1, (double)f1); + MovingObjectPosition mop = axisalignedbb.calculateIntercept(vec3, vec32); + if (axisalignedbb.isVecInside(vec3)) { + if (d2 >= 0.0D) { + pointedEntity = (EntityLivingBase)entity; + d2 = 0.0D; + } + } else if (mop != null) { + double d3 = vec3.distanceTo(mop.hitVec); + if (d3 < d2 || d2 == 0.0D) { + pointedEntity = (EntityLivingBase)entity; + d2 = d3; + } + } + } + } + return pointedEntity; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!(sender instanceof EntityPlayer)) return; + EntityPlayer player = (EntityPlayer) sender; + + if (args.length == 0) { + player.addChatMessage(new ChatComponentText("Usage: " + getCommandUsage(sender))); + return; + } + + String subCommand = args[0].toLowerCase(); + EntityLivingBase lookedAtEntity = getLookedAtEntity(player, 30.0D); + + if (subCommand.equals("attack")) { + if (lookedAtEntity == null) { + player.addChatMessage(new ChatComponentText("You must look at the enemy you want your hobgoblins to attack.")); + return; + } + + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(player.posX - 30.0D, player.posY - 30.0D, player.posZ - 30.0D, player.posX + 30.0D, player.posY + 30.0D, player.posZ + 30.0D); + List goblins = player.worldObj.getEntitiesWithinAABB(EntityGoblin.class, bb); + + int attackCount = 0; + for (EntityGoblin goblin : goblins) { + if (goblin.isTamed && player.getCommandSenderName().equals(goblin.tamedOwnerName) && !goblin.isSitting) { + goblin.setAttackTarget(lookedAtEntity); + attackCount++; + } + } + + if (attackCount > 0) { + player.addChatMessage(new ChatComponentText(attackCount + " hobgoblins have locked onto the target.")); + } else { + player.addChatMessage(new ChatComponentText("There are no tame hobgoblins nearby that can attack.")); + } + return; + } + + // For other commands, we MUST be looking at a tamed hobgoblin + if (lookedAtEntity == null || !(lookedAtEntity instanceof EntityGoblin)) { + player.addChatMessage(new ChatComponentText("You must look directly at one of your hobgoblins to give this order.")); + return; + } + + EntityGoblin goblin = (EntityGoblin) lookedAtEntity; + + if (!goblin.isTamed || goblin.tamedOwnerName == null || !goblin.tamedOwnerName.equals(player.getCommandSenderName())) { + player.addChatMessage(new ChatComponentText("This hobgoblin is not yours. It will not obey your orders.")); + return; + } + + if (subCommand.equals("stay")) { + goblin.isSitting = true; + goblin.isFollowing = false; + goblin.setAttackTarget(null); + goblin.getNavigator().clearPathEntity(); + player.addChatMessage(new ChatComponentText("The hobgoblin will wait here.")); + } else if (subCommand.equals("follow")) { + goblin.isSitting = false; + goblin.isFollowing = true; + player.addChatMessage(new ChatComponentText("The hobgoblin will follow and protect you.")); + } else if (subCommand.equals("release")) { + goblin.isTamed = false; + goblin.tamedOwnerName = ""; + goblin.isSitting = false; + goblin.isFollowing = false; + goblin.setAttackTarget(null); + goblin.getNavigator().clearPathEntity(); + player.addChatMessage(new ChatComponentText("You have released the hobgoblin. It will no longer follow you.")); + } else if (subCommand.equals("inventory")) { + player.displayGUIChest(new com.emoniph.witchery.infusion.infusions.symbols.InventoryMobEquipment(goblin)); + } else { + player.addChatMessage(new ChatComponentText("Unknown command. Valid commands are: follow, stay, attack, release, inventory.")); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/commands/CommandImperio.java b/src/main/java/com/emoniph/witchery/commands/CommandImperio.java new file mode 100644 index 0000000..71129b4 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/commands/CommandImperio.java @@ -0,0 +1,192 @@ +package com.emoniph.witchery.commands; + +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class CommandImperio extends CommandBase { + + @Override + public String getCommandName() { + return "imperio"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/imperio [args]"; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return sender instanceof EntityPlayer; + } + + private EntityLivingBase getLookedAtEntity(EntityPlayer player, double range) { + Vec3 vec3 = Vec3.createVectorHelper(player.posX, player.posY, player.posZ); + vec3.yCoord += player.getEyeHeight(); + Vec3 vec31 = player.getLook(1.0F); + Vec3 vec32 = vec3.addVector(vec31.xCoord * range, vec31.yCoord * range, vec31.zCoord * range); + + EntityLivingBase pointedEntity = null; + List list = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.addCoord(vec31.xCoord * range, vec31.yCoord * range, vec31.zCoord * range).expand(1.0D, 1.0D, 1.0D)); + double d2 = range; + + for (int i = 0; i < list.size(); ++i) { + net.minecraft.entity.Entity entity = (net.minecraft.entity.Entity)list.get(i); + if (entity.canBeCollidedWith() && entity instanceof EntityLivingBase) { + float f1 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)f1, (double)f1, (double)f1); + MovingObjectPosition mop = axisalignedbb.calculateIntercept(vec3, vec32); + if (axisalignedbb.isVecInside(vec3)) { + if (d2 >= 0.0D) { + pointedEntity = (EntityLivingBase)entity; + d2 = 0.0D; + } + } else if (mop != null) { + double d3 = vec3.distanceTo(mop.hitVec); + if (d3 < d2 || d2 == 0.0D) { + pointedEntity = (EntityLivingBase)entity; + d2 = d3; + } + } + } + } + return pointedEntity; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!(sender instanceof EntityPlayer)) return; + EntityPlayer player = (EntityPlayer) sender; + + if (args.length == 0) { + player.addChatMessage(new ChatComponentText("Usage: " + getCommandUsage(sender))); + return; + } + + String subCommand = args[0].toLowerCase(); + + // 1. Get the entity we are looking at (RayTrace) + EntityLivingBase lookedAtEntity = getLookedAtEntity(player, 30.0D); + + // Fetch all controlled entities for context + List controlledEntities = new ArrayList(); + for (Map.Entry entry : SymbolEffectImperio.IMPERIO_TARGETS.entrySet()) { + if (entry.getValue() == player && entry.getKey().isEntityAlive()) { + controlledEntities.add(entry.getKey()); + } + } + + if (controlledEntities.isEmpty()) { + player.addChatMessage(new ChatComponentText("You do not have any creature under your mental control.")); + return; + } + + // Logic for ATTACK (Target Enemy) + if (subCommand.equals("attack")) { + if (lookedAtEntity == null) { + player.addChatMessage(new ChatComponentText("You must look at the enemy you want your army to attack.")); + return; + } + if (controlledEntities.contains(lookedAtEntity)) { + player.addChatMessage(new ChatComponentText("You cannot order them to attack an ally of the hive mind.")); + return; + } + int attackCount = 0; + for (EntityLivingBase minion : controlledEntities) { + if (!SymbolEffectImperio.IMPERIO_STAYING_TARGETS.contains(minion) && minion instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving) minion).setAttackTarget(lookedAtEntity); + attackCount++; + } + } + player.addChatMessage(new ChatComponentText(attackCount + " creatures have locked onto the target.")); + return; + } + + // The rest of the commands REQUIRE the looked-at entity to be an ALIEN CONTROLLED BY US + if (lookedAtEntity == null || !controlledEntities.contains(lookedAtEntity)) { + player.addChatMessage(new ChatComponentText("You must look directly at one of your creatures to give this order.")); + return; + } + + EntityLivingBase target = lookedAtEntity; + + if (subCommand.equals("forward") || subCommand.equals("backward")) { + SymbolEffectImperio.IMPERIO_STAYING_TARGETS.remove(target); + int steps = 1; + if (args.length > 1) { + try { steps = Integer.parseInt(args[1]); } catch (NumberFormatException e) {} + } + int multiplier = subCommand.equals("forward") ? 1 : -1; + + if (target instanceof net.minecraft.entity.EntityLiving) { + double destX = target.posX + target.getLookVec().xCoord * steps * multiplier; + double destY = target.posY; + double destZ = target.posZ + target.getLookVec().zCoord * steps * multiplier; + ((net.minecraft.entity.EntityLiving) target).getNavigator().tryMoveToXYZ(destX, destY, destZ, 1.0D); + } else if (target instanceof EntityPlayer) { + target.setPositionAndUpdate(target.posX + target.getLookVec().xCoord * steps * multiplier, target.posY, target.posZ + target.getLookVec().zCoord * steps * multiplier); + } + player.addChatMessage(new ChatComponentText("The creature moves " + steps + " steps.")); + + } else if (subCommand.equals("coord")) { + SymbolEffectImperio.IMPERIO_STAYING_TARGETS.remove(target); + if (args.length < 4) { + player.addChatMessage(new ChatComponentText("Usage: /imperio coord ")); + return; + } + try { + int x = Integer.parseInt(args[1]); + int y = Integer.parseInt(args[2]); + int z = Integer.parseInt(args[3]); + if (target instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving) target).getNavigator().tryMoveToXYZ(x, y, z, 1.0D); + } else if (target instanceof EntityPlayer) { + target.setPositionAndUpdate(x, y, z); + } + player.addChatMessage(new ChatComponentText("Creature directed to " + x + ", " + y + ", " + z)); + } catch (NumberFormatException e) { + player.addChatMessage(new ChatComponentText("Invalid coordinates.")); + } + + } else if (subCommand.equals("stay")) { + SymbolEffectImperio.IMPERIO_STAYING_TARGETS.add(target); + if (target instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving) target).setAttackTarget(null); + ((net.minecraft.entity.EntityLiving) target).getNavigator().clearPathEntity(); + } + player.addChatMessage(new ChatComponentText("The creature will wait here and not attack anyone.")); + + } else if (subCommand.equals("release")) { + SymbolEffectImperio.IMPERIO_TARGETS.remove(target); + SymbolEffectImperio.IMPERIO_STAYING_TARGETS.remove(target); + target.removePotionEffect(com.emoniph.witchery.Witchery.Potions.PARALYSED.id); + player.addChatMessage(new ChatComponentText("You have released the creature from your control.")); + + } else if (subCommand.equals("inventory")) { + if (target instanceof EntityPlayer) { + player.displayGUIChest(((EntityPlayer) target).inventory); + } else { + player.displayGUIChest(new com.emoniph.witchery.infusion.infusions.symbols.InventoryMobEquipment(target)); + } + } else { + player.addChatMessage(new ChatComponentText("Unknown command.")); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/commands/CommandPet.java b/src/main/java/com/emoniph/witchery/commands/CommandPet.java new file mode 100644 index 0000000..75358af --- /dev/null +++ b/src/main/java/com/emoniph/witchery/commands/CommandPet.java @@ -0,0 +1,143 @@ +package com.emoniph.witchery.commands; + +import com.emoniph.witchery.util.TameableUtil; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; + +import java.util.List; + +public class CommandPet extends CommandBase { + + @Override + public String getCommandName() { + return "pet"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/pet "; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return sender instanceof EntityPlayer; + } + + private EntityLivingBase getLookedAtEntity(EntityPlayer player, double range) { + Vec3 vec3 = Vec3.createVectorHelper(player.posX, player.posY, player.posZ); + vec3.yCoord += player.getEyeHeight(); + Vec3 vec31 = player.getLook(1.0F); + Vec3 vec32 = vec3.addVector(vec31.xCoord * range, vec31.yCoord * range, vec31.zCoord * range); + + EntityLivingBase pointedEntity = null; + List list = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.addCoord(vec31.xCoord * range, vec31.yCoord * range, vec31.zCoord * range).expand(1.0D, 1.0D, 1.0D)); + double d2 = range; + + for (int i = 0; i < list.size(); ++i) { + net.minecraft.entity.Entity entity = (net.minecraft.entity.Entity)list.get(i); + if (entity.canBeCollidedWith() && entity instanceof EntityLivingBase) { + float f1 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)f1, (double)f1, (double)f1); + MovingObjectPosition mop = axisalignedbb.calculateIntercept(vec3, vec32); + if (axisalignedbb.isVecInside(vec3)) { + if (d2 >= 0.0D) { + pointedEntity = (EntityLivingBase)entity; + d2 = 0.0D; + } + } else if (mop != null) { + double d3 = vec3.distanceTo(mop.hitVec); + if (d3 < d2 || d2 == 0.0D) { + pointedEntity = (EntityLivingBase)entity; + d2 = d3; + } + } + } + } + return pointedEntity; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!(sender instanceof EntityPlayer)) return; + EntityPlayer player = (EntityPlayer) sender; + + if (args.length == 0) { + player.addChatMessage(new ChatComponentText("Usage: " + getCommandUsage(sender))); + return; + } + + String subCommand = args[0].toLowerCase(); + EntityLivingBase lookedAtEntity = getLookedAtEntity(player, 30.0D); + + if (subCommand.equals("attack")) { + if (lookedAtEntity == null) { + player.addChatMessage(new ChatComponentText("You must look at the enemy you want your pets to attack.")); + return; + } + + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(player.posX - 30.0D, player.posY - 30.0D, player.posZ - 30.0D, player.posX + 30.0D, player.posY + 30.0D, player.posZ + 30.0D); + List pets = player.worldObj.getEntitiesWithinAABB(EntityTameable.class, bb); + + int attackCount = 0; + for (EntityTameable pet : pets) { + if (pet.isTamed() && TameableUtil.isOwner(pet, player) && !pet.isSitting()) { + pet.setAttackTarget(lookedAtEntity); + attackCount++; + } + } + + if (attackCount > 0) { + player.addChatMessage(new ChatComponentText(attackCount + " pets have locked onto the target.")); + } else { + player.addChatMessage(new ChatComponentText("There are no tame pets nearby that can attack.")); + } + return; + } + + // For other commands, we MUST be looking at a tamed pet + if (lookedAtEntity == null || !(lookedAtEntity instanceof EntityTameable)) { + player.addChatMessage(new ChatComponentText("You must look directly at one of your pets to give this order.")); + return; + } + + EntityTameable pet = (EntityTameable) lookedAtEntity; + + if (!pet.isTamed() || !TameableUtil.isOwner(pet, player)) { + player.addChatMessage(new ChatComponentText("This pet is not yours. It will not obey your orders.")); + return; + } + + if (subCommand.equals("stay")) { + pet.setSitting(true); + pet.setAttackTarget(null); + pet.getNavigator().clearPathEntity(); + player.addChatMessage(new ChatComponentText("The pet will wait here.")); + } else if (subCommand.equals("follow")) { + pet.setSitting(false); + player.addChatMessage(new ChatComponentText("The pet will follow and protect you.")); + } else if (subCommand.equals("release")) { + pet.setTamed(false); + pet.func_152115_b(""); // Clear owner ID string + pet.setSitting(false); + pet.setAttackTarget(null); + pet.getNavigator().clearPathEntity(); + player.addChatMessage(new ChatComponentText("You have released the pet. It will no longer follow you.")); + } else if (subCommand.equals("inventory")) { + player.displayGUIChest(new com.emoniph.witchery.infusion.infusions.symbols.InventoryMobEquipment(pet)); + } else { + player.addChatMessage(new ChatComponentText("Unknown command. Valid commands are: follow, stay, attack, release, inventory.")); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/common/ChantCommand.java b/src/main/java/com/emoniph/witchery/common/ChantCommand.java index 6a41db9..e1d665d 100644 --- a/src/main/java/com/emoniph/witchery/common/ChantCommand.java +++ b/src/main/java/com/emoniph/witchery/common/ChantCommand.java @@ -41,6 +41,14 @@ public void processCommand(ICommandSender sender, String[] args) { String strings = Strings.join(args, " "); EntityPlayer player = world.getPlayerEntityByName(sender.getCommandSenderName()); if(player != null) { + if(com.emoniph.witchery.common.ExtendedPlayer.trySayAstralProjection(player, strings)) { + return; + } + + if(com.emoniph.witchery.common.ExtendedPlayer.trySaySpiritForm(player, strings)) { + return; + } + if(Witchery.Items.RUBY_SLIPPERS.trySayTheresNoPlaceLikeHome(player, strings)) { return; } diff --git a/src/main/java/com/emoniph/witchery/common/CommandWitcheryLevel.java b/src/main/java/com/emoniph/witchery/common/CommandWitcheryLevel.java new file mode 100644 index 0000000..e5e10cf --- /dev/null +++ b/src/main/java/com/emoniph/witchery/common/CommandWitcheryLevel.java @@ -0,0 +1,68 @@ +package com.emoniph.witchery.common; + +import com.emoniph.witchery.Witchery; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; + +import java.util.List; + +public class CommandWitcheryLevel extends CommandBase { + + @Override + public String getCommandName() { + return "witcherylevel"; + } + + @Override + public int getRequiredPermissionLevel() { + return 2; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/witcherylevel <0-10>"; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (args.length < 3) { + throw new WrongUsageException(getCommandUsage(sender)); + } + + EntityPlayerMP player = getPlayer(sender, args[0]); + String type = args[1].toLowerCase(); + int level = parseIntBounded(sender, args[2], 0, 10); + + ExtendedPlayer playerEx = ExtendedPlayer.get(player); + if (playerEx == null) { + throw new CommandException("Player does not have Witchery data"); + } + + if (type.equals("vampire")) { + playerEx.setVampireLevel(level); + } else if (type.equals("werewolf")) { + playerEx.setWerewolfLevel(level); + } else if (type.equals("spirit")) { + playerEx.setSpiritLevel(level); + } else { + throw new WrongUsageException(getCommandUsage(sender)); + } + + sender.addChatMessage(new ChatComponentText("Successfully set " + type + " level to " + level + " for " + player.getCommandSenderName())); + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args) { + if (args.length == 1) { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } else if (args.length == 2) { + return getListOfStringsMatchingLastWord(args, new String[]{"vampire", "werewolf", "spirit"}); + } + return null; + } +} diff --git a/src/main/java/com/emoniph/witchery/common/CommonProxy.java b/src/main/java/com/emoniph/witchery/common/CommonProxy.java index 901a655..12b7100 100644 --- a/src/main/java/com/emoniph/witchery/common/CommonProxy.java +++ b/src/main/java/com/emoniph/witchery/common/CommonProxy.java @@ -1,128 +1,127 @@ -package com.emoniph.witchery.common; - -import com.emoniph.witchery.blocks.BlockAreaMarker; -import com.emoniph.witchery.blocks.BlockDistillery; -import com.emoniph.witchery.blocks.BlockSpinningWheel; -import com.emoniph.witchery.blocks.BlockWitchesOven; -import com.emoniph.witchery.brewing.DispersalTriggered; -import com.emoniph.witchery.brewing.potions.WitcheryPotions; -import com.emoniph.witchery.common.GenericEvents; -import com.emoniph.witchery.entity.EntityBroom; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.item.ItemBrewBag; -import com.emoniph.witchery.item.ItemGoblinClothes; -import com.emoniph.witchery.item.ItemLeonardsUrn; -import com.emoniph.witchery.item.ItemPoppet; -import com.emoniph.witchery.item.ItemWitchHand; -import com.emoniph.witchery.ritual.rites.RitePriorIncarnation; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import com.emoniph.witchery.worldgen.WorldHandlerVillageDistrict; -import cpw.mods.fml.common.network.IGuiHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import cpw.mods.fml.relauncher.Side; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; - -public class CommonProxy implements IGuiHandler { - - private static final Map extendedEntityData = new HashMap(); - - - public static void storeEntityData(String name, NBTTagCompound compound) { - extendedEntityData.put(name, compound); - } - - public static NBTTagCompound getEntityData(String name) { - return (NBTTagCompound)extendedEntityData.remove(name); - } - - public void preInit() {} - - public void registerEvents() { - MinecraftForge.EVENT_BUS.register(new ItemPoppet.PoppetEventHooks()); - MinecraftForge.EVENT_BUS.register(new Infusion.EventHooks()); - MinecraftForge.EVENT_BUS.register(new ItemWitchHand.EventHooks()); - MinecraftForge.EVENT_BUS.register(new EntityBroom.EventHooks()); - MinecraftForge.EVENT_BUS.register(new RitePriorIncarnation.EventHooks()); - MinecraftForge.EVENT_BUS.register(new BlockAreaMarker.AreaMarkerEventHooks()); - MinecraftForge.EVENT_BUS.register(new GenericEvents()); - MinecraftForge.EVENT_BUS.register(new ItemGoblinClothes.EventHooks()); - MinecraftForge.EVENT_BUS.register(new WitcheryPotions.EventHooks()); - MinecraftForge.EVENT_BUS.register(new DispersalTriggered.EventHooks()); - MinecraftForge.TERRAIN_GEN_BUS.register(new WorldHandlerVillageDistrict.EventHooks()); - } - - public void registerRenderers() {} - - public void registerServerHandlers() {} - - public void registerHandlers() {} - - public void postInit() {} - - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch(ID) { - case 0: - return null; - case 1: - case 6: - case 7: - default: - return null; - case 2: - return new BlockWitchesOven.ContainerWitchesOven(player.inventory, (BlockWitchesOven.TileEntityWitchesOven)world.getTileEntity(x, y, z)); - case 3: - return new BlockDistillery.ContainerDistillery(player.inventory, (BlockDistillery.TileEntityDistillery)world.getTileEntity(x, y, z)); - case 4: - return new BlockSpinningWheel.ContainerSpinningWheel(player.inventory, (BlockSpinningWheel.TileEntitySpinningWheel)world.getTileEntity(x, y, z)); - case 5: - return new ItemBrewBag.ContainerBrewBag(player.inventory, new ItemBrewBag.InventoryBrewBag(player), player.getHeldItem()); - case 8: - return new ItemLeonardsUrn.ContainerLeonardsUrn(player.inventory, new ItemLeonardsUrn.InventoryLeonardsUrn(player), player.getHeldItem()); - } - } - - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - return null; - } - - public boolean getGraphicsLevel() { - return false; - } - - public int getStockageRenderId() { - return 0; - } - - public int getGasRenderId() { - return 0; - } - - public int getPitGrassRenderId() { - return 0; - } - - public int getBrewLiquidRenderId() { - return 0; - } - - public void registerVillagers() {} - - public void generateParticle(World worldObj, double posX, double posY, double posZ, float f, float g, float h, int i, float j) {} - - public EntityPlayer getPlayer(MessageContext ctx) { - return ctx.side == Side.SERVER?ctx.getServerHandler().playerEntity:null; - } - - public int getVineRenderId() { - return 0; - } - - public void showParticleEffect(World world, double x, double y, double z, double width, double height, SoundEffect sound, int color, ParticleEffect particle) {} - -} +package com.emoniph.witchery.common; + +import com.emoniph.witchery.blocks.BlockAreaMarker; +import com.emoniph.witchery.blocks.BlockDistillery; +import com.emoniph.witchery.blocks.BlockSpinningWheel; +import com.emoniph.witchery.blocks.BlockWitchesOven; +import com.emoniph.witchery.brewing.DispersalTriggered; +import com.emoniph.witchery.brewing.potions.WitcheryPotions; +import com.emoniph.witchery.common.GenericEvents; +import com.emoniph.witchery.entity.EntityBroom; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.item.ItemBrewBag; +import com.emoniph.witchery.item.ItemGoblinClothes; +import com.emoniph.witchery.item.ItemLeonardsUrn; +import com.emoniph.witchery.item.ItemPoppet; +import com.emoniph.witchery.item.ItemWitchHand; +import com.emoniph.witchery.ritual.rites.RitePriorIncarnation; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.worldgen.WorldHandlerVillageDistrict; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import cpw.mods.fml.relauncher.Side; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + +public class CommonProxy implements IGuiHandler { + + private static final Map extendedEntityData = new HashMap(); + + + public static void storeEntityData(String name, NBTTagCompound compound) { + extendedEntityData.put(name, compound); + } + + public static NBTTagCompound getEntityData(String name) { + return (NBTTagCompound)extendedEntityData.remove(name); + } + + public void preInit() {} + + public void registerEvents() { + MinecraftForge.EVENT_BUS.register(new ItemPoppet.PoppetEventHooks()); + MinecraftForge.EVENT_BUS.register(new Infusion.EventHooks()); + MinecraftForge.EVENT_BUS.register(new ItemWitchHand.EventHooks()); + MinecraftForge.EVENT_BUS.register(new EntityBroom.EventHooks()); + MinecraftForge.EVENT_BUS.register(new RitePriorIncarnation.EventHooks()); + MinecraftForge.EVENT_BUS.register(new BlockAreaMarker.AreaMarkerEventHooks()); + MinecraftForge.EVENT_BUS.register(new GenericEvents()); + MinecraftForge.EVENT_BUS.register(new ItemGoblinClothes.EventHooks()); + MinecraftForge.EVENT_BUS.register(new WitcheryPotions.EventHooks()); + MinecraftForge.EVENT_BUS.register(new DispersalTriggered.EventHooks()); + MinecraftForge.TERRAIN_GEN_BUS.register(new WorldHandlerVillageDistrict.EventHooks()); + } + + public void registerRenderers() {} + + public void registerServerHandlers() {} + + public void registerHandlers() {} + + public void postInit() {} + + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + switch(ID) { + case 0: + return null; + case 1: + case 6: + case 7: + default: + return null; + case 2: + return new BlockWitchesOven.ContainerWitchesOven(player.inventory, (BlockWitchesOven.TileEntityWitchesOven)world.getTileEntity(x, y, z)); + case 3: + return new BlockDistillery.ContainerDistillery(player.inventory, (BlockDistillery.TileEntityDistillery)world.getTileEntity(x, y, z)); + case 4: + return new BlockSpinningWheel.ContainerSpinningWheel(player.inventory, (BlockSpinningWheel.TileEntitySpinningWheel)world.getTileEntity(x, y, z)); + case 5: + return new ItemBrewBag.ContainerBrewBag(player.inventory, new ItemBrewBag.InventoryBrewBag(player), player.getHeldItem()); + case 8: + return new ItemLeonardsUrn.ContainerLeonardsUrn(player.inventory, new ItemLeonardsUrn.InventoryLeonardsUrn(player), player.getHeldItem()); + } + } + + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + return null; + } + + public boolean getGraphicsLevel() { + return false; + } + + public int getStockageRenderId() { + return 0; + } + + public int getGasRenderId() { + return 0; + } + + public int getPitGrassRenderId() { + return 0; + } + + public int getBrewLiquidRenderId() { + return 0; + } + + public void registerVillagers() {} + + public void generateParticle(World worldObj, double posX, double posY, double posZ, float f, float g, float h, int i, float j) {} + + public EntityPlayer getPlayer(MessageContext ctx) { + return ctx.side == Side.SERVER?ctx.getServerHandler().playerEntity:null; + } + + public int getVineRenderId() { + return 0; + } + + public void showParticleEffect(World world, double x, double y, double z, double width, double height, SoundEffect sound, int color, ParticleEffect particle) {} +} diff --git a/src/main/java/com/emoniph/witchery/common/ExtendedPlayer.java b/src/main/java/com/emoniph/witchery/common/ExtendedPlayer.java index f77e2ca..6e21938 100644 --- a/src/main/java/com/emoniph/witchery/common/ExtendedPlayer.java +++ b/src/main/java/com/emoniph/witchery/common/ExtendedPlayer.java @@ -73,6 +73,10 @@ public class ExtendedPlayer implements IExtendedEntityProperties { private int creatureType; private int werewolfLevel; private int vampireLevel; + private int vampireLevelCap; + private int spiritLevel; + private boolean getPlayerData; + private boolean isAstralProjecting; private int bloodPower; private int bloodReserve; private int vampireUltimate; @@ -92,13 +96,11 @@ public class ExtendedPlayer implements IExtendedEntityProperties { private ResourceLocation locationSkin; private NBTTagList cachedInventory; private boolean inventoryCanBeRestored; - private int vampireLevelCap; private static final int DEFAULT_ULTIMATE_CHARGES = 5; public int highlightTicks; public int cachedWorship; private final List visitedChunks; private final List visitedVampireChunks; - boolean getPlayerData; boolean resetSleep; int cachedSky; private Coord mirrorWorldEntryPoint; @@ -106,6 +108,7 @@ public class ExtendedPlayer implements IExtendedEntityProperties { static final long COOLDOWN_ESCAPE_2_TICKS = (long)TimeUtil.minsToTicks(60); long mirrorWorldEscapeCooldown1; long mirrorWorldEscapeCooldown2; + private String unbreakableVowID = ""; public static final void register(EntityPlayer player) { @@ -131,9 +134,13 @@ public void init(Entity entity, World world) {} public void saveNBTData(NBTTagCompound compound) { NBTTagCompound props = new NBTTagCompound(); props.setInteger("PotionBottling", this.skillLevelPotionBottling); - props.setInteger("PotionThrowing", this.skillLevelPotionThrowing); - props.setInteger("CreatureType", this.creatureType); props.setInteger("WerewolfLevel", this.werewolfLevel); + props.setInteger("CreatureType", this.creatureType); + props.setInteger("VampireLevel", this.vampireLevel); + props.setInteger("SpiritLevel", this.spiritLevel); + props.setBoolean("AstralProjecting", this.isAstralProjecting); + props.setInteger("BloodPower", this.bloodPower); + props.setInteger("PotionThrowing", this.skillLevelPotionThrowing); props.setInteger("WolfmanQuestState", this.wolfmanQuestState); props.setInteger("WolfmanQuestCounter", this.wolfmanQuestCounter); props.setLong("LastBoneFind", this.lastBoneFind); @@ -149,7 +156,6 @@ public void saveNBTData(NBTTagCompound compound) { } props.setTag("WolfmanQuestChunks", nbtChunks); - props.setInteger("VampireLevel", this.vampireLevel); props.setInteger("BloodPower", this.bloodPower); props.setInteger("HumanBlood", this.humanBlood); props.setInteger("VampireUltimate", this.vampireUltimate); @@ -184,57 +190,67 @@ public void saveNBTData(NBTTagCompound compound) { props.setLong("MirrorEscape1", this.mirrorWorldEscapeCooldown1); props.setLong("MirrorEscape2", this.mirrorWorldEscapeCooldown2); + if (this.unbreakableVowID != null && !this.unbreakableVowID.isEmpty()) { + props.setString("UnbreakableVowID", this.unbreakableVowID); + } compound.setTag("WitcheryExtendedPlayer", props); } public void loadNBTData(NBTTagCompound compound) { if(compound.hasKey("WitcheryExtendedPlayer")) { - NBTTagCompound props = (NBTTagCompound)compound.getTag("WitcheryExtendedPlayer"); - this.skillLevelPotionBottling = MathHelper.clamp_int(props.getInteger("PotionBottling"), 0, 100); - this.skillLevelPotionThrowing = MathHelper.clamp_int(props.getInteger("PotionThrowing"), 0, 100); - this.creatureType = MathHelper.clamp_int(props.getInteger("CreatureType"), 0, 5); - this.werewolfLevel = MathHelper.clamp_int(props.getInteger("WerewolfLevel"), 0, 10); - this.wolfmanQuestState = MathHelper.clamp_int(props.getInteger("WolfmanQuestState"), 0, ExtendedPlayer.QuestState.values().length - 1); - this.wolfmanQuestCounter = MathHelper.clamp_int(props.getInteger("WolfmanQuestCounter"), 0, 100); + NBTTagCompound nbtRoot = (NBTTagCompound)compound.getTag("WitcheryExtendedPlayer"); + this.skillLevelPotionBottling = MathHelper.clamp_int(nbtRoot.getInteger("PotionBottling"), 0, 100); + this.skillLevelPotionThrowing = MathHelper.clamp_int(nbtRoot.getInteger("PotionThrowing"), 0, 100); + this.setCreatureTypeOrdinal(nbtRoot.getInteger("CreatureType")); + this.werewolfLevel = MathHelper.clamp_int(nbtRoot.getInteger("WerewolfLevel"), 0, 10); + this.vampireLevel = nbtRoot.getInteger("VampireLevel"); + this.spiritLevel = nbtRoot.getInteger("SpiritLevel"); + this.isAstralProjecting = nbtRoot.getBoolean("AstralProjecting"); + this.bloodPower = nbtRoot.getInteger("BloodPower"); + this.wolfmanQuestState = MathHelper.clamp_int(nbtRoot.getInteger("WolfmanQuestState"), 0, ExtendedPlayer.QuestState.values().length - 1); + this.wolfmanQuestCounter = MathHelper.clamp_int(nbtRoot.getInteger("WolfmanQuestCounter"), 0, 100); this.visitedChunks.clear(); - NBTTagList nbtChunks = props.getTagList("WolfmanQuestChunks", 10); + NBTTagList nbtChunks = nbtRoot.getTagList("WolfmanQuestChunks", 10); for(int nbtVampireChunks = 0; nbtVampireChunks < nbtChunks.tagCount(); ++nbtVampireChunks) { this.visitedChunks.add(Long.valueOf(nbtChunks.getCompoundTagAt(nbtVampireChunks).getLong("Location"))); } - this.lastBoneFind = props.getLong("LastBoneFind"); - this.lastHowl = props.getLong("LastHowl"); - this.vampireLevel = MathHelper.clamp_int(props.getInteger("VampireLevel"), 0, 10); - this.bloodPower = MathHelper.clamp_int(props.getInteger("BloodPower"), 0, this.getMaxBloodPower()); - this.humanBlood = MathHelper.clamp_int(props.getInteger("HumanBlood"), 0, 500); - this.vampireUltimate = props.getInteger("VampireUltimate"); - this.vampireUltimateCharges = props.getInteger("VampireUltimateCharges"); - this.vampireLevelCap = props.getInteger("VampireLevelCap"); - this.vampireQuestCounter = props.getInteger("VampireQuestCounter"); - NBTTagList var6 = props.getTagList("VampireQuestChunks", 10); + this.lastBoneFind = nbtRoot.getLong("LastBoneFind"); + this.lastHowl = nbtRoot.getLong("LastHowl"); + this.humanBlood = MathHelper.clamp_int(nbtRoot.getInteger("HumanBlood"), 0, 500); + this.vampireUltimate = nbtRoot.getInteger("VampireUltimate"); + this.vampireUltimateCharges = nbtRoot.getInteger("VampireUltimateCharges"); + this.vampireLevelCap = nbtRoot.getInteger("VampireLevelCap"); + this.vampireQuestCounter = nbtRoot.getInteger("VampireQuestCounter"); + NBTTagList var6 = nbtRoot.getTagList("VampireQuestChunks", 10); for(int i = 0; i < var6.tagCount(); ++i) { this.visitedVampireChunks.add(Long.valueOf(var6.getCompoundTagAt(i).getLong("Location"))); } - this.bloodReserve = props.getInteger("BloodReserve"); - this.vampVisionActive = props.getBoolean("VampireVision"); - if(props.hasKey("CachedInventory2")) { - this.cachedInventory = props.getTagList("CachedInventory2", 10); - this.inventoryCanBeRestored = props.getBoolean("CanRestoreInventory"); + this.bloodReserve = nbtRoot.getInteger("BloodReserve"); + this.vampVisionActive = nbtRoot.getBoolean("VampireVision"); + if(nbtRoot.hasKey("CachedInventory2")) { + this.cachedInventory = nbtRoot.getTagList("CachedInventory2", 10); + this.inventoryCanBeRestored = nbtRoot.getBoolean("CanRestoreInventory"); } - if(props.hasKey("MirrorWorldEntryPoint")) { - this.mirrorWorldEntryPoint = Coord.fromTagNBT(props.getCompoundTag("MirrorWorldEntryPoint")); + if(nbtRoot.hasKey("MirrorWorldEntryPoint")) { + this.mirrorWorldEntryPoint = Coord.fromTagNBT(nbtRoot.getCompoundTag("MirrorWorldEntryPoint")); } - if(props.hasKey("LastPlayerSkin")) { - this.lastPlayerSkin = props.getString("LastPlayerSkin"); + if(nbtRoot.hasKey("LastPlayerSkin")) { + this.lastPlayerSkin = nbtRoot.getString("LastPlayerSkin"); } - this.mirrorWorldEscapeCooldown1 = props.getLong("MirrorEscape1"); - this.mirrorWorldEscapeCooldown2 = props.getLong("MirrorEscape2"); + this.mirrorWorldEscapeCooldown1 = nbtRoot.getLong("MirrorEscape1"); + this.mirrorWorldEscapeCooldown2 = nbtRoot.getLong("MirrorEscape2"); + if(nbtRoot.hasKey("UnbreakableVowID")) { + this.unbreakableVowID = nbtRoot.getString("UnbreakableVowID"); + } else { + this.unbreakableVowID = ""; + } } } @@ -325,7 +341,7 @@ public int getSkillPotionThrowing() { public int increaseSkillPotionThrowing() { this.skillLevelPotionThrowing = Math.min(this.skillLevelPotionThrowing + 1, 100); - return this.getSkillPotionBottling(); + return this.getSkillPotionThrowing(); } public int getWerewolfLevel() { @@ -355,6 +371,23 @@ public void increaseWerewolfLevel() { } + public int getSpiritLevel() { + return this.spiritLevel; + } + + public void setSpiritLevel(int level) { + if(this.spiritLevel != level && level >= 0 && level <= 10) { + this.spiritLevel = level; + this.sync(); + } + } + + public void increaseSpiritLevel() { + if(this.spiritLevel < 10) { + this.setSpiritLevel(this.spiritLevel + 1); + } + } + public int getHumanBlood() { return this.humanBlood; } @@ -386,6 +419,76 @@ public int takeHumanBlood(int quantity, EntityLivingBase attacker) { return taken; } + public boolean isAstralProjecting() { + return this.isAstralProjecting; + } + + public void setAstralProjecting(boolean projecting) { + if (this.isAstralProjecting != projecting) { + this.isAstralProjecting = projecting; + this.sync(); + } + } + + public static boolean trySayAstralProjection(EntityPlayer player, String message) { + if(message != null && (message.equalsIgnoreCase("ex corpus") || message.equalsIgnoreCase("astral"))) { + ExtendedPlayer playerEx = get(player); + if(playerEx != null && playerEx.getSpiritLevel() >= 10 && player.dimension != Config.instance().dimensionDreamID) { + if (!playerEx.isAstralProjecting()) { + com.emoniph.witchery.entity.EntityCorpse var21 = new com.emoniph.witchery.entity.EntityCorpse(player.worldObj); + var21.setHealth(player.getHealth()); + var21.setCustomNameTag(player.getCommandSenderName()); + var21.setOwner(player.getCommandSenderName()); + var21.setLocationAndAngles(0.5D + (double)net.minecraft.util.MathHelper.floor_double(player.posX), player.posY, 0.5D + (double)net.minecraft.util.MathHelper.floor_double(player.posZ), 0.0F, 0.0F); + player.worldObj.spawnEntityInWorld(var21); + + net.minecraft.nbt.NBTTagCompound nbt = com.emoniph.witchery.infusion.Infusion.getNBT(player); + com.emoniph.witchery.dimension.WorldProviderDreamWorld.setPlayerIsGhost(nbt, true); + playerEx.setAstralProjecting(true); + + com.emoniph.witchery.util.SoundEffect.RANDOM_FIZZ.playAtPlayer(player.worldObj, player); + } else { + java.util.List corpses = player.worldObj.getEntitiesWithinAABB(com.emoniph.witchery.entity.EntityCorpse.class, player.boundingBox.expand(256.0D, 256.0D, 256.0D)); + for (Object obj : corpses) { + com.emoniph.witchery.entity.EntityCorpse corpse = (com.emoniph.witchery.entity.EntityCorpse)obj; + if (corpse.getOwnerName().equals(player.getCommandSenderName())) { + if (player.ridingEntity != null) { + player.mountEntity((net.minecraft.entity.Entity)null); + } + com.emoniph.witchery.item.ItemGeneral.teleportToLocationSafely(player.worldObj, corpse.posX, corpse.posY + 1, corpse.posZ, player.dimension, player, true); + corpse.setDead(); + break; + } + } + net.minecraft.nbt.NBTTagCompound nbt = com.emoniph.witchery.infusion.Infusion.getNBT(player); + com.emoniph.witchery.dimension.WorldProviderDreamWorld.setPlayerIsGhost(nbt, false); + playerEx.setAstralProjecting(false); + player.removePotionEffect(net.minecraft.potion.Potion.invisibility.id); + com.emoniph.witchery.util.SoundEffect.RANDOM_FIZZ.playAtPlayer(player.worldObj, player); + } + return true; + } + } + return false; + } + + public static boolean trySaySpiritForm(EntityPlayer player, String message) { + if(message != null && (message.equalsIgnoreCase("ex spiritus") || message.equalsIgnoreCase("spirit"))) { + ExtendedPlayer playerEx = get(player); + if(playerEx != null && playerEx.getSpiritLevel() >= 4) { + if (playerEx.getCreatureType() == com.emoniph.witchery.util.TransformCreature.SPIRIT) { + com.emoniph.witchery.common.Shapeshift.INSTANCE.shiftTo(player, com.emoniph.witchery.util.TransformCreature.NONE); + com.emoniph.witchery.util.SoundEffect.RANDOM_FIZZ.playAtPlayer(player.worldObj, player); + } else if (playerEx.getCreatureType() == com.emoniph.witchery.util.TransformCreature.NONE) { + com.emoniph.witchery.common.Shapeshift.INSTANCE.shiftTo(player, com.emoniph.witchery.util.TransformCreature.SPIRIT); + com.emoniph.witchery.util.SoundEffect.RANDOM_FIZZ.playAtPlayer(player.worldObj, player); + } + return true; + } + } + return false; + } + public void giveHumanBlood(int quantity) { if(this.humanBlood < 500) { this.setHumanBlood(this.humanBlood + quantity); @@ -502,7 +605,11 @@ public void setBloodPower(int bloodLevel) { } public ExtendedPlayer.VampireUltimate getVampireUltimate() { - return ExtendedPlayer.VampireUltimate.values()[this.vampireUltimate]; + ExtendedPlayer.VampireUltimate[] values = ExtendedPlayer.VampireUltimate.values(); + if(this.vampireUltimate < 0 || this.vampireUltimate >= values.length) { + return values[0]; + } + return values[this.vampireUltimate]; } public void setVampireUltimate(ExtendedPlayer.VampireUltimate skill) { @@ -797,6 +904,33 @@ public void tick() { if(this.vampireCooldown > 0) { --this.vampireCooldown; } + + if (!this.player.worldObj.isRemote && this.isAstralProjecting()) { + this.player.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.invisibility.id, 40, 0, true)); + + if (this.player.ticksExisted % 20 == 0) { + boolean hasEnergy = com.emoniph.witchery.infusion.Infusion.aquireEnergy(this.player.worldObj, this.player, 3, false); + if (!hasEnergy) { + // Forced return because out of energy + trySayAstralProjection(this.player, "ex corpus"); + com.emoniph.witchery.util.ChatUtil.sendTranslated(net.minecraft.util.EnumChatFormatting.RED, this.player, "witchery.infuse.nocharges"); + + // Apply exhaustion debuffs + this.player.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.confusion.id, 200, 1)); + this.player.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.hunger.id, 200, 1)); + this.player.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.moveSlowdown.id, 200, 1)); + } + } + } + + if (!this.player.worldObj.isRemote && this.getCreatureType() == com.emoniph.witchery.util.TransformCreature.SPIRIT && this.player.ticksExisted % 40 == 0) { + boolean hasEnergy = com.emoniph.witchery.infusion.Infusion.aquireEnergy(this.player.worldObj, this.player, 1, false); + if (!hasEnergy) { + com.emoniph.witchery.common.Shapeshift.INSTANCE.shiftTo(this.player, com.emoniph.witchery.util.TransformCreature.NONE); + com.emoniph.witchery.util.SoundEffect.RANDOM_FIZZ.playAtPlayer(this.player.worldObj, this.player); + com.emoniph.witchery.util.ChatUtil.sendTranslated(net.minecraft.util.EnumChatFormatting.RED, this.player, "witchery.infuse.nocharges"); + } + } } @@ -855,6 +989,19 @@ public void restoreIncurablePotionEffects() { } + public void setCachedWorship(int worship) { + this.cachedWorship = worship; + } + + public String getUnbreakableVowID() { + return this.unbreakableVowID == null ? "" : this.unbreakableVowID; + } + + public void setUnbreakableVowID(String vowID) { + this.unbreakableVowID = vowID; + this.sync(); + } + public void addWorship(int level) { this.cachedWorship = level; } @@ -866,6 +1013,30 @@ public void sync() { } + public void applySyncData(int werewolfLevel, int creatureType, int vampireLevel, int spiritLevel, int bloodPower, int selectedPower, int ultimate, int ultimateCharges, int bloodReserve) { + this.werewolfLevel = MathHelper.clamp_int(werewolfLevel, 0, 10); + this.vampireLevel = MathHelper.clamp_int(vampireLevel, 0, 10); + this.spiritLevel = MathHelper.clamp_int(spiritLevel, 0, 10); + this.bloodPower = Math.max(0, bloodPower); + this.vampireUltimateCharges = Math.max(0, ultimateCharges); + this.bloodReserve = Math.max(0, bloodReserve); + + ExtendedPlayer.VampireUltimate[] ultimates = ExtendedPlayer.VampireUltimate.values(); + this.vampireUltimate = ultimate >= 0 && ultimate < ultimates.length ? ultimate : 0; + + ExtendedPlayer.VampirePower[] powers = ExtendedPlayer.VampirePower.values(); + this.selectedVampirePower = selectedPower >= 0 && selectedPower < powers.length ? powers[selectedPower] : ExtendedPlayer.VampirePower.NONE; + + TransformCreature[] creatures = TransformCreature.values(); + int newCreatureType = creatureType >= 0 && creatureType < creatures.length ? creatureType : 0; + if (newCreatureType != this.creatureType) { + this.setCreatureTypeOrdinal(newCreatureType); + } + + net.minecraft.nbt.NBTTagCompound nbt = com.emoniph.witchery.infusion.Infusion.getNBT(this.player); + this.isAstralProjecting = nbt.getBoolean("AstralProjecting"); + } + public static void loadProxyData(EntityPlayer player) { if(player != null) { ExtendedPlayer playerEx = get(player); diff --git a/src/main/java/com/emoniph/witchery/common/GenericEvents.java b/src/main/java/com/emoniph/witchery/common/GenericEvents.java index 1198075..2e6654e 100644 --- a/src/main/java/com/emoniph/witchery/common/GenericEvents.java +++ b/src/main/java/com/emoniph/witchery/common/GenericEvents.java @@ -298,7 +298,7 @@ public void onPlayerSleepInBed(PlayerSleepInBedEvent event) { ChatUtil.sendTranslated(EnumChatFormatting.RED, event.entityPlayer, "witchery.nosleep.resized", new Object[0]); event.result = EnumStatus.OTHER_PROBLEM; } - } else if(ExtendedPlayer.get(event.entityPlayer).isVampire() && world.getBlock(event.x, event.y, event.z) == Witchery.Blocks.COFFIN) { + } else if(ExtendedPlayer.get(event.entityPlayer) != null && ExtendedPlayer.get(event.entityPlayer).isVampire() && world.getBlock(event.x, event.y, event.z) == Witchery.Blocks.COFFIN) { if(event.entityPlayer.worldObj.isDaytime()) { if(!world.isRemote) { if(player.isPlayerSleeping() || !player.isEntityAlive()) { @@ -470,6 +470,17 @@ public void onPlayerDrops(PlayerDropsEvent event) { priority = EventPriority.HIGH ) public void onEntityInteract(EntityInteractEvent event) { + if (com.emoniph.witchery.dimension.WorldProviderDreamWorld.getPlayerIsGhost(event.entityPlayer)) { + ExtendedPlayer playerEx = ExtendedPlayer.get(event.entityPlayer); + if (playerEx.getSpiritLevel() >= 6 && event.entityPlayer.getHeldItem() == null && event.entityPlayer.isSneaking() && event.target instanceof EntityLivingBase) { + if(!event.entityPlayer.worldObj.isRemote) { + event.entityPlayer.mountEntity(event.target); + } + event.setCanceled(true); + return; + } + } + PotionEffect effect = event.entityPlayer.getActivePotionEffect(Witchery.Potions.PARALYSED); if(effect != null && effect.getAmplifier() >= 4) { event.setCanceled(true); @@ -763,6 +774,23 @@ private void checkForBloodDrinkingWitnesses(EntityPlayer player, EntityLivingBas @SubscribeEvent public void onPlayerInteract(PlayerInteractEvent event) { + if (!event.entityPlayer.worldObj.isRemote && event.entityPlayer.getEntityData().getInteger("WITCLeviosaTicks") > 0) { + float currentDist = event.entityPlayer.getEntityData().hasKey("WITCLeviosaDistance") ? event.entityPlayer.getEntityData().getFloat("WITCLeviosaDistance") : 5.0f; + boolean changed = false; + if (event.action == net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR || event.action == net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { + currentDist = Math.max(1.0f, currentDist - 0.5f); + changed = true; + } else if (event.action == net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) { + currentDist = Math.min(20.0f, currentDist + 0.5f); + changed = true; + } + if (changed) { + event.entityPlayer.getEntityData().setFloat("WITCLeviosaDistance", currentDist); + event.setCanceled(true); + return; + } + } + PotionEffect effect = event.entityPlayer.getActivePotionEffect(Witchery.Potions.PARALYSED); if(effect != null && effect.getAmplifier() >= 4) { event.setCanceled(true); @@ -827,12 +855,88 @@ private void playTameEffect(EntityTameable entity, boolean tamed) { @SubscribeEvent public void onLivingUpdate(LivingUpdateEvent event) { + if (event.entity instanceof EntityLivingBase && event.entity.riddenByEntity instanceof EntityPlayer) { + EntityPlayer rider = (EntityPlayer)event.entity.riddenByEntity; + if (com.emoniph.witchery.dimension.WorldProviderDreamWorld.getPlayerIsGhost(rider) && ExtendedPlayer.get(rider).getSpiritLevel() >= 6) { + EntityLivingBase mount = (EntityLivingBase)event.entity; + mount.rotationYaw = rider.rotationYaw; + mount.rotationYawHead = rider.rotationYawHead; + mount.rotationPitch = rider.rotationPitch; + + // Also disable mount's own pathing and targets to avoid conflict. + if (mount instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving)mount).getNavigator().clearPathEntity(); + ((net.minecraft.entity.EntityLiving)mount).setAttackTarget(null); + } + + if (rider.moveForward != 0 || rider.moveStrafing != 0) { + float speed = 0.15f; + if (mount.getEntityAttribute(net.minecraft.entity.SharedMonsterAttributes.movementSpeed) != null) { + speed = (float) mount.getEntityAttribute(net.minecraft.entity.SharedMonsterAttributes.movementSpeed).getAttributeValue() * 0.75f; + } + double radYaw = Math.toRadians(rider.rotationYaw); + double motionX = -Math.sin(radYaw) * rider.moveForward * speed; + double motionZ = Math.cos(radYaw) * rider.moveForward * speed; + motionX += Math.cos(radYaw) * rider.moveStrafing * speed; + motionZ += Math.sin(radYaw) * rider.moveStrafing * speed; + + mount.motionX = motionX; + mount.motionZ = motionZ; + } + + mount.moveForward = 0.0f; + mount.moveStrafing = 0.0f; + + boolean isJumping = false; + try { + isJumping = ((Boolean) cpw.mods.fml.relauncher.ReflectionHelper.getPrivateValue(net.minecraft.entity.EntityLivingBase.class, rider, "isJumping", "field_70703_bu")).booleanValue(); + } catch (Exception e) {} + if (isJumping && mount.onGround) { + mount.motionY = 0.5D; + } + } + } + + if (!event.entity.worldObj.isRemote && event.entity instanceof EntityLivingBase) { + EntityLivingBase living = (EntityLivingBase) event.entity; + if (com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_STAYING_TARGETS.contains(living)) { + if (living instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving)living).getNavigator().clearPathEntity(); + } + living.motionX = 0; + living.motionZ = 0; + } + } + if(!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)event.entity; - ExtendedPlayer playerEx = ExtendedPlayer.get(player); - Shapeshift.INSTANCE.updatePlayerState(player, playerEx); - playerEx.tick(); - if(playerEx.isVampire()) { + EntityPlayer player = (EntityPlayer)event.entity; + ExtendedPlayer playerEx = ExtendedPlayer.get(player); + Shapeshift.INSTANCE.updatePlayerState(player, playerEx); + playerEx.tick(); + + if(!playerEx.getUnbreakableVowID().isEmpty() && event.entity.ticksExisted % 20 == 0) { + java.util.List linkedPlayers = new java.util.ArrayList(); + for (Object obj : net.minecraft.server.MinecraftServer.getServer().getConfigurationManager().playerEntityList) { + EntityPlayer p = (EntityPlayer) obj; + if (p != player && ExtendedPlayer.get(p).getUnbreakableVowID().equals(playerEx.getUnbreakableVowID())) { + linkedPlayers.add(p); + } + } + if (!linkedPlayers.isEmpty()) { + java.util.Collection effects = player.getActivePotionEffects(); + for (net.minecraft.potion.PotionEffect effect : effects) { + if (effect.getDuration() > 20) { + for (EntityPlayer p : linkedPlayers) { + net.minecraft.potion.PotionEffect current = p.getActivePotionEffect(net.minecraft.potion.Potion.potionTypes[effect.getPotionID()]); + if (current == null || current.getAmplifier() < effect.getAmplifier() || (current.getAmplifier() == effect.getAmplifier() && current.getDuration() < effect.getDuration() - 10)) { + p.addPotionEffect(new net.minecraft.potion.PotionEffect(effect.getPotionID(), effect.getDuration(), effect.getAmplifier(), effect.getIsAmbient())); + } + } + } + } + } + } + if(playerEx.isVampire()) { int closestVillage = player.getFoodStats().prevFoodLevel; int isWolfman = player.getFoodStats().getFoodLevel(); if(closestVillage < isWolfman) { @@ -975,6 +1079,36 @@ public void onHarvestDrops(HarvestDropsEvent event) { } + @SubscribeEvent + public void onLivingHeal(net.minecraftforge.event.entity.living.LivingHealEvent event) { + if(!event.entityLiving.worldObj.isRemote && !event.isCanceled()) { + if(event.entityLiving instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)event.entityLiving; + ExtendedPlayer playerEx = ExtendedPlayer.get(player); + if (!playerEx.getUnbreakableVowID().isEmpty() && !event.entityLiving.getEntityData().getBoolean("VowHealing")) { + java.util.List linkedPlayers = new java.util.ArrayList(); + for (Object obj : net.minecraft.server.MinecraftServer.getServer().getConfigurationManager().playerEntityList) { + EntityPlayer p = (EntityPlayer) obj; + if (p != player && ExtendedPlayer.get(p).getUnbreakableVowID().equals(playerEx.getUnbreakableVowID())) { + linkedPlayers.add(p); + } + } + if (!linkedPlayers.isEmpty()) { + float totalHeal = event.amount; + int totalPlayers = linkedPlayers.size() + 1; + float sharedHeal = totalHeal / totalPlayers; + event.amount = sharedHeal; + for (EntityPlayer p : linkedPlayers) { + p.getEntityData().setBoolean("VowHealing", true); + p.heal(sharedHeal); + p.getEntityData().setBoolean("VowHealing", false); + } + } + } + } + } + } + @SubscribeEvent( priority = EventPriority.HIGHEST ) @@ -985,6 +1119,67 @@ public void onLivingHurt(LivingHurtEvent event) { EntityPlayer player = (EntityPlayer)event.entityLiving; float playerHealth = player.getHealth(); ExtendedPlayer playerEx = ExtendedPlayer.get(player); + + if (!playerEx.getUnbreakableVowID().isEmpty() && !event.source.getDamageType().equals("vow_share")) { + java.util.List linkedPlayers = new java.util.ArrayList(); + for (Object obj : net.minecraft.server.MinecraftServer.getServer().getConfigurationManager().playerEntityList) { + EntityPlayer p = (EntityPlayer) obj; + if (p != player && ExtendedPlayer.get(p).getUnbreakableVowID().equals(playerEx.getUnbreakableVowID())) { + linkedPlayers.add(p); + } + } + if (!linkedPlayers.isEmpty()) { + float totalDamage = event.ammount; + int totalPlayers = linkedPlayers.size() + 1; + float sharedDamage = totalDamage / totalPlayers; + event.ammount = sharedDamage; + for (EntityPlayer p : linkedPlayers) { + p.attackEntityFrom(new net.minecraft.util.DamageSource("vow_share").setDamageBypassesArmor().setMagicDamage(), sharedDamage); + } + } + } + + if (player.isUsingItem() && player.getHeldItem() != null && player.getHeldItem().getItem() == Witchery.Items.MYSTIC_BRANCH) { + boolean blockable = event.source.isProjectile() || event.source.isMagicDamage() || event.source.damageType.equals("mob") || event.source.damageType.equals("player"); + if (blockable && !event.source.isUnblockable() && !event.source.isFireDamage() && !event.source.isExplosion() && event.source.getEntity() != player) { + net.minecraft.nbt.NBTTagCompound nbtPerm = com.emoniph.witchery.infusion.Infusion.getNBT(player); + if (nbtPerm != null && nbtPerm.hasKey("witcheryInfusionID") && nbtPerm.hasKey("witcheryInfusionCharges")) { + int charges = nbtPerm.getInteger("witcheryInfusionCharges"); + int blockCost = 2; + if (charges >= blockCost) { + com.emoniph.witchery.infusion.Infusion.setCurrentEnergy(player, charges - blockCost); + com.emoniph.witchery.util.ParticleEffect.INSTANT_SPELL.send(com.emoniph.witchery.util.SoundEffect.RANDOM_FIZZ, player, 1.0D, 2.0D, 16); + com.emoniph.witchery.util.ParticleEffect.SPELL_COLORED.send(com.emoniph.witchery.util.SoundEffect.NONE, player, 0.75D, 2.0D, 24, 0x00FFFF); + if (event.source.isProjectile()) { + event.setCanceled(true); + return; + } else { + event.ammount = Math.max(0.0F, event.ammount - 5.0F); + if (event.ammount == 0.0F) { + event.setCanceled(true); + return; + } + } + } + } + } + } + + if (playerEx.isAstralProjecting()) { + if (!event.source.isMagicDamage() && event.source != net.minecraft.util.DamageSource.outOfWorld && event.source != net.minecraft.util.DamageSource.inWall && event.source != net.minecraft.util.DamageSource.drown) { + event.setCanceled(true); + return; + } + if (playerHealth - event.ammount <= 0.0F) { + event.setCanceled(true); + player.setHealth(1.0F); + ExtendedPlayer.trySayAstralProjection(player, "ex corpus"); + player.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.confusion.id, 200, 1)); + player.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.hunger.id, 200, 1)); + player.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.moveSlowdown.id, 200, 1)); + return; + } + } if(event.source == DamageSource.drown && playerEx.isVampire()) { event.setCanceled(true); return; @@ -1399,6 +1594,32 @@ private static void dropItemsOnHit(EntityPlayer player) { } + @SubscribeEvent + public void onLivingSetAttackTarget(net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent event) { + if(event.target instanceof EntityPlayer && event.entityLiving != null) { + EntityPlayer player = (EntityPlayer)event.target; + + EntityPlayer controller = com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_TARGETS.get(event.entityLiving); + if (controller == player && event.entityLiving instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving)event.entityLiving).setAttackTarget(null); + return; + } + + ExtendedPlayer playerEx = ExtendedPlayer.get(player); + if(playerEx != null && playerEx.getSpiritLevel() >= 7 && player.isSneaking()) { + if(event.entityLiving.getDistanceSqToEntity(player) > 16.0D && event.entityLiving instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving)event.entityLiving).setAttackTarget(null); + } + } + } + + if (event.entityLiving != null && com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_STAYING_TARGETS.contains(event.entityLiving)) { + if (event.entityLiving instanceof net.minecraft.entity.EntityLiving) { + ((net.minecraft.entity.EntityLiving)event.entityLiving).setAttackTarget(null); + } + } + } + @SubscribeEvent( priority = EventPriority.HIGH ) @@ -1484,6 +1705,18 @@ public void onLivingDeath(LivingDeathEvent event) { } } + if(player1.dimension == Config.instance().dimensionDreamID && com.emoniph.witchery.dimension.WorldProviderDreamWorld.getPlayerIsGhost(player1)) { + if (event.entityLiving != null && event.entityLiving.getClass().getSimpleName().contains("Nightmare")) { + if (player1.worldObj.rand.nextInt(3) == 0 && playerEx1.getSpiritLevel() < 10) { + playerEx1.increaseSpiritLevel(); + if (!player1.worldObj.isRemote) { + com.emoniph.witchery.util.ChatUtil.sendTranslated(net.minecraft.util.EnumChatFormatting.DARK_PURPLE, player1, "Tu poder espiritual aumenta.", new Object[0]); + com.emoniph.witchery.util.SoundEffect.RANDOM_LEVELUP.playOnlyTo(player1); + } + } + } + } + int baseLooting = EnchantmentHelper.getLootingModifier(player1); double lootingFactor = 1.0D + (double)baseLooting; double halfLooting = 1.0D + (double)(baseLooting / 2); diff --git a/src/main/java/com/emoniph/witchery/common/ServerTickEvents.java b/src/main/java/com/emoniph/witchery/common/ServerTickEvents.java index e75e43e..7853959 100644 --- a/src/main/java/com/emoniph/witchery/common/ServerTickEvents.java +++ b/src/main/java/com/emoniph/witchery/common/ServerTickEvents.java @@ -58,6 +58,35 @@ public void onServerTick(ServerTickEvent event) { public void onPlayerTick(PlayerTickEvent event) { if(event.side == Side.SERVER && !event.player.worldObj.isRemote) { if(event.phase == Phase.START) { + int leviosaTicks = event.player.getEntityData().getInteger("WITCLeviosaTicks"); + if (leviosaTicks > 0) { + if (event.player.isSneaking()) { + event.player.getEntityData().setInteger("WITCLeviosaTicks", 0); + } else { + if (leviosaTicks != Integer.MAX_VALUE) { + event.player.getEntityData().setInteger("WITCLeviosaTicks", leviosaTicks - 1); + } + int entityId = event.player.getEntityData().getInteger("WITCLeviosaEntity"); + net.minecraft.entity.Entity target = event.player.worldObj.getEntityByID(entityId); + if (target != null && !target.isDead && target.getDistanceSqToEntity(event.player) < 1024.0D) { + net.minecraft.util.Vec3 look = event.player.getLookVec(); + float dist = event.player.getEntityData().hasKey("WITCLeviosaDistance") ? event.player.getEntityData().getFloat("WITCLeviosaDistance") : 5.0f; + double targetX = event.player.posX + look.xCoord * dist; + double targetY = event.player.posY + (double)event.player.getEyeHeight() + look.yCoord * dist; + double targetZ = event.player.posZ + look.zCoord * dist; + target.motionX = (targetX - target.posX) * 0.2D; + target.motionY = (targetY - target.posY) * 0.2D; + target.motionZ = (targetZ - target.posZ) * 0.2D; + target.fallDistance = 0.0F; + if (target instanceof net.minecraft.entity.EntityLivingBase) { + ((net.minecraft.entity.EntityLivingBase)target).addPotionEffect(new PotionEffect(net.minecraft.potion.Potion.resistance.id, 20, 4)); + } + } else { + event.player.getEntityData().setInteger("WITCLeviosaTicks", 0); + } + } + } + Collection playerExt = event.player.getActivePotionEffects(); ExtendedPlayer playerExt1 = ExtendedPlayer.get(event.player); if(playerExt1 != null) { diff --git a/src/main/java/com/emoniph/witchery/common/Shapeshift.java b/src/main/java/com/emoniph/witchery/common/Shapeshift.java index e98ee1f..2ce8244 100644 --- a/src/main/java/com/emoniph/witchery/common/Shapeshift.java +++ b/src/main/java/com/emoniph/witchery/common/Shapeshift.java @@ -3,6 +3,7 @@ import com.emoniph.witchery.Witchery; import com.emoniph.witchery.brewing.potions.PotionResizing; import com.emoniph.witchery.common.ExtendedPlayer; +import com.emoniph.witchery.dimension.WorldProviderDreamWorld; import com.emoniph.witchery.entity.EntityWolfman; import com.emoniph.witchery.infusion.infusions.InfusionInfernal; import com.emoniph.witchery.item.ItemHunterClothes; @@ -57,6 +58,7 @@ public class Shapeshift { public final Shapeshift.StatBoost[] boostWolf = new Shapeshift.StatBoost[]{new Shapeshift.StatBoost(0.0F, 0.0D, 0.0D, 0, 0.0F, 0.0F, 0, 4.0F), new Shapeshift.StatBoost(0.5F, 0.20000000298023224D, 0.20000000298023224D, 0, 1.0F, 0.0F, 2, 4.0F), new Shapeshift.StatBoost(0.5F, 0.20000000298023224D, 0.20000000298023224D, 0, 1.0F, 0.0F, 2, 3.0F), new Shapeshift.StatBoost(0.75F, 0.20000000298023224D, 0.30000001192092896D, 0, 2.0F, 0.0F, 2, 3.0F), new Shapeshift.StatBoost(0.75F, 0.20000000298023224D, 0.4000000059604645D, 0, 2.0F, 0.0F, 3, 3.0F), new Shapeshift.StatBoost(0.75F, 0.20000000298023224D, 0.5D, 0, 2.0F, 0.0F, 3, 2.0F), new Shapeshift.StatBoost(1.0F, 0.20000000298023224D, 0.6000000238418579D, 0, 2.0F, 1.0F, 3, 2.0F), new Shapeshift.StatBoost(1.25F, 0.30000001192092896D, 0.699999988079071D, 4, 2.0F, 1.0F, 4, 2.0F), new Shapeshift.StatBoost(1.5F, 0.30000001192092896D, 0.800000011920929D, 8, 3.0F, 2.0F, 4, 2.0F), new Shapeshift.StatBoost(1.75F, 0.30000001192092896D, 0.8999999761581421D, 12, 3.0F, 3.0F, 5, 2.0F), new Shapeshift.StatBoost(1.75F, 0.30000001192092896D, 1.0D, 12, 3.0F, 3.0F, 5, 2.0F)}; public final Shapeshift.StatBoost[] boostVampire = new Shapeshift.StatBoost[]{new Shapeshift.StatBoost(0.0F), new Shapeshift.StatBoost(1.0F), new Shapeshift.StatBoost(1.0F), new Shapeshift.StatBoost(1.0F), new Shapeshift.StatBoost(2.0F), new Shapeshift.StatBoost(2.0F), new Shapeshift.StatBoost(2.0F), new Shapeshift.StatBoost(3.0F), new Shapeshift.StatBoost(3.0F), new Shapeshift.StatBoost(3.0F), new Shapeshift.StatBoost(3.0F)}; public final Shapeshift.StatBoost[] boostBat = new Shapeshift.StatBoost[]{new Shapeshift.StatBoost(0.0F), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true), (new Shapeshift.StatBoost(-6.0F)).setFlying(true)}; + public final Shapeshift.StatBoost[] boostSpirit = new Shapeshift.StatBoost[]{new Shapeshift.StatBoost(0.0F), new Shapeshift.StatBoost(0.0F, 0.0D, 0.0D, 0, 0.0F, 0.0F, 2, 4.0F), new Shapeshift.StatBoost(0.0F, 0.0D, 0.0D, 0, 0.0F, 0.0F, 6, 4.0F), new Shapeshift.StatBoost(0.0F, 0.0D, 0.0D, 0, 0.0F, 0.0F, -1, 4.0F), new Shapeshift.StatBoost(0.1F, 0.1D, 0.1D, 0, 0.0F, 0.0F, -1, 4.0F), new Shapeshift.StatBoost(0.1F, 0.1D, 0.1D, 0, 0.0F, 0.0F, -1, 4.0F), new Shapeshift.StatBoost(0.2F, 0.2D, 0.2D, 0, 0.0F, 0.0F, -1, 4.0F), new Shapeshift.StatBoost(0.2F, 0.2D, 0.2D, 0, 0.0F, 0.0F, -1, 4.0F), new Shapeshift.StatBoost(0.2F, 0.2D, 0.2D, 0, 0.0F, 0.0F, -1, 4.0F), new Shapeshift.StatBoost(0.2F, 0.2D, 0.2D, 0, 0.0F, 0.0F, -1, 4.0F), new Shapeshift.StatBoost(0.2F, 0.2D, 0.2D, 0, 0.0F, 0.0F, -1, 4.0F)}; public static final AttributeModifier SPEED_MODIFIER = new AttributeModifier(UUID.fromString("10536417-7AA6-4033-A598-8E934CA77D98"), "witcheryWolfSpeed", 0.5D, 2); public static final AttributeModifier DAMAGE_MODIFIER = new AttributeModifier(UUID.fromString("46C5271C-193B-4D41-9CAB-D071AAEE9D4A"), "witcheryWolfDamage", 6.0D, 2); public static final AttributeModifier HEALTH_MODIFIER = new AttributeModifier(UUID.fromString("615920F9-6675-4779-8B18-6A62A3671E94"), "witcheryWolfHealth", 40.0D, 0); @@ -82,8 +84,10 @@ public void initCurrentShift(EntityPlayer player) { this.removeModifier(SharedMonsterAttributes.maxHealth, HEALTH_MODIFIER, playerAttributes); } + boolean isGhostWithFlight = WorldProviderDreamWorld.getPlayerIsGhost(player) && playerEx.getSpiritLevel() >= 1; + if(!player.capabilities.isCreativeMode) { - player.capabilities.allowFlying = boost != null && boost.flying; + player.capabilities.allowFlying = (boost != null && boost.flying) || isGhostWithFlight; if(!player.capabilities.allowFlying && player.capabilities.isFlying) { player.capabilities.isFlying = false; } else if(player.capabilities.allowFlying) { @@ -100,7 +104,12 @@ public void initCurrentShift(EntityPlayer player) { } public void updatePlayerState(EntityPlayer player, ExtendedPlayer playerEx) { - if(playerEx.getCreatureType() == TransformCreature.BAT) { + boolean isGhost = WorldProviderDreamWorld.getPlayerIsGhost(com.emoniph.witchery.infusion.Infusion.getNBT(player)); + if(playerEx.getCreatureType() == TransformCreature.BAT || playerEx.getCreatureType() == TransformCreature.SPIRIT || (isGhost && playerEx.getSpiritLevel() >= 1)) { + if(!player.capabilities.allowFlying) { + player.capabilities.allowFlying = true; + } + if(player.capabilities.isFlying) { player.fallDistance = 0.0F; } @@ -111,6 +120,12 @@ public void updatePlayerState(EntityPlayer player, ExtendedPlayer playerEx) { } } + if (isGhost && playerEx.getSpiritLevel() >= 4) { + player.noClip = true; + } else if (!player.capabilities.isCreativeMode) { + player.noClip = false; + } + } public float updateFallState(EntityPlayer player, float distance) { @@ -362,6 +377,9 @@ public boolean canControlTransform(ExtendedPlayer playerEx) { public Shapeshift.StatBoost getStatBoost(EntityPlayer player, ExtendedPlayer playerEx) { TransformCreature creature = playerEx.getCreatureType(); + if (creature == TransformCreature.SPIRIT) { + return (new Shapeshift.StatBoost(-12.0F)).setFlying(true); + } switch(Shapeshift.NamelessClass26779675.$SwitchMap$com$emoniph$witchery$util$TransformCreature[creature.ordinal()]) { case 1: return this.boostWolf[playerEx.getWerewolfLevel()]; @@ -370,7 +388,15 @@ public Shapeshift.StatBoost getStatBoost(EntityPlayer player, ExtendedPlayer pla case 3: return this.boostBat[playerEx.getVampireLevel()]; default: - return playerEx.isVampire()?this.boostVampire[playerEx.getVampireLevel()]:null; + Shapeshift.StatBoost base = playerEx.isVampire() ? this.boostVampire[playerEx.getVampireLevel()] : null; + if (playerEx.getSpiritLevel() > 0 && playerEx.getSpiritLevel() <= 10) { + Shapeshift.StatBoost spirit = this.boostSpirit[playerEx.getSpiritLevel()]; + if (base == null) return spirit; + Shapeshift.StatBoost combined = new Shapeshift.StatBoost(base.speed + spirit.speed, base.jump + spirit.jump, base.leap + spirit.leap, base.health + spirit.health, base.damage + spirit.damage, base.resistance + spirit.resistance, spirit.fall == -1 || base.fall == -1 ? -1 : Math.max(base.fall, spirit.fall), Math.max(base.damageCap, spirit.damageCap)); + combined.flying = base.flying || spirit.flying; + return combined; + } + return base; } } diff --git a/src/main/java/com/emoniph/witchery/crafting/BrazierRecipes.java b/src/main/java/com/emoniph/witchery/crafting/BrazierRecipes.java index e3c9845..fb16143 100644 --- a/src/main/java/com/emoniph/witchery/crafting/BrazierRecipes.java +++ b/src/main/java/com/emoniph/witchery/crafting/BrazierRecipes.java @@ -19,6 +19,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -90,13 +91,13 @@ public void onBurnt(World world, int x, int y, int z, long ticks, BlockBrazier.T } }; - public static final BrazierRecipes.BrazierRecipe SMOKE = new BrazierRecipes.BrazierRecipe("witchery.brazier.smoke", true, TimeUtil.minsToTicks(5), new ItemStack[]{new ItemStack(Items.gunpowder), Witchery.Items.GENERIC.itemQuicklime.createStack(), new ItemStack(Items.glowstone_dust)}, null) { + public static final BrazierRecipes.BrazierRecipe SMOKE = new BrazierRecipes.BrazierRecipe("witchery.brazier.smoke", true, -1, new ItemStack[]{new ItemStack(Items.gunpowder), Witchery.Items.GENERIC.itemQuicklime.createStack(), new ItemStack(Items.glowstone_dust)}, null) { public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { ParticleEffect.EXPLODE.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)y, 0.5D + (double)z, 16.0D, 4.0D, 64); return 0; } }; - public static final BrazierRecipes.BrazierRecipe STRONG = new BrazierRecipes.BrazierRecipe("witchery.brazier.strong", true, TimeUtil.minsToTicks(5), new ItemStack[]{Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), new ItemStack(Items.bone), new ItemStack(Items.blaze_powder)}, null) { + public static final BrazierRecipes.BrazierRecipe STRONG = new BrazierRecipes.BrazierRecipe("witchery.brazier.strong", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), new ItemStack(Items.bone), new ItemStack(Items.blaze_powder)}, null) { public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { if(TimeUtil.secondsElapsed(3, ticks)) { boolean radius = true; @@ -117,7 +118,7 @@ public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier. return 0; } }; - public static final BrazierRecipes.BrazierRecipe TOUGH = new BrazierRecipes.BrazierRecipe("witchery.brazier.tough", true, TimeUtil.minsToTicks(5), new ItemStack[]{Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), new ItemStack(Items.rotten_flesh), new ItemStack(Items.blaze_powder)}, null) { + public static final BrazierRecipes.BrazierRecipe TOUGH = new BrazierRecipes.BrazierRecipe("witchery.brazier.tough", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemTearOfTheGoddess.createStack(), new ItemStack(Items.rotten_flesh), new ItemStack(Items.blaze_powder)}, null) { public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { if(TimeUtil.secondsElapsed(3, ticks)) { boolean radius = true; @@ -138,7 +139,7 @@ public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier. return 0; } }; - public static final BrazierRecipes.BrazierRecipe INVISIBLE = new BrazierRecipes.BrazierRecipe("witchery.brazier.invisible", true, TimeUtil.minsToTicks(10), new ItemStack[]{new ItemStack(Items.ender_pearl), new ItemStack(Items.spider_eye), new ItemStack(Items.blaze_rod)}, null) { + public static final BrazierRecipes.BrazierRecipe INVISIBLE = new BrazierRecipes.BrazierRecipe("witchery.brazier.invisible", true, -1, new ItemStack[]{new ItemStack(Items.ender_pearl), new ItemStack(Items.spider_eye), new ItemStack(Items.blaze_rod)}, null) { public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { if(TimeUtil.secondsElapsed(3, ticks)) { boolean radius = true; @@ -159,7 +160,7 @@ public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier. return 0; } }; - public static final BrazierRecipes.BrazierRecipe WILTING = new BrazierRecipes.BrazierRecipe("witchery.brazier.wilting", true, TimeUtil.minsToTicks(1), new ItemStack[]{Witchery.Items.GENERIC.itemCondensedFear.createStack(), Witchery.Items.GENERIC.itemWormyApple.createStack(), Witchery.Items.GENERIC.itemGraveyardDust.createStack()}, null) { + public static final BrazierRecipes.BrazierRecipe WILTING = new BrazierRecipes.BrazierRecipe("witchery.brazier.wilting", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemCondensedFear.createStack(), Witchery.Items.GENERIC.itemWormyApple.createStack(), Witchery.Items.GENERIC.itemGraveyardDust.createStack()}, null) { public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { if(ticks % 5L == 0L) { int offsetY = (int)(ticks % 30L) / 5; @@ -207,6 +208,146 @@ public boolean getNeedsPower() { return false; } }; + public static final BrazierRecipes.BrazierRecipe INFUSION = new BrazierRecipes.BrazierRecipe("witchery.brazier.infusion", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack(), new ItemStack(Items.ghast_tear), Witchery.Items.GENERIC.itemGraveyardDust.createStack()}, null) { + public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { + if(ticks % 10L == 0L) { + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(x - 4), (double)(y - 4), (double)(z - 4), (double)(x + 4), (double)(y + 4), (double)(z + 4)); + List entities = world.getEntitiesWithinAABB(EntityPlayer.class, bb); + Iterator i$ = entities.iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityPlayer player = (EntityPlayer)obj; + if(Infusion.getInfusionID(player) > 0) { + int currentEnergy = Infusion.getCurrentEnergy(player); + int maxEnergy = Infusion.getMaxEnergy(player); + if(currentEnergy < maxEnergy) { + Infusion.setCurrentEnergy(player, Math.min(currentEnergy + 15, maxEnergy)); + ParticleEffect.SPELL.send(SoundEffect.NONE, player, 0.5D, 1.0D, 8); + } + } + } + } + return 0; + } + }; + public static final BrazierRecipes.BrazierRecipe GROWTH = new BrazierRecipes.BrazierRecipe("witchery.brazier.growth", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemWormwood.createStack(), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.apple)}, null) { + public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { + if(ticks % 10L == 0L) { + int px = x - 5 + world.rand.nextInt(11); + int pz = z - 5 + world.rand.nextInt(11); + int py = y - 2 + world.rand.nextInt(5); + Block block = world.getBlock(px, py, pz); + if(block != null && block instanceof net.minecraft.block.IGrowable) { + net.minecraft.block.IGrowable growable = (net.minecraft.block.IGrowable)block; + if(growable.func_149851_a(world, px, py, pz, world.isRemote)) { + growable.func_149853_b(world, world.rand, px, py, pz); + world.playAuxSFX(2005, px, py, pz, 0); + } + } + } + return 0; + } + }; + public static final BrazierRecipes.BrazierRecipe MAGNET = new BrazierRecipes.BrazierRecipe("witchery.brazier.magnet", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemWormwood.createStack(), new ItemStack(Items.iron_ingot), new ItemStack(Items.redstone)}, null) { + public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(x - 8), (double)(y - 8), (double)(z - 8), (double)(x + 8), (double)(y + 8), (double)(z + 8)); + List entities = world.getEntitiesWithinAABB(net.minecraft.entity.item.EntityItem.class, bb); + for(Object obj : entities) { + net.minecraft.entity.item.EntityItem item = (net.minecraft.entity.item.EntityItem)obj; + double dx = ((double)x + 0.5D) - item.posX; + double dy = ((double)y + 0.5D) - item.posY; + double dz = ((double)z + 0.5D) - item.posZ; + double dist = Math.sqrt(dx * dx + dy * dy + dz * dz); + if(dist > 1.0D && dist < 8.0D) { + item.motionX += dx / dist * 0.05D; + item.motionY += dy / dist * 0.05D; + item.motionZ += dz / dist * 0.05D; + } + } + return 0; + } + }; + public static final BrazierRecipes.BrazierRecipe STORM = new BrazierRecipes.BrazierRecipe("witchery.brazier.storm", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemWormwood.createStack(), new ItemStack(Items.ghast_tear), new ItemStack(Items.water_bucket)}, null) { + public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { + if(!world.isRemote && ticks % 100L == 0L) { + net.minecraft.world.storage.WorldInfo info = world.getWorldInfo(); + info.setRaining(true); + info.setThundering(true); + info.setRainTime(1200); + info.setThunderTime(1200); + } + return 0; + } + }; + public static final BrazierRecipes.BrazierRecipe REPELLENT = new BrazierRecipes.BrazierRecipe("witchery.brazier.repellent", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemWormwood.createStack(), new ItemStack(Items.rotten_flesh), new ItemStack(Items.bone)}, null) { + public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(x - 8), (double)(y - 8), (double)(z - 8), (double)(x + 8), (double)(y + 8), (double)(z + 8)); + List entities = world.getEntitiesWithinAABB(net.minecraft.entity.monster.IMob.class, bb); + for(Object obj : entities) { + EntityLivingBase mob = (EntityLivingBase)obj; + double dx = mob.posX - ((double)x + 0.5D); + double dz = mob.posZ - ((double)z + 0.5D); + double dist = Math.sqrt(dx * dx + dz * dz); + if(dist < 8.0D && dist > 0.1D) { + mob.motionX += dx / dist * 0.1D; + mob.motionZ += dz / dist * 0.1D; + } + } + return 0; + } + }; + public static final BrazierRecipes.BrazierRecipe POTION_AURA = new BrazierRecipes.BrazierRecipe("witchery.brazier.potionaura", true, -1, new ItemStack[]{Witchery.Items.GENERIC.itemWormwood.createStack(), Witchery.Items.GENERIC.itemGraveyardDust.createStack(), new ItemStack(Items.potionitem)}, null) { + @Override + protected boolean isMatch(ItemStack[] availableItems) { + boolean hasWormwood = false; + boolean hasDust = false; + boolean hasPotion = false; + for (ItemStack item : availableItems) { + if (item != null) { + if (item.isItemEqual(Witchery.Items.GENERIC.itemWormwood.createStack())) hasWormwood = true; + else if (item.isItemEqual(Witchery.Items.GENERIC.itemGraveyardDust.createStack())) hasDust = true; + else if ((item.getItem() == Items.potionitem && item.getItemDamage() > 0) || item.getItem() == Witchery.Items.BREW) hasPotion = true; + } + } + return hasWormwood && hasDust && hasPotion; + } + + @Override + public int onBurning(World world, int x, int y, int z, long ticks, BlockBrazier.TileEntityBrazier tile) { + if (ticks % 60L == 0L) { + ItemStack potionStack = null; + for (int i = 0; i < 3; i++) { + ItemStack stack = tile.getStackInSlot(i); + if (stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Witchery.Items.BREW)) { + potionStack = stack; + break; + } + } + if (potionStack != null) { + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(x - 6), (double)(y - 6), (double)(z - 6), (double)(x + 6), (double)(y + 6), (double)(z + 6)); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, bb); + if (potionStack.getItem() == Items.potionitem) { + List effects = Items.potionitem.getEffects(potionStack); + if (effects != null && !effects.isEmpty()) { + PotionEffect effect = (PotionEffect)effects.get(0); + for (Object obj : entities) { + EntityLivingBase entity = (EntityLivingBase)obj; + entity.addPotionEffect(new PotionEffect(effect.getPotionID(), TimeUtil.secsToTicks(60), effect.getAmplifier())); + } + } + } else if (potionStack.getItem() == Witchery.Items.BREW) { + com.emoniph.witchery.brewing.ModifiersEffect modifiers = new com.emoniph.witchery.brewing.ModifiersEffect(1.0D, 1.0D, false, new com.emoniph.witchery.util.EntityPosition(x, y, z), false, 0, (EntityPlayer)null); + for (Object obj : entities) { + EntityLivingBase entity = (EntityLivingBase)obj; + com.emoniph.witchery.brewing.WitcheryBrewRegistry.INSTANCE.applyToEntity(world, entity, potionStack.getTagCompound(), modifiers); + } + } + } + } + return 0; + } + }; public static BrazierRecipes instance() { @@ -264,7 +405,7 @@ public ArrayList getMutableModifiersList() { return available; } - private boolean isMatch(ItemStack[] availableItems) { + protected boolean isMatch(ItemStack[] availableItems) { ArrayList availableItemList = new ArrayList(); ItemStack[] arr$ = availableItems; int len$ = availableItems.length; diff --git a/src/main/java/com/emoniph/witchery/dimension/WorldProviderDreamWorld.java b/src/main/java/com/emoniph/witchery/dimension/WorldProviderDreamWorld.java index afc58da..0a0f5b8 100644 --- a/src/main/java/com/emoniph/witchery/dimension/WorldProviderDreamWorld.java +++ b/src/main/java/com/emoniph/witchery/dimension/WorldProviderDreamWorld.java @@ -866,6 +866,10 @@ public static void updatePlayerEffects(World world, EntityPlayer player, NBTTagC Infusion.spawnCreature(world, EntityNightmare.class, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), player, 2, 6); } } else if(player.dimension != Config.instance().dimensionDreamID && getPlayerIsGhost(nbtPlayer)) { + com.emoniph.witchery.common.ExtendedPlayer playerEx = com.emoniph.witchery.common.ExtendedPlayer.get(player); + if (playerEx != null && playerEx.isAstralProjecting()) { + return; + } int timeRemaining = 0; boolean skipNext = getPlayerSkipNextManifestTick(nbtPlayer); if(nbtPlayer.hasKey("WITCManifestDuration")) { diff --git a/src/main/java/com/emoniph/witchery/entity/EntityBanshee.java b/src/main/java/com/emoniph/witchery/entity/EntityBanshee.java index 07a570b..35c6eac 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntityBanshee.java +++ b/src/main/java/com/emoniph/witchery/entity/EntityBanshee.java @@ -35,10 +35,16 @@ public EntityBanshee(World par1World) { super.tasks.addTask(3, new EntityAIWander(this, 1.0D)); super.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); super.tasks.addTask(5, new EntityAILookIdle(this)); - super.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); super.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); } + public boolean getCanSpawnHere() { + if (this.worldObj.provider.dimensionId != com.emoniph.witchery.util.Config.instance().dimensionDreamID) { + return false; + } + return super.getCanSpawnHere(); + } + protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); @@ -68,16 +74,18 @@ public void onLivingUpdate() { while(i$.hasNext()) { Object obj = i$.next(); EntityLivingBase player = (EntityLivingBase)obj; - if(this.getDistanceSqToEntity(player) <= 36.0D && (player == this.getAttackTarget() || player == super.entityToAttack || player instanceof EntityPlayer)) { + double dsq = this.getDistanceSqToEntity(player); + if(dsq <= 36.0D && (player == this.getAttackTarget() || player == super.entityToAttack || player instanceof EntityPlayer)) { playersFound = true; if(!this.isScreaming()) { this.setScreaming(true); startedScreaming = true; } - if(!(player instanceof EntityPlayer) || !ItemEarmuffs.isHelmWorn((EntityPlayer)player)) { - float maxHealth = player.getMaxHealth(); - EntityUtil.touchOfDeath(player, this, Math.max(0.1F * maxHealth, 1.0F)); + if (this.dimension != com.emoniph.witchery.util.Config.instance().dimensionDreamID) { + float maxHealth = player.getMaxHealth(); + EntityUtil.touchOfDeath(player, this, Math.max(0.1F * maxHealth, 1.0F)); + } } } } diff --git a/src/main/java/com/emoniph/witchery/entity/EntityGoblin.java b/src/main/java/com/emoniph/witchery/entity/EntityGoblin.java index dbf7d52..30359a1 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntityGoblin.java +++ b/src/main/java/com/emoniph/witchery/entity/EntityGoblin.java @@ -84,6 +84,10 @@ public class EntityGoblin extends EntityAgeable implements IMerchant, INpc, IEnt private boolean preventDespawn; private static final double KOBOLDITE_HARVEST_CHANCE = 0.02D; private boolean testingLeashRange; + public String tamedOwnerName = ""; + public boolean isTamed = false; + public boolean isSitting = false; + public boolean isFollowing = false; public EntityGoblin(World par1World) { @@ -98,6 +102,49 @@ public EntityGoblin(World par1World, int par2) { this.getNavigator().setAvoidsWater(true); super.tasks.addTask(0, new EntityAISwimming(this)); super.tasks.addTask(1, this.aiWorship = new EntityAIWorship(this, (double)(TimeUtil.secsToTicks(30) + super.rand.nextInt(10)))); + super.tasks.addTask(1, new net.minecraft.entity.ai.EntityAIBase() { + { + this.setMutexBits(5); + } + public boolean shouldExecute() { + return EntityGoblin.this.isSitting; + } + public void startExecuting() { + EntityGoblin.this.getNavigator().clearPathEntity(); + } + public void updateTask() { + EntityGoblin.this.getNavigator().clearPathEntity(); + } + }); + super.tasks.addTask(5, new net.minecraft.entity.ai.EntityAIBase() { + private EntityLivingBase owner; + private int timeToRecalcPath; + { + this.setMutexBits(3); + } + public boolean shouldExecute() { + if (!EntityGoblin.this.isFollowing || EntityGoblin.this.isSitting || EntityGoblin.this.tamedOwnerName == null || EntityGoblin.this.tamedOwnerName.isEmpty()) return false; + this.owner = net.minecraft.server.MinecraftServer.getServer().getConfigurationManager().func_152612_a(EntityGoblin.this.tamedOwnerName); + return this.owner != null && EntityGoblin.this.getDistanceSqToEntity(this.owner) > 16.0D; + } + public boolean continueExecuting() { + return EntityGoblin.this.isFollowing && !EntityGoblin.this.isSitting && !EntityGoblin.this.getNavigator().noPath() && EntityGoblin.this.getDistanceSqToEntity(this.owner) > 4.0D; + } + public void startExecuting() { + this.timeToRecalcPath = 0; + } + public void resetTask() { + this.owner = null; + EntityGoblin.this.getNavigator().clearPathEntity(); + } + public void updateTask() { + EntityGoblin.this.getLookHelper().setLookPositionWithEntity(this.owner, 10.0F, (float)EntityGoblin.this.getVerticalFaceSpeed()); + if (--this.timeToRecalcPath <= 0) { + this.timeToRecalcPath = 10; + EntityGoblin.this.getNavigator().tryMoveToEntityLiving(this.owner, 0.6D); + } + } + }); super.tasks.addTask(2, new EntityAIPickUpBlocks(this, 24.0D)); super.tasks.addTask(2, new EntityAIDropOffBlocks(this, 24.0D)); super.tasks.addTask(2, new EntityAIDigBlocks(this, 16.0D, 0.02D)); @@ -113,7 +160,11 @@ public EntityGoblin(World par1World, int par2) { super.tasks.addTask(8, new EntityAIGoblinMate(this)); super.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); super.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityGoblin.class, 5.0F, 0.02F)); - super.tasks.addTask(9, new EntityAIWander(this, 0.6D)); + super.tasks.addTask(9, new EntityAIWander(this, 0.6D) { + public boolean shouldExecute() { + return !EntityGoblin.this.isFollowing && !EntityGoblin.this.isSitting && super.shouldExecute(); + } + }); super.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); super.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); super.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, true, true, this)); @@ -219,6 +270,20 @@ protected void updateAITick() { } } + if(this.isTamed && this.tamedOwnerName != null && !this.tamedOwnerName.isEmpty()) { + EntityPlayerMP owner = net.minecraft.server.MinecraftServer.getServer().getConfigurationManager().func_152612_a(this.tamedOwnerName); + if(owner != null) { + if(!this.isSitting && TimeUtil.secondsElapsed(2, super.ticksExisted)) { + int currentEnergy = com.emoniph.witchery.infusion.Infusion.getCurrentEnergy(owner); + int maxEnergy = com.emoniph.witchery.infusion.Infusion.getMaxEnergy(owner); + if(currentEnergy < maxEnergy) { + com.emoniph.witchery.infusion.Infusion.setCurrentEnergy(owner, Math.min(currentEnergy + 40, maxEnergy)); + com.emoniph.witchery.util.ParticleEffect.INSTANT_SPELL.send(com.emoniph.witchery.util.SoundEffect.NOTE_PLING, owner, 1.0D, 2.0D, 8); + } + } + } + } + super.updateAITick(); } @@ -303,7 +368,25 @@ public void setBesideClimbableBlock(boolean par1) { public boolean interact(EntityPlayer player) { ItemStack stack = player.inventory.getCurrentItem(); boolean heldSpawnEgg = stack != null && stack.getItem() == Items.spawn_egg; - if(!heldSpawnEgg && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !player.isSneaking()) { + + if (!heldSpawnEgg && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !player.isSneaking()) { + if (!this.isTamed && stack != null && stack.getItem() == Items.emerald) { + if (!super.worldObj.isRemote) { + if (!player.capabilities.isCreativeMode) { + --stack.stackSize; + if (stack.stackSize <= 0) { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + } + this.isTamed = true; + this.tamedOwnerName = player.getCommandSenderName(); + this.isFollowing = true; + this.preventDespawn = true; + super.worldObj.setEntityState(this, (byte)7); // Heart particles + } + return true; + } + if(this.getLeashed()) { if(this.getHeldItem() == null) { if(stack != null && stack.getItem() instanceof ItemPickaxe) { @@ -351,6 +434,10 @@ public void writeEntityToNBT(NBTTagCompound nbtRoot) { } nbtRoot.setBoolean("PreventDespawn", this.preventDespawn); + nbtRoot.setString("TamedOwnerName", this.tamedOwnerName != null ? this.tamedOwnerName : ""); + nbtRoot.setBoolean("IsTamed", this.isTamed); + nbtRoot.setBoolean("IsSitting", this.isSitting); + nbtRoot.setBoolean("IsFollowing", this.isFollowing); } public void readEntityFromNBT(NBTTagCompound nbtRoot) { @@ -367,6 +454,10 @@ public void readEntityFromNBT(NBTTagCompound nbtRoot) { } this.preventDespawn = nbtRoot.getBoolean("PreventDespawn"); + this.tamedOwnerName = nbtRoot.getString("TamedOwnerName"); + this.isTamed = nbtRoot.getBoolean("IsTamed"); + this.isSitting = nbtRoot.getBoolean("IsSitting"); + this.isFollowing = nbtRoot.getBoolean("IsFollowing"); } protected float getSoundPitch() { diff --git a/src/main/java/com/emoniph/witchery/entity/EntityLilith.java b/src/main/java/com/emoniph/witchery/entity/EntityLilith.java index e86c03d..ed1b4e4 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntityLilith.java +++ b/src/main/java/com/emoniph/witchery/entity/EntityLilith.java @@ -1,540 +1,540 @@ -package com.emoniph.witchery.entity; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.brewing.potions.PotionBase; -import com.emoniph.witchery.common.ExtendedPlayer; -import com.emoniph.witchery.entity.EntitySpellEffect; -import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; -import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; -import com.emoniph.witchery.item.ItemGlassGoblet; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.IHandleDT; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.RandomCollection; -import com.emoniph.witchery.util.SoundEffect; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import net.minecraft.enchantment.EnchantmentData; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIArrowAttack; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.boss.IBossDisplayData; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.entity.projectile.EntitySmallFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MathHelper; -import net.minecraft.util.StatCollector; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public class EntityLilith extends EntityMob implements IBossDisplayData, IRangedAttackMob, IHandleDT { - - private int attackTimer; - boolean isFriendly = false; - int weaknessTimer; - private static final RandomCollection SPELLS = createSpells(); - - - public EntityLilith(World world) { - super(world); - this.setSize(0.8F, 2.5F); - super.isImmuneToFire = true; - this.getNavigator().setAvoidsWater(true); - this.getNavigator().setCanSwim(true); - super.tasks.addTask(1, new EntityAISwimming(this)); - super.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 20, 60, 30.0F)); - super.tasks.addTask(3, new EntityAIWander(this, 1.0D)); - super.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - super.tasks.addTask(5, new EntityAILookIdle(this)); - super.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); - super.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); - super.experienceValue = 60; - } - - protected void entityInit() { - super.entityInit(); - super.dataWatcher.addObject(16, Byte.valueOf((byte)0)); - super.dataWatcher.addObject(17, Integer.valueOf(0)); - super.dataWatcher.addObject(20, new Integer(0)); - super.dataWatcher.addObject(21, new Integer(0)); - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(50.0D); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); - } - - public int getTotalArmorValue() { - return 8; - } - - public void setInWeb() {} - - public String getCommandSenderName() { - return this.hasCustomNameTag()?this.getCustomNameTag():StatCollector.translateToLocal("entity.witchery.lilith.name"); - } - - public boolean isAIEnabled() { - return !this.isFriendly; - } - - protected Entity findPlayerToAttack() { - return this.isFriendly?null:super.findPlayerToAttack(); - } - - protected void updateAITick() { - super.updateAITick(); - } - - public int getInvulnerableStartTicks() { - return super.dataWatcher.getWatchableObjectInt(20); - } - - public void setInvulnerableStartTicks(int par1) { - super.dataWatcher.updateObject(20, Integer.valueOf(par1)); - } - - public int getLifetime() { - return super.dataWatcher.getWatchableObjectInt(21); - } - - public void setLifetime(int par1) { - super.dataWatcher.updateObject(21, Integer.valueOf(par1)); - } - - public void setInvulnerableStart() { - this.setInvulnerableStartTicks(150); - this.setHealth(this.getMaxHealth() / 4.0F); - } - - protected void updateAITasks() { - if(this.getInvulnerableStartTicks() > 0) { - int R = this.getInvulnerableStartTicks() - 1; - if(R <= 0) { - super.worldObj.playBroadcastSound(1013, (int)super.posX, (int)super.posY, (int)super.posZ, 0); - } - - this.setInvulnerableStartTicks(R); - if(super.ticksExisted % 10 == 0) { - this.heal(this.getMaxHealth() * 0.75F / 15.0F); - } - } else { - super.updateAITasks(); - if(!super.worldObj.isRemote && !this.isPotionActive(Witchery.Potions.RESIZING)) { - this.addPotionEffect(new PotionEffect(Witchery.Potions.RESIZING.id, 10000, 3, true)); - } - - this.setLifetime(this.getLifetime() + 1); - if(super.ticksExisted % 20 == 0) { - if(this.weaknessTimer > 0) { - --this.weaknessTimer; - } - - if(!this.isPotionActive(Witchery.Potions.CHILLED) && !this.isPotionActive(Potion.weakness) && this.weaknessTimer == 0) { - this.heal(5.0F); - } else if(this.weaknessTimer == 0) { - this.heal(1.0F); - } - } - - if(super.ticksExisted % 20 == 0 && super.worldObj.rand.nextInt(5) == 0 && (this.getAttackTarget() != null || this.getLastAttacker() != null) && !super.worldObj.isRemote) { - boolean var12 = true; - double RY = 16.0D; - double RSQ = 1024.0D; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(super.posX - 32.0D, super.posY - 16.0D, super.posZ - 32.0D, super.posX + 32.0D, super.posY + 16.0D, super.posZ + 32.0D); - List players = super.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bounds); - Iterator i$ = players.iterator(); - - while(i$.hasNext()) { - EntityPlayer player = (EntityPlayer)i$.next(); - if(player.isPotionActive(Potion.fireResistance)) { - player.removePotionEffect(Potion.fireResistance.id); - } - - if(super.worldObj.rand.nextInt(2) == 0) { - SoundEffect.MOB_ENDERDRAGON_GROWL.playAtPlayer(super.worldObj, player); - - for(int i = 0; i < 3 + super.rand.nextInt(4); ++i) { - EntitySmallFireball fireball = new EntitySmallFireball(super.worldObj, player.posX + super.rand.nextDouble() * 4.0D - 2.0D, player.posY + (double)super.rand.nextInt(2) + 14.0D, player.posZ + super.rand.nextDouble() * 4.0D - 2.0D, 0.0D, -0.2D, 0.0D); - super.worldObj.spawnEntityInWorld(fireball); - } - } - } - } - } - - } - - protected int decreaseAirSupply(int par1) { - return par1; - } - - protected void collideWithEntity(Entity par1Entity) { - super.collideWithEntity(par1Entity); - } - - public void onLivingUpdate() { - super.onLivingUpdate(); - if(this.attackTimer > 0) { - --this.attackTimer; - } - - } - - public boolean attackEntityFrom(DamageSource source, float damage) { - boolean immune = false; - if(immune) { - return false; - } else { - if(source.getEntity() != null && source.getSourceOfDamage() instanceof EntityLargeFireball && source.getEntity() instanceof EntityPlayer) { - this.weaknessTimer = 10; - } - - return super.attackEntityFrom(source, Math.min(damage, 12.0F)); - } - } - - public float getCapDT(DamageSource source, float damage) { - return 12.0F; - } - - public void writeEntityToNBT(NBTTagCompound nbtRoot) { - super.writeEntityToNBT(nbtRoot); - nbtRoot.setInteger("Invul", this.getInvulnerableStartTicks()); - nbtRoot.setLong("Lifetime", (long)this.getLifetime()); - nbtRoot.setBoolean("Friendly", this.isFriendly); - } - - public void readEntityFromNBT(NBTTagCompound nbtRoot) { - super.readEntityFromNBT(nbtRoot); - this.setInvulnerableStartTicks(nbtRoot.getInteger("Invul")); - this.setLifetime(nbtRoot.getInteger("Lifetime")); - this.isFriendly = nbtRoot.getBoolean("Friendly"); - } - - public boolean attackEntityAsMob(Entity par1Entity) { - this.attackTimer = 10; - super.worldObj.setEntityState(this, (byte)4); - boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + super.rand.nextInt(15))); - if(flag) { - par1Entity.motionY += 0.4000000059604645D; - } - - this.playSound("mob.irongolem.throw", 1.0F, 1.0F); - return flag; - } - - @SideOnly(Side.CLIENT) - public void handleHealthUpdate(byte par1) { - if(par1 == 4) { - this.attackTimer = 10; - this.playSound("mob.irongolem.throw", 1.0F, 1.0F); - } else { - super.handleHealthUpdate(par1); - } - - } - - @SideOnly(Side.CLIENT) - public int getAttackTimer() { - return this.attackTimer; - } - - public float getBrightness(float par1) { - return 1.0F; - } - - protected String getLivingSound() { - return this.isFriendly?null:"witchery:mob.lilith.say"; - } - - protected String getHurtSound() { - return "witchery:mob.lilith.hit"; - } - - protected String getDeathSound() { - return this.isFriendly?"witchery:mob.lilith.hit":"witchery:mob.lilith.death"; - } - - protected void dropFewItems(boolean par1, int par2) {} - - public void onDeath(DamageSource source) { - if(!super.worldObj.isRemote) { - super.isDead = false; - ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, this, 1.0D, 2.0D, 16); - this.setHealth(this.getMaxHealth()); - this.isFriendly = true; - ArrayList effectsToRemove = new ArrayList(); - Collection effects = this.getActivePotionEffects(); - Iterator player = effects.iterator(); - - while(player.hasNext()) { - PotionEffect R = (PotionEffect)player.next(); - Potion RY = Potion.potionTypes[R.getPotionID()]; - if(PotionBase.isCurable(RY)) { - effectsToRemove.add(RY); - } - } - - player = effectsToRemove.iterator(); - - while(player.hasNext()) { - Potion R1 = (Potion)player.next(); - this.removePotionEffect(R1.id); - } - - EntityPlayer player1 = null; - if(source != null && source.getEntity() != null && source.getEntity() instanceof EntityPlayer) { - player1 = (EntityPlayer)source.getEntity(); - if(player1.dimension != super.dimension || player1.isDead || player1.getDistanceSqToEntity(this) > 4096.0D) { - player1 = null; - } - } - - if(player1 == null) { - boolean R2 = true; - double RY1 = 16.0D; - double RSQ = 1024.0D; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(super.posX - 32.0D, super.posY - 16.0D, super.posZ - 32.0D, super.posX + 32.0D, super.posY + 16.0D, super.posZ + 32.0D); - List players = super.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bounds); - double distSq = 0.0D; - Iterator i$ = players.iterator(); - - while(i$.hasNext()) { - EntityPlayer player2 = (EntityPlayer)i$.next(); - if(player1 == null) { - distSq = this.getDistanceSqToEntity(player2); - player1 = player2; - } else { - double newDist = this.getDistanceSqToEntity(player2); - if(newDist < distSq) { - distSq = newDist; - player1 = player2; - } - } - } - } - - if(player1 != null) { - this.setPositionAndUpdate(player1.posX - 1.0D + super.rand.nextDouble() * 2.0D, player1.posY + 0.05D, player1.posZ - 1.0D + super.rand.nextDouble() * 2.0D); - ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, this, 1.0D, 2.0D, 16); - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player1, "item.witchery:glassgoblet.lilithquestcomplete", new Object[0]); - SoundEffect.WITCHERY_MOB_LILITH_TALK.playAt((EntityLiving)this); - } else { - this.setDead(); - } - } - - } - - protected Item getDropItem() { - return null; - } - - protected boolean canDespawn() { - return false; - } - - protected boolean interact(EntityPlayer player) { - if(!super.worldObj.isRemote && this.isFriendly) { - ItemStack stack = player.getHeldItem(); - SoundEffect.WITCHERY_MOB_LILITH_TALK.playAt((EntityLiving)this, 1.0F); - boolean vanish = false; - if(stack == null) { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcomplete2", new Object[0]); - } else if(stack.getItem() == Witchery.Items.BLOOD_GOBLET) { - if(!ExtendedPlayer.get(player).isVampire()) { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletelife", new Object[0]); - player.setCurrentItemOrArmor(0, (ItemStack)null); - ParticleEffect.REDDUST.send(SoundEffect.WITCHERY_RANDOM_DRINK, player.worldObj, player.posX, player.posY + (double)player.height * 0.85D, player.posZ, 0.8D, 0.8D, 16); - Witchery.Items.BLOOD_GOBLET.setBloodOwner(stack, ItemGlassGoblet.BloodSource.LILITH); - super.worldObj.spawnEntityInWorld(new EntityItem(super.worldObj, player.posX, player.posY, player.posZ, stack)); - ExtendedPlayer.get(player).setHumanBlood(0); - vanish = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletelifefail", new Object[0]); - } - } else if(stack.getItem() == Witchery.Items.SEEDS_GARLIC) { - if(ExtendedPlayer.get(player).isVampire()) { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletecure", new Object[0]); - player.setCurrentItemOrArmor(0, (ItemStack)null); - ExtendedPlayer.get(player).setVampireLevel(0); - ParticleEffect.REDDUST.send(SoundEffect.RANDOM_FIZZ, player, 1.0D, 1.5D, 16); - vanish = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletecurefail", new Object[0]); - } - } else if(stack.getItem() == Item.getItemFromBlock(Blocks.red_flower) && stack.getItemDamage() == 0) { - ExtendedPlayer enchants1 = ExtendedPlayer.get(player); - if(enchants1.getVampireLevel() == 6 && enchants1.canIncreaseVampireLevel()) { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletebatflight", new Object[0]); - player.setCurrentItemOrArmor(0, (ItemStack)null); - enchants1.increaseVampireLevel(); - ParticleEffect.REDDUST.send(SoundEffect.RANDOM_FIZZ, player, 1.0D, 1.5D, 16); - vanish = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletebatflightfail", new Object[0]); - } - } else { - List enchants = EnchantmentHelper.buildEnchantmentList(super.worldObj.rand, stack, 40); - if(enchants != null && enchants.size() > 0) { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletemagic", new Object[0]); - player.setCurrentItemOrArmor(0, (ItemStack)null); - addEnchantmentsFromList(stack, enchants); - if(stack.isItemStackDamageable()) { - stack.setItemDamage(0); - } - - super.worldObj.spawnEntityInWorld(new EntityItem(super.worldObj, player.posX, player.posY, player.posZ, stack)); - vanish = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcomplete2", new Object[0]); - } - } - - if(vanish) { - ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, this, 1.0D, 2.0D, 16); - this.setDead(); - } - - return true; - } else { - return false; - } - } - - private static void addEnchantmentsFromList(ItemStack stack, List list) { - boolean flag = stack.getItem() == Items.book; - if(flag) { - stack.func_150996_a(Items.enchanted_book); - } - - Map enchants = EnchantmentHelper.getEnchantments(stack); - if(list != null) { - Iterator iterator = list.iterator(); - - while(iterator.hasNext()) { - EnchantmentData enchantmentdata = (EnchantmentData)iterator.next(); - if(flag) { - Items.enchanted_book.addEnchantment(stack, enchantmentdata); - } else { - if(stack.getTagCompound() == null) { - stack.setTagCompound(new NBTTagCompound()); - } - - if(!stack.getTagCompound().hasKey("ench", 9)) { - stack.getTagCompound().setTag("ench", new NBTTagList()); - } - - NBTTagList nbttaglist = stack.getTagCompound().getTagList("ench", 10); - boolean addEnchant = true; - - for(int nbttagcompound = 0; nbttagcompound < nbttaglist.tagCount(); ++nbttagcompound) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(nbttagcompound); - if(nbttagcompound1.getShort("id") == enchantmentdata.enchantmentobj.effectId) { - if(nbttagcompound1.getShort("lvl") < enchantmentdata.enchantmentLevel) { - nbttagcompound1.setShort("lvl", (short)enchantmentdata.enchantmentLevel); - } - - addEnchant = false; - break; - } - } - - if(addEnchant) { - NBTTagCompound var10 = new NBTTagCompound(); - var10.setShort("id", (short)enchantmentdata.enchantmentobj.effectId); - var10.setShort("lvl", (short)((byte)enchantmentdata.enchantmentLevel)); - nbttaglist.appendTag(var10); - } - - stack.getTagCompound().setTag("ench", nbttaglist); - } - } - } - - } - - private static RandomCollection createSpells() { - RandomCollection spells = new RandomCollection(); - EffectRegistry.instance(); - spells.add(1.0D, EffectRegistry.Ignianima); - EffectRegistry.instance(); - spells.add(5.0D, EffectRegistry.Flipendo); - EffectRegistry.instance(); - spells.add(1.0D, EffectRegistry.Impedimenta); - EffectRegistry.instance(); - spells.add(1.0D, EffectRegistry.Confundus); - EffectRegistry.instance(); - spells.add(5.0D, EffectRegistry.Attraho); - return spells; - } - - public void attackEntityWithRangedAttack(EntityLivingBase targetEntity, float par2) { - if(super.worldObj.rand.nextBoolean()) { - this.attackTimer = 10; - super.worldObj.setEntityState(this, (byte)4); - double d0 = targetEntity.posX - super.posX; - double d1 = targetEntity.boundingBox.minY + (double)(targetEntity.height / 2.0F) - (super.posY + (double)(super.height / 2.0F)); - double d2 = targetEntity.posZ - super.posZ; - float f1 = MathHelper.sqrt_float(par2) * 0.5F; - if(!super.worldObj.isRemote) { - if(super.worldObj.rand.nextInt(3) == 0) { - EntityLargeFireball count = new EntityLargeFireball(super.worldObj, this, d0 + super.rand.nextGaussian() * (double)f1, d1, d2 + super.rand.nextGaussian() * (double)f1); - double effect = 1.0D; - Vec3 vec3 = this.getLook(1.0F); - count.posX = super.posX + vec3.xCoord * effect; - count.posY = super.posY + (double)(super.height / 2.0F) + 0.5D; - count.posZ = super.posZ + vec3.zCoord * effect; - if(!super.worldObj.isRemote) { - super.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)super.posX, (int)super.posY, (int)super.posZ, 0); - super.worldObj.spawnEntityInWorld(count); - } - } else { - super.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)super.posX, (int)super.posY, (int)super.posZ, 0); - boolean count1 = super.rand.nextInt(10) == 0?true:true; - EntitySpellEffect effect1 = new EntitySpellEffect(super.worldObj, this, d0 + super.rand.nextGaussian() * (double)f1, d1, d2 + super.rand.nextGaussian() * (double)f1, (SymbolEffect)SPELLS.next(), 1); - double d8 = 1.0D; - effect1.posX = super.posX; - effect1.posY = super.posY + (double)(super.height / 2.0F); - effect1.posZ = super.posZ; - super.worldObj.spawnEntityInWorld(effect1); - effect1.setShooter(this); - } - } - } - - } - -} +package com.emoniph.witchery.entity; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.brewing.potions.PotionBase; +import com.emoniph.witchery.common.ExtendedPlayer; +import com.emoniph.witchery.entity.EntitySpellEffect; +import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; +import com.emoniph.witchery.item.ItemGlassGoblet; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.IHandleDT; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.RandomCollection; +import com.emoniph.witchery.util.SoundEffect; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityLilith extends EntityMob implements IBossDisplayData, IRangedAttackMob, IHandleDT { + + private int attackTimer; + boolean isFriendly = false; + int weaknessTimer; + private static final RandomCollection SPELLS = createSpells(); + + + public EntityLilith(World world) { + super(world); + this.setSize(0.8F, 2.5F); + super.isImmuneToFire = true; + this.getNavigator().setAvoidsWater(true); + this.getNavigator().setCanSwim(true); + super.tasks.addTask(1, new EntityAISwimming(this)); + super.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 20, 60, 30.0F)); + super.tasks.addTask(3, new EntityAIWander(this, 1.0D)); + super.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + super.tasks.addTask(5, new EntityAILookIdle(this)); + super.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + super.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + super.experienceValue = 60; + } + + protected void entityInit() { + super.entityInit(); + super.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + super.dataWatcher.addObject(17, Integer.valueOf(0)); + super.dataWatcher.addObject(20, new Integer(0)); + super.dataWatcher.addObject(21, new Integer(0)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(50.0D); + this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); + } + + public int getTotalArmorValue() { + return 8; + } + + public void setInWeb() {} + + public String getCommandSenderName() { + return this.hasCustomNameTag()?this.getCustomNameTag():StatCollector.translateToLocal("entity.witchery.lilith.name"); + } + + public boolean isAIEnabled() { + return !this.isFriendly; + } + + protected Entity findPlayerToAttack() { + return this.isFriendly?null:super.findPlayerToAttack(); + } + + protected void updateAITick() { + super.updateAITick(); + } + + public int getInvulnerableStartTicks() { + return super.dataWatcher.getWatchableObjectInt(20); + } + + public void setInvulnerableStartTicks(int par1) { + super.dataWatcher.updateObject(20, Integer.valueOf(par1)); + } + + public int getLifetime() { + return super.dataWatcher.getWatchableObjectInt(21); + } + + public void setLifetime(int par1) { + super.dataWatcher.updateObject(21, Integer.valueOf(par1)); + } + + public void setInvulnerableStart() { + this.setInvulnerableStartTicks(150); + this.setHealth(this.getMaxHealth() / 4.0F); + } + + protected void updateAITasks() { + if(this.getInvulnerableStartTicks() > 0) { + int R = this.getInvulnerableStartTicks() - 1; + if(R <= 0) { + super.worldObj.playBroadcastSound(1013, (int)super.posX, (int)super.posY, (int)super.posZ, 0); + } + + this.setInvulnerableStartTicks(R); + if(super.ticksExisted % 10 == 0) { + this.heal(this.getMaxHealth() * 0.75F / 15.0F); + } + } else { + super.updateAITasks(); + if(!super.worldObj.isRemote && !this.isPotionActive(Witchery.Potions.RESIZING)) { + this.addPotionEffect(new PotionEffect(Witchery.Potions.RESIZING.id, 10000, 3, true)); + } + + this.setLifetime(this.getLifetime() + 1); + if(super.ticksExisted % 20 == 0) { + if(this.weaknessTimer > 0) { + --this.weaknessTimer; + } + + if(!this.isPotionActive(Witchery.Potions.CHILLED) && !this.isPotionActive(Potion.weakness) && this.weaknessTimer == 0) { + this.heal(5.0F); + } else if(this.weaknessTimer == 0) { + this.heal(1.0F); + } + } + + if(super.ticksExisted % 20 == 0 && super.worldObj.rand.nextInt(5) == 0 && (this.getAttackTarget() != null || this.getLastAttacker() != null) && !super.worldObj.isRemote) { + boolean var12 = true; + double RY = 16.0D; + double RSQ = 1024.0D; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(super.posX - 32.0D, super.posY - 16.0D, super.posZ - 32.0D, super.posX + 32.0D, super.posY + 16.0D, super.posZ + 32.0D); + List players = super.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bounds); + Iterator i$ = players.iterator(); + + while(i$.hasNext()) { + EntityPlayer player = (EntityPlayer)i$.next(); + if(player.isPotionActive(Potion.fireResistance)) { + player.removePotionEffect(Potion.fireResistance.id); + } + + if(super.worldObj.rand.nextInt(2) == 0) { + SoundEffect.MOB_ENDERDRAGON_GROWL.playAtPlayer(super.worldObj, player); + + for(int i = 0; i < 3 + super.rand.nextInt(4); ++i) { + EntitySmallFireball fireball = new EntitySmallFireball(super.worldObj, player.posX + super.rand.nextDouble() * 4.0D - 2.0D, player.posY + (double)super.rand.nextInt(2) + 14.0D, player.posZ + super.rand.nextDouble() * 4.0D - 2.0D, 0.0D, -0.2D, 0.0D); + super.worldObj.spawnEntityInWorld(fireball); + } + } + } + } + } + + } + + protected int decreaseAirSupply(int par1) { + return par1; + } + + protected void collideWithEntity(Entity par1Entity) { + super.collideWithEntity(par1Entity); + } + + public void onLivingUpdate() { + super.onLivingUpdate(); + if(this.attackTimer > 0) { + --this.attackTimer; + } + + } + + public boolean attackEntityFrom(DamageSource source, float damage) { + boolean immune = false; + if(immune) { + return false; + } else { + if(source.getEntity() != null && source.getSourceOfDamage() instanceof EntityLargeFireball && source.getEntity() instanceof EntityPlayer) { + this.weaknessTimer = 10; + } + + return super.attackEntityFrom(source, Math.min(damage, 12.0F)); + } + } + + public float getCapDT(DamageSource source, float damage) { + return 12.0F; + } + + public void writeEntityToNBT(NBTTagCompound nbtRoot) { + super.writeEntityToNBT(nbtRoot); + nbtRoot.setInteger("Invul", this.getInvulnerableStartTicks()); + nbtRoot.setLong("Lifetime", (long)this.getLifetime()); + nbtRoot.setBoolean("Friendly", this.isFriendly); + } + + public void readEntityFromNBT(NBTTagCompound nbtRoot) { + super.readEntityFromNBT(nbtRoot); + this.setInvulnerableStartTicks(nbtRoot.getInteger("Invul")); + this.setLifetime(nbtRoot.getInteger("Lifetime")); + this.isFriendly = nbtRoot.getBoolean("Friendly"); + } + + public boolean attackEntityAsMob(Entity par1Entity) { + this.attackTimer = 10; + super.worldObj.setEntityState(this, (byte)4); + boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + super.rand.nextInt(15))); + if(flag) { + par1Entity.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte par1) { + if(par1 == 4) { + this.attackTimer = 10; + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + } else { + super.handleHealthUpdate(par1); + } + + } + + @SideOnly(Side.CLIENT) + public int getAttackTimer() { + return this.attackTimer; + } + + public float getBrightness(float par1) { + return 1.0F; + } + + protected String getLivingSound() { + return this.isFriendly?null:"witchery:mob.lilith.say"; + } + + protected String getHurtSound() { + return "witchery:mob.lilith.hit"; + } + + protected String getDeathSound() { + return this.isFriendly?"witchery:mob.lilith.hit":"witchery:mob.lilith.death"; + } + + protected void dropFewItems(boolean par1, int par2) {} + + public void onDeath(DamageSource source) { + if(!super.worldObj.isRemote) { + super.isDead = false; + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, this, 1.0D, 2.0D, 16); + this.setHealth(this.getMaxHealth()); + this.isFriendly = true; + ArrayList effectsToRemove = new ArrayList(); + Collection effects = this.getActivePotionEffects(); + Iterator player = effects.iterator(); + + while(player.hasNext()) { + PotionEffect R = (PotionEffect)player.next(); + Potion RY = Potion.potionTypes[R.getPotionID()]; + if(PotionBase.isCurable(RY)) { + effectsToRemove.add(RY); + } + } + + player = effectsToRemove.iterator(); + + while(player.hasNext()) { + Potion R1 = (Potion)player.next(); + this.removePotionEffect(R1.id); + } + + EntityPlayer player1 = null; + if(source != null && source.getEntity() != null && source.getEntity() instanceof EntityPlayer) { + player1 = (EntityPlayer)source.getEntity(); + if(player1.dimension != super.dimension || player1.isDead || player1.getDistanceSqToEntity(this) > 4096.0D) { + player1 = null; + } + } + + if(player1 == null) { + boolean R2 = true; + double RY1 = 16.0D; + double RSQ = 1024.0D; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(super.posX - 32.0D, super.posY - 16.0D, super.posZ - 32.0D, super.posX + 32.0D, super.posY + 16.0D, super.posZ + 32.0D); + List players = super.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bounds); + double distSq = 0.0D; + Iterator i$ = players.iterator(); + + while(i$.hasNext()) { + EntityPlayer player2 = (EntityPlayer)i$.next(); + if(player1 == null) { + distSq = this.getDistanceSqToEntity(player2); + player1 = player2; + } else { + double newDist = this.getDistanceSqToEntity(player2); + if(newDist < distSq) { + distSq = newDist; + player1 = player2; + } + } + } + } + + if(player1 != null) { + this.setPositionAndUpdate(player1.posX - 1.0D + super.rand.nextDouble() * 2.0D, player1.posY + 0.05D, player1.posZ - 1.0D + super.rand.nextDouble() * 2.0D); + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, this, 1.0D, 2.0D, 16); + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player1, "item.witchery:glassgoblet.lilithquestcomplete", new Object[0]); + SoundEffect.WITCHERY_MOB_LILITH_TALK.playAt((EntityLiving)this); + } else { + this.setDead(); + } + } + + } + + protected Item getDropItem() { + return null; + } + + protected boolean canDespawn() { + return false; + } + + protected boolean interact(EntityPlayer player) { + if(!super.worldObj.isRemote && this.isFriendly) { + ItemStack stack = player.getHeldItem(); + SoundEffect.WITCHERY_MOB_LILITH_TALK.playAt((EntityLiving)this, 1.0F); + boolean vanish = false; + if(stack == null) { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcomplete2", new Object[0]); + } else if(stack.getItem() == Witchery.Items.BLOOD_GOBLET) { + if(!ExtendedPlayer.get(player).isVampire()) { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletelife", new Object[0]); + player.setCurrentItemOrArmor(0, (ItemStack)null); + ParticleEffect.REDDUST.send(SoundEffect.WITCHERY_RANDOM_DRINK, player.worldObj, player.posX, player.posY + (double)player.height * 0.85D, player.posZ, 0.8D, 0.8D, 16); + Witchery.Items.BLOOD_GOBLET.setBloodOwner(stack, ItemGlassGoblet.BloodSource.LILITH); + super.worldObj.spawnEntityInWorld(new EntityItem(super.worldObj, player.posX, player.posY, player.posZ, stack)); + ExtendedPlayer.get(player).setHumanBlood(0); + vanish = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletelifefail", new Object[0]); + } + } else if(stack.getItem() == Witchery.Items.SEEDS_GARLIC) { + if(ExtendedPlayer.get(player).isVampire()) { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletecure", new Object[0]); + player.setCurrentItemOrArmor(0, (ItemStack)null); + ExtendedPlayer.get(player).setVampireLevel(0); + ParticleEffect.REDDUST.send(SoundEffect.RANDOM_FIZZ, player, 1.0D, 1.5D, 16); + vanish = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletecurefail", new Object[0]); + } + } else if(stack.getItem() == Item.getItemFromBlock(Blocks.red_flower) && stack.getItemDamage() == 0) { + ExtendedPlayer enchants1 = ExtendedPlayer.get(player); + if(enchants1.getVampireLevel() == 6 && enchants1.canIncreaseVampireLevel()) { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletebatflight", new Object[0]); + player.setCurrentItemOrArmor(0, (ItemStack)null); + enchants1.increaseVampireLevel(); + ParticleEffect.REDDUST.send(SoundEffect.RANDOM_FIZZ, player, 1.0D, 1.5D, 16); + vanish = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletebatflightfail", new Object[0]); + } + } else { + List enchants = EnchantmentHelper.buildEnchantmentList(super.worldObj.rand, stack, 40); + if(enchants != null && enchants.size() > 0) { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcompletemagic", new Object[0]); + player.setCurrentItemOrArmor(0, (ItemStack)null); + addEnchantmentsFromList(stack, enchants); + if(stack.isItemStackDamageable()) { + stack.setItemDamage(0); + } + + super.worldObj.spawnEntityInWorld(new EntityItem(super.worldObj, player.posX, player.posY, player.posZ, stack)); + vanish = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, player, "item.witchery:glassgoblet.lilithquestcomplete2", new Object[0]); + } + } + + if(vanish) { + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, this, 1.0D, 2.0D, 16); + this.setDead(); + } + + return true; + } else { + return false; + } + } + + private static void addEnchantmentsFromList(ItemStack stack, List list) { + boolean flag = stack.getItem() == Items.book; + if(flag) { + stack.func_150996_a(Items.enchanted_book); + } + + Map enchants = EnchantmentHelper.getEnchantments(stack); + if(list != null) { + Iterator iterator = list.iterator(); + + while(iterator.hasNext()) { + EnchantmentData enchantmentdata = (EnchantmentData)iterator.next(); + if(flag) { + Items.enchanted_book.addEnchantment(stack, enchantmentdata); + } else { + if(stack.getTagCompound() == null) { + stack.setTagCompound(new NBTTagCompound()); + } + + if(!stack.getTagCompound().hasKey("ench", 9)) { + stack.getTagCompound().setTag("ench", new NBTTagList()); + } + + NBTTagList nbttaglist = stack.getTagCompound().getTagList("ench", 10); + boolean addEnchant = true; + + for(int nbttagcompound = 0; nbttagcompound < nbttaglist.tagCount(); ++nbttagcompound) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(nbttagcompound); + if(nbttagcompound1.getShort("id") == enchantmentdata.enchantmentobj.effectId) { + if(nbttagcompound1.getShort("lvl") < enchantmentdata.enchantmentLevel) { + nbttagcompound1.setShort("lvl", (short)enchantmentdata.enchantmentLevel); + } + + addEnchant = false; + break; + } + } + + if(addEnchant) { + NBTTagCompound var10 = new NBTTagCompound(); + var10.setShort("id", (short)enchantmentdata.enchantmentobj.effectId); + var10.setShort("lvl", (short)((byte)enchantmentdata.enchantmentLevel)); + nbttaglist.appendTag(var10); + } + + stack.getTagCompound().setTag("ench", nbttaglist); + } + } + } + + } + + private static RandomCollection createSpells() { + RandomCollection spells = new RandomCollection(); + EffectRegistry.instance(); + spells.add(1.0D, EffectRegistry.Ignianima); + EffectRegistry.instance(); + spells.add(5.0D, EffectRegistry.Flipendo); + EffectRegistry.instance(); + spells.add(1.0D, EffectRegistry.Impedimenta); + EffectRegistry.instance(); + spells.add(1.0D, EffectRegistry.Confundus); + EffectRegistry.instance(); + //spells.add(5.0D, EffectRegistry.Attraho); + return spells; + } + + public void attackEntityWithRangedAttack(EntityLivingBase targetEntity, float par2) { + if(super.worldObj.rand.nextBoolean()) { + this.attackTimer = 10; + super.worldObj.setEntityState(this, (byte)4); + double d0 = targetEntity.posX - super.posX; + double d1 = targetEntity.boundingBox.minY + (double)(targetEntity.height / 2.0F) - (super.posY + (double)(super.height / 2.0F)); + double d2 = targetEntity.posZ - super.posZ; + float f1 = MathHelper.sqrt_float(par2) * 0.5F; + if(!super.worldObj.isRemote) { + if(super.worldObj.rand.nextInt(3) == 0) { + EntityLargeFireball count = new EntityLargeFireball(super.worldObj, this, d0 + super.rand.nextGaussian() * (double)f1, d1, d2 + super.rand.nextGaussian() * (double)f1); + double effect = 1.0D; + Vec3 vec3 = this.getLook(1.0F); + count.posX = super.posX + vec3.xCoord * effect; + count.posY = super.posY + (double)(super.height / 2.0F) + 0.5D; + count.posZ = super.posZ + vec3.zCoord * effect; + if(!super.worldObj.isRemote) { + super.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)super.posX, (int)super.posY, (int)super.posZ, 0); + super.worldObj.spawnEntityInWorld(count); + } + } else { + super.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)super.posX, (int)super.posY, (int)super.posZ, 0); + boolean count1 = super.rand.nextInt(10) == 0?true:true; + EntitySpellEffect effect1 = new EntitySpellEffect(super.worldObj, this, d0 + super.rand.nextGaussian() * (double)f1, d1, d2 + super.rand.nextGaussian() * (double)f1, (SymbolEffect)SPELLS.next(), 1); + double d8 = 1.0D; + effect1.posX = super.posX; + effect1.posY = super.posY + (double)(super.height / 2.0F); + effect1.posZ = super.posZ; + super.worldObj.spawnEntityInWorld(effect1); + effect1.setShooter(this); + } + } + } + + } + +} diff --git a/src/main/java/com/emoniph/witchery/entity/EntityNightmare.java b/src/main/java/com/emoniph/witchery/entity/EntityNightmare.java index f7e5f50..5498a8a 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntityNightmare.java +++ b/src/main/java/com/emoniph/witchery/entity/EntityNightmare.java @@ -63,6 +63,13 @@ public EntityNightmare(World par1World) { super.experienceValue = 25; } + public boolean getCanSpawnHere() { + if (this.worldObj.provider.dimensionId != com.emoniph.witchery.util.Config.instance().dimensionDreamID) { + return false; + } + return super.getCanSpawnHere(); + } + public boolean isEntityApplicable(Entity entity) { if(!(entity instanceof EntityPlayer)) { return false; @@ -222,7 +229,9 @@ public boolean attackEntityAsMob(Entity entity) { } float f1 = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - if(super.dimension != Config.instance().dimensionDreamID) { + if(super.dimension == Config.instance().dimensionDreamID) { + f1 = 0.0F; + } else { f1 = 0.5F; } diff --git a/src/main/java/com/emoniph/witchery/entity/EntityPoltergeist.java b/src/main/java/com/emoniph/witchery/entity/EntityPoltergeist.java index ccee48c..794cc2f 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntityPoltergeist.java +++ b/src/main/java/com/emoniph/witchery/entity/EntityPoltergeist.java @@ -51,6 +51,13 @@ public EntityPoltergeist(World par1World) { super.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); } + public boolean getCanSpawnHere() { + if (this.worldObj.provider.dimensionId != com.emoniph.witchery.util.Config.instance().dimensionDreamID) { + return false; + } + return super.getCanSpawnHere(); + } + protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(20.0D); @@ -222,6 +229,9 @@ public void onUpdate() { } public boolean attackEntityAsMob(Entity par1Entity) { + if (this.dimension == com.emoniph.witchery.util.Config.instance().dimensionDreamID) { + return false; + } boolean flag = super.attackEntityAsMob(par1Entity); return flag; } diff --git a/src/main/java/com/emoniph/witchery/entity/EntityReflection.java b/src/main/java/com/emoniph/witchery/entity/EntityReflection.java index 6fd034d..8707470 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntityReflection.java +++ b/src/main/java/com/emoniph/witchery/entity/EntityReflection.java @@ -1,597 +1,597 @@ -package com.emoniph.witchery.entity; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.client.renderer.RenderReflection; -import com.emoniph.witchery.common.ExtendedPlayer; -import com.emoniph.witchery.entity.EntityBolt; -import com.emoniph.witchery.entity.EntitySpellEffect; -import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; -import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.CreatureUtil; -import com.emoniph.witchery.util.IHandleDT; -import com.emoniph.witchery.util.RandomCollection; -import com.emoniph.witchery.util.TransformCreature; -import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.io.File; -import java.util.Iterator; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.AbstractClientPlayer; -import net.minecraft.client.renderer.ImageBufferDownload; -import net.minecraft.client.renderer.ThreadDownloadImageData; -import net.minecraft.client.renderer.texture.ITextureObject; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIArrowAttack; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.boss.IBossDisplayData; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBow; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraft.util.StringUtils; -import net.minecraft.world.World; - -public class EntityReflection extends EntityMob implements IBossDisplayData, IRangedAttackMob, IHandleDT { - - private int attackTimer; - private boolean freeSpawn; - private boolean isVampire; - private int livingTicks = -1; - private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); - private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityLivingBase.class, 1.2D, false); - private String owner = ""; - private EntityReflection.Task task; - private static final RandomCollection SPELLS = createSpells(); - @SideOnly(Side.CLIENT) - private ThreadDownloadImageData downloadImageSkin; - @SideOnly(Side.CLIENT) - private ResourceLocation locationSkin; - private String lastSkinOwner; - - - public EntityReflection(World world) { - super(world); - this.task = EntityReflection.Task.NONE; - this.setSize(0.6F, 1.8F); - super.isImmuneToFire = true; - this.getNavigator().setAvoidsWater(true); - this.getNavigator().setCanSwim(true); - super.tasks.addTask(1, new EntityAISwimming(this)); - super.tasks.addTask(3, new EntityAIWander(this, 1.0D)); - super.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - super.tasks.addTask(5, new EntityAILookIdle(this)); - super.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); - super.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); - super.experienceValue = 50; - } - - protected void entityInit() { - super.entityInit(); - super.dataWatcher.addObject(17, ""); - super.dataWatcher.addObject(18, Byte.valueOf((byte)0)); - } - - public String getOwnerSkin() { - return super.dataWatcher.getWatchableObjectString(17); - } - - public String getOwnerName() { - return this.owner; - } - - public void setOwnerSkin(String skinName) { - super.dataWatcher.updateObject(17, skinName); - } - - public void setOwner(String par1Str) { - this.func_110163_bv(); - this.owner = par1Str; - } - - public EntityPlayer getOwnerEntity() { - return super.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - - public void setModel(int model) { - super.dataWatcher.updateObject(18, Byte.valueOf((byte)model)); - } - - public int getModel() { - return super.dataWatcher.getWatchableObjectByte(18); - } - - public void setLifetime(int ticks) { - this.livingTicks = ticks; - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(50.0D); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); - } - - public void setInWeb() {} - - public String getCommandSenderName() { - if(this.hasCustomNameTag()) { - return this.getCustomNameTag(); - } else { - String owner = this.getOwnerName(); - return owner != null && !owner.isEmpty()?owner:StatCollector.translateToLocal("entity.witchery.reflection.name"); - } - } - - public boolean isAIEnabled() { - return true; - } - - protected void updateAITick() { - super.updateAITick(); - } - - protected int decreaseAirSupply(int par1) { - return par1; - } - - protected void collideWithEntity(Entity par1Entity) { - super.collideWithEntity(par1Entity); - } - - public void onLivingUpdate() { - super.onLivingUpdate(); - if(this.attackTimer > 0) { - --this.attackTimer; - } - - if(!super.worldObj.isRemote && super.ticksExisted % 30 == 1) { - if(!this.freeSpawn && super.dimension != Config.instance().dimensionMirrorID) { - this.setDead(); - return; - } - - if(this.livingTicks > -1 && --this.livingTicks == 0) { - this.setDead(); - return; - } - - double R = 10.0D; - double RY = 8.0D; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(super.posX - R, super.posY - RY, super.posZ - R, super.posX + R, super.posY + RY, super.posZ + R); - List players = super.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bounds); - EntityPlayer ownerEntity = this.getOwnerEntity(); - boolean ownerFound = false; - EntityPlayer closest = null; - double distance = Double.MAX_VALUE; - Iterator resetGear = players.iterator(); - - while(resetGear.hasNext()) { - EntityPlayer skinName = (EntityPlayer)resetGear.next(); - double held = skinName.getDistanceSqToEntity(this); - if(closest == null || held < distance) { - closest = skinName; - distance = held; - } - - if(ownerEntity == skinName) { - ownerFound = true; - } - } - - if(ownerEntity == null || !ownerFound) { - if(closest != null) { - this.setOwner(closest.getCommandSenderName()); - } else { - this.setOwner(""); - } - } - - boolean var25 = true; - String var26 = this.getOwnerName(); - if(!this.getOwnerName().isEmpty()) { - EntityPlayer var28 = ownerEntity != null && ownerFound?ownerEntity:this.getOwnerEntity(); - if(var28 != null) { - for(int bestWeapon = 1; bestWeapon <= 4; ++bestWeapon) { - ItemStack bestDamage = var28.getEquipmentInSlot(bestWeapon); - if(bestDamage != null) { - bestDamage = bestDamage.copy(); - } - - this.setCurrentItemOrArmor(bestWeapon, bestDamage); - } - - ItemStack var30 = null; - double var31 = 0.0D; - - ItemStack stack; - for(int playerEx = 0; playerEx < 9; ++playerEx) { - stack = var28.inventory.getStackInSlot(playerEx); - if(stack != null) { - Multimap effects = stack.getAttributeModifiers(); - Iterator effect = effects.get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).iterator(); - double damage = 0.0D; - - while(effect.hasNext()) { - AttributeModifier modifier = (AttributeModifier)effect.next(); - if(modifier.getOperation() == 0) { - damage += modifier.getAmount(); - } - } - - if(damage > var31) { - var30 = stack; - var31 = damage; - } - } - } - - ExtendedPlayer var32 = ExtendedPlayer.get(var28); - if(var32 != null) { - this.setModel(var32.getCreatureType() == TransformCreature.WOLFMAN?1:0); - this.isVampire = var32.isVampire(); - if(var32.getCreatureType() == TransformCreature.PLAYER) { - var26 = var32.getOtherPlayerSkin(); - } - } - - stack = var30 != null?var30:var28.getEquipmentInSlot(0); - if(stack != null) { - stack = stack.copy(); - Witchery.modHooks.makeItemModProof(stack); - } - - if(this.getModel() == 1) { - stack = null; - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); - } else { - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); - } - - this.setCurrentItemOrArmor(0, stack); - var25 = false; - if(super.ticksExisted % 60 == 1) { - this.clearActivePotions(); - Iterator var33 = var28.getActivePotionEffects().iterator(); - - while(var33.hasNext()) { - PotionEffect var34 = (PotionEffect)var33.next(); - this.addPotionEffect(new PotionEffect(var34)); - } - } - } - } - - if(var25) { - for(int var29 = 0; var29 <= 4; ++var29) { - this.setCurrentItemOrArmor(var29, (ItemStack)null); - } - } - - this.setOwnerSkin(var26); - ItemStack var27 = this.getHeldItem(); - if(var27 != null) { - if(var27.getItem() == Witchery.Items.MYSTIC_BRANCH) { - if(this.task == EntityReflection.Task.MELEE) { - super.tasks.removeTask(this.aiAttackOnCollide); - } - - super.tasks.addTask(2, this.aiArrowAttack); - this.task = EntityReflection.Task.RANGED; - } else if(var27.getItem() != Witchery.Items.CROSSBOW_PISTOL && !(var27.getItem() instanceof ItemBow)) { - if(this.task == EntityReflection.Task.RANGED) { - super.tasks.removeTask(this.aiArrowAttack); - } - - super.tasks.addTask(2, this.aiAttackOnCollide); - this.task = EntityReflection.Task.MELEE; - } else { - if(this.task == EntityReflection.Task.MELEE) { - super.tasks.removeTask(this.aiAttackOnCollide); - } - - super.tasks.addTask(2, this.aiArrowAttack); - this.task = EntityReflection.Task.RANGED; - } - } else { - if(this.task == EntityReflection.Task.RANGED) { - super.tasks.removeTask(this.aiArrowAttack); - } - - super.tasks.addTask(2, this.aiAttackOnCollide); - this.task = EntityReflection.Task.MELEE; - } - - if(this.isEntityAlive() && this.getAttackTarget() != null && this.getNavigator().noPath() && this.getEntitySenses().canSee(this.getAttackTarget())) { - EntityLivingBase var10001 = this.getAttackTarget(); - EffectRegistry.instance(); - this.castSpell(var10001, 1.0F, EffectRegistry.Attraho); - } - } - - if(!super.worldObj.isRemote && super.worldObj.rand.nextDouble() < 0.05D && this.getAttackTarget() != null && (this.getAttackTarget().isAirBorne || this.getAttackTarget() instanceof EntityPlayer && ((EntityPlayer)this.getAttackTarget()).capabilities.isFlying) && !this.getAttackTarget().isPotionActive(Potion.moveSlowdown)) { - this.getAttackTarget().addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 5)); - } - - } - - public void onDeath(DamageSource p_70645_1_) { - super.onDeath(p_70645_1_); - Witchery.Blocks.MIRROR.demonSlain(super.worldObj, super.posX, super.posY, super.posZ); - } - - public boolean attackEntityFrom(DamageSource source, float damage) { - return super.attackEntityFrom(source, Math.min(damage, 6.0F)); - } - - public float getCapDT(DamageSource source, float damage) { - return 2.0F; - } - - public boolean canAttackClass(Class par1Class) { - return super.canAttackClass(par1Class); - } - - public void writeEntityToNBT(NBTTagCompound nbtRoot) { - super.writeEntityToNBT(nbtRoot); - nbtRoot.setString("Owner", this.getOwnerName()); - nbtRoot.setString("OwnerSkin", this.getOwnerSkin()); - nbtRoot.setInteger("Model", this.getModel()); - nbtRoot.setBoolean("FreeSpawn", this.freeSpawn); - nbtRoot.setBoolean("Vampire", this.isVampire); - nbtRoot.setInteger("LivingTicks", this.livingTicks); - } - - public void readEntityFromNBT(NBTTagCompound nbtRoot) { - super.readEntityFromNBT(nbtRoot); - this.setOwner(nbtRoot.getString("Owner")); - this.setOwnerSkin(nbtRoot.getString("OwnerSkin")); - this.freeSpawn = nbtRoot.getBoolean("FreeSpawn"); - this.livingTicks = nbtRoot.getInteger("LivingTicks"); - this.isVampire = nbtRoot.getBoolean("Vampire"); - this.setModel(nbtRoot.getInteger("Model")); - } - - public boolean attackEntityAsMob(Entity par1Entity) { - this.attackTimer = 10; - boolean flag = super.attackEntityAsMob(par1Entity); - return flag; - } - - @SideOnly(Side.CLIENT) - public void handleHealthUpdate(byte par1) { - if(par1 == 4) { - this.attackTimer = 10; - } else { - super.handleHealthUpdate(par1); - } - - } - - @SideOnly(Side.CLIENT) - public int getAttackTimer() { - return this.attackTimer; - } - - public float getBrightness(float par1) { - return 1.0F; - } - - protected String getLivingSound() { - return "witchery:mob.reflection.say"; - } - - protected String getHurtSound() { - return "witchery:mob.reflection.hit"; - } - - protected String getDeathSound() { - return "witchery:mob.reflection.death"; - } - - protected void func_145780_a(int par1, int par2, int par3, Block par4) { - super.func_145780_a(par1, par2, par3, par4); - } - - protected void dropFewItems(boolean par1, int par2) { - this.entityDropItem(Witchery.Items.GENERIC.itemDemonHeart.createStack(), 0.0F); - } - - protected void dropEquipment(boolean p_82160_1_, int p_82160_2_) {} - - protected Item getDropItem() { - return null; - } - - protected boolean canDespawn() { - return false; - } - - private static RandomCollection createSpells() { - RandomCollection spells = new RandomCollection(); - EffectRegistry.instance(); - spells.add(14.0D, EffectRegistry.Ignianima); - EffectRegistry.instance(); - spells.add(2.0D, EffectRegistry.Expelliarmus); - EffectRegistry.instance(); - spells.add(2.0D, EffectRegistry.Flipendo); - EffectRegistry.instance(); - spells.add(2.0D, EffectRegistry.Impedimenta); - EffectRegistry.instance(); - spells.add(1.0D, EffectRegistry.Confundus); - return spells; - } - - public void attackEntityWithRangedAttack(EntityLivingBase targetEntity, float par2) { - ItemStack held = this.getHeldItem(); - if(held != null) { - this.attackTimer = 10; - super.worldObj.setEntityState(this, (byte)4); - if(held.getItem() == Witchery.Items.MYSTIC_BRANCH) { - if(super.worldObj.rand.nextBoolean()) { - this.castSpell(targetEntity, par2, (SymbolEffect)SPELLS.next()); - } - } else { - int i; - int j; - if(held.getItem() == Witchery.Items.CROSSBOW_PISTOL) { - EntityBolt entityarrow = new EntityBolt(super.worldObj, this, targetEntity, 1.6F, (float)(14 - super.worldObj.difficultySetting.getDifficultyId() * 4)); - i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); - j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); - entityarrow.setDamage((double)(par2 * 2.0F) + super.rand.nextGaussian() * 0.25D + (double)((float)super.worldObj.difficultySetting.getDifficultyId() * 0.11F)); - if(i > 0) { - entityarrow.setDamage(entityarrow.getDamage() + (double)i * 0.5D + 0.5D); - } - - if(j > 0) { - entityarrow.setKnockbackStrength(j); - } - - if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || CreatureUtil.isVampire(this.getAttackTarget()) && super.worldObj.rand.nextInt(3) == 0) { - entityarrow.setFire(100); - } - - if(this.getAttackTarget() != null) { - if(CreatureUtil.isWerewolf(this.getAttackTarget())) { - entityarrow.setBoltType(4); - } else if(CreatureUtil.isUndead(this.getAttackTarget())) { - entityarrow.setBoltType(3); - } else if(super.worldObj.rand.nextInt(4) == 0) { - entityarrow.setBoltType(2); - } - } - - this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - super.worldObj.spawnEntityInWorld(entityarrow); - } else { - EntityArrow entityarrow1 = new EntityArrow(super.worldObj, this, targetEntity, 1.6F, (float)(14 - super.worldObj.difficultySetting.getDifficultyId() * 3)); - i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); - j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); - entityarrow1.setDamage((double)(par2 * 2.0F) + super.rand.nextGaussian() * 0.25D + (double)((float)super.worldObj.difficultySetting.getDifficultyId() * 0.11F)); - if(i > 0) { - entityarrow1.setDamage(entityarrow1.getDamage() + (double)i * 0.5D + 0.5D); - } - - if(j > 0) { - entityarrow1.setKnockbackStrength(j); - } - - if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) { - entityarrow1.setFire(100); - } - - this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - super.worldObj.spawnEntityInWorld(entityarrow1); - } - } - - } - } - - private void castSpell(EntityLivingBase targetEntity, float par2, SymbolEffect spell) { - double d0 = targetEntity.posX - super.posX; - double d1 = targetEntity.boundingBox.minY + (double)(targetEntity.height / 2.0F) - (super.posY + (double)(super.height / 2.0F)); - double d2 = targetEntity.posZ - super.posZ; - float f1 = MathHelper.sqrt_float(par2) * 0.5F; - if(!super.worldObj.isRemote) { - super.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)super.posX, (int)super.posY, (int)super.posZ, 0); - boolean count = super.rand.nextInt(10) == 0?true:true; - EntitySpellEffect effect = new EntitySpellEffect(super.worldObj, this, d0 + super.rand.nextGaussian() * (double)f1, d1, d2 + super.rand.nextGaussian() * (double)f1, spell, 1); - double d8 = 1.0D; - effect.posX = super.posX; - effect.posY = super.posY + (double)(super.height / 2.0F); - effect.posZ = super.posZ; - super.worldObj.spawnEntityInWorld(effect); - effect.setShooter(this); - } - - } - - @SideOnly(Side.CLIENT) - public ResourceLocation getLocationSkin() { - if(this.locationSkin == null || !this.lastSkinOwner.equals(this.getOwnerName())) { - this.setupCustomSkin(); - } - - return this.locationSkin != null?this.locationSkin:null; - } - - @SideOnly(Side.CLIENT) - private void setupCustomSkin() { - String ownerName = this.getOwnerSkin(); - if(ownerName != null && !ownerName.isEmpty()) { - this.locationSkin = AbstractClientPlayer.getLocationSkin(ownerName); - this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, ownerName); - this.lastSkinOwner = ownerName; - } else { - this.locationSkin = null; - this.downloadImageSkin = null; - this.lastSkinOwner = ""; - } - - } - - @SideOnly(Side.CLIENT) - public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation location, String name) { - TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); - Object object = texturemanager.getTexture(location); - if(object == null) { - object = new ThreadDownloadImageData((File)null, String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[]{StringUtils.stripControlCodes(name)}), RenderReflection.SKIN, new ImageBufferDownload()); - texturemanager.loadTexture(location, (ITextureObject)object); - } - - return (ThreadDownloadImageData)object; - } - - public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { - this.freeSpawn = true; - return super.onSpawnWithEgg(data); - } - - public boolean isVampire() { - return this.isVampire; - } - - - private static enum Task { - - NONE("NONE", 0), - MELEE("MELEE", 1), - RANGED("RANGED", 2); - // $FF: synthetic field - private static final EntityReflection.Task[] $VALUES = new EntityReflection.Task[]{NONE, MELEE, RANGED}; - - - private Task(String var1, int var2) {} - - } -} +package com.emoniph.witchery.entity; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.client.renderer.RenderReflection; +import com.emoniph.witchery.common.ExtendedPlayer; +import com.emoniph.witchery.entity.EntityBolt; +import com.emoniph.witchery.entity.EntitySpellEffect; +import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.CreatureUtil; +import com.emoniph.witchery.util.IHandleDT; +import com.emoniph.witchery.util.RandomCollection; +import com.emoniph.witchery.util.TransformCreature; +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; + +public class EntityReflection extends EntityMob implements IBossDisplayData, IRangedAttackMob, IHandleDT { + + private int attackTimer; + private boolean freeSpawn; + private boolean isVampire; + private int livingTicks = -1; + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityLivingBase.class, 1.2D, false); + private String owner = ""; + private EntityReflection.Task task; + private static final RandomCollection SPELLS = createSpells(); + @SideOnly(Side.CLIENT) + private ThreadDownloadImageData downloadImageSkin; + @SideOnly(Side.CLIENT) + private ResourceLocation locationSkin; + private String lastSkinOwner; + + + public EntityReflection(World world) { + super(world); + this.task = EntityReflection.Task.NONE; + this.setSize(0.6F, 1.8F); + super.isImmuneToFire = true; + this.getNavigator().setAvoidsWater(true); + this.getNavigator().setCanSwim(true); + super.tasks.addTask(1, new EntityAISwimming(this)); + super.tasks.addTask(3, new EntityAIWander(this, 1.0D)); + super.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + super.tasks.addTask(5, new EntityAILookIdle(this)); + super.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + super.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + super.experienceValue = 50; + } + + protected void entityInit() { + super.entityInit(); + super.dataWatcher.addObject(17, ""); + super.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + public String getOwnerSkin() { + return super.dataWatcher.getWatchableObjectString(17); + } + + public String getOwnerName() { + return this.owner; + } + + public void setOwnerSkin(String skinName) { + super.dataWatcher.updateObject(17, skinName); + } + + public void setOwner(String par1Str) { + this.func_110163_bv(); + this.owner = par1Str; + } + + public EntityPlayer getOwnerEntity() { + return super.worldObj.getPlayerEntityByName(this.getOwnerName()); + } + + public void setModel(int model) { + super.dataWatcher.updateObject(18, Byte.valueOf((byte)model)); + } + + public int getModel() { + return super.dataWatcher.getWatchableObjectByte(18); + } + + public void setLifetime(int ticks) { + this.livingTicks = ticks; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(50.0D); + this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); + } + + public void setInWeb() {} + + public String getCommandSenderName() { + if(this.hasCustomNameTag()) { + return this.getCustomNameTag(); + } else { + String owner = this.getOwnerName(); + return owner != null && !owner.isEmpty()?owner:StatCollector.translateToLocal("entity.witchery.reflection.name"); + } + } + + public boolean isAIEnabled() { + return true; + } + + protected void updateAITick() { + super.updateAITick(); + } + + protected int decreaseAirSupply(int par1) { + return par1; + } + + protected void collideWithEntity(Entity par1Entity) { + super.collideWithEntity(par1Entity); + } + + public void onLivingUpdate() { + super.onLivingUpdate(); + if(this.attackTimer > 0) { + --this.attackTimer; + } + + if(!super.worldObj.isRemote && super.ticksExisted % 30 == 1) { + if(!this.freeSpawn && super.dimension != Config.instance().dimensionMirrorID) { + this.setDead(); + return; + } + + if(this.livingTicks > -1 && --this.livingTicks == 0) { + this.setDead(); + return; + } + + double R = 10.0D; + double RY = 8.0D; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(super.posX - R, super.posY - RY, super.posZ - R, super.posX + R, super.posY + RY, super.posZ + R); + List players = super.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bounds); + EntityPlayer ownerEntity = this.getOwnerEntity(); + boolean ownerFound = false; + EntityPlayer closest = null; + double distance = Double.MAX_VALUE; + Iterator resetGear = players.iterator(); + + while(resetGear.hasNext()) { + EntityPlayer skinName = (EntityPlayer)resetGear.next(); + double held = skinName.getDistanceSqToEntity(this); + if(closest == null || held < distance) { + closest = skinName; + distance = held; + } + + if(ownerEntity == skinName) { + ownerFound = true; + } + } + + if(ownerEntity == null || !ownerFound) { + if(closest != null) { + this.setOwner(closest.getCommandSenderName()); + } else { + this.setOwner(""); + } + } + + boolean var25 = true; + String var26 = this.getOwnerName(); + if(!this.getOwnerName().isEmpty()) { + EntityPlayer var28 = ownerEntity != null && ownerFound?ownerEntity:this.getOwnerEntity(); + if(var28 != null) { + for(int bestWeapon = 1; bestWeapon <= 4; ++bestWeapon) { + ItemStack bestDamage = var28.getEquipmentInSlot(bestWeapon); + if(bestDamage != null) { + bestDamage = bestDamage.copy(); + } + + this.setCurrentItemOrArmor(bestWeapon, bestDamage); + } + + ItemStack var30 = null; + double var31 = 0.0D; + + ItemStack stack; + for(int playerEx = 0; playerEx < 9; ++playerEx) { + stack = var28.inventory.getStackInSlot(playerEx); + if(stack != null) { + Multimap effects = stack.getAttributeModifiers(); + Iterator effect = effects.get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).iterator(); + double damage = 0.0D; + + while(effect.hasNext()) { + AttributeModifier modifier = (AttributeModifier)effect.next(); + if(modifier.getOperation() == 0) { + damage += modifier.getAmount(); + } + } + + if(damage > var31) { + var30 = stack; + var31 = damage; + } + } + } + + ExtendedPlayer var32 = ExtendedPlayer.get(var28); + if(var32 != null) { + this.setModel(var32.getCreatureType() == TransformCreature.WOLFMAN?1:0); + this.isVampire = var32.isVampire(); + if(var32.getCreatureType() == TransformCreature.PLAYER) { + var26 = var32.getOtherPlayerSkin(); + } + } + + stack = var30 != null?var30:var28.getEquipmentInSlot(0); + if(stack != null) { + stack = stack.copy(); + Witchery.modHooks.makeItemModProof(stack); + } + + if(this.getModel() == 1) { + stack = null; + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + } else { + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); + } + + this.setCurrentItemOrArmor(0, stack); + var25 = false; + if(super.ticksExisted % 60 == 1) { + this.clearActivePotions(); + Iterator var33 = var28.getActivePotionEffects().iterator(); + + while(var33.hasNext()) { + PotionEffect var34 = (PotionEffect)var33.next(); + this.addPotionEffect(new PotionEffect(var34)); + } + } + } + } + + if(var25) { + for(int var29 = 0; var29 <= 4; ++var29) { + this.setCurrentItemOrArmor(var29, (ItemStack)null); + } + } + + this.setOwnerSkin(var26); + ItemStack var27 = this.getHeldItem(); + if(var27 != null) { + if(var27.getItem() == Witchery.Items.MYSTIC_BRANCH) { + if(this.task == EntityReflection.Task.MELEE) { + super.tasks.removeTask(this.aiAttackOnCollide); + } + + super.tasks.addTask(2, this.aiArrowAttack); + this.task = EntityReflection.Task.RANGED; + } else if(var27.getItem() != Witchery.Items.CROSSBOW_PISTOL && !(var27.getItem() instanceof ItemBow)) { + if(this.task == EntityReflection.Task.RANGED) { + super.tasks.removeTask(this.aiArrowAttack); + } + + super.tasks.addTask(2, this.aiAttackOnCollide); + this.task = EntityReflection.Task.MELEE; + } else { + if(this.task == EntityReflection.Task.MELEE) { + super.tasks.removeTask(this.aiAttackOnCollide); + } + + super.tasks.addTask(2, this.aiArrowAttack); + this.task = EntityReflection.Task.RANGED; + } + } else { + if(this.task == EntityReflection.Task.RANGED) { + super.tasks.removeTask(this.aiArrowAttack); + } + + super.tasks.addTask(2, this.aiAttackOnCollide); + this.task = EntityReflection.Task.MELEE; + } + + if(this.isEntityAlive() && this.getAttackTarget() != null && this.getNavigator().noPath() && this.getEntitySenses().canSee(this.getAttackTarget())) { + EntityLivingBase var10001 = this.getAttackTarget(); + EffectRegistry.instance(); + //this.castSpell(var10001, 1.0F, EffectRegistry.Attraho); + } + } + + if(!super.worldObj.isRemote && super.worldObj.rand.nextDouble() < 0.05D && this.getAttackTarget() != null && (this.getAttackTarget().isAirBorne || this.getAttackTarget() instanceof EntityPlayer && ((EntityPlayer)this.getAttackTarget()).capabilities.isFlying) && !this.getAttackTarget().isPotionActive(Potion.moveSlowdown)) { + this.getAttackTarget().addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 5)); + } + + } + + public void onDeath(DamageSource p_70645_1_) { + super.onDeath(p_70645_1_); + Witchery.Blocks.MIRROR.demonSlain(super.worldObj, super.posX, super.posY, super.posZ); + } + + public boolean attackEntityFrom(DamageSource source, float damage) { + return super.attackEntityFrom(source, Math.min(damage, 6.0F)); + } + + public float getCapDT(DamageSource source, float damage) { + return 2.0F; + } + + public boolean canAttackClass(Class par1Class) { + return super.canAttackClass(par1Class); + } + + public void writeEntityToNBT(NBTTagCompound nbtRoot) { + super.writeEntityToNBT(nbtRoot); + nbtRoot.setString("Owner", this.getOwnerName()); + nbtRoot.setString("OwnerSkin", this.getOwnerSkin()); + nbtRoot.setInteger("Model", this.getModel()); + nbtRoot.setBoolean("FreeSpawn", this.freeSpawn); + nbtRoot.setBoolean("Vampire", this.isVampire); + nbtRoot.setInteger("LivingTicks", this.livingTicks); + } + + public void readEntityFromNBT(NBTTagCompound nbtRoot) { + super.readEntityFromNBT(nbtRoot); + this.setOwner(nbtRoot.getString("Owner")); + this.setOwnerSkin(nbtRoot.getString("OwnerSkin")); + this.freeSpawn = nbtRoot.getBoolean("FreeSpawn"); + this.livingTicks = nbtRoot.getInteger("LivingTicks"); + this.isVampire = nbtRoot.getBoolean("Vampire"); + this.setModel(nbtRoot.getInteger("Model")); + } + + public boolean attackEntityAsMob(Entity par1Entity) { + this.attackTimer = 10; + boolean flag = super.attackEntityAsMob(par1Entity); + return flag; + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte par1) { + if(par1 == 4) { + this.attackTimer = 10; + } else { + super.handleHealthUpdate(par1); + } + + } + + @SideOnly(Side.CLIENT) + public int getAttackTimer() { + return this.attackTimer; + } + + public float getBrightness(float par1) { + return 1.0F; + } + + protected String getLivingSound() { + return "witchery:mob.reflection.say"; + } + + protected String getHurtSound() { + return "witchery:mob.reflection.hit"; + } + + protected String getDeathSound() { + return "witchery:mob.reflection.death"; + } + + protected void func_145780_a(int par1, int par2, int par3, Block par4) { + super.func_145780_a(par1, par2, par3, par4); + } + + protected void dropFewItems(boolean par1, int par2) { + this.entityDropItem(Witchery.Items.GENERIC.itemDemonHeart.createStack(), 0.0F); + } + + protected void dropEquipment(boolean p_82160_1_, int p_82160_2_) {} + + protected Item getDropItem() { + return null; + } + + protected boolean canDespawn() { + return false; + } + + private static RandomCollection createSpells() { + RandomCollection spells = new RandomCollection(); + EffectRegistry.instance(); + spells.add(14.0D, EffectRegistry.Ignianima); + EffectRegistry.instance(); + spells.add(2.0D, EffectRegistry.Expelliarmus); + EffectRegistry.instance(); + spells.add(2.0D, EffectRegistry.Flipendo); + EffectRegistry.instance(); + spells.add(2.0D, EffectRegistry.Impedimenta); + EffectRegistry.instance(); + spells.add(1.0D, EffectRegistry.Confundus); + return spells; + } + + public void attackEntityWithRangedAttack(EntityLivingBase targetEntity, float par2) { + ItemStack held = this.getHeldItem(); + if(held != null) { + this.attackTimer = 10; + super.worldObj.setEntityState(this, (byte)4); + if(held.getItem() == Witchery.Items.MYSTIC_BRANCH) { + if(super.worldObj.rand.nextBoolean()) { + this.castSpell(targetEntity, par2, (SymbolEffect)SPELLS.next()); + } + } else { + int i; + int j; + if(held.getItem() == Witchery.Items.CROSSBOW_PISTOL) { + EntityBolt entityarrow = new EntityBolt(super.worldObj, this, targetEntity, 1.6F, (float)(14 - super.worldObj.difficultySetting.getDifficultyId() * 4)); + i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); + entityarrow.setDamage((double)(par2 * 2.0F) + super.rand.nextGaussian() * 0.25D + (double)((float)super.worldObj.difficultySetting.getDifficultyId() * 0.11F)); + if(i > 0) { + entityarrow.setDamage(entityarrow.getDamage() + (double)i * 0.5D + 0.5D); + } + + if(j > 0) { + entityarrow.setKnockbackStrength(j); + } + + if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || CreatureUtil.isVampire(this.getAttackTarget()) && super.worldObj.rand.nextInt(3) == 0) { + entityarrow.setFire(100); + } + + if(this.getAttackTarget() != null) { + if(CreatureUtil.isWerewolf(this.getAttackTarget())) { + entityarrow.setBoltType(4); + } else if(CreatureUtil.isUndead(this.getAttackTarget())) { + entityarrow.setBoltType(3); + } else if(super.worldObj.rand.nextInt(4) == 0) { + entityarrow.setBoltType(2); + } + } + + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + super.worldObj.spawnEntityInWorld(entityarrow); + } else { + EntityArrow entityarrow1 = new EntityArrow(super.worldObj, this, targetEntity, 1.6F, (float)(14 - super.worldObj.difficultySetting.getDifficultyId() * 3)); + i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); + entityarrow1.setDamage((double)(par2 * 2.0F) + super.rand.nextGaussian() * 0.25D + (double)((float)super.worldObj.difficultySetting.getDifficultyId() * 0.11F)); + if(i > 0) { + entityarrow1.setDamage(entityarrow1.getDamage() + (double)i * 0.5D + 0.5D); + } + + if(j > 0) { + entityarrow1.setKnockbackStrength(j); + } + + if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) { + entityarrow1.setFire(100); + } + + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + super.worldObj.spawnEntityInWorld(entityarrow1); + } + } + + } + } + + private void castSpell(EntityLivingBase targetEntity, float par2, SymbolEffect spell) { + double d0 = targetEntity.posX - super.posX; + double d1 = targetEntity.boundingBox.minY + (double)(targetEntity.height / 2.0F) - (super.posY + (double)(super.height / 2.0F)); + double d2 = targetEntity.posZ - super.posZ; + float f1 = MathHelper.sqrt_float(par2) * 0.5F; + if(!super.worldObj.isRemote) { + super.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)super.posX, (int)super.posY, (int)super.posZ, 0); + boolean count = super.rand.nextInt(10) == 0?true:true; + EntitySpellEffect effect = new EntitySpellEffect(super.worldObj, this, d0 + super.rand.nextGaussian() * (double)f1, d1, d2 + super.rand.nextGaussian() * (double)f1, spell, 1); + double d8 = 1.0D; + effect.posX = super.posX; + effect.posY = super.posY + (double)(super.height / 2.0F); + effect.posZ = super.posZ; + super.worldObj.spawnEntityInWorld(effect); + effect.setShooter(this); + } + + } + + @SideOnly(Side.CLIENT) + public ResourceLocation getLocationSkin() { + if(this.locationSkin == null || !this.lastSkinOwner.equals(this.getOwnerName())) { + this.setupCustomSkin(); + } + + return this.locationSkin != null?this.locationSkin:null; + } + + @SideOnly(Side.CLIENT) + private void setupCustomSkin() { + String ownerName = this.getOwnerSkin(); + if(ownerName != null && !ownerName.isEmpty()) { + this.locationSkin = AbstractClientPlayer.getLocationSkin(ownerName); + this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, ownerName); + this.lastSkinOwner = ownerName; + } else { + this.locationSkin = null; + this.downloadImageSkin = null; + this.lastSkinOwner = ""; + } + + } + + @SideOnly(Side.CLIENT) + public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation location, String name) { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + Object object = texturemanager.getTexture(location); + if(object == null) { + object = new ThreadDownloadImageData((File)null, String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[]{StringUtils.stripControlCodes(name)}), RenderReflection.SKIN, new ImageBufferDownload()); + texturemanager.loadTexture(location, (ITextureObject)object); + } + + return (ThreadDownloadImageData)object; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + this.freeSpawn = true; + return super.onSpawnWithEgg(data); + } + + public boolean isVampire() { + return this.isVampire; + } + + + private static enum Task { + + NONE("NONE", 0), + MELEE("MELEE", 1), + RANGED("RANGED", 2); + // $FF: synthetic field + private static final EntityReflection.Task[] $VALUES = new EntityReflection.Task[]{NONE, MELEE, RANGED}; + + + private Task(String var1, int var2) {} + + } +} diff --git a/src/main/java/com/emoniph/witchery/entity/EntitySpectre.java b/src/main/java/com/emoniph/witchery/entity/EntitySpectre.java index ae32271..d80e67e 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntitySpectre.java +++ b/src/main/java/com/emoniph/witchery/entity/EntitySpectre.java @@ -39,6 +39,13 @@ public EntitySpectre(World par1World) { super.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); } + public boolean getCanSpawnHere() { + if (this.worldObj.provider.dimensionId != com.emoniph.witchery.util.Config.instance().dimensionDreamID) { + return false; + } + return super.getCanSpawnHere(); + } + protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); @@ -72,6 +79,9 @@ public void onUpdate() { } public boolean attackEntityAsMob(Entity par1Entity) { + if (this.dimension == com.emoniph.witchery.util.Config.instance().dimensionDreamID) { + return false; + } float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); int i = 0; if(par1Entity instanceof EntityLivingBase) { diff --git a/src/main/java/com/emoniph/witchery/entity/EntitySpellEffect.java b/src/main/java/com/emoniph/witchery/entity/EntitySpellEffect.java index 202ef1e..ee54b23 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntitySpellEffect.java +++ b/src/main/java/com/emoniph/witchery/entity/EntitySpellEffect.java @@ -6,6 +6,7 @@ import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectProjectile; import com.emoniph.witchery.util.ParticleEffect; import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.infusion.Infusion; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.List; @@ -253,26 +254,78 @@ public void onUpdate() { super.worldObj.spawnParticle(var21.isCurse()?ParticleEffect.FLAME.toString():ParticleEffect.SLIME.toString(), super.posX, super.posY + 0.5D, super.posZ, 0.0D, 0.0D, 0.0D); } + if(super.worldObj.isRemote && var21 instanceof SymbolEffectProjectile) { + this.spawnTrail((SymbolEffectProjectile)var21); + } + this.setPosition(super.posX, super.posY, super.posZ); } } } + @SideOnly(Side.CLIENT) + private void spawnTrail(SymbolEffectProjectile effect) { + int color = effect.getColor(); + float red = (float)(color >>> 16 & 255) / 255.0F; + float green = (float)(color >>> 8 & 255) / 255.0F; + float blue = (float)(color & 255) / 255.0F; + int count = effect.isCurse()?3:2; + + for(int i = 0; i < count; ++i) { + double frac = (double)i / (double)count; + double tx = super.posX - super.motionX * frac + super.rand.nextGaussian() * 0.05D; + double ty = super.posY + 0.5D - super.motionY * frac + super.rand.nextGaussian() * 0.05D; + double tz = super.posZ - super.motionZ * frac + super.rand.nextGaussian() * 0.05D; + Witchery.proxy.generateParticle(super.worldObj, tx, ty, tz, red, green, blue, 8 + super.rand.nextInt(5), 0.0F); + } + + } + protected float getMotionFactor() { return 0.95F; } + private boolean isSpellBlockable(int effectID) { + // 17 = Flipendo, 15 = Expelliarmus, 19 = Impedimenta, 1 = Accio + // 3 = Alohomora, 8 = Confundus, 12 = Ennervate, 35 = Petrificus Totalus, 36 = Stupefy, 37 = Glacius + // Nota: Avada Kedavra (4) y Crucio (9) son Maldiciones Imperdonables y NO se pueden bloquear. + return effectID == 17 || effectID == 15 || effectID == 19 || effectID == 1 || effectID == 3 || effectID == 8 || effectID == 12 || effectID == 35 || effectID == 36 || effectID == 37; + } + protected void onImpact(MovingObjectPosition mop) { if(!super.worldObj.isRemote) { SymbolEffect effect = EffectRegistry.instance().getEffect(this.getEffectID()); if(effect != null && effect instanceof SymbolEffectProjectile) { + + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityPlayer) { + EntityPlayer hitPlayer = (EntityPlayer) mop.entityHit; + if (hitPlayer.isUsingItem() && hitPlayer.getHeldItem() != null && hitPlayer.getHeldItem().getItem() == Witchery.Items.MYSTIC_BRANCH) { + if (this.isSpellBlockable(this.getEffectID())) { + NBTTagCompound nbtPerm = Infusion.getNBT(hitPlayer); + if (nbtPerm != null && nbtPerm.hasKey("witcheryInfusionID") && nbtPerm.hasKey("witcheryInfusionCharges")) { + int charges = nbtPerm.getInteger("witcheryInfusionCharges"); + int blockCost = 2; + if (charges >= blockCost) { + Infusion.setCurrentEnergy(hitPlayer, charges - blockCost); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, this, 1.0D, 1.0D, 16); + ParticleEffect.SPELL_COLORED.send(SoundEffect.NONE, this, 0.75D, 1.0D, 24, 0x00FFFF); + this.setDead(); + return; + } + } + } + } + } + + int color = ((SymbolEffectProjectile)effect).getColor(); if(effect.isCurse()) { ParticleEffect.MOB_SPELL.send(SoundEffect.MOB_ENDERDRAGON_HIT, this, 1.0D, 1.0D, 16); } else { ParticleEffect.SLIME.send(SoundEffect.MOB_SLIME_SMALL, this, 1.0D, 1.0D, 16); } + ParticleEffect.SPELL_COLORED.send(SoundEffect.NONE, this, 0.75D, 1.0D, 24, color); ((SymbolEffectProjectile)effect).onCollision(super.worldObj, this.shootingEntity, mop, this); } } diff --git a/src/main/java/com/emoniph/witchery/entity/EntitySpirit.java b/src/main/java/com/emoniph/witchery/entity/EntitySpirit.java index 53928de..86b45f3 100644 --- a/src/main/java/com/emoniph/witchery/entity/EntitySpirit.java +++ b/src/main/java/com/emoniph/witchery/entity/EntitySpirit.java @@ -272,7 +272,8 @@ public boolean getCanSpawnHere() { int k = MathHelper.floor_double(super.posZ); superGetCanSpawnHere = superGetCanSpawnHere && this.getBlockPathWeight(i, j, k) >= 0.0F && j >= 60; Block blockID = super.worldObj.getBlock(i, j - 1, k); - return superGetCanSpawnHere && super.worldObj.rand.nextInt(10) == 0 && (blockID == Blocks.grass || blockID == Blocks.sand) && super.worldObj.getFullBlockLightValue(i, j, k) > 8; + int spawnChance = super.worldObj.provider.dimensionId == Config.instance().dimensionDreamID ? 2 : 10; + return superGetCanSpawnHere && super.worldObj.rand.nextInt(spawnChance) == 0 && (blockID == Blocks.grass || blockID == Blocks.sand) && super.worldObj.getFullBlockLightValue(i, j, k) > 8; } } diff --git a/src/main/java/com/emoniph/witchery/familiar/Familiar.java b/src/main/java/com/emoniph/witchery/familiar/Familiar.java index 312ca01..89d36c9 100644 --- a/src/main/java/com/emoniph/witchery/familiar/Familiar.java +++ b/src/main/java/com/emoniph/witchery/familiar/Familiar.java @@ -75,11 +75,11 @@ public static void bindToPlayer(EntityPlayer player, EntityTameable familiarEnti nbtFamiliar1.setInteger("FamiliarType", 3); nbtFamiliar1.setByte("FamiliarColor", Byte.valueOf((byte)((EntityOwl)familiar1).getFeatherColor()).byteValue()); } else if(familiarEntity instanceof EntityToad) { - name = NAMES_TOAD[player.worldObj.rand.nextInt(NAMES_OWL.length)]; + name = NAMES_TOAD[player.worldObj.rand.nextInt(NAMES_TOAD.length)]; nbtFamiliar1.setInteger("FamiliarType", 2); nbtFamiliar1.setByte("FamiliarColor", Byte.valueOf((byte)((EntityToad)familiar1).getSkinColor()).byteValue()); } else if(familiarEntity instanceof EntityOcelot) { - name = NAMES_CAT[player.worldObj.rand.nextInt(NAMES_OWL.length)]; + name = NAMES_CAT[player.worldObj.rand.nextInt(NAMES_CAT.length)]; nbtFamiliar1.setInteger("FamiliarType", 1); nbtFamiliar1.setByte("FamiliarColor", Byte.valueOf((byte)0).byteValue()); } diff --git a/src/main/java/com/emoniph/witchery/infusion/Infusion.java b/src/main/java/com/emoniph/witchery/infusion/Infusion.java index ec7ea10..a7cb57f 100644 --- a/src/main/java/com/emoniph/witchery/infusion/Infusion.java +++ b/src/main/java/com/emoniph/witchery/infusion/Infusion.java @@ -1,1070 +1,1092 @@ -package com.emoniph.witchery.infusion; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.common.ExtendedPlayer; -import com.emoniph.witchery.dimension.WorldProviderDreamWorld; -import com.emoniph.witchery.dimension.WorldProviderTorment; -import com.emoniph.witchery.entity.EntityCovenWitch; -import com.emoniph.witchery.entity.EntityDemon; -import com.emoniph.witchery.entity.EntityIllusion; -import com.emoniph.witchery.entity.EntityIllusionCreeper; -import com.emoniph.witchery.entity.EntityIllusionSpider; -import com.emoniph.witchery.entity.EntityIllusionZombie; -import com.emoniph.witchery.entity.EntityNightmare; -import com.emoniph.witchery.entity.EntityVillageGuard; -import com.emoniph.witchery.entity.EntityWitchHunter; -import com.emoniph.witchery.entity.ai.EntityAIDigBlocks; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.infusion.InfusedBrewEffect; -import com.emoniph.witchery.infusion.PlayerEffects; -import com.emoniph.witchery.infusion.infusions.creature.CreaturePower; -import com.emoniph.witchery.item.ItemGeneral; -import com.emoniph.witchery.item.ItemHunterClothes; -import com.emoniph.witchery.network.PacketPlayerStyle; -import com.emoniph.witchery.network.PacketPlayerSync; -import com.emoniph.witchery.predictions.PredictionManager; -import com.emoniph.witchery.ritual.rites.RiteProtectionCircleRepulsive; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.Dye; -import com.emoniph.witchery.util.Log; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import com.emoniph.witchery.util.TimeUtil; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.boss.IBossDisplayData; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.entity.monster.EntityGolem; -import net.minecraft.entity.monster.EntityWitch; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemDye; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.ServerChatEvent; -import net.minecraftforge.event.entity.living.EnderTeleportEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.player.FillBucketEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; - -public class Infusion { - - public static final Infusion DEFUSED = new Infusion(0); - public static final String INFUSION_CHARGES_KEY = "witcheryInfusionCharges"; - public static final String INFUSION_ID_KEY = "witcheryInfusionID"; - public static final String INFUSION_MAX_CHARGES_KEY = "witcheryInfusionChargesMax"; - public static final String INFUSION_NEXTSYNC = "WITCResyncLook"; - public static final String INFUSION_GROTESQUE = "witcheryGrotesque"; - public static final String INFUSION_DEPTHS = "witcheryDepths"; - public static final String INFUSION_CURSED = "witcheryCursed"; - public static final String INFUSION_INSANITY = "witcheryInsanity"; - public static final String INFUSION_SINKING = "witcherySinking"; - public static final String INFUSION_OVERHEAT = "witcheryOverheating"; - public static final String INFUSION_NIGHTMARE = "witcheryWakingNightmare"; - public final int infusionID; - protected static final int DEFAULT_CHARGE_COST = 1; - - - public static EntityItem dropEntityItemWithRandomChoice(EntityLivingBase entity, ItemStack par1ItemStack, boolean par2) { - if(par1ItemStack != null && entity != null) { - if(par1ItemStack.stackSize == 0) { - return null; - } else { - EntityItem entityitem = new EntityItem(entity.worldObj, entity.posX, entity.posY - 0.30000001192092896D + (double)entity.getEyeHeight(), entity.posZ, par1ItemStack); - entityitem.delayBeforeCanPickup = 40; - float f = 0.1F; - float f1; - if(par2) { - f1 = entity.worldObj.rand.nextFloat() * 0.5F; - float f2 = entity.worldObj.rand.nextFloat() * 3.1415927F * 2.0F; - entityitem.motionX = (double)(-MathHelper.sin(f2) * f1); - entityitem.motionZ = (double)(MathHelper.cos(f2) * f1); - entityitem.motionY = 0.20000000298023224D; - } else { - f = 0.3F; - entityitem.motionX = (double)(-MathHelper.sin(entity.rotationYaw / 180.0F * 3.1415927F) * MathHelper.cos(entity.rotationPitch / 180.0F * 3.1415927F) * f); - entityitem.motionZ = (double)(MathHelper.cos(entity.rotationYaw / 180.0F * 3.1415927F) * MathHelper.cos(entity.rotationPitch / 180.0F * 3.1415927F) * f); - entityitem.motionY = (double)(-MathHelper.sin(entity.rotationPitch / 180.0F * 3.1415927F) * f + 0.1F); - f = 0.02F; - f1 = entity.worldObj.rand.nextFloat() * 3.1415927F * 2.0F; - f *= entity.worldObj.rand.nextFloat(); - entityitem.motionX += Math.cos((double)f1) * (double)f; - entityitem.motionY += (double)((entity.worldObj.rand.nextFloat() - entity.worldObj.rand.nextFloat()) * 0.1F); - entityitem.motionZ += Math.sin((double)f1) * (double)f; - } - - entity.worldObj.spawnEntityInWorld(entityitem); - return entityitem; - } - } else { - return null; - } - } - - public static EntityCreature spawnCreature(World world, Class creatureType, EntityLivingBase victim, int minRange, int maxRange, ParticleEffect effect, SoundEffect effectSound) { - int x = MathHelper.floor_double(victim.posX); - int y = MathHelper.floor_double(victim.posY); - int z = MathHelper.floor_double(victim.posZ); - return spawnCreature(world, creatureType, x, y, z, victim, minRange, maxRange, effect, effectSound); - } - - public static EntityCreature spawnCreature(World world, Class creatureType, int x, int y, int z, EntityPlayer victim, int minRange, int maxRange) { - return spawnCreature(world, creatureType, x, y, z, victim, minRange, maxRange, (ParticleEffect)null, SoundEffect.NONE); - } - - public static EntityCreature spawnCreature(World world, Class creatureType, int x, int y, int z, EntityLivingBase victim, int minRange, int maxRange, ParticleEffect effect, SoundEffect effectSound) { - if(!world.isRemote) { - int activeRadius = maxRange - minRange; - int ax = world.rand.nextInt(activeRadius * 2 + 1); - if(ax > activeRadius) { - ax += minRange * 2; - } - - int nx = x - maxRange + ax; - int az = world.rand.nextInt(activeRadius * 2 + 1); - if(az > activeRadius) { - az += minRange * 2; - } - - int nz = z - maxRange + az; - - int ny; - for(ny = y; !world.isAirBlock(nx, ny, nz) && ny < y + 8; ++ny) { - ; - } - - while(world.isAirBlock(nx, ny, nz) && ny > 0) { - --ny; - } - - int hy; - for(hy = 0; world.isAirBlock(nx, ny + hy + 1, nz) && hy < 6; ++hy) { - ; - } - - Log.instance().debug("Creature: hy: " + hy + " (" + nx + "," + ny + "," + nz + ")"); - if(hy >= 2) { - try { - Constructor ex = creatureType.getConstructor(new Class[]{World.class}); - EntityCreature creature = (EntityCreature)ex.newInstance(new Object[]{world}); - if(victim instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)victim; - if(creature instanceof EntityIllusion) { - ((EntityIllusion)creature).setVictim(player.getCommandSenderName()); - } else if(creature instanceof EntityNightmare) { - ((EntityNightmare)creature).setVictim(player.getCommandSenderName()); - creature.setAttackTarget(victim); - } - } - - creature.setLocationAndAngles(0.5D + (double)nx, 0.05D + (double)ny + 1.0D, 0.5D + (double)nz, 0.0F, 0.0F); - world.spawnEntityInWorld(creature); - if(effect != null) { - effect.send(effectSound, world, 0.5D + (double)nx, 0.05D + (double)ny + 1.0D, 0.5D + (double)nz, 1.0D, (double)creature.height, 16); - } - - return creature; - } catch (NoSuchMethodException var20) { - ; - } catch (InvocationTargetException var21) { - ; - } catch (InstantiationException var22) { - ; - } catch (IllegalAccessException var23) { - ; - } - } - } - - return null; - } - - public static boolean isOnCooldown(World world, ItemStack stack) { - if(!world.isRemote) { - NBTTagCompound nbtTag = stack.getTagCompound(); - if(nbtTag != null && nbtTag.hasKey("WITCCooldown")) { - long currentTime = MinecraftServer.getSystemTimeMillis(); - if(currentTime < nbtTag.getLong("WITCCooldown")) { - return true; - } - } - } - - return false; - } - - public static void setCooldown(World world, ItemStack stack, int milliseconds) { - if(!world.isRemote) { - if(!stack.hasTagCompound()) { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound nbtTag = stack.getTagCompound(); - if(nbtTag != null) { - long currentTime = MinecraftServer.getSystemTimeMillis(); - nbtTag.setLong("WITCCooldown", currentTime + (long)milliseconds); - } - } - - } - - public Infusion(int infusionID) { - this.infusionID = infusionID; - } - - public void onHurt(World worldObj, EntityPlayer player, LivingHurtEvent event) {} - - public void onFalling(World world, EntityPlayer player, LivingFallEvent event) {} - - public IIcon getPowerBarIcon(EntityPlayer player, int index) { - return Blocks.planks.getIcon(0, 0); - } - - protected boolean consumeCharges(World world, EntityPlayer player, int cost, boolean playFailSound) { - if(player.capabilities.isCreativeMode) { - return true; - } else { - int charges = getCurrentEnergy(player); - if(charges - cost < 0) { - world.playSoundAtEntity(player, "note.snare", 0.5F, 0.4F / ((float)Math.random() * 0.4F + 0.8F)); - this.clearInfusion(player); - return false; - } else { - setCurrentEnergy(player, charges - cost); - return true; - } - } - } - - public void onUpdate(ItemStack itemstack, World world, EntityPlayer player, int par4, boolean par5) {} - - public void onLeftClickEntity(ItemStack itemstack, World world, EntityPlayer player, Entity otherEntity) { - if(!world.isRemote) { - world.playSoundAtEntity(player, "note.snare", 0.5F, 0.4F / ((float)Math.random() * 0.4F + 0.8F)); - } - - } - - public int getMaxItemUseDuration(ItemStack itemstack) { - return 400; - } - - public void onUsingItemTick(ItemStack itemstack, World world, EntityPlayer player, int countdown) {} - - public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int countdown) { - if(!world.isRemote) { - world.playSoundAtEntity(player, "note.snare", 0.5F, 0.4F / ((float)Math.random() * 0.4F + 0.8F)); - } - - } - - public void playSound(World world, EntityPlayer player, String sound) { - world.playSoundAtEntity(player, sound, 0.5F, 0.4F / ((float)world.rand.nextDouble() * 0.4F + 0.8F)); - } - - public void playFailSound(World world, EntityPlayer player) { - this.playSound(world, player, "note.snare"); - } - - public static NBTTagCompound getNBT(Entity player) { - NBTTagCompound entityData = player.getEntityData(); - if(player.worldObj.isRemote) { - return entityData; - } else { - NBTTagCompound persistedData = entityData.getCompoundTag("PlayerPersisted"); - if(!entityData.hasKey("PlayerPersisted")) { - entityData.setTag("PlayerPersisted", persistedData); - } - - return persistedData; - } - } - - public void infuse(EntityPlayer player, int charges) { - if(!player.worldObj.isRemote) { - NBTTagCompound nbt = getNBT(player); - nbt.setInteger("witcheryInfusionID", this.infusionID); - nbt.setInteger("witcheryInfusionCharges", charges); - nbt.setInteger("witcheryInfusionChargesMax", charges); - CreaturePower.setCreaturePowerID(player, 0, 0); - syncPlayer(player.worldObj, player); - } - - } - - private void clearInfusion(EntityPlayer player) { - if(!player.worldObj.isRemote) { - NBTTagCompound nbt = getNBT(player); - nbt.removeTag("witcheryInfusionCharges"); - syncPlayer(player.worldObj, player); - } - - } - - public static void setCurrentEnergy(EntityPlayer player, int currentEnergy) { - if(!player.worldObj.isRemote) { - NBTTagCompound nbt = getNBT(player); - nbt.setInteger("witcheryInfusionCharges", currentEnergy); - syncPlayer(player.worldObj, player); - } - - } - - public static void syncPlayer(World world, EntityPlayer player) { - if(!world.isRemote) { - Witchery.packetPipeline.sendTo((IMessage)(new PacketPlayerSync(player)), player); - } - - } - - public static int getInfusionID(EntityPlayer player) { - NBTTagCompound nbt = getNBT(player); - return nbt.hasKey("witcheryInfusionID")?nbt.getInteger("witcheryInfusionID"):0; - } - - public static int getCurrentEnergy(EntityPlayer player) { - NBTTagCompound nbt = getNBT(player); - return nbt.hasKey("witcheryInfusionCharges")?nbt.getInteger("witcheryInfusionCharges"):0; - } - - public static int getMaxEnergy(EntityPlayer player) { - NBTTagCompound nbt = getNBT(player); - return nbt.hasKey("witcheryInfusionChargesMax")?nbt.getInteger("witcheryInfusionChargesMax"):0; - } - - public static void setEnergy(EntityPlayer player, int infusionID, int currentEnergy, int maxEnergy) { - if(player.worldObj.isRemote) { - NBTTagCompound nbt = getNBT(player); - nbt.setInteger("witcheryInfusionID", infusionID); - nbt.setInteger("witcheryInfusionCharges", currentEnergy); - nbt.setInteger("witcheryInfusionChargesMax", maxEnergy); - } - - } - - public static void setSinkingCurseLevel(EntityPlayer playerEntity, int sinkingLevel) { - if(playerEntity.worldObj.isRemote) { - NBTTagCompound nbt = getNBT(playerEntity); - if(nbt.hasKey("witcherySinking") && sinkingLevel <= 0) { - nbt.removeTag("witcherySinking"); - } - - nbt.setInteger("witcherySinking", sinkingLevel); - } - - } - - public static int getSinkingCurseLevel(EntityPlayer player) { - NBTTagCompound nbtTag = getNBT(player); - return nbtTag.hasKey("witcherySinking")?nbtTag.getInteger("witcherySinking"):0; - } - - public static boolean aquireEnergy(World world, EntityPlayer player, int cost, boolean showMessages) { - NBTTagCompound nbtPlayer = getNBT(player); - return nbtPlayer != null?aquireEnergy(world, player, nbtPlayer, cost, showMessages):false; - } - - public static boolean aquireEnergy(World world, EntityPlayer player, NBTTagCompound nbtPlayer, int cost, boolean showMessages) { - if(nbtPlayer != null && nbtPlayer.hasKey("witcheryInfusionID") && nbtPlayer.hasKey("witcheryInfusionCharges")) { - if(!player.capabilities.isCreativeMode && nbtPlayer.getInteger("witcheryInfusionCharges") < cost) { - if(showMessages) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.nocharges", new Object[0]); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - - return false; - } else { - if(!player.capabilities.isCreativeMode) { - setCurrentEnergy(player, nbtPlayer.getInteger("witcheryInfusionCharges") - cost); - } - - return true; - } - } else { - if(showMessages) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.infusionrequired", new Object[0]); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - - return false; - } - } - - - public static class Registry { - - private static final Infusion.Registry INSTANCE = new Infusion.Registry(); - private final ArrayList registry = new ArrayList(); - - - public static Infusion.Registry instance() { - return INSTANCE; - } - - public void add(Infusion infusion) { - if(infusion.infusionID == this.registry.size() + 1) { - this.registry.add(infusion); - } else if(infusion.infusionID > this.registry.size() + 1) { - for(int existingInfusion = this.registry.size(); existingInfusion < infusion.infusionID; ++existingInfusion) { - this.registry.add((Object)null); - } - - this.registry.add(infusion); - } else { - Infusion var3 = (Infusion)this.registry.get(infusion.infusionID); - if(var3 != null) { - Log.instance().warning(String.format("Creature power %s at id %d is being overwritten by another creature power %s.", new Object[]{var3, Integer.valueOf(infusion.infusionID), infusion})); - } - - this.registry.set(infusion.infusionID, infusion); - } - - } - - public Infusion get(EntityPlayer player) { - int infusionID = Infusion.getInfusionID(player); - return infusionID > 0?(Infusion)this.registry.get(infusionID - 1):Infusion.DEFUSED; - } - - public Infusion get(int infusionID) { - return infusionID > 0?(Infusion)this.registry.get(infusionID - 1):Infusion.DEFUSED; - } - - } - - public static class EventHooks { - - private boolean isBannedSpiritObject(ItemStack stack) { - if(stack == null) { - return false; - } else { - Item item = stack.getItem(); - return item == Items.ender_pearl || item == Items.blaze_powder; - } - } - - @SubscribeEvent( - priority = EventPriority.NORMAL - ) - public void onEnderTeleport(EnderTeleportEvent event) { - if(!event.isCanceled() && event.entityLiving != null && !event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer && ItemHunterClothes.isFullSetWorn(event.entityLiving, false)) { - event.setCanceled(true); - } - - } - - @SubscribeEvent( - priority = EventPriority.NORMAL - ) - public void FillBucket(FillBucketEvent event) { - ItemStack result = this.attemptFill(event.world, event.target); - if(result != null) { - event.result = result; - event.setResult(Result.ALLOW); - } - - } - - private ItemStack attemptFill(World world, MovingObjectPosition p) { - Block id = world.getBlock(p.blockX, p.blockY, p.blockZ); - if(id == Witchery.Blocks.FLOWING_SPIRIT) { - if(world.getBlockMetadata(p.blockX, p.blockY, p.blockZ) == 0) { - world.setBlock(p.blockX, p.blockY, p.blockZ, Blocks.air); - return new ItemStack(Witchery.Items.BUCKET_FLOWINGSPIRIT); - } - } else if(id == Witchery.Blocks.HOLLOW_TEARS && world.getBlockMetadata(p.blockX, p.blockY, p.blockZ) == 0) { - world.setBlock(p.blockX, p.blockY, p.blockZ, Blocks.air); - return new ItemStack(Witchery.Items.BUCKET_HOLLOWTEARS); - } - - return null; - } - - @SubscribeEvent - public void onLivingDamage(LivingHurtEvent event) { - if(event.entityLiving != null && event.entityLiving.worldObj != null && !event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer && !event.isCanceled()) { - EntityPlayer player = (EntityPlayer)event.entityLiving; - PredictionManager.instance().checkIfFulfilled(player, event); - } - - } - - @SubscribeEvent - public void onServerChat(ServerChatEvent event) { - if(event.player != null && !event.isCanceled() && !event.player.worldObj.isRemote && event.message != null) { - Witchery.Items.RUBY_SLIPPERS.trySayTheresNoPlaceLikeHome(event.player, event.message); - } - - } - - @SubscribeEvent - public void onHarvestDrops(HarvestDropsEvent event) { - if(event.harvester != null && event.harvester.worldObj != null && !event.harvester.worldObj.isRemote) { - PredictionManager.instance().checkIfFulfilled(event.harvester, event); - PlayerEffects.onHarvestDrops(event.harvester, event); - EntityAIDigBlocks.onHarvestDrops(event.harvester, event); - } - - if(!event.world.isRemote && event.world.provider.dimensionId == Config.instance().dimensionDreamID && !event.isCanceled()) { - Iterator iterator = event.drops.iterator(); - - while(iterator.hasNext()) { - ItemStack stack = (ItemStack)iterator.next(); - if(stack != null && this.isBannedSpiritObject(stack)) { - iterator.remove(); - } - } - } - - } - - @SubscribeEvent - public void onPlayerInteract(PlayerInteractEvent event) { - if(event.entityLiving != null && event.entityLiving.worldObj != null && !event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer && !event.isCanceled()) { - EntityPlayer player = (EntityPlayer)event.entityLiving; - PredictionManager.instance().checkIfFulfilled(player, event); - PlayerEffects.onInteract(player, event); - } - - } - - @SubscribeEvent - public void onLivingUpdate(LivingUpdateEvent event) { - long counter = event.entityLiving.worldObj.getTotalWorldTime(); - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer belt = (EntityPlayer)event.entityLiving; - if(!event.entityLiving.worldObj.isRemote) { - long blockID = TimeUtil.getServerTimeInTicks(); - if(counter % 4L == 0L) { - NBTTagCompound currentChargeLevel = Infusion.getNBT(belt); - this.handleBrewGrotesqueEffect(belt, currentChargeLevel); - WorldProviderDreamWorld.updatePlayerEffects(belt.worldObj, belt, currentChargeLevel, blockID, counter); - WorldProviderTorment.updatePlayerEffects(belt.worldObj, belt, currentChargeLevel, blockID, counter); - if(counter % 20L == 0L) { - this.handleSyncEffects(belt, currentChargeLevel); - this.handleBrewDepthsEffect(belt, currentChargeLevel); - this.handleCurseEffects(belt, currentChargeLevel); - this.handleSeepingShoesEffect(belt, currentChargeLevel); - InfusedBrewEffect.checkActiveEffects(belt.worldObj, belt, currentChargeLevel, counter % 1200L == 0L, blockID); - } - - if(counter % 100L == 0L && !event.isCanceled()) { - PredictionManager.instance().checkIfFulfilled(belt, event); - if(Config.instance().allowCovenWitchVisits && currentChargeLevel.hasKey("WITCCoven") && belt.worldObj.rand.nextInt(20) == 0) { - ChunkCoordinates coords = belt.getBedLocation(belt.dimension); - if(coords != null && coords.getDistanceSquared((int)belt.posX, (int)belt.posY, (int)belt.posZ) < 256.0F) { - NBTTagList nbtCovenList = currentChargeLevel.getTagList("WITCCoven", 10); - if(nbtCovenList.tagCount() > 0) { - EntityCovenWitch.summonCovenMember(belt.worldObj, belt, 90); - } - } - } - } - } - - PlayerEffects.onUpdate(belt, blockID); - if(counter % 100L == 1L) { - EntityWitchHunter.handleWitchHunterEffects(belt, blockID); - } - } - - this.handleIcySlippersEffect(belt); - this.handleFamiliarFollowerSync(belt); - } else if(!event.entityLiving.worldObj.isRemote && counter % 20L == 0L) { - this.handleCurseEffects(event.entityLiving, event.entityLiving.getEntityData()); - } - - if(counter % 100L == 0L) { - ItemStack belt1 = event.entityLiving.getEquipmentInSlot(2); - if(belt1 != null && belt1.getItem() == Witchery.Items.BARK_BELT) { - Block blockID1 = event.entityLiving.worldObj.getBlock(MathHelper.floor_double(event.entityLiving.posX), MathHelper.floor_double(event.entityLiving.posY) - 1, MathHelper.floor_double(event.entityLiving.posZ)); - if(blockID1 == Blocks.grass || blockID1 == Blocks.mycelium) { - int maxChargeLevel = Witchery.Items.BARK_BELT.getMaxChargeLevel(event.entityLiving); - int currentChargeLevel1 = Witchery.Items.BARK_BELT.getChargeLevel(belt1); - if(currentChargeLevel1 < maxChargeLevel) { - Witchery.Items.BARK_BELT.setChargeLevel(belt1, Math.min(currentChargeLevel1 + 1, maxChargeLevel)); - event.entityLiving.worldObj.playSoundAtEntity(event.entityLiving, "witchery:random.wood_creak", 0.5F, (float)(0.8D + 2.0D * event.entityLiving.worldObj.rand.nextGaussian())); - } - } - } - } - - } - - private void handleSeepingShoesEffect(EntityPlayer player, NBTTagCompound nbtTag) { - if(player.onGround) { - if(player.isPotionActive(Potion.poison) || player.isPotionActive(Potion.wither)) { - ItemStack shoes = player.getEquipmentInSlot(1); - if(shoes != null && shoes.getItem() == Witchery.Items.SEEPING_SHOES) { - boolean poisonRemoved = false; - if(player.isPotionActive(Potion.poison)) { - player.removePotionEffect(Potion.poison.id); - poisonRemoved = true; - } - - if(player.isPotionActive(Potion.wither)) { - player.removePotionEffect(Potion.wither.id); - poisonRemoved = true; - } - - if(poisonRemoved) { - int x = MathHelper.floor_double(player.posX); - int z = MathHelper.floor_double(player.posZ); - int y = MathHelper.floor_double(player.posY); - boolean RADIUS = true; - boolean RADIUS_SQ = true; - - for(int dx = x - 3; dx <= x + 3; ++dx) { - for(int dz = z - 3; dz <= z + 3; ++dz) { - for(int dy = y - 1; dy <= y + 1; ++dy) { - if(Coord.distanceSq((double)dx, 1.0D, (double)dy, (double)x, 1.0D, (double)dy) <= 9.0D && player.worldObj.isAirBlock(dx, dy + 1, dz) && !player.worldObj.isAirBlock(dx, dy, dz)) { - ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), player.worldObj, dx, dy, dz, player); - } - } - } - } - } - - } - } - } - } - - private void handleSyncEffects(EntityPlayer player, NBTTagCompound nbtPlayer) { - if(!player.worldObj.isRemote && nbtPlayer.hasKey("WITCResyncLook")) { - long nextSync = nbtPlayer.getLong("WITCResyncLook"); - if(nextSync <= MinecraftServer.getSystemTimeMillis()) { - nbtPlayer.removeTag("WITCResyncLook"); - Witchery.packetPipeline.sendToDimension(new PacketPlayerStyle(player), player.dimension); - } - } - - } - - private void handleFamiliarFollowerSync(EntityPlayer player) { - if(!player.worldObj.isRemote) { - NBTTagCompound compound = player.getEntityData(); - NBTTagCompound pos; - if(compound.hasKey("WITC_LASTPOS")) { - pos = compound.getCompoundTag("WITC_LASTPOS"); - int lastDimension = pos.getInteger("D"); - if(lastDimension != player.dimension || Math.abs(pos.getDouble("X") - player.posX) > 32.0D || Math.abs(pos.getDouble("Z") - player.posZ) > 32.0D) { - if(lastDimension != player.dimension && player.dimension == -1 || lastDimension == -1) { - NBTTagCompound familiar = Infusion.getNBT(player); - familiar.setBoolean("WITCVisitedNether", true); - } - - if(Familiar.hasActiveFamiliar(player)) { - EntityTameable var13 = Familiar.getFamiliarEntity(player); - if(var13 != null && !var13.isSitting()) { - int ipx = MathHelper.floor_double(player.posX) - 2; - int j = MathHelper.floor_double(player.posZ) - 2; - int k = MathHelper.floor_double(player.boundingBox.minY) - 2; - boolean done = false; - - for(int l = 0; l <= 4 && !done; ++l) { - for(int i1 = 0; i1 <= 4 && !done; ++i1) { - for(int dy = 0; dy <= 4 && !done; ++dy) { - if(player.worldObj.getBlock(ipx + l, k + dy - 1, j + i1).isSideSolid(player.worldObj, ipx + l, k + dy - 1, j + i1, ForgeDirection.UP) && !player.worldObj.getBlock(ipx + l, k + dy, j + i1).isNormalCube() && !player.worldObj.getBlock(ipx + l, k + dy + 1, j + i1).isNormalCube()) { - ItemGeneral var10000 = Witchery.Items.GENERIC; - ItemGeneral.teleportToLocation(player.worldObj, 0.5D + (double)ipx + (double)l, (double)(k + dy), 0.5D + (double)j + (double)i1, player.dimension, var13, true); - done = true; - } - } - } - } - } - } - } - - pos.setDouble("X", player.posX); - pos.setDouble("Z", player.posZ); - pos.setInteger("D", player.dimension); - } else { - pos = new NBTTagCompound(); - pos.setDouble("X", player.posX); - pos.setDouble("Z", player.posZ); - pos.setInteger("D", player.dimension); - pos.setBoolean("visitedNether", player.dimension == -1); - } - } - - } - - private void handleIcySlippersEffect(EntityPlayer player) { - ItemStack shoes = player.getCurrentArmor(0); - if(shoes != null && shoes.getItem() == Witchery.Items.ICY_SLIPPERS) { - int k = MathHelper.floor_double(player.posY - 1.0D); - - for(int i = 0; i < 4; ++i) { - int j = MathHelper.floor_double(player.posX + (double)((float)(i % 2 * 2 - 1) * 0.5F)); - int l = MathHelper.floor_double(player.posZ + (double)((float)(i / 2 % 2 * 2 - 1) * 0.5F)); - Block blockID = player.worldObj.getBlock(j, k, l); - if(blockID != Blocks.flowing_water && blockID != Blocks.water) { - if(blockID == Blocks.flowing_lava || blockID == Blocks.lava) { - player.worldObj.setBlock(j, k, l, Blocks.obsidian); - if(player.worldObj.rand.nextInt(10) == 0) { - shoes.damageItem(1, player); - } - } - } else { - player.worldObj.setBlock(j, k, l, Blocks.ice); - } - } - } - - } - - private void handleBrewDepthsEffect(EntityPlayer player, NBTTagCompound nbtTag) { - if(nbtTag.hasKey("witcheryDepths")) { - int timeLeft = nbtTag.getInteger("witcheryDepths"); - if(timeLeft > 0) { - if(!player.isPotionActive(Potion.waterBreathing)) { - player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 6000)); - } - - if(!player.isInsideOfMaterial(Material.water)) { - if(!player.isPotionActive(Potion.wither)) { - player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 1)); - } - } else if(player.isPotionActive(Potion.wither)) { - player.removePotionEffect(Potion.wither.id); - } - } - - --timeLeft; - if(timeLeft <= 0) { - nbtTag.removeTag("witcheryDepths"); - if(player.isPotionActive(Potion.waterBreathing)) { - player.removePotionEffect(Potion.waterBreathing.id); - } - - if(player.isPotionActive(Potion.poison)) { - player.removePotionEffect(Potion.poison.id); - } - } else { - nbtTag.setInteger("witcheryDepths", timeLeft); - } - } - - } - - private void handleBrewGrotesqueEffect(EntityPlayer player, NBTTagCompound nbtTag) { - if(nbtTag.hasKey("witcheryGrotesque")) { - int timeLeft = nbtTag.getInteger("witcheryGrotesque"); - if(timeLeft > 0) { - float radius = 4.0F; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(player.posX - 4.0D, player.posY - 4.0D, player.posZ - 4.0D, player.posX + 4.0D, player.posY + 4.0D, player.posZ + 4.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityLiving.class, bounds); - Iterator iterator = list.iterator(); - - while(iterator.hasNext()) { - EntityLiving entity = (EntityLiving)iterator.next(); - boolean victim = !(entity instanceof EntityDemon) && !(entity instanceof IBossDisplayData) && !(entity instanceof EntityGolem) && !(entity instanceof EntityWitch); - if(victim && Coord.distance(entity.posX, entity.posY, entity.posZ, player.posX, player.posY, player.posZ) < 4.0D) { - RiteProtectionCircleRepulsive.push(player.worldObj, entity, player.posX, player.posY, player.posZ); - } - } - } - - --timeLeft; - if(timeLeft <= 0) { - nbtTag.removeTag("witcheryGrotesque"); - Witchery.packetPipeline.sendToDimension(new PacketPlayerStyle(player), player.dimension); - } else { - nbtTag.setInteger("witcheryGrotesque", timeLeft); - } - } - - } - - private void handleCurseEffects(EntityLivingBase entity, NBTTagCompound nbtTag) { - if(entity != null && nbtTag != null) { - int level; - if(!(entity instanceof EntityPlayer) && nbtTag.hasKey("witcherySinking")) { - level = nbtTag.getInteger("witcherySinking"); - if(level > 0) { - if(entity.isInWater() || entity instanceof EntityPlayer && !entity.onGround) { - if(entity.motionY < 0.0D) { - entity.motionY *= 1.0D + Math.min(0.1D * (double)level, 0.4D); - } else if(entity.motionY > 0.0D) { - entity.motionY *= 1.0D - Math.min(0.1D * (double)level, 0.4D); - } - } - } else { - nbtTag.removeTag("witcherySinking"); - } - } - - int x; - if(nbtTag.hasKey("witcheryCursed")) { - level = nbtTag.getInteger("witcheryCursed"); - if(level > 0) { - if(!entity.isPotionActive(Potion.blindness.id) && !entity.isPotionActive(Potion.weakness.id) && !entity.isPotionActive(Potion.digSlowdown.id) && !entity.isPotionActive(Potion.moveSlowdown.id) && !entity.isPotionActive(Potion.poison.id) && entity.worldObj.rand.nextInt(20) == 0) { - switch(entity.worldObj.rand.nextInt(level >= 5?6:(level >= 4?5:(level >= 3?4:(level >= 2?3:2))))) { - case 0: - entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 600, Math.min(level - 1, 4))); - break; - case 1: - entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 600, Math.min(level - 1, 4))); - break; - case 2: - entity.addPotionEffect(new PotionEffect(Potion.weakness.id, (13 + 2 * level) * 20, Math.min(level - 2, 4))); - break; - case 3: - entity.addPotionEffect(new PotionEffect(Potion.blindness.id, 5 * level * 20)); - if(level > 5) { - entity.addPotionEffect(new PotionEffect(Potion.nightVision.id, 5 * level * 20)); - } - case 4: - default: - break; - case 5: - if(entity instanceof EntityPlayer) { - EntityPlayer world = (EntityPlayer)entity; - x = world.inventory.currentItem; - if(world.inventory.mainInventory[x] != null) { - world.dropPlayerItemWithRandomChoice(world.inventory.mainInventory[x], true); - world.inventory.mainInventory[x] = null; - } - } else { - ItemStack world1 = entity.getHeldItem(); - if(world1 != null) { - Infusion.dropEntityItemWithRandomChoice(entity, world1, true); - entity.setCurrentItemOrArmor(0, (ItemStack)null); - } - } - } - } - } else { - nbtTag.removeTag("witcheryCursed"); - } - } - - int y; - World world2; - if(nbtTag.hasKey("witcheryOverheating")) { - level = nbtTag.getInteger("witcheryOverheating"); - if(level > 0) { - world2 = entity.worldObj; - if(!entity.isBurning() && world2.rand.nextInt(level > 2?20:(level > 1?25:30)) == 0) { - x = MathHelper.floor_double(entity.posX); - y = MathHelper.floor_double(entity.posZ); - BiomeGenBase z = world2.getBiomeGenForCoords(x, y); - if((double)z.temperature >= 1.5D && (!z.canSpawnLightningBolt() || !world2.isRaining()) && !entity.isInWater()) { - entity.setFire(Math.min(world2.rand.nextInt(level < 4?2:level - 1) + 1, 4)); - } - } - } else { - nbtTag.removeTag("witcheryOverheating"); - } - } - - if(nbtTag.hasKey("witcheryWakingNightmare") && entity instanceof EntityPlayer) { - EntityPlayer level1 = (EntityPlayer)entity; - int world3 = nbtTag.getInteger("witcheryWakingNightmare"); - if(world3 > 0 && level1.dimension != Config.instance().dimensionDreamID) { - World x1 = level1.worldObj; - if(x1.rand.nextInt(world3 > 4?30:(world3 > 2?60:180)) == 0) { - double y1 = 16.0D; - double sound = 8.0D; - AxisAlignedBB MIN_DISTANCE = AxisAlignedBB.getBoundingBox(entity.posX - 16.0D, entity.posY - 8.0D, entity.posZ - 16.0D, entity.posX + 16.0D, entity.posY + 8.0D, entity.posZ + 16.0D); - List entities = x1.getEntitiesWithinAABB(EntityNightmare.class, MIN_DISTANCE); - boolean doNothing = false; - Iterator i$ = entities.iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityNightmare nightmare = (EntityNightmare)obj; - if(nightmare.getVictimName().equalsIgnoreCase(level1.getCommandSenderName())) { - doNothing = true; - break; - } - } - - if(!doNothing) { - Infusion.spawnCreature(x1, EntityNightmare.class, MathHelper.floor_double(level1.posX), MathHelper.floor_double(level1.posY), MathHelper.floor_double(level1.posZ), level1, 2, 6); - } - } - } else { - nbtTag.removeTag("witcheryWakingNightmare"); - } - } - - if(entity instanceof EntityPlayer && nbtTag.hasKey("witcheryInsanity")) { - level = nbtTag.getInteger("witcheryInsanity"); - if(level > 0) { - world2 = entity.worldObj; - x = MathHelper.floor_double(entity.posX); - y = MathHelper.floor_double(entity.posY); - int z1 = MathHelper.floor_double(entity.posZ); - if(world2.rand.nextInt(level > 2?25:(level > 1?30:35)) == 0) { - Class sound1 = null; - switch(world2.rand.nextInt(3)) { - case 0: - default: - sound1 = EntityIllusionCreeper.class; - break; - case 1: - sound1 = EntityIllusionSpider.class; - break; - case 2: - sound1 = EntityIllusionZombie.class; - } - - boolean MAX_DISTANCE = true; - boolean MIN_DISTANCE1 = true; - Infusion.spawnCreature(world2, sound1, x, y, z1, (EntityPlayer)entity, 4, 9); - } else if(level >= 4 && world2.rand.nextInt(20) == 0) { - SoundEffect sound2 = SoundEffect.NONE; - switch(world2.rand.nextInt(3)) { - case 0: - case 2: - case 3: - default: - sound2 = SoundEffect.RANDOM_EXPLODE; - break; - case 1: - sound2 = SoundEffect.MOB_ENDERMAN_IDLE; - } - - sound2.playOnlyTo((EntityPlayer)entity, 1.0F, 1.0F); - } - } else { - nbtTag.removeTag("witcheryInsanity"); - } - } - } - - } - - @SubscribeEvent( - priority = EventPriority.HIGH - ) - public void onLivingDeath(LivingDeathEvent event) { - if(!event.entityLiving.worldObj.isRemote && !event.isCanceled()) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)event.entity; - World world = player.worldObj; - NBTTagCompound nbtTag = Infusion.getNBT(player); - if(nbtTag.hasKey("witcheryDepths")) { - nbtTag.removeTag("witcheryDepths"); - } - - PlayerEffects.onDeath(player); - } - - Familiar.handleLivingDeath(event); - } - - } - - @SubscribeEvent - public void onLivingSetAttackTarget(LivingSetAttackTargetEvent event) { - if(event.target != null && event.entityLiving instanceof EntityLiving) { - EntityLiving aggressorEntity = (EntityLiving)event.entityLiving; - if(event.target instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)event.target; - if(player.isInvisible()) { - if(aggressorEntity.worldObj.getClosestVulnerablePlayer(aggressorEntity.posX, aggressorEntity.posY, aggressorEntity.posZ, 16.0D) != event.target) { - aggressorEntity.setAttackTarget((EntityLivingBase)null); - } - } else if(aggressorEntity.isPotionActive(Potion.blindness)) { - aggressorEntity.setAttackTarget((EntityLivingBase)null); - } else { - ItemStack stack; - if(aggressorEntity instanceof EntityCreeper) { - stack = player.inventory.armorItemInSlot(2); - if(stack != null && stack.getItem() == Witchery.Items.WITCH_ROBES) { - aggressorEntity.setAttackTarget((EntityLivingBase)null); - } - } else if(aggressorEntity.isEntityUndead()) { - if(aggressorEntity instanceof EntityZombie && ExtendedPlayer.get(player).getVampireLevel() >= 10) { - aggressorEntity.setAttackTarget((EntityLivingBase)null); - } else { - stack = player.inventory.armorItemInSlot(2); - if(stack != null && stack.getItem() == Witchery.Items.NECROMANCERS_ROBES) { - aggressorEntity.setAttackTarget((EntityLivingBase)null); - } - } - } - } - } - - if(event.target instanceof EntityVillageGuard && event.entityLiving instanceof EntityGolem) { - aggressorEntity.setAttackTarget((EntityLivingBase)null); - } else if(Config.instance().isZombeIgnoreVillagerActive() && event.target instanceof EntityVillager && event.entityLiving instanceof EntityZombie) { - aggressorEntity.setAttackTarget((EntityLivingBase)null); - } - } - - } - - @SubscribeEvent - public void onLivingFall(LivingFallEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)event.entityLiving; - Infusion.Registry.INSTANCE.get(player).onFalling(player.worldObj, player, event); - } - - } - - @SubscribeEvent - public void onLivingHurt(LivingHurtEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)event.entityLiving; - if(event.source.isFireDamage() && event.isCancelable() && !event.isCanceled() && player.getCurrentArmor(2) != null && player.getCurrentArmor(2).getItem() == Witchery.Items.DEATH_ROBE) { - if(!player.isPotionActive(Potion.fireResistance.id)) { - player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 0)); - } - - event.setCanceled(true); - } - - if(!event.isCanceled()) { - Infusion.Registry.INSTANCE.get(player).onHurt(player.worldObj, player, event); - } - } - - } - } -} +package com.emoniph.witchery.infusion; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.common.ExtendedPlayer; +import com.emoniph.witchery.dimension.WorldProviderDreamWorld; +import com.emoniph.witchery.dimension.WorldProviderTorment; +import com.emoniph.witchery.entity.EntityCovenWitch; +import com.emoniph.witchery.entity.EntityDemon; +import com.emoniph.witchery.entity.EntityIllusion; +import com.emoniph.witchery.entity.EntityIllusionCreeper; +import com.emoniph.witchery.entity.EntityIllusionSpider; +import com.emoniph.witchery.entity.EntityIllusionZombie; +import com.emoniph.witchery.entity.EntityNightmare; +import com.emoniph.witchery.entity.EntityVillageGuard; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.entity.ai.EntityAIDigBlocks; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.infusion.InfusedBrewEffect; +import com.emoniph.witchery.infusion.PlayerEffects; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePower; +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.item.ItemHunterClothes; +import com.emoniph.witchery.network.PacketPlayerStyle; +import com.emoniph.witchery.network.PacketPlayerSync; +import com.emoniph.witchery.predictions.PredictionManager; +import com.emoniph.witchery.ritual.rites.RiteProtectionCircleRepulsive; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.Dye; +import com.emoniph.witchery.util.Log; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGolem; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ServerChatEvent; +import net.minecraftforge.event.entity.living.EnderTeleportEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.event.entity.living.LivingFallEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.player.FillBucketEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; + +public class Infusion { + + public static final Infusion DEFUSED = new Infusion(0); + public static final String INFUSION_CHARGES_KEY = "witcheryInfusionCharges"; + public static final String INFUSION_ID_KEY = "witcheryInfusionID"; + public static final String INFUSION_MAX_CHARGES_KEY = "witcheryInfusionChargesMax"; + public static final String INFUSION_NEXTSYNC = "WITCResyncLook"; + public static final String INFUSION_GROTESQUE = "witcheryGrotesque"; + public static final String INFUSION_DEPTHS = "witcheryDepths"; + public static final String INFUSION_CURSED = "witcheryCursed"; + public static final String INFUSION_INSANITY = "witcheryInsanity"; + public static final String INFUSION_SINKING = "witcherySinking"; + public static final String INFUSION_OVERHEAT = "witcheryOverheating"; + public static final String INFUSION_NIGHTMARE = "witcheryWakingNightmare"; + public final int infusionID; + protected static final int DEFAULT_CHARGE_COST = 1; + + + public static EntityItem dropEntityItemWithRandomChoice(EntityLivingBase entity, ItemStack par1ItemStack, boolean par2) { + if(par1ItemStack != null && entity != null) { + if(par1ItemStack.stackSize == 0) { + return null; + } else { + EntityItem entityitem = new EntityItem(entity.worldObj, entity.posX, entity.posY - 0.30000001192092896D + (double)entity.getEyeHeight(), entity.posZ, par1ItemStack); + entityitem.delayBeforeCanPickup = 40; + float f = 0.1F; + float f1; + if(par2) { + f1 = entity.worldObj.rand.nextFloat() * 0.5F; + float f2 = entity.worldObj.rand.nextFloat() * 3.1415927F * 2.0F; + entityitem.motionX = (double)(-MathHelper.sin(f2) * f1); + entityitem.motionZ = (double)(MathHelper.cos(f2) * f1); + entityitem.motionY = 0.20000000298023224D; + } else { + f = 0.3F; + entityitem.motionX = (double)(-MathHelper.sin(entity.rotationYaw / 180.0F * 3.1415927F) * MathHelper.cos(entity.rotationPitch / 180.0F * 3.1415927F) * f); + entityitem.motionZ = (double)(MathHelper.cos(entity.rotationYaw / 180.0F * 3.1415927F) * MathHelper.cos(entity.rotationPitch / 180.0F * 3.1415927F) * f); + entityitem.motionY = (double)(-MathHelper.sin(entity.rotationPitch / 180.0F * 3.1415927F) * f + 0.1F); + f = 0.02F; + f1 = entity.worldObj.rand.nextFloat() * 3.1415927F * 2.0F; + f *= entity.worldObj.rand.nextFloat(); + entityitem.motionX += Math.cos((double)f1) * (double)f; + entityitem.motionY += (double)((entity.worldObj.rand.nextFloat() - entity.worldObj.rand.nextFloat()) * 0.1F); + entityitem.motionZ += Math.sin((double)f1) * (double)f; + } + + entity.worldObj.spawnEntityInWorld(entityitem); + return entityitem; + } + } else { + return null; + } + } + + public static EntityCreature spawnCreature(World world, Class creatureType, EntityLivingBase victim, int minRange, int maxRange, ParticleEffect effect, SoundEffect effectSound) { + int x = MathHelper.floor_double(victim.posX); + int y = MathHelper.floor_double(victim.posY); + int z = MathHelper.floor_double(victim.posZ); + return spawnCreature(world, creatureType, x, y, z, victim, minRange, maxRange, effect, effectSound); + } + + public static EntityCreature spawnCreature(World world, Class creatureType, int x, int y, int z, EntityPlayer victim, int minRange, int maxRange) { + return spawnCreature(world, creatureType, x, y, z, victim, minRange, maxRange, (ParticleEffect)null, SoundEffect.NONE); + } + + public static EntityCreature spawnCreature(World world, Class creatureType, int x, int y, int z, EntityLivingBase victim, int minRange, int maxRange, ParticleEffect effect, SoundEffect effectSound) { + if(!world.isRemote) { + int activeRadius = maxRange - minRange; + int ax = world.rand.nextInt(activeRadius * 2 + 1); + if(ax > activeRadius) { + ax += minRange * 2; + } + + int nx = x - maxRange + ax; + int az = world.rand.nextInt(activeRadius * 2 + 1); + if(az > activeRadius) { + az += minRange * 2; + } + + int nz = z - maxRange + az; + + int ny; + for(ny = y; !world.isAirBlock(nx, ny, nz) && ny < y + 8; ++ny) { + ; + } + + while(world.isAirBlock(nx, ny, nz) && ny > 0) { + --ny; + } + + int hy; + for(hy = 0; world.isAirBlock(nx, ny + hy + 1, nz) && hy < 6; ++hy) { + ; + } + + Log.instance().debug("Creature: hy: " + hy + " (" + nx + "," + ny + "," + nz + ")"); + if(hy >= 2) { + try { + Constructor ex = creatureType.getConstructor(new Class[]{World.class}); + EntityCreature creature = (EntityCreature)ex.newInstance(new Object[]{world}); + if(victim instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)victim; + if(creature instanceof EntityIllusion) { + ((EntityIllusion)creature).setVictim(player.getCommandSenderName()); + } else if(creature instanceof EntityNightmare) { + ((EntityNightmare)creature).setVictim(player.getCommandSenderName()); + creature.setAttackTarget(victim); + } + } + + creature.setLocationAndAngles(0.5D + (double)nx, 0.05D + (double)ny + 1.0D, 0.5D + (double)nz, 0.0F, 0.0F); + world.spawnEntityInWorld(creature); + if(effect != null) { + effect.send(effectSound, world, 0.5D + (double)nx, 0.05D + (double)ny + 1.0D, 0.5D + (double)nz, 1.0D, (double)creature.height, 16); + } + + return creature; + } catch (NoSuchMethodException var20) { + ; + } catch (InvocationTargetException var21) { + ; + } catch (InstantiationException var22) { + ; + } catch (IllegalAccessException var23) { + ; + } + } + } + + return null; + } + + public static boolean isOnCooldown(World world, ItemStack stack) { + if(!world.isRemote) { + NBTTagCompound nbtTag = stack.getTagCompound(); + if(nbtTag != null && nbtTag.hasKey("WITCCooldown")) { + long currentTime = MinecraftServer.getSystemTimeMillis(); + if(currentTime < nbtTag.getLong("WITCCooldown")) { + return true; + } + } + } + + return false; + } + + public static void setCooldown(World world, ItemStack stack, int milliseconds) { + if(!world.isRemote) { + if(!stack.hasTagCompound()) { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound nbtTag = stack.getTagCompound(); + if(nbtTag != null) { + long currentTime = MinecraftServer.getSystemTimeMillis(); + nbtTag.setLong("WITCCooldown", currentTime + (long)milliseconds); + } + } + + } + + public Infusion(int infusionID) { + this.infusionID = infusionID; + } + + public void onHurt(World worldObj, EntityPlayer player, LivingHurtEvent event) {} + + public void onFalling(World world, EntityPlayer player, LivingFallEvent event) {} + + public IIcon getPowerBarIcon(EntityPlayer player, int index) { + return Blocks.planks.getIcon(0, 0); + } + + protected boolean consumeCharges(World world, EntityPlayer player, int cost, boolean playFailSound) { + if(player.capabilities.isCreativeMode) { + return true; + } else { + int charges = getCurrentEnergy(player); + if(charges - cost < 0) { + world.playSoundAtEntity(player, "note.snare", 0.5F, 0.4F / ((float)Math.random() * 0.4F + 0.8F)); + this.clearInfusion(player); + return false; + } else { + setCurrentEnergy(player, charges - cost); + return true; + } + } + } + + public void onUpdate(ItemStack itemstack, World world, EntityPlayer player, int par4, boolean par5) {} + + public void onLeftClickEntity(ItemStack itemstack, World world, EntityPlayer player, Entity otherEntity) { + if(!world.isRemote) { + world.playSoundAtEntity(player, "note.snare", 0.5F, 0.4F / ((float)Math.random() * 0.4F + 0.8F)); + } + + } + + public int getMaxItemUseDuration(ItemStack itemstack) { + return 400; + } + + public void onUsingItemTick(ItemStack itemstack, World world, EntityPlayer player, int countdown) {} + + public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int countdown) { + if(!world.isRemote) { + world.playSoundAtEntity(player, "note.snare", 0.5F, 0.4F / ((float)Math.random() * 0.4F + 0.8F)); + } + + } + + public void playSound(World world, EntityPlayer player, String sound) { + world.playSoundAtEntity(player, sound, 0.5F, 0.4F / ((float)world.rand.nextDouble() * 0.4F + 0.8F)); + } + + public void playFailSound(World world, EntityPlayer player) { + this.playSound(world, player, "note.snare"); + } + + public static NBTTagCompound getNBT(Entity player) { + NBTTagCompound entityData = player.getEntityData(); + if(player.worldObj.isRemote) { + return entityData; + } else { + NBTTagCompound persistedData = entityData.getCompoundTag("PlayerPersisted"); + if(!entityData.hasKey("PlayerPersisted")) { + entityData.setTag("PlayerPersisted", persistedData); + } + + return persistedData; + } + } + + public void infuse(EntityPlayer player, int charges) { + if(!player.worldObj.isRemote) { + NBTTagCompound nbt = getNBT(player); + nbt.setInteger("witcheryInfusionID", this.infusionID); + nbt.setInteger("witcheryInfusionCharges", charges); + nbt.setInteger("witcheryInfusionChargesMax", charges); + CreaturePower.setCreaturePowerID(player, 0, 0); + syncPlayer(player.worldObj, player); + } + + } + + private void clearInfusion(EntityPlayer player) { + if(!player.worldObj.isRemote) { + NBTTagCompound nbt = getNBT(player); + nbt.removeTag("witcheryInfusionCharges"); + syncPlayer(player.worldObj, player); + } + + } + + public static void setCurrentEnergy(EntityPlayer player, int currentEnergy) { + if(!player.worldObj.isRemote) { + NBTTagCompound nbt = getNBT(player); + nbt.setInteger("witcheryInfusionCharges", currentEnergy); + syncPlayer(player.worldObj, player); + } + + } + + public static void syncPlayer(World world, EntityPlayer player) { + if(!world.isRemote) { + Witchery.packetPipeline.sendTo((IMessage)(new PacketPlayerSync(player)), player); + } + + } + + public static int getInfusionID(EntityPlayer player) { + NBTTagCompound nbt = getNBT(player); + return nbt.hasKey("witcheryInfusionID")?nbt.getInteger("witcheryInfusionID"):0; + } + + public static int getCurrentEnergy(EntityPlayer player) { + NBTTagCompound nbt = getNBT(player); + return nbt.hasKey("witcheryInfusionCharges")?nbt.getInteger("witcheryInfusionCharges"):0; + } + + public static int getMaxEnergy(EntityPlayer player) { + NBTTagCompound nbt = getNBT(player); + return nbt.hasKey("witcheryInfusionChargesMax")?nbt.getInteger("witcheryInfusionChargesMax"):0; + } + + public static void setEnergy(EntityPlayer player, int infusionID, int currentEnergy, int maxEnergy) { + if(player.worldObj.isRemote) { + NBTTagCompound nbt = getNBT(player); + nbt.setInteger("witcheryInfusionID", infusionID); + nbt.setInteger("witcheryInfusionCharges", currentEnergy); + nbt.setInteger("witcheryInfusionChargesMax", maxEnergy); + } + + } + + public static void setSinkingCurseLevel(EntityPlayer playerEntity, int sinkingLevel) { + if(playerEntity.worldObj.isRemote) { + NBTTagCompound nbt = getNBT(playerEntity); + if(nbt.hasKey("witcherySinking") && sinkingLevel <= 0) { + nbt.removeTag("witcherySinking"); + } + + nbt.setInteger("witcherySinking", sinkingLevel); + } + + } + + public static int getSinkingCurseLevel(EntityPlayer player) { + NBTTagCompound nbtTag = getNBT(player); + return nbtTag.hasKey("witcherySinking")?nbtTag.getInteger("witcherySinking"):0; + } + + public static boolean aquireEnergy(World world, EntityPlayer player, int cost, boolean showMessages) { + NBTTagCompound nbtPlayer = getNBT(player); + return nbtPlayer != null?aquireEnergy(world, player, nbtPlayer, cost, showMessages):false; + } + + public static boolean aquireEnergy(World world, EntityPlayer player, NBTTagCompound nbtPlayer, int cost, boolean showMessages) { + if(nbtPlayer != null && nbtPlayer.hasKey("witcheryInfusionID") && nbtPlayer.hasKey("witcheryInfusionCharges")) { + if(!player.capabilities.isCreativeMode && nbtPlayer.getInteger("witcheryInfusionCharges") < cost) { + if(showMessages) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.nocharges", new Object[0]); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + + return false; + } else { + if(!player.capabilities.isCreativeMode) { + setCurrentEnergy(player, nbtPlayer.getInteger("witcheryInfusionCharges") - cost); + } + + return true; + } + } else { + if(showMessages) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.infusionrequired", new Object[0]); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + + return false; + } + } + + + public static class Registry { + + private static final Infusion.Registry INSTANCE = new Infusion.Registry(); + private final ArrayList registry = new ArrayList(); + + + public static Infusion.Registry instance() { + return INSTANCE; + } + + public void add(Infusion infusion) { + if(infusion.infusionID == this.registry.size() + 1) { + this.registry.add(infusion); + } else if(infusion.infusionID > this.registry.size() + 1) { + for(int existingInfusion = this.registry.size(); existingInfusion < infusion.infusionID; ++existingInfusion) { + this.registry.add((Object)null); + } + + this.registry.add(infusion); + } else { + Infusion var3 = (Infusion)this.registry.get(infusion.infusionID); + if(var3 != null) { + Log.instance().warning(String.format("Creature power %s at id %d is being overwritten by another creature power %s.", new Object[]{var3, Integer.valueOf(infusion.infusionID), infusion})); + } + + this.registry.set(infusion.infusionID, infusion); + } + + } + + public Infusion get(EntityPlayer player) { + int infusionID = Infusion.getInfusionID(player); + return infusionID > 0?(Infusion)this.registry.get(infusionID - 1):Infusion.DEFUSED; + } + + public Infusion get(int infusionID) { + return infusionID > 0?(Infusion)this.registry.get(infusionID - 1):Infusion.DEFUSED; + } + + } + + public static class EventHooks { + + private boolean isBannedSpiritObject(ItemStack stack) { + if(stack == null) { + return false; + } else { + Item item = stack.getItem(); + return item == Items.ender_pearl || item == Items.blaze_powder; + } + } + + @SubscribeEvent( + priority = EventPriority.NORMAL + ) + public void onEnderTeleport(EnderTeleportEvent event) { + if(!event.isCanceled() && event.entityLiving != null && !event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer && ItemHunterClothes.isFullSetWorn(event.entityLiving, false)) { + event.setCanceled(true); + } + + } + + @SubscribeEvent( + priority = EventPriority.NORMAL + ) + public void FillBucket(FillBucketEvent event) { + ItemStack result = this.attemptFill(event.world, event.target); + if(result != null) { + event.result = result; + event.setResult(Result.ALLOW); + } + + } + + private ItemStack attemptFill(World world, MovingObjectPosition p) { + Block id = world.getBlock(p.blockX, p.blockY, p.blockZ); + if(id == Witchery.Blocks.FLOWING_SPIRIT) { + if(world.getBlockMetadata(p.blockX, p.blockY, p.blockZ) == 0) { + world.setBlock(p.blockX, p.blockY, p.blockZ, Blocks.air); + return new ItemStack(Witchery.Items.BUCKET_FLOWINGSPIRIT); + } + } else if(id == Witchery.Blocks.HOLLOW_TEARS && world.getBlockMetadata(p.blockX, p.blockY, p.blockZ) == 0) { + world.setBlock(p.blockX, p.blockY, p.blockZ, Blocks.air); + return new ItemStack(Witchery.Items.BUCKET_HOLLOWTEARS); + } + + return null; + } + + @SubscribeEvent + public void onLivingDamage(LivingHurtEvent event) { + if(event.entityLiving != null && event.entityLiving.worldObj != null && !event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer && !event.isCanceled()) { + EntityPlayer player = (EntityPlayer)event.entityLiving; + PredictionManager.instance().checkIfFulfilled(player, event); + } + + } + + @SubscribeEvent + public void onServerChat(ServerChatEvent event) { + if(event.player != null && !event.isCanceled() && !event.player.worldObj.isRemote && event.message != null) { + Witchery.Items.RUBY_SLIPPERS.trySayTheresNoPlaceLikeHome(event.player, event.message); + } + + } + + @SubscribeEvent + public void onHarvestDrops(HarvestDropsEvent event) { + if(event.harvester != null && event.harvester.worldObj != null && !event.harvester.worldObj.isRemote) { + PredictionManager.instance().checkIfFulfilled(event.harvester, event); + PlayerEffects.onHarvestDrops(event.harvester, event); + EntityAIDigBlocks.onHarvestDrops(event.harvester, event); + } + + if(!event.world.isRemote && event.world.provider.dimensionId == Config.instance().dimensionDreamID && !event.isCanceled()) { + Iterator iterator = event.drops.iterator(); + + while(iterator.hasNext()) { + ItemStack stack = (ItemStack)iterator.next(); + if(stack != null && this.isBannedSpiritObject(stack)) { + iterator.remove(); + } + } + } + + } + + @SubscribeEvent + public void onPlayerInteract(PlayerInteractEvent event) { + if(event.entityLiving != null && event.entityLiving.worldObj != null && !event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer && !event.isCanceled()) { + EntityPlayer player = (EntityPlayer)event.entityLiving; + PredictionManager.instance().checkIfFulfilled(player, event); + PlayerEffects.onInteract(player, event); + } + + } + + @SubscribeEvent + public void onLivingUpdate(LivingUpdateEvent event) { + long counter = event.entityLiving.worldObj.getTotalWorldTime(); + if(event.entityLiving instanceof EntityPlayer) { + EntityPlayer belt = (EntityPlayer)event.entityLiving; + if(!event.entityLiving.worldObj.isRemote) { + long blockID = TimeUtil.getServerTimeInTicks(); + if(counter % 4L == 0L) { + NBTTagCompound currentChargeLevel = Infusion.getNBT(belt); + this.handleBrewGrotesqueEffect(belt, currentChargeLevel); + WorldProviderDreamWorld.updatePlayerEffects(belt.worldObj, belt, currentChargeLevel, blockID, counter); + WorldProviderTorment.updatePlayerEffects(belt.worldObj, belt, currentChargeLevel, blockID, counter); + // Lumos follower: move glow globe above player every 4 ticks + if (currentChargeLevel.hasKey("WITCLumos")) { + int ox = currentChargeLevel.getInteger("WITCLumosX"); + int oy = currentChargeLevel.getInteger("WITCLumosY"); + int oz = currentChargeLevel.getInteger("WITCLumosZ"); + int nx = MathHelper.floor_double(belt.posX); + int ny = MathHelper.floor_double(belt.posY) + 2; + int nz = MathHelper.floor_double(belt.posZ); + if (ox != nx || oy != ny || oz != nz) { + // Remove old globe only if it's still our globe + if (belt.worldObj.blockExists(ox, oy, oz) && belt.worldObj.getBlock(ox, oy, oz) == Witchery.Blocks.GLOW_GLOBE) { + belt.worldObj.setBlockToAir(ox, oy, oz); + } + // Place new globe above head if the space is free + if (belt.worldObj.isAirBlock(nx, ny, nz)) { + belt.worldObj.setBlock(nx, ny, nz, Witchery.Blocks.GLOW_GLOBE); + } + currentChargeLevel.setInteger("WITCLumosX", nx); + currentChargeLevel.setInteger("WITCLumosY", ny); + currentChargeLevel.setInteger("WITCLumosZ", nz); + } + } + if(counter % 20L == 0L) { + this.handleSyncEffects(belt, currentChargeLevel); + this.handleBrewDepthsEffect(belt, currentChargeLevel); + this.handleCurseEffects(belt, currentChargeLevel); + this.handleSeepingShoesEffect(belt, currentChargeLevel); + InfusedBrewEffect.checkActiveEffects(belt.worldObj, belt, currentChargeLevel, counter % 1200L == 0L, blockID); + } + + if(counter % 100L == 0L && !event.isCanceled()) { + PredictionManager.instance().checkIfFulfilled(belt, event); + if(Config.instance().allowCovenWitchVisits && currentChargeLevel.hasKey("WITCCoven") && belt.worldObj.rand.nextInt(20) == 0) { + ChunkCoordinates coords = belt.getBedLocation(belt.dimension); + if(coords != null && coords.getDistanceSquared((int)belt.posX, (int)belt.posY, (int)belt.posZ) < 256.0F) { + NBTTagList nbtCovenList = currentChargeLevel.getTagList("WITCCoven", 10); + if(nbtCovenList.tagCount() > 0) { + EntityCovenWitch.summonCovenMember(belt.worldObj, belt, 90); + } + } + } + } + } + + PlayerEffects.onUpdate(belt, blockID); + if(counter % 100L == 1L) { + EntityWitchHunter.handleWitchHunterEffects(belt, blockID); + } + } + + this.handleIcySlippersEffect(belt); + this.handleFamiliarFollowerSync(belt); + } else if(!event.entityLiving.worldObj.isRemote && counter % 20L == 0L) { + this.handleCurseEffects(event.entityLiving, event.entityLiving.getEntityData()); + } + + if(counter % 100L == 0L) { + ItemStack belt1 = event.entityLiving.getEquipmentInSlot(2); + if(belt1 != null && belt1.getItem() == Witchery.Items.BARK_BELT) { + Block blockID1 = event.entityLiving.worldObj.getBlock(MathHelper.floor_double(event.entityLiving.posX), MathHelper.floor_double(event.entityLiving.posY) - 1, MathHelper.floor_double(event.entityLiving.posZ)); + if(blockID1 == Blocks.grass || blockID1 == Blocks.mycelium) { + int maxChargeLevel = Witchery.Items.BARK_BELT.getMaxChargeLevel(event.entityLiving); + int currentChargeLevel1 = Witchery.Items.BARK_BELT.getChargeLevel(belt1); + if(currentChargeLevel1 < maxChargeLevel) { + Witchery.Items.BARK_BELT.setChargeLevel(belt1, Math.min(currentChargeLevel1 + 1, maxChargeLevel)); + event.entityLiving.worldObj.playSoundAtEntity(event.entityLiving, "witchery:random.wood_creak", 0.5F, (float)(0.8D + 2.0D * event.entityLiving.worldObj.rand.nextGaussian())); + } + } + } + } + + } + + private void handleSeepingShoesEffect(EntityPlayer player, NBTTagCompound nbtTag) { + if(player.onGround) { + if(player.isPotionActive(Potion.poison) || player.isPotionActive(Potion.wither)) { + ItemStack shoes = player.getEquipmentInSlot(1); + if(shoes != null && shoes.getItem() == Witchery.Items.SEEPING_SHOES) { + boolean poisonRemoved = false; + if(player.isPotionActive(Potion.poison)) { + player.removePotionEffect(Potion.poison.id); + poisonRemoved = true; + } + + if(player.isPotionActive(Potion.wither)) { + player.removePotionEffect(Potion.wither.id); + poisonRemoved = true; + } + + if(poisonRemoved) { + int x = MathHelper.floor_double(player.posX); + int z = MathHelper.floor_double(player.posZ); + int y = MathHelper.floor_double(player.posY); + boolean RADIUS = true; + boolean RADIUS_SQ = true; + + for(int dx = x - 3; dx <= x + 3; ++dx) { + for(int dz = z - 3; dz <= z + 3; ++dz) { + for(int dy = y - 1; dy <= y + 1; ++dy) { + if(Coord.distanceSq((double)dx, 1.0D, (double)dy, (double)x, 1.0D, (double)dy) <= 9.0D && player.worldObj.isAirBlock(dx, dy + 1, dz) && !player.worldObj.isAirBlock(dx, dy, dz)) { + ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), player.worldObj, dx, dy, dz, player); + } + } + } + } + } + + } + } + } + } + + private void handleSyncEffects(EntityPlayer player, NBTTagCompound nbtPlayer) { + if(!player.worldObj.isRemote && nbtPlayer.hasKey("WITCResyncLook")) { + long nextSync = nbtPlayer.getLong("WITCResyncLook"); + if(nextSync <= MinecraftServer.getSystemTimeMillis()) { + nbtPlayer.removeTag("WITCResyncLook"); + Witchery.packetPipeline.sendToDimension(new PacketPlayerStyle(player), player.dimension); + } + } + + } + + private void handleFamiliarFollowerSync(EntityPlayer player) { + if(!player.worldObj.isRemote) { + NBTTagCompound compound = player.getEntityData(); + NBTTagCompound pos; + if(compound.hasKey("WITC_LASTPOS")) { + pos = compound.getCompoundTag("WITC_LASTPOS"); + int lastDimension = pos.getInteger("D"); + if(lastDimension != player.dimension || Math.abs(pos.getDouble("X") - player.posX) > 32.0D || Math.abs(pos.getDouble("Z") - player.posZ) > 32.0D) { + if(lastDimension != player.dimension && player.dimension == -1 || lastDimension == -1) { + NBTTagCompound familiar = Infusion.getNBT(player); + familiar.setBoolean("WITCVisitedNether", true); + } + + if(Familiar.hasActiveFamiliar(player)) { + EntityTameable var13 = Familiar.getFamiliarEntity(player); + if(var13 != null && !var13.isSitting()) { + int ipx = MathHelper.floor_double(player.posX) - 2; + int j = MathHelper.floor_double(player.posZ) - 2; + int k = MathHelper.floor_double(player.boundingBox.minY) - 2; + boolean done = false; + + for(int l = 0; l <= 4 && !done; ++l) { + for(int i1 = 0; i1 <= 4 && !done; ++i1) { + for(int dy = 0; dy <= 4 && !done; ++dy) { + if(player.worldObj.getBlock(ipx + l, k + dy - 1, j + i1).isSideSolid(player.worldObj, ipx + l, k + dy - 1, j + i1, ForgeDirection.UP) && !player.worldObj.getBlock(ipx + l, k + dy, j + i1).isNormalCube() && !player.worldObj.getBlock(ipx + l, k + dy + 1, j + i1).isNormalCube()) { + ItemGeneral var10000 = Witchery.Items.GENERIC; + ItemGeneral.teleportToLocation(player.worldObj, 0.5D + (double)ipx + (double)l, (double)(k + dy), 0.5D + (double)j + (double)i1, player.dimension, var13, true); + done = true; + } + } + } + } + } + } + } + + pos.setDouble("X", player.posX); + pos.setDouble("Z", player.posZ); + pos.setInteger("D", player.dimension); + } else { + pos = new NBTTagCompound(); + pos.setDouble("X", player.posX); + pos.setDouble("Z", player.posZ); + pos.setInteger("D", player.dimension); + pos.setBoolean("visitedNether", player.dimension == -1); + } + } + + } + + private void handleIcySlippersEffect(EntityPlayer player) { + ItemStack shoes = player.getCurrentArmor(0); + if(shoes != null && shoes.getItem() == Witchery.Items.ICY_SLIPPERS) { + int k = MathHelper.floor_double(player.posY - 1.0D); + + for(int i = 0; i < 4; ++i) { + int j = MathHelper.floor_double(player.posX + (double)((float)(i % 2 * 2 - 1) * 0.5F)); + int l = MathHelper.floor_double(player.posZ + (double)((float)(i / 2 % 2 * 2 - 1) * 0.5F)); + Block blockID = player.worldObj.getBlock(j, k, l); + if(blockID != Blocks.flowing_water && blockID != Blocks.water) { + if(blockID == Blocks.flowing_lava || blockID == Blocks.lava) { + player.worldObj.setBlock(j, k, l, Blocks.obsidian); + if(player.worldObj.rand.nextInt(10) == 0) { + shoes.damageItem(1, player); + } + } + } else { + player.worldObj.setBlock(j, k, l, Blocks.ice); + } + } + } + + } + + private void handleBrewDepthsEffect(EntityPlayer player, NBTTagCompound nbtTag) { + if(nbtTag.hasKey("witcheryDepths")) { + int timeLeft = nbtTag.getInteger("witcheryDepths"); + if(timeLeft > 0) { + if(!player.isPotionActive(Potion.waterBreathing)) { + player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 6000)); + } + + if(!player.isInsideOfMaterial(Material.water)) { + if(!player.isPotionActive(Potion.wither)) { + player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 1)); + } + } else if(player.isPotionActive(Potion.wither)) { + player.removePotionEffect(Potion.wither.id); + } + } + + --timeLeft; + if(timeLeft <= 0) { + nbtTag.removeTag("witcheryDepths"); + if(player.isPotionActive(Potion.waterBreathing)) { + player.removePotionEffect(Potion.waterBreathing.id); + } + + if(player.isPotionActive(Potion.poison)) { + player.removePotionEffect(Potion.poison.id); + } + } else { + nbtTag.setInteger("witcheryDepths", timeLeft); + } + } + + } + + private void handleBrewGrotesqueEffect(EntityPlayer player, NBTTagCompound nbtTag) { + if(nbtTag.hasKey("witcheryGrotesque")) { + int timeLeft = nbtTag.getInteger("witcheryGrotesque"); + if(timeLeft > 0) { + float radius = 4.0F; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(player.posX - 4.0D, player.posY - 4.0D, player.posZ - 4.0D, player.posX + 4.0D, player.posY + 4.0D, player.posZ + 4.0D); + List list = player.worldObj.getEntitiesWithinAABB(EntityLiving.class, bounds); + Iterator iterator = list.iterator(); + + while(iterator.hasNext()) { + EntityLiving entity = (EntityLiving)iterator.next(); + boolean victim = !(entity instanceof EntityDemon) && !(entity instanceof IBossDisplayData) && !(entity instanceof EntityGolem) && !(entity instanceof EntityWitch); + if(victim && Coord.distance(entity.posX, entity.posY, entity.posZ, player.posX, player.posY, player.posZ) < 4.0D) { + RiteProtectionCircleRepulsive.push(player.worldObj, entity, player.posX, player.posY, player.posZ); + } + } + } + + --timeLeft; + if(timeLeft <= 0) { + nbtTag.removeTag("witcheryGrotesque"); + Witchery.packetPipeline.sendToDimension(new PacketPlayerStyle(player), player.dimension); + } else { + nbtTag.setInteger("witcheryGrotesque", timeLeft); + } + } + + } + + private void handleCurseEffects(EntityLivingBase entity, NBTTagCompound nbtTag) { + if(entity != null && nbtTag != null) { + int level; + if(!(entity instanceof EntityPlayer) && nbtTag.hasKey("witcherySinking")) { + level = nbtTag.getInteger("witcherySinking"); + if(level > 0) { + if(entity.isInWater() || entity instanceof EntityPlayer && !entity.onGround) { + if(entity.motionY < 0.0D) { + entity.motionY *= 1.0D + Math.min(0.1D * (double)level, 0.4D); + } else if(entity.motionY > 0.0D) { + entity.motionY *= 1.0D - Math.min(0.1D * (double)level, 0.4D); + } + } + } else { + nbtTag.removeTag("witcherySinking"); + } + } + + int x; + if(nbtTag.hasKey("witcheryCursed")) { + level = nbtTag.getInteger("witcheryCursed"); + if(level > 0) { + if(!entity.isPotionActive(Potion.blindness.id) && !entity.isPotionActive(Potion.weakness.id) && !entity.isPotionActive(Potion.digSlowdown.id) && !entity.isPotionActive(Potion.moveSlowdown.id) && !entity.isPotionActive(Potion.poison.id) && entity.worldObj.rand.nextInt(20) == 0) { + switch(entity.worldObj.rand.nextInt(level >= 5?6:(level >= 4?5:(level >= 3?4:(level >= 2?3:2))))) { + case 0: + entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 600, Math.min(level - 1, 4))); + break; + case 1: + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 600, Math.min(level - 1, 4))); + break; + case 2: + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, (13 + 2 * level) * 20, Math.min(level - 2, 4))); + break; + case 3: + entity.addPotionEffect(new PotionEffect(Potion.blindness.id, 5 * level * 20)); + if(level > 5) { + entity.addPotionEffect(new PotionEffect(Potion.nightVision.id, 5 * level * 20)); + } + case 4: + default: + break; + case 5: + if(entity instanceof EntityPlayer) { + EntityPlayer world = (EntityPlayer)entity; + x = world.inventory.currentItem; + if(world.inventory.mainInventory[x] != null) { + world.dropPlayerItemWithRandomChoice(world.inventory.mainInventory[x], true); + world.inventory.mainInventory[x] = null; + } + } else { + ItemStack world1 = entity.getHeldItem(); + if(world1 != null) { + Infusion.dropEntityItemWithRandomChoice(entity, world1, true); + entity.setCurrentItemOrArmor(0, (ItemStack)null); + } + } + } + } + } else { + nbtTag.removeTag("witcheryCursed"); + } + } + + int y; + World world2; + if(nbtTag.hasKey("witcheryOverheating")) { + level = nbtTag.getInteger("witcheryOverheating"); + if(level > 0) { + world2 = entity.worldObj; + if(!entity.isBurning() && world2.rand.nextInt(level > 2?20:(level > 1?25:30)) == 0) { + x = MathHelper.floor_double(entity.posX); + y = MathHelper.floor_double(entity.posZ); + BiomeGenBase z = world2.getBiomeGenForCoords(x, y); + if((double)z.temperature >= 1.5D && (!z.canSpawnLightningBolt() || !world2.isRaining()) && !entity.isInWater()) { + entity.setFire(Math.min(world2.rand.nextInt(level < 4?2:level - 1) + 1, 4)); + } + } + } else { + nbtTag.removeTag("witcheryOverheating"); + } + } + + if(nbtTag.hasKey("witcheryWakingNightmare") && entity instanceof EntityPlayer) { + EntityPlayer level1 = (EntityPlayer)entity; + int world3 = nbtTag.getInteger("witcheryWakingNightmare"); + if(world3 > 0 && level1.dimension != Config.instance().dimensionDreamID) { + World x1 = level1.worldObj; + if(x1.rand.nextInt(world3 > 4?30:(world3 > 2?60:180)) == 0) { + double y1 = 16.0D; + double sound = 8.0D; + AxisAlignedBB MIN_DISTANCE = AxisAlignedBB.getBoundingBox(entity.posX - 16.0D, entity.posY - 8.0D, entity.posZ - 16.0D, entity.posX + 16.0D, entity.posY + 8.0D, entity.posZ + 16.0D); + List entities = x1.getEntitiesWithinAABB(EntityNightmare.class, MIN_DISTANCE); + boolean doNothing = false; + Iterator i$ = entities.iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityNightmare nightmare = (EntityNightmare)obj; + if(nightmare.getVictimName().equalsIgnoreCase(level1.getCommandSenderName())) { + doNothing = true; + break; + } + } + + if(!doNothing) { + Infusion.spawnCreature(x1, EntityNightmare.class, MathHelper.floor_double(level1.posX), MathHelper.floor_double(level1.posY), MathHelper.floor_double(level1.posZ), level1, 2, 6); + } + } + } else { + nbtTag.removeTag("witcheryWakingNightmare"); + } + } + + if(entity instanceof EntityPlayer && nbtTag.hasKey("witcheryInsanity")) { + level = nbtTag.getInteger("witcheryInsanity"); + if(level > 0) { + world2 = entity.worldObj; + x = MathHelper.floor_double(entity.posX); + y = MathHelper.floor_double(entity.posY); + int z1 = MathHelper.floor_double(entity.posZ); + if(world2.rand.nextInt(level > 2?25:(level > 1?30:35)) == 0) { + Class sound1 = null; + switch(world2.rand.nextInt(3)) { + case 0: + default: + sound1 = EntityIllusionCreeper.class; + break; + case 1: + sound1 = EntityIllusionSpider.class; + break; + case 2: + sound1 = EntityIllusionZombie.class; + } + + boolean MAX_DISTANCE = true; + boolean MIN_DISTANCE1 = true; + Infusion.spawnCreature(world2, sound1, x, y, z1, (EntityPlayer)entity, 4, 9); + } else if(level >= 4 && world2.rand.nextInt(20) == 0) { + SoundEffect sound2 = SoundEffect.NONE; + switch(world2.rand.nextInt(3)) { + case 0: + case 2: + case 3: + default: + sound2 = SoundEffect.RANDOM_EXPLODE; + break; + case 1: + sound2 = SoundEffect.MOB_ENDERMAN_IDLE; + } + + sound2.playOnlyTo((EntityPlayer)entity, 1.0F, 1.0F); + } + } else { + nbtTag.removeTag("witcheryInsanity"); + } + } + } + + } + + @SubscribeEvent( + priority = EventPriority.HIGH + ) + public void onLivingDeath(LivingDeathEvent event) { + if(!event.entityLiving.worldObj.isRemote && !event.isCanceled()) { + if(event.entityLiving instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)event.entity; + World world = player.worldObj; + NBTTagCompound nbtTag = Infusion.getNBT(player); + if(nbtTag.hasKey("witcheryDepths")) { + nbtTag.removeTag("witcheryDepths"); + } + + PlayerEffects.onDeath(player); + } + + Familiar.handleLivingDeath(event); + } + + } + + @SubscribeEvent + public void onLivingSetAttackTarget(LivingSetAttackTargetEvent event) { + if(event.target != null && event.entityLiving instanceof EntityLiving) { + EntityLiving aggressorEntity = (EntityLiving)event.entityLiving; + if(event.target instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)event.target; + if(player.isInvisible()) { + if(aggressorEntity.worldObj.getClosestVulnerablePlayer(aggressorEntity.posX, aggressorEntity.posY, aggressorEntity.posZ, 16.0D) != event.target) { + aggressorEntity.setAttackTarget((EntityLivingBase)null); + } + } else if(aggressorEntity.isPotionActive(Potion.blindness)) { + aggressorEntity.setAttackTarget((EntityLivingBase)null); + } else { + ItemStack stack; + if(aggressorEntity instanceof EntityCreeper) { + stack = player.inventory.armorItemInSlot(2); + if(stack != null && stack.getItem() == Witchery.Items.WITCH_ROBES) { + aggressorEntity.setAttackTarget((EntityLivingBase)null); + } + } else if(aggressorEntity.isEntityUndead()) { + if(aggressorEntity instanceof EntityZombie && ExtendedPlayer.get(player).getVampireLevel() >= 10) { + aggressorEntity.setAttackTarget((EntityLivingBase)null); + } else { + stack = player.inventory.armorItemInSlot(2); + if(stack != null && stack.getItem() == Witchery.Items.NECROMANCERS_ROBES) { + aggressorEntity.setAttackTarget((EntityLivingBase)null); + } + } + } + } + } + + if(event.target instanceof EntityVillageGuard && event.entityLiving instanceof EntityGolem) { + aggressorEntity.setAttackTarget((EntityLivingBase)null); + } else if(Config.instance().isZombeIgnoreVillagerActive() && event.target instanceof EntityVillager && event.entityLiving instanceof EntityZombie) { + aggressorEntity.setAttackTarget((EntityLivingBase)null); + } + } + + } + + @SubscribeEvent + public void onLivingFall(LivingFallEvent event) { + if(event.entityLiving instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)event.entityLiving; + Infusion.Registry.INSTANCE.get(player).onFalling(player.worldObj, player, event); + } + + } + + @SubscribeEvent + public void onLivingHurt(LivingHurtEvent event) { + if(event.entityLiving instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)event.entityLiving; + if(event.source.isFireDamage() && event.isCancelable() && !event.isCanceled() && player.getCurrentArmor(2) != null && player.getCurrentArmor(2).getItem() == Witchery.Items.DEATH_ROBE) { + if(!player.isPotionActive(Potion.fireResistance.id)) { + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 0)); + } + + event.setCanceled(true); + } + + if(!event.isCanceled()) { + Infusion.Registry.INSTANCE.get(player).onHurt(player.worldObj, player, event); + } + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionInfernal.java b/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionInfernal.java index b696631..db8cf22 100644 --- a/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionInfernal.java +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionInfernal.java @@ -52,12 +52,13 @@ public void onLeftClickEntity(ItemStack itemstack, World world, EntityPlayer pla if(player.isSneaking()) { if(PotionEnslaved.canCreatureBeEnslaved(entityLivingBase)) { EntityLiving r = (EntityLiving)entityLivingBase; - if(PotionEnslaved.isMobEnslavedBy(r, player)) { + if(PotionEnslaved.isMobEnslavedBy(r, player) || (com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_TARGETS.get(r) == player)) { if(this.consumeCharges(world, player, 1, true)) { this.trySacrificeCreature(world, player, r); } } else if(this.consumeCharges(world, player, 5, true)) { PotionEnslaved.setEnslaverForMob(r, player); + com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_TARGETS.put(r, player); EntityUtil.dropAttackTarget((EntityLiving)otherEntity); ParticleEffect.SPELL.send(SoundEffect.MOB_ZOMBIE_INFECT, r, 1.0D, 2.0D, 16); } @@ -74,7 +75,7 @@ public void onLeftClickEntity(ItemStack itemstack, World world, EntityPlayer pla while(i$.hasNext()) { Object obj = i$.next(); EntityLiving nearbyLivingEntity = (EntityLiving)obj; - if(PotionEnslaved.isMobEnslavedBy(nearbyLivingEntity, player)) { + if(PotionEnslaved.isMobEnslavedBy(nearbyLivingEntity, player) || (com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_TARGETS.get(nearbyLivingEntity) == player)) { ++minionCount; nearbyLivingEntity.setAttackTarget(entityLivingBase); if(nearbyLivingEntity instanceof EntityGhast) { @@ -176,7 +177,7 @@ public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer Object obj = currentCharges.next(); EntityLiving creature = (EntityLiving)obj; EntityCreature creature2 = creature instanceof EntityCreature?(EntityCreature)creature:null; - if(PotionEnslaved.isMobEnslavedBy(creature, player)) { + if(PotionEnslaved.isMobEnslavedBy(creature, player) || (com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_TARGETS.get(creature) == player)) { ++beastPowerID; creature.setAttackTarget((EntityLivingBase)null); creature.setRevengeTarget((EntityLivingBase)null); diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionOverworld.java b/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionOverworld.java index 8706032..1dae248 100644 --- a/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionOverworld.java +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/InfusionOverworld.java @@ -52,7 +52,7 @@ public void onFalling(World world, EntityPlayer player, LivingFallEvent event) { int blockY = MathHelper.floor_double(player.posY) - 1; int blockZ = MathHelper.floor_double(player.posZ); Block blockID = world.getBlock(blockX, blockY, blockZ); - if(blockID == Blocks.grass || blockID == Blocks.grass || blockID == Blocks.mycelium || blockID == Blocks.gravel || blockID == Blocks.sand || blockID == Blocks.snow) { + if(blockID == Blocks.grass || blockID == Blocks.dirt || blockID == Blocks.mycelium || blockID == Blocks.gravel || blockID == Blocks.sand || blockID == Blocks.snow) { if(player.isSneaking()) { if(this.consumeCharges(world, player, 10, true)) { event.distance = 0.0F; diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/creature/CreaturePowerFrost.java b/src/main/java/com/emoniph/witchery/infusion/infusions/creature/CreaturePowerFrost.java new file mode 100644 index 0000000..9200f1a --- /dev/null +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/creature/CreaturePowerFrost.java @@ -0,0 +1,66 @@ +package com.emoniph.witchery.infusion.infusions.creature; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.infusion.infusions.creature.CreaturePower; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class CreaturePowerFrost extends CreaturePower { + + public CreaturePowerFrost(int powerID, Class creatureType) { + super(powerID, creatureType); + } + + public int activateCost(World world, EntityPlayer player, int elapsedTicks, MovingObjectPosition mop) { + return 2; + } + + public void onActivate(World world, EntityPlayer player, int elapsedTicks, MovingObjectPosition mop) { + if (!world.isRemote) { + // A wave of bitter cold: chill and slow nearby foes. + AxisAlignedBB bounds = player.boundingBox.expand(4.0D, 2.0D, 4.0D); + List targets = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds); + Iterator i$ = targets.iterator(); + while (i$.hasNext()) { + EntityLivingBase target = (EntityLivingBase)i$.next(); + if (target == player) { + continue; + } + target.addPotionEffect(new PotionEffect(Witchery.Potions.CHILLED.id, TimeUtil.secsToTicks(10), 1)); + target.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, TimeUtil.secsToTicks(6), 1)); + } + } + SoundEffect.RANDOM_FIZZ.playAtPlayer(world, player); + } + + public void onUpdate(World world, EntityPlayer player) { + if (!world.isRemote && world.rand.nextInt(4) == 0) { + // Leave a trail of frost in the player's wake. + int x = MathHelper.floor_double(player.posX); + int y = MathHelper.floor_double(player.boundingBox.minY); + int z = MathHelper.floor_double(player.posZ); + if (world.getBlock(x, y, z).getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(world, x, y, z)) { + float temp = world.getBiomeGenForCoords(x, z).getFloatTemperature(x, y, z); + if (temp < 1.6F) { + world.setBlock(x, y, z, Blocks.snow_layer); + } + } + } + } + + public int getChargesPerSacrifice() { + return 5; + } +} diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/creature/CreaturePowerIronGolem.java b/src/main/java/com/emoniph/witchery/infusion/infusions/creature/CreaturePowerIronGolem.java new file mode 100644 index 0000000..ba90345 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/creature/CreaturePowerIronGolem.java @@ -0,0 +1,55 @@ +package com.emoniph.witchery.infusion.infusions.creature; + +import com.emoniph.witchery.infusion.infusions.creature.CreaturePower; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class CreaturePowerIronGolem extends CreaturePower { + + public CreaturePowerIronGolem(int powerID, Class creatureType) { + super(powerID, creatureType); + } + + public int activateCost(World world, EntityPlayer player, int elapsedTicks, MovingObjectPosition mop) { + return 2; + } + + public void onActivate(World world, EntityPlayer player, int elapsedTicks, MovingObjectPosition mop) { + if (!world.isRemote) { + // A golem's mighty blow: launch and bruise everything nearby. + AxisAlignedBB bounds = player.boundingBox.expand(3.0D, 2.0D, 3.0D); + List targets = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds); + Iterator i$ = targets.iterator(); + while (i$.hasNext()) { + EntityLivingBase target = (EntityLivingBase)i$.next(); + if (target == player) { + continue; + } + double dX = target.posX - player.posX; + double dZ = target.posZ - player.posZ; + double len = Math.sqrt(dX * dX + dZ * dZ); + if (len > 0.001D) { + dX /= len; + dZ /= len; + } + target.addVelocity(dX * 2.0D, 0.5D, dZ * 2.0D); + target.velocityChanged = true; + target.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)player), 4.0F); + } + } + ParticleEffect.CLOUD.send(SoundEffect.RANDOM_FIZZ, (Entity)player, 2.0D, 1.0D, 16); + } + + public int getChargesPerSacrifice() { + return 5; + } +} diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/spirit/InfusedSpiritCurseBringerEffect.java b/src/main/java/com/emoniph/witchery/infusion/infusions/spirit/InfusedSpiritCurseBringerEffect.java new file mode 100644 index 0000000..6623ea8 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/spirit/InfusedSpiritCurseBringerEffect.java @@ -0,0 +1,45 @@ +package com.emoniph.witchery.infusion.infusions.spirit; + +import com.emoniph.witchery.infusion.infusions.spirit.InfusedSpiritEffect; +import com.emoniph.witchery.util.TimeUtil; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; + +public class InfusedSpiritCurseBringerEffect extends InfusedSpiritEffect { + + public InfusedSpiritCurseBringerEffect(int id, int spirits, int spectres, int banshees, int poltergeists) { + super(id, "cursebringer", spirits, spectres, banshees, poltergeists); + } + + @Override + public int getCooldownTicks() { + return TimeUtil.secsToTicks(5); + } + + @Override + public double getRadius() { + return 12.0D; + } + + @Override + public boolean doUpdateEffect(TileEntity tile, boolean triggered, ArrayList foundEntities) { + if(triggered) { + Iterator i$ = foundEntities.iterator(); + + while(i$.hasNext()) { + EntityLivingBase entity = (EntityLivingBase)i$.next(); + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, TimeUtil.secsToTicks(10), 1)); + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, TimeUtil.secsToTicks(10), 1)); + entity.addPotionEffect(new PotionEffect(Potion.blindness.id, TimeUtil.secsToTicks(10), 0)); + // Add a bit of wither effect too + entity.addPotionEffect(new PotionEffect(Potion.wither.id, TimeUtil.secsToTicks(5), 0)); + } + } + + return triggered; + } +} diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/spirit/InfusedSpiritEffect.java b/src/main/java/com/emoniph/witchery/infusion/infusions/spirit/InfusedSpiritEffect.java index 46d636f..90b6f6e 100644 --- a/src/main/java/com/emoniph/witchery/infusion/infusions/spirit/InfusedSpiritEffect.java +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/spirit/InfusedSpiritEffect.java @@ -7,6 +7,7 @@ import com.emoniph.witchery.infusion.infusions.spirit.InfusedSpiritScreamerEffect; import com.emoniph.witchery.infusion.infusions.spirit.InfusedSpiritSentinalEffect; import com.emoniph.witchery.infusion.infusions.spirit.InfusedSpiritTwisterEffect; +import com.emoniph.witchery.infusion.infusions.spirit.InfusedSpiritCurseBringerEffect; import com.emoniph.witchery.util.Const; import com.emoniph.witchery.util.ParticleEffect; import com.emoniph.witchery.util.SoundEffect; @@ -27,6 +28,7 @@ public abstract class InfusedSpiritEffect { public static final InfusedSpiritEffect SCREAMER = new InfusedSpiritScreamerEffect(3, 3, 0, 2, 0); public static final InfusedSpiritEffect TWISTER = new InfusedSpiritTwisterEffect(4, 3, 0, 0, 2); public static final InfusedSpiritEffect GHOST_WALKER = new InfusedSpiritGhostWalkerEffect(5, 3, 1, 1, 0); + public static final InfusedSpiritEffect CURSE_BRINGER = new InfusedSpiritCurseBringerEffect(7, 2, 0, 1, 2); public static final InfusedSpiritEffect DEATH = new InfusedSpiritEffect(6, "death", 0, 5, 5, 5, false) { public boolean doUpdateEffect(TileEntity tile, boolean triggered, ArrayList foundEntities) { return true; diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/EffectRegistry.java b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/EffectRegistry.java index 165ca4e..ea11044 100644 --- a/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/EffectRegistry.java +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/EffectRegistry.java @@ -1,938 +1,2217 @@ -package com.emoniph.witchery.infusion.infusions.symbols; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockBrazier; -import com.emoniph.witchery.blocks.BlockWickerBundle; -import com.emoniph.witchery.blocks.BlockWitchDoor; -import com.emoniph.witchery.brewing.EntityBrew; -import com.emoniph.witchery.brewing.WitcheryBrewRegistry; -import com.emoniph.witchery.brewing.potions.PotionEnslaved; -import com.emoniph.witchery.brewing.potions.PotionIllFitting; -import com.emoniph.witchery.dimension.WorldProviderTorment; -import com.emoniph.witchery.entity.EntityDarkMark; -import com.emoniph.witchery.entity.EntityEnt; -import com.emoniph.witchery.entity.EntitySpellEffect; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.infusion.infusions.InfusionLight; -import com.emoniph.witchery.infusion.infusions.InfusionOtherwhere; -import com.emoniph.witchery.infusion.infusions.symbols.StrokeSet; -import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; -import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectProjectile; -import com.emoniph.witchery.item.ItemChalk; -import com.emoniph.witchery.item.ItemLeonardsUrn; -import com.emoniph.witchery.network.PacketPushTarget; -import com.emoniph.witchery.util.BlockProtect; -import com.emoniph.witchery.util.BlockUtil; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.DemonicDamageSource; -import com.emoniph.witchery.util.EntityPosition; -import com.emoniph.witchery.util.EntityUtil; -import com.emoniph.witchery.util.InvUtil; -import com.emoniph.witchery.util.Log; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import com.emoniph.witchery.util.TimeUtil; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.BlockDoor; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.boss.IBossDisplayData; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntityGolem; -import net.minecraft.entity.monster.EntityWitch; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemDoor; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSourceIndirect; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.MovingObjectPosition.MovingObjectType; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraft.world.storage.WorldInfo; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class EffectRegistry { - - private static final EffectRegistry INSTANCE = new EffectRegistry(); - private Hashtable effects = new Hashtable(); - private Hashtable enhanced = new Hashtable(); - private Hashtable effectID = new Hashtable(); - private ArrayList allEffects = new ArrayList(); - public static final SymbolEffect Accio = instance().addEffect((new SymbolEffectProjectile(1, "witchery.pott.accio") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - if(caster != null && mop != null) { - double R = spell.getEffectLevel() == 1?0.8D:(spell.getEffectLevel() == 2?3.0D:9.0D); - double R_SQ = R * R; - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(spell.posX - R, spell.posY - R, spell.posZ - R, spell.posX + R, spell.posY + R, spell.posZ + R); - List entities = world.getEntitiesWithinAABB(EntityItem.class, bb); - Iterator i$ = entities.iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityItem item = (EntityItem)obj; - if(item.getDistanceSqToEntity(spell) <= R_SQ) { - item.setPosition(caster.posX, caster.posY + 1.0D, caster.posZ); - } - } - } - - } - }).setColor(5322534).setSize(1.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)3, (byte)0, (byte)2, (byte)2, (byte)1}), new StrokeSet(1, new byte[]{(byte)3, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1}), new StrokeSet(2, new byte[]{(byte)3, (byte)0, (byte)0, (byte)2, (byte)2, (byte)1, (byte)1}), new StrokeSet(2, new byte[]{(byte)3, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1, (byte)1}), new StrokeSet(3, new byte[]{(byte)3, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1, (byte)1, (byte)1}), new StrokeSet(3, new byte[]{(byte)3, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2, (byte)2, (byte)1, (byte)1, (byte)1})}); - public static final SymbolEffect Aguamenti = instance().addEffect((new SymbolEffectProjectile(2, "witchery.pott.aguamenti") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - int dy; - int dz; - int x; - if((spell.getEffectLevel() != 1 || world.provider.isHellWorld) && (!world.provider.isHellWorld || spell.getEffectLevel() != 3)) { - if(!world.provider.isHellWorld) { - int dx1; - if(mop.typeOfHit == MovingObjectType.ENTITY) { - dx1 = MathHelper.floor_double(mop.entityHit.posX); - dy = MathHelper.floor_double(mop.entityHit.posY); - dz = MathHelper.floor_double(mop.entityHit.posZ); - this.setBlock(caster, world, dx1, dy, dz, Blocks.flowing_water); - this.setIfAir(caster, world, dx1, dy + 1, dz, Blocks.flowing_water); - this.setIfAir(caster, world, dx1 + 1, dy, dz, Blocks.flowing_water); - this.setIfAir(caster, world, dx1 - 1, dy, dz, Blocks.flowing_water); - this.setIfAir(caster, world, dx1, dy, dz + 1, Blocks.flowing_water); - this.setIfAir(caster, world, dx1, dy, dz - 1, Blocks.flowing_water); - this.setIfAir(caster, world, dx1, dy - 1, dz, Blocks.flowing_water); - } else { - dx1 = mop.sideHit == 5?1:(mop.sideHit == 4?-1:0); - dy = mop.sideHit == 0?-1:(mop.sideHit == 1?1:0); - dz = mop.sideHit == 3?1:(mop.sideHit == 2?-1:0); - x = mop.blockX + dx1; - int y = mop.blockY + dy + (!world.getBlock(mop.blockX, mop.blockY, mop.blockZ).getMaterial().isSolid() && mop.sideHit == 1?-1:0); - int z = mop.blockZ + dz; - this.setBlock(caster, world, x, y, z, Blocks.flowing_water); - this.setIfAir(caster, world, x, y + 1, z, Blocks.flowing_water); - this.setIfAir(caster, world, x + 1, y, z, Blocks.flowing_water); - this.setIfAir(caster, world, x - 1, y, z, Blocks.flowing_water); - this.setIfAir(caster, world, x, y, z + 1, Blocks.flowing_water); - this.setIfAir(caster, world, x, y, z - 1, Blocks.flowing_water); - this.setIfAir(caster, world, x, y - 1, z, Blocks.flowing_water); - } - } - } else if(mop.typeOfHit == MovingObjectType.ENTITY) { - this.setBlock(caster, world, MathHelper.floor_double(mop.entityHit.posX), MathHelper.floor_double(mop.entityHit.posY), MathHelper.floor_double(mop.entityHit.posZ), Blocks.flowing_water); - } else if(mop.typeOfHit == MovingObjectType.BLOCK) { - Block dx = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); - if(dx == Witchery.Blocks.CAULDRON) { - if(Witchery.Blocks.CAULDRON.tryFillWith(world, mop.blockX, mop.blockY, mop.blockZ, new FluidStack(FluidRegistry.WATER, 3000))) { - ; - } - } else if(dx == Witchery.Blocks.KETTLE) { - if(Witchery.Blocks.KETTLE.tryFillWith(world, mop.blockX, mop.blockY, mop.blockZ, new FluidStack(FluidRegistry.WATER, 1000))) { - ; - } - } else { - dy = mop.sideHit == 5?1:(mop.sideHit == 4?-1:0); - dz = mop.sideHit == 0?-1:(mop.sideHit == 1?1:0); - x = mop.sideHit == 3?1:(mop.sideHit == 2?-1:0); - this.setBlock(caster, world, mop.blockX + dy, mop.blockY + dz + (!world.getBlock(mop.blockX, mop.blockY, mop.blockZ).getMaterial().isSolid() && mop.sideHit == 1?-1:0), mop.blockZ + x, Blocks.flowing_water); - } - } - - } - private void setBlock(EntityLivingBase caster, World world, int x, int y, int z, Block block) { - if(BlockProtect.checkModsForBreakOK(world, x, y, z, caster)) { - world.setBlock(x, y, z, block); - } - - } - private void setIfAir(EntityLivingBase caster, World world, int x, int y, int z, Block block) { - if(world.isAirBlock(x, y, z)) { - this.setBlock(caster, world, x, y, z, block); - } - - } - }).setColor(1176575).setSize(2.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)2, (byte)2, (byte)1}), new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1}), new StrokeSet(2, new byte[]{(byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)1, (byte)1}), new StrokeSet(2, new byte[]{(byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1, (byte)1}), new StrokeSet(3, new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)1, (byte)1, (byte)1}), new StrokeSet(3, new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1, (byte)1, (byte)1})}); - public static final SymbolEffect Alohomora = instance().addEffect((new SymbolEffectProjectile(3, "witchery.pott.alohomora") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop.typeOfHit == MovingObjectType.BLOCK) { - Block blockID = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); - if(blockID != Witchery.Blocks.DOOR_ALDER && blockID != Witchery.Blocks.DOOR_ROWAN) { - if(blockID instanceof BlockDoor) { - ((BlockDoor)blockID).func_150014_a(world, mop.blockX, mop.blockY, mop.blockZ, !((BlockDoor)blockID).func_150015_f(world, mop.blockX, mop.blockY, mop.blockZ)); - } - } else { - ((BlockWitchDoor)blockID).onBlockActivatedNormally(world, mop.blockX, mop.blockY, mop.blockZ, (EntityPlayer)null, 1, (float)mop.blockX, (float)mop.blockY, (float)mop.blockZ); - } - } - - } - }).setColor(5322534).setSize(0.5F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)2, (byte)0, (byte)2, (byte)2, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)0, (byte)0, (byte)2, (byte)2, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2, (byte)1, (byte)1})}); - public static final SymbolEffect AvadaKedavra = instance().addEffect((new SymbolEffectProjectile(4, "witchery.pott.avadakedavra", 101, true, false, (String)null, 0, false) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop != null && caster != null && mop.typeOfHit == MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { - if(mop.entityHit instanceof EntityPlayer) { - if(world.isRemote || !(caster instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled()) { - EntityPlayer hitCreature = (EntityPlayer)mop.entityHit; - EntityUtil.instantDeath(hitCreature, caster); - } - } else if(mop.entityHit instanceof EntityLiving) { - EntityLiving hitCreature1 = (EntityLiving)mop.entityHit; - if(caster instanceof EntityPlayer && ((EntityPlayer)caster).capabilities.isCreativeMode) { - EntityUtil.instantDeath(hitCreature1, caster); - } else if((PotionEnslaved.canCreatureBeEnslaved(hitCreature1) || hitCreature1 instanceof EntityWitch || hitCreature1 instanceof EntityEnt || hitCreature1 instanceof EntityGolem) && hitCreature1.getMaxHealth() <= 200.0F) { - hitCreature1.attackEntityFrom(DamageSource.causeIndirectMagicDamage(effectEntity, caster), 200.0F); - } else { - hitCreature1.attackEntityFrom(DamageSource.causeIndirectMagicDamage(effectEntity, caster), 25.0F); - } - } - } - - } - }).setColor('\uff00').setSize(2.0F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)2, (byte)2, (byte)0, (byte)0, (byte)3, (byte)3, (byte)3, (byte)3, (byte)1, (byte)1, (byte)2})}); - public static final SymbolEffect CaveInimicum = instance().addEffect((new SymbolEffectProjectile(5, "witchery.pott.caveinimicum") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop.typeOfHit == MovingObjectType.BLOCK) { - EffectRegistry.applyBlockEffect(world, caster, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, effectEntity.getEffectLevel(), new EffectRegistry.IBlockEffect() { - public void doAction(World world, EntityLivingBase actor, int x, int y, int z, Block block, int meta) { - Block newBlockID = Blocks.air; - if(block == Blocks.dirt) { - newBlockID = Blocks.stone; - } else if(block == Blocks.grass) { - newBlockID = Blocks.stone; - } else if(block == Blocks.mycelium) { - newBlockID = Blocks.stone; - } else if(block == Blocks.cobblestone) { - newBlockID = Blocks.stone; - } else if(block == Blocks.planks) { - newBlockID = Blocks.stone; - } else if(block == Witchery.Blocks.PLANKS) { - newBlockID = Blocks.stone; - } else if(block == Blocks.stonebrick) { - newBlockID = Blocks.brick_block; - } else if(block == Blocks.sand) { - newBlockID = Blocks.sandstone; - } else if(block == Blocks.clay) { - newBlockID = Blocks.hardened_clay; - } else if(block == Blocks.wooden_door) { - int i1 = ((BlockDoor)block).func_150012_g(world, x, y, z); - if((i1 & 8) != 0) { - --y; - } - - world.setBlockToAir(x, y, z); - world.setBlockToAir(x, y + 1, z); - int pp1 = MathHelper.floor_double((double)((actor.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; - ItemDoor.placeDoorBlock(world, x, y, z, pp1, Blocks.iron_door); - } - - if(newBlockID != Blocks.air) { - world.setBlock(x, y, z, newBlockID); - } - - } - }); - } - - } - }).setColor(3158064).setSize(3.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)0, (byte)3, (byte)0, (byte)0, (byte)2}), new StrokeSet(1, new byte[]{(byte)0, (byte)3, (byte)0, (byte)0, (byte)0, (byte)2}), new StrokeSet(1, new byte[]{(byte)0, (byte)3, (byte)3, (byte)0, (byte)0, (byte)2, (byte)2}), new StrokeSet(2, new byte[]{(byte)0, (byte)3, (byte)3, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2}), new StrokeSet(3, new byte[]{(byte)0, (byte)3, (byte)3, (byte)3, (byte)0, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2})}); - public static final SymbolEffect Colloportus = instance().addEffect((new SymbolEffectProjectile(6, "witchery.pott.colloportus") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop.typeOfHit == MovingObjectType.BLOCK && caster != null) { - int y = mop.blockY; - Block blockID = world.getBlock(mop.blockX, y, mop.blockZ); - if(blockID instanceof BlockDoor) { - int i1 = ((BlockDoor)blockID).func_150012_g(world, mop.blockX, y, mop.blockZ); - if((i1 & 8) != 0) { - --y; - } - - world.setBlockToAir(mop.blockX, y, mop.blockZ); - world.setBlockToAir(mop.blockX, y + 1, mop.blockZ); - int pp1 = MathHelper.floor_double((double)((caster.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; - ItemDoor.placeDoorBlock(world, mop.blockX, y, mop.blockZ, pp1, Witchery.Blocks.DOOR_ROWAN); - } - } - - } - }).setColor(5322534).setSize(1.0F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)1, (byte)1, (byte)2}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)1, (byte)1, (byte)1, (byte)2}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)3, (byte)1, (byte)1, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)3, (byte)1, (byte)1, (byte)2, (byte)1, (byte)2})}); - public static final SymbolEffect Confundus = instance().addEffect((new SymbolEffectProjectile(8, "witchery.pott.confundus") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - double radius = spell.getEffectLevel() == 1?0.0D:(spell.getEffectLevel() == 2?2.0D:4.0D); - EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, (IEntityEffect)new EffectRegistry.IEntityEffect() { - public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { - if(target instanceof EntityLivingBase && !target.isPotionActive(Potion.confusion)) { - target.addPotionEffect(new PotionEffect(Potion.confusion.id, 600)); - } - - } - }); - } - }).setColor(16771328).setSize(1.5F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)3, (byte)3, (byte)0, (byte)0, (byte)2}), new StrokeSet(1, new byte[]{(byte)3, (byte)3, (byte)3, (byte)0, (byte)0, (byte)2, (byte)2}), new StrokeSet(2, new byte[]{(byte)3, (byte)3, (byte)3, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2}), new StrokeSet(3, new byte[]{(byte)3, (byte)3, (byte)3, (byte)3, (byte)0, (byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)2})}); - public static final SymbolEffect Crucio = instance().addEffect((new SymbolEffectProjectile(9, "witchery.pott.crucio", 5, true, false, (String)null, 0) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - if(mop != null && caster != null && mop.typeOfHit == MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { - if(mop.entityHit instanceof EntityPlayer) { - if(world.isRemote || !(caster instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled()) { - EntityPlayer hitCreature = (EntityPlayer)mop.entityHit; - hitCreature.attackEntityFrom(DamageSource.causeIndirectMagicDamage(spell, caster), (float)(4 + 4 * (spell.getEffectLevel() - 1))); - } - } else if(mop.entityHit instanceof EntityLiving) { - EntityLiving hitCreature1 = (EntityLiving)mop.entityHit; - hitCreature1.attackEntityFrom(DamageSource.causeIndirectMagicDamage(spell, caster), 4.0F); - } - } - - } - }).setColor(6684927).setSize(2.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)1, (byte)3, (byte)1, (byte)1, (byte)2}), new StrokeSet(1, new byte[]{(byte)1, (byte)3, (byte)3, (byte)1, (byte)1, (byte)2, (byte)2}), new StrokeSet(2, new byte[]{(byte)1, (byte)3, (byte)1, (byte)1, (byte)1, (byte)2}), new StrokeSet(2, new byte[]{(byte)1, (byte)3, (byte)3, (byte)1, (byte)1, (byte)1, (byte)2, (byte)2}), new StrokeSet(3, new byte[]{(byte)1, (byte)3, (byte)3, (byte)3, (byte)1, (byte)1, (byte)1, (byte)1, (byte)2, (byte)2, (byte)2})}); - public static final SymbolEffect Defodio = instance().addEffect((new SymbolEffectProjectile(10, "witchery.pott.defodio", 3, false, false, (String)null, 0) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop.typeOfHit == MovingObjectType.BLOCK) { - EffectRegistry.applyBlockEffect(world, caster, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, effectEntity.getEffectLevel(), new EffectRegistry.IBlockEffect() { - public void doAction(World world, EntityLivingBase actor, int x, int y, int z, Block block, int meta) { - Material material = block.getMaterial(); - if(material == Material.clay || material == Material.craftedSnow || material == Material.ground || material == Material.grass || material == Material.ice || material == Material.rock || material == Material.sand) { - world.setBlockToAir(x, y, z); - Item itemBlock = null; - byte itemDamageValue = -1; - - try { - itemBlock = block.getItemDropped(meta, world.rand, 0); - int itemDamageValue1 = block.damageDropped(meta); - int ex = block.quantityDropped(meta, 0, world.rand); - if(itemBlock != null && itemDamageValue1 >= 0 && ex > 0) { - world.spawnEntityInWorld(new EntityItem(world, 0.5D + (double)x, 0.5D + (double)y, 0.5D + (double)z, new ItemStack(itemBlock, ex, itemDamageValue1))); - } - } catch (Throwable var12) { - Log.instance().warning(var12, "Exception occured while spawning block as part of Defodio effect: new (" + itemBlock + ", " + itemDamageValue + ") old (" + block + ", " + meta + ")"); - } - } - - } - }); - } - - } - }).setColor(4008220).setSize(2.5F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)3, (byte)1}), new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)0, (byte)3, (byte)1, (byte)1}), new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)3, (byte)3, (byte)1, (byte)2}), new StrokeSet(2, new byte[]{(byte)0, (byte)0, (byte)0, (byte)3, (byte)3, (byte)1, (byte)1, (byte)2}), new StrokeSet(2, new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)3, (byte)3, (byte)1, (byte)1, (byte)1, (byte)2}), new StrokeSet(2, new byte[]{(byte)0, (byte)0, (byte)0, (byte)3, (byte)3, (byte)3, (byte)1, (byte)1, (byte)2, (byte)2}), new StrokeSet(3, new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)3, (byte)3, (byte)3, (byte)1, (byte)1, (byte)1, (byte)2, (byte)2})}); - public static final SymbolEffect Ennervate = instance().addEffect((new SymbolEffectProjectile(12, "witchery.pott.ennervate", 1, false, true, (String)null, 0) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - double radius = spell.getEffectLevel() == 1?0.0D:(spell.getEffectLevel() == 2?2.0D:4.0D); - EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, (IEntityEffect)new IEntityEffect() { - public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { - if(target.isPotionActive(Potion.moveSlowdown)) { - target.removePotionEffect(Potion.moveSlowdown.id); - } - - if(target.isPotionActive(Potion.digSlowdown)) { - target.removePotionEffect(Potion.digSlowdown.id); - } - - if(target.isPotionActive(Potion.confusion)) { - target.removePotionEffect(Potion.confusion.id); - } - - } - }); - } - }).setColor(16713595).setSize(1.5F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)0, (byte)3, (byte)0, (byte)2, (byte)3, (byte)0, (byte)2}), new StrokeSet(2, new byte[]{(byte)0, (byte)3, (byte)3, (byte)0, (byte)2, (byte)2, (byte)3, (byte)3, (byte)0, (byte)2, (byte)2}), new StrokeSet(3, new byte[]{(byte)0, (byte)3, (byte)3, (byte)3, (byte)0, (byte)2, (byte)2, (byte)2, (byte)3, (byte)3, (byte)3, (byte)0, (byte)2, (byte)2, (byte)2})}); - public static final SymbolEffect Episkey = instance().addEffect(new SymbolEffect(13, "witchery.pott.episkey", 1, false, false, (String)null, 0) { - public void perform(World world, EntityPlayer player, int effectLevel) { - double radius = effectLevel == 1?0.0D:(effectLevel == 2?2.0D:4.0D); - MovingObjectPosition mop = new MovingObjectPosition(player); - EffectRegistry.applyEntityEffect(world, player, mop, player.posX, player.posY, player.posZ, radius, EntityLivingBase.class, (IEntityEffect)new IEntityEffect() { - public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { - boolean hasFood = target instanceof EntityPlayer; - int currentFood = hasFood?((EntityPlayer)target).getFoodStats().getFoodLevel():5; - if(currentFood > 1 && target.getHealth() < target.getMaxHealth()) { - target.heal((float)Math.min(5, currentFood)); - if(hasFood) { - ((EntityPlayer)target).getFoodStats().addStats(-Math.min(5, currentFood), 0.0F); - } - - if(!target.isPotionActive(Potion.confusion)) { - target.addPotionEffect(new PotionEffect(Potion.confusion.id, TimeUtil.secsToTicks(4))); - } - - ParticleEffect.SPLASH.send(SoundEffect.MOB_SLIME_SMALL, target, 1.0D, 1.0D, 16); - } - - } - }); - } - }, new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)2, (byte)0, (byte)3, (byte)1, (byte)1, (byte)2}), new StrokeSet(2, new byte[]{(byte)2, (byte)0, (byte)0, (byte)3, (byte)1, (byte)1, (byte)1, (byte)1, (byte)2}), new StrokeSet(2, new byte[]{(byte)2, (byte)2, (byte)0, (byte)3, (byte)3, (byte)1, (byte)1, (byte)2, (byte)2}), new StrokeSet(3, new byte[]{(byte)2, (byte)2, (byte)0, (byte)0, (byte)3, (byte)3, (byte)1, (byte)1, (byte)1, (byte)1, (byte)2, (byte)2})}); - public static final SymbolEffect Expelliarmus = instance().addEffect((new SymbolEffectProjectile(15, "witchery.pott.expelliarmus") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - double radius = spell.getEffectLevel() == 1?0.0D:(spell.getEffectLevel() == 2?3.0D:5.0D); - EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, (IEntityEffect)new IEntityEffect() { - public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { - if(actor != target) { - disarm(target); - } - - } - }); - } - private void disarm(EntityLivingBase target) { - if(target instanceof EntityPlayer) { - EntityPlayer heldItem = (EntityPlayer)target; - if(heldItem.openContainer == null || heldItem.openContainer.windowId == 0) { - int heldItemIndex = heldItem.inventory.currentItem; - if(heldItem.inventory.mainInventory[heldItemIndex] != null) { - heldItem.dropPlayerItemWithRandomChoice(heldItem.inventory.mainInventory[heldItemIndex], true); - heldItem.inventory.mainInventory[heldItemIndex] = null; - } - } - } else if(!PotionIllFitting.isTargetBanned(target)) { - ItemStack heldItem1 = target.getHeldItem(); - if(heldItem1 != null) { - if(target instanceof EntityPlayer) { - Infusion.dropEntityItemWithRandomChoice(target, heldItem1, true); - } else { - target.entityDropItem(heldItem1, 0.5F); - } - - target.setCurrentItemOrArmor(0, (ItemStack)null); - } - } - - } - }).setColor(16747778).setSize(3.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)1}), new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)0, (byte)1, (byte)1}), new StrokeSet(2, new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1}), new StrokeSet(3, new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1})}); - public static final SymbolEffect Flagrate = instance().addEffect(new SymbolEffect(16, "witchery.pott.flagrate", 1, false, false, (String)null, 0, false) { - public void perform(World world, EntityPlayer player, int effectLevel) { - MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0D); - if(mop != null) { - if(mop.typeOfHit == MovingObjectType.BLOCK) { - ItemChalk.drawGlyph(world, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, Witchery.Blocks.GLYPH_INFERNAL, player); - } else { - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - } else { - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)2, (byte)0, (byte)2, (byte)3, (byte)0, (byte)2})}); - public static final SymbolEffect Flipendo = instance().addEffect((new SymbolEffectProjectile(17, "witchery.pott.flipendo") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - final double radius = spell.getEffectLevel() == 1?0.0D:(spell.getEffectLevel() == 2?3.0D:6.0D); - final double spellX = spell.motionX; - final double spellZ = spell.motionZ; - EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, (IEntityEffect)new IEntityEffect() { - public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { - if(radius == 3.0D || target != actor) { - double ACCELERATION = 2.0D; - if(target.isPotionActive(Potion.moveSlowdown)) { - ACCELERATION += 0.5D; - } - - double motionX = spellX * ACCELERATION; - double motionY = 0.3D; - double motionZ = spellZ * ACCELERATION; - if(target instanceof EntityPlayer) { - EntityPlayer targetPlayer = (EntityPlayer)target; - Witchery.packetPipeline.sendTo((IMessage)(new PacketPushTarget(motionX, 0.3D, motionZ)), targetPlayer); - } else { - target.motionX = motionX; - target.motionY = 0.3D; - target.motionZ = motionZ; - } - } - - } - }); - } - }).setColor(16775577).setSize(3.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)2, (byte)2, (byte)3}), new StrokeSet(1, new byte[]{(byte)2, (byte)2, (byte)2, (byte)3, (byte)3}), new StrokeSet(2, new byte[]{(byte)2, (byte)2, (byte)2, (byte)2, (byte)3, (byte)3, (byte)3}), new StrokeSet(3, new byte[]{(byte)2, (byte)2, (byte)2, (byte)2, (byte)2, (byte)3, (byte)3, (byte)3, (byte)3})}); - public static final SymbolEffect Impedimenta = instance().addEffect((new SymbolEffectProjectile(19, "witchery.pott.impedimenta") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - double radius = spell.getEffectLevel() == 1?0.0D:(spell.getEffectLevel() == 2?3.0D:6.0D); - double spellX = spell.motionX; - double spellZ = spell.motionZ; - EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, (IEntityEffect)new IEntityEffect() { - public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { - if(target != actor && !target.isPotionActive(Potion.moveSlowdown)) { - target.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 600, 1)); - } - - } - }); - } - }).setColor(6191615).setSize(1.5F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)3, (byte)3, (byte)2}), new StrokeSet(1, new byte[]{(byte)3, (byte)3, (byte)3, (byte)2, (byte)2}), new StrokeSet(2, new byte[]{(byte)3, (byte)3, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2}), new StrokeSet(3, new byte[]{(byte)3, (byte)3, (byte)3, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2, (byte)2})}); - public static final SymbolEffect Imperio = instance().addEffect((new SymbolEffectProjectile(20, "witchery.pott.imperio", 10, true, false, (String)null, 0) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop != null && caster != null && caster instanceof EntityPlayer && mop.typeOfHit == MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { - EntityLivingBase entityLiving = (EntityLivingBase)mop.entityHit; - if(PotionEnslaved.canCreatureBeEnslaved(entityLiving)) { - EntityPlayer player = (EntityPlayer)caster; - EntityLiving creature = (EntityLiving)entityLiving; - NBTTagCompound nbt = entityLiving.getEntityData(); - if(PotionEnslaved.setEnslaverForMob(creature, player)) { - ParticleEffect.SPELL.send(SoundEffect.MOB_ZOMBIE_INFECT, creature, 1.0D, 2.0D, 8); - } - } - } - - } - }).setColor(10686463).setSize(1.5F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)2, (byte)1, (byte)1, (byte)1, (byte)1})}); - public static final SymbolEffect Incendio = instance().addEffect((new SymbolEffectProjectile(21, "witchery.pott.incendio") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - double radius = spell.getEffectLevel() == 1?0.0D:(spell.getEffectLevel() == 2?3.0D:6.0D); - final int level = spell.getEffectLevel(); - if(radius == 0.0D) { - if(mop.typeOfHit == MovingObjectType.ENTITY) { - mop.entityHit.setFire(1); - mop.entityHit.attackEntityFrom((new EntityDamageSourceIndirect("onFire", spell, caster)).setFireDamage(), 0.1F); - } else if(mop.typeOfHit == MovingObjectType.BLOCK) { - Block side = BlockUtil.getBlock(world, mop); - if(side == Witchery.Blocks.WICKER_BUNDLE && BlockWickerBundle.limitToValidMetadata(world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ)) == 1) { - if(BlockWickerBundle.tryIgniteMan(world, mop.blockX, mop.blockY, mop.blockZ, caster != null?caster.rotationYaw:0.0F)) { - return; - } - } else if(side == Witchery.Blocks.BRAZIER) { - BlockBrazier.tryIgnite(world, mop.blockX, mop.blockY, mop.blockZ); - return; - } - - int dx = mop.sideHit == 5?1:(mop.sideHit == 4?-1:0); - int dy = mop.sideHit == 0?-1:(mop.sideHit == 1?1:0); - int dz = mop.sideHit == 3?1:(mop.sideHit == 2?-1:0); - world.setBlock(mop.blockX + dx, mop.blockY + dy + (!world.getBlock(mop.blockX, mop.blockY, mop.blockZ).getMaterial().isSolid() && mop.sideHit == 1?-1:0), mop.blockZ + dz, Blocks.fire); - } - } else { - EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, (IEntityEffect)new IEntityEffect() { - public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { - if(target != actor) { - target.setFire(level); - } - - } - }); - if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK) { - final int side1 = mop.sideHit; - EffectRegistry.applyBlockEffect(world, caster, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, level, new EffectRegistry.IBlockEffect() { - public void doAction(World world, EntityLivingBase actor, int x, int y, int z, Block block, int meta) { - if(side1 == 1) { - int dx = side1 == 5?1:(side1 == 4?-1:0); - int dy = side1 == 0?-1:(side1 == 1?1:0); - int dz = side1 == 3?1:(side1 == 2?-1:0); - int nX = x + dx; - int nY = y + dy; - int nZ = z + dz; - if(world.isAirBlock(nX, nY, nZ)) { - world.setBlock(nX, nY, nZ, Blocks.fire); - } - } - - } - }); - } - } - - } - }).setColor(16724023).setSize(2.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)3, (byte)0, (byte)0, (byte)1, (byte)1}), new StrokeSet(2, new byte[]{(byte)3, (byte)0, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1}), new StrokeSet(3, new byte[]{(byte)3, (byte)0, (byte)0, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1})}); - public static final SymbolEffect Lumos = instance().addEffect((new SymbolEffectProjectile(22, "witchery.pott.lumos") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop.typeOfHit == MovingObjectType.BLOCK) { - int dx = mop.sideHit == 5?1:(mop.sideHit == 4?-1:0); - int dy = mop.sideHit == 0?-1:(mop.sideHit == 1?1:0); - int dz = mop.sideHit == 3?1:(mop.sideHit == 2?-1:0); - int x = mop.blockX + 1 * dx; - int y = mop.blockY + 1 * dy; - int z = mop.blockZ + 1 * dz; - Material material = world.getBlock(x, y, z).getMaterial(); - if(material == Material.air || material == Material.snow) { - world.setBlock(x, y, z, Witchery.Blocks.GLOW_GLOBE); - } - } - - } - }).setColor(16777018).setSize(0.5F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)1, (byte)2})}); - public static final SymbolEffect MeteolojinxRecanto = instance().addEffect(new SymbolEffect(23, "witchery.pott.meteolojinxrecanto", 100, false, false, (String)null, 0) { - public void perform(World world, EntityPlayer player, int effectLevel) { - InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0D); - if(world.isRaining()) { - WorldServer worldserver = MinecraftServer.getServer().worldServers[0]; - if(worldserver != null) { - WorldInfo worldinfo = worldserver.getWorldInfo(); - worldinfo.setRaining(false); - worldinfo.setThundering(false); - } - } else { - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)1, (byte)0, (byte)2, (byte)2, (byte)1, (byte)1})}); - public static final SymbolEffect Nox = instance().addEffect(new SymbolEffect(26, "witchery.pott.nox", 50, false, false, (String)null, 0) { - public void perform(World world, EntityPlayer player, int effectLevel) { - int x0 = MathHelper.floor_double(player.posX); - int y0 = MathHelper.floor_double(player.posY); - int z0 = MathHelper.floor_double(player.posZ); - byte radius = 10; - - for(int y = y0 - radius; y <= y0 + radius; ++y) { - for(int x = x0 - radius; x <= x0 + radius; ++x) { - for(int z = z0 - radius; z <= z0 + radius; ++z) { - Block blockID = world.getBlock(x, y, z); - if((double)blockID.getLightValue(world, x, y, z) > 0.8D && BlockProtect.canBreak(blockID, world)) { - int blockMeta = world.getBlockMetadata(x, y, z); - if(BlockProtect.checkModsForBreakOK(world, x, y, z, blockID, blockMeta, player)) { - world.setBlockToAir(x, y, z); - if(blockID.quantityDropped(world.rand) > 0) { - blockID.dropBlockAsItem(world, x, y, z, blockMeta, 0); - } - } - } - } - } - } - - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)2, (byte)1, (byte)2, (byte)0})}); - public static final SymbolEffect Protego = instance().addEffect(new SymbolEffect(31, "witchery.pott.protego") { - public void perform(World world, EntityPlayer player, int effectLevel) { - MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0D); - if(mop != null) { - if(mop.typeOfHit == MovingObjectType.BLOCK) { - InfusionLight.placeBarrierShield(world, player, mop); - } else { - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - } else { - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)0}), new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)1, (byte)0, (byte)0}), new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)1, (byte)1, (byte)0, (byte)0, (byte)0})}); - public static final SymbolEffect Stupefy = instance().addEffect((new SymbolEffectProjectile(36, "witchery.pott.stupefy", 5, false, true, (String)null, 0) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(mop != null && mop.typeOfHit == MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { - EntityLivingBase entityLiving = (EntityLivingBase)mop.entityHit; - if(!entityLiving.isPotionActive(Potion.moveSlowdown)) { - entityLiving.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 6000, 9)); - } - } - - } - }).setColor(1279).setSize(1.5F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)2, (byte)2, (byte)0, (byte)3, (byte)0, (byte)2}), new StrokeSet(1, new byte[]{(byte)2, (byte)2, (byte)2, (byte)0, (byte)3, (byte)3, (byte)0, (byte)2, (byte)2}), new StrokeSet(2, new byte[]{(byte)2, (byte)2, (byte)0, (byte)0, (byte)3, (byte)0, (byte)0, (byte)2}), new StrokeSet(2, new byte[]{(byte)2, (byte)2, (byte)2, (byte)0, (byte)0, (byte)3, (byte)3, (byte)0, (byte)0, (byte)2, (byte)2})}); - public static final SymbolEffect Ignianima = instance().addEffect((new SymbolEffectProjectile(39, "witchery.pott.ignianima", 2, true, false, "ignianima", 0) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect e) { - double R = 1.5D; - double R_SQ = 2.25D; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(e.posX - 1.5D, e.posY - 1.5D, e.posZ - 1.5D, e.posX + 1.5D, e.posY + 1.5D, e.posZ + 1.5D); - List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds); - Iterator i$ = entities.iterator(); - - while(i$.hasNext()) { - Object hit = i$.next(); - EntityLivingBase hitEntity = (EntityLivingBase)hit; - if(e.getDistanceSqToEntity(hitEntity) <= 2.25D) { - float damage = 4.0F; - float scale = hitEntity instanceof EntityPlayer?hitEntity.getMaxHealth() / 20.0F:1.0F; - float scaledDamage; - if(caster != null) { - scaledDamage = 20.0F * (caster.getHealth() / caster.getMaxHealth()); - if(scaledDamage > 19.0F) { - damage = 2.0F; - } else if(scaledDamage > 15.0F) { - damage = 3.0F; - } else if(scaledDamage > 10.0F) { - damage = 5.0F; - } else { - damage = 6.0F + (12.0F - scaledDamage) / 2.0F; - } - } - - scaledDamage = damage * scale; - hitEntity.attackEntityFrom(new DemonicDamageSource(caster), scaledDamage); - ParticleEffect.FLAME.send(SoundEffect.FIRE_IGNITE, hitEntity, 1.0D, 2.0D, 16); - } - } - - } - }).setColor(16770912).setSize(3.0F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)0, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)3, (byte)0, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)3, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)3, (byte)3, (byte)0, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)3, (byte)3, (byte)3, (byte)3, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1})}); - public static final SymbolEffect CarnosaDiem = instance().addEffect(new SymbolEffect(40, "witchery.pott.carnosadiem", 1, true, false, "carnosadiem", 0) { - public void perform(World world, EntityPlayer player, int effectLevel) { - float damage = player.getMaxHealth() * 0.1F; - player.attackEntityFrom(new DemonicDamageSource(player), damage); - ParticleEffect.REDDUST.send(SoundEffect.MOB_ENDERDRAGON_GROWL, player, 1.0D, 2.0D, 16); - int currentPower = Infusion.getCurrentEnergy(player); - int maxPower = Infusion.getMaxEnergy(player); - Infusion.setCurrentEnergy(player, Math.min(currentPower + 10, maxPower)); - Witchery.modHooks.boostBloodPowers(player, damage); - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)2, (byte)2, (byte)0, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)2, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)2, (byte)2, (byte)0, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)2, (byte)2, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)2, (byte)2, (byte)2, (byte)0, (byte)1, (byte)1}), new StrokeSet(new byte[]{(byte)2, (byte)2, (byte)2, (byte)2, (byte)0, (byte)0, (byte)1, (byte)1, (byte)1, (byte)1})}); - public static final SymbolEffect MORSMORDRE = instance().addEffect((new SymbolEffectProjectile(41, "witchery.pott.morsmordre", 20, true, false, "morsmordre", 0) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { - if(!world.isRemote) { - EntityDarkMark entity = new EntityDarkMark(world); - entity.setLocationAndAngles(effectEntity.posX, effectEntity.posY, effectEntity.posZ, 0.0F, 0.0F); - entity.func_110163_bv(); - world.spawnEntityInWorld(entity); - } - - } - }).setColor(0).setSize(3.0F).setTimeToLive(8), new StrokeSet[]{new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)3, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)0, (byte)3, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)0, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)3, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)0, (byte)0, (byte)0, (byte)0, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2, (byte)2})}); - public static final SymbolEffect Tormentum = instance().addEffect((new SymbolEffectProjectile(42, "witchery.pott.tormentum", 25, true, true, "tormentum", TimeUtil.minsToTicks(30)) { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect e) { - if(!world.isRemote && e.dimension != Config.instance().dimensionTormentID) { - double R = 2.0D; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(e.posX - 2.0D, e.posY - 2.0D, e.posZ - 2.0D, e.posX + 2.0D, e.posY + 2.0D, e.posZ + 2.0D); - List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds); - boolean setCooldown = false; - Iterator i$ = entities.iterator(); - - while(i$.hasNext()) { - Object hitEntity = i$.next(); - if(hitEntity instanceof EntityPlayer) { - EntityPlayer hitLiving = (EntityPlayer)hitEntity; - WorldProviderTorment.setPlayerMustTorment(hitLiving, 1, -1); - setCooldown = true; - } else if(hitEntity instanceof EntityLiving && !(hitEntity instanceof IBossDisplayData)) { - EntityLiving hitLiving1 = (EntityLiving)hitEntity; - hitLiving1.setDead(); - setCooldown = true; - } - } - - if(setCooldown && caster != null && caster instanceof EntityPlayer) { - this.setOnCooldown((EntityPlayer)caster); - } - } - - } - }).setColor(2236962).setSize(4.0F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)3, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)1, (byte)3, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)1, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)1, (byte)1, (byte)3, (byte)2, (byte)2}), new StrokeSet(new byte[]{(byte)1, (byte)1, (byte)1, (byte)1, (byte)3, (byte)3, (byte)2, (byte)2, (byte)2, (byte)2})}); - public static final SymbolEffect LEONARD_1 = instance().addEffect(new SymbolEffect(43, "witchery.pott.leonard1", 5, false, false, (String)null, 0) { - public void perform(World world, EntityPlayer player, int level) { - EffectRegistry.castLeonardSpell(world, player, 0); - } - public int getChargeCost(World world, EntityPlayer player, int level) { - return EffectRegistry.costOfLeonardSpell(world, player, 0); - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)2, (byte)0, (byte)3, (byte)3, (byte)1})}); - public static final SymbolEffect LEONARD_2 = instance().addEffect(new SymbolEffect(44, "witchery.pott.leonard2", 5, false, false, (String)null, 0) { - public void perform(World world, EntityPlayer player, int level) { - EffectRegistry.castLeonardSpell(world, player, 1); - } - public int getChargeCost(World world, EntityPlayer player, int level) { - return EffectRegistry.costOfLeonardSpell(world, player, 1); - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)3, (byte)1, (byte)2, (byte)2, (byte)0})}); - public static final SymbolEffect LEONARD_3 = instance().addEffect(new SymbolEffect(45, "witchery.pott.leonard3", 5, false, false, (String)null, 0) { - public void perform(World world, EntityPlayer player, int level) { - EffectRegistry.castLeonardSpell(world, player, 2); - } - public int getChargeCost(World world, EntityPlayer player, int level) { - return EffectRegistry.costOfLeonardSpell(world, player, 2); - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)1, (byte)2, (byte)0, (byte)0, (byte)3})}); - public static final SymbolEffect LEONARD_4 = instance().addEffect(new SymbolEffect(46, "witchery.pott.leonard4", 5, false, false, (String)null, 0) { - public void perform(World world, EntityPlayer player, int level) { - EffectRegistry.castLeonardSpell(world, player, 3); - } - public int getChargeCost(World world, EntityPlayer player, int level) { - return EffectRegistry.costOfLeonardSpell(world, player, 3); - } - }, new StrokeSet[]{new StrokeSet(new byte[]{(byte)0, (byte)3, (byte)1, (byte)1, (byte)2})}); - public static final SymbolEffect Attraho = instance().addEffect((new SymbolEffectProjectile(47, "witchery.pott.attraho") { - public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { - if(caster != null && mop != null) { - double R = spell.getEffectLevel() == 1?2.0D:(spell.getEffectLevel() == 2?3.0D:9.0D); - double R_SQ = R * R; - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(spell.posX - R, spell.posY - R, spell.posZ - R, spell.posX + R, spell.posY + R, spell.posZ + R); - List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, bb); - Iterator i$ = entities.iterator(); - - while(i$.hasNext()) { - EntityLivingBase entity = (EntityLivingBase)i$.next(); - if(entity.getDistanceSqToEntity(spell) <= R_SQ) { - EntityUtil.pullTowards(world, entity, new EntityPosition(caster), 0.04D, 0.1D); - } - } - } - - } - }).setColor(5322534).setSize(1.0F), new StrokeSet[]{new StrokeSet(1, new byte[]{(byte)0, (byte)0, (byte)0, (byte)2, (byte)2, (byte)1, (byte)3})}); - - - public static final EffectRegistry instance() { - return INSTANCE; - } - - public SymbolEffect addEffect(SymbolEffect effect, StrokeSet ... strokeSets) { - StrokeSet[] arr$ = strokeSets; - int len$ = strokeSets.length; - - for(int i$ = 0; i$ < len$; ++i$) { - StrokeSet strokes = arr$[i$]; - strokes.addTo(this.effects, this.enhanced, effect); - } - - this.effectID.put(Integer.valueOf(effect.getEffectID()), effect); - strokeSets[0].setDefaultFor(effect); - this.allEffects.add(effect); - return effect; - } - - public boolean contains(byte[] strokes) { - return this.getEffect(strokes) != null; - } - - public SymbolEffect getEffect(byte[] strokes) { - return (SymbolEffect)this.effects.get(ByteBuffer.wrap(strokes)); - } - - public SymbolEffect getEffect(int effectID) { - return (SymbolEffect)this.effectID.get(Integer.valueOf(effectID)); - } - - public int getLevel(byte[] strokes) { - return ((Integer)this.enhanced.get(ByteBuffer.wrap(strokes))).intValue(); - } - - public ArrayList getEffects() { - return this.allEffects; - } - - private static void applyEntityEffect(World world, EntityLivingBase actor, MovingObjectPosition mop, double xMid, double yMid, double zMid, double radius, Class clazz, EffectRegistry.IEntityEffect effect) { - if(radius == 0.0D) { - if(mop != null && mop.typeOfHit == MovingObjectType.ENTITY && mop.entityHit != null && clazz.isAssignableFrom(mop.entityHit.getClass())) { - effect.doAction(world, actor, xMid, yMid, zMid, (T)mop.entityHit); - } - } else { - double R_SQ = radius * radius; - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(xMid - radius, yMid - radius, zMid - radius, xMid + radius, yMid + radius, zMid + radius); - List entities = world.getEntitiesWithinAABB(clazz, bb); - Iterator i$ = entities.iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - T entity = (T)obj; - if(entity.getDistanceSq(xMid, yMid, zMid) <= R_SQ) { - effect.doAction(world, actor, entity.posX, entity.posY, entity.posZ, entity); - } - } - } - - } - - private static void applyBlockEffect(World world, EntityLivingBase actor, int midX, int midY, int midZ, int side, int radius, EffectRegistry.IBlockEffect effect) { - int x; - if(radius == 1) { - Block r = world.getBlock(midX, midY, midZ); - x = world.getBlockMetadata(midX, midY, midZ); - if(r != Blocks.air && BlockProtect.canBreak(r, world) && BlockProtect.checkModsForBreakOK(world, midX, midY, midZ, r, x, actor)) { - effect.doAction(world, actor, midX, midY, midZ, r, x); - } - } else { - int var16 = Math.min(radius - 1, 3); - x = midX; - int y = midY; - int z = midZ; - - for(int k = -var16; k <= var16; ++k) { - for(int j = -var16; j <= var16; ++j) { - switch(side) { - case 0: - case 1: - x = midX + k; - z = midZ + j; - break; - case 2: - case 3: - x = midX + k; - y = midY + j; - break; - case 4: - case 5: - y = midY + k; - z = midZ + j; - } - - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - if(block != Blocks.air && BlockProtect.canBreak(block, world) && BlockProtect.checkModsForBreakOK(world, x, y, z, block, meta, actor)) { - effect.doAction(world, actor, x, y, z, block, meta); - } - } - } - } - - } - - private static int costOfLeonardSpell(World world, EntityPlayer player, int spellSlot) { - int slot = InvUtil.getSlotContainingItem(player.inventory, Witchery.Items.LEONARDS_URN); - if(slot >= 0 && slot < player.inventory.getSizeInventory()) { - ItemStack urnStack = player.inventory.getStackInSlot(slot); - if(urnStack != null) { - ItemLeonardsUrn.InventoryLeonardsUrn inv = new ItemLeonardsUrn.InventoryLeonardsUrn(player, urnStack); - if(urnStack.getItemDamage() >= spellSlot) { - ItemStack potion = inv.getStackInSlot(spellSlot); - if(potion != null) { - int baseLevel = WitcheryBrewRegistry.INSTANCE.getUsedCapacity(potion.getTagCompound()); - if(player.isPotionActive(Witchery.Potions.WORSHIP)) { - PotionEffect effect = player.getActivePotionEffect(Witchery.Potions.WORSHIP); - if(effect.getAmplifier() < 1) { - baseLevel += (int)Math.ceil((double)baseLevel * 0.5D); - } - } else { - baseLevel *= 2; - } - - return Math.max(baseLevel, 4); - } - } - } - } - - return 5; - } - - private static void castLeonardSpell(World world, EntityPlayer player, int spellSlot) { - int slot = InvUtil.getSlotContainingItem(player.inventory, Witchery.Items.LEONARDS_URN); - if(slot >= 0 && slot < player.inventory.getSizeInventory()) { - ItemStack urnStack = player.inventory.getStackInSlot(slot); - if(urnStack != null) { - ItemLeonardsUrn.InventoryLeonardsUrn inv = new ItemLeonardsUrn.InventoryLeonardsUrn(player, urnStack); - if(urnStack.getItemDamage() >= spellSlot) { - ItemStack potion = inv.getStackInSlot(spellSlot); - if(potion != null) { - world.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)player.posX, (int)player.posY, (int)player.posZ, 0); - EntityBrew entity = new EntityBrew(world, player, potion, true); - world.spawnEntityInWorld(entity); - return; - } - } - } - } - - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - - // $FF: synthetic method - /*static void access$100(World x0, EntityLivingBase x1, MovingObjectPosition x2, double x3, double x4, double x5, double x6, Class x7, IEntityEffect x8) { - applyEntityEffect(x0, x1, x2, x3, x4, x5, x6, x7, x8); - }*/ - - - private interface IBlockEffect { - - void doAction(World var1, EntityLivingBase var2, int var3, int var4, int var5, Block var6, int var7); - } - - private interface IEntityEffect { - - void doAction(World var1, EntityLivingBase var2, double var3, double var5, double var7, T var9); - } -} +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * cpw.mods.fml.common.FMLCommonHandler + * cpw.mods.fml.common.eventhandler.SubscribeEvent + * cpw.mods.fml.common.gameevent.TickEvent$Phase + * cpw.mods.fml.common.gameevent.TickEvent$ServerTickEvent + * net.minecraft.block.Block + * net.minecraft.block.BlockDoor + * net.minecraft.block.BlockSand + * net.minecraft.block.IGrowable + * net.minecraft.block.material.Material + * net.minecraft.entity.Entity + * net.minecraft.entity.EntityLiving + * net.minecraft.entity.EntityLivingBase + * net.minecraft.entity.EnumCreatureAttribute + * net.minecraft.entity.boss.IBossDisplayData + * net.minecraft.entity.item.EntityFireworkRocket + * net.minecraft.entity.item.EntityItem + * net.minecraft.entity.item.EntityXPOrb + * net.minecraft.entity.monster.EntityBlaze + * net.minecraft.entity.monster.EntityCreeper + * net.minecraft.entity.monster.EntityGolem + * net.minecraft.entity.monster.EntityIronGolem + * net.minecraft.entity.monster.EntityMob + * net.minecraft.entity.monster.EntitySpider + * net.minecraft.entity.monster.EntityWitch + * net.minecraft.entity.passive.EntityWolf + * net.minecraft.entity.player.EntityPlayer + * net.minecraft.init.Blocks + * net.minecraft.init.Items + * net.minecraft.inventory.IInventory + * net.minecraft.item.Item + * net.minecraft.item.ItemDoor + * net.minecraft.item.ItemStack + * net.minecraft.item.crafting.FurnaceRecipes + * net.minecraft.nbt.NBTBase + * net.minecraft.nbt.NBTTagCompound + * net.minecraft.nbt.NBTTagList + * net.minecraft.potion.Potion + * net.minecraft.potion.PotionEffect + * net.minecraft.server.MinecraftServer + * net.minecraft.tileentity.TileEntity + * net.minecraft.util.AxisAlignedBB + * net.minecraft.util.ChatComponentText + * net.minecraft.util.DamageSource + * net.minecraft.util.EntityDamageSourceIndirect + * net.minecraft.util.IChatComponent + * net.minecraft.util.MathHelper + * net.minecraft.util.MovingObjectPosition + * net.minecraft.util.MovingObjectPosition$MovingObjectType + * net.minecraft.world.IBlockAccess + * net.minecraft.world.World + * net.minecraft.world.WorldServer + * net.minecraft.world.storage.WorldInfo + * net.minecraftforge.fluids.FluidRegistry + * net.minecraftforge.fluids.FluidStack + */ +package com.emoniph.witchery.infusion.infusions.symbols; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockBarrier; +import com.emoniph.witchery.blocks.BlockBrazier; +import com.emoniph.witchery.blocks.BlockWickerBundle; +import com.emoniph.witchery.blocks.BlockWitchDoor; +import com.emoniph.witchery.brewing.EntityBrew; +import com.emoniph.witchery.brewing.ModifiersImpact; +import com.emoniph.witchery.brewing.TileEntityCursedBlock; +import com.emoniph.witchery.brewing.WitcheryBrewRegistry; +import com.emoniph.witchery.brewing.potions.PotionEnslaved; +import com.emoniph.witchery.brewing.potions.PotionIllFitting; +import com.emoniph.witchery.dimension.WorldProviderTorment; +import com.emoniph.witchery.entity.EntityBroom; +import com.emoniph.witchery.entity.EntityDarkMark; +import com.emoniph.witchery.entity.EntityEnt; +import com.emoniph.witchery.entity.EntityOwl; +import com.emoniph.witchery.entity.EntitySpellEffect; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.infusion.infusions.InfusionLight; +import com.emoniph.witchery.infusion.infusions.InfusionOtherwhere; +import com.emoniph.witchery.infusion.infusions.symbols.StrokeSet; +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectProjectile; +import com.emoniph.witchery.item.ItemChalk; +import com.emoniph.witchery.item.ItemLeonardsUrn; +import com.emoniph.witchery.util.BlockProtect; +import com.emoniph.witchery.util.BlockUtil; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.DemonicDamageSource; +import com.emoniph.witchery.util.EntityPosition; +import com.emoniph.witchery.util.EntityUtil; +import com.emoniph.witchery.util.InvUtil; +import com.emoniph.witchery.util.Log; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.BlockSand; +import net.minecraft.block.IGrowable; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGolem; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDoor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.WorldInfo; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class EffectRegistry { + private static final EffectRegistry INSTANCE = new EffectRegistry(); + private Hashtable effects = new Hashtable(); + private Hashtable enhanced = new Hashtable(); + private Hashtable effectID = new Hashtable(); + private ArrayList allEffects = new ArrayList(); + public static final SymbolEffect Accio = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(1, "witchery.pott.accio"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, final EntitySpellEffect spell) { + if (caster != null && mop != null) { + double R = spell.getEffectLevel() == 1 ? 5.0 : (spell.getEffectLevel() == 2 ? 10.0 : 20.0); + double R_SQ = R * R; + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(spell.posX - R), (double)(spell.posY - R), (double)(spell.posZ - R), (double)(spell.posX + R), (double)(spell.posY + R), (double)(spell.posZ + R)); + List entities = world.getEntitiesWithinAABB(EntityItem.class, bb); + for (Object obj : entities) { + EntityItem item = (EntityItem)obj; + if (!(item.getDistanceSqToEntity((Entity)spell) <= R_SQ)) continue; + item.setPosition(caster.posX, caster.posY + 1.0, caster.posZ); + } + List living = world.getEntitiesWithinAABB(EntityLivingBase.class, bb); + for (Object obj : living) { + EntityLivingBase entity = (EntityLivingBase)obj; + if (entity == caster || !(entity.getDistanceSqToEntity((Entity)spell) <= R_SQ)) continue; + EntityUtil.pullTowards(world, (Entity)entity, new EntityPosition((Entity)caster), 0.04, 0.1); + } + } + } + }.setColor(5322534).setSize(1.0f), new StrokeSet(1, new byte[]{(byte)3,(byte)0,(byte)2,(byte)2,(byte)1}), new StrokeSet(1, new byte[]{(byte)3,(byte)0,(byte)2,(byte)2,(byte)2,(byte)1}), new StrokeSet(2, new byte[]{(byte)3,(byte)0,(byte)0,(byte)2,(byte)2,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)3,(byte)0,(byte)0,(byte)2,(byte)2,(byte)2,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)2,(byte)1,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)2,(byte)2,(byte)1,(byte)1,(byte)1})); + public static final SymbolEffect Aguamenti = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(2, "witchery.pott.aguamenti"){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (player.isSneaking()) { + EntitySpellEffect dummy = new EntitySpellEffect(world, (EntityLivingBase)player, 0.0, 0.0, 0.0, this, effectLevel); + dummy.setPosition(player.posX, player.posY, player.posZ); + this.onCollision(world, (EntityLivingBase)player, new MovingObjectPosition((Entity)player), dummy); + } else { + super.perform(world, player, effectLevel); + } + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, final EntitySpellEffect spell) { + if (!(spell.getEffectLevel() == 1 && !world.provider.isHellWorld || world.provider.isHellWorld && spell.getEffectLevel() == 3)) { + if (!world.provider.isHellWorld) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) { + int dx1 = MathHelper.floor_double((double)mop.entityHit.posX); + int dy = MathHelper.floor_double((double)mop.entityHit.posY); + int dz = MathHelper.floor_double((double)mop.entityHit.posZ); + this.setBlock(caster, world, dx1, dy, dz, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, dx1, dy + 1, dz, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, dx1 + 1, dy, dz, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, dx1 - 1, dy, dz, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, dx1, dy, dz + 1, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, dx1, dy, dz - 1, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, dx1, dy - 1, dz, (Block)Blocks.flowing_water); + } else { + int dy = 0; + int dx1 = 0; + int n = mop.sideHit == 5 ? 1 : (dx1 = mop.sideHit == 4 ? -1 : 0); + int n2 = mop.sideHit == 0 ? -1 : (dy = mop.sideHit == 1 ? 1 : 0); + int dz = mop.sideHit == 3 ? 1 : (mop.sideHit == 2 ? -1 : 0); + int x = mop.blockX + dx1; + int y = mop.blockY + dy + (!world.getBlock(mop.blockX, mop.blockY, mop.blockZ).getMaterial().isSolid() && mop.sideHit == 1 ? -1 : 0); + int z = mop.blockZ + dz; + this.setBlock(caster, world, x, y, z, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, x, y + 1, z, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, x + 1, y, z, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, x - 1, y, z, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, x, y, z + 1, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, x, y, z - 1, (Block)Blocks.flowing_water); + this.setIfAir(caster, world, x, y - 1, z, (Block)Blocks.flowing_water); + } + } + } else if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) { + this.setBlock(caster, world, MathHelper.floor_double((double)mop.entityHit.posX), MathHelper.floor_double((double)mop.entityHit.posY), MathHelper.floor_double((double)mop.entityHit.posZ), (Block)Blocks.flowing_water); + } else if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + Block dx = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + if (dx == Witchery.Blocks.CAULDRON) { + if (Witchery.Blocks.CAULDRON.tryFillWith(world, mop.blockX, mop.blockY, mop.blockZ, new FluidStack(FluidRegistry.WATER, 3000))) { + // empty if block + } + } else if (dx == Witchery.Blocks.KETTLE) { + if (Witchery.Blocks.KETTLE.tryFillWith(world, mop.blockX, mop.blockY, mop.blockZ, new FluidStack(FluidRegistry.WATER, 1000))) { + // empty if block + } + } else { + int dz = 0; + int dy = 0; + int n = mop.sideHit == 5 ? 1 : (dy = mop.sideHit == 4 ? -1 : 0); + int n3 = mop.sideHit == 0 ? -1 : (dz = mop.sideHit == 1 ? 1 : 0); + int x = mop.sideHit == 3 ? 1 : (mop.sideHit == 2 ? -1 : 0); + this.setBlock(caster, world, mop.blockX + dy, mop.blockY + dz + (!world.getBlock(mop.blockX, mop.blockY, mop.blockZ).getMaterial().isSolid() && mop.sideHit == 1 ? -1 : 0), mop.blockZ + x, (Block)Blocks.flowing_water); + } + } + } + + private void setBlock(EntityLivingBase caster, World world, int x, int y, int z, Block block) { + if (BlockProtect.checkModsForBreakOK(world, x, y, z, caster)) { + world.setBlock(x, y, z, block); + } + } + + private void setIfAir(EntityLivingBase caster, World world, int x, int y, int z, Block block) { + if (world.isAirBlock(x, y, z)) { + this.setBlock(caster, world, x, y, z, block); + } + } + }.setColor(0x11F3FF).setSize(2.0f), new StrokeSet(1, new byte[]{(byte)0,(byte)0,(byte)2,(byte)2,(byte)1,(byte)2}), new StrokeSet(1, new byte[]{(byte)0,(byte)0,(byte)2,(byte)2,(byte)2,(byte)1,(byte)0}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)2,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)0,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)1,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)0,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)2,(byte)1,(byte)1,(byte)1})); + public static final SymbolEffect Alohomora = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(3, "witchery.pott.alohomora"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + Block blockID = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + if (blockID != Witchery.Blocks.DOOR_ALDER && blockID != Witchery.Blocks.DOOR_ROWAN) { + if (blockID instanceof BlockDoor) { + ((BlockDoor)blockID).func_150014_a(world, mop.blockX, mop.blockY, mop.blockZ, !((BlockDoor)blockID).func_150015_f((IBlockAccess)world, mop.blockX, mop.blockY, mop.blockZ)); + } + } else { + ((BlockWitchDoor)blockID).onBlockActivatedNormally(world, mop.blockX, mop.blockY, mop.blockZ, null, 1, mop.blockX, mop.blockY, mop.blockZ); + } + } + } + }.setColor(5322534).setSize(0.5f), new StrokeSet(2, new byte[]{(byte)0,(byte)2,(byte)2,(byte)1}), new StrokeSet(2, new byte[]{(byte)0,(byte)2,(byte)2,(byte)2,(byte)1}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)2,(byte)2,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)2,(byte)2,(byte)2,(byte)1,(byte)1})); + public static final SymbolEffect AvadaKedavra = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(4, "witchery.pott.avadakedavra", 101, true, false, null, 0, true){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + if (mop != null && caster != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + if (mop.entityHit instanceof EntityPlayer) { + if (world.isRemote || !(caster instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled()) { + EntityPlayer hitCreature = (EntityPlayer)mop.entityHit; + EntityUtil.instantDeath((EntityLivingBase)hitCreature, caster); + } + } else if (mop.entityHit instanceof EntityLiving) { + EntityLiving hitCreature1 = (EntityLiving)mop.entityHit; + if (caster instanceof EntityPlayer && ((EntityPlayer)caster).capabilities.isCreativeMode) { + EntityUtil.instantDeath((EntityLivingBase)hitCreature1, caster); + } else if ((PotionEnslaved.canCreatureBeEnslaved((EntityLivingBase)hitCreature1) || hitCreature1 instanceof EntityWitch || hitCreature1 instanceof EntityEnt || hitCreature1 instanceof EntityGolem) && hitCreature1.getMaxHealth() <= 200.0f) { + hitCreature1.attackEntityFrom(DamageSource.causeIndirectMagicDamage((Entity)effectEntity, (Entity)caster), 200.0f); + } else { + hitCreature1.attackEntityFrom(DamageSource.causeIndirectMagicDamage((Entity)effectEntity, (Entity)caster), 25.0f); + } + } + } + } + }.setColor(65280).setSize(2.0f), new StrokeSet(1, new byte[]{(byte)1,(byte)2,(byte)2,(byte)0,(byte)0,(byte)3,(byte)3,(byte)3,(byte)3,(byte)1,(byte)1,(byte)2})); + public static final SymbolEffect CaveInimicum = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(5, "witchery.pott.caveinimicum"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + EffectRegistry.applyBlockEffect(world, caster, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, effectEntity.getEffectLevel(), new IBlockEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, int x, int y, int z, Block block, int meta) { + Block newBlockID = Blocks.air; + if (block == Blocks.dirt) { + newBlockID = Blocks.stone; + } else if (block == Blocks.grass) { + newBlockID = Blocks.stone; + } else if (block == Blocks.mycelium) { + newBlockID = Blocks.stone; + } else if (block == Blocks.cobblestone) { + newBlockID = Blocks.stone; + } else if (block == Blocks.planks) { + newBlockID = Blocks.stone; + } else if (block == Witchery.Blocks.PLANKS) { + newBlockID = Blocks.stone; + } else if (block == Blocks.stonebrick) { + newBlockID = Blocks.brick_block; + } else if (block == Blocks.sand) { + newBlockID = Blocks.sandstone; + } else if (block == Blocks.clay) { + newBlockID = Blocks.hardened_clay; + } else if (block == Blocks.wooden_door) { + int i1 = ((BlockDoor)block).func_150012_g((IBlockAccess)world, x, y, z); + if ((i1 & 8) != 0) { + --y; + } + world.setBlockToAir(x, y, z); + world.setBlockToAir(x, y + 1, z); + int pp1 = MathHelper.floor_double((double)((double)((actor.rotationYaw + 180.0f) * 4.0f / 360.0f) - 0.5)) & 3; + ItemDoor.placeDoorBlock((World)world, (int)x, (int)y, (int)z, (int)pp1, (Block)Blocks.iron_door); + } + if (newBlockID != Blocks.air) { + world.setBlock(x, y, z, newBlockID); + } + } + }); + } + } + }.setColor(0x303030).setSize(3.0f), new StrokeSet(1, new byte[]{(byte)0,(byte)3,(byte)0,(byte)0,(byte)2}), new StrokeSet(1, new byte[]{(byte)0,(byte)3,(byte)0,(byte)0,(byte)0,(byte)2}), new StrokeSet(1, new byte[]{(byte)0,(byte)3,(byte)3,(byte)0,(byte)0,(byte)2,(byte)2}), new StrokeSet(2, new byte[]{(byte)0,(byte)3,(byte)3,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2}), new StrokeSet(3, new byte[]{(byte)0,(byte)3,(byte)3,(byte)3,(byte)0,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)2})); + public static final SymbolEffect Colloportus = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(6, "witchery.pott.colloportus"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + int y; + Block blockID; + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && caster != null && (blockID = world.getBlock(mop.blockX, y = mop.blockY, mop.blockZ)) instanceof BlockDoor) { + int i1 = ((BlockDoor)blockID).func_150012_g((IBlockAccess)world, mop.blockX, y, mop.blockZ); + if ((i1 & 8) != 0) { + --y; + } + world.setBlockToAir(mop.blockX, y, mop.blockZ); + world.setBlockToAir(mop.blockX, y + 1, mop.blockZ); + int pp1 = MathHelper.floor_double((double)((double)((caster.rotationYaw + 180.0f) * 4.0f / 360.0f) - 0.5)) & 3; + ItemDoor.placeDoorBlock((World)world, (int)mop.blockX, (int)y, (int)mop.blockZ, (int)pp1, (Block)Witchery.Blocks.DOOR_ROWAN); + } + } + }.setColor(5322534).setSize(1.0f), new StrokeSet(3, new byte[]{(byte)3,(byte)1,(byte)1,(byte)2}), new StrokeSet(3, new byte[]{(byte)3,(byte)1,(byte)1,(byte)1,(byte)2}), new StrokeSet(3, new byte[]{(byte)1,(byte)0,(byte)1,(byte)1,(byte)3}), new StrokeSet(1, new byte[]{(byte)1,(byte)2,(byte)2,(byte)3,(byte)3})); + public static final SymbolEffect Flipendo = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(17, "witchery.pott.flipendo"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + int level = spell.getEffectLevel(); + if (level <= 1) { + // Level 1: single-target knockback (classic Flipendo). + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + double dX = target.posX - (caster != null ? caster.posX : spell.posX); + double dZ = target.posZ - (caster != null ? caster.posZ : spell.posZ); + double len = Math.sqrt(dX * dX + dZ * dZ); + if (len > 0.001) { dX /= len; dZ /= len; } + target.addVelocity(dX * 2.5, 0.6, dZ * 2.5); + target.attackEntityFrom(DamageSource.causeIndirectMagicDamage(spell, caster), 2.0F); + target.velocityChanged = true; + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_POP, (Entity)target, 1.0D, 1.0D, 16); + } + } else { + // Level 2/3: area-of-effect blast wave (absorbs the old Expulso). + double radius = level == 2 ? 6.0 : 10.0; + double force = level == 2 ? 2.0 : 3.0; + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, spell.boundingBox.expand(radius, radius, radius)); + boolean hit = false; + for (Object obj : list) { + EntityLivingBase target = (EntityLivingBase)obj; + if (target != caster && target.getDistanceToEntity((Entity)spell) <= radius) { + double dX = target.posX - spell.posX; + double dZ = target.posZ - spell.posZ; + double len = Math.sqrt(dX * dX + dZ * dZ); + if (len > 0.001) { dX /= len; dZ /= len; } + target.addVelocity(dX * force, 1.5, dZ * force); + target.attackEntityFrom(DamageSource.causeIndirectMagicDamage(spell, caster), 2.0F); + target.velocityChanged = true; + hit = true; + } + } + if (hit) { + ParticleEffect.EXPLODE.send(SoundEffect.RANDOM_EXPLODE, world, spell.posX, spell.posY, spell.posZ, 2.0D, 2.0D, 16); + } + } + } + }.setColor(16777215).setSize(1.5F), new StrokeSet(1, new byte[]{(byte)0,(byte)3,(byte)1,(byte)0}), new StrokeSet(2, new byte[]{(byte)0,(byte)3,(byte)1,(byte)3,(byte)0}), new StrokeSet(3, new byte[]{(byte)0,(byte)3,(byte)1,(byte)3,(byte)1})); + public static final SymbolEffect Confundus = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(8, "witchery.pott.confundus"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + double radius = spell.getEffectLevel() == 1 ? 0.0 : (spell.getEffectLevel() == 2 ? 2.0 : 4.0); + EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, new IEntityEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { + if (target instanceof EntityLivingBase && !target.isPotionActive(Potion.confusion)) { + target.addPotionEffect(new PotionEffect(Potion.confusion.id, 600)); + } + } + }); + } + }.setColor(16771328).setSize(1.5f), new StrokeSet(1, new byte[]{(byte)3,(byte)3,(byte)0,(byte)0,(byte)2}), new StrokeSet(1, new byte[]{(byte)3,(byte)3,(byte)3,(byte)0,(byte)0,(byte)2,(byte)2}), new StrokeSet(2, new byte[]{(byte)3,(byte)3,(byte)3,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2}), new StrokeSet(3, new byte[]{(byte)3,(byte)3,(byte)3,(byte)3,(byte)0,(byte)0,(byte)0,(byte)0,(byte)2,(byte)2,(byte)2})); + public static final SymbolEffect Crucio = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(9, "witchery.pott.crucio", 5, true, false, null, 0){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && caster != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + + int corazones = 2; // Daño base de 2 corazones (4 puntos) + if (caster instanceof net.minecraft.entity.player.EntityPlayer && com.emoniph.witchery.commands.CommandCrucio.CRUCIO_POWER.containsKey(caster)) { + corazones = com.emoniph.witchery.commands.CommandCrucio.CRUCIO_POWER.get(caster); + } + + // Wither Nivel 3 (Amplificador 2) hace 1 de daño (0.5 corazones) cada 10 ticks. + // Para quitar X corazones, necesita 20 ticks por corazón. + int duracionTicks = corazones * 20; + + EntityLivingBase target = (EntityLivingBase) mop.entityHit; + + if (target instanceof net.minecraft.entity.player.EntityPlayer) { + if (world.isRemote || !(caster instanceof net.minecraft.entity.player.EntityPlayer) || net.minecraft.server.MinecraftServer.getServer().isPVPEnabled()) { + target.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.wither.id, duracionTicks, 2, false)); + } + } else { + target.addPotionEffect(new net.minecraft.potion.PotionEffect(net.minecraft.potion.Potion.wither.id, duracionTicks, 2, false)); + } + } + } + }.setColor(0x6600FF).setSize(2.0f), new StrokeSet(1, new byte[]{(byte)1,(byte)3,(byte)1,(byte)1,(byte)2}), new StrokeSet(1, new byte[]{(byte)1,(byte)3,(byte)3,(byte)1,(byte)1,(byte)2,(byte)2}), new StrokeSet(2, new byte[]{(byte)1,(byte)3,(byte)1,(byte)1,(byte)1,(byte)2}), new StrokeSet(2, new byte[]{(byte)1,(byte)3,(byte)3,(byte)1,(byte)1,(byte)1,(byte)2,(byte)2}), new StrokeSet(3, new byte[]{(byte)1,(byte)3,(byte)3,(byte)3,(byte)1,(byte)1,(byte)1,(byte)1,(byte)2,(byte)2,(byte)2})); + public static final SymbolEffect Defodio = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(10, "witchery.pott.defodio", 3, false, false, null, 0){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + EffectRegistry.applyBlockEffect(world, caster, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, effectEntity.getEffectLevel(), new IBlockEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, int x, int y, int z, Block block, int meta) { + Material material = block.getMaterial(); + if (material == Material.clay || material == Material.craftedSnow || material == Material.ground || material == Material.grass || material == Material.ice || material == Material.rock || material == Material.sand) { + world.setBlockToAir(x, y, z); + Item itemBlock = null; + int itemDamageValue = -1; + try { + itemBlock = block.getItemDropped(meta, world.rand, 0); + int itemDamageValue1 = block.damageDropped(meta); + int ex = block.quantityDropped(meta, 0, world.rand); + if (itemBlock != null && itemDamageValue1 >= 0 && ex > 0) { + world.spawnEntityInWorld((Entity)new EntityItem(world, 0.5 + (double)x, 0.5 + (double)y, 0.5 + (double)z, new ItemStack(itemBlock, ex, itemDamageValue1))); + } + } + catch (Throwable var12) { + Log.instance().warning(var12, "Exception occured while spawning block as part of Defodio effect: new (" + itemBlock + ", " + itemDamageValue + ") old (" + block + ", " + meta + ")"); + } + } + } + }); + } + } + }.setColor(4008220).setSize(2.5f), new StrokeSet(1, new byte[]{(byte)0,(byte)0,(byte)3,(byte)1}), new StrokeSet(1, new byte[]{(byte)0,(byte)0,(byte)0,(byte)3,(byte)1,(byte)1}), new StrokeSet(1, new byte[]{(byte)0,(byte)0,(byte)3,(byte)3,(byte)1,(byte)2}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)0,(byte)3,(byte)3,(byte)1,(byte)1,(byte)2}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)0,(byte)0,(byte)3,(byte)3,(byte)1,(byte)1,(byte)1,(byte)2}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)0,(byte)3,(byte)3,(byte)3,(byte)1,(byte)1,(byte)2,(byte)2}), new StrokeSet(3, new byte[]{(byte)0,(byte)0,(byte)0,(byte)0,(byte)3,(byte)3,(byte)3,(byte)1,(byte)1,(byte)1,(byte)2,(byte)2})); + public static final SymbolEffect Ennervate = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(12, "witchery.pott.ennervate", 1, false, true, null, 0){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + double radius = spell.getEffectLevel() == 1 ? 0.0 : (spell.getEffectLevel() == 2 ? 2.0 : 4.0); + EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, new IEntityEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { + if (target.isPotionActive(Potion.moveSlowdown)) { + target.removePotionEffect(Potion.moveSlowdown.id); + } + if (target.isPotionActive(Potion.digSlowdown)) { + target.removePotionEffect(Potion.digSlowdown.id); + } + if (target.isPotionActive(Potion.confusion)) { + target.removePotionEffect(Potion.confusion.id); + } + } + }); + } + }.setColor(16713595).setSize(1.5f), new StrokeSet(1, new byte[]{(byte)0,(byte)3,(byte)0,(byte)2,(byte)3,(byte)0,(byte)2}), new StrokeSet(2, new byte[]{(byte)0,(byte)3,(byte)3,(byte)0,(byte)2,(byte)2,(byte)3,(byte)3,(byte)0,(byte)2,(byte)2}), new StrokeSet(3, new byte[]{(byte)0,(byte)3,(byte)3,(byte)3,(byte)0,(byte)2,(byte)2,(byte)2,(byte)3,(byte)3,(byte)3,(byte)0,(byte)2,(byte)2,(byte)2})); + public static final SymbolEffect Episkey = EffectRegistry.instance().addEffect(new SymbolEffect(13, "witchery.pott.episkey", 1, false, false, null, 0){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + double radius = effectLevel == 1 ? 0.0 : (effectLevel == 2 ? 2.0 : 4.0); + MovingObjectPosition mop = new MovingObjectPosition((Entity)player); + EffectRegistry.applyEntityEffect(world, (EntityLivingBase)player, mop, player.posX, player.posY, player.posZ, radius, EntityLivingBase.class, new IEntityEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { + int currentFood; + boolean hasFood = target instanceof EntityPlayer; + int n = currentFood = hasFood ? ((EntityPlayer)target).getFoodStats().getFoodLevel() : 5; + if (currentFood > 1 && target.getHealth() < target.getMaxHealth()) { + target.heal((float)Math.min(5, currentFood)); + if (hasFood) { + ((EntityPlayer)target).getFoodStats().addStats(-Math.min(5, currentFood), 0.0f); + } + if (!target.isPotionActive(Potion.confusion)) { + target.addPotionEffect(new PotionEffect(Potion.confusion.id, TimeUtil.secsToTicks(4))); + } + ParticleEffect.SPLASH.send(SoundEffect.MOB_SLIME_SMALL, (Entity)target, 1.0, 1.0, 16); + } + } + }); + } + }, new StrokeSet(1, new byte[]{(byte)2,(byte)0,(byte)3,(byte)1,(byte)1,(byte)2}), new StrokeSet(2, new byte[]{(byte)2,(byte)0,(byte)0,(byte)3,(byte)1,(byte)1,(byte)1,(byte)1,(byte)2}), new StrokeSet(2, new byte[]{(byte)2,(byte)2,(byte)0,(byte)3,(byte)3,(byte)1,(byte)1,(byte)2,(byte)2}), new StrokeSet(3, new byte[]{(byte)2,(byte)2,(byte)0,(byte)0,(byte)3,(byte)3,(byte)1,(byte)1,(byte)1,(byte)1,(byte)2,(byte)2})); + public static final SymbolEffect Expelliarmus = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(15, "witchery.pott.expelliarmus"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + double radius = spell.getEffectLevel() == 1 ? 0.0 : (spell.getEffectLevel() == 2 ? 3.0 : 5.0); + EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, new IEntityEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { + if (actor != target) { + if(target.getHeldItem()!=null){target.entityDropItem(target.getHeldItem(),0);target.setCurrentItemOrArmor(0,null);} + } + } + }); + } + + private void disarm(EntityLivingBase target) { + ItemStack heldItem1; + if (target instanceof EntityPlayer) { + int heldItemIndex; + EntityPlayer heldItem = (EntityPlayer)target; + if ((heldItem.openContainer == null || heldItem.openContainer.windowId == 0) && heldItem.inventory.mainInventory[heldItemIndex = heldItem.inventory.currentItem] != null) { + heldItem.dropPlayerItemWithRandomChoice(heldItem.inventory.mainInventory[heldItemIndex], true); + heldItem.inventory.mainInventory[heldItemIndex] = null; + } + } else if (!PotionIllFitting.isTargetBanned(target) && (heldItem1 = target.getHeldItem()) != null) { + if (target instanceof EntityPlayer) { + Infusion.dropEntityItemWithRandomChoice(target, heldItem1, true); + } else { + target.entityDropItem(heldItem1, 0.5f); + } + target.setCurrentItemOrArmor(0, (ItemStack)null); + } + } + }.setColor(16747778).setSize(3.0f), new StrokeSet(1, new byte[]{(byte)0,(byte)0,(byte)1}), new StrokeSet(1, new byte[]{(byte)0,(byte)0,(byte)0,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1})); + public static final SymbolEffect Flagrate = EffectRegistry.instance().addEffect(new SymbolEffect(16, "witchery.pott.flagrate", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0); + if (mop != null) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + ItemChalk.drawGlyph(world, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, Witchery.Blocks.GLYPH_INFERNAL, player); + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + }, new StrokeSet(2, new byte[]{(byte)0,(byte)2,(byte)3,(byte)0,(byte)2})); + public static final SymbolEffect Impedimenta = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(19, "witchery.pott.impedimenta"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + double radius = spell.getEffectLevel() == 1 ? 0.0 : (spell.getEffectLevel() == 2 ? 3.0 : 6.0); + double spellX = spell.motionX; + double spellZ = spell.motionZ; + EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, new IEntityEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { + if (target != actor && !target.isPotionActive(Potion.moveSlowdown)) { + target.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 600, 1)); + } + } + }); + } + }.setColor(6191615).setSize(1.5f), new StrokeSet(1, new byte[]{(byte)3,(byte)3,(byte)2}), new StrokeSet(1, new byte[]{(byte)3,(byte)3,(byte)3,(byte)2,(byte)2}), new StrokeSet(2, new byte[]{(byte)3,(byte)3,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2}), new StrokeSet(3, new byte[]{(byte)3,(byte)3,(byte)3,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2,(byte)2})); + public static final SymbolEffect Imperio = EffectRegistry.instance().addEffect(new SymbolEffectImperio(20, "witchery.pott.imperio").setColor(10686463).setSize(1.5f), new StrokeSet(2, new byte[]{(byte)1,(byte)1,(byte)1,(byte)1})); + public static final SymbolEffect Incendio = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(21, "witchery.pott.incendio"){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (player.isSneaking()) { + if (!world.isRemote) { + int px = MathHelper.floor_double(player.posX); + int py = MathHelper.floor_double(player.posY); + int pz = MathHelper.floor_double(player.posZ); + int radius = effectLevel == 1 ? 1 : (effectLevel == 2 ? 2 : 3); + for (int x = -radius; x <= radius; ++x) { + for (int z = -radius; z <= radius; ++z) { + if (Math.abs(x) == radius || Math.abs(z) == radius) { + for (int y = -1; y <= 1; ++y) { + if (world.isAirBlock(px + x, py + y, pz + z) && world.getBlock(px + x, py + y - 1, pz + z).getMaterial().isSolid()) { + world.setBlock(px + x, py + y, pz + z, Blocks.fire); + break; + } + } + } + } + } + ParticleEffect.FLAME.send(SoundEffect.MOB_GHAST_FIREBALL, player, 1.0, 1.0, 16); + } + } else { + super.perform(world, player, effectLevel); + } + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + double radius = spell.getEffectLevel() == 1 ? 0.0 : (spell.getEffectLevel() == 2 ? 3.0 : 6.0); + final int level = spell.getEffectLevel(); + if (radius == 0.0) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) { + mop.entityHit.setFire(1); + mop.entityHit.attackEntityFrom(new EntityDamageSourceIndirect("onFire", (Entity)spell, (Entity)caster).setFireDamage(), 0.1f); + } else if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int dy = 0; + int dx = 0; + Block side = BlockUtil.getBlock(world, mop); + if (side == Witchery.Blocks.WICKER_BUNDLE && BlockWickerBundle.limitToValidMetadata(world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ)) == 1) { + if (BlockWickerBundle.tryIgniteMan(world, mop.blockX, mop.blockY, mop.blockZ, caster != null ? caster.rotationYaw : 0.0f)) { + return; + } + } else if (side == Witchery.Blocks.BRAZIER) { + BlockBrazier.tryIgnite(world, mop.blockX, mop.blockY, mop.blockZ); + return; + } + int n = mop.sideHit == 5 ? 1 : (dx = mop.sideHit == 4 ? -1 : 0); + int n2 = mop.sideHit == 0 ? -1 : (dy = mop.sideHit == 1 ? 1 : 0); + int dz = mop.sideHit == 3 ? 1 : (mop.sideHit == 2 ? -1 : 0); + world.setBlock(mop.blockX + dx, mop.blockY + dy + (!world.getBlock(mop.blockX, mop.blockY, mop.blockZ).getMaterial().isSolid() && mop.sideHit == 1 ? -1 : 0), mop.blockZ + dz, (Block)Blocks.fire); + } + } else { + EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, new IEntityEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { + if (target != actor) { + target.setFire(level); + } + } + }); + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + final int side1 = mop.sideHit; + EffectRegistry.applyBlockEffect(world, caster, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, level, new IBlockEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, int x, int y, int z, Block block, int meta) { + if (side1 == 1) { + int dy = 0; + int dx = 0; + int n = side1 == 5 ? 1 : (dx = side1 == 4 ? -1 : 0); + int n2 = side1 == 0 ? -1 : (dy = side1 == 1 ? 1 : 0); + int nX = x + dx; + int nY = y + dy; + int dz = side1 == 3 ? 1 : (side1 == 2 ? -1 : 0); + int nZ = z + dz; + if (world.isAirBlock(nX, nY, nZ)) { + world.setBlock(nX, nY, nZ, (Block)Blocks.fire); + } + } + } + }); + } + } + } + }.setColor(16724023).setSize(2.0f), new StrokeSet(1, new byte[]{(byte)3,(byte)0,(byte)0,(byte)1,(byte)1,(byte)0}), new StrokeSet(2, new byte[]{(byte)3,(byte)0,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)0,(byte)0,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1})); + public static final SymbolEffect Lumos = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(22, "witchery.pott.lumos"){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (player.isSneaking()) { + EntitySpellEffect dummy = new EntitySpellEffect(world, (EntityLivingBase)player, 0.0, 0.0, 0.0, this, effectLevel); + dummy.setPosition(player.posX, player.posY, player.posZ); + this.onCollision(world, (EntityLivingBase)player, new MovingObjectPosition((Entity)player), dummy); + } else { + super.perform(world, player, effectLevel); + } + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + if (!world.isRemote && mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityPlayer) { + EntityPlayer target = (EntityPlayer)mop.entityHit; + NBTTagCompound nbt = Infusion.getNBT(target); + if (nbt.hasKey("WITCLumos")) { + int ox = nbt.getInteger("WITCLumosX"); + int oy = nbt.getInteger("WITCLumosY"); + int oz = nbt.getInteger("WITCLumosZ"); + if (world.blockExists(ox, oy, oz) && world.getBlock(ox, oy, oz) == Witchery.Blocks.GLOW_GLOBE) { + world.setBlockToAir(ox, oy, oz); + } + nbt.removeTag("WITCLumos"); + nbt.removeTag("WITCLumosX"); + nbt.removeTag("WITCLumosY"); + nbt.removeTag("WITCLumosZ"); + } else { + int nx = MathHelper.floor_double(target.posX); + int ny = MathHelper.floor_double(target.posY) + 2; + int nz = MathHelper.floor_double(target.posZ); + nbt.setBoolean("WITCLumos", true); + nbt.setInteger("WITCLumosX", nx); + nbt.setInteger("WITCLumosY", ny); + nbt.setInteger("WITCLumosZ", nz); + if (world.isAirBlock(nx, ny, nz)) { + world.setBlock(nx, ny, nz, Witchery.Blocks.GLOW_GLOBE); + } + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, target, 1.0, 1.0, 16); + return; + } + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int dy = 0; + int dx = 0; + int n = mop.sideHit == 5 ? 1 : (dx = mop.sideHit == 4 ? -1 : 0); + int n2 = mop.sideHit == 0 ? -1 : (dy = mop.sideHit == 1 ? 1 : 0); + int x = mop.blockX + 1 * dx; + int y = mop.blockY + 1 * dy; + int dz = mop.sideHit == 3 ? 1 : (mop.sideHit == 2 ? -1 : 0); + int z = mop.blockZ + 1 * dz; + int level = effectEntity.getEffectLevel(); + if (level <= 1) { + // Level 1: a single glow globe (classic Lumos). + Material material = world.getBlock(x, y, z).getMaterial(); + if (material == Material.air || material == Material.snow) { + world.setBlock(x, y, z, Witchery.Blocks.GLOW_GLOBE); + } + } else { + // Level 2/3: scatter glow globes around the impact (absorbs Lumos Maxima). + int radius = level == 2 ? 5 : 10; + for (int ox = -radius; ox <= radius; ++ox) { + for (int oy = -radius; oy <= radius; ++oy) { + for (int oz = -radius; oz <= radius; ++oz) { + if (world.rand.nextInt(10) != 0 || !world.isAirBlock(x + ox, y + oy, z + oz)) continue; + world.setBlock(x + ox, y + oy, z + oz, Witchery.Blocks.GLOW_GLOBE); + } + } + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, effectEntity, 2.0, 2.0, 16); + } + } + } + }.setColor(0xFFFF3A).setSize(0.5f), new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)2,(byte)0}), new StrokeSet(2, new byte[]{(byte)1,(byte)1,(byte)2,(byte)1,(byte)0}), new StrokeSet(3, new byte[]{(byte)1,(byte)1,(byte)2,(byte)1,(byte)1})); + public static final SymbolEffect MeteolojinxRecanto = EffectRegistry.instance().addEffect(new SymbolEffect(23, "witchery.pott.meteolojinxrecanto", 100, false, false, null, 0){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0); + if (world.isRaining()) { + WorldServer worldserver = MinecraftServer.getServer().worldServers[0]; + if (worldserver != null) { + WorldInfo worldinfo = worldserver.getWorldInfo(); + worldinfo.setRaining(false); + worldinfo.setThundering(false); + } + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + }, new StrokeSet(0, new byte[]{(byte)0,(byte)0,(byte)2,(byte)2,(byte)1,(byte)0,(byte)2,(byte)2,(byte)1,(byte)1})); + public static final SymbolEffect Nox = EffectRegistry.instance().addEffect(new SymbolEffect(26, "witchery.pott.nox", 50, false, false, null, 0){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + int x0 = MathHelper.floor_double((double)player.posX); + int y0 = MathHelper.floor_double((double)player.posY); + int z0 = MathHelper.floor_double((double)player.posZ); + int radius = 25; + for (int y = y0 - radius; y <= y0 + radius; ++y) { + for (int x = x0 - radius; x <= x0 + radius; ++x) { + for (int z = z0 - radius; z <= z0 + radius; ++z) { + int blockMeta; + Block blockID = world.getBlock(x, y, z); + if (!((double)blockID.getLightValue((IBlockAccess)world, x, y, z) > 0.8) || !BlockProtect.canBreak(blockID, world) || !BlockProtect.checkModsForBreakOK(world, x, y, z, blockID, blockMeta = world.getBlockMetadata(x, y, z), (EntityLivingBase)player)) continue; + world.setBlockToAir(x, y, z); + if (blockID.quantityDropped(world.rand) <= 0) continue; + blockID.dropBlockAsItem(world, x, y, z, blockMeta, 0); + } + } + } + + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(x0 - radius), (double)(y0 - radius), (double)(z0 - radius), (double)(x0 + radius), (double)(y0 + radius), (double)(z0 + radius)); + List list = world.getEntitiesWithinAABB(EntityPlayer.class, bounds); + for (Object obj : list) { + EntityPlayer p = (EntityPlayer)obj; + NBTTagCompound nbt = Infusion.getNBT(p); + if (nbt.hasKey("WITCLumos")) { + int ox = nbt.getInteger("WITCLumosX"); + int oy = nbt.getInteger("WITCLumosY"); + int oz = nbt.getInteger("WITCLumosZ"); + if (world.blockExists(ox, oy, oz) && world.getBlock(ox, oy, oz) == Witchery.Blocks.GLOW_GLOBE) { + world.setBlockToAir(ox, oy, oz); + } + nbt.removeTag("WITCLumos"); + nbt.removeTag("WITCLumosX"); + nbt.removeTag("WITCLumosY"); + nbt.removeTag("WITCLumosZ"); + p.addChatMessage(new net.minecraft.util.ChatComponentTranslation("witchery.pott.lumos.extinguished")); + } + } + } + }, new StrokeSet(0, new byte[]{(byte)0,(byte)2,(byte)1,(byte)2,(byte)0})); + public static final SymbolEffect Protego = EffectRegistry.instance().addEffect(new SymbolEffect(31, "witchery.pott.protego"){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (player.isSneaking()) { + MovingObjectPosition mop = new MovingObjectPosition((Entity)player); + InfusionLight.placeBarrierShield(world, player, mop); + return; + } + MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0); + if (mop != null) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + InfusionLight.placeBarrierShield(world, player, mop); + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + }, new StrokeSet(1, new byte[]{(byte)1,(byte)0,(byte)0}), new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)0,(byte)0}), new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)1,(byte)0,(byte)0,(byte)0})); + public static final SymbolEffect PetrificusTotalus = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(35, "witchery.pott.petrificustotalus"){ + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + if (target instanceof EntityPlayer) { + if (!world.isRemote && (!(caster instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) { + EntityPlayer pTarget = (EntityPlayer)target; + pTarget.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Integer.MAX_VALUE, 10)); + pTarget.addPotionEffect(new PotionEffect(Potion.blindness.id, Integer.MAX_VALUE, 0)); + pTarget.addPotionEffect(new PotionEffect(Witchery.Potions.PARALYSED.id, Integer.MAX_VALUE, 0)); + pTarget.addPotionEffect(new PotionEffect(Potion.resistance.id, Integer.MAX_VALUE, 4)); + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_FIZZ, pTarget, 1.0D, 2.0D, 16); + } + } else if (target instanceof EntityLiving) { + target.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Integer.MAX_VALUE, 10)); + target.addPotionEffect(new PotionEffect(Potion.blindness.id, Integer.MAX_VALUE, 0)); + target.addPotionEffect(new PotionEffect(Potion.resistance.id, Integer.MAX_VALUE, 4)); + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_FIZZ, target, 1.0D, 2.0D, 16); + } + } + } + }.setColor(16755200).setSize(1.5F), new StrokeSet[]{new StrokeSet(new byte[]{(byte)3, (byte)1, (byte)3, (byte)1, (byte)3})}); + public static final SymbolEffect Glacius = EffectRegistry.instance().addEffect((new SymbolEffectProjectile(37, "witchery.pott.glacius") { + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + target.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 300, 3)); + target.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 300, 2)); + target.extinguish(); + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_FIZZ, target, 1.0D, 1.0D, 16); + } + if (!world.isRemote) { + int px = (int)spell.posX; + int py = (int)spell.posY; + int pz = (int)spell.posZ; + for (int x = -5; x <= 5; ++x) { + for (int y = -5; y <= 5; ++y) { + for (int z = -5; z <= 5; ++z) { + Block b = world.getBlock(px + x, py + y, pz + z); + if (b == net.minecraft.init.Blocks.water || b == net.minecraft.init.Blocks.flowing_water) { + world.setBlock(px + x, py + y, pz + z, net.minecraft.init.Blocks.ice); + } else if (b == net.minecraft.init.Blocks.lava || b == net.minecraft.init.Blocks.flowing_lava) { + world.setBlock(px + x, py + y, pz + z, net.minecraft.init.Blocks.cobblestone); + } else if (b == net.minecraft.init.Blocks.fire) { + world.setBlockToAir(px + x, py + y, pz + z); + } + } + } + } + } + } + }).setColor(0x88CCFF).setSize(1.5F), new StrokeSet(1, new byte[]{(byte)1,(byte)2,(byte)0})); + public static final SymbolEffect Stupefy = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(36, "witchery.pott.stupefy", 5, false, true, null, 0){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase entityLiving = (EntityLivingBase)mop.entityHit; + if (!entityLiving.isPotionActive(Potion.moveSlowdown)) { + entityLiving.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 6000, 9)); + } + entityLiving.addPotionEffect(new PotionEffect(Potion.confusion.id, 60, 0)); + if (effectEntity != null) { + entityLiving.addVelocity(effectEntity.motionX * 2.0, 0.3, effectEntity.motionZ * 2.0); + entityLiving.velocityChanged = true; + } + } + } + }.setColor(1279).setSize(1.5f), new StrokeSet(1, new byte[]{(byte)2,(byte)2,(byte)0,(byte)3,(byte)0,(byte)2}), new StrokeSet(1, new byte[]{(byte)2,(byte)2,(byte)2,(byte)0,(byte)3,(byte)3,(byte)0,(byte)2,(byte)2}), new StrokeSet(2, new byte[]{(byte)2,(byte)2,(byte)0,(byte)0,(byte)3,(byte)0,(byte)0,(byte)2}), new StrokeSet(2, new byte[]{(byte)2,(byte)2,(byte)2,(byte)0,(byte)0,(byte)3,(byte)3,(byte)0,(byte)0,(byte)2,(byte)2})); + public static final SymbolEffect Ignianima = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(39, "witchery.pott.ignianima", 2, true, false, "ignianima", 0){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect e) { + double R = 1.5; + double R_SQ = 2.25; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(e.posX - 1.5), (double)(e.posY - 1.5), (double)(e.posZ - 1.5), (double)(e.posX + 1.5), (double)(e.posY + 1.5), (double)(e.posZ + 1.5)); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds); + for (Object hit : entities) { + float healthPct; + float scale; + EntityLivingBase hitEntity = (EntityLivingBase)hit; + if (hitEntity == caster || !(e.getDistanceSqToEntity((Entity)hitEntity) <= 2.25)) continue; + float damage = 10.0f; + float f = scale = hitEntity instanceof EntityPlayer ? hitEntity.getMaxHealth() / 20.0f : 1.0f; + if (caster != null && (damage = 20.0f * (1.0f - (healthPct = caster.getHealth() / caster.getMaxHealth()))) < 2.0f) { + damage = 2.0f; + } + float scaledDamage = damage * scale; + hitEntity.attackEntityFrom((DamageSource)new DemonicDamageSource((Entity)caster), scaledDamage); + ParticleEffect.FLAME.send(SoundEffect.FIRE_IGNITE, (Entity)hitEntity, 1.0, 2.0, 16); + } + } + }.setColor(16770912).setSize(3.0f), new StrokeSet(3, new byte[]{(byte)3,(byte)0,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)3,(byte)0,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)3,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)3,(byte)3,(byte)0,(byte)1,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)3,(byte)3,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1})); + public static final SymbolEffect CarnosaDiem = EffectRegistry.instance().addEffect(new SymbolEffect(40, "witchery.pott.carnosadiem", 1, true, false, "carnosadiem", 0){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + float damage = player.getMaxHealth() * 0.1f; + player.attackEntityFrom((DamageSource)new DemonicDamageSource((Entity)player), damage); + ParticleEffect.REDDUST.send(SoundEffect.MOB_ENDERDRAGON_GROWL, (Entity)player, 1.0, 2.0, 16); + int currentPower = Infusion.getCurrentEnergy(player); + int maxPower = Infusion.getMaxEnergy(player); + Infusion.setCurrentEnergy(player, Math.min(currentPower + 10, maxPower)); + Witchery.modHooks.boostBloodPowers(player, damage); + } + }, new StrokeSet(2, new byte[]{(byte)2,(byte)0,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)2,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)2,(byte)2,(byte)0,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)2,(byte)2,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)2,(byte)2,(byte)2,(byte)0,(byte)1,(byte)1}), new StrokeSet(2, new byte[]{(byte)2,(byte)2,(byte)2,(byte)0,(byte)0,(byte)1,(byte)1,(byte)1,(byte)1})); + public static final SymbolEffect MORSMORDRE = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(41, "witchery.pott.morsmordre", 20, true, false, "morsmordre", 0){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect effectEntity) { + if (!world.isRemote) { + EntityDarkMark entity = new EntityDarkMark(world); + entity.setLocationAndAngles(effectEntity.posX, effectEntity.posY, effectEntity.posZ, 0.0f, 0.0f); + entity.func_110163_bv(); + world.spawnEntityInWorld((Entity)entity); + } + } + }.setColor(0).setSize(3.0f).setTimeToLive(8), new StrokeSet(0, new byte[]{(byte)0,(byte)3,(byte)2,(byte)2}), new StrokeSet(0, new byte[]{(byte)0,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2,(byte)2}), new StrokeSet(0, new byte[]{(byte)0,(byte)0,(byte)3,(byte)2,(byte)2}), new StrokeSet(0, new byte[]{(byte)0,(byte)0,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2,(byte)2}), new StrokeSet(0, new byte[]{(byte)0,(byte)0,(byte)0,(byte)3,(byte)2,(byte)2}), new StrokeSet(0, new byte[]{(byte)0,(byte)0,(byte)0,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2,(byte)2})); + public static final SymbolEffect Tormentum = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(42, "witchery.pott.tormentum", 25, true, true, "tormentum", TimeUtil.minsToTicks(30)){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect e) { + if (!world.isRemote && e.dimension != Config.instance().dimensionTormentID) { + double R = 2.0; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(e.posX - 2.0), (double)(e.posY - 2.0), (double)(e.posZ - 2.0), (double)(e.posX + 2.0), (double)(e.posY + 2.0), (double)(e.posZ + 2.0)); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds); + boolean setCooldown = false; + for (Object hitEntity : entities) { + if (hitEntity instanceof EntityPlayer) { + EntityPlayer hitLiving = (EntityPlayer)hitEntity; + WorldProviderTorment.setPlayerMustTorment(hitLiving, 1, -1); + setCooldown = true; + continue; + } + if (!(hitEntity instanceof EntityLiving) || hitEntity instanceof IBossDisplayData) continue; + EntityLiving hitLiving1 = (EntityLiving)hitEntity; + hitLiving1.setDead(); + setCooldown = true; + } + if (setCooldown && caster != null && caster instanceof EntityPlayer) { + this.setOnCooldown((EntityPlayer)caster); + } + } + } + }.setColor(0x222222).setSize(4.0f), new StrokeSet(1, new byte[]{(byte)1,(byte)3,(byte)2,(byte)2}), new StrokeSet(1, new byte[]{(byte)1,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2,(byte)2}), new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)3,(byte)2,(byte)2}), new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2,(byte)2}), new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)1,(byte)3,(byte)2,(byte)2}), new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)1,(byte)3,(byte)3,(byte)2,(byte)2,(byte)2,(byte)2})); + public static final SymbolEffect LEONARD_1 = EffectRegistry.instance().addEffect(new SymbolEffect(43, "witchery.pott.leonard1", 5, false, false, null, 0){ + + @Override + public void perform(World world, EntityPlayer player, int level) { + EffectRegistry.castLeonardSpell(world, player, 0); + } + + @Override + public int getChargeCost(World world, EntityPlayer player, int level) { + return EffectRegistry.costOfLeonardSpell(world, player, 0); + } + }, new StrokeSet(2, new byte[]{(byte)0,(byte)3,(byte)3,(byte)1})); + public static final SymbolEffect LEONARD_2 = EffectRegistry.instance().addEffect(new SymbolEffect(44, "witchery.pott.leonard2", 5, false, false, null, 0){ + + @Override + public void perform(World world, EntityPlayer player, int level) { + EffectRegistry.castLeonardSpell(world, player, 1); + } + + @Override + public int getChargeCost(World world, EntityPlayer player, int level) { + return EffectRegistry.costOfLeonardSpell(world, player, 1); + } + }, new StrokeSet(3, new byte[]{(byte)1,(byte)2,(byte)2,(byte)0,(byte)1})); + public static final SymbolEffect LEONARD_3 = EffectRegistry.instance().addEffect(new SymbolEffect(45, "witchery.pott.leonard3", 5, false, false, null, 0){ + + @Override + public void perform(World world, EntityPlayer player, int level) { + EffectRegistry.castLeonardSpell(world, player, 2); + } + + @Override + public int getChargeCost(World world, EntityPlayer player, int level) { + return EffectRegistry.costOfLeonardSpell(world, player, 2); + } + }, new StrokeSet(1, new byte[]{(byte)2,(byte)0,(byte)0,(byte)3,(byte)0})); + public static final SymbolEffect LEONARD_4 = EffectRegistry.instance().addEffect(new SymbolEffect(46, "witchery.pott.leonard4", 5, false, false, null, 0){ + + @Override + public void perform(World world, EntityPlayer player, int level) { + EffectRegistry.castLeonardSpell(world, player, 3); + } + + @Override + public int getChargeCost(World world, EntityPlayer player, int level) { + return EffectRegistry.costOfLeonardSpell(world, player, 3); + } + }, new StrokeSet(0, new byte[]{(byte)3,(byte)1,(byte)1,(byte)2})); + public static final SymbolEffect FlagrateRitualis = EffectRegistry.instance().addEffect(new SymbolEffect(48, "witchery.pott.flagrateritualis", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0); + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + ItemChalk.drawGlyph(world, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, Witchery.Blocks.GLYPH_RITUAL, player); + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + }, new StrokeSet(0, new byte[]{(byte)2,(byte)1,(byte)3,(byte)0})); + public static final SymbolEffect FlagrateAureus = EffectRegistry.instance().addEffect(new SymbolEffect(49, "witchery.pott.flagrateaureus", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0); + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + ItemChalk.drawGlyph(world, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, Witchery.Blocks.CIRCLE, player); + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + }, new StrokeSet(0, new byte[]{(byte)2,(byte)1,(byte)3,(byte)2})); + public static final SymbolEffect FlagrateAlibi = EffectRegistry.instance().addEffect(new SymbolEffect(50, "witchery.pott.flagratealibi", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 4.0); + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + ItemChalk.drawGlyph(world, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, Witchery.Blocks.GLYPH_OTHERWHERE, player); + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + }, new StrokeSet(0, new byte[]{(byte)2,(byte)1,(byte)3,(byte)1})); + public static final SymbolEffect RevelioPotionis = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(51, "witchery.pott.revelopotionis"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + TileEntity tile = world.getTileEntity(mop.blockX, mop.blockY, mop.blockZ); + if (tile instanceof TileEntityCursedBlock) { + ((TileEntityCursedBlock)tile).applyToEntityAndDestroy((Entity)caster); + } + } + if (!world.isRemote) { + double r = 10.0; + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, spell.boundingBox.expand(r, r, r)); + for (Object obj : list) { + EntityLivingBase entity = (EntityLivingBase)obj; + if (!entity.isPotionActive(Potion.invisibility)) continue; + entity.removePotionEffect(Potion.invisibility.id); + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_ORB, (Entity)entity, 1.0, 1.0, 16); + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, spell, 2.0, 2.0, 16); + } + } + }, new StrokeSet(0, new byte[]{(byte)1,(byte)2,(byte)1})); + public static final SymbolEffect Reparo = EffectRegistry.instance().addEffect(new SymbolEffect(52, "witchery.pott.reparo", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + ItemStack[][] inventories; + int currentEnergy = Infusion.getCurrentEnergy(player); + boolean repairedAny = false; + for (ItemStack[] inv : inventories = new ItemStack[][]{player.inventory.mainInventory, player.inventory.armorInventory}) { + for (int i = 0; i < inv.length; ++i) { + ItemStack stack = inv[i]; + if (stack == null || !stack.isItemDamaged()) continue; + int damage = stack.getItemDamage(); + int repairAmount = Math.min(damage, currentEnergy); + if (repairAmount > 0) { + stack.setItemDamage(stack.getItemDamage() - repairAmount); + currentEnergy -= repairAmount; + repairedAny = true; + } + if (currentEnergy <= 0) break; + } + if (currentEnergy <= 0) break; + } + if (repairedAny) { + Infusion.setCurrentEnergy(player, currentEnergy); + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_ORB, (Entity)player, 1.0, 1.0, 16); + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + }, new StrokeSet(3, new byte[]{(byte)1,(byte)2,(byte)3})); + public static final SymbolEffect ExpectoPatronum = EffectRegistry.instance().addEffect(new SymbolEffect(53, "witchery.pott.expectopatronum", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + List list = world.getEntitiesWithinAABB(EntityMob.class, player.boundingBox.expand(15.0, 15.0, 15.0)); + for (Object obj : list) { + EntityMob mob = (EntityMob)obj; + if (mob.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD && !(mob instanceof EntityCreeper)) continue; + double d0 = mob.posX - player.posX; + double d1 = mob.posZ - player.posZ; + mob.addVelocity(d0 * 0.2, 0.5, d1 * 0.2); + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.MOB_WITHER_SPAWN, (Entity)player, 2.0, 2.0, 16); + } + }, new StrokeSet(0, new byte[]{(byte)2,(byte)0,(byte)2})); + public static final SymbolEffect Sectumsempra = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(54, "witchery.pott.sectumsempra"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + // Unified single-target damage spell (absorbs Ictus / Diffindo / basic attack). + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + int level = spell.getEffectLevel(); + float damage = level == 1 ? 5.0f : (level == 2 ? 8.0f : 12.0f); + target.attackEntityFrom(DamageSource.causeIndirectMagicDamage((Entity)spell, (Entity)caster), damage); + target.addPotionEffect(new PotionEffect(Potion.wither.id, 100 * level, level - 1)); + // Higher levels also drain a target player's infusion energy (the old Ictus effect). + if (level >= 2 && target instanceof EntityPlayer) { + EntityPlayer pTarget = (EntityPlayer)target; + int currentEnergy = Infusion.getCurrentEnergy(pTarget); + Infusion.setCurrentEnergy(pTarget, Math.max(0, currentEnergy - 25 * level)); + } + ParticleEffect.REDDUST.send(SoundEffect.DAMAGE_HIT, (Entity)target, 1.0, 1.0, 16); + } + } + }, new StrokeSet(1, new byte[]{(byte)1,(byte)3,(byte)1,(byte)3,(byte)1}), new StrokeSet(2, new byte[]{(byte)1,(byte)3,(byte)3,(byte)1,(byte)3,(byte)3,(byte)1}), new StrokeSet(3, new byte[]{(byte)1,(byte)3,(byte)3,(byte)3,(byte)1,(byte)3,(byte)3,(byte)3,(byte)1})); + public static final SymbolEffect Obliviate = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(7, "witchery.pott.obliviate"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + if (target instanceof EntityPlayer) { + if (!world.isRemote && (!(caster instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) { + target.clearActivePotions(); + target.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1)); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, (Entity)target, 1.0, 1.0, 16); + } + } else if (target instanceof EntityLiving) { + EntityLiving mobTarget = (EntityLiving)target; + mobTarget.setAttackTarget(null); + mobTarget.setRevengeTarget(null); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, (Entity)target, 1.0, 1.0, 16); + } + } + } + }, new StrokeSet(0, new byte[]{(byte)2,(byte)1,(byte)0})); + public static final SymbolEffect Confringo = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(11, "witchery.pott.confringo"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + // Scalable blast: L1 small, L2 medium, L3 huge (absorbs the old Bombarda / Bombarda Maxima). + int level = spell.getEffectLevel(); + float power = level == 1 ? 3.0f : (level == 2 ? 4.0f : 8.0f); + boolean flaming = level >= 3; + boolean smoking = level >= 2; + world.newExplosion((Entity)caster, spell.posX, spell.posY, spell.posZ, power, flaming, smoking); + } + }, new StrokeSet(1, new byte[]{(byte)2,(byte)1,(byte)1,(byte)0}), new StrokeSet(2, new byte[]{(byte)2,(byte)1,(byte)1,(byte)2,(byte)0}), new StrokeSet(3, new byte[]{(byte)2,(byte)1,(byte)1,(byte)2,(byte)1})); + public static final SymbolEffect WingardiumLeviosa = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(18, "witchery.pott.wingardiumleviosa"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + Entity target = null; + if (mop != null) { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) { + target = mop.entityHit; + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)mop.blockX, (double)mop.blockY, (double)mop.blockZ, (double)(mop.blockX + 1), (double)(mop.blockY + 1), (double)(mop.blockZ + 1)).expand(1.5, 1.5, 1.5); + List list = world.getEntitiesWithinAABBExcludingEntity(spell, bounds); + double closestDist = Double.MAX_VALUE; + for (Object obj : list) { + Entity e = (Entity)obj; + double d = e.getDistanceSqToEntity(spell); + if (d < closestDist) { + closestDist = d; + target = e; + } + } + } + } + if (target != null) { + if (target instanceof EntityPlayer && ((EntityPlayer)target).getEntityData().getInteger("WITCLeviosaTicks") > 0) { + ((EntityPlayer)target).getEntityData().setInteger("WITCLeviosaTicks", 0); + ParticleEffect.SMOKE.send(SoundEffect.RANDOM_FIZZ, target, 1.0D, 2.0D, 16); + } else { + if (caster instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)caster; + player.getEntityData().setInteger("WITCLeviosaEntity", target.getEntityId()); + player.getEntityData().setInteger("WITCLeviosaTicks", Integer.MAX_VALUE); + if (!player.getEntityData().hasKey("WITCLeviosaDistance")) { + player.getEntityData().setFloat("WITCLeviosaDistance", 5.0f); + } + } + target.motionY = 0.5; + if (target instanceof EntityLivingBase) { + ((EntityLivingBase)target).addPotionEffect(new PotionEffect(Potion.resistance.id, 200, 4)); + } + } + } + } + }, new StrokeSet(0, new byte[]{(byte)2,(byte)2,(byte)1})); + public static final SymbolEffect Descendo = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(102, "witchery.pott.descendo"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote && mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + // Slam the target violently into the ground and pin it. + if (target.ridingEntity != null && target.ridingEntity instanceof com.emoniph.witchery.entity.EntityBroom) { + target.mountEntity(null); + } + boolean isFlyingMob = target instanceof net.minecraft.entity.EntityFlying || target instanceof net.minecraft.entity.passive.EntityBat || target instanceof com.emoniph.witchery.entity.EntityFlyingTameable || target instanceof com.emoniph.witchery.entity.EntityFlyingMob || target instanceof net.minecraft.entity.boss.EntityDragon || target instanceof net.minecraft.entity.boss.EntityWither || target instanceof net.minecraft.entity.monster.EntityGhast || target instanceof net.minecraft.entity.monster.EntityBlaze; + boolean isFlyingPlayer = target instanceof EntityPlayer && ((EntityPlayer)target).capabilities.isFlying; + + if (isFlyingMob || isFlyingPlayer) { + if (isFlyingPlayer) { + ((EntityPlayer)target).capabilities.isFlying = false; + ((EntityPlayer)target).sendPlayerAbilities(); + } + target.addVelocity(0.0, -5.0, 0.0); + } else { + target.addVelocity(0.0, -2.0, 0.0); + } + + target.velocityChanged = true; + target.fallDistance += 4.0f; + target.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60 * spell.getEffectLevel(), 3)); + target.attackEntityFrom(DamageSource.causeIndirectMagicDamage((Entity)spell, (Entity)caster), 2.0f); + ParticleEffect.SMOKE.send(SoundEffect.RANDOM_POP, (Entity)target, 1.0, 0.5, 16); + } + } + }.setColor(0x6688AA).setSize(1.0f), new StrokeSet(1, new byte[]{(byte)3,(byte)2,(byte)1}), new StrokeSet(2, new byte[]{(byte)3,(byte)2,(byte)0,(byte)1}), new StrokeSet(3, new byte[]{(byte)3,(byte)2,(byte)0,(byte)0})); + public static final SymbolEffect Geminio = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(103, "witchery.pott.geminio"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + double R = 3.0 + 1.0 * (double)(spell.getEffectLevel() - 1); + double R_SQ = R * R; + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(spell.posX - R), (double)(spell.posY - R), (double)(spell.posZ - R), (double)(spell.posX + R), (double)(spell.posY + R), (double)(spell.posZ + R)); + List entities = world.getEntitiesWithinAABB(EntityItem.class, bb); + boolean duplicated = false; + for (Object obj : entities) { + EntityItem item = (EntityItem)obj; + if (item.getDistanceSqToEntity((Entity)spell) > R_SQ) continue; + ItemStack stack = item.getEntityItem(); + if (stack == null || stack.stackSize <= 0) continue; + if (!EffectRegistry.canDuplicate(stack)) continue; + ItemStack copy = stack.copy(); + copy.stackSize = 1; + EntityItem dupe = new EntityItem(world, item.posX, item.posY + 0.2, item.posZ, copy); + dupe.delayBeforeCanPickup = 10; + dupe.motionX = (world.rand.nextDouble() - 0.5) * 0.1; + dupe.motionY = 0.2; + dupe.motionZ = (world.rand.nextDouble() - 0.5) * 0.1; + world.spawnEntityInWorld(dupe); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_ORB, item, 0.5, 0.5, 16); + duplicated = true; + break; + } + + if (!duplicated && caster != null) { + SoundEffect.NOTE_SNARE.playAt(world, caster.posX, caster.posY, caster.posZ); + } + } + } + }.setColor(0xC0FFC0).setSize(1.0f), new StrokeSet(1, new byte[]{(byte)0,(byte)2,(byte)0,(byte)1}), new StrokeSet(2, new byte[]{(byte)0,(byte)2,(byte)0,(byte)0,(byte)1}), new StrokeSet(3, new byte[]{(byte)0,(byte)2,(byte)0,(byte)0,(byte)0})); + public static final SymbolEffect Avis = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(25, "witchery.pott.avis"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + for (int i = 0; i < 3; ++i) { + EntityOwl owl = new EntityOwl(world); + owl.setLocationAndAngles(spell.posX, spell.posY, spell.posZ, 0.0f, 0.0f); + owl.setTimeToLive(200); + if (mop != null && mop.entityHit instanceof EntityLivingBase) { + owl.setAttackTarget((EntityLivingBase)mop.entityHit); + } + world.spawnEntityInWorld((Entity)owl); + } + ParticleEffect.SMOKE.send(SoundEffect.RANDOM_POP, spell, 1.0, 1.0, 16); + } + } + }, new StrokeSet(0, new byte[]{(byte)3,(byte)1,(byte)0})); + public static final SymbolEffect Oppugno = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(27, "witchery.pott.oppugno"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + for (int i = 0; i < 3; ++i) { + EntityWolf wolf = new EntityWolf(world); + wolf.setLocationAndAngles(spell.posX, spell.posY, spell.posZ, 0.0f, 0.0f); + wolf.setAngry(true); + if (mop.entityHit instanceof EntityLivingBase) { + wolf.setAttackTarget((EntityLivingBase)mop.entityHit); + } + world.spawnEntityInWorld((Entity)wolf); + } + ParticleEffect.SMOKE.send(SoundEffect.RANDOM_POP, spell, 1.0, 1.0, 16); + } + } + }, new StrokeSet(1, new byte[]{(byte)3,(byte)1,(byte)2})); + public static final SymbolEffect PiertotumLocomotor = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(29, "witchery.pott.piertotumlocomotor"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + EntityIronGolem golem = new EntityIronGolem(world); + golem.setLocationAndAngles(spell.posX, spell.posY, spell.posZ, 0.0f, 0.0f); + golem.setPlayerCreated(true); + world.spawnEntityInWorld((Entity)golem); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, spell, 2.0, 2.0, 16); + } + } + }, new StrokeSet(2, new byte[]{(byte)3,(byte)3,(byte)1})); + public static final SymbolEffect Reducto = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(30, "witchery.pott.reducto"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + double r = 4.0; + List list = world.getEntitiesWithinAABB(EntityItem.class, spell.boundingBox.expand(r, r, r)); + for (Object obj : list) { + ((EntityItem)obj).setDead(); + } + List listXp = world.getEntitiesWithinAABB(EntityXPOrb.class, spell.boundingBox.expand(r, r, r)); + for (Object obj : listXp) { + ((EntityXPOrb)obj).setDead(); + } + if (mop == null) return; + int cx = mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? mop.blockX : (int)spell.posX; + int cy = mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? mop.blockY : (int)spell.posY; + int cz = mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? mop.blockZ : (int)spell.posZ; + for (int x = -2; x <= 2; ++x) { + for (int y = -2; y <= 2; ++y) { + for (int z = -2; z <= 2; ++z) { + Block b = world.getBlock(cx + x, cy + y, cz + z); + if (Math.abs(x) <= 1 && Math.abs(y) <= 1 && Math.abs(z) <= 1) { + if (b == Blocks.air || b == Blocks.bedrock) continue; + world.setBlockToAir(cx + x, cy + y, cz + z); + continue; + } + if (b != Blocks.water && b != Blocks.flowing_water && b != Blocks.lava && b != Blocks.flowing_lava && b != Blocks.fire && b != Blocks.web) continue; + world.setBlockToAir(cx + x, cy + y, cz + z); + } + } + } + world.playSoundEffect((double)cx, (double)cy, (double)cz, "random.explode", 1.0f, 1.0f); + ParticleEffect.SMOKE.send(SoundEffect.RANDOM_FIZZ, spell, 2.0, 2.0, 16); + } + } + }, new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)2,(byte)0})); + public static final SymbolEffect AraniaExumai = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(32, "witchery.pott.araniaexumai"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + if (target instanceof EntitySpider) { + target.attackEntityFrom(DamageSource.causeIndirectMagicDamage((Entity)spell, (Entity)caster), 50.0f); + } else { + target.attackEntityFrom(DamageSource.causeIndirectMagicDamage((Entity)spell, (Entity)caster), 2.0f); + } + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_ORB, (Entity)target, 1.0, 1.0, 16); + } + } + }, new StrokeSet(0, new byte[]{(byte)0,(byte)0,(byte)2,(byte)1})); + public static final SymbolEffect Silencio = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(33, "witchery.pott.silencio"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + if (target instanceof EntityPlayer) { + target.addPotionEffect(new PotionEffect(Witchery.Potions.PARALYSED.id, 400, 0)); + } + target.addPotionEffect(new PotionEffect(Potion.weakness.id, 400, 10)); + target.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 400, 10)); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, (Entity)target, 1.0, 1.0, 16); + } + } + }, new StrokeSet(3, new byte[]{(byte)0,(byte)0,(byte)2,(byte)3})); + public static final SymbolEffect ProtegoMaxima = EffectRegistry.instance().addEffect(new SymbolEffect(34, "witchery.pott.protegomaxima", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + int px = (int)player.posX; + int py = (int)player.posY; + int pz = (int)player.posZ; + for (int x = -3; x <= 3; ++x) { + for (int y = -3; y <= 3; ++y) { + for (int z = -3; z <= 3; ++z) { + if (Math.abs(x) != 3 && Math.abs(y) != 3 && Math.abs(z) != 3 || !world.isAirBlock(px + x, py + y, pz + z)) continue; + world.setBlock(px + x, py + y, pz + z, Witchery.Blocks.FORCE); + } + } + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, (Entity)player, 2.0, 2.0, 16); + } + }, new StrokeSet(2, new byte[]{(byte)0,(byte)0,(byte)3,(byte)0})); + public static List erectoTasks = new ArrayList(); + public static final SymbolEffect Apparition; + public static final SymbolEffect Fiendfyre; + public static final SymbolEffect Expulso; + public static final SymbolEffect Engorgio; + public static final SymbolEffect FiniteIncantatem; + public static final SymbolEffect Herbivicus; + public static final SymbolEffect Impervius; + public static final SymbolEffect Erecto; + public static final SymbolEffect PortusPersonal; + public static final SymbolEffect PortusTraslador; + public static final SymbolEffect TaglockHex; + public static final SymbolEffect SmeltRay; + public static final SymbolEffect EarthPillar; + public static final SymbolEffect Transmutation; + public static final SymbolEffect Excavation; + public static final SymbolEffect BroomSummon; + public static final SymbolEffect ToadLeap; + public static final SymbolEffect EtherealVault; + public static final SymbolEffect Orchideous; + public static final SymbolEffect Fumos; + public static final SymbolEffect Incarcerous; + public static final SymbolEffect Vermillious; + + public static final EffectRegistry instance() { + return INSTANCE; + } + + public SymbolEffect addEffect(SymbolEffect effect, StrokeSet ... strokeSets) { + StrokeSet[] arr$ = strokeSets; + int len$ = strokeSets.length; + for (int i$ = 0; i$ < len$; ++i$) { + StrokeSet strokes = arr$[i$]; + strokes.addTo(this.effects, this.enhanced, effect); + } + this.effectID.put(effect.getEffectID(), effect); + strokeSets[0].setDefaultFor(effect); + this.allEffects.add(effect); + return effect; + } + + public static boolean canDuplicate(ItemStack stack) { + if (stack == null || stack.getItem() == null) { + return false; + } + // The Geminio charm only copies minor, non-precious items - never tools, armour, + // enchanted gear or anything stacked beyond a single duplicate target. + if (stack.isItemEnchanted() || stack.isItemStackDamageable()) { + return false; + } + Item item = stack.getItem(); + if (item == Witchery.Items.GENERIC) { + int dmg = stack.getItemDamage(); + return dmg == Witchery.Items.GENERIC.itemWaystone.damageValue || dmg == Witchery.Items.GENERIC.itemWaystoneBound.damageValue; + } + if (item == Witchery.Items.TAGLOCK_KIT) { + return true; + } + // A small whitelist of cheap, common materials. + return item == Items.string || item == Items.feather || item == Items.bone || item == Items.gunpowder || item == Items.paper || item == Items.stick || item == Items.clay_ball || item == Item.getItemFromBlock(Blocks.dirt) || item == Item.getItemFromBlock(Blocks.cobblestone) || item == Item.getItemFromBlock(Blocks.sand) || item == Items.wheat_seeds; + } + + public boolean contains(byte[] strokes) { + return this.getEffect(strokes) != null; + } + + public boolean hasLongerSymbol(byte[] strokes) { + Iterator i$ = this.effects.keySet().iterator(); + while (i$.hasNext()) { + ByteBuffer key = (ByteBuffer)i$.next(); + byte[] candidate = key.array(); + if (candidate.length <= strokes.length) { + continue; + } + boolean isPrefix = true; + for (int n = 0; n < strokes.length; ++n) { + if (candidate[n] == strokes[n]) continue; + isPrefix = false; + break; + } + if (isPrefix) { + return true; + } + } + return false; + } + + public SymbolEffect getEffect(byte[] strokes) { + return (SymbolEffect)this.effects.get(ByteBuffer.wrap(strokes)); + } + + public SymbolEffect getEffect(int effectID) { + return (SymbolEffect)this.effectID.get(effectID); + } + + public int getLevel(byte[] strokes) { + return (Integer)this.enhanced.get(ByteBuffer.wrap(strokes)); + } + + public ArrayList getEffects() { + return this.allEffects; + } + + public static void applyEntityEffect(World world, EntityLivingBase actor, MovingObjectPosition mop, double xMid, double yMid, double zMid, double radius, Class clazz, IEntityEffect effect) { + if (radius == 0.0) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null && clazz.isAssignableFrom(mop.entityHit.getClass())) { + effect.doAction(world, actor, xMid, yMid, zMid, (T)mop.entityHit); + } + } else { + double R_SQ = radius * radius; + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(xMid - radius), (double)(yMid - radius), (double)(zMid - radius), (double)(xMid + radius), (double)(yMid + radius), (double)(zMid + radius)); + List entities = world.getEntitiesWithinAABB(clazz, bb); + for (Object obj : entities) { + Entity entity = (Entity)obj; + if (!(entity.getDistanceSq(xMid, yMid, zMid) <= R_SQ)) continue; + effect.doAction(world, actor, entity.posX, entity.posY, entity.posZ, (T)entity); + } + } + } + + private static void applyBlockEffect(World world, EntityLivingBase actor, int midX, int midY, int midZ, int side, int radius, IBlockEffect effect) { + if (radius == 1) { + Block r = world.getBlock(midX, midY, midZ); + int x = world.getBlockMetadata(midX, midY, midZ); + if (r != Blocks.air && BlockProtect.canBreak(r, world) && BlockProtect.checkModsForBreakOK(world, midX, midY, midZ, r, x, actor)) { + effect.doAction(world, actor, midX, midY, midZ, r, x); + } + } else { + int var16 = Math.min(radius - 1, 3); + int x = midX; + int y = midY; + int z = midZ; + for (int k = -var16; k <= var16; ++k) { + for (int j = -var16; j <= var16; ++j) { + switch (side) { + case 0: + case 1: { + x = midX + k; + z = midZ + j; + break; + } + case 2: + case 3: { + x = midX + k; + y = midY + j; + break; + } + case 4: + case 5: { + y = midY + k; + z = midZ + j; + } + } + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + if (block == Blocks.air || !BlockProtect.canBreak(block, world) || !BlockProtect.checkModsForBreakOK(world, x, y, z, block, meta, actor)) continue; + effect.doAction(world, actor, x, y, z, block, meta); + } + } + } + } + + private static int costOfLeonardSpell(World world, EntityPlayer player, int spellSlot) { + ItemStack urnStack; + int slot = InvUtil.getSlotContainingItem(player.inventory, Witchery.Items.LEONARDS_URN); + if (slot >= 0 && slot < player.inventory.getSizeInventory() && (urnStack = player.inventory.getStackInSlot(slot)) != null) { + ItemStack potion; + ItemLeonardsUrn.InventoryLeonardsUrn inv = new ItemLeonardsUrn.InventoryLeonardsUrn(player, urnStack); + if (urnStack.getItemDamage() >= spellSlot && (potion = inv.getStackInSlot(spellSlot)) != null) { + int baseLevel = WitcheryBrewRegistry.INSTANCE.getUsedCapacity(potion.getTagCompound()); + if (player.isPotionActive(Witchery.Potions.WORSHIP)) { + PotionEffect effect = player.getActivePotionEffect(Witchery.Potions.WORSHIP); + if (effect.getAmplifier() < 1) { + baseLevel += (int)Math.ceil((double)baseLevel * 0.5); + } + } else { + baseLevel *= 2; + } + return Math.max(baseLevel, 4); + } + } + return 5; + } + + private static void castLeonardSpell(World world, EntityPlayer player, int spellSlot) { + ItemStack urnStack; + int slot = InvUtil.getSlotContainingItem(player.inventory, Witchery.Items.LEONARDS_URN); + if (slot >= 0 && slot < player.inventory.getSizeInventory() && (urnStack = player.inventory.getStackInSlot(slot)) != null) { + ItemStack potion; + ItemLeonardsUrn.InventoryLeonardsUrn inv = new ItemLeonardsUrn.InventoryLeonardsUrn(player, urnStack); + if (urnStack.getItemDamage() >= spellSlot && (potion = inv.getStackInSlot(spellSlot)) != null) { + world.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)player.posX, (int)player.posY, (int)player.posZ, 0); + if (player.isSneaking()) { + WitcheryBrewRegistry.INSTANCE.impactSplashPotion(world, potion, new MovingObjectPosition((Entity)player), new ModifiersImpact(new EntityPosition((Entity)player), false, 0, EntityUtil.playerOrFake(world, (EntityLivingBase)player))); + world.playAuxSFX(2002, MathHelper.floor_double((double)player.posX), MathHelper.floor_double((double)player.posY), MathHelper.floor_double((double)player.posZ), WitcheryBrewRegistry.INSTANCE.getBrewColor(potion.getTagCompound())); + } else { + EntityBrew entity = new EntityBrew(world, (EntityLivingBase)player, potion, true); + world.spawnEntityInWorld((Entity)entity); + } + return; + } + } + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + + static { + FMLCommonHandler.instance().bus().register((Object)new ErectoTickHandler()); + Apparition = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(55, "witchery.pott.apparition"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + double x = spell.posX; + double y = spell.posY; + double z = spell.posZ; + caster.setPositionAndUpdate(x, y + 1.0, z); + world.playSoundAtEntity((Entity)caster, "mob.endermen.portal", 1.0f, 1.0f); + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_POP, spell, 1.0, 1.0, 16); + } + } + }, new StrokeSet(2, new byte[]{(byte)0,(byte)2,(byte)1,(byte)0})); + Fiendfyre = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(56, "witchery.pott.fiendfyre"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + EntityPlayer player; + if (!world.isRemote && caster instanceof EntityPlayer && Infusion.getInfusionID(player = (EntityPlayer)caster) == 4 && Infusion.aquireEnergy(world, player, 100, false)) { + for (int i = 0; i < 5; ++i) { + EntityBlaze blaze = new EntityBlaze(world); + blaze.setLocationAndAngles(spell.posX + (double)world.rand.nextInt(5) - 2.0, spell.posY, spell.posZ + (double)world.rand.nextInt(5) - 2.0, 0.0f, 0.0f); + blaze.addPotionEffect(new PotionEffect(Potion.wither.id, 200, 3)); + if (mop.entityHit instanceof EntityLivingBase) { + blaze.setAttackTarget((EntityLivingBase)mop.entityHit); + } + world.spawnEntityInWorld((Entity)blaze); + } + for (int x = -3; x <= 3; ++x) { + for (int z = -3; z <= 3; ++z) { + if (world.rand.nextInt(3) != 0 || !world.isAirBlock(mop.blockX + x, mop.blockY + 1, mop.blockZ + z)) continue; + world.setBlock(mop.blockX + x, mop.blockY + 1, mop.blockZ + z, (Block)Blocks.fire); + } + } + ParticleEffect.FLAME.send(SoundEffect.MOB_GHAST_FIREBALL, spell, 3.0, 3.0, 16); + } + } + }, new StrokeSet(1, new byte[]{(byte)0,(byte)2,(byte)1,(byte)1})); + Expulso = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(57, "witchery.pott.expulso"){ + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + double radius = 8.0D; + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, spell.boundingBox.expand(radius, radius, radius)); + boolean hit = false; + for (Object obj : list) { + EntityLivingBase target = (EntityLivingBase)obj; + if (target != caster && target.getDistanceToEntity((Entity)spell) <= radius) { + // Disarm: drop whatever the target is holding. + ItemStack held = target.getHeldItem(); + if (held != null) { + target.entityDropItem(held, 0.5f); + target.setCurrentItemOrArmor(0, (ItemStack)null); + } + // Knock the target away from the blast. + double dX = target.posX - spell.posX; + double dZ = target.posZ - spell.posZ; + double len = Math.sqrt(dX * dX + dZ * dZ); + if (len > 0.001D) { dX /= len; dZ /= len; } + target.addVelocity(dX * 2.0D, 1.5D, dZ * 2.0D); + target.velocityChanged = true; + hit = true; + } + } + if (hit) { + ParticleEffect.EXPLODE.send(SoundEffect.RANDOM_EXPLODE, world, spell.posX, spell.posY, spell.posZ, 2.0D, 2.0D, 16); + } + } + }, new StrokeSet(1, new byte[]{(byte)0,(byte)2,(byte)1,(byte)3})); + Engorgio = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(58, "witchery.pott.engorgio"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + target.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 1200, 4)); + target.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 1200, 1)); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_LEVELUP, (Entity)target, 1.0, 1.0, 16); + } + } + }, new StrokeSet(0, new byte[]{(byte)0,(byte)2,(byte)2,(byte)0})); + FiniteIncantatem = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(59, "witchery.pott.finiteincantatem"){ + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (player.isSneaking()) { + if (!world.isRemote) { + player.clearActivePotions(); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, player, 1.0D, 1.5D, 16); + com.emoniph.witchery.util.ChatUtil.sendTranslated(net.minecraft.util.EnumChatFormatting.GREEN, player, "witchery.pott.finiteincantatem.cleanse"); + } + } else { + super.perform(world, player, effectLevel); + } + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, spell.boundingBox.expand(15.0D, 15.0D, 15.0D)); + for (Object obj : list) { + EntityLivingBase target = (EntityLivingBase)obj; + target.clearActivePotions(); + com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_TARGETS.remove(target); + com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectImperio.IMPERIO_STAYING_TARGETS.remove(target); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, (Entity)target, 1.0, 1.0, 16); + } + if (!world.isRemote) { + int px = (int)spell.posX; + int py = (int)spell.posY; + int pz = (int)spell.posZ; + for (int x = -15; x <= 15; ++x) { + for (int y = -15; y <= 15; ++y) { + for (int z = -15; z <= 15; ++z) { + Block _finB = world.getBlock(px + x, py + y, pz + z); + if (_finB == Witchery.Blocks.FORCE || _finB == Witchery.Blocks.BARRIER || _finB == Witchery.Blocks.GLOW_GLOBE + || _finB == Witchery.Blocks.CIRCLE || _finB == Witchery.Blocks.BRAMBLE || _finB == Witchery.Blocks.VOID_BRAMBLE + || _finB == Witchery.Blocks.PIT_DIRT || _finB == Witchery.Blocks.PIT_GRASS || _finB == net.minecraft.init.Blocks.web + || _finB == net.minecraft.init.Blocks.fire || _finB == net.minecraft.init.Blocks.water || _finB == net.minecraft.init.Blocks.flowing_water || _finB == net.minecraft.init.Blocks.ice) { + world.setBlockToAir(px + x, py + y, pz + z); + ParticleEffect.SMOKE.send(SoundEffect.RANDOM_FIZZ, world, px + x, py + y, pz + z, 0.5D, 0.5D, 16); + } + } + } + } + } + } + }, new StrokeSet(3, new byte[]{(byte)0,(byte)2,(byte)2,(byte)3})); + Herbivicus = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(60, "witchery.pott.herbivicus"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + int px = (int)spell.posX; + int py = (int)spell.posY; + int pz = (int)spell.posZ; + for (int x = -5; x <= 5; ++x) { + for (int y = -2; y <= 2; ++y) { + for (int z = -5; z <= 5; ++z) { + IGrowable growable; + Block block = world.getBlock(px + x, py + y, pz + z); + if (!(block instanceof IGrowable) || !(growable = (IGrowable)block).func_149851_a(world, px + x, py + y, pz + z, world.isRemote)) continue; + growable.func_149853_b(world, world.rand, px + x, py + y, pz + z); + world.playAuxSFX(2005, px + x, py + y, pz + z, 0); + } + } + } + } + } + }, new StrokeSet(2, new byte[]{(byte)0,(byte)2,(byte)3,(byte)1})); + Impervius = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(62, "witchery.pott.impervius"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + target.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); + target.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 6000, 0)); + target.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 2)); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_LEVELUP, (Entity)target, 1.0, 1.0, 16); + } else if (caster != null) { + caster.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); + caster.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 6000, 0)); + caster.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 2)); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_LEVELUP, (Entity)caster, 1.0, 1.0, 16); + } + } + }, new StrokeSet(0, new byte[]{(byte)0,(byte)2,(byte)3,(byte)2})); + Erecto = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(63, "witchery.pott.erecto"){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (player.isSneaking()) { + EntitySpellEffect dummy = new EntitySpellEffect(world, (EntityLivingBase)player, 0.0, 0.0, 0.0, this, effectLevel); + dummy.setPosition(player.posX, player.posY, player.posZ); + this.onCollision(world, (EntityLivingBase)player, new MovingObjectPosition((Entity)player), dummy); + } else { + super.perform(world, player, effectLevel); + } + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + int px = (int)spell.posX; + int py = (int)spell.posY; + int pz = (int)spell.posZ; + EntityPlayer player = caster instanceof EntityPlayer ? (EntityPlayer)caster : null; + for (int x = -2; x <= 2; ++x) { + for (int y = 0; y <= 4; ++y) { + for (int z = -2; z <= 2; ++z) { + if (Math.abs(x) == 2 || Math.abs(z) == 2 || y == 4 || y == 0) { + if (!world.isAirBlock(px + x, py + y, pz + z)) continue; + BlockBarrier.setBlock(world, px + x, py + y, pz + z, 600, true, player); + continue; + } + if (world.getBlock(px + x, py + y, pz + z) != Witchery.Blocks.BARRIER && world.getBlock(px + x, py + y, pz + z) != Witchery.Blocks.FORCE) continue; + world.setBlockToAir(px + x, py + y, pz + z); + } + } + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, spell, 2.0, 2.0, 16); + } + } + }, new StrokeSet(1, new byte[]{(byte)0,(byte)2,(byte)3,(byte)3})); + PortusPersonal = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(64, "witchery.pott.portuspersonal"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote && caster instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)caster; + NBTTagCompound nbt = player.getEntityData(); + if (nbt.hasKey("PortusX")) { + int dx = nbt.getInteger("PortusX"); + int dy = nbt.getInteger("PortusY"); + int dz = nbt.getInteger("PortusZ"); + int dim = nbt.getInteger("PortusDim"); + if (player.dimension != dim) { + player.travelToDimension(dim); + } + player.setPositionAndUpdate((double)dx + 0.5, (double)dy + 1.0, (double)dz + 0.5); + nbt.removeTag("PortusX"); + player.addChatMessage((IChatComponent)new ChatComponentText("\u00a7aTe has trasladado a tu punto de guardado personal. Punto borrado.\u00a7r")); + world.playSoundAtEntity((Entity)player, "mob.endermen.portal", 1.0f, 1.0f); + } else { + nbt.setInteger("PortusX", (int)player.posX); + nbt.setInteger("PortusY", (int)player.posY); + nbt.setInteger("PortusZ", (int)player.posZ); + nbt.setInteger("PortusDim", player.dimension); + player.addChatMessage((IChatComponent)new ChatComponentText("\u00a7aPunto de guardado personal creado. Vuelve a lanzar el hechizo para volver aqu\u00ed.\u00a7r")); + world.playSoundAtEntity((Entity)player, "random.levelup", 1.0f, 1.0f); + } + } + } + }, new StrokeSet(3, new byte[]{(byte)0,(byte)3,(byte)0,(byte)1})); + PortusTraslador = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(65, "witchery.pott.portustraslador"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote && caster instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)caster; + ItemStack stack = Witchery.Items.GENERIC.itemChaliceEmpty.createStack(); + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("PosX", (int)player.posX); + nbt.setInteger("PosY", (int)player.posY); + nbt.setInteger("PosZ", (int)player.posZ); + nbt.setInteger("PosD", player.dimension); + stack.setTagCompound(nbt); + if (!player.inventory.addItemStackToInventory(stack)) { + player.dropPlayerItemWithRandomChoice(stack, false); + } + player.addChatMessage((IChatComponent)new ChatComponentText("\u00a7aSe ha creado un Traslador vinculado a tu posici\u00f3n actual. Haz clic derecho sosteni\u00e9ndolo para regresar aqu\u00ed.\u00a7r")); + world.playSoundAtEntity((Entity)player, "random.levelup", 1.0f, 1.0f); + } + } + }, new StrokeSet(3, new byte[]{(byte)0,(byte)3,(byte)0,(byte)3})); + TaglockHex = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(72, "witchery.pott.taglockhex"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase && caster instanceof EntityPlayer) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + if (!world.isRemote) { + ItemStack taglock = new ItemStack((Item)Witchery.Items.TAGLOCK_KIT, 1, 1); + Witchery.Items.TAGLOCK_KIT.setTaglockForEntity(taglock, (EntityPlayer)caster, (Entity)target, true, (Integer)1); + world.spawnEntityInWorld((Entity)new EntityItem(world, target.posX, target.posY, target.posZ, taglock)); + ParticleEffect.MAGIC_CRIT.send(SoundEffect.WATER_SPLASH, (Entity)target, 0.5, 1.0, 16); + } + } + } + }.setColor(0xFF0000).setSize(1.0f), new StrokeSet(1, new byte[]{(byte)0,(byte)3,(byte)2,(byte)0})); + SmeltRay = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(73, "witchery.pott.smeltray"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && !world.isRemote) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + ArrayList drops; + Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); + ItemStack stack = new ItemStack(block, 1, meta); + ItemStack smelted = FurnaceRecipes.smelting().getSmeltingResult(stack); + if (smelted == null && (drops = block.getDrops(world, mop.blockX, mop.blockY, mop.blockZ, meta, 0)) != null && !drops.isEmpty() && (smelted = FurnaceRecipes.smelting().getSmeltingResult((ItemStack)drops.get(0))) == null && block instanceof BlockSand) { + smelted = new ItemStack(Blocks.glass); + } + if (smelted != null) { + world.setBlockToAir(mop.blockX, mop.blockY, mop.blockZ); + world.spawnEntityInWorld((Entity)new EntityItem(world, (double)mop.blockX, (double)mop.blockY, (double)mop.blockZ, smelted.copy())); + ParticleEffect.FLAME.send(SoundEffect.MOB_GHAST_FIREBALL, world, mop.blockX, mop.blockY, mop.blockZ, 1.0, 1.0, 16); + } + } else if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null && mop.entityHit instanceof EntityItem) { + EntityItem eItem = (EntityItem)mop.entityHit; + ItemStack smelted = FurnaceRecipes.smelting().getSmeltingResult(eItem.getEntityItem()); + if (smelted != null) { + ItemStack res = smelted.copy(); + res.stackSize = eItem.getEntityItem().stackSize; + eItem.setEntityItemStack(res); + ParticleEffect.FLAME.send(SoundEffect.MOB_GHAST_FIREBALL, (Entity)eItem, 1.0, 1.0, 16); + } + } + } + } + }.setColor(0xFFAA00).setSize(1.0f), new StrokeSet(3, new byte[]{(byte)0,(byte)3,(byte)2,(byte)1})); + EarthPillar = EffectRegistry.instance().addEffect(new SymbolEffect(74, "witchery.pott.earthpillar", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 8.0); + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && !world.isRemote) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + for (int y = 0; y < 3; ++y) { + if (!world.isAirBlock(mop.blockX + x, mop.blockY + y + 1, mop.blockZ + z)) continue; + world.setBlock(mop.blockX + x, mop.blockY + y + 1, mop.blockZ + z, Blocks.dirt); + } + } + } + if (player.posX >= (double)mop.blockX - 1.5 && player.posX <= (double)mop.blockX + 2.5 && player.posZ >= (double)mop.blockZ - 1.5 && player.posZ <= (double)mop.blockZ + 2.5 && player.posY >= (double)mop.blockY && player.posY <= (double)mop.blockY + 3.0) { + player.setPositionAndUpdate(player.posX, (double)mop.blockY + 4.0, player.posZ); + } + ParticleEffect.EXPLODE.send(SoundEffect.RANDOM_EXPLODE, world, mop.blockX, mop.blockY, mop.blockZ, 2.0, 2.0, 16); + } + } + }, new StrokeSet(0, new byte[]{(byte)0,(byte)3,(byte)2,(byte)3})); + Transmutation = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(75, "witchery.pott.transmutation"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && !world.isRemote) { + Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + Block newBlock = null; + if (b == Blocks.dirt) { + newBlock = Blocks.sand; + } else if (b == Blocks.sand) { + newBlock = Blocks.dirt; + } else if (b == Blocks.stone) { + newBlock = Blocks.cobblestone; + } else if (b == Blocks.cobblestone) { + newBlock = Blocks.stone; + } else if (b == Blocks.log || b == Blocks.log2) { + newBlock = Blocks.planks; + } + if (newBlock != null) { + world.setBlock(mop.blockX, mop.blockY, mop.blockZ, (Block)newBlock); + ParticleEffect.SPELL_COLORED.send(SoundEffect.RANDOM_LEVELUP, world, mop.blockX, mop.blockY, mop.blockZ, 1.0, 1.0, 16); + } + } + } + }.setColor(0x9900CC).setSize(1.5f), new StrokeSet(2, new byte[]{(byte)1,(byte)1,(byte)0,(byte)1})); + Excavation = EffectRegistry.instance().addEffect(new SymbolEffect(76, "witchery.pott.excavation", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + MovingObjectPosition mop = InfusionOtherwhere.doCustomRayTrace(world, player, true, 8.0); + if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && !world.isRemote) { + for (int x = -1; x <= 1; ++x) { + for (int y = -1; y <= 1; ++y) { + for (int z = -1; z <= 1; ++z) { + Block b = world.getBlock(mop.blockX + x, mop.blockY + y, mop.blockZ + z); + if (b == Blocks.air || b == Blocks.bedrock || !(b.getBlockHardness(world, mop.blockX + x, mop.blockY + y, mop.blockZ + z) >= 0.0f)) continue; + b.dropBlockAsItem(world, mop.blockX + x, mop.blockY + y, mop.blockZ + z, world.getBlockMetadata(mop.blockX + x, mop.blockY + y, mop.blockZ + z), 0); + world.setBlockToAir(mop.blockX + x, mop.blockY + y, mop.blockZ + z); + } + } + } + ParticleEffect.EXPLODE.send(SoundEffect.RANDOM_EXPLODE, world, mop.blockX, mop.blockY, mop.blockZ, 2.0, 2.0, 16); + } + } + }, new StrokeSet(1, new byte[]{(byte)1,(byte)1,(byte)0,(byte)2})); + BroomSummon = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(77, "witchery.pott.broomsummon"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote && mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + EntityBroom broom = new EntityBroom(world); + broom.setLocationAndAngles(mop.blockX, mop.blockY + 1, mop.blockZ, 0.0f, 0.0f); + world.spawnEntityInWorld((Entity)broom); + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, world, mop.blockX, mop.blockY, mop.blockZ, 1.0, 1.0, 16); + } + } + }.setColor(8409152).setSize(2.0f), new StrokeSet(0, new byte[]{(byte)1,(byte)1,(byte)0,(byte)3})); + ToadLeap = EffectRegistry.instance().addEffect(new SymbolEffect(78, "witchery.pott.toadleap", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (!world.isRemote) { + player.addVelocity(0.0, 1.5, 0.0); + player.velocityChanged = true; + player.fallDistance = -20.0f; + ParticleEffect.SLIME.send(SoundEffect.MOB_SLIME_BIG, (Entity)player, 1.0, 1.0, 16); + } + } + }, new StrokeSet(3, new byte[]{(byte)1,(byte)1,(byte)1,(byte)2})); + EtherealVault = EffectRegistry.instance().addEffect(new SymbolEffect(79, "witchery.pott.etherealvault", 1, false, false, null, 0, true){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (!world.isRemote) { + player.displayGUIChest((IInventory)player.getInventoryEnderChest()); + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, (Entity)player, 1.0, 1.0, 16); + } + } + }, new StrokeSet(0, new byte[]{(byte)1,(byte)1,(byte)3,(byte)0})); + Orchideous = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(81, "witchery.pott.orchideous"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote && mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int cx = mop.blockX; + int cy = mop.blockY; + int cz = mop.blockZ; + for (int x = -3; x <= 3; ++x) { + for (int z = -3; z <= 3; ++z) { + Block b; + if (world.rand.nextInt(3) != 0 || (b = world.getBlock(cx + x, cy, cz + z)) != Blocks.dirt && b != Blocks.grass || !world.isAirBlock(cx + x, cy + 1, cz + z)) continue; + world.setBlock(cx + x, cy, cz + z, (Block)Blocks.grass); + world.setBlock(cx + x, cy + 1, cz + z, (Block)Blocks.red_flower, world.rand.nextInt(9), 3); + } + } + ParticleEffect.SLIME.send(SoundEffect.MOB_SLIME_BIG, spell, 2.0, 2.0, 16); + } + } + }, new StrokeSet(1, new byte[]{(byte)1,(byte)2,(byte)2,(byte)1})); + Fumos = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(82, "witchery.pott.fumos"){ + + @Override + public void perform(World world, EntityPlayer player, int effectLevel) { + if (player.isSneaking()) { + EntitySpellEffect dummy = new EntitySpellEffect(world, (EntityLivingBase)player, 0.0, 0.0, 0.0, this, effectLevel); + dummy.setPosition(player.posX, player.posY, player.posZ); + this.onCollision(world, (EntityLivingBase)player, new MovingObjectPosition((Entity)player), dummy); + } else { + super.perform(world, player, effectLevel); + } + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + for (int i = 0; i < 30; ++i) { + ParticleEffect.LARGE_SMOKE.send(SoundEffect.NONE, spell, 10.0, 10.0, 32); + ParticleEffect.SMOKE.send(SoundEffect.NONE, spell, 10.0, 10.0, 32); + } + ParticleEffect.LARGE_SMOKE.send(SoundEffect.RANDOM_FIZZ, spell, 10.0, 10.0, 32); + + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, spell.boundingBox.expand(8.0D, 8.0D, 8.0D)); + for (Object obj : list) { + EntityLivingBase target = (EntityLivingBase)obj; + if (target == caster || (caster instanceof EntityPlayer && target instanceof EntityPlayer && !MinecraftServer.getServer().isPVPEnabled())) { + target.addPotionEffect(new PotionEffect(Potion.invisibility.id, 200, 0)); + } else { + target.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 0)); + } + } + } + } + }, new StrokeSet(1, new byte[]{(byte)1,(byte)2,(byte)2,(byte)2})); + Incarcerous = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(83, "witchery.pott.incarcerous"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote && mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase)mop.entityHit; + if (target instanceof net.minecraft.entity.monster.EntitySpider) { + return; // Prevent crash when webs touch spiders + } + int cx = (int)target.posX; + int cy = (int)target.posY; + int cz = (int)target.posZ; + for (int x = -1; x <= 1; ++x) { + for (int y = 0; y <= 1; ++y) { + for (int z = -1; z <= 1; ++z) { + if (Math.abs(x) + Math.abs(z) > 1 || !world.isAirBlock(cx + x, cy + y, cz + z)) continue; + world.setBlock(cx + x, cy + y, cz + z, Blocks.web); + } + } + } + ParticleEffect.MAGIC_CRIT.send(SoundEffect.RANDOM_POP, (Entity)target, 1.0, 1.0, 16); + } + } + }, new StrokeSet(3, new byte[]{(byte)1,(byte)3,(byte)1,(byte)0})); + Vermillious = EffectRegistry.instance().addEffect(new SymbolEffectProjectile(84, "witchery.pott.vermillious"){ + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote) { + ItemStack itemstack = new ItemStack(Items.fireworks); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + NBTTagCompound explosion = new NBTTagCompound(); + explosion.setBoolean("Flicker", true); + explosion.setBoolean("Trail", true); + explosion.setByte("Type", (byte)1); + explosion.setIntArray("Colors", new int[]{0xFF0000}); + nbttaglist.appendTag((NBTBase)explosion); + nbttagcompound1.setTag("Explosions", (NBTBase)nbttaglist); + nbttagcompound1.setByte("Flight", (byte)2); + nbttagcompound.setTag("Fireworks", (NBTBase)nbttagcompound1); + itemstack.setTagCompound(nbttagcompound); + EntityFireworkRocket rocket = new EntityFireworkRocket(world, spell.posX, spell.posY + 1.0, spell.posZ, itemstack); + world.spawnEntityInWorld((Entity)rocket); + world.playSoundAtEntity((Entity)rocket, "fireworks.launch", 3.0f, 1.0f); + } + } + }, new StrokeSet(1, new byte[]{(byte)1,(byte)3,(byte)1,(byte)2})); + } + + public static interface IEntityEffect { + public void doAction(World var1, EntityLivingBase var2, double var3, double var5, double var7, T var9); + } + + private static interface IBlockEffect { + public void doAction(World var1, EntityLivingBase var2, int var3, int var4, int var5, Block var6, int var7); + } + + public static class ErectoTickHandler { + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + @SubscribeEvent + public void onServerTick(TickEvent.ServerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + List list = erectoTasks; + synchronized (list) { + Iterator it = erectoTasks.iterator(); + while (it.hasNext()) { + WorldServer world; + ErectoTask task = it.next(); + --task.ticks; + if (task.ticks > 0) continue; + MinecraftServer server = MinecraftServer.getServer(); + if (server != null && (world = server.worldServerForDimension(task.dim)) != null) { + for (int x = -2; x <= 2; ++x) { + for (int y = 0; y <= 4; ++y) { + for (int z = -2; z <= 2; ++z) { + if (Math.abs(x) != 2 && Math.abs(z) != 2 && y != 4 && y != 0 || world.getBlock(task.x + x, task.y + y, task.z + z) != Witchery.Blocks.FORCE) continue; + world.setBlockToAir(task.x + x, task.y + y, task.z + z); + } + } + } + } + it.remove(); + } + } + } + } + } + + public static class ErectoTask { + public int ticks; + public int x; + public int y; + public int z; + public int dim; + + public ErectoTask(int t, int x, int y, int z, int d) { + this.ticks = t; + this.x = x; + this.y = y; + this.z = z; + this.dim = d; + } + } +} + diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/InventoryMobEquipment.java b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/InventoryMobEquipment.java new file mode 100644 index 0000000..45d1ccd --- /dev/null +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/InventoryMobEquipment.java @@ -0,0 +1,99 @@ +package com.emoniph.witchery.infusion.infusions.symbols; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +public class InventoryMobEquipment implements IInventory { + private final EntityLivingBase target; + + public InventoryMobEquipment(EntityLivingBase target) { + this.target = target; + } + + @Override + public int getSizeInventory() { + return 5; + } + + @Override + public ItemStack getStackInSlot(int slot) { + if (slot >= 0 && slot <= 4) { + return target.getEquipmentInSlot(slot); + } + return null; + } + + @Override + public ItemStack decrStackSize(int slot, int amount) { + ItemStack stack = getStackInSlot(slot); + if (stack != null) { + if (stack.stackSize <= amount) { + setInventorySlotContents(slot, null); + return stack; + } else { + ItemStack split = stack.splitStack(amount); + if (stack.stackSize == 0) { + setInventorySlotContents(slot, null); + } + return split; + } + } + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + ItemStack stack = getStackInSlot(slot); + if (stack != null) { + setInventorySlotContents(slot, null); + return stack; + } + return null; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + if (slot >= 0 && slot <= 4) { + target.setCurrentItemOrArmor(slot, stack); + } + } + + @Override + public String getInventoryName() { + return "Imperio: " + target.getCommandSenderName(); + } + + @Override + public boolean hasCustomInventoryName() { + return true; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public void markDirty() { + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return target.isEntityAlive() && player.getDistanceSqToEntity(target) <= 1024.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + return true; + } +} diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffect.java b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffect.java index 7caf721..e1f287a 100644 --- a/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffect.java +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffect.java @@ -47,6 +47,14 @@ public int getEffectID() { return this.effectID; } + public int getDisplayColor() { + if(this instanceof SymbolEffectProjectile) { + return ((SymbolEffectProjectile)this).getColor(); + } + + return this.curse?13382297:11645183; + } + public boolean isCurse() { return this.curse; } diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffectImperio.java b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffectImperio.java new file mode 100644 index 0000000..a3011de --- /dev/null +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffectImperio.java @@ -0,0 +1,42 @@ +package com.emoniph.witchery.infusion.infusions.symbols; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.entity.EntitySpellEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; + +public class SymbolEffectImperio extends SymbolEffectProjectile { + + public static final Map IMPERIO_TARGETS = new WeakHashMap(); + public static final Set IMPERIO_STAYING_TARGETS = Collections.newSetFromMap(new WeakHashMap()); + + public SymbolEffectImperio(int effectID, String unlocalisedName) { + super(effectID, unlocalisedName, 200, false, false, "witchery.pott.imperio", 100); + this.setSize(1.0f); + this.setColor(0x00FF00); + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + if (!world.isRemote && caster instanceof EntityPlayer && mop != null && mop.entityHit instanceof EntityLivingBase) { + EntityLivingBase target = (EntityLivingBase) mop.entityHit; + EntityPlayer player = (EntityPlayer) caster; + + // Apply paralysis to target temporarily to signify mind control shock + target.addPotionEffect(new PotionEffect(Witchery.Potions.PARALYSED.id, 100, 0, true)); + + IMPERIO_TARGETS.put(target, player); + + player.addChatMessage(new ChatComponentText("La criatura ha caído bajo tu control. Usa /imperio para darle órdenes.")); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffectTelekinesis.java b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffectTelekinesis.java new file mode 100644 index 0000000..a97a68b --- /dev/null +++ b/src/main/java/com/emoniph/witchery/infusion/infusions/symbols/SymbolEffectTelekinesis.java @@ -0,0 +1,76 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * cpw.mods.fml.common.network.simpleimpl.IMessage + * net.minecraft.entity.EntityLivingBase + * net.minecraft.entity.player.EntityPlayer + * net.minecraft.util.MovingObjectPosition + * net.minecraft.world.World + */ +package com.emoniph.witchery.infusion.infusions.symbols; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.entity.EntitySpellEffect; +import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffectProjectile; +import com.emoniph.witchery.network.PacketPushTarget; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class SymbolEffectTelekinesis +extends SymbolEffectProjectile { + public SymbolEffectTelekinesis(int effectID, String unlocalisedName) { + super(effectID, unlocalisedName); + } + + @Override + public void onCollision(World world, EntityLivingBase caster, MovingObjectPosition mop, EntitySpellEffect spell) { + double radius = spell.getEffectLevel() == 1 ? 0.0 : (spell.getEffectLevel() == 2 ? 3.0 : 6.0); + final boolean isSneaking = caster != null && caster.isSneaking(); + final double spellX = spell.motionX; + final double spellZ = spell.motionZ; + final double casterX = caster != null ? caster.posX : spell.posX; + final double casterZ = caster != null ? caster.posZ : spell.posZ; + EffectRegistry.applyEntityEffect(world, caster, mop, spell.posX, spell.posY, spell.posZ, radius, EntityLivingBase.class, new EffectRegistry.IEntityEffect(){ + + @Override + public void doAction(World world, EntityLivingBase actor, double x, double y, double z, EntityLivingBase target) { + if (target != actor) { + double motionZ; + double motionX; + double acceleration; + double d = acceleration = isSneaking ? 2.5 : -1.5; + if (isSneaking) { + motionX = spellX * acceleration; + motionZ = spellZ * acceleration; + } else { + double dX = casterX - target.posX; + double dZ = casterZ - target.posZ; + double distance = Math.sqrt(dX * dX + dZ * dZ); + if (distance > 0.0) { + motionX = dX / distance * Math.abs(acceleration); + motionZ = dZ / distance * Math.abs(acceleration); + } else { + motionX = 0.0; + motionZ = 0.0; + } + } + double motionY = 0.4; + if (target instanceof EntityPlayer) { + EntityPlayer targetPlayer = (EntityPlayer)target; + Witchery.packetPipeline.sendTo((IMessage)new PacketPushTarget(motionX, motionY, motionZ), targetPlayer); + } else { + target.motionX = motionX; + target.motionY = motionY; + target.motionZ = motionZ; + } + } + } + }); + } +} + diff --git a/src/main/java/com/emoniph/witchery/item/ItemGeneral.java b/src/main/java/com/emoniph/witchery/item/ItemGeneral.java index da71043..a577316 100644 --- a/src/main/java/com/emoniph/witchery/item/ItemGeneral.java +++ b/src/main/java/com/emoniph/witchery/item/ItemGeneral.java @@ -276,6 +276,7 @@ public class ItemGeneral extends ItemBase { public final ItemGeneral.SubItem itemBloodWarm; public final ItemGeneral.SubItem itemBloodLiliths; public final ItemGeneral.SubItem itemHeartOfGold; + public final ItemGeneral.SubItem itemFlooPowder; @SideOnly(Side.CLIENT) private IIcon overlayGenericIcon; @SideOnly(Side.CLIENT) @@ -644,6 +645,7 @@ public void onDrunk(World world, EntityPlayer player, ItemStack itemstack) { } }, this.subItems); this.itemHeartOfGold = ItemGeneral.SubItem.register(new ItemGeneral.SubItem(165, "heartofgold"), this.subItems); + this.itemFlooPowder = ItemGeneral.SubItem.register(new ItemGeneral.SubItem(166, "floopowder"), this.subItems); this.setMaxDamage(0); this.setMaxStackSize(64); this.setHasSubtypes(true); @@ -1122,25 +1124,17 @@ private boolean isPost(World world, int x, int y, int z, boolean bottomSolid, bo public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { Block block = BlockUtil.getBlock(world, x, y, z); - if(this.itemWaystoneBound.isMatch(stack) && block == Witchery.Blocks.CRYSTAL_BALL) { - if(!world.isRemote && BlockCrystalBall.tryConsumePower(world, player, x, y, z)) { - NBTTagCompound tag = stack.getTagCompound(); - if(tag != null && tag.hasKey("PosX") && tag.hasKey("PosY") && tag.hasKey("PosZ") && tag.hasKey("PosD")) { - int newX = tag.getInteger("PosX"); - int newY = tag.getInteger("PosY"); - int newZ = tag.getInteger("PosZ"); - int newD = tag.getInteger("PosD"); - double MAX_DISTANCE = 22500.0D; - if(newD == player.dimension && player.getDistanceSq((double)newX, (double)newY, (double)newZ) <= 22500.0D) { - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); - } else { - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + if(this.itemWaystoneBound.isMatch(stack) && block == Witchery.Blocks.CHALICE) { + if(!world.isRemote) { + if(this.teleportToLocation(world, stack, player, 0, true)) { + --stack.stackSize; + if(stack.stackSize <= 0) { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); } + world.playSoundAtEntity(player, "mob.endermen.portal", 1.0F, 1.0F); } else { SoundEffect.NOTE_SNARE.playAtPlayer(world, player); } - } else if(world.isRemote) { - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); } return !world.isRemote; @@ -1217,6 +1211,21 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer this.setThrowableHeading(var7, var7.motionX, var7.motionY, var7.motionZ, 1.0F, 1.0F); world.spawnEntityInWorld(var7); } + } else if((this.itemWaystone.isMatch(itemstack) || this.itemChaliceEmpty.isMatch(itemstack) || this.itemChaliceFull.isMatch(itemstack)) && isWaystoneBound(itemstack)) { + if(!world.isRemote) { + if(this.teleportToLocation(world, itemstack, player, 0, true)) { + --itemstack.stackSize; + if(itemstack.stackSize <= 0) { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + world.playSoundAtEntity(player, "mob.endermen.portal", 1.0F, 1.0F); + } else { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } + } else if(this.itemFlooPowder.isMatch(itemstack)) { + this.useFlooPowder(world, player, itemstack); } else if(this.itemSeerStone.isMatch(itemstack)) { this.useSeerStone(world, player, itemstack); } else if(this.itemIcyNeedle.isMatch(itemstack)) { @@ -1267,6 +1276,62 @@ private void useIcyNeedle(World world, EntityPlayer player, ItemStack itemstack) } + private void useFlooPowder(World world, EntityPlayer player, ItemStack itemstack) { + // Throw the Floo Powder onto a nearby fire; the flame turns verdant green (Floo Fire). + // Then, holding a bound Waystone, step into the green flame to travel to its location. + MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(world, player, true); + if(mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int fireX = mop.blockX; + int fireY = mop.blockY; + int fireZ = mop.blockZ; + Block hit = world.getBlock(fireX, fireY, fireZ); + if(hit != Blocks.fire) { + // Allow aiming at the block under/beside the fire (the flame sits on the hit face). + switch(mop.sideHit) { + case 0: + --fireY; + break; + case 1: + ++fireY; + break; + case 2: + --fireZ; + break; + case 3: + ++fireZ; + break; + case 4: + --fireX; + break; + case 5: + ++fireX; + } + + hit = world.getBlock(fireX, fireY, fireZ); + } + + if(hit == Blocks.fire) { + if(!world.isRemote) { + world.setBlock(fireX, fireY, fireZ, Witchery.Blocks.FLOO_FIRE); + world.playSoundEffect((double)fireX + 0.5D, (double)fireY + 0.5D, (double)fireZ + 0.5D, "fire.ignite", 1.0F, 0.6F); + if(!player.capabilities.isCreativeMode) { + --itemstack.stackSize; + if(itemstack.stackSize <= 0) { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + } + } + + return; + } + } + + if(!world.isRemote) { + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + + } + public void throwBrew(ItemStack itemstack, World world, EntityPlayer player) { if(itemstack != null && itemstack.getItem() == this) { ItemGeneral.SubItem subItem = (ItemGeneral.SubItem)this.subItems.get(itemstack.getItemDamage()); diff --git a/src/main/java/com/emoniph/witchery/item/ItemMysticBranch.java b/src/main/java/com/emoniph/witchery/item/ItemMysticBranch.java index 1e6d3b3..74ee474 100644 --- a/src/main/java/com/emoniph/witchery/item/ItemMysticBranch.java +++ b/src/main/java/com/emoniph/witchery/item/ItemMysticBranch.java @@ -1,201 +1,256 @@ -package com.emoniph.witchery.item; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockPlacedItem; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; -import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; -import com.emoniph.witchery.item.ItemBase; -import com.emoniph.witchery.network.PacketSpellPrepared; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.SoundEffect; -import com.emoniph.witchery.util.TimeUtil; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class ItemMysticBranch extends ItemBase { - - private static final float THRESHOLD_ORTHOGONAL = 7.0F; - private static final int MAX_STROKES = 15; - - - public ItemMysticBranch() { - this.setMaxStackSize(1); - this.setFull3D(); - } - - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(ItemStack stack) { - return EnumRarity.rare; - } - - @SideOnly(Side.CLIENT) - public boolean isFull3D() { - return true; - } - - public EnumAction getItemUseAction(ItemStack stack) { - return EnumAction.block; - } - - public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) { - return super.onDroppedByPlayer(item, player); - } - - public int getMaxItemUseDuration(ItemStack stack) { - return '\u8ca0'; - } - - public boolean hasEffect(ItemStack par1ItemStack, int pass) { - return true; - } - - public void onUpdate(ItemStack stack, World world, Entity entity, int invSlot, boolean isHeld) {} - - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - NBTTagCompound nbtTag = player.getEntityData(); - if(!player.worldObj.isRemote) { - nbtTag.removeTag("WITCSpellEffectID"); - nbtTag.removeTag("WITCSpellEffectEnhanced"); - } - - nbtTag.setByteArray("Strokes", new byte[0]); - nbtTag.setFloat("startPitch", player.rotationPitch); - nbtTag.setFloat("startYaw", player.rotationYawHead); - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); - return stack; - } - - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - if(world.getBlock(x, y, z) == Witchery.Blocks.ALTAR && side == 1 && world.getBlock(x, y + 1, z) == Blocks.air) { - BlockPlacedItem.placeItemInWorld(stack, player, world, x, y + 1, z); - player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); - return !world.isRemote; - } else { - return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ); - } - } - - public void onUsingTick(ItemStack stack, EntityPlayer player, int countdown) { - if(player.worldObj.isRemote) { - NBTTagCompound nbtTag = player.getEntityData(); - if(nbtTag == null) { - return; - } - - float yawDiff = nbtTag.getFloat("startYaw") - player.rotationYawHead; - float pitchDiff = nbtTag.getFloat("startPitch") - player.rotationPitch; - byte[] strokes = nbtTag.getByteArray("Strokes"); - int strokesStart = strokes.length; - if(!EffectRegistry.instance().contains(strokes) && strokesStart <= 15) { - if(pitchDiff >= 7.0F) { - strokes = this.addNewStroke(nbtTag, strokes, (byte)0); - } else if(pitchDiff <= -7.0F) { - strokes = this.addNewStroke(nbtTag, strokes, (byte)1); - } else if(yawDiff <= -7.0F) { - strokes = this.addNewStroke(nbtTag, strokes, (byte)2); - } else if(yawDiff >= 7.0F) { - strokes = this.addNewStroke(nbtTag, strokes, (byte)3); - } - - if(strokes.length > strokesStart) { - nbtTag.setFloat("startPitch", player.rotationPitch); - nbtTag.setFloat("startYaw", player.rotationYawHead); - } - - SymbolEffect effect = EffectRegistry.instance().getEffect(strokes); - if(effect != null) { - int level = EffectRegistry.instance().getLevel(strokes); - Witchery.packetPipeline.sendToServer(new PacketSpellPrepared(effect, level)); - } - } - } - - } - - public byte[] addNewStroke(NBTTagCompound nbtTag, byte[] strokes, byte stroke) { - byte[] newStrokes = new byte[strokes.length + 1]; - System.arraycopy(strokes, 0, newStrokes, 0, strokes.length); - newStrokes[newStrokes.length - 1] = stroke; - nbtTag.setByteArray("Strokes", newStrokes); - return newStrokes; - } - - public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int countdown) { - NBTTagCompound nbtTag = player.getEntityData(); - if(nbtTag != null) { - if(!world.isRemote) { - int effectID = nbtTag.getInteger("WITCSpellEffectID"); - int level = 1; - if(nbtTag.hasKey("WITCSpellEffectEnhanced")) { - level = nbtTag.getInteger("WITCSpellEffectEnhanced"); - nbtTag.removeTag("WITCSpellEffectEnhanced"); - } - - nbtTag.removeTag("WITCSpellEffectID"); - SymbolEffect effect = EffectRegistry.instance().getEffect(effectID); - NBTTagCompound nbtPerm = Infusion.getNBT(player); - if(effect != null) { - if(!player.capabilities.isCreativeMode && (nbtPerm == null || !nbtPerm.hasKey("witcheryInfusionID") || !nbtPerm.hasKey("witcheryInfusionCharges"))) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.infusionrequired", new Object[0]); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } else if(effect.hasValidInfusion(player, nbtPerm.getInteger("witcheryInfusionID"))) { - if(effect.hasValidKnowledge(player, nbtPerm)) { - long ticksRemaining = effect.cooldownRemaining(player, nbtPerm); - if(ticksRemaining > 0L && !player.capabilities.isCreativeMode) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.effectoncooldown", new Object[]{Long.valueOf(TimeUtil.ticksToSecs(ticksRemaining)).toString()}); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } else { - if(level > 1) { - int newLevel = 1; - if(player.isPotionActive(Witchery.Potions.WORSHIP)) { - PotionEffect potion = player.getActivePotionEffect(Witchery.Potions.WORSHIP); - if(level <= potion.getAmplifier() + 2) { - newLevel = level; - } - } - - level = newLevel; - } - - if(!player.capabilities.isCreativeMode && nbtPerm.getInteger("witcheryInfusionCharges") < effect.getChargeCost(world, player, level)) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.nocharges", new Object[0]); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } else { - effect.perform(world, player, level); - if(!player.capabilities.isCreativeMode) { - Infusion.setCurrentEnergy(player, nbtPerm.getInteger("witcheryInfusionCharges") - effect.getChargeCost(world, player, level)); - } - } - } - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.unknowneffect", new Object[0]); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.infernalrequired", new Object[0]); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.unknownsymbol", new Object[0]); - SoundEffect.NOTE_SNARE.playAtPlayer(world, player); - } - } else { - nbtTag.removeTag("Strokes"); - nbtTag.removeTag("startYaw"); - nbtTag.removeTag("startPitch"); - } - } - - } -} +package com.emoniph.witchery.item; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockPlacedItem; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; +import com.emoniph.witchery.item.ItemBase; +import com.emoniph.witchery.network.PacketSpellPrepared; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumAction; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.Potion; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public class ItemMysticBranch extends ItemBase { + + private static final float THRESHOLD_ORTHOGONAL = 7.0F; + private static final int MAX_STROKES = 15; + + + public ItemMysticBranch() { + this.setMaxStackSize(1); + this.setFull3D(); + } + + @SideOnly(Side.CLIENT) + public EnumRarity getRarity(ItemStack stack) { + return EnumRarity.rare; + } + + @SideOnly(Side.CLIENT) + public boolean isFull3D() { + return true; + } + + public EnumAction getItemUseAction(ItemStack stack) { + return EnumAction.block; + } + + public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) { + return super.onDroppedByPlayer(item, player); + } + + public int getMaxItemUseDuration(ItemStack stack) { + return '\u8ca0'; + } + + public boolean hasEffect(ItemStack par1ItemStack, int pass) { + return true; + } + + public void onUpdate(ItemStack stack, World world, Entity entity, int invSlot, boolean isHeld) {} + + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + NBTTagCompound nbtTag = player.getEntityData(); + if(!player.worldObj.isRemote) { + nbtTag.removeTag("WITCSpellEffectID"); + nbtTag.removeTag("WITCSpellEffectEnhanced"); + } + + nbtTag.setByteArray("Strokes", new byte[0]); + nbtTag.setFloat("startPitch", player.rotationPitch); + nbtTag.setFloat("startYaw", player.rotationYawHead); + player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); + return stack; + } + + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + if(world.getBlock(x, y, z) == Witchery.Blocks.ALTAR && side == 1 && world.getBlock(x, y + 1, z) == Blocks.air) { + BlockPlacedItem.placeItemInWorld(stack, player, world, x, y + 1, z); + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + return !world.isRemote; + } else { + return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ); + } + } + + public void onUsingTick(ItemStack stack, EntityPlayer player, int countdown) { + if(!player.worldObj.isRemote) { + NBTTagCompound nbtServer = player.getEntityData(); + if(nbtServer != null && nbtServer.hasKey("WITCSpellEffectID") && countdown % 6 == 0) { + SymbolEffect prepared = EffectRegistry.instance().getEffect(nbtServer.getInteger("WITCSpellEffectID")); + if(prepared != null) { + // Continuous casting aura, visible to all nearby players while a spell is charged. + ParticleEffect.SPELL_COLORED.send(SoundEffect.NONE, player, 0.45D, 1.6D, 32, prepared.getDisplayColor()); + } + } + + return; + } + + if(player.worldObj.isRemote) { + NBTTagCompound nbtTag = player.getEntityData(); + if(nbtTag == null) { + return; + } + + float yawDiff = nbtTag.getFloat("startYaw") - player.rotationYawHead; + float pitchDiff = nbtTag.getFloat("startPitch") - player.rotationPitch; + byte[] strokes = nbtTag.getByteArray("Strokes"); + int strokesStart = strokes.length; + if(!EffectRegistry.instance().contains(strokes) && strokesStart <= 15) { + if(pitchDiff >= 7.0F) { + strokes = this.addNewStroke(nbtTag, strokes, (byte)0); + } else if(pitchDiff <= -7.0F) { + strokes = this.addNewStroke(nbtTag, strokes, (byte)1); + } else if(yawDiff <= -7.0F) { + strokes = this.addNewStroke(nbtTag, strokes, (byte)2); + } else if(yawDiff >= 7.0F) { + strokes = this.addNewStroke(nbtTag, strokes, (byte)3); + } + + if(strokes.length > strokesStart) { + nbtTag.setFloat("startPitch", player.rotationPitch); + nbtTag.setFloat("startYaw", player.rotationYawHead); + + SymbolEffect effect = EffectRegistry.instance().getEffect(strokes); + if(effect != null) { + int level = EffectRegistry.instance().getLevel(strokes); + Witchery.packetPipeline.sendToServer(new PacketSpellPrepared(effect, level)); + } + } + } + } + + } + + public byte[] addNewStroke(NBTTagCompound nbtTag, byte[] strokes, byte stroke) { + byte[] newStrokes = new byte[strokes.length + 1]; + System.arraycopy(strokes, 0, newStrokes, 0, strokes.length); + newStrokes[newStrokes.length - 1] = stroke; + nbtTag.setByteArray("Strokes", newStrokes); + return newStrokes; + } + + public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int countdown) { + NBTTagCompound nbtTag = player.getEntityData(); + if(nbtTag != null) { + if(!world.isRemote) { + int effectID = nbtTag.getInteger("WITCSpellEffectID"); + int level = 1; + if(nbtTag.hasKey("WITCSpellEffectEnhanced")) { + level = nbtTag.getInteger("WITCSpellEffectEnhanced"); + nbtTag.removeTag("WITCSpellEffectEnhanced"); + } + + nbtTag.removeTag("WITCSpellEffectID"); + SymbolEffect effect = EffectRegistry.instance().getEffect(effectID); + NBTTagCompound nbtPerm = Infusion.getNBT(player); + if(effect != null) { + if(!player.capabilities.isCreativeMode && (nbtPerm == null || !nbtPerm.hasKey("witcheryInfusionID") || !nbtPerm.hasKey("witcheryInfusionCharges"))) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.infusionrequired", new Object[0]); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } else if(effect.hasValidInfusion(player, nbtPerm.getInteger("witcheryInfusionID"))) { + if(effect.hasValidKnowledge(player, nbtPerm)) { + long ticksRemaining = effect.cooldownRemaining(player, nbtPerm); + if(ticksRemaining > 0L && !player.capabilities.isCreativeMode) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.effectoncooldown", new Object[]{Long.valueOf(TimeUtil.ticksToSecs(ticksRemaining)).toString()}); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } else { + if(!player.capabilities.isCreativeMode && nbtPerm.getInteger("witcheryInfusionCharges") < effect.getChargeCost(world, player, level)) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.nocharges", new Object[0]); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } else { + int covenSize = com.emoniph.witchery.entity.EntityCovenWitch.getCovenSize(player); + int worshipLevel = 0; + if (player.isPotionActive(Witchery.Potions.WORSHIP)) { + worshipLevel = player.getActivePotionEffect(Witchery.Potions.WORSHIP).getAmplifier() + 1; + } + + int skill = Math.min(6, covenSize + (worshipLevel * 2)); + double failureChance = 0.5 * (1.0 - (skill / 6.0)); + + if (!player.capabilities.isCreativeMode && world.rand.nextDouble() < failureChance) { + int mishapType = world.rand.nextInt(3); + if (mishapType == 0) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.fizzle"); + Infusion.setCurrentEnergy(player, Math.max(0, nbtPerm.getInteger("witcheryInfusionCharges") - effect.getChargeCost(world, player, level))); + SoundEffect.RANDOM_FIZZ.playAtPlayer(world, player); + } else if (mishapType == 1) { + int cost = effect.getChargeCost(world, player, level) * 3; + if (nbtPerm.getInteger("witcheryInfusionCharges") < cost) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.clumsy_fail"); + Infusion.setCurrentEnergy(player, 0); + SoundEffect.RANDOM_FIZZ.playAtPlayer(world, player); + } else { + ChatUtil.sendTranslated(EnumChatFormatting.YELLOW, player, "witchery.infuse.branch.clumsy_success"); + effect.perform(world, player, level); + this.announceCastSpell(player, effect); + Infusion.setCurrentEnergy(player, nbtPerm.getInteger("witcheryInfusionCharges") - cost); + } + } else if (mishapType == 2) { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_RED, player, "witchery.infuse.branch.backfire"); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); + player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 0)); + Infusion.setCurrentEnergy(player, Math.max(0, nbtPerm.getInteger("witcheryInfusionCharges") - effect.getChargeCost(world, player, level))); + SoundEffect.RANDOM_FIZZ.playAtPlayer(world, player); + } + } else { + effect.perform(world, player, level); + this.announceCastSpell(player, effect); + if(!player.capabilities.isCreativeMode) { + Infusion.setCurrentEnergy(player, nbtPerm.getInteger("witcheryInfusionCharges") - effect.getChargeCost(world, player, level)); + } + } + } + } + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.unknowneffect", new Object[0]); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.infernalrequired", new Object[0]); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.infuse.branch.unknownsymbol", new Object[0]); + SoundEffect.NOTE_SNARE.playAtPlayer(world, player); + } + } else { + nbtTag.removeTag("Strokes"); + nbtTag.removeTag("startYaw"); + nbtTag.removeTag("startPitch"); + } + } + + } + + private void announceCastSpell(EntityPlayer player, SymbolEffect effect) { + MinecraftServer server = MinecraftServer.getServer(); + if(server != null) { + EnumChatFormatting nameColor = effect.isCurse()?EnumChatFormatting.DARK_PURPLE:EnumChatFormatting.LIGHT_PURPLE; + IChatComponent spoken = new ChatComponentText(nameColor + effect.getLocalizedName() + "!" + EnumChatFormatting.RESET); + IChatComponent chatLine = new ChatComponentTranslation("chat.type.text", new Object[]{player.getDisplayName(), spoken}); + server.getConfigurationManager().sendChatMsg(chatLine); + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/item/ItemWitchHand.java b/src/main/java/com/emoniph/witchery/item/ItemWitchHand.java index fefd04f..4649277 100644 --- a/src/main/java/com/emoniph/witchery/item/ItemWitchHand.java +++ b/src/main/java/com/emoniph/witchery/item/ItemWitchHand.java @@ -1,82 +1,102 @@ -package com.emoniph.witchery.item; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.entity.EntityCovenWitch; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.item.ItemBase; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntityWitch; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.event.entity.living.LivingDeathEvent; - -public class ItemWitchHand extends ItemBase { - - public ItemWitchHand() { - this.setMaxStackSize(1); - this.setFull3D(); - } - - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(ItemStack itemstack) { - return EnumRarity.uncommon; - } - - public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean par5) { - if(entity instanceof EntityPlayer) { - Infusion.Registry.instance().get((EntityPlayer)entity).onUpdate(itemstack, world, (EntityPlayer)entity, par4, par5); - } - - } - - public boolean onLeftClickEntity(ItemStack itemstack, EntityPlayer player, Entity entity) { - Infusion.Registry.instance().get(player).onLeftClickEntity(itemstack, player.worldObj, player, entity); - return true; - } - - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - player.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); - return itemstack; - } - - public int getMaxItemUseDuration(ItemStack itemstack) { - return 400; - } - - public void onUsingTick(ItemStack itemstack, EntityPlayer player, int countdown) { - Infusion.Registry.instance().get(player).onUsingItemTick(itemstack, player.worldObj, player, countdown); - } - - public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int countdown) { - if(world.isRemote || !Infusion.isOnCooldown(world, itemstack)) { - Infusion.Registry.instance().get(player).onPlayerStoppedUsing(itemstack, world, player, countdown); - } - - } - - public static class EventHooks { - - @SubscribeEvent - public void onLivingDeath(LivingDeathEvent event) { - if(!event.entityLiving.worldObj.isRemote && (event.entityLiving instanceof EntityWitch || event.entityLiving instanceof EntityCovenWitch)) { - Entity entitySource = event.source.getSourceOfDamage(); - if(entitySource != null && entitySource instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)entitySource; - boolean hasArthana = player.getHeldItem() != null && player.getHeldItem().getItem() == Witchery.Items.ARTHANA; - if(player.worldObj.rand.nextDouble() < (hasArthana?0.5D:0.33D)) { - ItemStack itemstack = new ItemStack(Witchery.Items.WITCH_HAND); - EntityItem entityItem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, itemstack); - event.entityLiving.worldObj.spawnEntityInWorld(entityItem); - } - } - } - - } - } -} +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * cpw.mods.fml.common.eventhandler.SubscribeEvent + * cpw.mods.fml.relauncher.Side + * cpw.mods.fml.relauncher.SideOnly + * net.minecraft.entity.Entity + * net.minecraft.entity.EntityLivingBase + * net.minecraft.entity.item.EntityItem + * net.minecraft.entity.monster.EntityWitch + * net.minecraft.entity.player.EntityPlayer + * net.minecraft.item.EnumRarity + * net.minecraft.item.ItemStack + * net.minecraft.world.World + * net.minecraftforge.event.entity.living.LivingDeathEvent + */ +package com.emoniph.witchery.item; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.entity.EntityCovenWitch; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.item.ItemBase; +import com.emoniph.witchery.item.WitchHandAbilities; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingDeathEvent; + +public class ItemWitchHand +extends ItemBase { + public ItemWitchHand() { + this.setMaxStackSize(1); + this.setFull3D(); + } + + @SideOnly(value=Side.CLIENT) + public EnumRarity getRarity(ItemStack itemstack) { + return EnumRarity.uncommon; + } + + public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean par5) { + if (entity instanceof EntityPlayer) { + Infusion.Registry.instance().get((EntityPlayer)entity).onUpdate(itemstack, world, (EntityPlayer)entity, par4, par5); + } + } + + public boolean onLeftClickEntity(ItemStack itemstack, EntityPlayer player, Entity entity) { + if (!player.worldObj.isRemote && entity instanceof EntityLivingBase) { + WitchHandAbilities.onAttack(player, (EntityLivingBase)entity); + } + Infusion.Registry.instance().get(player).onLeftClickEntity(itemstack, player.worldObj, player, entity); + return true; + } + + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { + WitchHandAbilities.onRightClick(world, player); + player.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); + return itemstack; + } + + public int getMaxItemUseDuration(ItemStack itemstack) { + return 400; + } + + public void onUsingTick(ItemStack itemstack, EntityPlayer player, int countdown) { + Infusion.Registry.instance().get(player).onUsingItemTick(itemstack, player.worldObj, player, countdown); + } + + public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int countdown) { + if (world.isRemote || !Infusion.isOnCooldown(world, itemstack)) { + Infusion.Registry.instance().get(player).onPlayerStoppedUsing(itemstack, world, player, countdown); + } + } + + public static class EventHooks { + @SubscribeEvent + public void onLivingDeath(LivingDeathEvent event) { + Entity entitySource; + if (!event.entityLiving.worldObj.isRemote && (event.entityLiving instanceof EntityWitch || event.entityLiving instanceof EntityCovenWitch) && (entitySource = event.source.getSourceOfDamage()) != null && entitySource instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)entitySource; + boolean hasArthana = player.getHeldItem() != null && (player.getHeldItem().getItem() == Witchery.Items.ARTHANA || player.getHeldItem().getItem() == Witchery.Items.WITCH_HAND); + double d = player.worldObj.rand.nextDouble(); + double d2 = hasArthana ? 0.5 : 0.33; + if (d < d2) { + ItemStack itemstack = new ItemStack(Witchery.Items.WITCH_HAND); + EntityItem entityItem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, itemstack); + event.entityLiving.worldObj.spawnEntityInWorld((Entity)entityItem); + } + } + } + } +} + diff --git a/src/main/java/com/emoniph/witchery/item/WitchHandAbilities.java b/src/main/java/com/emoniph/witchery/item/WitchHandAbilities.java new file mode 100644 index 0000000..07d6fed --- /dev/null +++ b/src/main/java/com/emoniph/witchery/item/WitchHandAbilities.java @@ -0,0 +1,172 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * net.minecraft.entity.Entity + * net.minecraft.entity.EntityLivingBase + * net.minecraft.entity.EnumCreatureAttribute + * net.minecraft.entity.monster.IMob + * net.minecraft.entity.player.EntityPlayer + * net.minecraft.entity.projectile.EntitySmallFireball + * net.minecraft.nbt.NBTTagCompound + * net.minecraft.potion.Potion + * net.minecraft.potion.PotionEffect + * net.minecraft.util.DamageSource + * net.minecraft.util.Vec3 + * net.minecraft.world.World + */ +package com.emoniph.witchery.item; + +import com.emoniph.witchery.common.ExtendedPlayer; +import com.emoniph.witchery.entity.EntityCovenWitch; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class WitchHandAbilities { + public static void onAttack(EntityPlayer player, EntityLivingBase target) { + ExtendedPlayer ext = ExtendedPlayer.get(player); + int infId = Infusion.getInfusionID(player); + float baseDamage = 1.0f + (float)1 * 0.15f; + if (infId == 1) { + if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { + baseDamage *= 3.0f; + } + } else if (infId == 3) { + if (target.isBurning()) { + baseDamage += 4.0f; + } + } else if (infId == 4) { + player.heal(baseDamage * 0.25f); + } else if (infId == 2 && player.worldObj.rand.nextInt(4) == 0) { + Vec3 look = target.getLookVec(); + player.setPositionAndUpdate(target.posX - look.xCoord * 2.0, target.posY, target.posZ - look.zCoord * 2.0); + } + target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)player), baseDamage); + if (!player.worldObj.isRemote) { + //ext.increaseWitchXP(2); + } + } + + public static void onRightClick(World world, EntityPlayer player) { + NBTTagCompound nbt; + ExtendedPlayer ext = ExtendedPlayer.get(player); + int infId = Infusion.getInfusionID(player); + if (!world.isRemote) { + //ext.increaseWitchXP(1); + } + int baseCost = player.isSneaking() ? 20 : 5; + List witches = world.getEntitiesWithinAABB(EntityCovenWitch.class, player.boundingBox.expand(16.0, 16.0, 16.0)); + int covenCount = 0; + for (Object obj : witches) { + Object witch = (EntityCovenWitch)((Object)obj); + if (!((net.minecraft.entity.passive.EntityTameable)witch).isTamed() || !player.getUniqueID().toString().equals(((net.minecraft.entity.passive.EntityTameable)witch).func_152113_b())) continue; + ++covenCount; + } + if (covenCount > 0) { + float multiplier = 1.0f - (float)covenCount * 0.15f; + if (multiplier < 0.1f) { + multiplier = 0.1f; + } + baseCost = (int)((float)baseCost * multiplier); + } + if ((nbt = Infusion.getNBT((Entity)player)) != null) { + int currentEnergy = nbt.getInteger("witcheryInfusionCharges"); + if (currentEnergy < baseCost && !player.capabilities.isCreativeMode) { + SoundEffect.NOTE_SNARE.playOnlyTo(player); + return; + } + if (!player.capabilities.isCreativeMode) { + Infusion.setCurrentEnergy(player, currentEnergy - baseCost); + } + } + if (player.isSneaking()) { + if (infId == 1) { + List mobs = world.getEntitiesWithinAABB(IMob.class, player.boundingBox.expand(6.0, 6.0, 6.0)); + for (Object obj : mobs) { + EntityLivingBase mob = (EntityLivingBase)obj; + mob.addPotionEffect(new PotionEffect(Potion.blindness.id, 100)); + mob.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)player), 5.0f); + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_EXPLODE, (Entity)player, 2.0, 2.0, 16); + } else if (infId == 2) { + List mobs = world.getEntitiesWithinAABB(EntityLivingBase.class, player.boundingBox.expand(10.0, 10.0, 10.0)); + for (Object obj : mobs) { + EntityLivingBase mob = (EntityLivingBase)obj; + if (mob == player) continue; + double px = player.posX; + double py = player.posY; + double pz = player.posZ; + player.setPositionAndUpdate(mob.posX, mob.posY, mob.posZ); + mob.setPositionAndUpdate(px, py, pz); + SoundEffect.MOB_ENDERMEN_PORTAL.playOnlyTo(player); + break; + } + } else if (infId == 3) { + Vec3 look = player.getLookVec(); + player.motionX = look.xCoord * 3.5; + player.motionY = 0.5; + player.motionZ = look.zCoord * 3.5; + player.velocityChanged = true; + SoundEffect.MOB_GHAST_FIREBALL.playOnlyTo(player); + } else if (infId == 4) { + List mobs = world.getEntitiesWithinAABB(EntityLivingBase.class, player.boundingBox.expand(5.0, 5.0, 5.0)); + for (Object obj : mobs) { + EntityLivingBase mob = (EntityLivingBase)obj; + if (mob == player) continue; + mob.motionY += 1.2; + mob.velocityChanged = true; + mob.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)player), 4.0f); + } + ParticleEffect.LARGE_EXPLODE.send(SoundEffect.RANDOM_EXPLODE, (Entity)player, 1.0, 2.0, 16); + } + } else if (infId == 1) { + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 100, 4)); + SoundEffect.NOTE_SNARE.playOnlyTo(player); + } else if (infId == 2) { + Vec3 look = player.getLookVec(); + boolean teleported = ItemGeneral.teleportToLocationSafely(world, player.posX + look.xCoord * 15.0, player.posY + look.yCoord * 15.0, player.posZ + look.zCoord * 15.0, player.dimension, (Entity)player, true); + if (teleported) { + SoundEffect.MOB_ENDERMEN_PORTAL.playOnlyTo(player); + player.fallDistance = 0.0f; + } else { + SoundEffect.NOTE_SNARE.playOnlyTo(player); + } + } else if (infId == 3) { + EntitySmallFireball fb = new EntitySmallFireball(world, (EntityLivingBase)player, player.getLookVec().xCoord, player.getLookVec().yCoord, player.getLookVec().zCoord); + fb.posY = player.posY + (double)player.getEyeHeight(); + world.spawnEntityInWorld((Entity)fb); + SoundEffect.MOB_GHAST_FIREBALL.playOnlyTo(player); + } else if (infId == 4) { + List mobs = world.getEntitiesWithinAABB(EntityLivingBase.class, player.boundingBox.expand(12.0, 12.0, 12.0)); + for (Object obj : mobs) { + EntityLivingBase mob = (EntityLivingBase)obj; + if (mob == player) continue; + Vec3 dir = Vec3.createVectorHelper((double)(player.posX - mob.posX), (double)(player.posY - mob.posY), (double)(player.posZ - mob.posZ)); + dir = dir.normalize(); + mob.motionX = dir.xCoord * 1.5; + mob.motionY = dir.yCoord * 1.0; + mob.motionZ = dir.zCoord * 1.5; + mob.velocityChanged = true; + mob.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60, 2)); + break; + } + SoundEffect.WITCHERY_RANDOM_POOF.playOnlyTo(player); + } + } +} + diff --git a/src/main/java/com/emoniph/witchery/network/PacketExtendedPlayerSync.java b/src/main/java/com/emoniph/witchery/network/PacketExtendedPlayerSync.java index 001a5a3..97d633e 100644 --- a/src/main/java/com/emoniph/witchery/network/PacketExtendedPlayerSync.java +++ b/src/main/java/com/emoniph/witchery/network/PacketExtendedPlayerSync.java @@ -12,12 +12,14 @@ public class PacketExtendedPlayerSync implements IMessage { private int werewolfLevel; private int vampireLevel; + private int spiritLevel; private int bloodLevel; private int ultimate; private int creatureOrdinal; private int selected; private int ultimateCharges; private int reserveBlood; + private boolean isAstralProjecting; public PacketExtendedPlayerSync() {} @@ -26,47 +28,54 @@ public PacketExtendedPlayerSync(ExtendedPlayer extendedPlayer) { this.werewolfLevel = extendedPlayer.getWerewolfLevel(); this.creatureOrdinal = extendedPlayer.getCreatureTypeOrdinal(); this.vampireLevel = extendedPlayer.getVampireLevel(); + this.spiritLevel = extendedPlayer.getSpiritLevel(); this.bloodLevel = extendedPlayer.getBloodPower(); this.selected = extendedPlayer.getSelectedVampirePower().ordinal(); this.ultimate = extendedPlayer.getVampireUltimate().ordinal(); this.ultimateCharges = extendedPlayer.getVampireUltimateCharges(); this.reserveBlood = extendedPlayer.getBloodReserve(); + this.isAstralProjecting = extendedPlayer.isAstralProjecting(); } public void toBytes(ByteBuf buffer) { buffer.writeInt(this.werewolfLevel); buffer.writeInt(this.creatureOrdinal); buffer.writeInt(this.vampireLevel); + buffer.writeInt(this.spiritLevel); buffer.writeInt(this.bloodLevel); buffer.writeInt(this.selected); buffer.writeInt(this.ultimate); buffer.writeInt(this.ultimateCharges); buffer.writeInt(this.reserveBlood); + buffer.writeBoolean(this.isAstralProjecting); } public void fromBytes(ByteBuf buffer) { this.werewolfLevel = buffer.readInt(); this.creatureOrdinal = buffer.readInt(); this.vampireLevel = buffer.readInt(); + this.spiritLevel = buffer.readInt(); this.bloodLevel = buffer.readInt(); this.selected = buffer.readInt(); this.ultimate = buffer.readInt(); this.ultimateCharges = buffer.readInt(); this.reserveBlood = buffer.readInt(); + this.isAstralProjecting = buffer.readBoolean(); } public static class Handler implements IMessageHandler { public IMessage onMessage(PacketExtendedPlayerSync message, MessageContext ctx) { EntityPlayer player = Witchery.proxy.getPlayer(ctx); + if (player == null) { + return null; + } ExtendedPlayer playerEx = ExtendedPlayer.get(player); - playerEx.setWerewolfLevel(message.werewolfLevel); - playerEx.setCreatureTypeOrdinal(message.creatureOrdinal); - playerEx.setVampireLevel(message.vampireLevel); - playerEx.setBloodPower(message.bloodLevel); - playerEx.setSelectedVampirePower(ExtendedPlayer.VampirePower.values()[message.selected], false); - playerEx.setVampireUltimate(ExtendedPlayer.VampireUltimate.values()[message.ultimate], message.ultimateCharges); - playerEx.setBloodReserve(message.reserveBlood); + if (playerEx == null) { + return null; + } + playerEx.applySyncData(message.werewolfLevel, message.creatureOrdinal, message.vampireLevel, message.spiritLevel, message.bloodLevel, message.selected, message.ultimate, message.ultimateCharges, message.reserveBlood); + playerEx.setAstralProjecting(message.isAstralProjecting); return null; } } diff --git a/src/main/java/com/emoniph/witchery/network/PacketSpellPrepared.java b/src/main/java/com/emoniph/witchery/network/PacketSpellPrepared.java index a162db5..6930829 100644 --- a/src/main/java/com/emoniph/witchery/network/PacketSpellPrepared.java +++ b/src/main/java/com/emoniph/witchery/network/PacketSpellPrepared.java @@ -1,7 +1,9 @@ package com.emoniph.witchery.network; import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; +import com.emoniph.witchery.util.ParticleEffect; import com.emoniph.witchery.util.SoundEffect; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; @@ -36,9 +38,19 @@ public static class Handler implements IMessageHandler= 0 && fastIndex < this.rituals.size()) { + RiteRegistry.Ritual candidate = (RiteRegistry.Ritual)this.rituals.get(fastIndex); + if(candidate != null && candidate.getRitualID() == ritualID) { + return candidate; + } + } + + Iterator i$ = this.rituals.iterator(); + while(i$.hasNext()) { + RiteRegistry.Ritual ritual = (RiteRegistry.Ritual)i$.next(); + if(ritual != null && ritual.getRitualID() == ritualID) { + return ritual; + } + } + + return null; } public List getSortedRituals() { @@ -83,6 +105,7 @@ public static class Ritual { final Sacrifice initialSacrifice; final EnumSet traits; final Circle[] circles; + final IRitualPattern pattern; final byte ritualID; final int bookIndex; boolean visibleInBook; @@ -110,6 +133,18 @@ public String getLocalizedName() { this.initialSacrifice = initialSacrifice; this.traits = traits; this.circles = circles; + this.pattern = null; + this.visibleInBook = true; + } + + Ritual(byte ritualID, int bookIndex, Rite rite, Sacrifice initialSacrifice, EnumSet traits, IRitualPattern pattern) { + this.ritualID = ritualID; + this.bookIndex = bookIndex; + this.rite = rite; + this.initialSacrifice = initialSacrifice; + this.traits = traits; + this.circles = new Circle[0]; + this.pattern = pattern; this.visibleInBook = true; } @@ -126,7 +161,11 @@ public String getDescription() { public boolean isMatch(World world, int posX, int posY, int posZ, Circle[] nearbyCircles, ArrayList entities, ArrayList grassperStacks, boolean isDaytime, boolean isRaining, boolean isThundering) { if((!this.traits.contains(RitualTraits.ONLY_AT_NIGHT) || !isDaytime) && (!this.traits.contains(RitualTraits.ONLY_AT_DAY) || isDaytime) && (!this.traits.contains(RitualTraits.ONLY_IN_RAIN) || isRaining) && (!this.traits.contains(RitualTraits.ONLY_IN_STROM) || isThundering) && (!this.traits.contains(RitualTraits.ONLY_OVERWORLD) || world.provider.dimensionId == 0)) { - if(this.circles.length > 0) { + if(this.pattern != null) { + if(!this.pattern.isMatch(world, posX, posY, posZ)) { + return false; + } + } else if(this.circles.length > 0) { ArrayList circlesToFind = new ArrayList(Arrays.asList(this.circles)); Circle[] arr$ = nearbyCircles; int len$ = nearbyCircles.length; @@ -158,6 +197,9 @@ public void addSteps(ArrayList steps, AxisAlignedBB bounds) { private int getMaxDistance() { int maxDistance = this.circles.length > 0?0:4; + if (this.pattern != null) { + maxDistance = Math.max(maxDistance, this.pattern.getRadius()); + } Circle[] arr$ = this.circles; int len$ = arr$.length; diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteAnnihilation.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteAnnihilation.java new file mode 100644 index 0000000..053e566 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteAnnihilation.java @@ -0,0 +1,66 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.BlockProtect; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class RiteAnnihilation extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteAnnihilation(this, initialStage)); + } + + private static class StepRiteAnnihilation extends RitualStep { + private final RiteAnnihilation rite; + private static final int RADIUS = 8; + + public StepRiteAnnihilation(RiteAnnihilation rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityPlayer caster = circleType.getInitiatingPlayer(world); + int radiusSq = RADIUS * RADIUS; + int cleared = 0; + // Annihilate everything above the circle in a dome, sparing the circle floor itself. + for (int dx = -RADIUS; dx <= RADIUS; ++dx) { + for (int dz = -RADIUS; dz <= RADIUS; ++dz) { + for (int dy = 1; dy <= RADIUS; ++dy) { + if (dx * dx + dy * dy + dz * dz > radiusSq) { + continue; + } + int bx = x + dx; + int by = y + dy; + int bz = z + dz; + Block block = world.getBlock(bx, by, bz); + if (block == Blocks.air) { + continue; + } + int meta = world.getBlockMetadata(bx, by, bz); + if (BlockProtect.canBreak(block, world) && BlockProtect.checkModsForBreakOK(world, bx, by, bz, block, meta, caster)) { + world.setBlockToAir(bx, by, bz); + ++cleared; + } + } + } + } + ParticleEffect.HUGE_EXPLOSION.send(SoundEffect.RANDOM_EXPLODE, world, 0.5D + (double)x, (double)y + 2.0D, 0.5D + (double)z, 3.0D, 3.0D, 48); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBanishDemon.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBanishDemon.java index 8613316..80e2323 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBanishDemon.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBanishDemon.java @@ -1,71 +1,71 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.entity.EntityDeath; -import com.emoniph.witchery.entity.EntityDemon; -import com.emoniph.witchery.entity.EntityImp; -import com.emoniph.witchery.entity.EntityLordOfTorment; -import com.emoniph.witchery.entity.EntityReflection; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteBanishDemon extends Rite { - - private final int radius; - - - public RiteBanishDemon(int radius) { - this.radius = radius; - } - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RiteBanishDemon.BanishDemonStep(this, initialStage)); - } - - private static class BanishDemonStep extends RitualStep { - - private final RiteBanishDemon rite; - protected int ticksSoFar; - - - public BanishDemonStep(RiteBanishDemon rite, int ticksSoFar) { - super(false); - this.rite = rite; - this.ticksSoFar = ticksSoFar; - } - - public int getCurrentStage() { - return this.ticksSoFar; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - this.rite.radius), (double)(posY - this.rite.radius), (double)(posZ - this.rite.radius), (double)(posX + this.rite.radius), (double)(posY + this.rite.radius), (double)(posZ + this.rite.radius)); - List list = world.getEntitiesWithinAABB(EntityLiving.class, bounds); - Iterator i$ = list.iterator(); - - while(i$.hasNext()) { - EntityLiving entity = (EntityLiving)i$.next(); - if((entity instanceof EntityDemon || entity instanceof EntityDeath || entity instanceof EntityLordOfTorment || entity instanceof EntityImp || entity instanceof EntityReflection) && Coord.distanceSq(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)(this.rite.radius * this.rite.radius)) { - entity.setDead(); - ParticleEffect.EXPLODE.send(SoundEffect.NONE, entity, 1.0D, 2.0D, 16); - } - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityDeath; +import com.emoniph.witchery.entity.EntityDemon; +import com.emoniph.witchery.entity.EntityImp; +import com.emoniph.witchery.entity.EntityLordOfTorment; +import com.emoniph.witchery.entity.EntityReflection; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteBanishDemon extends Rite { + + private final int radius; + + + public RiteBanishDemon(int radius) { + this.radius = radius; + } + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RiteBanishDemon.BanishDemonStep(this, initialStage)); + } + + private static class BanishDemonStep extends RitualStep { + + private final RiteBanishDemon rite; + protected int ticksSoFar; + + + public BanishDemonStep(RiteBanishDemon rite, int ticksSoFar) { + super(false); + this.rite = rite; + this.ticksSoFar = ticksSoFar; + } + + public int getCurrentStage() { + return this.ticksSoFar; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - this.rite.radius), (double)(posY - this.rite.radius), (double)(posZ - this.rite.radius), (double)(posX + this.rite.radius), (double)(posY + this.rite.radius), (double)(posZ + this.rite.radius)); + List list = world.getEntitiesWithinAABB(EntityLiving.class, bounds); + Iterator i$ = list.iterator(); + + while(i$.hasNext()) { + EntityLiving entity = (EntityLiving)i$.next(); + if((entity instanceof EntityDemon || entity instanceof EntityDeath || entity instanceof EntityLordOfTorment || entity instanceof EntityImp || entity instanceof EntityReflection) && Coord.distanceSq(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)(this.rite.radius * this.rite.radius)) { + entity.setDead(); + ParticleEffect.EXPLODE.send(SoundEffect.NONE, entity, 1.0D, 2.0D, 16); + } + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindCircleToTalisman.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindCircleToTalisman.java index 50aae60..bd0c589 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindCircleToTalisman.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindCircleToTalisman.java @@ -1,68 +1,68 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Circle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class RiteBindCircleToTalisman extends Rite { - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteBindCircleToTalisman.StepSummonItem(this)); - } - - private static class StepSummonItem extends RitualStep { - - private final RiteBindCircleToTalisman rite; - - - public StepSummonItem(RiteBindCircleToTalisman rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - Circle a = new Circle(16); - Circle b = new Circle(28); - Circle c = new Circle(40); - Circle _ = new Circle(0); - Circle[][] PATTERN = new Circle[][]{{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _}, {_, _, _, _, _, c, c, c, c, c, c, c, _, _, _, _, _}, {_, _, _, _, c, _, _, _, _, _, _, _, c, _, _, _, _}, {_, _, _, c, _, _, b, b, b, b, b, _, _, c, _, _, _}, {_, _, c, _, _, b, _, _, _, _, _, b, _, _, c, _, _}, {_, c, _, _, b, _, _, a, a, a, _, _, b, _, _, c, _}, {_, c, _, b, _, _, a, _, _, _, a, _, _, b, _, c, _}, {_, c, _, b, _, a, _, _, _, _, _, a, _, b, _, c, _}, {_, c, _, b, _, a, _, _, _, _, _, a, _, b, _, c, _}, {_, c, _, b, _, a, _, _, _, _, _, a, _, b, _, c, _}, {_, c, _, b, _, _, a, _, _, _, a, _, _, b, _, c, _}, {_, c, _, _, b, _, _, a, a, a, _, _, b, _, _, c, _}, {_, _, c, _, _, b, _, _, _, _, _, b, _, _, c, _, _}, {_, _, _, c, _, _, b, b, b, b, b, _, _, c, _, _, _}, {_, _, _, _, c, _, _, _, _, _, _, _, c, _, _, _, _}, {_, _, _, _, _, c, c, c, c, c, c, c, _, _, _, _, _}, {_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _}}; - int offsetZ = (PATTERN.length - 1) / 2; - - int metadata; - for(metadata = 0; metadata < PATTERN.length - 1; ++metadata) { - int itemstack = posZ - offsetZ + metadata; - int entity = (PATTERN[metadata].length - 1) / 2; - - for(int x = 0; x < PATTERN[metadata].length; ++x) { - int worldX = posX - entity + x; - PATTERN[PATTERN.length - 1 - metadata][x].addGlyph(world, worldX, posY, itemstack, true); - } - } - - metadata = c.getExclusiveMetadataValue() << 6 | b.getExclusiveMetadataValue() << 3 | a.getExclusiveMetadataValue(); - ItemStack var19 = new ItemStack(Witchery.Items.CIRCLE_TALISMAN, 1, metadata); - EntityItem var20 = new EntityItem(world, (double)posX, (double)posY + 0.05D, (double)posZ, var19); - world.spawnEntityInWorld(var20); - ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, var20, 0.5D, 1.0D, 16); - if(metadata > 0) { - world.setBlockToAir(posX, posY, posZ); - } - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Circle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RiteBindCircleToTalisman extends Rite { + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteBindCircleToTalisman.StepSummonItem(this)); + } + + private static class StepSummonItem extends RitualStep { + + private final RiteBindCircleToTalisman rite; + + + public StepSummonItem(RiteBindCircleToTalisman rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + Circle a = new Circle(16); + Circle b = new Circle(28); + Circle c = new Circle(40); + Circle _ = new Circle(0); + Circle[][] PATTERN = new Circle[][]{{_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _}, {_, _, _, _, _, c, c, c, c, c, c, c, _, _, _, _, _}, {_, _, _, _, c, _, _, _, _, _, _, _, c, _, _, _, _}, {_, _, _, c, _, _, b, b, b, b, b, _, _, c, _, _, _}, {_, _, c, _, _, b, _, _, _, _, _, b, _, _, c, _, _}, {_, c, _, _, b, _, _, a, a, a, _, _, b, _, _, c, _}, {_, c, _, b, _, _, a, _, _, _, a, _, _, b, _, c, _}, {_, c, _, b, _, a, _, _, _, _, _, a, _, b, _, c, _}, {_, c, _, b, _, a, _, _, _, _, _, a, _, b, _, c, _}, {_, c, _, b, _, a, _, _, _, _, _, a, _, b, _, c, _}, {_, c, _, b, _, _, a, _, _, _, a, _, _, b, _, c, _}, {_, c, _, _, b, _, _, a, a, a, _, _, b, _, _, c, _}, {_, _, c, _, _, b, _, _, _, _, _, b, _, _, c, _, _}, {_, _, _, c, _, _, b, b, b, b, b, _, _, c, _, _, _}, {_, _, _, _, c, _, _, _, _, _, _, _, c, _, _, _, _}, {_, _, _, _, _, c, c, c, c, c, c, c, _, _, _, _, _}, {_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _}}; + int offsetZ = (PATTERN.length - 1) / 2; + + int metadata; + for(metadata = 0; metadata < PATTERN.length - 1; ++metadata) { + int itemstack = posZ - offsetZ + metadata; + int entity = (PATTERN[metadata].length - 1) / 2; + + for(int x = 0; x < PATTERN[metadata].length; ++x) { + int worldX = posX - entity + x; + PATTERN[PATTERN.length - 1 - metadata][x].addGlyph(world, worldX, posY, itemstack, true); + } + } + + metadata = c.getExclusiveMetadataValue() << 6 | b.getExclusiveMetadataValue() << 3 | a.getExclusiveMetadataValue(); + ItemStack var19 = new ItemStack(Witchery.Items.CIRCLE_TALISMAN, 1, metadata); + EntityItem var20 = new EntityItem(world, (double)posX, (double)posY + 0.05D, (double)posZ, var19); + world.spawnEntityInWorld(var20); + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, var20, 0.5D, 1.0D, 16); + if(metadata > 0) { + world.setBlockToAir(posX, posY, posZ); + } + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindFamiliar.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindFamiliar.java index c247426..3040220 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindFamiliar.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindFamiliar.java @@ -1,76 +1,76 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteBindFamiliar extends Rite { - - private final int radius; - - - public RiteBindFamiliar(int radius) { - this.radius = radius; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteBindFamiliar.StepBindFamiliar(this)); - } - - private static class StepBindFamiliar extends RitualStep { - - private final RiteBindFamiliar rite; - - - public StepBindFamiliar(RiteBindFamiliar rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int r = this.rite.radius; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); - boolean bound = false; - ArrayList boundPlayers = new ArrayList(); - Iterator i$ = world.getEntitiesWithinAABB(EntityTameable.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityTameable tameable = (EntityTameable)obj; - if(tameable.isTamed() && Familiar.canBecomeFamiliar(tameable) && Coord.distance(tameable.posX, tameable.posY, tameable.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r) { - EntityLivingBase player = tameable.getOwner(); - if(player != null && player instanceof EntityPlayer && Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r && !boundPlayers.contains(player)) { - Familiar.bindToPlayer((EntityPlayer)player, tameable); - boundPlayers.add((EntityPlayer)player); - bound = true; - } - } - } - - if(!bound) { - return RitualStep.Result.ABORTED_REFUND; - } - - ParticleEffect.HEART.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteBindFamiliar extends Rite { + + private final int radius; + + + public RiteBindFamiliar(int radius) { + this.radius = radius; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteBindFamiliar.StepBindFamiliar(this)); + } + + private static class StepBindFamiliar extends RitualStep { + + private final RiteBindFamiliar rite; + + + public StepBindFamiliar(RiteBindFamiliar rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int r = this.rite.radius; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); + boolean bound = false; + ArrayList boundPlayers = new ArrayList(); + Iterator i$ = world.getEntitiesWithinAABB(EntityTameable.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityTameable tameable = (EntityTameable)obj; + if(tameable.isTamed() && Familiar.canBecomeFamiliar(tameable) && Coord.distance(tameable.posX, tameable.posY, tameable.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r) { + EntityLivingBase player = tameable.getOwner(); + if(player != null && player instanceof EntityPlayer && Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r && !boundPlayers.contains(player)) { + Familiar.bindToPlayer((EntityPlayer)player, tameable); + boundPlayers.add((EntityPlayer)player); + bound = true; + } + } + } + + if(!bound) { + return RitualStep.Result.ABORTED_REFUND; + } + + ParticleEffect.HEART.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindSpiritsToFetish.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindSpiritsToFetish.java index 54b9b33..b3af06c 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindSpiritsToFetish.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBindSpiritsToFetish.java @@ -1,151 +1,151 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.entity.EntityBanshee; -import com.emoniph.witchery.entity.EntityDeath; -import com.emoniph.witchery.entity.EntityPoltergeist; -import com.emoniph.witchery.entity.EntitySpectre; -import com.emoniph.witchery.entity.EntitySpirit; -import com.emoniph.witchery.infusion.infusions.spirit.InfusedSpiritEffect; -import com.emoniph.witchery.item.ItemDeathsClothes; -import com.emoniph.witchery.item.ItemGeneral; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteBindSpiritsToFetish extends Rite { - - private final int radius; - - - public RiteBindSpiritsToFetish(int radius) { - this.radius = radius; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteBindSpiritsToFetish.StepSpiritsToFetish(this)); - } - - private static class StepSpiritsToFetish extends RitualStep { - - private final RiteBindSpiritsToFetish rite; - - - public StepSpiritsToFetish(RiteBindSpiritsToFetish rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int r = this.rite.radius; - int r2 = r * r; - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)(posY - r), (double)(posZ - r), (double)(posX + r), (double)(posY + r), (double)(posZ + r)); - List entities = world.getEntitiesWithinAABB(EntityCreature.class, bb); - ArrayList spectreList = new ArrayList(); - ArrayList spiritList = new ArrayList(); - ArrayList bansheeList = new ArrayList(); - ArrayList poltergeistList = new ArrayList(); - Iterator stack = entities.iterator(); - - while(stack.hasNext()) { - Object result = stack.next(); - if(result instanceof EntitySpectre) { - spectreList.add((EntitySpectre)result); - } else if(result instanceof EntityPoltergeist) { - poltergeistList.add((EntityPoltergeist)result); - } else if(result instanceof EntityBanshee) { - bansheeList.add((EntityBanshee)result); - } else if(result instanceof EntitySpirit) { - spiritList.add((EntitySpirit)result); - } - } - - ItemStack stack1 = null; - Iterator result2 = ritual.sacrificedItems.iterator(); - - while(result2.hasNext()) { - RitualStep.SacrificedItem entity = (RitualStep.SacrificedItem)result2.next(); - if(entity.itemstack.isItemEqual(new ItemStack(Witchery.Blocks.FETISH_SCARECROW))) { - stack1 = entity.itemstack; - break; - } - - if(entity.itemstack.isItemEqual(new ItemStack(Witchery.Blocks.FETISH_TREANT_IDOL))) { - stack1 = entity.itemstack; - break; - } - - if(entity.itemstack.isItemEqual(new ItemStack(Witchery.Blocks.FETISH_WITCHS_LADDER))) { - stack1 = entity.itemstack; - break; - } - } - - if(stack1 == null) { - return RitualStep.Result.ABORTED_REFUND; - } - - int result1 = InfusedSpiritEffect.tryBindFetish(world, stack1, spiritList, spectreList, bansheeList, poltergeistList); - if(result1 == 0) { - return RitualStep.Result.ABORTED_REFUND; - } - - if(result1 == 2) { - EntityPlayer entity2 = this.findDeathPlayer(world); - if(entity2 != null) { - ItemGeneral var10000 = Witchery.Items.GENERIC; - ItemGeneral.teleportToLocation(world, (double)posX, (double)posY, (double)posZ, world.provider.dimensionId, entity2, true); - ParticleEffect.INSTANT_SPELL.send(SoundEffect.MOB_WITHER_SPAWN, entity2, 0.5D, 1.5D, 16); - } else { - EntityDeath death = new EntityDeath(world); - death.setLocationAndAngles(0.5D + (double)posX, (double)posY + 0.1D, 0.5D + (double)posZ, 0.0F, 0.0F); - death.func_110163_bv(); - world.spawnEntityInWorld(death); - ParticleEffect.INSTANT_SPELL.send(SoundEffect.MOB_WITHER_SPAWN, death, 0.5D, 1.5D, 16); - } - } else { - EntityItem entity1 = new EntityItem(world, 0.5D + (double)posX, (double)posY + 1.5D, 0.5D + (double)posZ, stack1); - entity1.motionX = 0.0D; - entity1.motionY = 0.3D; - entity1.motionZ = 0.0D; - world.spawnEntityInWorld(entity1); - ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, entity1, 0.5D, 1.5D, 16); - } - } - - return RitualStep.Result.COMPLETED; - } - } - - private EntityPlayer findDeathPlayer(World world) { - Iterator i$ = world.playerEntities.iterator(); - - EntityPlayer player; - do { - if(!i$.hasNext()) { - return null; - } - - Object obj = i$.next(); - player = (EntityPlayer)obj; - } while(!ItemDeathsClothes.isFullSetWorn(player) || player.getCurrentEquippedItem() == null || player.getCurrentEquippedItem().getItem() != Witchery.Items.DEATH_HAND); - - return player; - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityBanshee; +import com.emoniph.witchery.entity.EntityDeath; +import com.emoniph.witchery.entity.EntityPoltergeist; +import com.emoniph.witchery.entity.EntitySpectre; +import com.emoniph.witchery.entity.EntitySpirit; +import com.emoniph.witchery.infusion.infusions.spirit.InfusedSpiritEffect; +import com.emoniph.witchery.item.ItemDeathsClothes; +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteBindSpiritsToFetish extends Rite { + + private final int radius; + + + public RiteBindSpiritsToFetish(int radius) { + this.radius = radius; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteBindSpiritsToFetish.StepSpiritsToFetish(this)); + } + + private static class StepSpiritsToFetish extends RitualStep { + + private final RiteBindSpiritsToFetish rite; + + + public StepSpiritsToFetish(RiteBindSpiritsToFetish rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int r = this.rite.radius; + int r2 = r * r; + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)(posY - r), (double)(posZ - r), (double)(posX + r), (double)(posY + r), (double)(posZ + r)); + List entities = world.getEntitiesWithinAABB(EntityCreature.class, bb); + ArrayList spectreList = new ArrayList(); + ArrayList spiritList = new ArrayList(); + ArrayList bansheeList = new ArrayList(); + ArrayList poltergeistList = new ArrayList(); + Iterator stack = entities.iterator(); + + while(stack.hasNext()) { + Object result = stack.next(); + if(result instanceof EntitySpectre) { + spectreList.add((EntitySpectre)result); + } else if(result instanceof EntityPoltergeist) { + poltergeistList.add((EntityPoltergeist)result); + } else if(result instanceof EntityBanshee) { + bansheeList.add((EntityBanshee)result); + } else if(result instanceof EntitySpirit) { + spiritList.add((EntitySpirit)result); + } + } + + ItemStack stack1 = null; + Iterator result2 = ritual.sacrificedItems.iterator(); + + while(result2.hasNext()) { + RitualStep.SacrificedItem entity = (RitualStep.SacrificedItem)result2.next(); + if(entity.itemstack.isItemEqual(new ItemStack(Witchery.Blocks.FETISH_SCARECROW))) { + stack1 = entity.itemstack; + break; + } + + if(entity.itemstack.isItemEqual(new ItemStack(Witchery.Blocks.FETISH_TREANT_IDOL))) { + stack1 = entity.itemstack; + break; + } + + if(entity.itemstack.isItemEqual(new ItemStack(Witchery.Blocks.FETISH_WITCHS_LADDER))) { + stack1 = entity.itemstack; + break; + } + } + + if(stack1 == null) { + return RitualStep.Result.ABORTED_REFUND; + } + + int result1 = InfusedSpiritEffect.tryBindFetish(world, stack1, spiritList, spectreList, bansheeList, poltergeistList); + if(result1 == 0) { + return RitualStep.Result.ABORTED_REFUND; + } + + if(result1 == 2) { + EntityPlayer entity2 = this.findDeathPlayer(world); + if(entity2 != null) { + ItemGeneral var10000 = Witchery.Items.GENERIC; + ItemGeneral.teleportToLocation(world, (double)posX, (double)posY, (double)posZ, world.provider.dimensionId, entity2, true); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.MOB_WITHER_SPAWN, entity2, 0.5D, 1.5D, 16); + } else { + EntityDeath death = new EntityDeath(world); + death.setLocationAndAngles(0.5D + (double)posX, (double)posY + 0.1D, 0.5D + (double)posZ, 0.0F, 0.0F); + death.func_110163_bv(); + world.spawnEntityInWorld(death); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.MOB_WITHER_SPAWN, death, 0.5D, 1.5D, 16); + } + } else { + EntityItem entity1 = new EntityItem(world, 0.5D + (double)posX, (double)posY + 1.5D, 0.5D + (double)posZ, stack1); + entity1.motionX = 0.0D; + entity1.motionY = 0.3D; + entity1.motionZ = 0.0D; + world.spawnEntityInWorld(entity1); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, entity1, 0.5D, 1.5D, 16); + } + } + + return RitualStep.Result.COMPLETED; + } + } + + private EntityPlayer findDeathPlayer(World world) { + Iterator i$ = world.playerEntities.iterator(); + + EntityPlayer player; + do { + if(!i$.hasNext()) { + return null; + } + + Object obj = i$.next(); + player = (EntityPlayer)obj; + } while(!ItemDeathsClothes.isFullSetWorn(player) || player.getCurrentEquippedItem() == null || player.getCurrentEquippedItem().getItem() != Witchery.Items.DEATH_HAND); + + return player; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlight.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlight.java index 81d2e51..bbc7b3b 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlight.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlight.java @@ -1,161 +1,161 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; -import com.emoniph.witchery.util.Log; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.block.Block; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.EntityAnimal; -import net.minecraft.entity.passive.EntityCow; -import net.minecraft.entity.passive.EntityMooshroom; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; - -public class RiteBlight extends RiteExpandingEffect { - - public RiteBlight(int radius, int height) { - super(radius, height, true); - } - - public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { - double radiusSq = (double)(radius * radius); - double minSq = (double)Math.max(0, (radius - 1) * (radius - 1)); - Iterator villagersToZombify = world.playerEntities.iterator(); - - while(villagersToZombify.hasNext()) { - Object cowsToSchroom = villagersToZombify.next(); - EntityPlayer animalsToSlay = (EntityPlayer)cowsToSchroom; - double i$ = animalsToSlay.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(i$ > minSq && i$ <= radiusSq) { - if(Witchery.Items.POPPET.voodooProtectionActivated(player, (ItemStack)null, animalsToSlay, 6)) { - return false; - } - - if(!animalsToSlay.isPotionActive(Potion.confusion)) { - animalsToSlay.addPotionEffect(new PotionEffect(Potion.confusion.id, 2400, 1)); - } - } - } - - ArrayList villagersToZombify1 = new ArrayList(); - ArrayList cowsToSchroom1 = new ArrayList(); - ArrayList animalsToSlay1 = new ArrayList(); - Iterator i$1 = world.loadedEntityList.iterator(); - - while(i$1.hasNext()) { - Object animal = i$1.next(); - double distanceSq; - if(animal instanceof EntityVillager) { - EntityVillager entityzombie = (EntityVillager)animal; - distanceSq = entityzombie.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(distanceSq > minSq && distanceSq <= radiusSq) { - Log.instance().debug(String.format("Try Adding zombie %f %f %f", new Object[]{Double.valueOf(distanceSq), Double.valueOf(minSq), Double.valueOf(radiusSq)})); - if(world.rand.nextInt(10) == 0) { - Log.instance().debug("Added zombie"); - villagersToZombify1.add(entityzombie); - } - } - } else if(animal instanceof EntityCow) { - EntityCow entityzombie3 = (EntityCow)animal; - distanceSq = entityzombie3.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(distanceSq > minSq && distanceSq <= radiusSq) { - Log.instance().debug(String.format("Try Adding mooschroom %f %f %f", new Object[]{Double.valueOf(distanceSq), Double.valueOf(minSq), Double.valueOf(radiusSq)})); - if(world.rand.nextInt(20) == 0) { - Log.instance().debug("Added mooschroom"); - cowsToSchroom1.add(entityzombie3); - } else if(world.rand.nextInt(3) == 0) { - animalsToSlay1.add(entityzombie3); - } - } - } else if(animal instanceof EntityAnimal) { - EntityAnimal entityzombie2 = (EntityAnimal)animal; - distanceSq = entityzombie2.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(distanceSq > minSq && distanceSq <= radiusSq && world.rand.nextInt(3) == 0) { - animalsToSlay1.add(entityzombie2); - } - } - } - - i$1 = villagersToZombify1.iterator(); - - while(i$1.hasNext()) { - EntityVillager animal2 = (EntityVillager)i$1.next(); - EntityZombie entityzombie1 = new EntityZombie(world); - entityzombie1.copyLocationAndAnglesFrom(animal2); - world.removeEntity(animal2); - entityzombie1.onSpawnWithEgg((IEntityLivingData)null); - entityzombie1.setVillager(true); - if(animal2.isChild()) { - entityzombie1.setChild(true); - } - - world.spawnEntityInWorld(entityzombie1); - world.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)entityzombie1.posX, (int)entityzombie1.posY, (int)entityzombie1.posZ, 0); - } - - i$1 = cowsToSchroom1.iterator(); - - while(i$1.hasNext()) { - EntityCow animal1 = (EntityCow)i$1.next(); - EntityMooshroom entityzombie4 = new EntityMooshroom(world); - entityzombie4.copyLocationAndAnglesFrom(animal1); - world.removeEntity(animal1); - entityzombie4.onSpawnWithEgg((IEntityLivingData)null); - world.spawnEntityInWorld(entityzombie4); - world.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)entityzombie4.posX, (int)entityzombie4.posY, (int)entityzombie4.posZ, 0); - } - - i$1 = animalsToSlay1.iterator(); - - while(i$1.hasNext()) { - EntityAnimal animal3 = (EntityAnimal)i$1.next(); - animal3.attackEntityFrom(DamageSource.magic, 20.0F); - } - - return true; - } - - public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) { - if(!world.isRemote) { - Block blockID = world.getBlock(posX, posY, posZ); - Block blockBelowID = world.getBlock(posX, posY - 1, posZ); - if(blockID == Blocks.tallgrass) { - world.setBlockToAir(posX, posY, posZ); - this.blightGround(world, posX, posY - 1, posZ, blockBelowID, enhanced); - } else if(blockID != Blocks.red_flower && blockID != Blocks.yellow_flower && blockID != Blocks.carrots && blockID != Blocks.wheat && blockID != Blocks.potatoes && blockID != Blocks.pumpkin_stem && blockID != Blocks.melon_stem && blockID != Blocks.melon_block && blockID != Blocks.pumpkin) { - if(blockID == Blocks.farmland) { - world.setBlock(posX, posY, posZ, Blocks.sand); - } else if(blockID.getMaterial().isSolid()) { - this.blightGround(world, posX, posY, posZ, blockID, enhanced); - } else if(blockBelowID.getMaterial().isSolid()) { - this.blightGround(world, posX, posY - 1, posZ, blockBelowID, enhanced); - } - } else { - world.setBlock(posX, posY, posZ, Blocks.deadbush); - this.blightGround(world, posX, posY - 1, posZ, blockBelowID, enhanced); - } - } - - } - - public void blightGround(World world, int posX, int posY, int posZ, Block blockBelowID, boolean enhanced) { - if(blockBelowID == Blocks.dirt || blockBelowID == Blocks.grass || blockBelowID == Blocks.mycelium || blockBelowID == Blocks.farmland) { - int rand = world.rand.nextInt(enhanced?4:5); - if(rand == 0) { - world.setBlock(posX, posY, posZ, Blocks.sand); - } else if(rand == 1) { - world.setBlock(posX, posY, posZ, Blocks.dirt); - } - } - - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; +import com.emoniph.witchery.util.Log; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.block.Block; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class RiteBlight extends RiteExpandingEffect { + + public RiteBlight(int radius, int height) { + super(radius, height, true); + } + + public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { + double radiusSq = (double)(radius * radius); + double minSq = (double)Math.max(0, (radius - 1) * (radius - 1)); + Iterator villagersToZombify = world.playerEntities.iterator(); + + while(villagersToZombify.hasNext()) { + Object cowsToSchroom = villagersToZombify.next(); + EntityPlayer animalsToSlay = (EntityPlayer)cowsToSchroom; + double i$ = animalsToSlay.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(i$ > minSq && i$ <= radiusSq) { + if(Witchery.Items.POPPET.voodooProtectionActivated(player, (ItemStack)null, animalsToSlay, 6)) { + return false; + } + + if(!animalsToSlay.isPotionActive(Potion.confusion)) { + animalsToSlay.addPotionEffect(new PotionEffect(Potion.confusion.id, 2400, 1)); + } + } + } + + ArrayList villagersToZombify1 = new ArrayList(); + ArrayList cowsToSchroom1 = new ArrayList(); + ArrayList animalsToSlay1 = new ArrayList(); + Iterator i$1 = world.loadedEntityList.iterator(); + + while(i$1.hasNext()) { + Object animal = i$1.next(); + double distanceSq; + if(animal instanceof EntityVillager) { + EntityVillager entityzombie = (EntityVillager)animal; + distanceSq = entityzombie.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(distanceSq > minSq && distanceSq <= radiusSq) { + Log.instance().debug(String.format("Try Adding zombie %f %f %f", new Object[]{Double.valueOf(distanceSq), Double.valueOf(minSq), Double.valueOf(radiusSq)})); + if(world.rand.nextInt(10) == 0) { + Log.instance().debug("Added zombie"); + villagersToZombify1.add(entityzombie); + } + } + } else if(animal instanceof EntityCow) { + EntityCow entityzombie3 = (EntityCow)animal; + distanceSq = entityzombie3.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(distanceSq > minSq && distanceSq <= radiusSq) { + Log.instance().debug(String.format("Try Adding mooschroom %f %f %f", new Object[]{Double.valueOf(distanceSq), Double.valueOf(minSq), Double.valueOf(radiusSq)})); + if(world.rand.nextInt(20) == 0) { + Log.instance().debug("Added mooschroom"); + cowsToSchroom1.add(entityzombie3); + } else if(world.rand.nextInt(3) == 0) { + animalsToSlay1.add(entityzombie3); + } + } + } else if(animal instanceof EntityAnimal) { + EntityAnimal entityzombie2 = (EntityAnimal)animal; + distanceSq = entityzombie2.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(distanceSq > minSq && distanceSq <= radiusSq && world.rand.nextInt(3) == 0) { + animalsToSlay1.add(entityzombie2); + } + } + } + + i$1 = villagersToZombify1.iterator(); + + while(i$1.hasNext()) { + EntityVillager animal2 = (EntityVillager)i$1.next(); + EntityZombie entityzombie1 = new EntityZombie(world); + entityzombie1.copyLocationAndAnglesFrom(animal2); + world.removeEntity(animal2); + entityzombie1.onSpawnWithEgg((IEntityLivingData)null); + entityzombie1.setVillager(true); + if(animal2.isChild()) { + entityzombie1.setChild(true); + } + + world.spawnEntityInWorld(entityzombie1); + world.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)entityzombie1.posX, (int)entityzombie1.posY, (int)entityzombie1.posZ, 0); + } + + i$1 = cowsToSchroom1.iterator(); + + while(i$1.hasNext()) { + EntityCow animal1 = (EntityCow)i$1.next(); + EntityMooshroom entityzombie4 = new EntityMooshroom(world); + entityzombie4.copyLocationAndAnglesFrom(animal1); + world.removeEntity(animal1); + entityzombie4.onSpawnWithEgg((IEntityLivingData)null); + world.spawnEntityInWorld(entityzombie4); + world.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)entityzombie4.posX, (int)entityzombie4.posY, (int)entityzombie4.posZ, 0); + } + + i$1 = animalsToSlay1.iterator(); + + while(i$1.hasNext()) { + EntityAnimal animal3 = (EntityAnimal)i$1.next(); + animal3.attackEntityFrom(DamageSource.magic, 20.0F); + } + + return true; + } + + public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) { + if(!world.isRemote) { + Block blockID = world.getBlock(posX, posY, posZ); + Block blockBelowID = world.getBlock(posX, posY - 1, posZ); + if(blockID == Blocks.tallgrass) { + world.setBlockToAir(posX, posY, posZ); + this.blightGround(world, posX, posY - 1, posZ, blockBelowID, enhanced); + } else if(blockID != Blocks.red_flower && blockID != Blocks.yellow_flower && blockID != Blocks.carrots && blockID != Blocks.wheat && blockID != Blocks.potatoes && blockID != Blocks.pumpkin_stem && blockID != Blocks.melon_stem && blockID != Blocks.melon_block && blockID != Blocks.pumpkin) { + if(blockID == Blocks.farmland) { + world.setBlock(posX, posY, posZ, Blocks.sand); + } else if(blockID.getMaterial().isSolid()) { + this.blightGround(world, posX, posY, posZ, blockID, enhanced); + } else if(blockBelowID.getMaterial().isSolid()) { + this.blightGround(world, posX, posY - 1, posZ, blockBelowID, enhanced); + } + } else { + world.setBlock(posX, posY, posZ, Blocks.deadbush); + this.blightGround(world, posX, posY - 1, posZ, blockBelowID, enhanced); + } + } + + } + + public void blightGround(World world, int posX, int posY, int posZ, Block blockBelowID, boolean enhanced) { + if(blockBelowID == Blocks.dirt || blockBelowID == Blocks.grass || blockBelowID == Blocks.mycelium || blockBelowID == Blocks.farmland) { + int rand = world.rand.nextInt(enhanced?4:5); + if(rand == 0) { + world.setBlock(posX, posY, posZ, Blocks.sand); + } else if(rand == 1) { + world.setBlock(posX, posY, posZ, Blocks.dirt); + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlindness.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlindness.java index 9ab7769..8a24eb1 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlindness.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteBlindness.java @@ -1,58 +1,58 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; -import java.util.Iterator; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; - -public class RiteBlindness extends RiteExpandingEffect { - - public RiteBlindness(int radius, int height) { - super(radius, height, true); - } - - public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { - double radiusSq = (double)(radius * radius); - double minSq = (double)Math.max(0, (radius - 1) * (radius - 1)); - Iterator i$ = world.playerEntities.iterator(); - - Object obj; - double distanceSq; - while(i$.hasNext()) { - obj = i$.next(); - EntityPlayer victim = (EntityPlayer)obj; - distanceSq = victim.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(distanceSq > minSq && distanceSq <= radiusSq) { - if(Witchery.Items.POPPET.voodooProtectionActivated(player, (ItemStack)null, victim, 6)) { - return false; - } - - if(!victim.isPotionActive(Potion.blindness)) { - victim.addPotionEffect(new PotionEffect(Potion.blindness.id, (enhanced?5:2) * 1200, 0)); - } - } - } - - i$ = world.loadedEntityList.iterator(); - - while(i$.hasNext()) { - obj = i$.next(); - if(obj instanceof EntityLiving) { - EntityLiving victim1 = (EntityLiving)obj; - distanceSq = victim1.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(distanceSq > minSq && distanceSq <= radiusSq && !victim1.isPotionActive(Potion.blindness)) { - victim1.addPotionEffect(new PotionEffect(Potion.blindness.id, (enhanced?5:2) * 1200, 0)); - } - } - } - - return true; - } - - public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) {} -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; +import java.util.Iterator; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class RiteBlindness extends RiteExpandingEffect { + + public RiteBlindness(int radius, int height) { + super(radius, height, true); + } + + public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { + double radiusSq = (double)(radius * radius); + double minSq = (double)Math.max(0, (radius - 1) * (radius - 1)); + Iterator i$ = world.playerEntities.iterator(); + + Object obj; + double distanceSq; + while(i$.hasNext()) { + obj = i$.next(); + EntityPlayer victim = (EntityPlayer)obj; + distanceSq = victim.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(distanceSq > minSq && distanceSq <= radiusSq) { + if(Witchery.Items.POPPET.voodooProtectionActivated(player, (ItemStack)null, victim, 6)) { + return false; + } + + if(!victim.isPotionActive(Potion.blindness)) { + victim.addPotionEffect(new PotionEffect(Potion.blindness.id, (enhanced?5:2) * 1200, 0)); + } + } + } + + i$ = world.loadedEntityList.iterator(); + + while(i$.hasNext()) { + obj = i$.next(); + if(obj instanceof EntityLiving) { + EntityLiving victim1 = (EntityLiving)obj; + distanceSq = victim1.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(distanceSq > minSq && distanceSq <= radiusSq && !victim1.isPotionActive(Potion.blindness)) { + victim1.addPotionEffect(new PotionEffect(Potion.blindness.id, (enhanced?5:2) * 1200, 0)); + } + } + } + + return true; + } + + public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) {} +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallCreatures.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallCreatures.java index 8b4fa2d..cd5b093 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallCreatures.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallCreatures.java @@ -1,129 +1,129 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.brewing.potions.PotionEnderInhibition; -import com.emoniph.witchery.item.ItemGeneral; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.Log; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteCallCreatures extends Rite { - - private final float radius; - private final List creatureTypes; - - - public RiteCallCreatures(float radius, Class[] creatureTypes) { - this.radius = radius; - this.creatureTypes = Arrays.asList(creatureTypes); - } - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RiteCallCreatures.StepCallCreatures(this, initialStage)); - } - - private static class StepCallCreatures extends RitualStep { - - private final RiteCallCreatures rite; - private int stage = 0; - - - public StepCallCreatures(RiteCallCreatures rite, int stage) { - super(false); - this.rite = rite; - this.stage = stage; - } - - private void allure(World world, double posX, double posY, double posZ, int quad) { - try { - float e = 128.0F; - float dy = 10.0F; - AxisAlignedBB bounds = null; - switch(quad) { - case 0: - bounds = AxisAlignedBB.getBoundingBox(posX, posY - 10.0D, posZ - 128.0D, posX + 128.0D, posY, posZ); - break; - case 1: - bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY - 10.0D, posZ - 128.0D, posX, posY, posZ); - break; - case 2: - bounds = AxisAlignedBB.getBoundingBox(posX, posY - 10.0D, posZ, posX + 128.0D, posY, posZ + 128.0D); - break; - case 3: - bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY - 10.0D, posZ, posX, posY, posZ + 128.0D); - break; - case 4: - bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY + 1.0D, posZ - 128.0D, posX, posY + 10.0D, posZ); - break; - case 5: - bounds = AxisAlignedBB.getBoundingBox(posX, posY + 1.0D, posZ, posX + 128.0D, posY + 10.0D, posZ + 128.0D); - break; - case 6: - bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY + 1.0D, posZ, posX, posY + 10.0D, posZ + 128.0D); - break; - case 7: - default: - bounds = AxisAlignedBB.getBoundingBox(posX, posY + 1.0D, posZ - 128.0D, posX + 128.0D, posY + 10.0D, posZ); - } - - int count = 0; - boolean minDistanceSq = true; - Iterator i$ = world.getEntitiesWithinAABB(EntityCreature.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityCreature creature = (EntityCreature)obj; - if(this.rite.creatureTypes.contains(creature.getClass()) && creature.getDistanceSq(posX, posY, posZ) > 32.0D && !PotionEnderInhibition.isActive(creature, 0)) { - ItemGeneral var10000 = Witchery.Items.GENERIC; - ItemGeneral.teleportToLocation(world, posX - 2.0D + (double)world.rand.nextInt(5), posY, posZ - 2.0D + (double)world.rand.nextInt(5), world.provider.dimensionId, creature, true); - ++count; - if(count >= 2) { - break; - } - } - } - } catch (Exception var17) { - Log.instance().debug(String.format("Exception occurred alluring with a ritual! %s", new Object[]{var17.toString()})); - } - - } - - public int getCurrentStage() { - return this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 60L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - if(ritual.covenSize < 3) { - EntityPlayer player = ritual.getInitiatingPlayer(world); - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.coventoosmall", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } - - this.allure(world, (double)posX, (double)posY, (double)posZ, ++this.stage % 8); - } - - return this.stage < 250?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.brewing.potions.PotionEnderInhibition; +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Log; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteCallCreatures extends Rite { + + private final float radius; + private final List creatureTypes; + + + public RiteCallCreatures(float radius, Class[] creatureTypes) { + this.radius = radius; + this.creatureTypes = Arrays.asList(creatureTypes); + } + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RiteCallCreatures.StepCallCreatures(this, initialStage)); + } + + private static class StepCallCreatures extends RitualStep { + + private final RiteCallCreatures rite; + private int stage = 0; + + + public StepCallCreatures(RiteCallCreatures rite, int stage) { + super(false); + this.rite = rite; + this.stage = stage; + } + + private void allure(World world, double posX, double posY, double posZ, int quad) { + try { + float e = 128.0F; + float dy = 10.0F; + AxisAlignedBB bounds = null; + switch(quad) { + case 0: + bounds = AxisAlignedBB.getBoundingBox(posX, posY - 10.0D, posZ - 128.0D, posX + 128.0D, posY, posZ); + break; + case 1: + bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY - 10.0D, posZ - 128.0D, posX, posY, posZ); + break; + case 2: + bounds = AxisAlignedBB.getBoundingBox(posX, posY - 10.0D, posZ, posX + 128.0D, posY, posZ + 128.0D); + break; + case 3: + bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY - 10.0D, posZ, posX, posY, posZ + 128.0D); + break; + case 4: + bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY + 1.0D, posZ - 128.0D, posX, posY + 10.0D, posZ); + break; + case 5: + bounds = AxisAlignedBB.getBoundingBox(posX, posY + 1.0D, posZ, posX + 128.0D, posY + 10.0D, posZ + 128.0D); + break; + case 6: + bounds = AxisAlignedBB.getBoundingBox(posX - 128.0D, posY + 1.0D, posZ, posX, posY + 10.0D, posZ + 128.0D); + break; + case 7: + default: + bounds = AxisAlignedBB.getBoundingBox(posX, posY + 1.0D, posZ - 128.0D, posX + 128.0D, posY + 10.0D, posZ); + } + + int count = 0; + boolean minDistanceSq = true; + Iterator i$ = world.getEntitiesWithinAABB(EntityCreature.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityCreature creature = (EntityCreature)obj; + if(this.rite.creatureTypes.contains(creature.getClass()) && creature.getDistanceSq(posX, posY, posZ) > 32.0D && !PotionEnderInhibition.isActive(creature, 0)) { + ItemGeneral var10000 = Witchery.Items.GENERIC; + ItemGeneral.teleportToLocation(world, posX - 2.0D + (double)world.rand.nextInt(5), posY, posZ - 2.0D + (double)world.rand.nextInt(5), world.provider.dimensionId, creature, true); + ++count; + if(count >= 2) { + break; + } + } + } + } catch (Exception var17) { + Log.instance().debug(String.format("Exception occurred alluring with a ritual! %s", new Object[]{var17.toString()})); + } + + } + + public int getCurrentStage() { + return this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 60L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + if(ritual.covenSize < 3) { + EntityPlayer player = ritual.getInitiatingPlayer(world); + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.coventoosmall", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } + + this.allure(world, (double)posX, (double)posY, (double)posZ, ++this.stage % 8); + } + + return this.stage < 250?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallFamiliar.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallFamiliar.java index b6245c0..097f5f0 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallFamiliar.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCallFamiliar.java @@ -1,79 +1,79 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.item.ItemGeneral; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteCallFamiliar extends Rite { - - private final int radius; - - - public RiteCallFamiliar(int radius) { - this.radius = radius; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteCallFamiliar.StepCallFamiliar(this)); - } - - private static class StepCallFamiliar extends RitualStep { - - private final RiteCallFamiliar rite; - - - public StepCallFamiliar(RiteCallFamiliar rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int r = this.rite.radius; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); - boolean bound = false; - new ArrayList(); - Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityPlayer player = (EntityPlayer)obj; - EntityTameable entity = Familiar.getFamiliarEntity(player); - if(entity != null) { - ItemGeneral var10000 = Witchery.Items.GENERIC; - ItemGeneral.teleportToLocation(player.worldObj, player.posX, player.posY, player.posZ, player.dimension, entity, false); - bound = true; - } else { - EntityTameable familiar = Familiar.summonFamiliar(player, 0.5D + (double)posX, 0.001D + (double)posY, 0.5D + (double)posZ); - if(familiar != null) { - bound = true; - } - } - } - - if(!bound) { - return RitualStep.Result.ABORTED_REFUND; - } - - ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 1.0D, 2.0D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteCallFamiliar extends Rite { + + private final int radius; + + + public RiteCallFamiliar(int radius) { + this.radius = radius; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteCallFamiliar.StepCallFamiliar(this)); + } + + private static class StepCallFamiliar extends RitualStep { + + private final RiteCallFamiliar rite; + + + public StepCallFamiliar(RiteCallFamiliar rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int r = this.rite.radius; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); + boolean bound = false; + new ArrayList(); + Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityPlayer player = (EntityPlayer)obj; + EntityTameable entity = Familiar.getFamiliarEntity(player); + if(entity != null) { + ItemGeneral var10000 = Witchery.Items.GENERIC; + ItemGeneral.teleportToLocation(player.worldObj, player.posX, player.posY, player.posZ, player.dimension, entity, false); + bound = true; + } else { + EntityTameable familiar = Familiar.summonFamiliar(player, 0.5D + (double)posX, 0.001D + (double)posY, 0.5D + (double)posZ); + if(familiar != null) { + bound = true; + } + } + } + + if(!bound) { + return RitualStep.Result.ABORTED_REFUND; + } + + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 1.0D, 2.0D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteClimateChange.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteClimateChange.java index b1a2e8f..6794446 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteClimateChange.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteClimateChange.java @@ -1,390 +1,390 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map.Entry; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S26PacketMapChunkBulk; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.storage.WorldInfo; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class RiteClimateChange extends Rite { - - protected final int radius; - - - public RiteClimateChange(int radius) { - this.radius = radius; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteClimateChange.StepClimateChange(this, intialStage)); - } - - // $FF: synthetic class - static class NamelessClass1888453163 { - - // $FF: synthetic field - static final int[] $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange = new int[RiteClimateChange.WeatherChange.values().length]; - - - static { - try { - $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.SUN.ordinal()] = 1; - } catch (NoSuchFieldError var4) { - ; - } - - try { - $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.RAIN.ordinal()] = 2; - } catch (NoSuchFieldError var3) { - ; - } - - try { - $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.THUNDER.ordinal()] = 3; - } catch (NoSuchFieldError var2) { - ; - } - - try { - $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.NONE.ordinal()] = 4; - } catch (NoSuchFieldError var1) { - ; - } - - } - } - - private static class StepClimateChange extends RitualStep { - - private final RiteClimateChange rite; - private int stage = 0; - private boolean activated; - - - public StepClimateChange(RiteClimateChange rite, int initialStage) { - super(false); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(!this.activated) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } - - this.activated = true; - SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); - } - - if(!world.isRemote) { - EntityPlayer player = ritual.getInitiatingPlayer(world); - if(!Config.instance().allowBiomeChanging) { - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.disabled", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } else { - BiomeGenBase biome = world.getBiomeGenForCoords(posX, posZ); - if(world.provider.dimensionId != 1 && world.provider.dimensionId != -1 && biome != BiomeGenBase.sky && biome != BiomeGenBase.hell) { - if(ritual.covenSize < 4) { - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.coventoosmall", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } else if(ticks % 20L != 0L) { - return RitualStep.Result.UPKEEP; - } else { - ++this.stage; - if(this.stage < 5) { - ParticleEffect.INSTANT_SPELL.send(SoundEffect.NONE, world, 0.5D + (double)posX, 1.0D + (double)posY, 0.5D + (double)posZ, (double)((float)this.stage * 1.5F), (double)((float)this.stage * 1.1F), 16); - } else if(this.stage == 5) { - ParticleEffect.HUGE_EXPLOSION.send(SoundEffect.NONE, world, 0.5D + (double)posX, 1.0D + (double)posY, 0.5D + (double)posZ, (double)((float)this.stage * 2.0F), (double)((float)this.stage * 1.5F), 16); - double RADIUS = 8.0D; - List items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox((double)posX - 8.0D, (double)(posY - 2), (double)posZ - 8.0D, (double)posX + 8.0D, (double)(posY + 2), (double)posZ + 8.0D)); - Type biomeType = Type.END; - RiteClimateChange.WeatherChange weather = RiteClimateChange.WeatherChange.NONE; - int glowstone = 0; - Iterator biomes = items.iterator(); - - while(biomes.hasNext()) { - Object biomeID = biomes.next(); - EntityItem maxRadius = (EntityItem)biomeID; - ItemStack chunkMap = maxRadius.getEntityItem(); - if(chunkMap.isItemEqual(new ItemStack(Blocks.sapling, 1, 0))) { - biomeType = Type.FOREST; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.tallgrass, 1, 1))) { - biomeType = Type.PLAINS; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.obsidian))) { - biomeType = Type.MOUNTAIN; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.stone))) { - biomeType = Type.HILLS; - } else if(chunkMap.isItemEqual(new ItemStack(Items.slime_ball))) { - biomeType = Type.SWAMP; - } else if(chunkMap.isItemEqual(new ItemStack(Items.water_bucket))) { - biomeType = Type.WATER; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.cactus))) { - biomeType = Type.DESERT; - weather = RiteClimateChange.WeatherChange.SUN; - } else if(chunkMap.isItemEqual(Witchery.Items.GENERIC.itemIcyNeedle.createStack())) { - biomeType = Type.FROZEN; - weather = RiteClimateChange.WeatherChange.RAIN; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.sapling, 1, 3))) { - biomeType = Type.JUNGLE; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.netherrack))) { - biomeType = Type.WASTELAND; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.sand))) { - biomeType = Type.BEACH; - } else if(chunkMap.isItemEqual(new ItemStack(Blocks.red_mushroom))) { - biomeType = Type.MUSHROOM; - } else if(chunkMap.isItemEqual(new ItemStack(Items.skull))) { - biomeType = Type.MAGICAL; - } else { - if(chunkMap.getItem() != Items.glowstone_dust) { - continue; - } - - glowstone += chunkMap.stackSize; - } - - world.removeEntity(maxRadius); - ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_POP, maxRadius, 0.5D, 1.0D, 16); - } - - if(biomeType == Type.END) { - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.missingbiomefoci", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } - - BiomeGenBase[] var29 = BiomeDictionary.getBiomesForType(biomeType); - if(var29 != null && var29.length != 0) { - int var30 = var29[glowstone > 0?Math.min(glowstone, var29.length) - 1:(var29.length >= 3?world.rand.nextInt(3):0)].biomeID; - int var32 = this.rite.radius * (ritual.covenSize - 3); - HashMap var31 = new HashMap(); - this.drawFilledCircle(world, posX, posZ, var32, var31, weather, var30); - ArrayList chunks = new ArrayList(); - Iterator packet = var31.entrySet().iterator(); - - while(packet.hasNext()) { - Entry worldinfo = (Entry)packet.next(); - Chunk i = ((RiteClimateChange.StepClimateChange.ChunkCoord)worldinfo.getKey()).getChunk(world); - i.setBiomeArray((byte[])worldinfo.getValue()); - chunks.add(i); - } - - S26PacketMapChunkBulk var36 = new S26PacketMapChunkBulk(chunks); - Witchery.packetPipeline.sendToDimension(var36, world); - Iterator var33 = chunks.iterator(); - - while(var33.hasNext()) { - Object var35 = var33.next(); - Chunk chunk = (Chunk)var35; - Iterator i$ = chunk.chunkTileEntityMap.values().iterator(); - - while(i$.hasNext()) { - Object tileObj = i$.next(); - TileEntity tile = (TileEntity)tileObj; - Packet packet2 = tile.getDescriptionPacket(); - if(packet2 != null) { - world.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); - } - } - } - - if(world instanceof WorldServer) { - WorldInfo var34 = ((WorldServer)world).getWorldInfo(); - int var37 = (300 + world.rand.nextInt(600)) * 20; - switch(RiteClimateChange.NamelessClass1888453163.$SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[weather.ordinal()]) { - case 1: - if(world.isRaining() || world.isThundering()) { - var34.setRainTime(0); - var34.setThunderTime(0); - var34.setRaining(false); - var34.setThundering(false); - } - break; - case 2: - if(!world.isRaining() && !world.isThundering()) { - var34.setRainTime(var37); - var34.setThunderTime(var37); - var34.setRaining(true); - var34.setThundering(false); - } - break; - case 3: - if(!world.isThundering()) { - var34.setRainTime(var37); - var34.setThunderTime(var37); - var34.setRaining(true); - var34.setThundering(true); - } - case 4: - } - } - - return RitualStep.Result.COMPLETED; - } - - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.DARK_RED, player, "witchery.rite.missingbiomefoci", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } - - return RitualStep.Result.UPKEEP; - } - } else { - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.wrongdimension", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } - } - } else { - return RitualStep.Result.COMPLETED; - } - } - - private static byte[] rotateMatrix(byte[] matrix, int n) { - byte[] ret = new byte[matrix.length]; - - for(int i = 0; i < matrix.length / n; ++i) { - for(int j = 0; j < n; ++j) { - ret[j * n + i] = matrix[i * n + n - j]; - } - } - - return ret; - } - - protected void drawFilledCircle(World world, int x0, int z0, int radius, HashMap chunkMap, RiteClimateChange.WeatherChange weather, int biomeID) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawLine(world, -x + x0, x + x0, z + z0, chunkMap, weather, biomeID); - this.drawLine(world, -z + x0, z + x0, x + z0, chunkMap, weather, biomeID); - this.drawLine(world, -x + x0, x + x0, -z + z0, chunkMap, weather, biomeID); - this.drawLine(world, -z + x0, z + x0, -x + z0, chunkMap, weather, biomeID); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawLine(World world, int x1, int x2, int z, HashMap chunkMap, RiteClimateChange.WeatherChange weather, int biomeID) { - for(int x = x1; x <= x2; ++x) { - RiteClimateChange.StepClimateChange.ChunkCoord coord = new RiteClimateChange.StepClimateChange.ChunkCoord(x >> 4, z >> 4); - byte[] map = (byte[])chunkMap.get(coord); - if(map == null) { - Chunk y = world.getChunkFromBlockCoords(x, z); - map = (byte[])y.getBiomeArray().clone(); - chunkMap.put(coord, map); - } - - map[(z & 15) << 4 | x & 15] = (byte)biomeID; - if(weather == RiteClimateChange.WeatherChange.SUN) { - int var12 = world.getTopSolidOrLiquidBlock(x, z); - if(world.getBlock(x, var12, z) == Blocks.snow) { - world.setBlockToAir(x, var12, z); - } - } - } - - } - - private static class ChunkCoord { - - public final int X; - public final int Z; - - - public ChunkCoord(int x, int z) { - this.X = x; - this.Z = z; - } - - public boolean equals(Object obj) { - if(obj == this) { - return true; - } else if(obj != null && obj.getClass() == this.getClass()) { - RiteClimateChange.StepClimateChange.ChunkCoord other = (RiteClimateChange.StepClimateChange.ChunkCoord)obj; - return this.X == other.X && this.Z == other.Z; - } else { - return false; - } - } - - public int hashCode() { - int result = this.X ^ this.X >>> 32; - result = 31 * result + (this.Z ^ this.Z >>> 32); - return result; - } - - public Chunk getChunk(World world) { - return world.getChunkFromChunkCoords(this.X, this.Z); - } - } - } - - public static enum WeatherChange { - - NONE("NONE", 0), - SUN("SUN", 1), - RAIN("RAIN", 2), - THUNDER("THUNDER", 3); - // $FF: synthetic field - private static final RiteClimateChange.WeatherChange[] $VALUES = new RiteClimateChange.WeatherChange[]{NONE, SUN, RAIN, THUNDER}; - - - private WeatherChange(String var1, int var2) {} - - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.WorldInfo; +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.common.BiomeDictionary.Type; + +public class RiteClimateChange extends Rite { + + protected final int radius; + + + public RiteClimateChange(int radius) { + this.radius = radius; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteClimateChange.StepClimateChange(this, intialStage)); + } + + // $FF: synthetic class + static class NamelessClass1888453163 { + + // $FF: synthetic field + static final int[] $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange = new int[RiteClimateChange.WeatherChange.values().length]; + + + static { + try { + $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.SUN.ordinal()] = 1; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.RAIN.ordinal()] = 2; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.THUNDER.ordinal()] = 3; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[RiteClimateChange.WeatherChange.NONE.ordinal()] = 4; + } catch (NoSuchFieldError var1) { + ; + } + + } + } + + private static class StepClimateChange extends RitualStep { + + private final RiteClimateChange rite; + private int stage = 0; + private boolean activated; + + + public StepClimateChange(RiteClimateChange rite, int initialStage) { + super(false); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(!this.activated) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + + this.activated = true; + SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); + } + + if(!world.isRemote) { + EntityPlayer player = ritual.getInitiatingPlayer(world); + if(!Config.instance().allowBiomeChanging) { + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.disabled", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } else { + BiomeGenBase biome = world.getBiomeGenForCoords(posX, posZ); + if(world.provider.dimensionId != 1 && world.provider.dimensionId != -1 && biome != BiomeGenBase.sky && biome != BiomeGenBase.hell) { + if(ritual.covenSize < 4) { + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.coventoosmall", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } else if(ticks % 20L != 0L) { + return RitualStep.Result.UPKEEP; + } else { + ++this.stage; + if(this.stage < 5) { + ParticleEffect.INSTANT_SPELL.send(SoundEffect.NONE, world, 0.5D + (double)posX, 1.0D + (double)posY, 0.5D + (double)posZ, (double)((float)this.stage * 1.5F), (double)((float)this.stage * 1.1F), 16); + } else if(this.stage == 5) { + ParticleEffect.HUGE_EXPLOSION.send(SoundEffect.NONE, world, 0.5D + (double)posX, 1.0D + (double)posY, 0.5D + (double)posZ, (double)((float)this.stage * 2.0F), (double)((float)this.stage * 1.5F), 16); + double RADIUS = 8.0D; + List items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox((double)posX - 8.0D, (double)(posY - 2), (double)posZ - 8.0D, (double)posX + 8.0D, (double)(posY + 2), (double)posZ + 8.0D)); + Type biomeType = Type.END; + RiteClimateChange.WeatherChange weather = RiteClimateChange.WeatherChange.NONE; + int glowstone = 0; + Iterator biomes = items.iterator(); + + while(biomes.hasNext()) { + Object biomeID = biomes.next(); + EntityItem maxRadius = (EntityItem)biomeID; + ItemStack chunkMap = maxRadius.getEntityItem(); + if(chunkMap.isItemEqual(new ItemStack(Blocks.sapling, 1, 0))) { + biomeType = Type.FOREST; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.tallgrass, 1, 1))) { + biomeType = Type.PLAINS; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.obsidian))) { + biomeType = Type.MOUNTAIN; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.stone))) { + biomeType = Type.HILLS; + } else if(chunkMap.isItemEqual(new ItemStack(Items.slime_ball))) { + biomeType = Type.SWAMP; + } else if(chunkMap.isItemEqual(new ItemStack(Items.water_bucket))) { + biomeType = Type.WATER; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.cactus))) { + biomeType = Type.DESERT; + weather = RiteClimateChange.WeatherChange.SUN; + } else if(chunkMap.isItemEqual(Witchery.Items.GENERIC.itemIcyNeedle.createStack())) { + biomeType = Type.FROZEN; + weather = RiteClimateChange.WeatherChange.RAIN; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.sapling, 1, 3))) { + biomeType = Type.JUNGLE; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.netherrack))) { + biomeType = Type.WASTELAND; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.sand))) { + biomeType = Type.BEACH; + } else if(chunkMap.isItemEqual(new ItemStack(Blocks.red_mushroom))) { + biomeType = Type.MUSHROOM; + } else if(chunkMap.isItemEqual(new ItemStack(Items.skull))) { + biomeType = Type.MAGICAL; + } else { + if(chunkMap.getItem() != Items.glowstone_dust) { + continue; + } + + glowstone += chunkMap.stackSize; + } + + world.removeEntity(maxRadius); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_POP, maxRadius, 0.5D, 1.0D, 16); + } + + if(biomeType == Type.END) { + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.missingbiomefoci", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } + + BiomeGenBase[] var29 = BiomeDictionary.getBiomesForType(biomeType); + if(var29 != null && var29.length != 0) { + int var30 = var29[glowstone > 0?Math.min(glowstone, var29.length) - 1:(var29.length >= 3?world.rand.nextInt(3):0)].biomeID; + int var32 = this.rite.radius * (ritual.covenSize - 3); + HashMap var31 = new HashMap(); + this.drawFilledCircle(world, posX, posZ, var32, var31, weather, var30); + ArrayList chunks = new ArrayList(); + Iterator packet = var31.entrySet().iterator(); + + while(packet.hasNext()) { + Entry worldinfo = (Entry)packet.next(); + Chunk i = ((RiteClimateChange.StepClimateChange.ChunkCoord)worldinfo.getKey()).getChunk(world); + i.setBiomeArray((byte[])worldinfo.getValue()); + chunks.add(i); + } + + S26PacketMapChunkBulk var36 = new S26PacketMapChunkBulk(chunks); + Witchery.packetPipeline.sendToDimension(var36, world); + Iterator var33 = chunks.iterator(); + + while(var33.hasNext()) { + Object var35 = var33.next(); + Chunk chunk = (Chunk)var35; + Iterator i$ = chunk.chunkTileEntityMap.values().iterator(); + + while(i$.hasNext()) { + Object tileObj = i$.next(); + TileEntity tile = (TileEntity)tileObj; + Packet packet2 = tile.getDescriptionPacket(); + if(packet2 != null) { + world.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); + } + } + } + + if(world instanceof WorldServer) { + WorldInfo var34 = ((WorldServer)world).getWorldInfo(); + int var37 = (300 + world.rand.nextInt(600)) * 20; + switch(RiteClimateChange.NamelessClass1888453163.$SwitchMap$com$emoniph$witchery$ritual$rites$RiteClimateChange$WeatherChange[weather.ordinal()]) { + case 1: + if(world.isRaining() || world.isThundering()) { + var34.setRainTime(0); + var34.setThunderTime(0); + var34.setRaining(false); + var34.setThundering(false); + } + break; + case 2: + if(!world.isRaining() && !world.isThundering()) { + var34.setRainTime(var37); + var34.setThunderTime(var37); + var34.setRaining(true); + var34.setThundering(false); + } + break; + case 3: + if(!world.isThundering()) { + var34.setRainTime(var37); + var34.setThunderTime(var37); + var34.setRaining(true); + var34.setThundering(true); + } + case 4: + } + } + + return RitualStep.Result.COMPLETED; + } + + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.DARK_RED, player, "witchery.rite.missingbiomefoci", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } + + return RitualStep.Result.UPKEEP; + } + } else { + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.wrongdimension", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } + } + } else { + return RitualStep.Result.COMPLETED; + } + } + + private static byte[] rotateMatrix(byte[] matrix, int n) { + byte[] ret = new byte[matrix.length]; + + for(int i = 0; i < matrix.length / n; ++i) { + for(int j = 0; j < n; ++j) { + ret[j * n + i] = matrix[i * n + n - j]; + } + } + + return ret; + } + + protected void drawFilledCircle(World world, int x0, int z0, int radius, HashMap chunkMap, RiteClimateChange.WeatherChange weather, int biomeID) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawLine(world, -x + x0, x + x0, z + z0, chunkMap, weather, biomeID); + this.drawLine(world, -z + x0, z + x0, x + z0, chunkMap, weather, biomeID); + this.drawLine(world, -x + x0, x + x0, -z + z0, chunkMap, weather, biomeID); + this.drawLine(world, -z + x0, z + x0, -x + z0, chunkMap, weather, biomeID); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawLine(World world, int x1, int x2, int z, HashMap chunkMap, RiteClimateChange.WeatherChange weather, int biomeID) { + for(int x = x1; x <= x2; ++x) { + RiteClimateChange.StepClimateChange.ChunkCoord coord = new RiteClimateChange.StepClimateChange.ChunkCoord(x >> 4, z >> 4); + byte[] map = (byte[])chunkMap.get(coord); + if(map == null) { + Chunk y = world.getChunkFromBlockCoords(x, z); + map = (byte[])y.getBiomeArray().clone(); + chunkMap.put(coord, map); + } + + map[(z & 15) << 4 | x & 15] = (byte)biomeID; + if(weather == RiteClimateChange.WeatherChange.SUN) { + int var12 = world.getTopSolidOrLiquidBlock(x, z); + if(world.getBlock(x, var12, z) == Blocks.snow) { + world.setBlockToAir(x, var12, z); + } + } + } + + } + + private static class ChunkCoord { + + public final int X; + public final int Z; + + + public ChunkCoord(int x, int z) { + this.X = x; + this.Z = z; + } + + public boolean equals(Object obj) { + if(obj == this) { + return true; + } else if(obj != null && obj.getClass() == this.getClass()) { + RiteClimateChange.StepClimateChange.ChunkCoord other = (RiteClimateChange.StepClimateChange.ChunkCoord)obj; + return this.X == other.X && this.Z == other.Z; + } else { + return false; + } + } + + public int hashCode() { + int result = this.X ^ this.X >>> 32; + result = 31 * result + (this.Z ^ this.Z >>> 32); + return result; + } + + public Chunk getChunk(World world) { + return world.getChunkFromChunkCoords(this.X, this.Z); + } + } + } + + public static enum WeatherChange { + + NONE("NONE", 0), + SUN("SUN", 1), + RAIN("RAIN", 2), + THUNDER("THUNDER", 3); + // $FF: synthetic field + private static final RiteClimateChange.WeatherChange[] $VALUES = new RiteClimateChange.WeatherChange[]{NONE, SUN, RAIN, THUNDER}; + + + private WeatherChange(String var1, int var2) {} + + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCookItem.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCookItem.java index 6594710..a77d949 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCookItem.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCookItem.java @@ -1,96 +1,96 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Items; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.world.World; - -public class RiteCookItem extends Rite { - - private final float radius; - private final double burnChance; - - - public RiteCookItem(float radius, double burnChance) { - this.radius = radius; - this.burnChance = burnChance; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteCookItem.StepCookItem(this)); - } - - private static class StepCookItem extends RitualStep { - - private final RiteCookItem rite; - - - public StepCookItem(RiteCookItem rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - ArrayList items = this.rite.getItemsInRadius(world, posX, posY, posZ, this.rite.radius); - int count = 0; - Iterator i$ = items.iterator(); - - while(i$.hasNext()) { - EntityItem item = (EntityItem)i$.next(); - ItemStack cookedStack = FurnaceRecipes.smelting().getSmeltingResult(item.getEntityItem()); - if(cookedStack != null && cookedStack.getItem() instanceof ItemFood && item.getEntityItem().stackSize > 0) { - int size = item.getEntityItem().stackSize; - int burnCount = 0; - - for(int burntEntity = 0; burntEntity < size; ++burntEntity) { - if(world.rand.nextDouble() < this.rite.burnChance) { - ++burnCount; - } - } - - item.setDead(); - EntityItem var16; - if(size - burnCount > 0) { - cookedStack.stackSize = size - burnCount; - var16 = new EntityItem(world, (double)posX, (double)posY + 0.05D, (double)posZ, cookedStack); - var16.motionX = 0.0D; - var16.motionZ = 0.0D; - world.spawnEntityInWorld(var16); - } - - if(burnCount > 0) { - var16 = new EntityItem(world, (double)posX, (double)posY + 0.05D, (double)posZ, new ItemStack(Items.coal, burnCount, 1)); - var16.motionX = 0.0D; - var16.motionZ = 0.0D; - world.spawnEntityInWorld(var16); - } - - ++count; - } - } - - if(count == 0) { - return RitualStep.Result.ABORTED_REFUND; - } - - ParticleEffect.FLAME.send(SoundEffect.MOB_GHAST_FIREBALL, world, (double)posX, (double)posY, (double)posZ, 3.0D, 2.0D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.world.World; + +public class RiteCookItem extends Rite { + + private final float radius; + private final double burnChance; + + + public RiteCookItem(float radius, double burnChance) { + this.radius = radius; + this.burnChance = burnChance; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteCookItem.StepCookItem(this)); + } + + private static class StepCookItem extends RitualStep { + + private final RiteCookItem rite; + + + public StepCookItem(RiteCookItem rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + ArrayList items = this.rite.getItemsInRadius(world, posX, posY, posZ, this.rite.radius); + int count = 0; + Iterator i$ = items.iterator(); + + while(i$.hasNext()) { + EntityItem item = (EntityItem)i$.next(); + ItemStack cookedStack = FurnaceRecipes.smelting().getSmeltingResult(item.getEntityItem()); + if(cookedStack != null && cookedStack.getItem() instanceof ItemFood && item.getEntityItem().stackSize > 0) { + int size = item.getEntityItem().stackSize; + int burnCount = 0; + + for(int burntEntity = 0; burntEntity < size; ++burntEntity) { + if(world.rand.nextDouble() < this.rite.burnChance) { + ++burnCount; + } + } + + item.setDead(); + EntityItem var16; + if(size - burnCount > 0) { + cookedStack.stackSize = size - burnCount; + var16 = new EntityItem(world, (double)posX, (double)posY + 0.05D, (double)posZ, cookedStack); + var16.motionX = 0.0D; + var16.motionZ = 0.0D; + world.spawnEntityInWorld(var16); + } + + if(burnCount > 0) { + var16 = new EntityItem(world, (double)posX, (double)posY + 0.05D, (double)posZ, new ItemStack(Items.coal, burnCount, 1)); + var16.motionX = 0.0D; + var16.motionZ = 0.0D; + world.spawnEntityInWorld(var16); + } + + ++count; + } + } + + if(count == 0) { + return RitualStep.Result.ABORTED_REFUND; + } + + ParticleEffect.FLAME.send(SoundEffect.MOB_GHAST_FIREBALL, world, (double)posX, (double)posY, (double)posZ, 3.0D, 2.0D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCrater.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCrater.java index 3f72938..213a3f7 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCrater.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCrater.java @@ -1,129 +1,129 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.BlockProtect; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.Log; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class RiteCrater extends Rite { - - private final int radius; - private final int height; - - - public RiteCrater(int radius, int height) { - this.radius = radius; - this.height = height; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteCrater.StepCrater(this, intialStage)); - } - - private static class StepCrater extends RitualStep { - - private final RiteCrater rite; - private int stage = 0; - - - public StepCrater(RiteCrater rite, int initialStage) { - super(true); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 10L != 0L) { - return RitualStep.Result.STARTING; - } else if(world.isRemote) { - return RitualStep.Result.COMPLETED; - } else { - if(++this.stage == 1) { - ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 0.5D, 1.0D, 16); - } - - int height = this.rite.height; - float radius = (float)this.rite.radius; - if(this.stage > height) { - return RitualStep.Result.COMPLETED; - } else { - for(int y = 1; y <= this.stage; ++y) { - float r = radius - (float)(height - this.stage - 1 + y) * radius / (float)height; - Log.instance().debug(String.format("Stage: %d, r=%f y=%d", new Object[]{Integer.valueOf(this.stage), Float.valueOf(r), Integer.valueOf(y)})); - this.drawFilledCircle(world, posX, posZ, posY - y, Math.max((int)Math.ceil((double)r), 1), posY); - } - - return RitualStep.Result.UPKEEP; - } - } - } - - protected void drawFilledCircle(World world, int x0, int z0, int y, int radius, int height) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawLine(world, -x + x0, x + x0, z + z0, y, x0, z0, radius, height); - this.drawLine(world, -z + x0, z + x0, x + z0, y, x0, z0, radius, height); - this.drawLine(world, -x + x0, x + x0, -z + z0, y, x0, z0, radius, height); - this.drawLine(world, -z + x0, z + x0, -x + z0, y, x0, z0, radius, height); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawLine(World world, int x1, int x2, int z, int y, int midX, int midZ, int radius, int midY) { - int modX1 = radius > 1 && world.rand.nextInt(5) == 0?x1 + 1:x1; - int modX2 = radius > 1 && world.rand.nextInt(5) == 0?x2 - 1:x2; - boolean var10000; - if(midZ + radius != z && midZ - radius != z) { - var10000 = false; - } else { - var10000 = true; - } - - for(int done = modX1; done <= modX2; ++done) { - this.drawPixel(world, done, z, y, midX, midY, midZ); - } - - boolean var14 = true; - } - - protected void drawPixel(World world, int x, int z, int y, int midX, int midY, int midZ) { - if(!world.isRemote && (x != midX || z != midZ) && (y < midY - 3 || Coord.distance((double)x, (double)midY, (double)z, (double)midX, (double)midY, (double)midZ) > (double)(this.rite.radius - 3 - (midY - y)))) { - Block blockID = world.getBlock(x, y, z); - int blockMetadata = world.getBlockMetadata(x, y, z); - if(BlockProtect.canBreak(x, y, z, world)) { - world.setBlockToAir(x, y, z); - if(blockID != Blocks.air && blockID != Blocks.stone && blockID != Blocks.dirt && blockID != Blocks.grass && blockID != Blocks.sand && blockID != Blocks.sandstone && blockID != Blocks.gravel) { - ItemStack stack = new ItemStack(blockID, 1, blockMetadata); - EntityItem entity = new EntityItem(world, (double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, stack); - world.spawnEntityInWorld(entity); - } - } - } - - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.BlockProtect; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.Log; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RiteCrater extends Rite { + + private final int radius; + private final int height; + + + public RiteCrater(int radius, int height) { + this.radius = radius; + this.height = height; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteCrater.StepCrater(this, intialStage)); + } + + private static class StepCrater extends RitualStep { + + private final RiteCrater rite; + private int stage = 0; + + + public StepCrater(RiteCrater rite, int initialStage) { + super(true); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 10L != 0L) { + return RitualStep.Result.STARTING; + } else if(world.isRemote) { + return RitualStep.Result.COMPLETED; + } else { + if(++this.stage == 1) { + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 0.5D, 1.0D, 16); + } + + int height = this.rite.height; + float radius = (float)this.rite.radius; + if(this.stage > height) { + return RitualStep.Result.COMPLETED; + } else { + for(int y = 1; y <= this.stage; ++y) { + float r = radius - (float)(height - this.stage - 1 + y) * radius / (float)height; + Log.instance().debug(String.format("Stage: %d, r=%f y=%d", new Object[]{Integer.valueOf(this.stage), Float.valueOf(r), Integer.valueOf(y)})); + this.drawFilledCircle(world, posX, posZ, posY - y, Math.max((int)Math.ceil((double)r), 1), posY); + } + + return RitualStep.Result.UPKEEP; + } + } + } + + protected void drawFilledCircle(World world, int x0, int z0, int y, int radius, int height) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawLine(world, -x + x0, x + x0, z + z0, y, x0, z0, radius, height); + this.drawLine(world, -z + x0, z + x0, x + z0, y, x0, z0, radius, height); + this.drawLine(world, -x + x0, x + x0, -z + z0, y, x0, z0, radius, height); + this.drawLine(world, -z + x0, z + x0, -x + z0, y, x0, z0, radius, height); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawLine(World world, int x1, int x2, int z, int y, int midX, int midZ, int radius, int midY) { + int modX1 = radius > 1 && world.rand.nextInt(5) == 0?x1 + 1:x1; + int modX2 = radius > 1 && world.rand.nextInt(5) == 0?x2 - 1:x2; + boolean var10000; + if(midZ + radius != z && midZ - radius != z) { + var10000 = false; + } else { + var10000 = true; + } + + for(int done = modX1; done <= modX2; ++done) { + this.drawPixel(world, done, z, y, midX, midY, midZ); + } + + boolean var14 = true; + } + + protected void drawPixel(World world, int x, int z, int y, int midX, int midY, int midZ) { + if(!world.isRemote && (x != midX || z != midZ) && (y < midY - 3 || Coord.distance((double)x, (double)midY, (double)z, (double)midX, (double)midY, (double)midZ) > (double)(this.rite.radius - 3 - (midY - y)))) { + Block blockID = world.getBlock(x, y, z); + int blockMetadata = world.getBlockMetadata(x, y, z); + if(BlockProtect.canBreak(x, y, z, world)) { + world.setBlockToAir(x, y, z); + if(blockID != Blocks.air && blockID != Blocks.stone && blockID != Blocks.dirt && blockID != Blocks.grass && blockID != Blocks.sand && blockID != Blocks.sandstone && blockID != Blocks.gravel) { + ItemStack stack = new ItemStack(blockID, 1, blockMetadata); + EntityItem entity = new EntityItem(world, (double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, stack); + world.spawnEntityInWorld(entity); + } + } + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseCreature.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseCreature.java index 2075572..6164dd4 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseCreature.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseCreature.java @@ -1,169 +1,169 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockAreaMarker; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.entity.EntityWitchHunter; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.item.ItemHunterClothes; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteCurseCreature extends Rite { - - private final boolean curse; - private final int level; - private final String curseType; - - - public RiteCurseCreature(boolean curse, String curseType, int level) { - this.curse = curse; - this.level = level; - this.curseType = curseType; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteCurseCreature.StepCurseCreature(this)); - } - - private static class StepCurseCreature extends RitualStep { - - private final RiteCurseCreature rite; - private static final int CURSE_MASTER_BONUS_LEVELS = 1; - - - public StepCurseCreature(RiteCurseCreature rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - boolean complete = false; - boolean cursed = false; - EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); - int levelBuff = curseMasterPlayer != null && Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer)?1:0; - if(ritual.covenSize == 6) { - levelBuff += 2; - } else if(ritual.covenSize >= 3) { - ++levelBuff; - } - - Iterator i$ = ritual.sacrificedItems.iterator(); - - while(i$.hasNext()) { - RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); - if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { - EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); - if(entity != null) { - NBTTagCompound nbtTag = entity instanceof EntityPlayer?Infusion.getNBT(entity):entity.getEntityData(); - if(nbtTag != null) { - int currentLevel = nbtTag.hasKey(this.rite.curseType)?nbtTag.getInteger(this.rite.curseType):0; - if(this.rite.curse) { - EntityWitchHunter.blackMagicPerformed(curseMasterPlayer); - boolean newLevel = ItemHunterClothes.isCurseProtectionActive(entity) && (this.rite.curseType.equals("witcheryCursed") || this.rite.curseType.equals("witcheryWakingNightmare")); - if(!newLevel) { - newLevel = BlockAreaMarker.AreaMarkerRegistry.instance().isProtectionActive(entity, this.rite); - } - - if(!newLevel && !Witchery.Items.POPPET.voodooProtectionActivated(curseMasterPlayer, (ItemStack)null, entity, levelBuff > 0?3:1)) { - nbtTag.setInteger(this.rite.curseType, Math.max(this.rite.level + levelBuff, currentLevel)); - cursed = true; - if(entity instanceof EntityPlayer) { - Infusion.syncPlayer(entity.worldObj, (EntityPlayer)entity); - } - } - - if(newLevel) { - if(curseMasterPlayer != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.blackmagicdampening", new Object[0]); - } - } else { - complete = true; - } - } else { - int var18 = 0; - if(currentLevel > 0) { - if(this.rite.level + levelBuff > currentLevel) { - var18 = world.rand.nextInt(20) == 0?currentLevel + 1:0; - } else if(this.rite.level + levelBuff < currentLevel) { - var18 = world.rand.nextInt(4) == 0?0:currentLevel + 1; - } else { - var18 = world.rand.nextInt(4) == 0?currentLevel + 1:0; - } - } - - if(var18 == 0) { - if(nbtTag.hasKey(this.rite.curseType)) { - nbtTag.removeTag(this.rite.curseType); - } - - if(entity.isPotionActive(Potion.poison)) { - entity.removePotionEffect(Potion.poison.id); - } - - if(entity.isPotionActive(Potion.weakness)) { - entity.removePotionEffect(Potion.weakness.id); - } - - if(entity.isPotionActive(Potion.blindness)) { - entity.removePotionEffect(Potion.blindness.id); - } - - if(entity.isPotionActive(Potion.digSlowdown)) { - entity.removePotionEffect(Potion.digSlowdown.id); - } - - if(entity.isPotionActive(Potion.moveSlowdown)) { - entity.removePotionEffect(Potion.moveSlowdown.id); - } - } else { - nbtTag.setInteger(this.rite.curseType, var18); - cursed = true; - } - - if(entity instanceof EntityPlayer) { - Infusion.syncPlayer(entity.worldObj, (EntityPlayer)entity); - } - - complete = true; - } - } - } - break; - } - } - - if(!complete) { - return RitualStep.Result.ABORTED_REFUND; - } - - if(cursed) { - ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } else { - ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockAreaMarker; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.item.ItemHunterClothes; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteCurseCreature extends Rite { + + private final boolean curse; + private final int level; + private final String curseType; + + + public RiteCurseCreature(boolean curse, String curseType, int level) { + this.curse = curse; + this.level = level; + this.curseType = curseType; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteCurseCreature.StepCurseCreature(this)); + } + + private static class StepCurseCreature extends RitualStep { + + private final RiteCurseCreature rite; + private static final int CURSE_MASTER_BONUS_LEVELS = 1; + + + public StepCurseCreature(RiteCurseCreature rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + boolean complete = false; + boolean cursed = false; + EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); + int levelBuff = curseMasterPlayer != null && Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer)?1:0; + if(ritual.covenSize == 6) { + levelBuff += 2; + } else if(ritual.covenSize >= 3) { + ++levelBuff; + } + + Iterator i$ = ritual.sacrificedItems.iterator(); + + while(i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + if(entity != null) { + NBTTagCompound nbtTag = entity instanceof EntityPlayer?Infusion.getNBT(entity):entity.getEntityData(); + if(nbtTag != null) { + int currentLevel = nbtTag.hasKey(this.rite.curseType)?nbtTag.getInteger(this.rite.curseType):0; + if(this.rite.curse) { + EntityWitchHunter.blackMagicPerformed(curseMasterPlayer); + boolean newLevel = ItemHunterClothes.isCurseProtectionActive(entity) && (this.rite.curseType.equals("witcheryCursed") || this.rite.curseType.equals("witcheryWakingNightmare")); + if(!newLevel) { + newLevel = BlockAreaMarker.AreaMarkerRegistry.instance().isProtectionActive(entity, this.rite); + } + + if(!newLevel && !Witchery.Items.POPPET.voodooProtectionActivated(curseMasterPlayer, (ItemStack)null, entity, levelBuff > 0?3:1)) { + nbtTag.setInteger(this.rite.curseType, Math.max(this.rite.level + levelBuff, currentLevel)); + cursed = true; + if(entity instanceof EntityPlayer) { + Infusion.syncPlayer(entity.worldObj, (EntityPlayer)entity); + } + } + + if(newLevel) { + if(curseMasterPlayer != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.blackmagicdampening", new Object[0]); + } + } else { + complete = true; + } + } else { + int var18 = 0; + if(currentLevel > 0) { + if(this.rite.level + levelBuff > currentLevel) { + var18 = world.rand.nextInt(20) == 0?currentLevel + 1:0; + } else if(this.rite.level + levelBuff < currentLevel) { + var18 = world.rand.nextInt(4) == 0?0:currentLevel + 1; + } else { + var18 = world.rand.nextInt(4) == 0?currentLevel + 1:0; + } + } + + if(var18 == 0) { + if(nbtTag.hasKey(this.rite.curseType)) { + nbtTag.removeTag(this.rite.curseType); + } + + if(entity.isPotionActive(Potion.poison)) { + entity.removePotionEffect(Potion.poison.id); + } + + if(entity.isPotionActive(Potion.weakness)) { + entity.removePotionEffect(Potion.weakness.id); + } + + if(entity.isPotionActive(Potion.blindness)) { + entity.removePotionEffect(Potion.blindness.id); + } + + if(entity.isPotionActive(Potion.digSlowdown)) { + entity.removePotionEffect(Potion.digSlowdown.id); + } + + if(entity.isPotionActive(Potion.moveSlowdown)) { + entity.removePotionEffect(Potion.moveSlowdown.id); + } + } else { + nbtTag.setInteger(this.rite.curseType, var18); + cursed = true; + } + + if(entity instanceof EntityPlayer) { + Infusion.syncPlayer(entity.worldObj, (EntityPlayer)entity); + } + + complete = true; + } + } + } + break; + } + } + + if(!complete) { + return RitualStep.Result.ABORTED_REFUND; + } + + if(cursed) { + ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } else { + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseOfTheWolf.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseOfTheWolf.java index 1987402..b4929bc 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseOfTheWolf.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCurseOfTheWolf.java @@ -1,166 +1,166 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockAreaMarker; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.common.ExtendedPlayer; -import com.emoniph.witchery.entity.EntityVillagerWere; -import com.emoniph.witchery.entity.EntityWitchHunter; -import com.emoniph.witchery.entity.EntityWolfman; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.item.ItemHunterClothes; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.CreatureUtil; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteCurseOfTheWolf extends Rite { - - private final boolean curse; - - - public RiteCurseOfTheWolf(boolean curse) { - this.curse = curse; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteCurseOfTheWolf.StepCurseCreature(this)); - } - - private static class StepCurseCreature extends RitualStep { - - private final RiteCurseOfTheWolf rite; - - - public StepCurseCreature(RiteCurseOfTheWolf rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - boolean complete = false; - boolean cursed = false; - EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); - if(!CreatureUtil.isFullMoon(world)) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requiresfullmoon", new Object[0]); - return RitualStep.Result.ABORTED_REFUND; - } - - if(!Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer)) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requirescat", new Object[0]); - return RitualStep.Result.ABORTED_REFUND; - } - - if(ritual.covenSize < 6) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requiresfullcoven", new Object[0]); - return RitualStep.Result.ABORTED_REFUND; - } - - Iterator i$ = ritual.sacrificedItems.iterator(); - - while(i$.hasNext()) { - RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); - if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { - EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); - if(entity != null) { - if(this.rite.curse) { - EntityWitchHunter.blackMagicPerformed(curseMasterPlayer); - boolean villager = ItemHunterClothes.isCurseProtectionActive(entity); - if(!villager) { - villager = BlockAreaMarker.AreaMarkerRegistry.instance().isProtectionActive(entity, this.rite); - } - - if(!villager && !Witchery.Items.POPPET.voodooProtectionActivated(curseMasterPlayer, (ItemStack)null, entity, 3)) { - if(entity instanceof EntityPlayer) { - EntityPlayer playerEx = (EntityPlayer)entity; - ExtendedPlayer MAX_RANGE_SQ = ExtendedPlayer.get(playerEx); - if(!Config.instance().allowVampireWolfHybrids && MAX_RANGE_SQ.isVampire()) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.hybridsnotallow", new Object[0]); - } else if(MAX_RANGE_SQ.getWerewolfLevel() == 0) { - MAX_RANGE_SQ.setWerewolfLevel(1); - ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, playerEx, "witchery.werewolf.infection", new Object[0]); - complete = true; - cursed = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.alreadyactive", new Object[0]); - } - } else if(entity instanceof EntityVillager && !(entity instanceof EntityVillagerWere)) { - EntityVillager playerEx1 = (EntityVillager)entity; - EntityWolfman.convertToCuredVillager(playerEx1, playerEx1.getProfession(), playerEx1.wealth, playerEx1.buyingList); - complete = true; - cursed = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.nothuman", new Object[0]); - } - } - - if(villager && curseMasterPlayer != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.blackmagicdampening", new Object[0]); - } - } else if(entity instanceof EntityPlayer) { - EntityPlayer villager1 = (EntityPlayer)entity; - ExtendedPlayer playerEx2 = ExtendedPlayer.get(villager1); - if(playerEx2.getWerewolfLevel() > 0) { - double MAX_RANGE_SQ1 = 64.0D; - if(playerEx2.getWerewolfLevel() != 1 && villager1.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ) > 64.0D) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.toofar", new Object[0]); - } else { - if(world.rand.nextInt(4) != 0) { - playerEx2.setWerewolfLevel(0); - } else { - cursed = true; - } - - complete = true; - } - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); - } - } else if(entity instanceof EntityVillagerWere) { - EntityVillagerWere villager2 = (EntityVillagerWere)entity; - EntityWolfman.convertToCuredVillager(villager2, villager2.getProfession(), villager2.wealth, villager2.buyingList); - complete = true; - } else if(entity instanceof EntityWolfman) { - EntityWolfman villager3 = (EntityWolfman)entity; - EntityWolfman.convertToCuredVillager(villager3, villager3.getFormerProfession(), villager3.getWealth(), villager3.getBuyingList()); - complete = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); - } - } - break; - } - } - - if(!complete) { - return RitualStep.Result.ABORTED_REFUND; - } - - if(cursed) { - ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } else { - ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockAreaMarker; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.common.ExtendedPlayer; +import com.emoniph.witchery.entity.EntityVillagerWere; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.entity.EntityWolfman; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.item.ItemHunterClothes; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.CreatureUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteCurseOfTheWolf extends Rite { + + private final boolean curse; + + + public RiteCurseOfTheWolf(boolean curse) { + this.curse = curse; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteCurseOfTheWolf.StepCurseCreature(this)); + } + + private static class StepCurseCreature extends RitualStep { + + private final RiteCurseOfTheWolf rite; + + + public StepCurseCreature(RiteCurseOfTheWolf rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + boolean complete = false; + boolean cursed = false; + EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); + if(!CreatureUtil.isFullMoon(world)) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requiresfullmoon", new Object[0]); + return RitualStep.Result.ABORTED_REFUND; + } + + if(!Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer)) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requirescat", new Object[0]); + return RitualStep.Result.ABORTED_REFUND; + } + + if(ritual.covenSize < 6) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requiresfullcoven", new Object[0]); + return RitualStep.Result.ABORTED_REFUND; + } + + Iterator i$ = ritual.sacrificedItems.iterator(); + + while(i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + if(entity != null) { + if(this.rite.curse) { + EntityWitchHunter.blackMagicPerformed(curseMasterPlayer); + boolean villager = ItemHunterClothes.isCurseProtectionActive(entity); + if(!villager) { + villager = BlockAreaMarker.AreaMarkerRegistry.instance().isProtectionActive(entity, this.rite); + } + + if(!villager && !Witchery.Items.POPPET.voodooProtectionActivated(curseMasterPlayer, (ItemStack)null, entity, 3)) { + if(entity instanceof EntityPlayer) { + EntityPlayer playerEx = (EntityPlayer)entity; + ExtendedPlayer MAX_RANGE_SQ = ExtendedPlayer.get(playerEx); + if(!Config.instance().allowVampireWolfHybrids && MAX_RANGE_SQ.isVampire()) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.hybridsnotallow", new Object[0]); + } else if(MAX_RANGE_SQ.getWerewolfLevel() == 0) { + MAX_RANGE_SQ.setWerewolfLevel(1); + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, playerEx, "witchery.werewolf.infection", new Object[0]); + complete = true; + cursed = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.alreadyactive", new Object[0]); + } + } else if(entity instanceof EntityVillager && !(entity instanceof EntityVillagerWere)) { + EntityVillager playerEx1 = (EntityVillager)entity; + EntityWolfman.convertToCuredVillager(playerEx1, playerEx1.getProfession(), playerEx1.wealth, playerEx1.buyingList); + complete = true; + cursed = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.nothuman", new Object[0]); + } + } + + if(villager && curseMasterPlayer != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.blackmagicdampening", new Object[0]); + } + } else if(entity instanceof EntityPlayer) { + EntityPlayer villager1 = (EntityPlayer)entity; + ExtendedPlayer playerEx2 = ExtendedPlayer.get(villager1); + if(playerEx2.getWerewolfLevel() > 0) { + double MAX_RANGE_SQ1 = 64.0D; + if(playerEx2.getWerewolfLevel() != 1 && villager1.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ) > 64.0D) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.toofar", new Object[0]); + } else { + if(world.rand.nextInt(4) != 0) { + playerEx2.setWerewolfLevel(0); + } else { + cursed = true; + } + + complete = true; + } + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); + } + } else if(entity instanceof EntityVillagerWere) { + EntityVillagerWere villager2 = (EntityVillagerWere)entity; + EntityWolfman.convertToCuredVillager(villager2, villager2.getProfession(), villager2.wealth, villager2.buyingList); + complete = true; + } else if(entity instanceof EntityWolfman) { + EntityWolfman villager3 = (EntityWolfman)entity; + EntityWolfman.convertToCuredVillager(villager3, villager3.getFormerProfession(), villager3.getWealth(), villager3.getBuyingList()); + complete = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); + } + } + break; + } + } + + if(!complete) { + return RitualStep.Result.ABORTED_REFUND; + } + + if(cursed) { + ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } else { + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCursePoppets.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCursePoppets.java index 168a9b6..3446998 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteCursePoppets.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteCursePoppets.java @@ -1,78 +1,78 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class RiteCursePoppets extends Rite { - - private final int level; - - - public RiteCursePoppets(int level) { - this.level = level; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteCursePoppets.StepCursePoppets(this)); - } - - private static class StepCursePoppets extends RitualStep { - - private final RiteCursePoppets rite; - - - public StepCursePoppets(RiteCursePoppets rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - boolean complete = false; - EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); - boolean curseMaster = curseMasterPlayer != null && Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer); - if(curseMaster) { - Iterator i$ = ritual.sacrificedItems.iterator(); - if(i$.hasNext()) { - RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); - if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { - EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); - if(entity != null && !Witchery.Items.POPPET.poppetProtectionActivated(curseMasterPlayer, (ItemStack)null, entity, true)) { - Witchery.Items.POPPET.destroyAntiVoodooPoppets(curseMasterPlayer, entity, 10); - } - - complete = true; - } - } - } else if(curseMasterPlayer != null) { - ChatUtil.sendTranslated(curseMasterPlayer, "witchery.rite.requirescursemastery", new Object[0]); - } - - if(!complete) { - return RitualStep.Result.ABORTED_REFUND; - } - - ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RiteCursePoppets extends Rite { + + private final int level; + + + public RiteCursePoppets(int level) { + this.level = level; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteCursePoppets.StepCursePoppets(this)); + } + + private static class StepCursePoppets extends RitualStep { + + private final RiteCursePoppets rite; + + + public StepCursePoppets(RiteCursePoppets rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + boolean complete = false; + EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); + boolean curseMaster = curseMasterPlayer != null && Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer); + if(curseMaster) { + Iterator i$ = ritual.sacrificedItems.iterator(); + if(i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + if(entity != null && !Witchery.Items.POPPET.poppetProtectionActivated(curseMasterPlayer, (ItemStack)null, entity, true)) { + Witchery.Items.POPPET.destroyAntiVoodooPoppets(curseMasterPlayer, entity, 10); + } + + complete = true; + } + } + } else if(curseMasterPlayer != null) { + ChatUtil.sendTranslated(curseMasterPlayer, "witchery.rite.requirescursemastery", new Object[0]); + } + + if(!complete) { + return RitualStep.Result.ABORTED_REFUND; + } + + ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteDementorKiss.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteDementorKiss.java new file mode 100644 index 0000000..a1d930a --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteDementorKiss.java @@ -0,0 +1,81 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteDementorKiss extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteDementorKiss(this, initialStage)); + } + + private static class StepRiteDementorKiss extends RitualStep { + private final RiteDementorKiss rite; + + public StepRiteDementorKiss(RiteDementorKiss rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityPlayer initiator = circleType.getInitiatingPlayer(world); + boolean kissed = false; + Iterator i$ = circleType.sacrificedItems.iterator(); + while (i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if (item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + EntityLivingBase target = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + if (target != null) { + EntityWitchHunter.blackMagicPerformed(initiator); + int dur = TimeUtil.secsToTicks(30); + target.addPotionEffect(new PotionEffect(Potion.wither.id, dur, 1)); + target.addPotionEffect(new PotionEffect(Potion.blindness.id, dur, 0)); + target.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, dur, 2)); + target.addPotionEffect(new PotionEffect(Potion.weakness.id, dur, 2)); + target.addPotionEffect(new PotionEffect(Potion.confusion.id, dur, 0)); + if (target instanceof EntityPlayer) { + EntityPlayer victim = (EntityPlayer)target; + // The Kiss devours the soul: strip all experience and starve the body. + victim.experience = 0.0F; + victim.experienceTotal = 0; + victim.experienceLevel = 0; + victim.getFoodStats().addStats(-20, 0.0F); + ChatUtil.sendTranslated(EnumChatFormatting.DARK_RED, victim, "witchery.rite.dementorkiss.victim", new Object[0]); + } + ParticleEffect.MOB_SPELL.send(SoundEffect.MOB_WITHER_DEATH, target, 1.0D, 1.0D, 16); + kissed = true; + } + break; + } + } + + if (!kissed) { + return RitualStep.Result.ABORTED_REFUND; + } + ParticleEffect.LARGE_SMOKE.send(SoundEffect.MOB_ENDERMEN_PORTAL, world, 0.5D + (double)x, 0.5D + (double)y, 0.5D + (double)z, 1.0D, 2.0D, 16); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteEclipse.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteEclipse.java index ea7f7f7..eaa31fb 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteEclipse.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteEclipse.java @@ -1,69 +1,69 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.TimeUtil; -import java.util.ArrayList; -import java.util.Hashtable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteEclipse extends Rite { - - private static Hashtable lastEclipseTimes = new Hashtable(); - - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RiteEclipse.StepEclipse(this, initialStage)); - } - - - private static class StepEclipse extends RitualStep { - - private final RiteEclipse rite; - private int stage; - - - public StepEclipse(RiteEclipse rite, int initialStage) { - super(false); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 30L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - long riteOfEclipseCooldown = (long)TimeUtil.secsToTicks(Config.instance().riteOfEclipseCooldownInSecs); - EntityPlayer player = ritual.getInitiatingPlayer(world); - long i; - if(riteOfEclipseCooldown > 0L && world.playerEntities.size() > 1 && RiteEclipse.lastEclipseTimes.containsKey(Integer.valueOf(world.provider.dimensionId))) { - i = ((Long)RiteEclipse.lastEclipseTimes.get(Integer.valueOf(world.provider.dimensionId))).longValue(); - if(world.getTotalWorldTime() < i + riteOfEclipseCooldown) { - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.eclipse.cooldown", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } - } - - i = world.getWorldInfo().getWorldTime(); - world.getWorldInfo().setWorldTime(i - i % 24000L + 18000L); - RiteEclipse.lastEclipseTimes.put(Integer.valueOf(world.provider.dimensionId), Long.valueOf(world.getTotalWorldTime())); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.TimeUtil; +import java.util.ArrayList; +import java.util.Hashtable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteEclipse extends Rite { + + private static Hashtable lastEclipseTimes = new Hashtable(); + + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RiteEclipse.StepEclipse(this, initialStage)); + } + + + private static class StepEclipse extends RitualStep { + + private final RiteEclipse rite; + private int stage; + + + public StepEclipse(RiteEclipse rite, int initialStage) { + super(false); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 30L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + long riteOfEclipseCooldown = (long)TimeUtil.secsToTicks(Config.instance().riteOfEclipseCooldownInSecs); + EntityPlayer player = ritual.getInitiatingPlayer(world); + long i; + if(riteOfEclipseCooldown > 0L && world.playerEntities.size() > 1 && RiteEclipse.lastEclipseTimes.containsKey(Integer.valueOf(world.provider.dimensionId))) { + i = ((Long)RiteEclipse.lastEclipseTimes.get(Integer.valueOf(world.provider.dimensionId))).longValue(); + if(world.getTotalWorldTime() < i + riteOfEclipseCooldown) { + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.eclipse.cooldown", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } + } + + i = world.getWorldInfo().getWorldTime(); + world.getWorldInfo().setWorldTime(i - i % 24000L + 18000L); + RiteEclipse.lastEclipseTimes.put(Integer.valueOf(world.provider.dimensionId), Long.valueOf(world.getTotalWorldTime())); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteExpandingEffect.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteExpandingEffect.java index 014a4de..c4180d4 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteExpandingEffect.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteExpandingEffect.java @@ -1,143 +1,143 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.entity.EntityWitchHunter; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -public abstract class RiteExpandingEffect extends Rite { - - protected final int maxRadius; - protected final int height; - protected final boolean curse; - - - public RiteExpandingEffect(int radius, int height, boolean curse) { - this.maxRadius = radius; - this.height = height; - this.curse = curse; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteExpandingEffect.StepExpansion(this, intialStage)); - } - - public abstract void doBlockAction(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, boolean var7); - - public abstract boolean doRadiusAction(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, boolean var7); - - public boolean isComplete(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, long ticks, boolean fullyExpanded, boolean enhanced) { - return fullyExpanded; - } - - private static class StepExpansion extends RitualStep { - - private final RiteExpandingEffect rite; - private int stage = 0; - private boolean activated; - - - public StepExpansion(RiteExpandingEffect rite, int initialStage) { - super(true); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(!this.activated) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } - - this.activated = true; - SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); - } - - if(world.isRemote) { - return RitualStep.Result.COMPLETED; - } else if(ticks % 5L == 0L) { - ++this.stage; - if(this.stage == 1 && this.rite.curse) { - EntityWitchHunter.blackMagicPerformed(ritual.getInitiatingPlayer(world)); - } - - int height = this.rite.height; - float maxRadius = (float)(this.rite.maxRadius + 2 * ritual.covenSize); - EntityPlayer player = ritual.getInitiatingPlayer(world); - int currentRadius = this.stage + 3; - boolean enhanced = player != null && Familiar.hasActiveCurseMasteryFamiliar(player); - return (float)currentRadius <= maxRadius && !this.applyCircle(world, posX, posZ, posY, currentRadius, height, player, enhanced)?RitualStep.Result.ABORTED:(this.stage <= 250 && !this.rite.isComplete(world, posX, posY, posZ, currentRadius, player, ticks, (float)currentRadius >= maxRadius, enhanced)?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED); - } else { - return RitualStep.Result.UPKEEP; - } - } - - protected boolean applyCircle(World world, int x0, int z0, int y0, int radius, int height, EntityPlayer player, boolean enhanced) { - if(!this.rite.doRadiusAction(world, x0, y0, z0, radius, player, enhanced)) { - return false; - } else { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawPixel(world, x + x0, z + z0, y0, height, radius, player, enhanced); - this.drawPixel(world, z + x0, x + z0, y0, height, radius, player, enhanced); - this.drawPixel(world, -x + x0, z + z0, y0, height, radius, player, enhanced); - this.drawPixel(world, -z + x0, x + z0, y0, height, radius, player, enhanced); - this.drawPixel(world, -x + x0, -z + z0, y0, height, radius, player, enhanced); - this.drawPixel(world, -z + x0, -x + z0, y0, height, radius, player, enhanced); - this.drawPixel(world, x + x0, -z + z0, y0, height, radius, player, enhanced); - this.drawPixel(world, z + x0, -x + z0, y0, height, radius, player, enhanced); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - return true; - } - } - - protected void drawPixel(World world, int x, int z, int y, int height, int currentRadius, EntityPlayer player, boolean enhanced) { - for(int i = 0; i < height; ++i) { - if(world.getBlock(x, y + i, z).getMaterial() != Material.air && world.isAirBlock(x, y + i + 1, z)) { - if(this.rite.curse) { - ParticleEffect.MOB_SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y + i + 1), 0.5D + (double)z, 1.0D, 1.0D, 16); - } else { - ParticleEffect.SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y + i + 1), 0.5D + (double)z, 1.0D, 1.0D, 16); - } - - this.rite.doBlockAction(world, x, y + i, z, currentRadius, player, enhanced); - break; - } - - if(i > 0 && world.getBlock(x, y - i, z).getMaterial() != Material.air && world.isAirBlock(x, y - i + 1, z)) { - if(this.rite.curse) { - ParticleEffect.MOB_SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y - i + 1), 0.5D + (double)z, 1.0D, 1.0D, 32); - } else { - ParticleEffect.SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y - i + 1), 0.5D + (double)z, 1.0D, 1.0D, 32); - } - - this.rite.doBlockAction(world, x, y - i, z, currentRadius, player, enhanced); - break; - } - } - - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public abstract class RiteExpandingEffect extends Rite { + + protected final int maxRadius; + protected final int height; + protected final boolean curse; + + + public RiteExpandingEffect(int radius, int height, boolean curse) { + this.maxRadius = radius; + this.height = height; + this.curse = curse; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteExpandingEffect.StepExpansion(this, intialStage)); + } + + public abstract void doBlockAction(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, boolean var7); + + public abstract boolean doRadiusAction(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, boolean var7); + + public boolean isComplete(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, long ticks, boolean fullyExpanded, boolean enhanced) { + return fullyExpanded; + } + + private static class StepExpansion extends RitualStep { + + private final RiteExpandingEffect rite; + private int stage = 0; + private boolean activated; + + + public StepExpansion(RiteExpandingEffect rite, int initialStage) { + super(true); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(!this.activated) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + + this.activated = true; + SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); + } + + if(world.isRemote) { + return RitualStep.Result.COMPLETED; + } else if(ticks % 5L == 0L) { + ++this.stage; + if(this.stage == 1 && this.rite.curse) { + EntityWitchHunter.blackMagicPerformed(ritual.getInitiatingPlayer(world)); + } + + int height = this.rite.height; + float maxRadius = (float)(this.rite.maxRadius + 2 * ritual.covenSize); + EntityPlayer player = ritual.getInitiatingPlayer(world); + int currentRadius = this.stage + 3; + boolean enhanced = player != null && Familiar.hasActiveCurseMasteryFamiliar(player); + return (float)currentRadius <= maxRadius && !this.applyCircle(world, posX, posZ, posY, currentRadius, height, player, enhanced)?RitualStep.Result.ABORTED:(this.stage <= 250 && !this.rite.isComplete(world, posX, posY, posZ, currentRadius, player, ticks, (float)currentRadius >= maxRadius, enhanced)?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED); + } else { + return RitualStep.Result.UPKEEP; + } + } + + protected boolean applyCircle(World world, int x0, int z0, int y0, int radius, int height, EntityPlayer player, boolean enhanced) { + if(!this.rite.doRadiusAction(world, x0, y0, z0, radius, player, enhanced)) { + return false; + } else { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawPixel(world, x + x0, z + z0, y0, height, radius, player, enhanced); + this.drawPixel(world, z + x0, x + z0, y0, height, radius, player, enhanced); + this.drawPixel(world, -x + x0, z + z0, y0, height, radius, player, enhanced); + this.drawPixel(world, -z + x0, x + z0, y0, height, radius, player, enhanced); + this.drawPixel(world, -x + x0, -z + z0, y0, height, radius, player, enhanced); + this.drawPixel(world, -z + x0, -x + z0, y0, height, radius, player, enhanced); + this.drawPixel(world, x + x0, -z + z0, y0, height, radius, player, enhanced); + this.drawPixel(world, z + x0, -x + z0, y0, height, radius, player, enhanced); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + return true; + } + } + + protected void drawPixel(World world, int x, int z, int y, int height, int currentRadius, EntityPlayer player, boolean enhanced) { + for(int i = 0; i < height; ++i) { + if(world.getBlock(x, y + i, z).getMaterial() != Material.air && world.isAirBlock(x, y + i + 1, z)) { + if(this.rite.curse) { + ParticleEffect.MOB_SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y + i + 1), 0.5D + (double)z, 1.0D, 1.0D, 16); + } else { + ParticleEffect.SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y + i + 1), 0.5D + (double)z, 1.0D, 1.0D, 16); + } + + this.rite.doBlockAction(world, x, y + i, z, currentRadius, player, enhanced); + break; + } + + if(i > 0 && world.getBlock(x, y - i, z).getMaterial() != Material.air && world.isAirBlock(x, y - i + 1, z)) { + if(this.rite.curse) { + ParticleEffect.MOB_SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y - i + 1), 0.5D + (double)z, 1.0D, 1.0D, 32); + } else { + ParticleEffect.SPELL.send(SoundEffect.NONE, world, 0.5D + (double)x, (double)(y - i + 1), 0.5D + (double)z, 1.0D, 1.0D, 32); + } + + this.rite.doBlockAction(world, x, y - i, z, currentRadius, player, enhanced); + break; + } + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteFertility.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteFertility.java index 78a9428..d50f8fc 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteFertility.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteFertility.java @@ -1,99 +1,99 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; -import com.emoniph.witchery.util.Dye; -import com.emoniph.witchery.util.Log; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.block.Block; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemDye; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; - -public class RiteFertility extends RiteExpandingEffect { - - public RiteFertility(int radius, int height) { - super(radius, height, false); - } - - public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) { - Block blockID = world.getBlock(posX, posY, posZ); - if((blockID != Blocks.dirt || blockID != Blocks.grass || blockID != Blocks.mycelium || blockID != Blocks.farmland || world.rand.nextInt(5) == 0) && player != null) { - ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, posX, posY, posZ, player); - } - - } - - public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { - double radiusSq = (double)(radius * radius); - double minSq = (double)Math.max(0, (radius - 1) * (radius - 1)); - Iterator villagersToZombify = world.playerEntities.iterator(); - - while(villagersToZombify.hasNext()) { - Object i$ = villagersToZombify.next(); - EntityPlayer victim = (EntityPlayer)i$; - double entityvillager = victim.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(entityvillager > minSq && entityvillager <= radiusSq) { - if(victim.isPotionActive(Potion.confusion)) { - victim.removePotionEffect(Potion.confusion.id); - } - - if(victim.isPotionActive(Potion.blindness)) { - victim.removePotionEffect(Potion.blindness.id); - } - - if(victim.isPotionActive(Potion.poison)) { - victim.removePotionEffect(Potion.poison.id); - } - - if(enhanced) { - victim.addPotionEffect(new PotionEffect(Potion.regeneration.id, 300, 1)); - victim.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 2400)); - } - } - } - - ArrayList villagersToZombify1 = new ArrayList(); - Iterator i$1 = world.loadedEntityList.iterator(); - - while(i$1.hasNext()) { - Object victim1 = i$1.next(); - if(victim1 instanceof EntityZombie) { - EntityZombie entityvillager1 = (EntityZombie)victim1; - if(entityvillager1.isVillager()) { - double distanceSq = entityvillager1.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); - if(distanceSq > minSq && distanceSq <= radiusSq) { - Log.instance().debug(String.format("Try curing zombie %f %f %f", new Object[]{Double.valueOf(distanceSq), Double.valueOf(minSq), Double.valueOf(radiusSq)})); - villagersToZombify1.add(entityvillager1); - } - } - } - } - - i$1 = villagersToZombify1.iterator(); - - while(i$1.hasNext()) { - EntityZombie victim2 = (EntityZombie)i$1.next(); - EntityVillager entityvillager2 = new EntityVillager(world); - entityvillager2.copyLocationAndAnglesFrom(victim2); - entityvillager2.onSpawnWithEgg((IEntityLivingData)null); - entityvillager2.setLookingForHome(); - if(victim2.isChild()) { - entityvillager2.setGrowingAge(-24000); - } - - world.removeEntity(victim2); - world.spawnEntityInWorld(entityvillager2); - entityvillager2.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); - world.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)entityvillager2.posX, (int)entityvillager2.posY, (int)entityvillager2.posZ, 0); - } - - return true; - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; +import com.emoniph.witchery.util.Dye; +import com.emoniph.witchery.util.Log; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.block.Block; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDye; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class RiteFertility extends RiteExpandingEffect { + + public RiteFertility(int radius, int height) { + super(radius, height, false); + } + + public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) { + Block blockID = world.getBlock(posX, posY, posZ); + if((blockID != Blocks.dirt || blockID != Blocks.grass || blockID != Blocks.mycelium || blockID != Blocks.farmland || world.rand.nextInt(5) == 0) && player != null) { + ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, posX, posY, posZ, player); + } + + } + + public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { + double radiusSq = (double)(radius * radius); + double minSq = (double)Math.max(0, (radius - 1) * (radius - 1)); + Iterator villagersToZombify = world.playerEntities.iterator(); + + while(villagersToZombify.hasNext()) { + Object i$ = villagersToZombify.next(); + EntityPlayer victim = (EntityPlayer)i$; + double entityvillager = victim.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(entityvillager > minSq && entityvillager <= radiusSq) { + if(victim.isPotionActive(Potion.confusion)) { + victim.removePotionEffect(Potion.confusion.id); + } + + if(victim.isPotionActive(Potion.blindness)) { + victim.removePotionEffect(Potion.blindness.id); + } + + if(victim.isPotionActive(Potion.poison)) { + victim.removePotionEffect(Potion.poison.id); + } + + if(enhanced) { + victim.addPotionEffect(new PotionEffect(Potion.regeneration.id, 300, 1)); + victim.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 2400)); + } + } + } + + ArrayList villagersToZombify1 = new ArrayList(); + Iterator i$1 = world.loadedEntityList.iterator(); + + while(i$1.hasNext()) { + Object victim1 = i$1.next(); + if(victim1 instanceof EntityZombie) { + EntityZombie entityvillager1 = (EntityZombie)victim1; + if(entityvillager1.isVillager()) { + double distanceSq = entityvillager1.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ); + if(distanceSq > minSq && distanceSq <= radiusSq) { + Log.instance().debug(String.format("Try curing zombie %f %f %f", new Object[]{Double.valueOf(distanceSq), Double.valueOf(minSq), Double.valueOf(radiusSq)})); + villagersToZombify1.add(entityvillager1); + } + } + } + } + + i$1 = villagersToZombify1.iterator(); + + while(i$1.hasNext()) { + EntityZombie victim2 = (EntityZombie)i$1.next(); + EntityVillager entityvillager2 = new EntityVillager(world); + entityvillager2.copyLocationAndAnglesFrom(victim2); + entityvillager2.onSpawnWithEgg((IEntityLivingData)null); + entityvillager2.setLookingForHome(); + if(victim2.isChild()) { + entityvillager2.setGrowingAge(-24000); + } + + world.removeEntity(victim2); + world.spawnEntityInWorld(entityvillager2); + entityvillager2.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); + world.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)entityvillager2.posX, (int)entityvillager2.posY, (int)entityvillager2.posZ, 0); + } + + return true; + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteFidelio.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteFidelio.java new file mode 100644 index 0000000..143ebf3 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteFidelio.java @@ -0,0 +1,72 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteFidelio extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteFidelio(this, initialStage)); + } + + private static class StepRiteFidelio extends RitualStep { + private final RiteFidelio rite; + + public StepRiteFidelio(RiteFidelio rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityLivingBase subject = null; + Iterator i$ = circleType.sacrificedItems.iterator(); + while (i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if (item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + subject = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + break; + } + } + if (subject == null) { + subject = circleType.getInitiatingPlayer(world); + } + if (subject == null) { + return RitualStep.Result.ABORTED_REFUND; + } + + // The Fidelius charm hides the secret-keeper: cleanse and conceal. + int dur = TimeUtil.minsToTicks(20); + subject.clearActivePotions(); + subject.addPotionEffect(new PotionEffect(Potion.invisibility.id, dur, 0)); + subject.addPotionEffect(new PotionEffect(Potion.nightVision.id, dur, 0)); + subject.addPotionEffect(new PotionEffect(Potion.resistance.id, dur, 0)); + if (subject instanceof EntityPlayer) { + ChatUtil.sendTranslated(EnumChatFormatting.AQUA, (EntityPlayer)subject, "witchery.rite.fidelio.hidden", new Object[0]); + } + ParticleEffect.PORTAL.send(SoundEffect.MOB_ENDERMEN_PORTAL, subject, 1.0D, 2.0D, 24); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 2.0D, 2.0D, 24); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteForestation.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteForestation.java index b58a9ca..b3595d0 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteForestation.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteForestation.java @@ -1,141 +1,141 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.Dye; -import com.emoniph.witchery.util.MutableBlock; -import com.mojang.authlib.GameProfile; -import java.util.ArrayList; -import java.util.UUID; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemDye; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.util.FakePlayer; - -public class RiteForestation extends Rite { - - private final int radius; - private final int height; - private final int duration; - private final Block block; - private final int metadata; - - - public RiteForestation(int radius, int height, int duration, Block block, int protoMeta) { - this.radius = radius; - this.height = height; - this.duration = duration; - this.block = block; - this.metadata = protoMeta; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteForestation.StepForestation(this, intialStage)); - } - - private static class StepForestation extends RitualStep { - - private final RiteForestation rite; - private int stage = 0; - private EntityPlayer fakePlayer = null; - - - public StepForestation(RiteForestation rite, int initialStage) { - super(true); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public boolean isAirOrReplaceableBlock(World world, int x, int y, int z) { - Block blockID = world.getBlock(x, y, z); - if(blockID == Blocks.air) { - return true; - } else { - Material block = blockID.getMaterial(); - return block == null?false:(block.isLiquid()?false:block.isReplaceable()); - } - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else if(world.isRemote) { - return RitualStep.Result.COMPLETED; - } else if(++this.stage < this.rite.duration + ritual.covenSize * 5) { - int modradius = this.rite.radius + ritual.covenSize * 2; - int modradiussq = (modradius + 1) * (modradius + 1); - --posY; - int x = posX - modradius + world.rand.nextInt(modradius * 2); - int z = posZ - modradius + world.rand.nextInt(modradius * 2); - int y = -1; - if(Coord.distanceSq((double)x, 1.0D, (double)z, (double)posX, 1.0D, (double)posZ) > (double)modradiussq) { - x = posX - modradius + world.rand.nextInt(modradius * 2); - z = posZ - modradius + world.rand.nextInt(modradius * 2); - if(Coord.distanceSq((double)x, 1.0D, (double)z, (double)posX, 1.0D, (double)posZ) > (double)modradiussq) { - return RitualStep.Result.UPKEEP; - } - } - - world.playAuxSFX(2005, posX, posY + 2, posZ, 0); - Material material = world.getBlock(x, posY, z).getMaterial(); - if(material != null && material.isSolid() && world.isAirBlock(x, posY + 1, z)) { - y = posY; - } else { - for(int h = 1; h < this.rite.height; ++h) { - material = world.getBlock(x, posY + h, z).getMaterial(); - if(material != null && material.isSolid() && this.isAirOrReplaceableBlock(world, x, posY + h + 1, z)) { - y = posY + h; - break; - } - - material = world.getBlock(x, posY - h, z).getMaterial(); - if(material != null && material.isSolid() && this.isAirOrReplaceableBlock(world, x, posY - h + 1, z)) { - y = posY - h; - break; - } - } - } - - if(y != -1) { - world.playAuxSFX(2005, x, y + 1, z, 0); - this.drawPixel(world, x, z, y, false); - } - - return RitualStep.Result.UPKEEP; - } else { - return RitualStep.Result.COMPLETED; - } - } - - protected void drawPixel(World world, int x, int z, int y, boolean lower) { - Block blockID = world.getBlock(x, y, z); - boolean wasGrass = blockID == Blocks.grass; - Material materialAbove = world.getBlock(x, y + 1, z).getMaterial(); - if(materialAbove != null && !materialAbove.isSolid()) { - (new MutableBlock(this.rite.block, this.rite.metadata)).mutate(world, x, y + 1, z, false); - int count = 0; - if((this.fakePlayer == null || this.fakePlayer.worldObj != world) && world instanceof WorldServer) { - this.fakePlayer = new FakePlayer((WorldServer)world, new GameProfile(UUID.randomUUID(), "[Minecraft]")); - } - - ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); - - for(Block saplingBlockID = world.getBlock(x, y + 1, z); (saplingBlockID == Blocks.sapling || saplingBlockID == Witchery.Blocks.SAPLING) && count++ < 10; saplingBlockID = world.getBlock(x, y + 1, z)) { - ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); - } - } - - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.Dye; +import com.emoniph.witchery.util.MutableBlock; +import com.mojang.authlib.GameProfile; +import java.util.ArrayList; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDye; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.util.FakePlayer; + +public class RiteForestation extends Rite { + + private final int radius; + private final int height; + private final int duration; + private final Block block; + private final int metadata; + + + public RiteForestation(int radius, int height, int duration, Block block, int protoMeta) { + this.radius = radius; + this.height = height; + this.duration = duration; + this.block = block; + this.metadata = protoMeta; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteForestation.StepForestation(this, intialStage)); + } + + private static class StepForestation extends RitualStep { + + private final RiteForestation rite; + private int stage = 0; + private EntityPlayer fakePlayer = null; + + + public StepForestation(RiteForestation rite, int initialStage) { + super(true); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public boolean isAirOrReplaceableBlock(World world, int x, int y, int z) { + Block blockID = world.getBlock(x, y, z); + if(blockID == Blocks.air) { + return true; + } else { + Material block = blockID.getMaterial(); + return block == null?false:(block.isLiquid()?false:block.isReplaceable()); + } + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else if(world.isRemote) { + return RitualStep.Result.COMPLETED; + } else if(++this.stage < this.rite.duration + ritual.covenSize * 5) { + int modradius = this.rite.radius + ritual.covenSize * 2; + int modradiussq = (modradius + 1) * (modradius + 1); + --posY; + int x = posX - modradius + world.rand.nextInt(modradius * 2); + int z = posZ - modradius + world.rand.nextInt(modradius * 2); + int y = -1; + if(Coord.distanceSq((double)x, 1.0D, (double)z, (double)posX, 1.0D, (double)posZ) > (double)modradiussq) { + x = posX - modradius + world.rand.nextInt(modradius * 2); + z = posZ - modradius + world.rand.nextInt(modradius * 2); + if(Coord.distanceSq((double)x, 1.0D, (double)z, (double)posX, 1.0D, (double)posZ) > (double)modradiussq) { + return RitualStep.Result.UPKEEP; + } + } + + world.playAuxSFX(2005, posX, posY + 2, posZ, 0); + Material material = world.getBlock(x, posY, z).getMaterial(); + if(material != null && material.isSolid() && world.isAirBlock(x, posY + 1, z)) { + y = posY; + } else { + for(int h = 1; h < this.rite.height; ++h) { + material = world.getBlock(x, posY + h, z).getMaterial(); + if(material != null && material.isSolid() && this.isAirOrReplaceableBlock(world, x, posY + h + 1, z)) { + y = posY + h; + break; + } + + material = world.getBlock(x, posY - h, z).getMaterial(); + if(material != null && material.isSolid() && this.isAirOrReplaceableBlock(world, x, posY - h + 1, z)) { + y = posY - h; + break; + } + } + } + + if(y != -1) { + world.playAuxSFX(2005, x, y + 1, z, 0); + this.drawPixel(world, x, z, y, false); + } + + return RitualStep.Result.UPKEEP; + } else { + return RitualStep.Result.COMPLETED; + } + } + + protected void drawPixel(World world, int x, int z, int y, boolean lower) { + Block blockID = world.getBlock(x, y, z); + boolean wasGrass = blockID == Blocks.grass; + Material materialAbove = world.getBlock(x, y + 1, z).getMaterial(); + if(materialAbove != null && !materialAbove.isSolid()) { + (new MutableBlock(this.rite.block, this.rite.metadata)).mutate(world, x, y + 1, z, false); + int count = 0; + if((this.fakePlayer == null || this.fakePlayer.worldObj != world) && world instanceof WorldServer) { + this.fakePlayer = new FakePlayer((WorldServer)world, new GameProfile(UUID.randomUUID(), "[Minecraft]")); + } + + ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); + + for(Block saplingBlockID = world.getBlock(x, y + 1, z); (saplingBlockID == Blocks.sapling || saplingBlockID == Witchery.Blocks.SAPLING) && count++ < 10; saplingBlockID = world.getBlock(x, y + 1, z)) { + ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); + } + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteGlyphicTransformation.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteGlyphicTransformation.java index 2009025..cd6ae48 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteGlyphicTransformation.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteGlyphicTransformation.java @@ -1,135 +1,135 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteGlyphicTransformation extends Rite { - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteGlyphicTransformation.StepGlyphicTransformation(this)); - } - - private static class StepGlyphicTransformation extends RitualStep { - - private final RiteGlyphicTransformation rite; - - - public StepGlyphicTransformation(RiteGlyphicTransformation rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 30L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - double RADIUS = 4.0D; - List items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox((double)posX - 4.0D, (double)(posY - 2), (double)posZ - 4.0D, (double)posX + 4.0D, (double)(posY + 2), (double)posZ + 4.0D)); - int whiteChalk = 0; - int purpleChalk = 0; - int redChalk = 0; - Iterator blockID = items.iterator(); - - boolean c; - while(blockID.hasNext()) { - Object size = blockID.next(); - EntityItem a = (EntityItem)size; - ItemStack b = a.getEntityItem(); - if(redChalk == 0 && purpleChalk == 0 && b.isItemEqual(new ItemStack(Witchery.Items.CHALK_RITUAL, 1, 0))) { - c = whiteChalk == 0; - whiteChalk += b.stackSize; - if(c) { - --b.stackSize; - if(b.stackSize <= 0) { - world.removeEntity(a); - } - } - } else if(redChalk == 0 && whiteChalk == 0 && b.isItemEqual(new ItemStack(Witchery.Items.CHALK_OTHERWHERE, 1, 0))) { - c = purpleChalk == 0; - purpleChalk += b.stackSize; - if(c) { - --b.stackSize; - if(b.stackSize <= 0) { - world.removeEntity(a); - } - } - } else { - if(purpleChalk != 0 || whiteChalk != 0 || !b.isItemEqual(new ItemStack(Witchery.Items.CHALK_INFERNAL, 1, 0))) { - continue; - } - - c = redChalk == 0; - redChalk += b.stackSize; - if(c) { - --b.stackSize; - if(b.stackSize <= 0) { - world.removeEntity(a); - } - } - } - - ParticleEffect.SMOKE.send(SoundEffect.RANDOM_POP, a, 1.0D, 1.0D, 16); - } - - Block var31 = Blocks.air; - int var30 = 0; - if(whiteChalk == 0 && redChalk == 0 && purpleChalk == 0) { - return RitualStep.Result.ABORTED_REFUND; - } - - if(redChalk > 0) { - var31 = Witchery.Blocks.GLYPH_INFERNAL; - var30 = Math.min(redChalk, 3); - } else if(purpleChalk > 0) { - var31 = Witchery.Blocks.GLYPH_OTHERWHERE; - var30 = Math.min(purpleChalk, 3); - } else if(whiteChalk > 0) { - var31 = Witchery.Blocks.GLYPH_RITUAL; - var30 = Math.min(whiteChalk, 3); - } - - boolean var32 = true; - boolean var33 = true; - c = true; - boolean _ = false; - int[][] PATTERN = new int[][]{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0}, {0, 0, 0, 3, 0, 0, 2, 2, 2, 2, 2, 0, 0, 3, 0, 0, 0}, {0, 0, 3, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0}, {0, 3, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 3, 0}, {0, 3, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 1, 0, 0, 4, 0, 0, 1, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 3, 0}, {0, 3, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 3, 0}, {0, 0, 3, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0}, {0, 0, 0, 3, 0, 0, 2, 2, 2, 2, 2, 0, 0, 3, 0, 0, 0}, {0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; - int offsetZ = (PATTERN.length - 1) / 2; - - for(int z = 0; z < PATTERN.length - 1; ++z) { - int worldZ = posZ - offsetZ + z; - int offsetX = (PATTERN[z].length - 1) / 2; - - for(int x = 0; x < PATTERN[z].length; ++x) { - int worldX = posX - offsetX + x; - int item = PATTERN[PATTERN.length - 1 - z][x]; - if(item == var30) { - Block currentBlockID = world.getBlock(worldX, posY, worldZ); - if((currentBlockID == Witchery.Blocks.GLYPH_INFERNAL || currentBlockID == Witchery.Blocks.GLYPH_OTHERWHERE || currentBlockID == Witchery.Blocks.GLYPH_RITUAL) && currentBlockID != var31) { - int meta = world.getBlockMetadata(worldX, posY, worldZ); - world.setBlock(worldX, posY, worldZ, var31, meta, 3); - ParticleEffect.SMOKE.send(SoundEffect.NONE, world, (double)worldX, (double)(posY + 1), (double)worldZ, 0.5D, 1.0D, 16); - } - } - } - } - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteGlyphicTransformation extends Rite { + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteGlyphicTransformation.StepGlyphicTransformation(this)); + } + + private static class StepGlyphicTransformation extends RitualStep { + + private final RiteGlyphicTransformation rite; + + + public StepGlyphicTransformation(RiteGlyphicTransformation rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 30L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + double RADIUS = 4.0D; + List items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox((double)posX - 4.0D, (double)(posY - 2), (double)posZ - 4.0D, (double)posX + 4.0D, (double)(posY + 2), (double)posZ + 4.0D)); + int whiteChalk = 0; + int purpleChalk = 0; + int redChalk = 0; + Iterator blockID = items.iterator(); + + boolean c; + while(blockID.hasNext()) { + Object size = blockID.next(); + EntityItem a = (EntityItem)size; + ItemStack b = a.getEntityItem(); + if(redChalk == 0 && purpleChalk == 0 && b.isItemEqual(new ItemStack(Witchery.Items.CHALK_RITUAL, 1, 0))) { + c = whiteChalk == 0; + whiteChalk += b.stackSize; + if(c) { + --b.stackSize; + if(b.stackSize <= 0) { + world.removeEntity(a); + } + } + } else if(redChalk == 0 && whiteChalk == 0 && b.isItemEqual(new ItemStack(Witchery.Items.CHALK_OTHERWHERE, 1, 0))) { + c = purpleChalk == 0; + purpleChalk += b.stackSize; + if(c) { + --b.stackSize; + if(b.stackSize <= 0) { + world.removeEntity(a); + } + } + } else { + if(purpleChalk != 0 || whiteChalk != 0 || !b.isItemEqual(new ItemStack(Witchery.Items.CHALK_INFERNAL, 1, 0))) { + continue; + } + + c = redChalk == 0; + redChalk += b.stackSize; + if(c) { + --b.stackSize; + if(b.stackSize <= 0) { + world.removeEntity(a); + } + } + } + + ParticleEffect.SMOKE.send(SoundEffect.RANDOM_POP, a, 1.0D, 1.0D, 16); + } + + Block var31 = Blocks.air; + int var30 = 0; + if(whiteChalk == 0 && redChalk == 0 && purpleChalk == 0) { + return RitualStep.Result.ABORTED_REFUND; + } + + if(redChalk > 0) { + var31 = Witchery.Blocks.GLYPH_INFERNAL; + var30 = Math.min(redChalk, 3); + } else if(purpleChalk > 0) { + var31 = Witchery.Blocks.GLYPH_OTHERWHERE; + var30 = Math.min(purpleChalk, 3); + } else if(whiteChalk > 0) { + var31 = Witchery.Blocks.GLYPH_RITUAL; + var30 = Math.min(whiteChalk, 3); + } + + boolean var32 = true; + boolean var33 = true; + c = true; + boolean _ = false; + int[][] PATTERN = new int[][]{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0}, {0, 0, 0, 3, 0, 0, 2, 2, 2, 2, 2, 0, 0, 3, 0, 0, 0}, {0, 0, 3, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0}, {0, 3, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 3, 0}, {0, 3, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 1, 0, 0, 4, 0, 0, 1, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0}, {0, 3, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 3, 0}, {0, 3, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 3, 0}, {0, 0, 3, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0}, {0, 0, 0, 3, 0, 0, 2, 2, 2, 2, 2, 0, 0, 3, 0, 0, 0}, {0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; + int offsetZ = (PATTERN.length - 1) / 2; + + for(int z = 0; z < PATTERN.length - 1; ++z) { + int worldZ = posZ - offsetZ + z; + int offsetX = (PATTERN[z].length - 1) / 2; + + for(int x = 0; x < PATTERN[z].length; ++x) { + int worldX = posX - offsetX + x; + int item = PATTERN[PATTERN.length - 1 - z][x]; + if(item == var30) { + Block currentBlockID = world.getBlock(worldX, posY, worldZ); + if((currentBlockID == Witchery.Blocks.GLYPH_INFERNAL || currentBlockID == Witchery.Blocks.GLYPH_OTHERWHERE || currentBlockID == Witchery.Blocks.GLYPH_RITUAL) && currentBlockID != var31) { + int meta = world.getBlockMetadata(worldX, posY, worldZ); + world.setBlock(worldX, posY, worldZ, var31, meta, 3); + ParticleEffect.SMOKE.send(SoundEffect.NONE, world, (double)worldX, (double)(posY + 1), (double)worldZ, 0.5D, 1.0D, 16); + } + } + } + } + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteHellOnEarth.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteHellOnEarth.java index 5fdbab8..eb83b09 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteHellOnEarth.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteHellOnEarth.java @@ -1,116 +1,116 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.common.IPowerSource; -import com.emoniph.witchery.common.PowerSources; -import com.emoniph.witchery.entity.EntityDemon; -import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.monster.EntityBlaze; -import net.minecraft.entity.monster.EntityGhast; -import net.minecraft.entity.monster.EntityMagmaCube; -import net.minecraft.entity.monster.EntityPigZombie; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; - -public class RiteHellOnEarth extends RiteExpandingEffect { - - private final float upkeepCost; - static final int POWER_SOURCE_RADIUS = 16; - - - public RiteHellOnEarth(int radius, int height, float upkeepCost) { - super(radius, height, true); - this.upkeepCost = upkeepCost; - } - - public boolean isComplete(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, long ticks, boolean fullyExpanded, boolean enhanced) { - if(fullyExpanded && ticks % 40L == 0L) { - IPowerSource powerSource = this.findNewPowerSource(world, posX, posY, posZ); - if(powerSource == null) { - return true; - } - - if(!powerSource.consumePower(this.upkeepCost)) { - return true; - } - - double roll = world.rand.nextDouble(); - Object entity = null; - if(roll < 0.02D) { - entity = new EntityDemon(world); - } else if(roll < 0.1D) { - entity = new EntityGhast(world); - } else if(roll < 0.4D) { - entity = new EntityBlaze(world); - } else if(roll < 0.6D) { - entity = new EntityMagmaCube(world); - } else { - entity = new EntityPigZombie(world); - } - - if(entity != null) { - ((EntityLiving)entity).onSpawnWithEgg((IEntityLivingData)null); - ((EntityLiving)entity).setLocationAndAngles(0.5D + (double)posX, 2.0D + (double)posY, 0.5D + (double)posZ, 0.0F, 0.0F); - world.spawnEntityInWorld((Entity)entity); - ParticleEffect.LARGE_EXPLODE.send(SoundEffect.MOB_BLAZE_DEATH, world, 0.5D + (double)posX, 2.0D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } - } - - return false; - } - - public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { - return true; - } - - public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) { - if(!world.isRemote) { - Block blockID = world.getBlock(posX, posY, posZ); - Block blockBelowID = world.getBlock(posX, posY - 1, posZ); - if(blockID == Blocks.tallgrass) { - if(Config.instance().allowHellOnEarthFires && enhanced) { - world.setBlock(posX, posY, posZ, Blocks.fire); - } - - this.blightGround(world, posX, posY - 1, posZ, blockBelowID, currentRadius); - } else if(blockID != Blocks.red_flower && blockID != Blocks.yellow_flower && blockID != Blocks.carrots && blockID != Blocks.wheat && blockID != Blocks.potatoes && blockID != Blocks.pumpkin_stem && blockID != Blocks.melon_stem && blockID != Blocks.melon_block && blockID != Blocks.pumpkin) { - if(blockID.getMaterial().isSolid()) { - this.blightGround(world, posX, posY, posZ, blockID, currentRadius); - } else if(blockBelowID.getMaterial().isSolid()) { - this.blightGround(world, posX, posY - 1, posZ, blockBelowID, currentRadius); - } - } else { - if(Config.instance().allowHellOnEarthFires && enhanced) { - world.setBlock(posX, posY, posZ, Blocks.fire); - } - - this.blightGround(world, posX, posY - 1, posZ, blockBelowID, currentRadius); - } - } - - } - - public void blightGround(World world, int posX, int posY, int posZ, Block blockBelowID, int currentRadius) { - if(blockBelowID == Blocks.dirt || blockBelowID == Blocks.grass || blockBelowID == Blocks.mycelium || blockBelowID == Blocks.farmland || blockBelowID == Blocks.sand) { - int rand = world.rand.nextInt(currentRadius < super.maxRadius / 3?2:(currentRadius < super.maxRadius / 2?4:6)); - if(rand == 0) { - world.setBlock(posX, posY, posZ, Blocks.netherrack); - } - } - - } - - private IPowerSource findNewPowerSource(World world, int posX, int posY, int posZ) { - ArrayList sources = PowerSources.instance() != null?PowerSources.instance().get(world, new Coord(posX, posY, posZ), 16):null; - return sources != null && sources.size() > 0?((PowerSources.RelativePowerSource)sources.get(0)).source():null; - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.common.IPowerSource; +import com.emoniph.witchery.common.PowerSources; +import com.emoniph.witchery.entity.EntityDemon; +import com.emoniph.witchery.ritual.rites.RiteExpandingEffect; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class RiteHellOnEarth extends RiteExpandingEffect { + + private final float upkeepCost; + static final int POWER_SOURCE_RADIUS = 16; + + + public RiteHellOnEarth(int radius, int height, float upkeepCost) { + super(radius, height, true); + this.upkeepCost = upkeepCost; + } + + public boolean isComplete(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, long ticks, boolean fullyExpanded, boolean enhanced) { + if(fullyExpanded && ticks % 40L == 0L) { + IPowerSource powerSource = this.findNewPowerSource(world, posX, posY, posZ); + if(powerSource == null) { + return true; + } + + if(!powerSource.consumePower(this.upkeepCost)) { + return true; + } + + double roll = world.rand.nextDouble(); + Object entity = null; + if(roll < 0.02D) { + entity = new EntityDemon(world); + } else if(roll < 0.1D) { + entity = new EntityGhast(world); + } else if(roll < 0.4D) { + entity = new EntityBlaze(world); + } else if(roll < 0.6D) { + entity = new EntityMagmaCube(world); + } else { + entity = new EntityPigZombie(world); + } + + if(entity != null) { + ((EntityLiving)entity).onSpawnWithEgg((IEntityLivingData)null); + ((EntityLiving)entity).setLocationAndAngles(0.5D + (double)posX, 2.0D + (double)posY, 0.5D + (double)posZ, 0.0F, 0.0F); + world.spawnEntityInWorld((Entity)entity); + ParticleEffect.LARGE_EXPLODE.send(SoundEffect.MOB_BLAZE_DEATH, world, 0.5D + (double)posX, 2.0D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } + } + + return false; + } + + public boolean doRadiusAction(World world, int posX, int posY, int posZ, int radius, EntityPlayer player, boolean enhanced) { + return true; + } + + public void doBlockAction(World world, int posX, int posY, int posZ, int currentRadius, EntityPlayer player, boolean enhanced) { + if(!world.isRemote) { + Block blockID = world.getBlock(posX, posY, posZ); + Block blockBelowID = world.getBlock(posX, posY - 1, posZ); + if(blockID == Blocks.tallgrass) { + if(Config.instance().allowHellOnEarthFires && enhanced) { + world.setBlock(posX, posY, posZ, Blocks.fire); + } + + this.blightGround(world, posX, posY - 1, posZ, blockBelowID, currentRadius); + } else if(blockID != Blocks.red_flower && blockID != Blocks.yellow_flower && blockID != Blocks.carrots && blockID != Blocks.wheat && blockID != Blocks.potatoes && blockID != Blocks.pumpkin_stem && blockID != Blocks.melon_stem && blockID != Blocks.melon_block && blockID != Blocks.pumpkin) { + if(blockID.getMaterial().isSolid()) { + this.blightGround(world, posX, posY, posZ, blockID, currentRadius); + } else if(blockBelowID.getMaterial().isSolid()) { + this.blightGround(world, posX, posY - 1, posZ, blockBelowID, currentRadius); + } + } else { + if(Config.instance().allowHellOnEarthFires && enhanced) { + world.setBlock(posX, posY, posZ, Blocks.fire); + } + + this.blightGround(world, posX, posY - 1, posZ, blockBelowID, currentRadius); + } + } + + } + + public void blightGround(World world, int posX, int posY, int posZ, Block blockBelowID, int currentRadius) { + if(blockBelowID == Blocks.dirt || blockBelowID == Blocks.grass || blockBelowID == Blocks.mycelium || blockBelowID == Blocks.farmland || blockBelowID == Blocks.sand) { + int rand = world.rand.nextInt(currentRadius < super.maxRadius / 3?2:(currentRadius < super.maxRadius / 2?4:6)); + if(rand == 0) { + world.setBlock(posX, posY, posZ, Blocks.netherrack); + } + } + + } + + private IPowerSource findNewPowerSource(World world, int posX, int posY, int posZ) { + ArrayList sources = PowerSources.instance() != null?PowerSources.instance().get(world, new Coord(posX, posY, posZ), 16):null; + return sources != null && sources.size() > 0?((PowerSources.RelativePowerSource)sources.get(0)).source():null; + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteHorrocrux.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteHorrocrux.java new file mode 100644 index 0000000..e8f5de6 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteHorrocrux.java @@ -0,0 +1,59 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteHorrocrux extends Rite { + + public static final String NBT_KEY = "WITCHorrocrux"; + + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteHorrocrux(this, initialStage)); + } + + private static class StepRiteHorrocrux extends RitualStep { + private final RiteHorrocrux rite; + + public StepRiteHorrocrux(RiteHorrocrux rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityPlayer initiator = circleType.getInitiatingPlayer(world); + if (initiator == null) { + return RitualStep.Result.ABORTED_REFUND; + } + NBTTagCompound nbt = Infusion.getNBT(initiator); + if (nbt.getBoolean(NBT_KEY)) { + // A soul can only be split once at a time. + ChatUtil.sendTranslated(EnumChatFormatting.RED, initiator, "witchery.rite.horrocrux.exists", new Object[0]); + return RitualStep.Result.ABORTED_REFUND; + } + EntityWitchHunter.blackMagicPerformed(initiator); + nbt.setBoolean(NBT_KEY, true); + Infusion.syncPlayer(world, initiator); + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, initiator, "witchery.rite.horrocrux.created", new Object[0]); + ParticleEffect.MOB_SPELL.send(SoundEffect.MOB_WITHER_SPAWN, initiator, 1.0D, 2.0D, 32); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusePlayers.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusePlayers.java index c4afc16..fc32c3e 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusePlayers.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusePlayers.java @@ -1,71 +1,71 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; - -public class RiteInfusePlayers extends Rite { - - private final Infusion infusion; - private final int charges; - private final int radius; - - - public RiteInfusePlayers(Infusion infusion, int charges, int radius) { - this.infusion = infusion; - this.charges = charges; - this.radius = radius; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteInfusePlayers.StepInfusePlayers(this)); - } - - private static class StepInfusePlayers extends RitualStep { - - private final RiteInfusePlayers rite; - - - public StepInfusePlayers(RiteInfusePlayers rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int r = this.rite.radius; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); - Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityPlayer player = (EntityPlayer)obj; - if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r) { - player.attackEntityFrom(DamageSource.magic, 100.0F); - if(player.getHealth() > 0.1F) { - this.rite.infusion.infuse(player, this.rite.charges); - } - } - } - - ParticleEffect.HUGE_EXPLOSION.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class RiteInfusePlayers extends Rite { + + private final Infusion infusion; + private final int charges; + private final int radius; + + + public RiteInfusePlayers(Infusion infusion, int charges, int radius) { + this.infusion = infusion; + this.charges = charges; + this.radius = radius; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteInfusePlayers.StepInfusePlayers(this)); + } + + private static class StepInfusePlayers extends RitualStep { + + private final RiteInfusePlayers rite; + + + public StepInfusePlayers(RiteInfusePlayers rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int r = this.rite.radius; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); + Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityPlayer player = (EntityPlayer)obj; + if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r) { + player.attackEntityFrom(DamageSource.magic, 100.0F); + if(player.getHealth() > 0.1F) { + this.rite.infusion.infuse(player, this.rite.charges); + } + } + } + + ParticleEffect.HUGE_EXPLOSION.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusionRecharge.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusionRecharge.java index 957f11b..214aac2 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusionRecharge.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteInfusionRecharge.java @@ -1,120 +1,120 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockAltar; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.common.IPowerSource; -import com.emoniph.witchery.common.PowerSources; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteInfusionRecharge extends Rite { - - private final float upkeepPowerCost; - private final int charges; - private final int radius; - private final int ticksToLive; - - - public RiteInfusionRecharge(int charges, int radius, float upkeepPowerCost, int ticksToLive) { - this.charges = charges; - this.radius = radius; - this.upkeepPowerCost = upkeepPowerCost; - this.ticksToLive = ticksToLive; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteInfusionRecharge.StepInfusePlayers(this, intialStage)); - } - - private static class StepInfusePlayers extends RitualStep { - - private final RiteInfusionRecharge rite; - private boolean activated = false; - protected int ticksSoFar; - Coord powerSourceCoord; - static final int POWER_SOURCE_RADIUS = 16; - - - public StepInfusePlayers(RiteInfusionRecharge rite, int ticksSoFar) { - super(false); - this.rite = rite; - this.ticksSoFar = ticksSoFar; - } - - public int getCurrentStage() { - return this.ticksSoFar; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - if(this.rite.upkeepPowerCost > 0.0F) { - IPowerSource r = this.getPowerSource(world, posX, posY, posZ); - if(r == null) { - return RitualStep.Result.ABORTED; - } - - this.powerSourceCoord = r.getLocation(); - if(!r.consumePower(this.rite.upkeepPowerCost)) { - return RitualStep.Result.ABORTED; - } - } - - if(this.rite.ticksToLive > 0 && ticks % 20L == 0L && ++this.ticksSoFar >= this.rite.ticksToLive) { - return RitualStep.Result.COMPLETED; - } - - int var15 = this.rite.radius; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - var15), (double)posY, (double)(posZ - var15), (double)(posX + var15), (double)(posY + 1), (double)(posZ + var15)); - Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityPlayer player = (EntityPlayer)obj; - if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)var15) { - int currentEnergy = Infusion.getCurrentEnergy(player); - int maxEnergy = Infusion.getMaxEnergy(player); - if(currentEnergy < maxEnergy) { - Infusion.setCurrentEnergy(player, Math.min(currentEnergy + this.rite.charges, maxEnergy)); - ParticleEffect.INSTANT_SPELL.send(SoundEffect.NOTE_PLING, player, 1.0D, 2.0D, 8); - } - } - } - } - - return RitualStep.Result.UPKEEP; - } - } - - IPowerSource getPowerSource(World world, int posX, int posY, int posZ) { - if(this.powerSourceCoord != null && world.rand.nextInt(5) != 0) { - TileEntity tileEntity = this.powerSourceCoord.getBlockTileEntity(world); - if(!(tileEntity instanceof BlockAltar.TileEntityAltar)) { - return this.findNewPowerSource(world, posX, posY, posZ); - } else { - BlockAltar.TileEntityAltar altarTileEntity = (BlockAltar.TileEntityAltar)tileEntity; - return (IPowerSource)(!altarTileEntity.isValid()?this.findNewPowerSource(world, posX, posY, posZ):altarTileEntity); - } - } else { - return this.findNewPowerSource(world, posX, posY, posZ); - } - } - - private IPowerSource findNewPowerSource(World world, int posX, int posY, int posZ) { - ArrayList sources = PowerSources.instance() != null?PowerSources.instance().get(world, new Coord(posX, posY, posZ), 16):null; - return sources != null && sources.size() > 0?((PowerSources.RelativePowerSource)sources.get(0)).source():null; - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockAltar; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.common.IPowerSource; +import com.emoniph.witchery.common.PowerSources; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteInfusionRecharge extends Rite { + + private final float upkeepPowerCost; + private final int charges; + private final int radius; + private final int ticksToLive; + + + public RiteInfusionRecharge(int charges, int radius, float upkeepPowerCost, int ticksToLive) { + this.charges = charges; + this.radius = radius; + this.upkeepPowerCost = upkeepPowerCost; + this.ticksToLive = ticksToLive; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteInfusionRecharge.StepInfusePlayers(this, intialStage)); + } + + private static class StepInfusePlayers extends RitualStep { + + private final RiteInfusionRecharge rite; + private boolean activated = false; + protected int ticksSoFar; + Coord powerSourceCoord; + static final int POWER_SOURCE_RADIUS = 16; + + + public StepInfusePlayers(RiteInfusionRecharge rite, int ticksSoFar) { + super(false); + this.rite = rite; + this.ticksSoFar = ticksSoFar; + } + + public int getCurrentStage() { + return this.ticksSoFar; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + if(this.rite.upkeepPowerCost > 0.0F) { + IPowerSource r = this.getPowerSource(world, posX, posY, posZ); + if(r == null) { + return RitualStep.Result.ABORTED; + } + + this.powerSourceCoord = r.getLocation(); + if(!r.consumePower(this.rite.upkeepPowerCost)) { + return RitualStep.Result.ABORTED; + } + } + + if(this.rite.ticksToLive > 0 && ticks % 20L == 0L && ++this.ticksSoFar >= this.rite.ticksToLive) { + return RitualStep.Result.COMPLETED; + } + + int var15 = this.rite.radius; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - var15), (double)posY, (double)(posZ - var15), (double)(posX + var15), (double)(posY + 1), (double)(posZ + var15)); + Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityPlayer player = (EntityPlayer)obj; + if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)var15) { + int currentEnergy = Infusion.getCurrentEnergy(player); + int maxEnergy = Infusion.getMaxEnergy(player); + if(currentEnergy < maxEnergy) { + Infusion.setCurrentEnergy(player, Math.min(currentEnergy + this.rite.charges, maxEnergy)); + ParticleEffect.INSTANT_SPELL.send(SoundEffect.NOTE_PLING, player, 1.0D, 2.0D, 8); + } + } + } + } + + return RitualStep.Result.UPKEEP; + } + } + + IPowerSource getPowerSource(World world, int posX, int posY, int posZ) { + if(this.powerSourceCoord != null && world.rand.nextInt(5) != 0) { + TileEntity tileEntity = this.powerSourceCoord.getBlockTileEntity(world); + if(!(tileEntity instanceof BlockAltar.TileEntityAltar)) { + return this.findNewPowerSource(world, posX, posY, posZ); + } else { + BlockAltar.TileEntityAltar altarTileEntity = (BlockAltar.TileEntityAltar)tileEntity; + return (IPowerSource)(!altarTileEntity.isValid()?this.findNewPowerSource(world, posX, posY, posZ):altarTileEntity); + } + } else { + return this.findNewPowerSource(world, posX, posY, posZ); + } + } + + private IPowerSource findNewPowerSource(World world, int posX, int posY, int posZ) { + ArrayList sources = PowerSources.instance() != null?PowerSources.instance().get(world, new Coord(posX, posY, posZ), 16):null; + return sources != null && sources.size() > 0?((PowerSources.RelativePowerSource)sources.get(0)).source():null; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteLegilimency.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteLegilimency.java new file mode 100644 index 0000000..2b559ea --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteLegilimency.java @@ -0,0 +1,77 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class RiteLegilimency extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteLegilimency(this, initialStage)); + } + + private static class StepRiteLegilimency extends RitualStep { + private final RiteLegilimency rite; + + public StepRiteLegilimency(RiteLegilimency rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityPlayer initiator = circleType.getInitiatingPlayer(world); + if (initiator == null) { + return RitualStep.Result.ABORTED_REFUND; + } + boolean read = false; + Iterator i$ = circleType.sacrificedItems.iterator(); + while (i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if (item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + EntityLivingBase target = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + if (target != null) { + String name = Witchery.Items.TAGLOCK_KIT.getBoundEntityDisplayName(item.itemstack, Integer.valueOf(1)); + String dim = target.worldObj.provider.getDimensionName(); + String tx = Integer.toString(MathHelper.floor_double(target.posX)); + String ty = Integer.toString(MathHelper.floor_double(target.posY)); + String tz = Integer.toString(MathHelper.floor_double(target.posZ)); + String hp = Integer.toString((int)Math.ceil((double)target.getHealth())) + "/" + Integer.toString((int)Math.ceil((double)target.getMaxHealth())); + String held = "-"; + ItemStack heldStack = target.getHeldItem(); + if (heldStack != null) { + held = heldStack.getDisplayName(); + } + ChatUtil.sendTranslated(EnumChatFormatting.LIGHT_PURPLE, initiator, "witchery.rite.legilimency.read", new Object[]{name, dim, tx, ty, tz, hp, held}); + read = true; + } + break; + } + } + + if (!read) { + return RitualStep.Result.ABORTED_REFUND; + } + ParticleEffect.MAGIC_CRIT.send(SoundEffect.MOB_ENDERMAN_IDLE, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 1.0D, 1.0D, 16); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteMorsmordre.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteMorsmordre.java new file mode 100644 index 0000000..c8471ab --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteMorsmordre.java @@ -0,0 +1,42 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityDarkMark; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public class RiteMorsmordre extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteMorsmordre(this, initialStage)); + } + + private static class StepRiteMorsmordre extends RitualStep { + private final RiteMorsmordre rite; + + public StepRiteMorsmordre(RiteMorsmordre rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityDarkMark mark = new EntityDarkMark(world); + mark.setLocationAndAngles(0.5D + (double)x, (double)y + 12.0D, 0.5D + (double)z, 0.0F, 0.0F); + mark.func_110163_bv(); + world.spawnEntityInWorld((Entity)mark); + ParticleEffect.LARGE_SMOKE.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 2.0D, 2.0D, 32); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteNaturesPower.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteNaturesPower.java index 7e2db2c..57ffa33 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteNaturesPower.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteNaturesPower.java @@ -1,176 +1,176 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.Dye; -import com.emoniph.witchery.util.MutableBlock; -import com.mojang.authlib.GameProfile; -import java.util.ArrayList; -import java.util.UUID; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemDye; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.util.FakePlayer; - -public class RiteNaturesPower extends Rite { - - private final int radius; - private final int height; - private final int duration; - private final int expanse; - - - public RiteNaturesPower(int radius, int height, int duration, int expanse) { - this.radius = radius; - this.height = height; - this.duration = duration; - this.expanse = expanse; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteNaturesPower.StepNaturesPower(this, intialStage)); - } - - private static class StepNaturesPower extends RitualStep { - - private final RiteNaturesPower rite; - private int stage = 0; - private EntityPlayer fakePlayer = null; - - - public StepNaturesPower(RiteNaturesPower rite, int initialStage) { - super(false); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else if(!world.isRemote) { - if(++this.stage >= this.rite.duration + ritual.covenSize * 5) { - return RitualStep.Result.COMPLETED; - } else { - int modradius = this.rite.radius + ritual.covenSize * 2; - --posY; - int x = posX - modradius + world.rand.nextInt(modradius * 2); - int z = posZ - modradius + world.rand.nextInt(modradius * 2); - int y = -1; - world.playAuxSFX(2005, posX, posY + 2, posZ, 0); - Material material = world.getBlock(x, posY, z).getMaterial(); - if(material != null && material.isSolid() && world.isAirBlock(x, posY + 1, z)) { - y = posY; - } else { - for(int h = 1; h < this.rite.height; ++h) { - material = world.getBlock(x, posY + h, z).getMaterial(); - if(material != null && material.isSolid() && world.isAirBlock(x, posY + h + 1, z)) { - y = posY + h; - break; - } - - material = world.getBlock(x, posY - h, z).getMaterial(); - if(material != null && material.isSolid() && (world.isAirBlock(x, posY - h + 1, z) || world.getBlock(x, posY - h + 1, z) == Blocks.snow)) { - y = posY - h; - break; - } - } - } - - if(y != -1) { - world.playAuxSFX(2005, x, y + 1, z, 0); - this.drawFilledCircle(world, x, y, z, this.rite.expanse + 1); - } - - return RitualStep.Result.UPKEEP; - } - } else { - return RitualStep.Result.COMPLETED; - } - } - - protected void drawFilledCircle(World world, int x0, int y, int z0, int radius) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawLine(world, -x + x0, x + x0, z + z0, y, x0, z0, radius); - this.drawLine(world, -z + x0, z + x0, x + z0, y, x0, z0, radius); - this.drawLine(world, -x + x0, x + x0, -z + z0, y, x0, z0, radius); - this.drawLine(world, -z + x0, z + x0, -x + z0, y, x0, z0, radius); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawLine(World world, int x1, int x2, int z, int y, int midX, int midZ, int radius) { - int modX1 = radius > 1 && world.rand.nextInt(5) == 0?x1 + 1:x1; - int modX2 = radius > 1 && world.rand.nextInt(5) == 0?x2 - 1:x2; - boolean edgeZ = midZ + radius == z || midZ - radius == z; - - for(int done = modX1; done <= modX2; ++done) { - this.drawPixel(world, done, z, y, done == modX1 || done == modX2 || edgeZ); - } - - boolean var13 = true; - } - - private boolean isNeighbourBlockID(World world, int x, int y, int z, Block blockID) { - return world.getBlock(x + 1, y, z) == blockID?true:(world.getBlock(x - 1, y, z) == blockID?true:(world.getBlock(x, y, z + 1) == blockID?true:world.getBlock(x, y, z - 1) == blockID)); - } - - protected void drawPixel(World world, int x, int z, int y, boolean lower) { - Object blockID = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - boolean wasGrass = blockID == Blocks.grass; - Material materialAbove = world.getBlock(x, y + 1, z).getMaterial(); - if(materialAbove != null && !materialAbove.isSolid()) { - if((blockID == Blocks.stone || blockID == Blocks.sand || blockID == Blocks.gravel || Config.instance().canReplaceNaturalBlock((Block)blockID, meta)) && world.rand.nextInt(8) != 0) { - if(materialAbove != Material.vine && world.rand.nextDouble() <= (this.isNeighbourBlockID(world, x, y, z, Blocks.water)?0.7D:0.02D)) { - world.setBlock(x, y, z, Blocks.water); - } else { - world.setBlock(x, y, z, Blocks.grass); - } - - blockID = Blocks.grass; - } - - if(materialAbove != Material.vine && blockID != Blocks.air && blockID != Blocks.leaves && blockID != Witchery.Blocks.LEAVES && world.rand.nextInt(4) == 0) { - MutableBlock[] count = new MutableBlock[]{new MutableBlock(Blocks.sapling, 0), new MutableBlock(Blocks.sapling, 1), new MutableBlock(Blocks.sapling, 2), new MutableBlock(Blocks.sapling, 3), new MutableBlock(Witchery.Blocks.SAPLING, 0), new MutableBlock(Witchery.Blocks.SAPLING, 1), new MutableBlock(Witchery.Blocks.SAPLING, 2), new MutableBlock(Witchery.Blocks.EMBER_MOSS, 0), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.brown_mushroom), new MutableBlock(Blocks.red_mushroom), new MutableBlock(Blocks.red_flower), new MutableBlock(Blocks.yellow_flower), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.pumpkin, 0), new MutableBlock(Blocks.melon_block, 0), new MutableBlock(Witchery.Blocks.GLINT_WEED, 0)}; - count[world.rand.nextInt(count.length)].mutate(world, x, y + 1, z, false); - } - - if(world.rand.nextInt(3) == 0) { - int var12 = 0; - if((this.fakePlayer == null || this.fakePlayer.worldObj != world) && world instanceof WorldServer) { - this.fakePlayer = new FakePlayer((WorldServer)world, new GameProfile(UUID.randomUUID(), "[Minecraft]")); - } - - ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); - - for(Block saplingBlockID = world.getBlock(x, y + 1, z); (saplingBlockID == Blocks.sapling || saplingBlockID == Witchery.Blocks.SAPLING) && var12++ < 8; saplingBlockID = world.getBlock(x, y + 1, z)) { - ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); - } - } - } - - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.Dye; +import com.emoniph.witchery.util.MutableBlock; +import com.mojang.authlib.GameProfile; +import java.util.ArrayList; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDye; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.util.FakePlayer; + +public class RiteNaturesPower extends Rite { + + private final int radius; + private final int height; + private final int duration; + private final int expanse; + + + public RiteNaturesPower(int radius, int height, int duration, int expanse) { + this.radius = radius; + this.height = height; + this.duration = duration; + this.expanse = expanse; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteNaturesPower.StepNaturesPower(this, intialStage)); + } + + private static class StepNaturesPower extends RitualStep { + + private final RiteNaturesPower rite; + private int stage = 0; + private EntityPlayer fakePlayer = null; + + + public StepNaturesPower(RiteNaturesPower rite, int initialStage) { + super(false); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else if(!world.isRemote) { + if(++this.stage >= this.rite.duration + ritual.covenSize * 5) { + return RitualStep.Result.COMPLETED; + } else { + int modradius = this.rite.radius + ritual.covenSize * 2; + --posY; + int x = posX - modradius + world.rand.nextInt(modradius * 2); + int z = posZ - modradius + world.rand.nextInt(modradius * 2); + int y = -1; + world.playAuxSFX(2005, posX, posY + 2, posZ, 0); + Material material = world.getBlock(x, posY, z).getMaterial(); + if(material != null && material.isSolid() && world.isAirBlock(x, posY + 1, z)) { + y = posY; + } else { + for(int h = 1; h < this.rite.height; ++h) { + material = world.getBlock(x, posY + h, z).getMaterial(); + if(material != null && material.isSolid() && world.isAirBlock(x, posY + h + 1, z)) { + y = posY + h; + break; + } + + material = world.getBlock(x, posY - h, z).getMaterial(); + if(material != null && material.isSolid() && (world.isAirBlock(x, posY - h + 1, z) || world.getBlock(x, posY - h + 1, z) == Blocks.snow)) { + y = posY - h; + break; + } + } + } + + if(y != -1) { + world.playAuxSFX(2005, x, y + 1, z, 0); + this.drawFilledCircle(world, x, y, z, this.rite.expanse + 1); + } + + return RitualStep.Result.UPKEEP; + } + } else { + return RitualStep.Result.COMPLETED; + } + } + + protected void drawFilledCircle(World world, int x0, int y, int z0, int radius) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawLine(world, -x + x0, x + x0, z + z0, y, x0, z0, radius); + this.drawLine(world, -z + x0, z + x0, x + z0, y, x0, z0, radius); + this.drawLine(world, -x + x0, x + x0, -z + z0, y, x0, z0, radius); + this.drawLine(world, -z + x0, z + x0, -x + z0, y, x0, z0, radius); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawLine(World world, int x1, int x2, int z, int y, int midX, int midZ, int radius) { + int modX1 = radius > 1 && world.rand.nextInt(5) == 0?x1 + 1:x1; + int modX2 = radius > 1 && world.rand.nextInt(5) == 0?x2 - 1:x2; + boolean edgeZ = midZ + radius == z || midZ - radius == z; + + for(int done = modX1; done <= modX2; ++done) { + this.drawPixel(world, done, z, y, done == modX1 || done == modX2 || edgeZ); + } + + boolean var13 = true; + } + + private boolean isNeighbourBlockID(World world, int x, int y, int z, Block blockID) { + return world.getBlock(x + 1, y, z) == blockID?true:(world.getBlock(x - 1, y, z) == blockID?true:(world.getBlock(x, y, z + 1) == blockID?true:world.getBlock(x, y, z - 1) == blockID)); + } + + protected void drawPixel(World world, int x, int z, int y, boolean lower) { + Object blockID = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + boolean wasGrass = blockID == Blocks.grass; + Material materialAbove = world.getBlock(x, y + 1, z).getMaterial(); + if(materialAbove != null && !materialAbove.isSolid()) { + if((blockID == Blocks.stone || blockID == Blocks.sand || blockID == Blocks.gravel || Config.instance().canReplaceNaturalBlock((Block)blockID, meta)) && world.rand.nextInt(8) != 0) { + if(materialAbove != Material.vine && world.rand.nextDouble() <= (this.isNeighbourBlockID(world, x, y, z, Blocks.water)?0.7D:0.02D)) { + world.setBlock(x, y, z, Blocks.water); + } else { + world.setBlock(x, y, z, Blocks.grass); + } + + blockID = Blocks.grass; + } + + if(materialAbove != Material.vine && blockID != Blocks.air && blockID != Blocks.leaves && blockID != Witchery.Blocks.LEAVES && world.rand.nextInt(4) == 0) { + MutableBlock[] count = new MutableBlock[]{new MutableBlock(Blocks.sapling, 0), new MutableBlock(Blocks.sapling, 1), new MutableBlock(Blocks.sapling, 2), new MutableBlock(Blocks.sapling, 3), new MutableBlock(Witchery.Blocks.SAPLING, 0), new MutableBlock(Witchery.Blocks.SAPLING, 1), new MutableBlock(Witchery.Blocks.SAPLING, 2), new MutableBlock(Witchery.Blocks.EMBER_MOSS, 0), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.brown_mushroom), new MutableBlock(Blocks.red_mushroom), new MutableBlock(Blocks.red_flower), new MutableBlock(Blocks.yellow_flower), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.tallgrass, 1), new MutableBlock(Blocks.tallgrass, 2), new MutableBlock(Blocks.pumpkin, 0), new MutableBlock(Blocks.melon_block, 0), new MutableBlock(Witchery.Blocks.GLINT_WEED, 0)}; + count[world.rand.nextInt(count.length)].mutate(world, x, y + 1, z, false); + } + + if(world.rand.nextInt(3) == 0) { + int var12 = 0; + if((this.fakePlayer == null || this.fakePlayer.worldObj != world) && world instanceof WorldServer) { + this.fakePlayer = new FakePlayer((WorldServer)world, new GameProfile(UUID.randomUUID(), "[Minecraft]")); + } + + ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); + + for(Block saplingBlockID = world.getBlock(x, y + 1, z); (saplingBlockID == Blocks.sapling || saplingBlockID == Witchery.Blocks.SAPLING) && var12++ < 8; saplingBlockID = world.getBlock(x, y + 1, z)) { + ItemDye.applyBonemeal(Dye.BONE_MEAL.createStack(), world, x, y + 1, z, this.fakePlayer); + } + } + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RitePartEarth.java b/src/main/java/com/emoniph/witchery/ritual/rites/RitePartEarth.java index 999476e..1fee55f 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RitePartEarth.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RitePartEarth.java @@ -1,222 +1,222 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.BlockProtect; -import com.emoniph.witchery.util.Coord; -import java.util.ArrayList; -import net.minecraft.world.World; - -public class RitePartEarth extends Rite { - - private final int length; - private final int width; - private final int depth; - - - public RitePartEarth(int length, int width, int depth) { - this.length = length; - this.width = width; - this.depth = depth; - } - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RitePartEarth.StepPartEarth(this, initialStage)); - } - - private static class StepPartEarth extends RitualStep { - - private final RitePartEarth rite; - private int stage = 0; - Coord coord; - ArrayList coords = new ArrayList(); - - - public StepPartEarth(RitePartEarth rite, int initialStage) { - super(false); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(this.stage == 0 && ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - int length = this.rite.length; - int width = this.rite.width + (ritual.covenSize > 2?2:0); - int depth = this.rite.depth; - if(++this.stage == 1 || this.coords.isEmpty()) { - this.coords.clear(); - this.coord = new Coord(posX, posY - 1, posZ); - this.coords.add(this.coord); - int DELAY = ritual.sacrificedItems != null && !ritual.sacrificedItems.isEmpty()?this.coord.getHeading(((RitualStep.SacrificedItem)ritual.sacrificedItems.get(0)).location):0; - byte c = 20; - - for(int l = 0; l < length - 1; ++l) { - DELAY = this.move(world, DELAY, this.coord, Math.max(c - l / 2, 6)); - this.coords.add(this.coord); - } - } - - boolean var15 = true; - if(!world.isRemote) { - Coord var14 = (Coord)this.coords.get(this.stage + 4); - this.drawFilledCircle(world, var14.x, var14.z, var14.y, width + (world.rand.nextInt(3) == 0?1:0), depth - 2 + world.rand.nextInt(5)); - } - - return this.stage >= this.coords.size() - 4 - 1?RitualStep.Result.COMPLETED:RitualStep.Result.UPKEEP; - } - } - - protected void drawFilledCircle(World world, int x0, int z0, int y, int radius, int depth) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawLine(world, -x + x0, x + x0, z + z0, y, depth); - this.drawLine(world, -z + x0, z + x0, x + z0, y, depth); - this.drawLine(world, -x + x0, x + x0, -z + z0, y, depth); - this.drawLine(world, -z + x0, z + x0, -x + z0, y, depth); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawLine(World world, int x1, int x2, int z, int y, int depth) { - for(int x = x1; x <= x2; ++x) { - this.drawPixel(world, x, z, y, depth); - } - - } - - protected void drawPixel(World world, int x, int z, int y, int depth) { - for(int d = 0; d < depth; ++d) { - if(BlockProtect.canBreak(x, y - d, z, world)) { - world.setBlockToAir(x, y - d, z); - } - } - - } - - private int move(World world, int last, Coord coord, int probability) { - int val = world.rand.nextInt(probability); - switch(last) { - case 0: - if(val == 0) { - this.coord = coord.northEast(); - return 1; - } else { - if(val == 1) { - this.coord = coord.northWest(); - return 7; - } - - this.coord = coord.north(); - return 0; - } - case 1: - if(val == 0) { - this.coord = coord.north(); - return 0; - } else { - if(val == 1) { - this.coord = coord.east(); - return 2; - } - - this.coord = coord.northEast(); - return 1; - } - case 2: - if(val == 0) { - this.coord = coord.northEast(); - return 1; - } else { - if(val == 1) { - this.coord = coord.southEast(); - return 3; - } - - this.coord = coord.east(); - return 2; - } - case 3: - if(val == 0) { - this.coord = coord.east(); - return 2; - } else { - if(val == 1) { - this.coord = coord.south(); - return 4; - } - - this.coord = coord.southEast(); - return 3; - } - case 4: - if(val == 0) { - this.coord = coord.southEast(); - return 3; - } else { - if(val == 1) { - this.coord = coord.southWest(); - return 5; - } - - this.coord = coord.south(); - return 4; - } - case 5: - if(val == 0) { - this.coord = coord.south(); - return 4; - } else { - if(val == 1) { - this.coord = coord.west(); - return 6; - } - - this.coord = coord.southWest(); - return 5; - } - case 6: - if(val == 0) { - this.coord = coord.southWest(); - return 5; - } else { - if(val == 1) { - this.coord = coord.northWest(); - return 7; - } - - this.coord = coord.west(); - return 6; - } - case 7: - default: - if(val == 0) { - this.coord = coord.west(); - return 6; - } else if(val == 1) { - this.coord = coord.north(); - return 0; - } else { - this.coord = coord.northWest(); - return 7; - } - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.BlockProtect; +import com.emoniph.witchery.util.Coord; +import java.util.ArrayList; +import net.minecraft.world.World; + +public class RitePartEarth extends Rite { + + private final int length; + private final int width; + private final int depth; + + + public RitePartEarth(int length, int width, int depth) { + this.length = length; + this.width = width; + this.depth = depth; + } + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RitePartEarth.StepPartEarth(this, initialStage)); + } + + private static class StepPartEarth extends RitualStep { + + private final RitePartEarth rite; + private int stage = 0; + Coord coord; + ArrayList coords = new ArrayList(); + + + public StepPartEarth(RitePartEarth rite, int initialStage) { + super(false); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(this.stage == 0 && ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + int length = this.rite.length; + int width = this.rite.width + (ritual.covenSize > 2?2:0); + int depth = this.rite.depth; + if(++this.stage == 1 || this.coords.isEmpty()) { + this.coords.clear(); + this.coord = new Coord(posX, posY - 1, posZ); + this.coords.add(this.coord); + int DELAY = ritual.sacrificedItems != null && !ritual.sacrificedItems.isEmpty()?this.coord.getHeading(((RitualStep.SacrificedItem)ritual.sacrificedItems.get(0)).location):0; + byte c = 20; + + for(int l = 0; l < length - 1; ++l) { + DELAY = this.move(world, DELAY, this.coord, Math.max(c - l / 2, 6)); + this.coords.add(this.coord); + } + } + + boolean var15 = true; + if(!world.isRemote) { + Coord var14 = (Coord)this.coords.get(this.stage + 4); + this.drawFilledCircle(world, var14.x, var14.z, var14.y, width + (world.rand.nextInt(3) == 0?1:0), depth - 2 + world.rand.nextInt(5)); + } + + return this.stage >= this.coords.size() - 4 - 1?RitualStep.Result.COMPLETED:RitualStep.Result.UPKEEP; + } + } + + protected void drawFilledCircle(World world, int x0, int z0, int y, int radius, int depth) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawLine(world, -x + x0, x + x0, z + z0, y, depth); + this.drawLine(world, -z + x0, z + x0, x + z0, y, depth); + this.drawLine(world, -x + x0, x + x0, -z + z0, y, depth); + this.drawLine(world, -z + x0, z + x0, -x + z0, y, depth); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawLine(World world, int x1, int x2, int z, int y, int depth) { + for(int x = x1; x <= x2; ++x) { + this.drawPixel(world, x, z, y, depth); + } + + } + + protected void drawPixel(World world, int x, int z, int y, int depth) { + for(int d = 0; d < depth; ++d) { + if(BlockProtect.canBreak(x, y - d, z, world)) { + world.setBlockToAir(x, y - d, z); + } + } + + } + + private int move(World world, int last, Coord coord, int probability) { + int val = world.rand.nextInt(probability); + switch(last) { + case 0: + if(val == 0) { + this.coord = coord.northEast(); + return 1; + } else { + if(val == 1) { + this.coord = coord.northWest(); + return 7; + } + + this.coord = coord.north(); + return 0; + } + case 1: + if(val == 0) { + this.coord = coord.north(); + return 0; + } else { + if(val == 1) { + this.coord = coord.east(); + return 2; + } + + this.coord = coord.northEast(); + return 1; + } + case 2: + if(val == 0) { + this.coord = coord.northEast(); + return 1; + } else { + if(val == 1) { + this.coord = coord.southEast(); + return 3; + } + + this.coord = coord.east(); + return 2; + } + case 3: + if(val == 0) { + this.coord = coord.east(); + return 2; + } else { + if(val == 1) { + this.coord = coord.south(); + return 4; + } + + this.coord = coord.southEast(); + return 3; + } + case 4: + if(val == 0) { + this.coord = coord.southEast(); + return 3; + } else { + if(val == 1) { + this.coord = coord.southWest(); + return 5; + } + + this.coord = coord.south(); + return 4; + } + case 5: + if(val == 0) { + this.coord = coord.south(); + return 4; + } else { + if(val == 1) { + this.coord = coord.west(); + return 6; + } + + this.coord = coord.southWest(); + return 5; + } + case 6: + if(val == 0) { + this.coord = coord.southWest(); + return 5; + } else { + if(val == 1) { + this.coord = coord.northWest(); + return 7; + } + + this.coord = coord.west(); + return 6; + } + case 7: + default: + if(val == 0) { + this.coord = coord.west(); + return 6; + } else if(val == 1) { + this.coord = coord.north(); + return 0; + } else { + this.coord = coord.northWest(); + return 7; + } + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RitePhilosopherStone.java b/src/main/java/com/emoniph/witchery/ritual/rites/RitePhilosopherStone.java new file mode 100644 index 0000000..1379d82 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RitePhilosopherStone.java @@ -0,0 +1,76 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RitePhilosopherStone extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRitePhilosopherStone(this, initialStage)); + } + + private static class StepRitePhilosopherStone extends RitualStep { + private final RitePhilosopherStone rite; + private static final int RADIUS = 4; + + public StepRitePhilosopherStone(RitePhilosopherStone rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + int transmuted = 0; + // The Great Work: base metals and stone become gold. + for (int dx = -RADIUS; dx <= RADIUS; ++dx) { + for (int dz = -RADIUS; dz <= RADIUS; ++dz) { + for (int dy = -3; dy <= 0; ++dy) { + int bx = x + dx; + int by = y + dy; + int bz = z + dz; + Block block = world.getBlock(bx, by, bz); + if (block == Blocks.iron_block || block == Blocks.iron_ore) { + world.setBlock(bx, by, bz, Blocks.gold_block, 0, 3); + ++transmuted; + } else if (block == Blocks.cobblestone || block == Blocks.gravel) { + world.setBlock(bx, by, bz, Blocks.iron_ore, 0, 3); + ++transmuted; + } + } + } + } + + // The stone yields its priceless gift regardless of nearby ore. + spawnReward(world, x, y, z, new ItemStack(Items.diamond, 1)); + spawnReward(world, x, y, z, new ItemStack(Items.gold_ingot, 3)); + spawnReward(world, x, y, z, Witchery.Items.GENERIC.itemAttunedStoneCharged.createStack()); + + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 2.0D, 2.0D, 24); + } + return RitualStep.Result.COMPLETED; + } + + private static void spawnReward(World world, int x, int y, int z, ItemStack stack) { + EntityItem drop = new EntityItem(world, 0.5D + (double)x, (double)y + 1.5D, 0.5D + (double)z, stack); + drop.motionX = 0.0D; + drop.motionY = 0.3D; + drop.motionZ = 0.0D; + world.spawnEntityInWorld(drop); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RitePriorIncarnation.java b/src/main/java/com/emoniph/witchery/ritual/rites/RitePriorIncarnation.java index 9f8d11a..754fcce 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RitePriorIncarnation.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RitePriorIncarnation.java @@ -1,277 +1,277 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.Config; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.Log; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntitySkeleton; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.event.entity.item.ItemExpireEvent; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; - -public class RitePriorIncarnation extends Rite { - - private static final String PRIOR_INV_KEY = "WITCPriIncInv"; - private static final String PRIOR_USR_KEY = "WITCPriIncUsr"; - private static final String PRIOR_LOC_KEY = "WITCPriIncLoc"; - private final int radius; - private final int aoe; - - - public static boolean isRiteAllowed() { - return Config.instance().allowDeathItemRecoveryRite && !Witchery.isDeathChestModInstalled; - } - - public RitePriorIncarnation(int radius, int aoe) { - this.radius = radius; - this.aoe = aoe; - } - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RitePriorIncarnation.StepPriorIncarnation(this, initialStage)); - } - - private static class StepPriorIncarnation extends RitualStep { - - private final RitePriorIncarnation rite; - private int stage = 0; - - - public StepPriorIncarnation(RitePriorIncarnation rite, int initialStage) { - super(false); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(RitePriorIncarnation.isRiteAllowed() && !world.getGameRules().getGameRuleBooleanValue("keepInventory")) { - if(this.stage == 0 && ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int var28 = this.rite.radius; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - var28), (double)posY, (double)(posZ - var28), (double)(posX + var28), (double)(posY + 1), (double)(posZ + var28)); - boolean found = false; - Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityPlayer player = (EntityPlayer)obj; - if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)var28) { - NBTTagCompound nbt = Infusion.getNBT(player); - if(Config.instance().traceRites()) { - Log.instance().debug(String.format("Prior invocation for %s", new Object[]{player.getCommandSenderName()})); - } - - if(nbt.hasKey("WITCPriIncInv") && nbt.hasKey("WITCPriIncLocX") && nbt.hasKey("WITCPriIncLocY") && nbt.hasKey("WITCPriIncLocZ")) { - NBTTagList tagList = nbt.getTagList("WITCPriIncInv", 10); - double x = nbt.getDouble("WITCPriIncLocX"); - double y = nbt.getDouble("WITCPriIncLocY"); - double z = nbt.getDouble("WITCPriIncLocZ"); - double dSq = Coord.distanceSq((double)posX, (double)posY, (double)posZ, x, y, z); - if(Config.instance().traceRites()) { - Log.instance().debug(String.format("Distance to death %f items %d", new Object[]{Double.valueOf(Math.sqrt(dSq)), Integer.valueOf(tagList.tagCount())})); - } - - if(dSq <= (double)(this.rite.aoe * this.rite.aoe) && tagList.tagCount() > 0) { - if(Config.instance().traceRites()) { - Log.instance().debug(String.format("Recovering %d items", new Object[]{Integer.valueOf(tagList.tagCount())})); - } - - for(int skeleton = 0; skeleton < tagList.tagCount(); ++skeleton) { - NBTTagCompound baseTag = tagList.getCompoundTagAt(skeleton); - if(baseTag != null && baseTag instanceof NBTTagCompound) { - NBTTagCompound tag = (NBTTagCompound)baseTag; - ItemStack stack = ItemStack.loadItemStackFromNBT(tag); - if(stack != null) { - if(Config.instance().traceRites()) { - Log.instance().debug(String.format(" - Recovered %s", new Object[]{stack.toString()})); - } - - world.spawnEntityInWorld(new EntityItem(world, (double)posX, (double)posY, (double)posZ, stack)); - } else { - Log.instance().warning("Prior Incarnation stack is null"); - } - } else { - Log.instance().warning("Prior Incarnation item has incorrect NBT type or is null " + baseTag); - } - } - - EntitySkeleton var29 = new EntitySkeleton(world); - var29.setLocationAndAngles((double)posX, (double)posY, (double)posZ, 0.0F, 0.0F); - var29.setCustomNameTag(player.getCommandSenderName()); - world.spawnEntityInWorld(var29); - nbt.removeTag("WITCPriIncInv"); - nbt.removeTag("WITCPriIncLocX"); - nbt.removeTag("WITCPriIncLocY"); - nbt.removeTag("WITCPriIncLocZ"); - found = true; - } - } - } - } - - if(found) { - ParticleEffect.HUGE_EXPLOSION.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); - } else { - ParticleEffect.SMOKE.send(SoundEffect.NOTE_SNARE, world, (double)posX, (double)posY, (double)posZ, 1.0D, 2.0D, 16); - } - } - - return RitualStep.Result.COMPLETED; - } - } else { - EntityPlayer r = ritual.getInitiatingPlayer(world); - if(r != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, r, "witchery.rite.disabled", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } - } - } - - public static class EventHooks { - - @SubscribeEvent - public void onItemExpire(ItemExpireEvent event) { - if(event.entityItem != null && !event.entityItem.worldObj.isRemote && RitePriorIncarnation.isRiteAllowed() && !event.isCanceled()) { - ItemStack stack = event.entityItem.getEntityItem(); - NBTTagCompound nbtItem = stack.getTagCompound(); - if(nbtItem != null && nbtItem.hasKey("WITCPriIncUsr")) { - String username = nbtItem.getString("WITCPriIncUsr"); - if(username != null && !username.isEmpty()) { - MinecraftServer server = MinecraftServer.getServer(); - WorldServer[] arr$ = server.worldServers; - int len$ = arr$.length; - - for(int i$ = 0; i$ < len$; ++i$) { - WorldServer world = arr$[i$]; - EntityPlayer player = world.getPlayerEntityByName(username); - if(player != null) { - if(Config.instance().traceRites()) { - Log.instance().debug(String.format("Saving stack %s for player %s", new Object[]{stack.toString(), player.getCommandSenderName()})); - } - - NBTTagCompound nbt = Infusion.getNBT(player); - NBTTagList list; - if(!nbt.hasKey("WITCPriIncInv")) { - list = new NBTTagList(); - nbt.setTag("WITCPriIncInv", list); - } - - list = nbt.getTagList("WITCPriIncInv", 10); - NBTTagCompound tagCompound = new NBTTagCompound(); - nbtItem.removeTag("WITCPriIncUsr"); - if(nbtItem.hasNoTags()) { - stack.setTagCompound((NBTTagCompound)null); - } - - stack.writeToNBT(tagCompound); - list.appendTag(tagCompound); - break; - } - } - } - } - } - - } - - @SubscribeEvent - public void onEntityItemPickup(EntityItemPickupEvent event) { - if(!event.item.worldObj.isRemote && RitePriorIncarnation.isRiteAllowed() && !event.isCanceled()) { - ItemStack stack = event.item.getEntityItem(); - removePriorUserTag(stack); - } - - } - - public static void removePriorUserTag(ItemStack stack) { - if(stack != null) { - NBTTagCompound nbtItem = stack.getTagCompound(); - if(nbtItem != null && nbtItem.hasKey("WITCPriIncUsr")) { - if(Config.instance().traceRites()) { - Log.instance().debug(String.format("removing prio incarnation tag for player %s", new Object[]{nbtItem.getString("WITCPriIncUsr")})); - } - - nbtItem.removeTag("WITCPriIncUsr"); - if(nbtItem.hasNoTags()) { - stack.setTagCompound((NBTTagCompound)null); - } - } - } - - } - - @SubscribeEvent - public void onPlayerDrops(PlayerDropsEvent event) { - if(event.entityPlayer != null && !event.entityPlayer.worldObj.isRemote && event.entityPlayer.isPotionActive(Witchery.Potions.KEEP_INVENTORY)) { - event.setCanceled(true); - } else { - if(event.entityPlayer != null && !event.entityPlayer.worldObj.isRemote && RitePriorIncarnation.isRiteAllowed() && !event.isCanceled()) { - if(event.entityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { - return; - } - - ArrayList drops = event.drops; - if(drops != null && drops.size() > 0) { - EntityPlayer player = event.entityPlayer; - World world = player.worldObj; - - for(int nbt = 0; nbt < drops.size(); ++nbt) { - ItemStack stack = ((EntityItem)drops.get(nbt)).getEntityItem(); - if(stack != null) { - NBTTagCompound nbt1 = stack.getTagCompound(); - if(nbt1 == null) { - nbt1 = new NBTTagCompound(); - stack.setTagCompound(nbt1); - } - - if(Config.instance().traceRites()) { - Log.instance().debug(String.format("Tagging stack %s for player %s", new Object[]{stack.toString(), player.getCommandSenderName()})); - } - - nbt1.setString("WITCPriIncUsr", player.getCommandSenderName()); - } - } - - NBTTagCompound var8 = Infusion.getNBT(player); - if(var8.hasKey("WITCPriIncInv")) { - var8.removeTag("WITCPriIncInv"); - } - - var8.setDouble("WITCPriIncLocX", player.posX); - var8.setDouble("WITCPriIncLocY", player.posY); - var8.setDouble("WITCPriIncLocZ", player.posZ); - } - } - - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Config; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.Log; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.event.entity.item.ItemExpireEvent; +import net.minecraftforge.event.entity.player.EntityItemPickupEvent; +import net.minecraftforge.event.entity.player.PlayerDropsEvent; + +public class RitePriorIncarnation extends Rite { + + private static final String PRIOR_INV_KEY = "WITCPriIncInv"; + private static final String PRIOR_USR_KEY = "WITCPriIncUsr"; + private static final String PRIOR_LOC_KEY = "WITCPriIncLoc"; + private final int radius; + private final int aoe; + + + public static boolean isRiteAllowed() { + return Config.instance().allowDeathItemRecoveryRite && !Witchery.isDeathChestModInstalled; + } + + public RitePriorIncarnation(int radius, int aoe) { + this.radius = radius; + this.aoe = aoe; + } + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RitePriorIncarnation.StepPriorIncarnation(this, initialStage)); + } + + private static class StepPriorIncarnation extends RitualStep { + + private final RitePriorIncarnation rite; + private int stage = 0; + + + public StepPriorIncarnation(RitePriorIncarnation rite, int initialStage) { + super(false); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(RitePriorIncarnation.isRiteAllowed() && !world.getGameRules().getGameRuleBooleanValue("keepInventory")) { + if(this.stage == 0 && ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int var28 = this.rite.radius; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - var28), (double)posY, (double)(posZ - var28), (double)(posX + var28), (double)(posY + 1), (double)(posZ + var28)); + boolean found = false; + Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityPlayer player = (EntityPlayer)obj; + if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)var28) { + NBTTagCompound nbt = Infusion.getNBT(player); + if(Config.instance().traceRites()) { + Log.instance().debug(String.format("Prior invocation for %s", new Object[]{player.getCommandSenderName()})); + } + + if(nbt.hasKey("WITCPriIncInv") && nbt.hasKey("WITCPriIncLocX") && nbt.hasKey("WITCPriIncLocY") && nbt.hasKey("WITCPriIncLocZ")) { + NBTTagList tagList = nbt.getTagList("WITCPriIncInv", 10); + double x = nbt.getDouble("WITCPriIncLocX"); + double y = nbt.getDouble("WITCPriIncLocY"); + double z = nbt.getDouble("WITCPriIncLocZ"); + double dSq = Coord.distanceSq((double)posX, (double)posY, (double)posZ, x, y, z); + if(Config.instance().traceRites()) { + Log.instance().debug(String.format("Distance to death %f items %d", new Object[]{Double.valueOf(Math.sqrt(dSq)), Integer.valueOf(tagList.tagCount())})); + } + + if(dSq <= (double)(this.rite.aoe * this.rite.aoe) && tagList.tagCount() > 0) { + if(Config.instance().traceRites()) { + Log.instance().debug(String.format("Recovering %d items", new Object[]{Integer.valueOf(tagList.tagCount())})); + } + + for(int skeleton = 0; skeleton < tagList.tagCount(); ++skeleton) { + NBTTagCompound baseTag = tagList.getCompoundTagAt(skeleton); + if(baseTag != null && baseTag instanceof NBTTagCompound) { + NBTTagCompound tag = (NBTTagCompound)baseTag; + ItemStack stack = ItemStack.loadItemStackFromNBT(tag); + if(stack != null) { + if(Config.instance().traceRites()) { + Log.instance().debug(String.format(" - Recovered %s", new Object[]{stack.toString()})); + } + + world.spawnEntityInWorld(new EntityItem(world, (double)posX, (double)posY, (double)posZ, stack)); + } else { + Log.instance().warning("Prior Incarnation stack is null"); + } + } else { + Log.instance().warning("Prior Incarnation item has incorrect NBT type or is null " + baseTag); + } + } + + EntitySkeleton var29 = new EntitySkeleton(world); + var29.setLocationAndAngles((double)posX, (double)posY, (double)posZ, 0.0F, 0.0F); + var29.setCustomNameTag(player.getCommandSenderName()); + world.spawnEntityInWorld(var29); + nbt.removeTag("WITCPriIncInv"); + nbt.removeTag("WITCPriIncLocX"); + nbt.removeTag("WITCPriIncLocY"); + nbt.removeTag("WITCPriIncLocZ"); + found = true; + } + } + } + } + + if(found) { + ParticleEffect.HUGE_EXPLOSION.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); + } else { + ParticleEffect.SMOKE.send(SoundEffect.NOTE_SNARE, world, (double)posX, (double)posY, (double)posZ, 1.0D, 2.0D, 16); + } + } + + return RitualStep.Result.COMPLETED; + } + } else { + EntityPlayer r = ritual.getInitiatingPlayer(world); + if(r != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, r, "witchery.rite.disabled", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } + } + } + + public static class EventHooks { + + @SubscribeEvent + public void onItemExpire(ItemExpireEvent event) { + if(event.entityItem != null && !event.entityItem.worldObj.isRemote && RitePriorIncarnation.isRiteAllowed() && !event.isCanceled()) { + ItemStack stack = event.entityItem.getEntityItem(); + NBTTagCompound nbtItem = stack.getTagCompound(); + if(nbtItem != null && nbtItem.hasKey("WITCPriIncUsr")) { + String username = nbtItem.getString("WITCPriIncUsr"); + if(username != null && !username.isEmpty()) { + MinecraftServer server = MinecraftServer.getServer(); + WorldServer[] arr$ = server.worldServers; + int len$ = arr$.length; + + for(int i$ = 0; i$ < len$; ++i$) { + WorldServer world = arr$[i$]; + EntityPlayer player = world.getPlayerEntityByName(username); + if(player != null) { + if(Config.instance().traceRites()) { + Log.instance().debug(String.format("Saving stack %s for player %s", new Object[]{stack.toString(), player.getCommandSenderName()})); + } + + NBTTagCompound nbt = Infusion.getNBT(player); + NBTTagList list; + if(!nbt.hasKey("WITCPriIncInv")) { + list = new NBTTagList(); + nbt.setTag("WITCPriIncInv", list); + } + + list = nbt.getTagList("WITCPriIncInv", 10); + NBTTagCompound tagCompound = new NBTTagCompound(); + nbtItem.removeTag("WITCPriIncUsr"); + if(nbtItem.hasNoTags()) { + stack.setTagCompound((NBTTagCompound)null); + } + + stack.writeToNBT(tagCompound); + list.appendTag(tagCompound); + break; + } + } + } + } + } + + } + + @SubscribeEvent + public void onEntityItemPickup(EntityItemPickupEvent event) { + if(!event.item.worldObj.isRemote && RitePriorIncarnation.isRiteAllowed() && !event.isCanceled()) { + ItemStack stack = event.item.getEntityItem(); + removePriorUserTag(stack); + } + + } + + public static void removePriorUserTag(ItemStack stack) { + if(stack != null) { + NBTTagCompound nbtItem = stack.getTagCompound(); + if(nbtItem != null && nbtItem.hasKey("WITCPriIncUsr")) { + if(Config.instance().traceRites()) { + Log.instance().debug(String.format("removing prio incarnation tag for player %s", new Object[]{nbtItem.getString("WITCPriIncUsr")})); + } + + nbtItem.removeTag("WITCPriIncUsr"); + if(nbtItem.hasNoTags()) { + stack.setTagCompound((NBTTagCompound)null); + } + } + } + + } + + @SubscribeEvent + public void onPlayerDrops(PlayerDropsEvent event) { + if(event.entityPlayer != null && !event.entityPlayer.worldObj.isRemote && event.entityPlayer.isPotionActive(Witchery.Potions.KEEP_INVENTORY)) { + event.setCanceled(true); + } else { + if(event.entityPlayer != null && !event.entityPlayer.worldObj.isRemote && RitePriorIncarnation.isRiteAllowed() && !event.isCanceled()) { + if(event.entityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + return; + } + + ArrayList drops = event.drops; + if(drops != null && drops.size() > 0) { + EntityPlayer player = event.entityPlayer; + World world = player.worldObj; + + for(int nbt = 0; nbt < drops.size(); ++nbt) { + ItemStack stack = ((EntityItem)drops.get(nbt)).getEntityItem(); + if(stack != null) { + NBTTagCompound nbt1 = stack.getTagCompound(); + if(nbt1 == null) { + nbt1 = new NBTTagCompound(); + stack.setTagCompound(nbt1); + } + + if(Config.instance().traceRites()) { + Log.instance().debug(String.format("Tagging stack %s for player %s", new Object[]{stack.toString(), player.getCommandSenderName()})); + } + + nbt1.setString("WITCPriIncUsr", player.getCommandSenderName()); + } + } + + NBTTagCompound var8 = Infusion.getNBT(player); + if(var8.hasKey("WITCPriIncInv")) { + var8.removeTag("WITCPriIncInv"); + } + + var8.setDouble("WITCPriIncLocX", player.posX); + var8.setDouble("WITCPriIncLocY", player.posY); + var8.setDouble("WITCPriIncLocZ", player.posZ); + } + } + + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RitePromisedLand.java b/src/main/java/com/emoniph/witchery/ritual/rites/RitePromisedLand.java new file mode 100644 index 0000000..043b288 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RitePromisedLand.java @@ -0,0 +1,81 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class RitePromisedLand extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRitePromisedLand(this, initialStage)); + } + + private static class StepRitePromisedLand extends RitualStep { + private final RitePromisedLand rite; + private static final int RADIUS = 8; + + public StepRitePromisedLand(RitePromisedLand rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + Random rand = world.rand; + int radiusSq = RADIUS * RADIUS; + int blessed = 0; + for (int dx = -RADIUS; dx <= RADIUS; ++dx) { + for (int dz = -RADIUS; dz <= RADIUS; ++dz) { + if (dx * dx + dz * dz > radiusSq) { + continue; + } + int bx = x + dx; + int bz = z + dz; + // Find the topmost solid ground within a few blocks of the circle plane. + for (int dy = 3; dy >= -3; --dy) { + int by = y + dy; + Block ground = world.getBlock(bx, by, bz); + boolean canGrow = ground == Blocks.dirt || ground == Blocks.sand || ground == Blocks.gravel || ground == Blocks.grass; + if (canGrow && world.isAirBlock(bx, by + 1, bz)) { + if (ground != Blocks.grass) { + world.setBlock(bx, by, bz, Blocks.grass, 0, 3); + } + decorate(world, rand, bx, by + 1, bz); + ++blessed; + break; + } + } + } + } + + if (blessed == 0) { + return RitualStep.Result.ABORTED_REFUND; + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 3.0D, 2.0D, 32); + } + return RitualStep.Result.COMPLETED; + } + + private static void decorate(World world, Random rand, int x, int y, int z) { + int roll = rand.nextInt(10); + if (roll == 0) { + world.setBlock(x, y, z, Blocks.yellow_flower, 0, 3); + } else if (roll == 1) { + world.setBlock(x, y, z, Blocks.red_flower, rand.nextInt(8), 3); + } else if (roll <= 5) { + world.setBlock(x, y, z, Blocks.tallgrass, 1, 3); + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircle.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircle.java index c2131e4..2588903 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircle.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircle.java @@ -1,102 +1,102 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockAltar; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.common.IPowerSource; -import com.emoniph.witchery.common.PowerSources; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public abstract class RiteProtectionCircle extends Rite { - - private final int radius; - private final float upkeepPowerCost; - private final int ticksToLive; - - - public RiteProtectionCircle(int radius, float upkeepPowerCost, int ticksToLive) { - this.radius = radius; - this.upkeepPowerCost = upkeepPowerCost; - this.ticksToLive = ticksToLive; - } - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RiteProtectionCircle.ProtectionCircleStep(this, initialStage)); - } - - protected abstract void update(World var1, int var2, int var3, int var4, int var5, long var6); - - private static class ProtectionCircleStep extends RitualStep { - - private final RiteProtectionCircle rite; - private boolean activated = false; - protected int ticksSoFar; - Coord powerSourceCoord; - static final int POWER_SOURCE_RADIUS = 16; - - - public ProtectionCircleStep(RiteProtectionCircle rite, int ticksSoFar) { - super(true); - this.rite = rite; - this.ticksSoFar = ticksSoFar; - } - - public int getCurrentStage() { - return this.ticksSoFar; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(!this.activated) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } - - this.activated = true; - SoundEffect.RANDOM_FIZZ.playAt(world, (double)super.sourceX, (double)super.sourceY, (double)super.sourceZ); - } - - if(this.rite.upkeepPowerCost > 0.0F) { - IPowerSource powerSource = this.getPowerSource(world, super.sourceX, super.sourceY, super.sourceZ); - if(powerSource == null) { - return RitualStep.Result.ABORTED; - } - - this.powerSourceCoord = powerSource.getLocation(); - if(!powerSource.consumePower(this.rite.upkeepPowerCost)) { - return RitualStep.Result.ABORTED; - } - } - - if(this.rite.ticksToLive > 0 && ticks % 20L == 0L && ++this.ticksSoFar >= this.rite.ticksToLive) { - return RitualStep.Result.COMPLETED; - } else { - this.rite.update(world, posX, posY, posZ, this.rite.radius, ticks); - return RitualStep.Result.UPKEEP; - } - } - - IPowerSource getPowerSource(World world, int posX, int posY, int posZ) { - if(this.powerSourceCoord != null && world.rand.nextInt(5) != 0) { - TileEntity tileEntity = this.powerSourceCoord.getBlockTileEntity(world); - if(!(tileEntity instanceof BlockAltar.TileEntityAltar)) { - return this.findNewPowerSource(world, posX, posY, posZ); - } else { - BlockAltar.TileEntityAltar altarTileEntity = (BlockAltar.TileEntityAltar)tileEntity; - return (IPowerSource)(!altarTileEntity.isValid()?this.findNewPowerSource(world, posX, posY, posZ):altarTileEntity); - } - } else { - return this.findNewPowerSource(world, posX, posY, posZ); - } - } - - private IPowerSource findNewPowerSource(World world, int posX, int posY, int posZ) { - ArrayList sources = PowerSources.instance() != null?PowerSources.instance().get(world, new Coord(posX, posY, posZ), 16):null; - return sources != null && sources.size() > 0?((PowerSources.RelativePowerSource)sources.get(0)).source():null; - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockAltar; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.common.IPowerSource; +import com.emoniph.witchery.common.PowerSources; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public abstract class RiteProtectionCircle extends Rite { + + private final int radius; + private final float upkeepPowerCost; + private final int ticksToLive; + + + public RiteProtectionCircle(int radius, float upkeepPowerCost, int ticksToLive) { + this.radius = radius; + this.upkeepPowerCost = upkeepPowerCost; + this.ticksToLive = ticksToLive; + } + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RiteProtectionCircle.ProtectionCircleStep(this, initialStage)); + } + + protected abstract void update(World var1, int var2, int var3, int var4, int var5, long var6); + + private static class ProtectionCircleStep extends RitualStep { + + private final RiteProtectionCircle rite; + private boolean activated = false; + protected int ticksSoFar; + Coord powerSourceCoord; + static final int POWER_SOURCE_RADIUS = 16; + + + public ProtectionCircleStep(RiteProtectionCircle rite, int ticksSoFar) { + super(true); + this.rite = rite; + this.ticksSoFar = ticksSoFar; + } + + public int getCurrentStage() { + return this.ticksSoFar; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(!this.activated) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + + this.activated = true; + SoundEffect.RANDOM_FIZZ.playAt(world, (double)super.sourceX, (double)super.sourceY, (double)super.sourceZ); + } + + if(this.rite.upkeepPowerCost > 0.0F) { + IPowerSource powerSource = this.getPowerSource(world, super.sourceX, super.sourceY, super.sourceZ); + if(powerSource == null) { + return RitualStep.Result.ABORTED; + } + + this.powerSourceCoord = powerSource.getLocation(); + if(!powerSource.consumePower(this.rite.upkeepPowerCost)) { + return RitualStep.Result.ABORTED; + } + } + + if(this.rite.ticksToLive > 0 && ticks % 20L == 0L && ++this.ticksSoFar >= this.rite.ticksToLive) { + return RitualStep.Result.COMPLETED; + } else { + this.rite.update(world, posX, posY, posZ, this.rite.radius, ticks); + return RitualStep.Result.UPKEEP; + } + } + + IPowerSource getPowerSource(World world, int posX, int posY, int posZ) { + if(this.powerSourceCoord != null && world.rand.nextInt(5) != 0) { + TileEntity tileEntity = this.powerSourceCoord.getBlockTileEntity(world); + if(!(tileEntity instanceof BlockAltar.TileEntityAltar)) { + return this.findNewPowerSource(world, posX, posY, posZ); + } else { + BlockAltar.TileEntityAltar altarTileEntity = (BlockAltar.TileEntityAltar)tileEntity; + return (IPowerSource)(!altarTileEntity.isValid()?this.findNewPowerSource(world, posX, posY, posZ):altarTileEntity); + } + } else { + return this.findNewPowerSource(world, posX, posY, posZ); + } + } + + private IPowerSource findNewPowerSource(World world, int posX, int posY, int posZ) { + ArrayList sources = PowerSources.instance() != null?PowerSources.instance().get(world, new Coord(posX, posY, posZ), 16):null; + return sources != null && sources.size() > 0?((PowerSources.RelativePowerSource)sources.get(0)).source():null; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleAttractive.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleAttractive.java index d288bca..834053e 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleAttractive.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleAttractive.java @@ -1,80 +1,80 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.ritual.rites.RiteProtectionCircle; -import com.emoniph.witchery.util.Coord; -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.boss.EntityDragon; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public class RiteProtectionCircleAttractive extends RiteProtectionCircle { - - public RiteProtectionCircleAttractive(int radius, float upkeepPowerCost, int ticksToLive) { - super(radius, upkeepPowerCost, ticksToLive); - } - - protected void update(World world, int posX, int posY, int posZ, int radius, long ticks) { - this.attract(world, posX, posY, posZ, (float)radius); - } - - private void attract(World world, int posX, int posY, int posZ, float radius) { - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)((float)posX - radius), (double)((float)posY - radius), (double)((float)posZ - radius), (double)((float)posX + radius), (double)((float)posY + radius), (double)((float)posZ + radius)); - List list = world.getEntitiesWithinAABB(EntityCreature.class, bounds); - Iterator iterator = list.iterator(); - - while(iterator.hasNext()) { - Entity entity = (Entity)iterator.next(); - if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)radius) { - this.pull(world, entity, posX, posY, posZ, radius); - } - } - - } - - private void pull(World world, Entity entity, int posX, int posY, int posZ, float radius) { - if(!(entity instanceof EntityPlayer) && !(entity instanceof EntityDragon)) { - double distance = Coord.distance(entity.posX + entity.motionX, entity.posY + entity.motionY, entity.posZ + entity.motionZ, (double)posX, (double)posY, (double)posZ); - if(distance >= (double)(radius - 1.0F)) { - double d = (double)posX - entity.posX; - double d1 = (double)posY - entity.posY; - double d2 = (double)posZ - entity.posZ; - double d4 = d * d + d1 * d1 + d2 * d2; - d4 *= d4; - if(d4 <= Math.pow(6.0D, 4.0D)) { - double d5 = -(d * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); - double d6 = -(d1 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); - double d7 = -(d2 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); - if(d5 > 0.0D) { - d5 = 0.22D; - } else if(d5 < 0.0D) { - d5 = -0.22D; - } - - if(d6 > 0.2D) { - d6 = 0.12D; - } else if(d6 < -0.1D) { - d6 = 0.12D; - } - - if(d7 > 0.0D) { - d7 = 0.22D; - } else if(d7 < 0.0D) { - d7 = -0.22D; - } - - Vec3 vec = Vec3.createVectorHelper(d5, d6, d7); - vec.rotateAroundY(180.0F); - entity.motionX = vec.xCoord; - entity.motionY = 0.0D; - entity.motionZ = vec.zCoord; - } - } - } - - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.ritual.rites.RiteProtectionCircle; +import com.emoniph.witchery.util.Coord; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class RiteProtectionCircleAttractive extends RiteProtectionCircle { + + public RiteProtectionCircleAttractive(int radius, float upkeepPowerCost, int ticksToLive) { + super(radius, upkeepPowerCost, ticksToLive); + } + + protected void update(World world, int posX, int posY, int posZ, int radius, long ticks) { + this.attract(world, posX, posY, posZ, (float)radius); + } + + private void attract(World world, int posX, int posY, int posZ, float radius) { + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)((float)posX - radius), (double)((float)posY - radius), (double)((float)posZ - radius), (double)((float)posX + radius), (double)((float)posY + radius), (double)((float)posZ + radius)); + List list = world.getEntitiesWithinAABB(EntityCreature.class, bounds); + Iterator iterator = list.iterator(); + + while(iterator.hasNext()) { + Entity entity = (Entity)iterator.next(); + if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)radius) { + this.pull(world, entity, posX, posY, posZ, radius); + } + } + + } + + private void pull(World world, Entity entity, int posX, int posY, int posZ, float radius) { + if(!(entity instanceof EntityPlayer) && !(entity instanceof EntityDragon)) { + double distance = Coord.distance(entity.posX + entity.motionX, entity.posY + entity.motionY, entity.posZ + entity.motionZ, (double)posX, (double)posY, (double)posZ); + if(distance >= (double)(radius - 1.0F)) { + double d = (double)posX - entity.posX; + double d1 = (double)posY - entity.posY; + double d2 = (double)posZ - entity.posZ; + double d4 = d * d + d1 * d1 + d2 * d2; + d4 *= d4; + if(d4 <= Math.pow(6.0D, 4.0D)) { + double d5 = -(d * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); + double d6 = -(d1 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); + double d7 = -(d2 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); + if(d5 > 0.0D) { + d5 = 0.22D; + } else if(d5 < 0.0D) { + d5 = -0.22D; + } + + if(d6 > 0.2D) { + d6 = 0.12D; + } else if(d6 < -0.1D) { + d6 = 0.12D; + } + + if(d7 > 0.0D) { + d7 = 0.22D; + } else if(d7 < 0.0D) { + d7 = -0.22D; + } + + Vec3 vec = Vec3.createVectorHelper(d5, d6, d7); + vec.rotateAroundY(180.0F); + entity.motionX = vec.xCoord; + entity.motionY = 0.0D; + entity.motionZ = vec.zCoord; + } + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleBarrier.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleBarrier.java index e513c4a..cae7774 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleBarrier.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleBarrier.java @@ -1,101 +1,101 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockBarrier; -import com.emoniph.witchery.ritual.rites.RiteProtectionCircle; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; - -public class RiteProtectionCircleBarrier extends RiteProtectionCircle { - - protected final int height; - protected final boolean blockPlayers; - protected static final int TICKS_TO_LIVE_WITHOUT_PULSE = 30; - - - public RiteProtectionCircleBarrier(int radius, int height, float upkeepPowerCost, boolean blockPlayers, int ticksToLive) { - super(radius, upkeepPowerCost, ticksToLive); - this.height = height; - this.blockPlayers = blockPlayers; - } - - protected void update(World world, int posX, int posY, int posZ, int radius, long ticks) { - if(ticks % 20L == 0L) { - this.drawFilledCircle(world, posX, posZ, posY - 1, radius); - this.drawCircleCylinder(world, posX, posZ, posY, radius); - this.drawFilledCircle(world, posX, posZ, posY + this.height, radius); - } - - } - - protected void drawCircleCylinder(World world, int x0, int z0, int y, int radius) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawPixelColumn(world, x + x0, z + z0, y); - this.drawPixelColumn(world, z + x0, x + z0, y); - this.drawPixelColumn(world, -x + x0, z + z0, y); - this.drawPixelColumn(world, -z + x0, x + z0, y); - this.drawPixelColumn(world, -x + x0, -z + z0, y); - this.drawPixelColumn(world, -z + x0, -x + z0, y); - this.drawPixelColumn(world, x + x0, -z + z0, y); - this.drawPixelColumn(world, z + x0, -x + z0, y); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawPixelColumn(World world, int x, int z, int y) { - for(int dy = y; dy < y + this.height; ++dy) { - this.drawPixel(world, x, z, dy); - } - - } - - protected void drawPixel(World world, int x, int z, int y) { - Block blockID = world.getBlock(x, y, z); - boolean isBarrier = blockID == Witchery.Blocks.BARRIER; - if(blockID == Blocks.air || blockID.getMaterial().isReplaceable() || isBarrier) { - BlockBarrier.setBlock(world, x, y, z, 30, this.blockPlayers, (EntityPlayer)null, isBarrier); - } - - } - - protected void drawFilledCircle(World world, int x0, int z0, int y, int radius) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawLine(world, -x + x0, x + x0, z + z0, y); - this.drawLine(world, -z + x0, z + x0, x + z0, y); - this.drawLine(world, -x + x0, x + x0, -z + z0, y); - this.drawLine(world, -z + x0, z + x0, -x + z0, y); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawLine(World world, int x1, int x2, int z, int y) { - for(int x = x1; x <= x2; ++x) { - this.drawPixel(world, x, z, y); - } - - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockBarrier; +import com.emoniph.witchery.ritual.rites.RiteProtectionCircle; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class RiteProtectionCircleBarrier extends RiteProtectionCircle { + + protected final int height; + protected final boolean blockPlayers; + protected static final int TICKS_TO_LIVE_WITHOUT_PULSE = 30; + + + public RiteProtectionCircleBarrier(int radius, int height, float upkeepPowerCost, boolean blockPlayers, int ticksToLive) { + super(radius, upkeepPowerCost, ticksToLive); + this.height = height; + this.blockPlayers = blockPlayers; + } + + protected void update(World world, int posX, int posY, int posZ, int radius, long ticks) { + if(ticks % 20L == 0L) { + this.drawFilledCircle(world, posX, posZ, posY - 1, radius); + this.drawCircleCylinder(world, posX, posZ, posY, radius); + this.drawFilledCircle(world, posX, posZ, posY + this.height, radius); + } + + } + + protected void drawCircleCylinder(World world, int x0, int z0, int y, int radius) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawPixelColumn(world, x + x0, z + z0, y); + this.drawPixelColumn(world, z + x0, x + z0, y); + this.drawPixelColumn(world, -x + x0, z + z0, y); + this.drawPixelColumn(world, -z + x0, x + z0, y); + this.drawPixelColumn(world, -x + x0, -z + z0, y); + this.drawPixelColumn(world, -z + x0, -x + z0, y); + this.drawPixelColumn(world, x + x0, -z + z0, y); + this.drawPixelColumn(world, z + x0, -x + z0, y); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawPixelColumn(World world, int x, int z, int y) { + for(int dy = y; dy < y + this.height; ++dy) { + this.drawPixel(world, x, z, dy); + } + + } + + protected void drawPixel(World world, int x, int z, int y) { + Block blockID = world.getBlock(x, y, z); + boolean isBarrier = blockID == Witchery.Blocks.BARRIER; + if(blockID == Blocks.air || blockID.getMaterial().isReplaceable() || isBarrier) { + BlockBarrier.setBlock(world, x, y, z, 30, this.blockPlayers, (EntityPlayer)null, isBarrier); + } + + } + + protected void drawFilledCircle(World world, int x0, int z0, int y, int radius) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawLine(world, -x + x0, x + x0, z + z0, y); + this.drawLine(world, -z + x0, z + x0, x + z0, y); + this.drawLine(world, -x + x0, x + x0, -z + z0, y); + this.drawLine(world, -z + x0, z + x0, -x + z0, y); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawLine(World world, int x1, int x2, int z, int y) { + for(int x = x1; x <= x2; ++x) { + this.drawPixel(world, x, z, y); + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleRepulsive.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleRepulsive.java index 789fad8..69e8183 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleRepulsive.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteProtectionCircleRepulsive.java @@ -1,78 +1,78 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.ritual.rites.RiteProtectionCircle; -import com.emoniph.witchery.util.Coord; -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.boss.EntityDragon; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteProtectionCircleRepulsive extends RiteProtectionCircle { - - public RiteProtectionCircleRepulsive(int radius, float upkeepPowerCost, int ticksTolive) { - super(radius, upkeepPowerCost, ticksTolive); - } - - protected void update(World world, int posX, int posY, int posZ, int radius, long ticks) { - this.repulse(world, posX, posY, posZ, (float)radius); - } - - private void repulse(World world, int posX, int posY, int posZ, float radius) { - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)((float)posX - radius), (double)((float)posY - radius), (double)((float)posZ - radius), (double)((float)posX + radius), (double)((float)posY + radius), (double)((float)posZ + radius)); - List list = world.getEntitiesWithinAABB(EntityCreature.class, bounds); - Iterator iterator = list.iterator(); - - while(iterator.hasNext()) { - Entity entity = (Entity)iterator.next(); - if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)radius) { - push(world, entity, (double)posX, (double)posY, (double)posZ); - } - } - - } - - public static void push(World world, Entity entity, double posX, double posY, double posZ) { - push(world, entity, posX, posY, posZ, true); - } - - public static void push(World world, Entity entity, double posX, double posY, double posZ, boolean restricted) { - if(!restricted || !(entity instanceof EntityPlayer) && !(entity instanceof EntityDragon)) { - double d = posX - entity.posX; - double d1 = posY - entity.posY; - double d2 = posZ - entity.posZ; - double d4 = d * d + d1 * d1 + d2 * d2; - d4 *= d4; - if(d4 <= Math.pow(6.0D, 4.0D)) { - double d5 = -(d * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); - double d6 = -(d1 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); - double d7 = -(d2 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); - if(d5 > 0.0D) { - d5 = 0.22D; - } else if(d5 < 0.0D) { - d5 = -0.22D; - } - - if(d6 > 0.2D) { - d6 = 0.12D; - } else if(d6 < -0.1D) { - d6 = 0.12D; - } - - if(d7 > 0.0D) { - d7 = 0.22D; - } else if(d7 < 0.0D) { - d7 = -0.22D; - } - - entity.motionX += d5; - entity.motionY += d6; - entity.motionZ += d7; - } - } - - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.ritual.rites.RiteProtectionCircle; +import com.emoniph.witchery.util.Coord; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteProtectionCircleRepulsive extends RiteProtectionCircle { + + public RiteProtectionCircleRepulsive(int radius, float upkeepPowerCost, int ticksTolive) { + super(radius, upkeepPowerCost, ticksTolive); + } + + protected void update(World world, int posX, int posY, int posZ, int radius, long ticks) { + this.repulse(world, posX, posY, posZ, (float)radius); + } + + private void repulse(World world, int posX, int posY, int posZ, float radius) { + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)((float)posX - radius), (double)((float)posY - radius), (double)((float)posZ - radius), (double)((float)posX + radius), (double)((float)posY + radius), (double)((float)posZ + radius)); + List list = world.getEntitiesWithinAABB(EntityCreature.class, bounds); + Iterator iterator = list.iterator(); + + while(iterator.hasNext()) { + Entity entity = (Entity)iterator.next(); + if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)radius) { + push(world, entity, (double)posX, (double)posY, (double)posZ); + } + } + + } + + public static void push(World world, Entity entity, double posX, double posY, double posZ) { + push(world, entity, posX, posY, posZ, true); + } + + public static void push(World world, Entity entity, double posX, double posY, double posZ, boolean restricted) { + if(!restricted || !(entity instanceof EntityPlayer) && !(entity instanceof EntityDragon)) { + double d = posX - entity.posX; + double d1 = posY - entity.posY; + double d2 = posZ - entity.posZ; + double d4 = d * d + d1 * d1 + d2 * d2; + d4 *= d4; + if(d4 <= Math.pow(6.0D, 4.0D)) { + double d5 = -(d * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); + double d6 = -(d1 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); + double d7 = -(d2 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D); + if(d5 > 0.0D) { + d5 = 0.22D; + } else if(d5 < 0.0D) { + d5 = -0.22D; + } + + if(d6 > 0.2D) { + d6 = 0.12D; + } else if(d6 < -0.1D) { + d6 = 0.12D; + } + + if(d7 > 0.0D) { + d7 = 0.22D; + } else if(d7 < 0.0D) { + d7 = -0.22D; + } + + entity.motionX += d5; + entity.motionY += d6; + entity.motionZ += d7; + } + } + + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRainOfToads.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRainOfToads.java index f6b90e0..54c46a2 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRainOfToads.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRainOfToads.java @@ -1,132 +1,132 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.entity.EntityToad; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraft.world.storage.WorldInfo; - -public class RiteRainOfToads extends Rite { - - private final int minRadius; - private final int maxRadius; - private final int bolts; - - - public RiteRainOfToads(int minRadius, int maxRadius, int bolts) { - this.minRadius = minRadius; - this.maxRadius = maxRadius; - this.bolts = bolts; - } - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RiteRainOfToads.StepRainOfToads(this, initialStage)); - } - - private static class StepRainOfToads extends RitualStep { - - private final RiteRainOfToads rite; - private int stage; - - - public StepRainOfToads(RiteRainOfToads rite, int initialStage) { - super(true); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 30L != 0L) { - return RitualStep.Result.STARTING; - } else if(ritual.covenSize < 1) { - EntityPlayer var16 = ritual.getInitiatingPlayer(world); - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(var16 != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, var16, "witchery.rite.coventoosmall", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } else { - ++this.stage; - int n; - switch(this.stage) { - case 1: - this.spawnBolt(world, posX, posY, posZ); - return RitualStep.Result.STARTING; - case 2: - this.spawnBolt(world, posX, posY, posZ); - return RitualStep.Result.STARTING; - case 3: - this.spawnBolt(world, posX, posY, posZ); - return RitualStep.Result.STARTING; - case 4: - if(world instanceof WorldServer && !world.isRaining()) { - WorldInfo activeRadius = ((WorldServer)world).getWorldInfo(); - n = (300 + world.rand.nextInt(600)) * 20; - activeRadius.setRainTime(n); - activeRadius.setRaining(true); - } - - this.spawnBolt(world, posX, posY, posZ); - return RitualStep.Result.STARTING; - default: - int var17 = this.rite.maxRadius - this.rite.minRadius; - - for(n = 0; n < world.rand.nextInt(this.rite.bolts) + 8; ++n) { - int ax = world.rand.nextInt(var17 * 2 + 1); - if(ax > var17) { - ax += this.rite.minRadius * 2; - } - - int x = posX - this.rite.maxRadius + ax; - int az = world.rand.nextInt(var17 * 2 + 1); - if(az > var17) { - az += this.rite.minRadius * 2; - } - - int z = posZ - this.rite.maxRadius + az; - int y = world.getTopSolidOrLiquidBlock(x, z); - if(world.isAirBlock(x, y, z)) { - EntityToad toad = new EntityToad(world); - toad.setLocationAndAngles((double)x, (double)(y + 8 + world.rand.nextInt(7)), (double)z, 0.0F, 0.0F); - toad.setTimeToLive(30, true); - world.spawnEntityInWorld(toad); - } - } - - return this.stage < 200?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; - } - } - } - - private void spawnBolt(World world, int posX, int posY, int posZ) { - int activeRadius = this.rite.maxRadius - this.rite.minRadius; - int ax = world.rand.nextInt(activeRadius * 2 + 1); - if(ax > activeRadius) { - ax += this.rite.minRadius * 2; - } - - int x = posX - this.rite.maxRadius + ax; - int az = world.rand.nextInt(activeRadius * 2 + 1); - if(az > activeRadius) { - az += this.rite.minRadius * 2; - } - - int z = posZ - this.rite.maxRadius + az; - EntityLightningBolt bolt = new EntityLightningBolt(world, (double)x, (double)posY, (double)z); - world.addWeatherEffect(bolt); - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityToad; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.WorldInfo; + +public class RiteRainOfToads extends Rite { + + private final int minRadius; + private final int maxRadius; + private final int bolts; + + + public RiteRainOfToads(int minRadius, int maxRadius, int bolts) { + this.minRadius = minRadius; + this.maxRadius = maxRadius; + this.bolts = bolts; + } + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RiteRainOfToads.StepRainOfToads(this, initialStage)); + } + + private static class StepRainOfToads extends RitualStep { + + private final RiteRainOfToads rite; + private int stage; + + + public StepRainOfToads(RiteRainOfToads rite, int initialStage) { + super(true); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 30L != 0L) { + return RitualStep.Result.STARTING; + } else if(ritual.covenSize < 1) { + EntityPlayer var16 = ritual.getInitiatingPlayer(world); + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(var16 != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, var16, "witchery.rite.coventoosmall", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } else { + ++this.stage; + int n; + switch(this.stage) { + case 1: + this.spawnBolt(world, posX, posY, posZ); + return RitualStep.Result.STARTING; + case 2: + this.spawnBolt(world, posX, posY, posZ); + return RitualStep.Result.STARTING; + case 3: + this.spawnBolt(world, posX, posY, posZ); + return RitualStep.Result.STARTING; + case 4: + if(world instanceof WorldServer && !world.isRaining()) { + WorldInfo activeRadius = ((WorldServer)world).getWorldInfo(); + n = (300 + world.rand.nextInt(600)) * 20; + activeRadius.setRainTime(n); + activeRadius.setRaining(true); + } + + this.spawnBolt(world, posX, posY, posZ); + return RitualStep.Result.STARTING; + default: + int var17 = this.rite.maxRadius - this.rite.minRadius; + + for(n = 0; n < world.rand.nextInt(this.rite.bolts) + 8; ++n) { + int ax = world.rand.nextInt(var17 * 2 + 1); + if(ax > var17) { + ax += this.rite.minRadius * 2; + } + + int x = posX - this.rite.maxRadius + ax; + int az = world.rand.nextInt(var17 * 2 + 1); + if(az > var17) { + az += this.rite.minRadius * 2; + } + + int z = posZ - this.rite.maxRadius + az; + int y = world.getTopSolidOrLiquidBlock(x, z); + if(world.isAirBlock(x, y, z)) { + EntityToad toad = new EntityToad(world); + toad.setLocationAndAngles((double)x, (double)(y + 8 + world.rand.nextInt(7)), (double)z, 0.0F, 0.0F); + toad.setTimeToLive(30, true); + world.spawnEntityInWorld(toad); + } + } + + return this.stage < 200?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; + } + } + } + + private void spawnBolt(World world, int posX, int posY, int posZ) { + int activeRadius = this.rite.maxRadius - this.rite.minRadius; + int ax = world.rand.nextInt(activeRadius * 2 + 1); + if(ax > activeRadius) { + ax += this.rite.minRadius * 2; + } + + int x = posX - this.rite.maxRadius + ax; + int az = world.rand.nextInt(activeRadius * 2 + 1); + if(az > activeRadius) { + az += this.rite.minRadius * 2; + } + + int z = posZ - this.rite.maxRadius + az; + EntityLightningBolt bolt = new EntityLightningBolt(world, (double)x, (double)posY, (double)z); + world.addWeatherEffect(bolt); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseColumn.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseColumn.java index 3f74c8b..00bc6ff 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseColumn.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseColumn.java @@ -1,146 +1,146 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.BlockUtil; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteRaiseColumn extends Rite { - - private final int radius; - private final int height; - - - public RiteRaiseColumn(int radius, int height) { - this.radius = radius; - this.height = height; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteRaiseColumn.StepRaiseColumn(this, intialStage)); - } - - private static class StepRaiseColumn extends RitualStep { - - private final RiteRaiseColumn rite; - private int stage = 0; - - - public StepRaiseColumn(RiteRaiseColumn rite, int initialStage) { - super(true); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(!world.isRemote) { - if(ticks % 5L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(++this.stage == 1) { - ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 0.5D, 1.0D, 16); - } - - int height = this.rite.height; - int radius = this.rite.radius + ritual.covenSize * 2; - int AIR_SPACE = this.rite.radius * 2; - - for(int bounds = posY + AIR_SPACE; bounds >= posY - height; --bounds) { - this.drawFilledCircle(world, posX, bounds, posZ, radius, bounds == posY - 1); - } - - AxisAlignedBB var15 = AxisAlignedBB.getBoundingBox((double)(posX - radius), (double)posY, (double)(posZ - radius), (double)(posX + radius), (double)(posY + AIR_SPACE), (double)(posZ + radius)); - Iterator i$ = world.getEntitiesWithinAABB(Entity.class, var15).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - Entity entity = (Entity)obj; - if(Coord.distanceSq(entity.posX, (double)posY, entity.posZ, (double)posX, (double)posY, (double)posZ) <= (double)(radius * radius)) { - if(entity instanceof EntityLivingBase) { - ((EntityLivingBase)entity).setPositionAndUpdate(entity.posX, entity.posY + 1.0D, entity.posZ); - } else { - entity.noClip = true; - entity.setPosition(entity.posX, entity.posY + 1.0D, entity.posZ); - entity.noClip = false; - } - } - } - - if(this.stage < height - 1) { - return RitualStep.Result.UPKEEP; - } else { - return RitualStep.Result.COMPLETED; - } - } - } else { - return RitualStep.Result.COMPLETED; - } - } - - protected void drawFilledCircle(World world, int x0, int y0, int z0, int radius, boolean topLayer) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawLine(world, -x + x0, x + x0, y0, z + z0, topLayer, radius, z0); - this.drawLine(world, -z + x0, z + x0, y0, x + z0, topLayer, radius, z0); - this.drawLine(world, -x + x0, x + x0, y0, -z + z0, topLayer, radius, z0); - this.drawLine(world, -z + x0, z + x0, y0, -x + z0, topLayer, radius, z0); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawLine(World world, int x1, int x2, int y, int z, boolean topLayer, int radius, int midZ) { - for(int x = x1; x <= x2; ++x) { - Block block = BlockUtil.getBlock(world, x, y, z); - Block highBlock = BlockUtil.getBlock(world, x, y + 1, z); - Block lowBlock = BlockUtil.getBlock(world, x, y - 1, z); - if(block != null && block != Blocks.air && !BlockUtil.isImmovableBlock(block) && !BlockUtil.isImmovableBlock(highBlock) && !BlockUtil.isImmovableBlock(lowBlock)) { - boolean edgeZ = midZ + radius == z || midZ - radius == z; - int blockMeta = world.getBlockMetadata(x, y, z); - if(topLayer || !edgeZ && x != x1 && x != x2 || world.rand.nextInt(7) != 0) { - if(block.hasTileEntity(0)) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if(tileEntity != null && !BlockUtil.isImmovableBlock(tileEntity)) { - world.removeTileEntity(x, y, z); - BlockUtil.setBlock(world, x, y + 1, z, block); - world.setBlockMetadataWithNotify(x, y + 1, z, blockMeta, 2); - tileEntity.validate(); - world.setTileEntity(x, y + 1, z, tileEntity); - BlockUtil.setAirBlock(world, x, y, z, 2); - } - } else { - BlockUtil.setBlock(world, x, y + 1, z, block, blockMeta, 2); - BlockUtil.setAirBlock(world, x, y, z, 2); - } - } - } - } - - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.BlockUtil; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteRaiseColumn extends Rite { + + private final int radius; + private final int height; + + + public RiteRaiseColumn(int radius, int height) { + this.radius = radius; + this.height = height; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteRaiseColumn.StepRaiseColumn(this, intialStage)); + } + + private static class StepRaiseColumn extends RitualStep { + + private final RiteRaiseColumn rite; + private int stage = 0; + + + public StepRaiseColumn(RiteRaiseColumn rite, int initialStage) { + super(true); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(!world.isRemote) { + if(ticks % 5L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(++this.stage == 1) { + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 0.5D, 1.0D, 16); + } + + int height = this.rite.height; + int radius = this.rite.radius + ritual.covenSize * 2; + int AIR_SPACE = this.rite.radius * 2; + + for(int bounds = posY + AIR_SPACE; bounds >= posY - height; --bounds) { + this.drawFilledCircle(world, posX, bounds, posZ, radius, bounds == posY - 1); + } + + AxisAlignedBB var15 = AxisAlignedBB.getBoundingBox((double)(posX - radius), (double)posY, (double)(posZ - radius), (double)(posX + radius), (double)(posY + AIR_SPACE), (double)(posZ + radius)); + Iterator i$ = world.getEntitiesWithinAABB(Entity.class, var15).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + Entity entity = (Entity)obj; + if(Coord.distanceSq(entity.posX, (double)posY, entity.posZ, (double)posX, (double)posY, (double)posZ) <= (double)(radius * radius)) { + if(entity instanceof EntityLivingBase) { + ((EntityLivingBase)entity).setPositionAndUpdate(entity.posX, entity.posY + 1.0D, entity.posZ); + } else { + entity.noClip = true; + entity.setPosition(entity.posX, entity.posY + 1.0D, entity.posZ); + entity.noClip = false; + } + } + } + + if(this.stage < height - 1) { + return RitualStep.Result.UPKEEP; + } else { + return RitualStep.Result.COMPLETED; + } + } + } else { + return RitualStep.Result.COMPLETED; + } + } + + protected void drawFilledCircle(World world, int x0, int y0, int z0, int radius, boolean topLayer) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawLine(world, -x + x0, x + x0, y0, z + z0, topLayer, radius, z0); + this.drawLine(world, -z + x0, z + x0, y0, x + z0, topLayer, radius, z0); + this.drawLine(world, -x + x0, x + x0, y0, -z + z0, topLayer, radius, z0); + this.drawLine(world, -z + x0, z + x0, y0, -x + z0, topLayer, radius, z0); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawLine(World world, int x1, int x2, int y, int z, boolean topLayer, int radius, int midZ) { + for(int x = x1; x <= x2; ++x) { + Block block = BlockUtil.getBlock(world, x, y, z); + Block highBlock = BlockUtil.getBlock(world, x, y + 1, z); + Block lowBlock = BlockUtil.getBlock(world, x, y - 1, z); + if(block != null && block != Blocks.air && !BlockUtil.isImmovableBlock(block) && !BlockUtil.isImmovableBlock(highBlock) && !BlockUtil.isImmovableBlock(lowBlock)) { + boolean edgeZ = midZ + radius == z || midZ - radius == z; + int blockMeta = world.getBlockMetadata(x, y, z); + if(topLayer || !edgeZ && x != x1 && x != x2 || world.rand.nextInt(7) != 0) { + if(block.hasTileEntity(0)) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + if(tileEntity != null && !BlockUtil.isImmovableBlock(tileEntity)) { + world.removeTileEntity(x, y, z); + BlockUtil.setBlock(world, x, y + 1, z, block); + world.setBlockMetadataWithNotify(x, y + 1, z, blockMeta, 2); + tileEntity.validate(); + world.setTileEntity(x, y + 1, z, tileEntity); + BlockUtil.setAirBlock(world, x, y, z, 2); + } + } else { + BlockUtil.setBlock(world, x, y + 1, z, block, blockMeta, 2); + BlockUtil.setAirBlock(world, x, y, z, 2); + } + } + } + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseVolcano.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseVolcano.java index a67d9b1..7b5121a 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseVolcano.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRaiseVolcano.java @@ -1,230 +1,230 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RiteRegistry; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.BlockProtect; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteRaiseVolcano extends Rite { - - private final int radius; - private final int height; - - - public RiteRaiseVolcano(int radius, int height) { - this.radius = radius; - this.height = height; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteRaiseVolcano.StepRaiseVolcano(this, intialStage)); - } - - private static class StepRaiseVolcano extends RitualStep { - - private final RiteRaiseVolcano rite; - private int stage = 0; - - - public StepRaiseVolcano(RiteRaiseVolcano rite, int initialStage) { - super(true); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 15L != 0L) { - return RitualStep.Result.STARTING; - } else if(world.isRemote) { - return RitualStep.Result.COMPLETED; - } else { - if(++this.stage == 1) { - boolean height = false; - - for(int radius = posY; radius > 0 && !height; --radius) { - Block y = world.getBlock(posX, radius, posZ); - if(y == Blocks.lava && this.surroundedByBlocks(world, posX, radius, posZ, Blocks.lava, 2)) { - height = true; - } else if(y == Blocks.bedrock) { - break; - } - } - - if(!height) { - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - RiteRegistry.RiteError("witchery.rite.missinglava", ritual.getInitiatingPlayerName(), world); - return RitualStep.Result.ABORTED_REFUND; - } - - ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 0.5D, 1.0D, 16); - } - - int var17 = this.rite.height + 4 * ritual.covenSize; - float var18 = (float)(this.rite.radius + 2 * ritual.covenSize); - int var20; - if(this.stage <= var17) { - for(var20 = 1; var20 <= this.stage; ++var20) { - float blockID = var18 - (float)(var17 - this.stage - 1 + var20) * var18 / (float)var17; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)((float)posX - blockID), (double)(var20 + posY), (double)((float)posZ - blockID), (double)((float)posX + blockID), (double)(var20 + posY), (double)((float)posZ + blockID)); - this.drawFilledCircle(world, posX, posZ, var20 + posY - 1, Math.max((int)Math.ceil((double)blockID), 1), var20, true); - if(this.stage == var17) { - int i$ = posY - 1; - - for(int obj = 0; i$ > posY - 5; ++obj) { - this.drawFilledCircle(world, posX, posZ, i$, Math.max((int)var18 - obj, 2), var20, false); - --i$; - } - } - - Iterator var21 = world.getEntitiesWithinAABB(Entity.class, bounds).iterator(); - - while(var21.hasNext()) { - Object var22 = var21.next(); - Entity entity = (Entity)var22; - if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)(var20 + posY), (double)posZ) <= (double)blockID) { - Material material = world.getBlock((int)entity.posX, (int)entity.posY, (int)entity.posZ).getMaterial(); - if(material.isSolid()) { - if(entity instanceof EntityLivingBase) { - ((EntityLivingBase)entity).setPositionAndUpdate(entity.posX, entity.posY + 1.0D, entity.posZ); - } else { - entity.setPosition(entity.posX, entity.posY + 1.0D, entity.posZ); - } - } - } - } - } - } else { - if(this.stage >= var17 * 2) { - for(var20 = posY; var20 > 0; --var20) { - Block var19 = world.getBlock(posX, var20, posZ); - if(var19 == Blocks.lava || var19 == Blocks.flowing_lava || var19 == Blocks.bedrock) { - while(var19 == Blocks.lava || var19 == Blocks.flowing_lava) { - this.setToAirIfLava(world, posX, var20, posZ); - this.setToAirIfLava(world, posX + 1, var20, posZ); - this.setToAirIfLava(world, posX - 1, var20, posZ); - this.setToAirIfLava(world, posX, var20, posZ + 1); - this.setToAirIfLava(world, posX, var20, posZ - 1); - --var20; - var19 = world.getBlock(posX, var20, posZ); - } - - return RitualStep.Result.COMPLETED; - } - - world.setBlockToAir(posX, var20, posZ); - } - - return RitualStep.Result.COMPLETED; - } - - if(this.stage == var17 * 2 - 1) { - world.setBlock(posX, posY + this.stage - var17, posZ, Blocks.flowing_lava); - world.setBlock(posX, posY + 1, posZ, Blocks.lava); - if(this.rite.radius == 16) { - if(world.rand.nextInt(4) == 0) { - world.setBlock(posX, posY + 1 + this.stage - var17, posZ, Blocks.flowing_lava); - } - } else { - switch(world.rand.nextInt(8)) { - case 0: - world.setBlockToAir(posX + 1, posY + var17 - 1, posZ); - break; - case 1: - world.setBlockToAir(posX, posY + var17 - 1, posZ + 1); - break; - case 2: - world.setBlockToAir(posX - 1, posY + var17 - 1, posZ); - break; - case 3: - world.setBlockToAir(posX, posY + var17 - 1, posZ - 1); - } - } - } else { - world.setBlock(posX, posY + 1, posZ, Blocks.stone); - world.setBlock(posX, posY + this.stage - var17, posZ, Blocks.lava); - } - } - - return RitualStep.Result.UPKEEP; - } - } - - private boolean surroundedByBlocks(World world, int x, int y, int z, Block blockID, int minCount) { - byte count = 0; - int count1 = count + (world.getBlock(x, y - 1, z) == blockID?1:0); - count1 += world.getBlock(x - 1, y, z) == blockID?1:0; - count1 += world.getBlock(x + 1, y - 1, z) == blockID?1:0; - count1 += world.getBlock(x, y, z - 1) == blockID?1:0; - count1 += world.getBlock(x, y, z + 1) == blockID?1:0; - count1 += world.getBlock(x, y + 1, z + 1) == blockID?1:0; - return count1 >= minCount; - } - - private void setToAirIfLava(World world, int posX, int posY, int posZ) { - Block blockID = world.getBlock(posX, posY, posZ); - if(blockID == Blocks.lava || blockID == Blocks.flowing_lava) { - world.setBlockToAir(posX, posY, posZ); - } - - } - - protected void drawFilledCircle(World world, int x0, int z0, int y, int radius, int height, boolean replaceBlocks) { - int x = radius; - int z = 0; - int radiusError = 1 - radius; - - while(x >= z) { - this.drawLine(world, -x + x0, x + x0, z + z0, y, x0, z0, radius, height, replaceBlocks); - this.drawLine(world, -z + x0, z + x0, x + z0, y, x0, z0, radius, height, replaceBlocks); - this.drawLine(world, -x + x0, x + x0, -z + z0, y, x0, z0, radius, height, replaceBlocks); - this.drawLine(world, -z + x0, z + x0, -x + z0, y, x0, z0, radius, height, replaceBlocks); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - } - - protected void drawLine(World world, int x1, int x2, int z, int y, int midX, int midZ, int radius, int height, boolean replaceBlocks) { - int modX1 = radius > 1 && world.rand.nextInt(5) == 0?x1 + 1:x1; - int modX2 = radius > 1 && world.rand.nextInt(5) == 0?x2 - 1:x2; - boolean edgeZ = midZ + radius == z || midZ - radius == z; - - for(int done = modX1; done <= modX2; ++done) { - if(done != midX || z != midZ) { - this.drawPixel(world, done, z, y, (done == modX1 || done == modX2 || edgeZ) && height < 3, replaceBlocks); - } - } - - boolean var15 = true; - } - - protected void drawPixel(World world, int x, int z, int y, boolean lower, boolean replaceBlocks) { - if(replaceBlocks && BlockProtect.canBreak(x, y, z, world) || world.isAirBlock(x, y, z)) { - world.setBlock(x, y, z, (Block)(lower && world.rand.nextInt(5) != 0?Blocks.grass:Blocks.stone)); - } - - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RiteRegistry; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.BlockProtect; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteRaiseVolcano extends Rite { + + private final int radius; + private final int height; + + + public RiteRaiseVolcano(int radius, int height) { + this.radius = radius; + this.height = height; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteRaiseVolcano.StepRaiseVolcano(this, intialStage)); + } + + private static class StepRaiseVolcano extends RitualStep { + + private final RiteRaiseVolcano rite; + private int stage = 0; + + + public StepRaiseVolcano(RiteRaiseVolcano rite, int initialStage) { + super(true); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 15L != 0L) { + return RitualStep.Result.STARTING; + } else if(world.isRemote) { + return RitualStep.Result.COMPLETED; + } else { + if(++this.stage == 1) { + boolean height = false; + + for(int radius = posY; radius > 0 && !height; --radius) { + Block y = world.getBlock(posX, radius, posZ); + if(y == Blocks.lava && this.surroundedByBlocks(world, posX, radius, posZ, Blocks.lava, 2)) { + height = true; + } else if(y == Blocks.bedrock) { + break; + } + } + + if(!height) { + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + RiteRegistry.RiteError("witchery.rite.missinglava", ritual.getInitiatingPlayerName(), world); + return RitualStep.Result.ABORTED_REFUND; + } + + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 0.5D, 1.0D, 16); + } + + int var17 = this.rite.height + 4 * ritual.covenSize; + float var18 = (float)(this.rite.radius + 2 * ritual.covenSize); + int var20; + if(this.stage <= var17) { + for(var20 = 1; var20 <= this.stage; ++var20) { + float blockID = var18 - (float)(var17 - this.stage - 1 + var20) * var18 / (float)var17; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)((float)posX - blockID), (double)(var20 + posY), (double)((float)posZ - blockID), (double)((float)posX + blockID), (double)(var20 + posY), (double)((float)posZ + blockID)); + this.drawFilledCircle(world, posX, posZ, var20 + posY - 1, Math.max((int)Math.ceil((double)blockID), 1), var20, true); + if(this.stage == var17) { + int i$ = posY - 1; + + for(int obj = 0; i$ > posY - 5; ++obj) { + this.drawFilledCircle(world, posX, posZ, i$, Math.max((int)var18 - obj, 2), var20, false); + --i$; + } + } + + Iterator var21 = world.getEntitiesWithinAABB(Entity.class, bounds).iterator(); + + while(var21.hasNext()) { + Object var22 = var21.next(); + Entity entity = (Entity)var22; + if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)(var20 + posY), (double)posZ) <= (double)blockID) { + Material material = world.getBlock((int)entity.posX, (int)entity.posY, (int)entity.posZ).getMaterial(); + if(material.isSolid()) { + if(entity instanceof EntityLivingBase) { + ((EntityLivingBase)entity).setPositionAndUpdate(entity.posX, entity.posY + 1.0D, entity.posZ); + } else { + entity.setPosition(entity.posX, entity.posY + 1.0D, entity.posZ); + } + } + } + } + } + } else { + if(this.stage >= var17 * 2) { + for(var20 = posY; var20 > 0; --var20) { + Block var19 = world.getBlock(posX, var20, posZ); + if(var19 == Blocks.lava || var19 == Blocks.flowing_lava || var19 == Blocks.bedrock) { + while(var19 == Blocks.lava || var19 == Blocks.flowing_lava) { + this.setToAirIfLava(world, posX, var20, posZ); + this.setToAirIfLava(world, posX + 1, var20, posZ); + this.setToAirIfLava(world, posX - 1, var20, posZ); + this.setToAirIfLava(world, posX, var20, posZ + 1); + this.setToAirIfLava(world, posX, var20, posZ - 1); + --var20; + var19 = world.getBlock(posX, var20, posZ); + } + + return RitualStep.Result.COMPLETED; + } + + world.setBlockToAir(posX, var20, posZ); + } + + return RitualStep.Result.COMPLETED; + } + + if(this.stage == var17 * 2 - 1) { + world.setBlock(posX, posY + this.stage - var17, posZ, Blocks.flowing_lava); + world.setBlock(posX, posY + 1, posZ, Blocks.lava); + if(this.rite.radius == 16) { + if(world.rand.nextInt(4) == 0) { + world.setBlock(posX, posY + 1 + this.stage - var17, posZ, Blocks.flowing_lava); + } + } else { + switch(world.rand.nextInt(8)) { + case 0: + world.setBlockToAir(posX + 1, posY + var17 - 1, posZ); + break; + case 1: + world.setBlockToAir(posX, posY + var17 - 1, posZ + 1); + break; + case 2: + world.setBlockToAir(posX - 1, posY + var17 - 1, posZ); + break; + case 3: + world.setBlockToAir(posX, posY + var17 - 1, posZ - 1); + } + } + } else { + world.setBlock(posX, posY + 1, posZ, Blocks.stone); + world.setBlock(posX, posY + this.stage - var17, posZ, Blocks.lava); + } + } + + return RitualStep.Result.UPKEEP; + } + } + + private boolean surroundedByBlocks(World world, int x, int y, int z, Block blockID, int minCount) { + byte count = 0; + int count1 = count + (world.getBlock(x, y - 1, z) == blockID?1:0); + count1 += world.getBlock(x - 1, y, z) == blockID?1:0; + count1 += world.getBlock(x + 1, y - 1, z) == blockID?1:0; + count1 += world.getBlock(x, y, z - 1) == blockID?1:0; + count1 += world.getBlock(x, y, z + 1) == blockID?1:0; + count1 += world.getBlock(x, y + 1, z + 1) == blockID?1:0; + return count1 >= minCount; + } + + private void setToAirIfLava(World world, int posX, int posY, int posZ) { + Block blockID = world.getBlock(posX, posY, posZ); + if(blockID == Blocks.lava || blockID == Blocks.flowing_lava) { + world.setBlockToAir(posX, posY, posZ); + } + + } + + protected void drawFilledCircle(World world, int x0, int z0, int y, int radius, int height, boolean replaceBlocks) { + int x = radius; + int z = 0; + int radiusError = 1 - radius; + + while(x >= z) { + this.drawLine(world, -x + x0, x + x0, z + z0, y, x0, z0, radius, height, replaceBlocks); + this.drawLine(world, -z + x0, z + x0, x + z0, y, x0, z0, radius, height, replaceBlocks); + this.drawLine(world, -x + x0, x + x0, -z + z0, y, x0, z0, radius, height, replaceBlocks); + this.drawLine(world, -z + x0, z + x0, -x + z0, y, x0, z0, radius, height, replaceBlocks); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + } + + protected void drawLine(World world, int x1, int x2, int z, int y, int midX, int midZ, int radius, int height, boolean replaceBlocks) { + int modX1 = radius > 1 && world.rand.nextInt(5) == 0?x1 + 1:x1; + int modX2 = radius > 1 && world.rand.nextInt(5) == 0?x2 - 1:x2; + boolean edgeZ = midZ + radius == z || midZ - radius == z; + + for(int done = modX1; done <= modX2; ++done) { + if(done != midX || z != midZ) { + this.drawPixel(world, done, z, y, (done == modX1 || done == modX2 || edgeZ) && height < 3, replaceBlocks); + } + } + + boolean var15 = true; + } + + protected void drawPixel(World world, int x, int z, int y, boolean lower, boolean replaceBlocks) { + if(replaceBlocks && BlockProtect.canBreak(x, y, z, world) || world.isAirBlock(x, y, z)) { + world.setBlock(x, y, z, (Block)(lower && world.rand.nextInt(5) != 0?Blocks.grass:Blocks.stone)); + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRemoveVampirism.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRemoveVampirism.java index ab77095..d21f166 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteRemoveVampirism.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteRemoveVampirism.java @@ -1,103 +1,103 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.common.ExtendedPlayer; -import com.emoniph.witchery.familiar.Familiar; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteRemoveVampirism extends Rite { - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteRemoveVampirism.StepCurseCreature(this)); - } - - private static class StepCurseCreature extends RitualStep { - - private final RiteRemoveVampirism rite; - - - public StepCurseCreature(RiteRemoveVampirism rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - boolean complete = false; - boolean cursed = false; - EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); - if(!Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer)) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requirescat", new Object[0]); - return RitualStep.Result.ABORTED_REFUND; - } - - if(ritual.covenSize < 6) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requiresfullcoven", new Object[0]); - return RitualStep.Result.ABORTED_REFUND; - } - - Iterator i$ = ritual.sacrificedItems.iterator(); - - while(i$.hasNext()) { - RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); - if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { - EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); - if(entity != null) { - if(entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)entity; - ExtendedPlayer playerEx = ExtendedPlayer.get(player); - if(playerEx.isVampire()) { - double MAX_RANGE_SQ = 64.0D; - if(player.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ) <= 64.0D) { - if(world.rand.nextInt(4) != 0) { - playerEx.setVampireLevel(0); - } else { - cursed = true; - } - - complete = true; - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.toofar", new Object[0]); - } - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); - } - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); - } - } - break; - } - } - - if(!complete) { - return RitualStep.Result.ABORTED_REFUND; - } - - if(cursed) { - ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } else { - ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); - } - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.common.ExtendedPlayer; +import com.emoniph.witchery.familiar.Familiar; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteRemoveVampirism extends Rite { + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteRemoveVampirism.StepCurseCreature(this)); + } + + private static class StepCurseCreature extends RitualStep { + + private final RiteRemoveVampirism rite; + + + public StepCurseCreature(RiteRemoveVampirism rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + boolean complete = false; + boolean cursed = false; + EntityPlayer curseMasterPlayer = ritual.getInitiatingPlayer(world); + if(!Familiar.hasActiveCurseMasteryFamiliar(curseMasterPlayer)) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requirescat", new Object[0]); + return RitualStep.Result.ABORTED_REFUND; + } + + if(ritual.covenSize < 6) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.requiresfullcoven", new Object[0]); + return RitualStep.Result.ABORTED_REFUND; + } + + Iterator i$ = ritual.sacrificedItems.iterator(); + + while(i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if(item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + EntityLivingBase entity = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + if(entity != null) { + if(entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)entity; + ExtendedPlayer playerEx = ExtendedPlayer.get(player); + if(playerEx.isVampire()) { + double MAX_RANGE_SQ = 64.0D; + if(player.getDistanceSq(0.5D + (double)posX, 0.5D + (double)posY, 0.5D + (double)posZ) <= 64.0D) { + if(world.rand.nextInt(4) != 0) { + playerEx.setVampireLevel(0); + } else { + cursed = true; + } + + complete = true; + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.toofar", new Object[0]); + } + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); + } + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, curseMasterPlayer, "witchery.rite.wolfcurse.notactive", new Object[0]); + } + } + break; + } + } + + if(!complete) { + return RitualStep.Result.ABORTED_REFUND; + } + + if(cursed) { + ParticleEffect.FLAME.send(SoundEffect.MOB_ENDERDRAGON_GROWL, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } else { + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)posX, 0.1D + (double)posY, 0.5D + (double)posZ, 1.0D, 2.0D, 16); + } + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSecretGuardian.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSecretGuardian.java new file mode 100644 index 0000000..78cbd08 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSecretGuardian.java @@ -0,0 +1,68 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockBarrier; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import java.util.ArrayList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class RiteSecretGuardian extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteSecretGuardian(this, initialStage)); + } + + private static class StepRiteSecretGuardian extends RitualStep { + private final RiteSecretGuardian rite; + + public StepRiteSecretGuardian(RiteSecretGuardian rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityPlayer owner = circleType.getInitiatingPlayer(world); + int duration = TimeUtil.minsToTicks(10) + TimeUtil.minsToTicks(5) * circleType.covenSize; + int radius = 5; + int radiusSq = radius * radius; + int height = 5; + int placed = 0; + for (int dx = -radius; dx <= radius; ++dx) { + for (int dz = -radius; dz <= radius; ++dz) { + for (int dy = 0; dy <= height; ++dy) { + int horizSq = dx * dx + dz * dz; + boolean shell = horizSq >= (radius - 1) * (radius - 1) && horizSq <= radiusSq && dy < height; + boolean cap = dy == height && horizSq <= (radius - 2) * (radius - 2); + if (shell || cap) { + int bx = x + dx; + int by = y + dy; + int bz = z + dz; + if (world.isAirBlock(bx, by, bz)) { + BlockBarrier.setBlock(world, bx, by, bz, duration, true, owner); + ++placed; + } + } + } + } + } + + if (placed == 0) { + return RitualStep.Result.ABORTED_REFUND; + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 3.0D, 3.0D, 32); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSetNBT.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSetNBT.java index 3d09122..cb86b15 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSetNBT.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSetNBT.java @@ -1,80 +1,80 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.infusion.Infusion; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteSetNBT extends Rite { - - private final int radius; - private final String nbtKey; - private final int nbtValue; - private final int nbtCovenBonus; - - - public RiteSetNBT(int radius, String nbtKey, int value, int covenMemberBonus) { - this.radius = radius; - this.nbtKey = nbtKey; - this.nbtValue = value; - this.nbtCovenBonus = covenMemberBonus; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteSetNBT.StepSetNBT(this)); - } - - private static class StepSetNBT extends RitualStep { - - private final RiteSetNBT rite; - - - public StepSetNBT(RiteSetNBT rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int r = this.rite.radius; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); - boolean bound = false; - new ArrayList(); - Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityPlayer player = (EntityPlayer)obj; - if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r) { - NBTTagCompound nbtPlayer = Infusion.getNBT(player); - if(nbtPlayer != null) { - nbtPlayer.setInteger(this.rite.nbtKey, this.rite.nbtValue + ritual.covenSize * this.rite.nbtCovenBonus); - bound = true; - } - } - } - - if(!bound) { - return RitualStep.Result.ABORTED_REFUND; - } - - ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteSetNBT extends Rite { + + private final int radius; + private final String nbtKey; + private final int nbtValue; + private final int nbtCovenBonus; + + + public RiteSetNBT(int radius, String nbtKey, int value, int covenMemberBonus) { + this.radius = radius; + this.nbtKey = nbtKey; + this.nbtValue = value; + this.nbtCovenBonus = covenMemberBonus; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteSetNBT.StepSetNBT(this)); + } + + private static class StepSetNBT extends RitualStep { + + private final RiteSetNBT rite; + + + public StepSetNBT(RiteSetNBT rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int r = this.rite.radius; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)posY, (double)(posZ - r), (double)(posX + r), (double)(posY + 1), (double)(posZ + r)); + boolean bound = false; + new ArrayList(); + Iterator i$ = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityPlayer player = (EntityPlayer)obj; + if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= (double)r) { + NBTTagCompound nbtPlayer = Infusion.getNBT(player); + if(nbtPlayer != null) { + nbtPlayer.setInteger(this.rite.nbtKey, this.rite.nbtValue + ritual.covenSize * this.rite.nbtCovenBonus); + bound = true; + } + } + } + + if(!bound) { + return RitualStep.Result.ABORTED_REFUND; + } + + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_FIZZ, world, (double)posX, (double)posY, (double)posZ, 3.0D, 3.0D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSoulThief.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSoulThief.java new file mode 100644 index 0000000..336dd40 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSoulThief.java @@ -0,0 +1,81 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityWitchHunter; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class RiteSoulThief extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteSoulThief(this, initialStage)); + } + + private static class StepRiteSoulThief extends RitualStep { + private final RiteSoulThief rite; + + public StepRiteSoulThief(RiteSoulThief rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + EntityPlayer initiator = circleType.getInitiatingPlayer(world); + boolean stolen = false; + Iterator i$ = circleType.sacrificedItems.iterator(); + while (i$.hasNext()) { + RitualStep.SacrificedItem item = (RitualStep.SacrificedItem)i$.next(); + if (item.itemstack.getItem() == Witchery.Items.TAGLOCK_KIT && item.itemstack.getItemDamage() == 1) { + EntityLivingBase target = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, item.itemstack, Integer.valueOf(1)); + if (target != null) { + EntityWitchHunter.blackMagicPerformed(initiator); + // Tear a fragment of the soul free: serious magic damage and lingering weakness. + target.attackEntityFrom(DamageSource.magic, 12.0F); + int dur = TimeUtil.secsToTicks(60); + target.addPotionEffect(new PotionEffect(Potion.weakness.id, dur, 1)); + target.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, dur, 1)); + target.addPotionEffect(new PotionEffect(Potion.hunger.id, dur, 1)); + + // The harvested soul manifests as a subdued spirit. + ItemStack soul = Witchery.Items.GENERIC.itemSubduedSpirit.createStack(); + EntityItem drop = new EntityItem(world, 0.5D + (double)x, (double)y + 1.5D, 0.5D + (double)z, soul); + drop.motionX = 0.0D; + drop.motionY = 0.3D; + drop.motionZ = 0.0D; + world.spawnEntityInWorld(drop); + ParticleEffect.MOB_SPELL.send(SoundEffect.MOB_ENDERMEN_PORTAL, target, 1.0D, 1.0D, 16); + stolen = true; + } + break; + } + } + + if (!stolen) { + return RitualStep.Result.ABORTED_REFUND; + } + ParticleEffect.PORTAL.send(SoundEffect.MOB_WITHER_SPAWN, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 1.0D, 2.0D, 16); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSphereEffect.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSphereEffect.java index a7c681c..0d27856 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSphereEffect.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSphereEffect.java @@ -1,223 +1,223 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteSphereEffect extends Rite { - - protected final int maxRadius; - protected final Block block; - - - public RiteSphereEffect(int radius, Block block) { - this.maxRadius = radius; - this.block = block; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteSphereEffect.StepExpansion(this, intialStage)); - } - - private static class StepExpansion extends RitualStep { - - private final RiteSphereEffect rite; - private int stage = 0; - private boolean activated; - - - public StepExpansion(RiteSphereEffect rite, int initialStage) { - super(false); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return (byte)this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(!this.activated) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } - - this.activated = true; - SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); - } - - if(!world.isRemote) { - if(ticks % 5L != 0L) { - return RitualStep.Result.UPKEEP; - } else { - EntityPlayer player = ritual.getInitiatingPlayer(world); - if(ritual.covenSize < 2) { - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(player != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.coventoosmall", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } else { - ++this.stage; - int maxRadius = (int)(ritual.covenSize <= 2?(double)this.rite.maxRadius:(ritual.covenSize <= 5?1.5D * (double)this.rite.maxRadius:2.0D * (double)this.rite.maxRadius)); - int currentRadius = this.stage + 4; - if(currentRadius <= maxRadius) { - if(this.stage % 2 == 0) { - drawSphere(world, posX, posY, posZ, currentRadius, this.rite.block); - drawSphere(world, posX, posY, posZ, currentRadius - 2, Blocks.air); - } - - if(currentRadius == maxRadius) { - fillWithAir(world, posX, posY, posZ, maxRadius, this.rite.block); - } - } - - return this.stage <= 250 && currentRadius < maxRadius?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; - } - } - } else { - return RitualStep.Result.COMPLETED; - } - } - - private static void fillWithAir(World world, int posX, int posY, int posZ, int radius, Block removalBlock) { - fillHalfWithAirY(world, posX, posY, posZ, 1, radius, removalBlock); - fillHalfWithAirY(world, posX, posY - 1, posZ, -1, radius, removalBlock); - } - - private static void fillHalfWithAirY(World world, int posX, int posY, int posZ, int dy, int radius, Block removalBlock) { - for(int y = 0; y <= radius; ++y) { - int realY = posY + y * dy; - if(world.getBlock(posX, realY, posZ) == removalBlock) { - break; - } - - fillSliceWithAir(world, posX, realY, posZ, radius, removalBlock); - } - - } - - private static void fillSliceWithAir(World world, int posX, int posY, int posZ, int radius, Block removalBlock) { - fillHalfWithAirX(world, posX, posY, posZ, 1, radius, removalBlock); - fillHalfWithAirX(world, posX - 1, posY, posZ, -1, radius, removalBlock); - } - - private static void fillHalfWithAirX(World world, int posX, int posY, int posZ, int dx, int radius, Block removalBlock) { - for(int x = 0; x <= radius; ++x) { - int realX = posX + x * dx; - if(world.getBlock(realX, x, posZ) == removalBlock) { - break; - } - - fillLineWithAir(world, realX, posY, posZ, radius, removalBlock); - } - - } - - private static void fillLineWithAir(World world, int posX, int posY, int posZ, int radius, Block removalBlock) { - fillHalfWithAirZ(world, posX, posY, posZ, 1, radius, removalBlock); - fillHalfWithAirZ(world, posX, posY, posZ - 1, -1, radius, removalBlock); - } - - private static void fillHalfWithAirZ(World world, int posX, int posY, int posZ, int dz, int radius, Block removalBlock) { - for(int z = 0; z <= radius; ++z) { - int realZ = posZ + z * dz; - Block foundBlock = world.getBlock(posX, posY, realZ); - if(foundBlock == removalBlock) { - break; - } - - if(foundBlock == Blocks.water || foundBlock == Blocks.flowing_water) { - world.setBlock(posX, posY, realZ, Blocks.air); - } - } - - } - - public static void drawSphere(World world, int x0, int y0, int z0, int radius, Block blockID) { - int x = radius; - int y = 0; - int radiusError = 1 - radius; - - while(x >= y) { - drawCircle(world, x0, y0, z0, y, x, radiusError, blockID); - ++y; - if(radiusError < 0) { - radiusError += 2 * y + 1; - } else { - --x; - radiusError += 2 * (y - x + 1); - } - } - - } - - protected static boolean drawCircle(World world, int x0, int y0, int z0, int y1, int radius, int error0, Block blockID) { - int x = radius; - int z = 0; - int radiusError = error0; - - while(x >= z) { - drawPixel(world, x0 + x, z0 + z, y0 + y1, blockID); - drawPixel(world, x0 - x, z0 + z, y0 + y1, blockID); - drawPixel(world, x0 + x, z0 + z, y0 - y1, blockID); - drawPixel(world, x0 - x, z0 + z, y0 - y1, blockID); - drawPixel(world, x0 + x, z0 - z, y0 + y1, blockID); - drawPixel(world, x0 - x, z0 - z, y0 + y1, blockID); - drawPixel(world, x0 + x, z0 - z, y0 - y1, blockID); - drawPixel(world, x0 - x, z0 - z, y0 - y1, blockID); - drawPixel(world, x0 + z, z0 + x, y0 + y1, blockID); - drawPixel(world, x0 - z, z0 + x, y0 + y1, blockID); - drawPixel(world, x0 + z, z0 + x, y0 - y1, blockID); - drawPixel(world, x0 - z, z0 + x, y0 - y1, blockID); - drawPixel(world, x0 + z, z0 - x, y0 + y1, blockID); - drawPixel(world, x0 - z, z0 - x, y0 + y1, blockID); - drawPixel(world, x0 + z, z0 - x, y0 - y1, blockID); - drawPixel(world, x0 - z, z0 - x, y0 - y1, blockID); - drawPixel(world, x0 + y1, z0 + z, y0 + x, blockID); - drawPixel(world, x0 - y1, z0 + z, y0 + x, blockID); - drawPixel(world, x0 + y1, z0 + z, y0 - x, blockID); - drawPixel(world, x0 - y1, z0 + z, y0 - x, blockID); - drawPixel(world, x0 + y1, z0 - z, y0 + x, blockID); - drawPixel(world, x0 - y1, z0 - z, y0 + x, blockID); - drawPixel(world, x0 + y1, z0 - z, y0 - x, blockID); - drawPixel(world, x0 - y1, z0 - z, y0 - x, blockID); - drawPixel(world, x0 + z, z0 + y1, y0 + x, blockID); - drawPixel(world, x0 - z, z0 + y1, y0 + x, blockID); - drawPixel(world, x0 + z, z0 + y1, y0 - x, blockID); - drawPixel(world, x0 - z, z0 + y1, y0 - x, blockID); - drawPixel(world, x0 + z, z0 - y1, y0 + x, blockID); - drawPixel(world, x0 - z, z0 - y1, y0 + x, blockID); - drawPixel(world, x0 + z, z0 - y1, y0 - x, blockID); - drawPixel(world, x0 - z, z0 - y1, y0 - x, blockID); - ++z; - if(radiusError < 0) { - radiusError += 2 * z + 1; - } else { - --x; - radiusError += 2 * (z - x + 1); - } - } - - return true; - } - - protected static void drawPixel(World world, int x, int z, int y, Block replaceBlockID) { - Block blockID = world.getBlock(x, y, z); - if((blockID == Blocks.water || blockID == Blocks.flowing_water || blockID == Blocks.air || blockID == Blocks.ice || blockID == Blocks.snow || blockID == Blocks.tallgrass || blockID == Blocks.vine || blockID == Blocks.waterlily || blockID == Blocks.red_flower || blockID == Blocks.yellow_flower || blockID == Blocks.cactus || blockID == Blocks.deadbush || blockID == Witchery.Blocks.PERPETUAL_ICE) && blockID != replaceBlockID) { - world.setBlock(x, y, z, replaceBlockID); - } - - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteSphereEffect extends Rite { + + protected final int maxRadius; + protected final Block block; + + + public RiteSphereEffect(int radius, Block block) { + this.maxRadius = radius; + this.block = block; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteSphereEffect.StepExpansion(this, intialStage)); + } + + private static class StepExpansion extends RitualStep { + + private final RiteSphereEffect rite; + private int stage = 0; + private boolean activated; + + + public StepExpansion(RiteSphereEffect rite, int initialStage) { + super(false); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return (byte)this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(!this.activated) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + + this.activated = true; + SoundEffect.RANDOM_FIZZ.playAt(world, (double)posX, (double)posY, (double)posZ); + } + + if(!world.isRemote) { + if(ticks % 5L != 0L) { + return RitualStep.Result.UPKEEP; + } else { + EntityPlayer player = ritual.getInitiatingPlayer(world); + if(ritual.covenSize < 2) { + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(player != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player, "witchery.rite.coventoosmall", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } else { + ++this.stage; + int maxRadius = (int)(ritual.covenSize <= 2?(double)this.rite.maxRadius:(ritual.covenSize <= 5?1.5D * (double)this.rite.maxRadius:2.0D * (double)this.rite.maxRadius)); + int currentRadius = this.stage + 4; + if(currentRadius <= maxRadius) { + if(this.stage % 2 == 0) { + drawSphere(world, posX, posY, posZ, currentRadius, this.rite.block); + drawSphere(world, posX, posY, posZ, currentRadius - 2, Blocks.air); + } + + if(currentRadius == maxRadius) { + fillWithAir(world, posX, posY, posZ, maxRadius, this.rite.block); + } + } + + return this.stage <= 250 && currentRadius < maxRadius?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; + } + } + } else { + return RitualStep.Result.COMPLETED; + } + } + + private static void fillWithAir(World world, int posX, int posY, int posZ, int radius, Block removalBlock) { + fillHalfWithAirY(world, posX, posY, posZ, 1, radius, removalBlock); + fillHalfWithAirY(world, posX, posY - 1, posZ, -1, radius, removalBlock); + } + + private static void fillHalfWithAirY(World world, int posX, int posY, int posZ, int dy, int radius, Block removalBlock) { + for(int y = 0; y <= radius; ++y) { + int realY = posY + y * dy; + if(world.getBlock(posX, realY, posZ) == removalBlock) { + break; + } + + fillSliceWithAir(world, posX, realY, posZ, radius, removalBlock); + } + + } + + private static void fillSliceWithAir(World world, int posX, int posY, int posZ, int radius, Block removalBlock) { + fillHalfWithAirX(world, posX, posY, posZ, 1, radius, removalBlock); + fillHalfWithAirX(world, posX - 1, posY, posZ, -1, radius, removalBlock); + } + + private static void fillHalfWithAirX(World world, int posX, int posY, int posZ, int dx, int radius, Block removalBlock) { + for(int x = 0; x <= radius; ++x) { + int realX = posX + x * dx; + if(world.getBlock(realX, x, posZ) == removalBlock) { + break; + } + + fillLineWithAir(world, realX, posY, posZ, radius, removalBlock); + } + + } + + private static void fillLineWithAir(World world, int posX, int posY, int posZ, int radius, Block removalBlock) { + fillHalfWithAirZ(world, posX, posY, posZ, 1, radius, removalBlock); + fillHalfWithAirZ(world, posX, posY, posZ - 1, -1, radius, removalBlock); + } + + private static void fillHalfWithAirZ(World world, int posX, int posY, int posZ, int dz, int radius, Block removalBlock) { + for(int z = 0; z <= radius; ++z) { + int realZ = posZ + z * dz; + Block foundBlock = world.getBlock(posX, posY, realZ); + if(foundBlock == removalBlock) { + break; + } + + if(foundBlock == Blocks.water || foundBlock == Blocks.flowing_water) { + world.setBlock(posX, posY, realZ, Blocks.air); + } + } + + } + + public static void drawSphere(World world, int x0, int y0, int z0, int radius, Block blockID) { + int x = radius; + int y = 0; + int radiusError = 1 - radius; + + while(x >= y) { + drawCircle(world, x0, y0, z0, y, x, radiusError, blockID); + ++y; + if(radiusError < 0) { + radiusError += 2 * y + 1; + } else { + --x; + radiusError += 2 * (y - x + 1); + } + } + + } + + protected static boolean drawCircle(World world, int x0, int y0, int z0, int y1, int radius, int error0, Block blockID) { + int x = radius; + int z = 0; + int radiusError = error0; + + while(x >= z) { + drawPixel(world, x0 + x, z0 + z, y0 + y1, blockID); + drawPixel(world, x0 - x, z0 + z, y0 + y1, blockID); + drawPixel(world, x0 + x, z0 + z, y0 - y1, blockID); + drawPixel(world, x0 - x, z0 + z, y0 - y1, blockID); + drawPixel(world, x0 + x, z0 - z, y0 + y1, blockID); + drawPixel(world, x0 - x, z0 - z, y0 + y1, blockID); + drawPixel(world, x0 + x, z0 - z, y0 - y1, blockID); + drawPixel(world, x0 - x, z0 - z, y0 - y1, blockID); + drawPixel(world, x0 + z, z0 + x, y0 + y1, blockID); + drawPixel(world, x0 - z, z0 + x, y0 + y1, blockID); + drawPixel(world, x0 + z, z0 + x, y0 - y1, blockID); + drawPixel(world, x0 - z, z0 + x, y0 - y1, blockID); + drawPixel(world, x0 + z, z0 - x, y0 + y1, blockID); + drawPixel(world, x0 - z, z0 - x, y0 + y1, blockID); + drawPixel(world, x0 + z, z0 - x, y0 - y1, blockID); + drawPixel(world, x0 - z, z0 - x, y0 - y1, blockID); + drawPixel(world, x0 + y1, z0 + z, y0 + x, blockID); + drawPixel(world, x0 - y1, z0 + z, y0 + x, blockID); + drawPixel(world, x0 + y1, z0 + z, y0 - x, blockID); + drawPixel(world, x0 - y1, z0 + z, y0 - x, blockID); + drawPixel(world, x0 + y1, z0 - z, y0 + x, blockID); + drawPixel(world, x0 - y1, z0 - z, y0 + x, blockID); + drawPixel(world, x0 + y1, z0 - z, y0 - x, blockID); + drawPixel(world, x0 - y1, z0 - z, y0 - x, blockID); + drawPixel(world, x0 + z, z0 + y1, y0 + x, blockID); + drawPixel(world, x0 - z, z0 + y1, y0 + x, blockID); + drawPixel(world, x0 + z, z0 + y1, y0 - x, blockID); + drawPixel(world, x0 - z, z0 + y1, y0 - x, blockID); + drawPixel(world, x0 + z, z0 - y1, y0 + x, blockID); + drawPixel(world, x0 - z, z0 - y1, y0 + x, blockID); + drawPixel(world, x0 + z, z0 - y1, y0 - x, blockID); + drawPixel(world, x0 - z, z0 - y1, y0 - x, blockID); + ++z; + if(radiusError < 0) { + radiusError += 2 * z + 1; + } else { + --x; + radiusError += 2 * (z - x + 1); + } + } + + return true; + } + + protected static void drawPixel(World world, int x, int z, int y, Block replaceBlockID) { + Block blockID = world.getBlock(x, y, z); + if((blockID == Blocks.water || blockID == Blocks.flowing_water || blockID == Blocks.air || blockID == Blocks.ice || blockID == Blocks.snow || blockID == Blocks.tallgrass || blockID == Blocks.vine || blockID == Blocks.waterlily || blockID == Blocks.red_flower || blockID == Blocks.yellow_flower || blockID == Blocks.cactus || blockID == Blocks.deadbush || blockID == Witchery.Blocks.PERPETUAL_ICE) && blockID != replaceBlockID) { + world.setBlock(x, y, z, replaceBlockID); + } + + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonCreature.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonCreature.java index 4851e02..9ec0aca 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonCreature.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonCreature.java @@ -1,132 +1,132 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.entity.EntityDemon; -import com.emoniph.witchery.entity.EntityImp; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RiteRegistry; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import com.emoniph.witchery.util.TameableUtil; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteSummonCreature extends Rite { - - private final Class creatureToSummon; - private boolean bindTameable; - - - public RiteSummonCreature(Class creatureToSummon, boolean bindTameable) { - this.creatureToSummon = creatureToSummon; - this.bindTameable = bindTameable; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteSummonCreature.StepSummonCreature(this)); - } - - private static class StepSummonCreature extends RitualStep { - - private final RiteSummonCreature rite; - - - public StepSummonCreature(RiteSummonCreature rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int[][] PATTERN = new int[][]{{0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 2, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0}}; - int obstructions = 0; - - for(int MAX_OBSTRUCTIONS = posY + 1; MAX_OBSTRUCTIONS <= posY + 3; ++MAX_OBSTRUCTIONS) { - int ex = (PATTERN.length - 1) / 2; - - for(int entity = 0; entity < PATTERN.length - 1; ++entity) { - int entitylivingData = posZ - ex + entity; - int offsetX = (PATTERN[entity].length - 1) / 2; - - for(int x = 0; x < PATTERN[entity].length; ++x) { - int worldX = posX - offsetX + x; - int val = PATTERN[PATTERN.length - 1 - entity][x]; - Material material; - if(val == 1) { - material = world.getBlock(worldX, MAX_OBSTRUCTIONS, entitylivingData).getMaterial(); - if(material != null && material.isSolid()) { - ++obstructions; - } - } else if(val == 2) { - material = world.getBlock(worldX, MAX_OBSTRUCTIONS, entitylivingData).getMaterial(); - if(material != null && material.isSolid()) { - obstructions += 100; - } - } - } - } - } - - boolean var24 = true; - if(obstructions > 1) { - ParticleEffect.LARGE_SMOKE.send(SoundEffect.NOTE_SNARE, world, (double)posX, (double)posY, (double)posZ, 0.5D, 2.0D, 16); - RiteRegistry.RiteError("witchery.rite.obstructedcircle", ritual.getInitiatingPlayerName(), world); - return RitualStep.Result.ABORTED_REFUND; - } - - try { - Constructor var23 = this.rite.creatureToSummon.getConstructor(new Class[]{World.class}); - EntityLiving var25 = (EntityLiving)var23.newInstance(new Object[]{world}); - EntityPlayer var26; - if(var25 instanceof EntityDemon) { - ((EntityDemon)var25).setPlayerCreated(true); - } else { - if(var25 instanceof EntityImp && ritual.covenSize == 0) { - var26 = ritual.getInitiatingPlayer(world); - SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); - if(var26 != null) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, var26, "witchery.rite.coventoosmall", new Object[0]); - } - - return RitualStep.Result.ABORTED_REFUND; - } - - if(this.rite.bindTameable && var25 instanceof EntityTameable) { - ((EntityTameable)var25).setTamed(true); - TameableUtil.setOwner((EntityTameable)var25, ritual.getInitiatingPlayer(world)); - } - } - - var25.setLocationAndAngles(0.5D + (double)posX, 1.0D + (double)posY, 0.5D + (double)posZ, 1.0F, 0.0F); - world.spawnEntityInWorld(var25); - var26 = null; - var25.onSpawnWithEgg(null); - ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, var25, 0.5D, 1.0D, 16); - } catch (NoSuchMethodException var19) { - ; - } catch (InvocationTargetException var20) { - ; - } catch (InstantiationException var21) { - ; - } catch (IllegalAccessException var22) { - ; - } - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntityDemon; +import com.emoniph.witchery.entity.EntityImp; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RiteRegistry; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TameableUtil; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteSummonCreature extends Rite { + + private final Class creatureToSummon; + private boolean bindTameable; + + + public RiteSummonCreature(Class creatureToSummon, boolean bindTameable) { + this.creatureToSummon = creatureToSummon; + this.bindTameable = bindTameable; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteSummonCreature.StepSummonCreature(this)); + } + + private static class StepSummonCreature extends RitualStep { + + private final RiteSummonCreature rite; + + + public StepSummonCreature(RiteSummonCreature rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int[][] PATTERN = new int[][]{{0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 2, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0}}; + int obstructions = 0; + + for(int MAX_OBSTRUCTIONS = posY + 1; MAX_OBSTRUCTIONS <= posY + 3; ++MAX_OBSTRUCTIONS) { + int ex = (PATTERN.length - 1) / 2; + + for(int entity = 0; entity < PATTERN.length - 1; ++entity) { + int entitylivingData = posZ - ex + entity; + int offsetX = (PATTERN[entity].length - 1) / 2; + + for(int x = 0; x < PATTERN[entity].length; ++x) { + int worldX = posX - offsetX + x; + int val = PATTERN[PATTERN.length - 1 - entity][x]; + Material material; + if(val == 1) { + material = world.getBlock(worldX, MAX_OBSTRUCTIONS, entitylivingData).getMaterial(); + if(material != null && material.isSolid()) { + ++obstructions; + } + } else if(val == 2) { + material = world.getBlock(worldX, MAX_OBSTRUCTIONS, entitylivingData).getMaterial(); + if(material != null && material.isSolid()) { + obstructions += 100; + } + } + } + } + } + + boolean var24 = true; + if(obstructions > 1) { + ParticleEffect.LARGE_SMOKE.send(SoundEffect.NOTE_SNARE, world, (double)posX, (double)posY, (double)posZ, 0.5D, 2.0D, 16); + RiteRegistry.RiteError("witchery.rite.obstructedcircle", ritual.getInitiatingPlayerName(), world); + return RitualStep.Result.ABORTED_REFUND; + } + + try { + Constructor var23 = this.rite.creatureToSummon.getConstructor(new Class[]{World.class}); + EntityLiving var25 = (EntityLiving)var23.newInstance(new Object[]{world}); + EntityPlayer var26; + if(var25 instanceof EntityDemon) { + ((EntityDemon)var25).setPlayerCreated(true); + } else { + if(var25 instanceof EntityImp && ritual.covenSize == 0) { + var26 = ritual.getInitiatingPlayer(world); + SoundEffect.NOTE_SNARE.playAt(world, (double)posX, (double)posY, (double)posZ); + if(var26 != null) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, var26, "witchery.rite.coventoosmall", new Object[0]); + } + + return RitualStep.Result.ABORTED_REFUND; + } + + if(this.rite.bindTameable && var25 instanceof EntityTameable) { + ((EntityTameable)var25).setTamed(true); + TameableUtil.setOwner((EntityTameable)var25, ritual.getInitiatingPlayer(world)); + } + } + + var25.setLocationAndAngles(0.5D + (double)posX, 1.0D + (double)posY, 0.5D + (double)posZ, 1.0F, 0.0F); + world.spawnEntityInWorld(var25); + var26 = null; + var25.onSpawnWithEgg(null); + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, var25, 0.5D, 1.0D, 16); + } catch (NoSuchMethodException var19) { + ; + } catch (InvocationTargetException var20) { + ; + } catch (InstantiationException var21) { + ; + } catch (IllegalAccessException var22) { + ; + } + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonItem.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonItem.java index 3986ffb..a76cfef 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonItem.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonItem.java @@ -1,162 +1,162 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.predictions.PredictionManager; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.Coord; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteSummonItem extends Rite { - - private final ItemStack itemToSummon; - private final RiteSummonItem.Binding binding; - - - public RiteSummonItem(ItemStack itemToSummon, RiteSummonItem.Binding binding) { - this.itemToSummon = itemToSummon; - this.binding = binding; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteSummonItem.StepSummonItem(this)); - } - - public static enum Binding { - - NONE("NONE", 0), - LOCATION("LOCATION", 1), - ENTITY("ENTITY", 2), - COPY_LOCATION("COPY_LOCATION", 3), - PLAYER("PLAYER", 4); - // $FF: synthetic field - private static final RiteSummonItem.Binding[] $VALUES = new RiteSummonItem.Binding[]{NONE, LOCATION, ENTITY, COPY_LOCATION, PLAYER}; - - - private Binding(String var1, int var2) {} - - } - - private static class StepSummonItem extends RitualStep { - - private final RiteSummonItem rite; - - - public StepSummonItem(RiteSummonItem rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - ItemStack itemstack = ItemStack.copyItemStack(this.rite.itemToSummon); - if(this.rite.binding == RiteSummonItem.Binding.LOCATION) { - Witchery.Items.GENERIC.bindToLocation(world, posX, posY, posZ, world.provider.dimensionId, world.provider.getDimensionName(), itemstack); - } else { - boolean entity; - AxisAlignedBB bounds; - Iterator nbtRoot; - Object obj; - EntityPlayer player; - if(this.rite.binding == RiteSummonItem.Binding.ENTITY) { - entity = true; - Object item = null; - bounds = AxisAlignedBB.getBoundingBox((double)(posX - 4), (double)posY, (double)(posZ - 4), (double)(posX + 4), (double)(posY + 1), (double)(posZ + 4)); - nbtRoot = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); - - while(nbtRoot.hasNext()) { - obj = nbtRoot.next(); - player = (EntityPlayer)obj; - if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= 4.0D) { - item = player; - } - } - - if(item != null) { - bounds = AxisAlignedBB.getBoundingBox((double)(posX - 4), (double)posY, (double)(posZ - 4), (double)(posX + 4), (double)(posY + 1), (double)(posZ + 4)); - nbtRoot = world.getEntitiesWithinAABB(EntityLiving.class, bounds).iterator(); - - while(nbtRoot.hasNext()) { - obj = nbtRoot.next(); - EntityLiving player1 = (EntityLiving)obj; - if(Coord.distance(player1.posX, player1.posY, player1.posZ, (double)posX, (double)posY, (double)posZ) <= 4.0D) { - item = player1; - } - } - } - - if(item == null) { - return RitualStep.Result.ABORTED_REFUND; - } - - Witchery.Items.TAGLOCK_KIT.setTaglockForEntity(itemstack, (EntityPlayer)null, (Entity)item, false, Integer.valueOf(1)); - } else if(this.rite.binding == RiteSummonItem.Binding.PLAYER) { - entity = true; - EntityPlayer item1 = null; - bounds = AxisAlignedBB.getBoundingBox((double)(posX - 4), (double)posY, (double)(posZ - 4), (double)(posX + 4), (double)(posY + 1), (double)(posZ + 4)); - nbtRoot = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); - - while(nbtRoot.hasNext()) { - obj = nbtRoot.next(); - player = (EntityPlayer)obj; - if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= 4.0D) { - item1 = player; - } - } - - if(item1 == null) { - return RitualStep.Result.ABORTED_REFUND; - } - - NBTTagCompound nbtRoot1 = new NBTTagCompound(); - nbtRoot1.setString("WITCBoundPlayer", item1.getCommandSenderName()); - itemstack.setTagCompound(nbtRoot1); - } else if(this.rite.binding == RiteSummonItem.Binding.COPY_LOCATION) { - Iterator entity2 = ritual.sacrificedItems.iterator(); - - while(entity2.hasNext()) { - RitualStep.SacrificedItem item2 = (RitualStep.SacrificedItem)entity2.next(); - if(Witchery.Items.GENERIC.hasLocationBinding(item2.itemstack)) { - Witchery.Items.GENERIC.copyLocationBinding(item2.itemstack, itemstack); - break; - } - } - } - } - - if(itemstack.getItem() == Item.getItemFromBlock(Witchery.Blocks.CRYSTAL_BALL)) { - EntityPlayer entity1 = ritual.getInitiatingPlayer(world); - if(entity1 != null) { - PredictionManager.instance().setFortuneTeller(entity1, true); - } - } - - EntityItem entity3 = new EntityItem(world, 0.5D + (double)posX, (double)posY + 1.5D, 0.5D + (double)posZ, itemstack); - entity3.motionX = 0.0D; - entity3.motionY = 0.3D; - entity3.motionZ = 0.0D; - world.spawnEntityInWorld(entity3); - ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, entity3, 0.5D, 0.5D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.predictions.PredictionManager; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteSummonItem extends Rite { + + private final ItemStack itemToSummon; + private final RiteSummonItem.Binding binding; + + + public RiteSummonItem(ItemStack itemToSummon, RiteSummonItem.Binding binding) { + this.itemToSummon = itemToSummon; + this.binding = binding; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteSummonItem.StepSummonItem(this)); + } + + public static enum Binding { + + NONE("NONE", 0), + LOCATION("LOCATION", 1), + ENTITY("ENTITY", 2), + COPY_LOCATION("COPY_LOCATION", 3), + PLAYER("PLAYER", 4); + // $FF: synthetic field + private static final RiteSummonItem.Binding[] $VALUES = new RiteSummonItem.Binding[]{NONE, LOCATION, ENTITY, COPY_LOCATION, PLAYER}; + + + private Binding(String var1, int var2) {} + + } + + private static class StepSummonItem extends RitualStep { + + private final RiteSummonItem rite; + + + public StepSummonItem(RiteSummonItem rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + ItemStack itemstack = ItemStack.copyItemStack(this.rite.itemToSummon); + if(this.rite.binding == RiteSummonItem.Binding.LOCATION) { + Witchery.Items.GENERIC.bindToLocation(world, posX, posY, posZ, world.provider.dimensionId, world.provider.getDimensionName(), itemstack); + } else { + boolean entity; + AxisAlignedBB bounds; + Iterator nbtRoot; + Object obj; + EntityPlayer player; + if(this.rite.binding == RiteSummonItem.Binding.ENTITY) { + entity = true; + Object item = null; + bounds = AxisAlignedBB.getBoundingBox((double)(posX - 4), (double)posY, (double)(posZ - 4), (double)(posX + 4), (double)(posY + 1), (double)(posZ + 4)); + nbtRoot = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); + + while(nbtRoot.hasNext()) { + obj = nbtRoot.next(); + player = (EntityPlayer)obj; + if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= 4.0D) { + item = player; + } + } + + if(item != null) { + bounds = AxisAlignedBB.getBoundingBox((double)(posX - 4), (double)posY, (double)(posZ - 4), (double)(posX + 4), (double)(posY + 1), (double)(posZ + 4)); + nbtRoot = world.getEntitiesWithinAABB(EntityLiving.class, bounds).iterator(); + + while(nbtRoot.hasNext()) { + obj = nbtRoot.next(); + EntityLiving player1 = (EntityLiving)obj; + if(Coord.distance(player1.posX, player1.posY, player1.posZ, (double)posX, (double)posY, (double)posZ) <= 4.0D) { + item = player1; + } + } + } + + if(item == null) { + return RitualStep.Result.ABORTED_REFUND; + } + + Witchery.Items.TAGLOCK_KIT.setTaglockForEntity(itemstack, (EntityPlayer)null, (Entity)item, false, Integer.valueOf(1)); + } else if(this.rite.binding == RiteSummonItem.Binding.PLAYER) { + entity = true; + EntityPlayer item1 = null; + bounds = AxisAlignedBB.getBoundingBox((double)(posX - 4), (double)posY, (double)(posZ - 4), (double)(posX + 4), (double)(posY + 1), (double)(posZ + 4)); + nbtRoot = world.getEntitiesWithinAABB(EntityPlayer.class, bounds).iterator(); + + while(nbtRoot.hasNext()) { + obj = nbtRoot.next(); + player = (EntityPlayer)obj; + if(Coord.distance(player.posX, player.posY, player.posZ, (double)posX, (double)posY, (double)posZ) <= 4.0D) { + item1 = player; + } + } + + if(item1 == null) { + return RitualStep.Result.ABORTED_REFUND; + } + + NBTTagCompound nbtRoot1 = new NBTTagCompound(); + nbtRoot1.setString("WITCBoundPlayer", item1.getCommandSenderName()); + itemstack.setTagCompound(nbtRoot1); + } else if(this.rite.binding == RiteSummonItem.Binding.COPY_LOCATION) { + Iterator entity2 = ritual.sacrificedItems.iterator(); + + while(entity2.hasNext()) { + RitualStep.SacrificedItem item2 = (RitualStep.SacrificedItem)entity2.next(); + if(Witchery.Items.GENERIC.hasLocationBinding(item2.itemstack)) { + Witchery.Items.GENERIC.copyLocationBinding(item2.itemstack, itemstack); + break; + } + } + } + } + + if(itemstack.getItem() == Item.getItemFromBlock(Witchery.Blocks.CRYSTAL_BALL)) { + EntityPlayer entity1 = ritual.getInitiatingPlayer(world); + if(entity1 != null) { + PredictionManager.instance().setFortuneTeller(entity1, true); + } + } + + EntityItem entity3 = new EntityItem(world, 0.5D + (double)posX, (double)posY + 1.5D, 0.5D + (double)posZ, itemstack); + entity3.motionX = 0.0D; + entity3.motionY = 0.3D; + entity3.motionZ = 0.0D; + world.spawnEntityInWorld(entity3); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, entity3, 0.5D, 0.5D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonSpectralStone.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonSpectralStone.java index 10294da..36306c7 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonSpectralStone.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteSummonSpectralStone.java @@ -1,97 +1,97 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.entity.EntitySummonedUndead; -import com.emoniph.witchery.item.ItemSpectralStone; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RiteRegistry; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteSummonSpectralStone extends Rite { - - private final int radius; - - - public RiteSummonSpectralStone(int radius) { - this.radius = radius; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteSummonSpectralStone.StepSummonItem(this)); - } - - private static class StepSummonItem extends RitualStep { - - private final RiteSummonSpectralStone rite; - - - public StepSummonItem(RiteSummonSpectralStone rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - int r = this.rite.radius; - int r2 = r * r; - AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)(posY - r), (double)(posZ - r), (double)(posX + r), (double)(posY + r), (double)(posZ + r)); - List entities = world.getEntitiesWithinAABB(EntitySummonedUndead.class, bb); - Class entityType = null; - int count = 0; - Iterator stack = entities.iterator(); - - while(stack.hasNext()) { - Object entity = stack.next(); - EntitySummonedUndead entity1 = (EntitySummonedUndead)entity; - if(entity1.getDistanceSq(0.5D + (double)posX, (double)posY, 0.5D + (double)posZ) <= (double)r2) { - Class foundType = entity1.getClass(); - if(entityType == null) { - entityType = foundType; - } - - if(entityType == foundType) { - ++count; - if(!world.isRemote) { - entity1.setDead(); - ParticleEffect.PORTAL.send(SoundEffect.RANDOM_POP, entity1, 1.0D, 2.0D, 16); - } - - if(count >= 3) { - break; - } - } - } - } - - if(count <= 0) { - RiteRegistry.RiteError("witchery.rite.missinglivingsacrifice", ritual.getInitiatingPlayerName(), world); - return RitualStep.Result.ABORTED_REFUND; - } - - ItemStack var19 = new ItemStack(Witchery.Items.SPECTRAL_STONE, 1, ItemSpectralStone.metaFromCreature(entityType, count)); - EntityItem var18 = new EntityItem(world, 0.5D + (double)posX, (double)posY + 1.5D, 0.5D + (double)posZ, var19); - var18.motionX = 0.0D; - var18.motionY = 0.3D; - var18.motionZ = 0.0D; - world.spawnEntityInWorld(var18); - ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, var18, 0.5D, 0.5D, 16); - } - - return RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.entity.EntitySummonedUndead; +import com.emoniph.witchery.item.ItemSpectralStone; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RiteRegistry; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteSummonSpectralStone extends Rite { + + private final int radius; + + + public RiteSummonSpectralStone(int radius) { + this.radius = radius; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteSummonSpectralStone.StepSummonItem(this)); + } + + private static class StepSummonItem extends RitualStep { + + private final RiteSummonSpectralStone rite; + + + public StepSummonItem(RiteSummonSpectralStone rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + int r = this.rite.radius; + int r2 = r * r; + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox((double)(posX - r), (double)(posY - r), (double)(posZ - r), (double)(posX + r), (double)(posY + r), (double)(posZ + r)); + List entities = world.getEntitiesWithinAABB(EntitySummonedUndead.class, bb); + Class entityType = null; + int count = 0; + Iterator stack = entities.iterator(); + + while(stack.hasNext()) { + Object entity = stack.next(); + EntitySummonedUndead entity1 = (EntitySummonedUndead)entity; + if(entity1.getDistanceSq(0.5D + (double)posX, (double)posY, 0.5D + (double)posZ) <= (double)r2) { + Class foundType = entity1.getClass(); + if(entityType == null) { + entityType = foundType; + } + + if(entityType == foundType) { + ++count; + if(!world.isRemote) { + entity1.setDead(); + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_POP, entity1, 1.0D, 2.0D, 16); + } + + if(count >= 3) { + break; + } + } + } + } + + if(count <= 0) { + RiteRegistry.RiteError("witchery.rite.missinglivingsacrifice", ritual.getInitiatingPlayerName(), world); + return RitualStep.Result.ABORTED_REFUND; + } + + ItemStack var19 = new ItemStack(Witchery.Items.SPECTRAL_STONE, 1, ItemSpectralStone.metaFromCreature(entityType, count)); + EntityItem var18 = new EntityItem(world, 0.5D + (double)posX, (double)posY + 1.5D, 0.5D + (double)posZ, var19); + var18.motionX = 0.0D; + var18.motionY = 0.3D; + var18.motionZ = 0.0D; + world.spawnEntityInWorld(var18); + ParticleEffect.SPELL.send(SoundEffect.RANDOM_FIZZ, var18, 0.5D, 0.5D, 16); + } + + return RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportEntity.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportEntity.java index 9cd6e58..433dd51 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportEntity.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportEntity.java @@ -1,70 +1,70 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockAreaMarker; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.brewing.potions.PotionEnderInhibition; -import com.emoniph.witchery.item.ItemGeneral; -import com.emoniph.witchery.item.ItemHunterClothes; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.ritual.rites.RiteTeleportation; -import com.emoniph.witchery.util.ChatUtil; -import com.emoniph.witchery.util.Config; -import java.util.Iterator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class RiteTeleportEntity extends RiteTeleportation { - - public RiteTeleportEntity(int radius) { - super(radius); - } - - protected boolean teleport(World world, int posX, int posY, int posZ, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(!world.isRemote) { - ItemStack taglockStack = null; - Iterator entity = ritual.sacrificedItems.iterator(); - - while(entity.hasNext()) { - RitualStep.SacrificedItem player = (RitualStep.SacrificedItem)entity.next(); - if(Witchery.Items.TAGLOCK_KIT == player.itemstack.getItem() && player.itemstack.getItemDamage() == 1) { - taglockStack = player.itemstack; - break; - } - } - - if(taglockStack != null) { - EntityLivingBase entity1 = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, taglockStack, Integer.valueOf(1)); - if(entity1 != null && entity1.dimension != Config.instance().dimensionDreamID && world.provider.dimensionId != Config.instance().dimensionDreamID) { - EntityPlayer player1 = ritual.getInitiatingPlayer(world); - boolean isImmune = ItemHunterClothes.isCurseProtectionActive(entity1); - if(!isImmune) { - isImmune = BlockAreaMarker.AreaMarkerRegistry.instance().isProtectionActive(entity1, this); - } - - if(!isImmune && !Witchery.Items.POPPET.voodooProtectionActivated(player1, (ItemStack)null, entity1, true, true) && !PotionEnderInhibition.isActive(entity1, 3)) { - ItemGeneral var10000 = Witchery.Items.GENERIC; - ItemGeneral.teleportToLocation(world, (double)posX, (double)posY, (double)posZ, world.provider.dimensionId, entity1, true); - return true; - } - - if(player1 != null) { - if(isImmune) { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player1, "witchery.rite.blackmagicdampening", new Object[0]); - } else { - ChatUtil.sendTranslated(EnumChatFormatting.RED, player1, "witchery.rite.voodooprotectionactivated", new Object[0]); - } - } - - return false; - } - } - } - - return false; - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockAreaMarker; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.brewing.potions.PotionEnderInhibition; +import com.emoniph.witchery.item.ItemGeneral; +import com.emoniph.witchery.item.ItemHunterClothes; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.ritual.rites.RiteTeleportation; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Config; +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteTeleportEntity extends RiteTeleportation { + + public RiteTeleportEntity(int radius) { + super(radius); + } + + protected boolean teleport(World world, int posX, int posY, int posZ, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(!world.isRemote) { + ItemStack taglockStack = null; + Iterator entity = ritual.sacrificedItems.iterator(); + + while(entity.hasNext()) { + RitualStep.SacrificedItem player = (RitualStep.SacrificedItem)entity.next(); + if(Witchery.Items.TAGLOCK_KIT == player.itemstack.getItem() && player.itemstack.getItemDamage() == 1) { + taglockStack = player.itemstack; + break; + } + } + + if(taglockStack != null) { + EntityLivingBase entity1 = Witchery.Items.TAGLOCK_KIT.getBoundEntity(world, (Entity)null, taglockStack, Integer.valueOf(1)); + if(entity1 != null && entity1.dimension != Config.instance().dimensionDreamID && world.provider.dimensionId != Config.instance().dimensionDreamID) { + EntityPlayer player1 = ritual.getInitiatingPlayer(world); + boolean isImmune = ItemHunterClothes.isCurseProtectionActive(entity1); + if(!isImmune) { + isImmune = BlockAreaMarker.AreaMarkerRegistry.instance().isProtectionActive(entity1, this); + } + + if(!isImmune && !Witchery.Items.POPPET.voodooProtectionActivated(player1, (ItemStack)null, entity1, true, true) && !PotionEnderInhibition.isActive(entity1, 3)) { + ItemGeneral var10000 = Witchery.Items.GENERIC; + ItemGeneral.teleportToLocation(world, (double)posX, (double)posY, (double)posZ, world.provider.dimensionId, entity1, true); + return true; + } + + if(player1 != null) { + if(isImmune) { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player1, "witchery.rite.blackmagicdampening", new Object[0]); + } else { + ChatUtil.sendTranslated(EnumChatFormatting.RED, player1, "witchery.rite.voodooprotectionactivated", new Object[0]); + } + } + + return false; + } + } + } + + return false; + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportToWaystone.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportToWaystone.java index d5270bf..c3c78f8 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportToWaystone.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportToWaystone.java @@ -1,54 +1,54 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.Witchery; -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.brewing.potions.PotionEnderInhibition; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.ritual.rites.RiteTeleportation; -import com.emoniph.witchery.util.Coord; -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteTeleportToWaystone extends RiteTeleportation { - - public RiteTeleportToWaystone(int radius) { - super(radius); - } - - protected boolean teleport(World world, int posX, int posY, int posZ, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(!world.isRemote) { - ItemStack waystoneStack = null; - Iterator bounds = ritual.sacrificedItems.iterator(); - - while(bounds.hasNext()) { - RitualStep.SacrificedItem list = (RitualStep.SacrificedItem)bounds.next(); - if(Witchery.Items.GENERIC.itemWaystoneBound.isMatch(list.itemstack) || Witchery.Items.GENERIC.itemWaystonePlayerBound.isMatch(list.itemstack)) { - waystoneStack = list.itemstack; - break; - } - } - - if(waystoneStack != null) { - AxisAlignedBB bounds1 = AxisAlignedBB.getBoundingBox((double)(posX - super.radius), (double)(posY - super.radius), (double)(posZ - super.radius), (double)(posX + super.radius), (double)(posY + super.radius), (double)(posZ + super.radius)); - List list1 = world.getEntitiesWithinAABB(Entity.class, bounds1); - boolean sent = false; - Iterator iterator = list1.iterator(); - - while(iterator.hasNext()) { - Entity entity = (Entity)iterator.next(); - if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)super.radius && !PotionEnderInhibition.isActive(entity, 1) && Witchery.Items.GENERIC.teleportToLocation(world, waystoneStack, entity, super.radius, true)) { - sent = true; - } - } - - return sent; - } - } - - return false; - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.brewing.potions.PotionEnderInhibition; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.ritual.rites.RiteTeleportation; +import com.emoniph.witchery.util.Coord; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteTeleportToWaystone extends RiteTeleportation { + + public RiteTeleportToWaystone(int radius) { + super(radius); + } + + protected boolean teleport(World world, int posX, int posY, int posZ, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(!world.isRemote) { + ItemStack waystoneStack = null; + Iterator bounds = ritual.sacrificedItems.iterator(); + + while(bounds.hasNext()) { + RitualStep.SacrificedItem list = (RitualStep.SacrificedItem)bounds.next(); + if(Witchery.Items.GENERIC.itemWaystoneBound.isMatch(list.itemstack) || Witchery.Items.GENERIC.itemWaystonePlayerBound.isMatch(list.itemstack)) { + waystoneStack = list.itemstack; + break; + } + } + + if(waystoneStack != null) { + AxisAlignedBB bounds1 = AxisAlignedBB.getBoundingBox((double)(posX - super.radius), (double)(posY - super.radius), (double)(posZ - super.radius), (double)(posX + super.radius), (double)(posY + super.radius), (double)(posZ + super.radius)); + List list1 = world.getEntitiesWithinAABB(Entity.class, bounds1); + boolean sent = false; + Iterator iterator = list1.iterator(); + + while(iterator.hasNext()) { + Entity entity = (Entity)iterator.next(); + if(Coord.distance(entity.posX, entity.posY, entity.posZ, (double)posX, (double)posY, (double)posZ) < (double)super.radius && !PotionEnderInhibition.isActive(entity, 1) && Witchery.Items.GENERIC.teleportToLocation(world, waystoneStack, entity, super.radius, true)) { + sent = true; + } + } + + return sent; + } + } + + return false; + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportation.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportation.java index 8e6bf22..7d89bbd 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportation.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTeleportation.java @@ -1,38 +1,38 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import java.util.ArrayList; -import net.minecraft.world.World; - -public abstract class RiteTeleportation extends Rite { - - protected final int radius; - - - public RiteTeleportation(int radius) { - this.radius = radius; - } - - public void addSteps(ArrayList steps, int intialStage) { - steps.add(new RiteTeleportation.StepTeleportation(this)); - } - - protected abstract boolean teleport(World var1, int var2, int var3, int var4, BlockCircle.TileEntityCircle.ActivatedRitual var5); - - private static class StepTeleportation extends RitualStep { - - private final RiteTeleportation rite; - - - public StepTeleportation(RiteTeleportation rite) { - super(false); - this.rite = rite; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - return ticks % 20L != 0L?RitualStep.Result.STARTING:(this.rite.teleport(world, posX, posY, posZ, ritual)?RitualStep.Result.COMPLETED:RitualStep.Result.ABORTED_REFUND); - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import java.util.ArrayList; +import net.minecraft.world.World; + +public abstract class RiteTeleportation extends Rite { + + protected final int radius; + + + public RiteTeleportation(int radius) { + this.radius = radius; + } + + public void addSteps(ArrayList steps, int intialStage) { + steps.add(new RiteTeleportation.StepTeleportation(this)); + } + + protected abstract boolean teleport(World var1, int var2, int var3, int var4, BlockCircle.TileEntityCircle.ActivatedRitual var5); + + private static class StepTeleportation extends RitualStep { + + private final RiteTeleportation rite; + + + public StepTeleportation(RiteTeleportation rite) { + super(false); + this.rite = rite; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + return ticks % 20L != 0L?RitualStep.Result.STARTING:(this.rite.teleport(world, posX, posY, posZ, ritual)?RitualStep.Result.COMPLETED:RitualStep.Result.ABORTED_REFUND); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeMobs.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeMobs.java index b317f00..8dde662 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeMobs.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeMobs.java @@ -1,83 +1,83 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import com.emoniph.witchery.util.ParticleEffect; -import com.emoniph.witchery.util.SoundEffect; -import java.util.ArrayList; -import java.util.Iterator; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class RiteTransposeMobs extends Rite { - - protected final int radius; - protected final int pulses; - protected final int minDistance; - - - public RiteTransposeMobs(int radius, int minDistance, int pulses) { - this.radius = radius; - this.pulses = pulses; - this.minDistance = minDistance; - } - - public void addSteps(ArrayList steps, int initialStep) { - steps.add(new RiteTransposeMobs.StepTeleportation(this, initialStep)); - } - - private static class StepTeleportation extends RitualStep { - - private final RiteTransposeMobs rite; - private int step; - - - public StepTeleportation(RiteTransposeMobs rite, int initialStep) { - super(false); - this.rite = rite; - this.step = initialStep; - } - - public int getCurrentStage() { - return this.step; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 20L != 0L) { - return RitualStep.Result.STARTING; - } else { - ++this.step; - int r = this.rite.radius; - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), 1.0D, (double)(posZ - r), (double)(posX + r), (double)(posY - 1), (double)(posZ + r)); - Iterator i$ = world.getEntitiesWithinAABB(EntityMob.class, bounds).iterator(); - - while(i$.hasNext()) { - Object obj = i$.next(); - EntityMob entity = (EntityMob)obj; - world.removeEntity(entity); - entity.isDead = false; - int activeRadius = this.rite.radius; - int ax = world.rand.nextInt(activeRadius * 2 + 1); - if(ax > activeRadius) { - ax += this.rite.minDistance * 2; - } - - int x = posX - this.rite.radius - this.rite.minDistance + ax; - int az = world.rand.nextInt(activeRadius * 2 + 1); - if(az > activeRadius) { - az += this.rite.minDistance * 2; - } - - int z = posZ - this.rite.radius - this.rite.minDistance + az; - entity.setLocationAndAngles((double)x, (double)posY, (double)z, 0.0F, 0.0F); - world.spawnEntityInWorld(entity); - ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, entity, 0.5D, 2.0D, 16); - } - - return this.step >= this.rite.pulses?RitualStep.Result.COMPLETED:RitualStep.Result.UPKEEP; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class RiteTransposeMobs extends Rite { + + protected final int radius; + protected final int pulses; + protected final int minDistance; + + + public RiteTransposeMobs(int radius, int minDistance, int pulses) { + this.radius = radius; + this.pulses = pulses; + this.minDistance = minDistance; + } + + public void addSteps(ArrayList steps, int initialStep) { + steps.add(new RiteTransposeMobs.StepTeleportation(this, initialStep)); + } + + private static class StepTeleportation extends RitualStep { + + private final RiteTransposeMobs rite; + private int step; + + + public StepTeleportation(RiteTransposeMobs rite, int initialStep) { + super(false); + this.rite = rite; + this.step = initialStep; + } + + public int getCurrentStage() { + return this.step; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } else { + ++this.step; + int r = this.rite.radius; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(posX - r), 1.0D, (double)(posZ - r), (double)(posX + r), (double)(posY - 1), (double)(posZ + r)); + Iterator i$ = world.getEntitiesWithinAABB(EntityMob.class, bounds).iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + EntityMob entity = (EntityMob)obj; + world.removeEntity(entity); + entity.isDead = false; + int activeRadius = this.rite.radius; + int ax = world.rand.nextInt(activeRadius * 2 + 1); + if(ax > activeRadius) { + ax += this.rite.minDistance * 2; + } + + int x = posX - this.rite.radius - this.rite.minDistance + ax; + int az = world.rand.nextInt(activeRadius * 2 + 1); + if(az > activeRadius) { + az += this.rite.minDistance * 2; + } + + int z = posZ - this.rite.radius - this.rite.minDistance + az; + entity.setLocationAndAngles((double)x, (double)posY, (double)z, 0.0F, 0.0F); + world.spawnEntityInWorld(entity); + ParticleEffect.PORTAL.send(SoundEffect.RANDOM_FIZZ, entity, 0.5D, 2.0D, 16); + } + + return this.step >= this.rite.pulses?RitualStep.Result.COMPLETED:RitualStep.Result.UPKEEP; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeOres.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeOres.java index 59579ab..3f2a0c8 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeOres.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteTransposeOres.java @@ -1,75 +1,75 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class RiteTransposeOres extends Rite { - - protected final int radius; - protected final int pulses; - protected final Block[] blocks; - - - public RiteTransposeOres(int radius, int pulses, Block[] blocks) { - this.radius = radius; - this.pulses = pulses; - this.blocks = blocks; - } - - public void addSteps(ArrayList steps, int initialStep) { - steps.add(new RiteTransposeOres.StepTeleportation(this, initialStep)); - } - - private static class StepTeleportation extends RitualStep { - - private final RiteTransposeOres rite; - private int step; - - - public StepTeleportation(RiteTransposeOres rite, int initialStep) { - super(false); - this.rite = rite; - this.step = initialStep; - } - - public int getCurrentStage() { - return this.step; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 10L != 0L) { - return RitualStep.Result.STARTING; - } else { - ++this.step; - int r = this.rite.radius; - int y = posY - this.step; - int blockTypes = ritual.covenSize == 6?2:1; - - for(int x = posX - r; x <= posX + r; ++x) { - for(int z = posZ - r; z <= posZ + r; ++z) { - Block blockID = world.getBlock(x, y, z); - - for(int t = 0; t < blockTypes; ++t) { - if(blockID == this.rite.blocks[t]) { - ItemStack stack = new ItemStack(this.rite.blocks[t]); - EntityItem entity = new EntityItem(world, (double)(posX - r + world.rand.nextInt(2 * r + 1)), (double)(posY + 2), (double)(posZ - r + world.rand.nextInt(2 * r + 1)), stack); - if(!world.isRemote) { - world.setBlockToAir(x, y, z); - world.spawnEntityInWorld(entity); - } - } - } - } - } - - return this.step < this.rite.pulses + 5 * ritual.covenSize && y > 2?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; - } - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import java.util.ArrayList; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RiteTransposeOres extends Rite { + + protected final int radius; + protected final int pulses; + protected final Block[] blocks; + + + public RiteTransposeOres(int radius, int pulses, Block[] blocks) { + this.radius = radius; + this.pulses = pulses; + this.blocks = blocks; + } + + public void addSteps(ArrayList steps, int initialStep) { + steps.add(new RiteTransposeOres.StepTeleportation(this, initialStep)); + } + + private static class StepTeleportation extends RitualStep { + + private final RiteTransposeOres rite; + private int step; + + + public StepTeleportation(RiteTransposeOres rite, int initialStep) { + super(false); + this.rite = rite; + this.step = initialStep; + } + + public int getCurrentStage() { + return this.step; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 10L != 0L) { + return RitualStep.Result.STARTING; + } else { + ++this.step; + int r = this.rite.radius; + int y = posY - this.step; + int blockTypes = ritual.covenSize == 6?2:1; + + for(int x = posX - r; x <= posX + r; ++x) { + for(int z = posZ - r; z <= posZ + r; ++z) { + Block blockID = world.getBlock(x, y, z); + + for(int t = 0; t < blockTypes; ++t) { + if(blockID == this.rite.blocks[t]) { + ItemStack stack = new ItemStack(this.rite.blocks[t]); + EntityItem entity = new EntityItem(world, (double)(posX - r + world.rand.nextInt(2 * r + 1)), (double)(posY + 2), (double)(posZ - r + world.rand.nextInt(2 * r + 1)), stack); + if(!world.isRemote) { + world.setBlockToAir(x, y, z); + world.spawnEntityInWorld(entity); + } + } + } + } + } + + return this.step < this.rite.pulses + 5 * ritual.covenSize && y > 2?RitualStep.Result.UPKEEP:RitualStep.Result.COMPLETED; + } + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteUnbreakableVow.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteUnbreakableVow.java new file mode 100644 index 0000000..e9d7276 --- /dev/null +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteUnbreakableVow.java @@ -0,0 +1,80 @@ +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import com.emoniph.witchery.util.ChatUtil; +import com.emoniph.witchery.util.Coord; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.emoniph.witchery.util.TimeUtil; +import java.util.Iterator; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.player.EntityPlayer; +import com.emoniph.witchery.common.ExtendedPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class RiteUnbreakableVow extends Rite { + @Override + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new StepRiteUnbreakableVow(this, initialStage)); + } + + private static class StepRiteUnbreakableVow extends RitualStep { + private final RiteUnbreakableVow rite; + + public StepRiteUnbreakableVow(RiteUnbreakableVow rite, int initialStage) { + super(false); + this.rite = rite; + } + + @Override + public RitualStep.Result process(World world, int x, int y, int z, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual circleType) { + if (ticks % 20L != 0L) { + return RitualStep.Result.STARTING; + } + if (!world.isRemote) { + boolean blessed = false; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox((double)(x - 6), (double)(y - 2), (double)(z - 6), (double)(x + 6), (double)(y + 4), (double)(z + 6)); + List players = world.getEntitiesWithinAABB(EntityPlayer.class, bounds); + ArrayList validPlayers = new ArrayList(); + + Iterator i$ = players.iterator(); + while (i$.hasNext()) { + EntityPlayer player = (EntityPlayer)i$.next(); + if (Coord.distance(player.posX, player.posY, player.posZ, (double)x + 0.5D, (double)y, (double)z + 0.5D) <= 6.0D) { + validPlayers.add(player); + } + } + + if (validPlayers.size() > 1) { + String vowID = UUID.randomUUID().toString(); + for (EntityPlayer p : validPlayers) { + ExtendedPlayer.get(p).setUnbreakableVowID(vowID); + ChatUtil.sendTranslated(EnumChatFormatting.LIGHT_PURPLE, p, "Your soul has been bound by the Unbreakable Vow.", new Object[0]); + } + blessed = true; + } else if (validPlayers.size() == 1) { + ExtendedPlayer playerEx = ExtendedPlayer.get(validPlayers.get(0)); + if (!playerEx.getUnbreakableVowID().isEmpty()) { + playerEx.setUnbreakableVowID(""); + ChatUtil.sendTranslated(EnumChatFormatting.DARK_PURPLE, validPlayers.get(0), "Your soul has been freed from the Unbreakable Vow.", new Object[0]); + blessed = true; + } + } + + if (!blessed) { + return RitualStep.Result.ABORTED_REFUND; + } + ParticleEffect.INSTANT_SPELL.send(SoundEffect.RANDOM_LEVELUP, world, 0.5D + (double)x, (double)y + 1.0D, 0.5D + (double)z, 2.0D, 2.0D, 24); + } + return RitualStep.Result.COMPLETED; + } + } +} diff --git a/src/main/java/com/emoniph/witchery/ritual/rites/RiteWeatherCallStorm.java b/src/main/java/com/emoniph/witchery/ritual/rites/RiteWeatherCallStorm.java index 7957243..6eb1143 100644 --- a/src/main/java/com/emoniph/witchery/ritual/rites/RiteWeatherCallStorm.java +++ b/src/main/java/com/emoniph/witchery/ritual/rites/RiteWeatherCallStorm.java @@ -1,106 +1,106 @@ -package com.emoniph.witchery.ritual.rites; - -import com.emoniph.witchery.blocks.BlockCircle; -import com.emoniph.witchery.ritual.Rite; -import com.emoniph.witchery.ritual.RitualStep; -import java.util.ArrayList; -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraft.world.storage.WorldInfo; - -public class RiteWeatherCallStorm extends Rite { - - private final int minRadius; - private final int maxRadius; - private final int bolts; - - - public RiteWeatherCallStorm(int minRadius, int maxRadius, int bolts) { - this.minRadius = minRadius; - this.maxRadius = maxRadius; - this.bolts = bolts; - } - - public void addSteps(ArrayList steps, int initialStage) { - steps.add(new RiteWeatherCallStorm.StepWeatherCallStorm(this, initialStage)); - } - - private static class StepWeatherCallStorm extends RitualStep { - - private final RiteWeatherCallStorm rite; - private int stage; - - - public StepWeatherCallStorm(RiteWeatherCallStorm rite, int initialStage) { - super(true); - this.rite = rite; - this.stage = initialStage; - } - - public int getCurrentStage() { - return this.stage; - } - - public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { - if(ticks % 30L != 0L) { - return RitualStep.Result.STARTING; - } else { - if(!world.isRemote) { - ++this.stage; - switch(this.stage) { - case 1: - this.spawnBolt(world, posX, posY, posZ); - break; - case 2: - this.spawnBolt(world, posX, posY, posZ); - break; - case 3: - this.spawnBolt(world, posX, posY, posZ); - this.spawnBolt(world, posX, posY, posZ); - break; - case 4: - if(world instanceof WorldServer && !world.isThundering()) { - WorldInfo i = ((WorldServer)world).getWorldInfo(); - int i1 = (300 + world.rand.nextInt(600)) * 20; - i.setRainTime(i1); - i.setThunderTime(i1); - i.setRaining(true); - i.setThundering(true); - } - - this.spawnBolt(world, posX, posY, posZ); - break; - default: - for(int var10 = 0; var10 < world.rand.nextInt(4); ++var10) { - this.spawnBolt(world, posX, posY, posZ); - if(var10 > 0) { - ++this.stage; - } - } - } - } - - return this.stage < this.rite.bolts?RitualStep.Result.STARTING:RitualStep.Result.COMPLETED; - } - } - - private void spawnBolt(World world, int posX, int posY, int posZ) { - int activeRadius = this.rite.maxRadius - this.rite.minRadius; - int ax = world.rand.nextInt(activeRadius * 2 + 1); - if(ax > activeRadius) { - ax += this.rite.minRadius * 2; - } - - int x = posX - this.rite.maxRadius + ax; - int az = world.rand.nextInt(activeRadius * 2 + 1); - if(az > activeRadius) { - az += this.rite.minRadius * 2; - } - - int z = posZ - this.rite.maxRadius + az; - EntityLightningBolt bolt = new EntityLightningBolt(world, (double)x, (double)posY, (double)z); - world.addWeatherEffect(bolt); - } - } -} +package com.emoniph.witchery.ritual.rites; + +import com.emoniph.witchery.blocks.BlockCircle; +import com.emoniph.witchery.ritual.Rite; +import com.emoniph.witchery.ritual.RitualStep; +import java.util.ArrayList; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.WorldInfo; + +public class RiteWeatherCallStorm extends Rite { + + private final int minRadius; + private final int maxRadius; + private final int bolts; + + + public RiteWeatherCallStorm(int minRadius, int maxRadius, int bolts) { + this.minRadius = minRadius; + this.maxRadius = maxRadius; + this.bolts = bolts; + } + + public void addSteps(ArrayList steps, int initialStage) { + steps.add(new RiteWeatherCallStorm.StepWeatherCallStorm(this, initialStage)); + } + + private static class StepWeatherCallStorm extends RitualStep { + + private final RiteWeatherCallStorm rite; + private int stage; + + + public StepWeatherCallStorm(RiteWeatherCallStorm rite, int initialStage) { + super(true); + this.rite = rite; + this.stage = initialStage; + } + + public int getCurrentStage() { + return this.stage; + } + + public RitualStep.Result process(World world, int posX, int posY, int posZ, long ticks, BlockCircle.TileEntityCircle.ActivatedRitual ritual) { + if(ticks % 30L != 0L) { + return RitualStep.Result.STARTING; + } else { + if(!world.isRemote) { + ++this.stage; + switch(this.stage) { + case 1: + this.spawnBolt(world, posX, posY, posZ); + break; + case 2: + this.spawnBolt(world, posX, posY, posZ); + break; + case 3: + this.spawnBolt(world, posX, posY, posZ); + this.spawnBolt(world, posX, posY, posZ); + break; + case 4: + if(world instanceof WorldServer && !world.isThundering()) { + WorldInfo i = ((WorldServer)world).getWorldInfo(); + int i1 = (300 + world.rand.nextInt(600)) * 20; + i.setRainTime(i1); + i.setThunderTime(i1); + i.setRaining(true); + i.setThundering(true); + } + + this.spawnBolt(world, posX, posY, posZ); + break; + default: + for(int var10 = 0; var10 < world.rand.nextInt(4); ++var10) { + this.spawnBolt(world, posX, posY, posZ); + if(var10 > 0) { + ++this.stage; + } + } + } + } + + return this.stage < this.rite.bolts?RitualStep.Result.STARTING:RitualStep.Result.COMPLETED; + } + } + + private void spawnBolt(World world, int posX, int posY, int posZ) { + int activeRadius = this.rite.maxRadius - this.rite.minRadius; + int ax = world.rand.nextInt(activeRadius * 2 + 1); + if(ax > activeRadius) { + ax += this.rite.minRadius * 2; + } + + int x = posX - this.rite.maxRadius + ax; + int az = world.rand.nextInt(activeRadius * 2 + 1); + if(az > activeRadius) { + az += this.rite.minRadius * 2; + } + + int z = posZ - this.rite.maxRadius + az; + EntityLightningBolt bolt = new EntityLightningBolt(world, (double)x, (double)posY, (double)z); + world.addWeatherEffect(bolt); + } + } +} diff --git a/src/main/java/com/emoniph/witchery/util/TransformCreature.java b/src/main/java/com/emoniph/witchery/util/TransformCreature.java index 7788c6b..daf4463 100644 --- a/src/main/java/com/emoniph/witchery/util/TransformCreature.java +++ b/src/main/java/com/emoniph/witchery/util/TransformCreature.java @@ -8,9 +8,10 @@ public enum TransformCreature { WOLFMAN("WOLFMAN", 2), BAT("BAT", 3), PLAYER("PLAYER", 4), - TOAD("TOAD", 5); + TOAD("TOAD", 5), + SPIRIT("SPIRIT", 6); // $FF: synthetic field - private static final TransformCreature[] $VALUES = new TransformCreature[]{NONE, WOLF, WOLFMAN, BAT, PLAYER, TOAD}; + private static final TransformCreature[] $VALUES = new TransformCreature[]{NONE, WOLF, WOLFMAN, BAT, PLAYER, TOAD, SPIRIT}; private TransformCreature(String var1, int var2) {} diff --git a/src/main/resources/assets/witchery/lang/en_US.lang b/src/main/resources/assets/witchery/lang/en_US.lang index af6d92e..f9bf30f 100644 --- a/src/main/resources/assets/witchery/lang/en_US.lang +++ b/src/main/resources/assets/witchery/lang/en_US.lang @@ -1,1685 +1,1922 @@ -itemGroup.tabWitchery=Witchery - -item.witchery:ingredient.candelabra.name=Candelabra -item.witchery:ingredient.chalice.name=Chalice -item.witchery:ingredient.chaliceFull.name=Chalice (Filled) -item.witchery:ingredient.weaveMoveFast.name=Dream Weaver of Fleet Foot -item.witchery:ingredient.weaveDigFast.name=Dream Weaver of Iron Arm -item.witchery:ingredient.weaveSaturation.name=Dream Weaver of Fasting -item.witchery:ingredient.weaveNightmares.name=Dream Weaver of Nightmares -item.witchery:ingredient.boneNeedle.name=Bone Needle -item.witchery:ingredient.broom.name=Broom -item.witchery:ingredient.broomEnchanted.name=Enchanted Broom -item.witchery:ingredient.attunedStone.name=Attuned Stone -item.witchery:ingredient.attunedStoneCharged.name=Attuned Stone (Charged) -item.witchery:ingredient.waystone.name=Waystone -item.witchery:ingredient.waystoneBound.name=Bound Waystone -item.witchery:ingredient.mutandis.name=Mutandis -item.witchery:ingredient.mutandisExtremis.name=Mutandis Extremis -item.witchery:ingredient.quicklime.name=Quicklime -item.witchery:ingredient.gypsum.name=Gypsum -item.witchery:ingredient.ashWood.name=Wood Ash -item.witchery:ingredient.seedsBelladonna.name=Stale Belladonna Seeds -item.witchery:ingredient.seedsMandrake.name=Stale Mandrake Seeds -item.witchery:ingredient.belladonna.name=Belladonna Flower -item.witchery:ingredient.mandrakeRoot.name=Mandrake Root -item.witchery:ingredient.demonHeart.name=Demon Heart -item.witchery:ingredient.batWool.name=Wool of Bat -item.witchery:ingredient.dogTongue.name=Tongue of Dog -item.witchery:ingredient.clayJarSoft.name=Soft Clay Jar -item.witchery:ingredient.clayJar.name=Clay Jar -item.witchery:ingredient.foulFume.name=Foul Fume -item.witchery:ingredient.diamondVapour.name=Diamond Vapor -item.witchery:ingredient.oilOfVitriol.name=Oil of Vitriol -item.witchery:ingredient.exhaleOfTheHornedOne.name=Exhale of the Horned One -item.witchery:ingredient.breathOfTheGoddess.name=Breath of the Goddess -item.witchery:ingredient.hintOfRebirth.name=Hint of Rebirth -item.witchery:ingredient.whiffOfMagic.name=Whiff of Magic -item.witchery:ingredient.reekOfMisfortune.name=Reek of Misfortune -item.witchery:ingredient.odourOfPurity.name=Odour of Purity -item.witchery:ingredient.tearOfTheGoddess.name=Tear of the Goddess -item.witchery:ingredient.refinedEvil.name=Refined Evil -item.witchery:ingredient.dropOfLuck.name=Drop of Luck -item.witchery:ingredient.redstoneSoup.name=Redstone Soup -item.witchery:ingredient.flyingOintment.name=Flying Ointment -item.witchery:ingredient.ghostOfTheLight.name=Ghost of the Light -item.witchery:ingredient.soulOfTheWorld.name=Soul of the World -item.witchery:ingredient.spiritOfOtherwhere.name=Spirit of Otherwhere -item.witchery:ingredient.infernalAnimus.name=Infernal Animus -item.witchery:ingredient.bookOven.name=Witchcraft: Collecting Fumes -item.witchery:ingredient.bookDistilling.name=Witchcraft: Distilling -item.witchery:ingredient.bookCircleMagic.name=Witchcraft: Circle Magic -item.witchery:ingredient.bookInfusions.name=Witchcraft: Brews & Infusions -item.witchery:ingredient.oddPorkchopRaw.name=Raw Porkchop? -item.witchery:ingredient.oddPorkchopCooked.name=Cooked Porkchop? -item.witchery:ingredient.doorRowan.name=Rowan Wood Door -item.witchery:ingredient.doorAlder.name=Alder Wood Door -item.witchery:ingredient.doorKey.name=Rowan Door Key -item.witchery:ingredient.rock.name=Rock -item.witchery:ingredient.web.name=Dense Web -item.witchery:ingredient.brewVines.name=Brew of Vines -item.witchery:ingredient.brewWeb.name=Brew of Webs -item.witchery:ingredient.brewThorns.name=Brew of Thorns -item.witchery:ingredient.brewInk.name=Brew of Ink -item.witchery:ingredient.brewSprouting.name=Brew of Sprouting -item.witchery:ingredient.brewErosion.name=Brew of Erosion -item.witchery:ingredient.berriesRowan.name=Rowan Berries -item.witchery:ingredient.necroStone.name=Necromantic Stone -item.witchery:ingredient.brewRaising.name=Brew of Raising -item.witchery:ingredient.spectralDust.name=Spectral Dust -item.witchery:ingredient.enderDew.name=Ender Dew -item.witchery:ingredient.seedsArtichoke.name=Stale Water Artichoke Seeds -item.witchery:ingredient.artichoke.name=Water Artichoke Globe -item.witchery:ingredient.seedsTreefyd.name=Treefyd Seed -item.witchery:ingredient.brewGrotesque.name=Brew of the Grotesque -item.witchery:ingredient.fumeFilter.name=Fume Filter -item.witchery:ingredient.impregnatedLeather.name=Impregnated Leather -item.witchery:arthana.name=Arthana -item.witchery:witchhand.name=Witches Hand -item.witchery:taglockkit.name=Taglock Kit -item.witchery:poppet.name=Poppet -item.witchery:poppet.protectEarth.name=Earth Protection Poppet -item.witchery:poppet.protectWater.name=Water Protection Poppet -item.witchery:poppet.protectStarvation.name=Hunger Protection Poppet -item.witchery:poppet.protectFire.name=Fire Protection Poppet -item.witchery:poppet.protectTool.name=Tool Protection Poppet -item.witchery:poppet.protectDeath.name=Death Protection Poppet -item.witchery:poppet.protectVoodoo.name=Voodoo Protection Poppet -item.witchery:poppet.voodoo.name=Voodoo Poppet -item.witchery:poppet.vampiric.name=Vampiric Poppet -item.witchery:circletalisman.name=Circle Talisman -item.witchery:divinerwater.name=Water Diviner -item.witchery:divinerlava.name=Lava Diviner -item.witchery:chalkheart.name=Golden Chalk -item.witchery:chalkritual.name=Ritual Chalk -item.witchery:chalkotherwhere.name=Otherwhere Chalk -item.witchery:chalkinfernal.name=Infernal Chalk -item.witchery:polynesiacharm.name=Polynesia Charm -item.witchery:polynesiacharm.tip=He talks to the animals... -item.witchery:devilstonguecharm.name=Devils Tongue Charm -item.witchery:devilstonguecharm.tip=Even demons find your wit|irresistible... most of the time. -item.witchery:witchhat.name=Witches' Hat -item.witchery:witchhat.tip=How original... a pointy hat.||{9+35% chance of second brew{0 -item.witchery:seedsbelladonna.name=Belladonna Seeds -item.witchery:seedsmandrake.name=Mandrake Seeds -item.witchery:seedsartichoke.name=Water Artichoke Seeds - -circletalisman.small.1=Small Ritual -circletalisman.small.2=Small Otherwhere -circletalisman.small.3=Small Infernal -circletalisman.medium.1=Medium Ritual -circletalisman.medium.2=Medium Otherwhere -circletalisman.medium.3=Medium Infernal -circletalisman.large.1=Large Ritual -circletalisman.large.2=Large Otherwhere -circletalisman.large.3=Large Infernal - -tile.witchery:rowanwooddoor.name=Rowan Wood Door -tile.witchery:alderwooddoor.name=Alder Wood Door -tile.witchery:rowandoorwood.name=Rowan Wood Door -tile.witchery:alderdoorwood.name=Alder Wood Door -tile.witchery:altar.name=Altar -tile.witchery:witchesovenidle.name=Witches Oven -tile.witchery:witchesovenburning.name=Witches Oven -tile.witchery:distilleryidle.name=Distillery -tile.witchery:distilleryburning.name=Distillery -tile.witchery:kettle.name=Kettle -tile.witchery:poppetshelf.name=Poppet Shelf -container.witchery:poppetshelf=Poppet Shelf -tile.witchery:witchlog.rowan.name=Rowan Wood -tile.witchery:witchlog.alder.name=Alder Wood -tile.witchery:witchlog.hawthorn.name=Hawthorn Wood -tile.witchery:witchwood.rowan.name=Rowan Planks -tile.witchery:witchwood.alder.name=Alder Planks -tile.witchery:witchwood.hawthorn.name=Hawthorn Planks -tile.witchery:witchsapling.rowan.name=Rowan Sapling -tile.witchery:witchsapling.alder.name=Alder Sapling -tile.witchery:witchsapling.hawthorn.name=Hawthorn Sapling -tile.witchery:witchleaves.rowan.name=Rowan Leaves -tile.witchery:witchleaves.alder.name=Alder Leaves -tile.witchery:witchleaves.hawthorn.name=Hawthorn Leaves -tile.witchery:belladonna.name=Belladonna -tile.witchery:mandrake.name=Mandrake -tile.witchery:barrier.name=Barrier -tile.witchery:dreamcatcher.name=Dream Weaver -tile.witchery:candelabra.name=Candelabra -tile.witchery:chalice.name=Chalice -tile.witchery:circle.name=Heart Glyph -tile.witchery:circleglyphritual.name=Ritual Glyph -tile.witchery:circleglyphotherwhere.name=Otherwhere Glyph -tile.witchery:circleglyphinfernal.name=Infernal Glyph -tile.witchery:stairswoodrowan.name=Rowan Stairs -tile.witchery:stairswoodalder.name=Alder Stairs -tile.witchery:stairswoodhawthorn.name=Hawthorn Stairs -tile.witchery:witchwoodslab.name=Wood Slab -tile.witchery:witchwoodslab.rowan.name=Rowan Slab -tile.witchery:witchwoodslab.alder.name=Alder Slab -tile.witchery:witchwoodslab.hawthorn.name=Hawthorn Slab -tile.witchery:witchwooddoubleslab.name=Wood Double Slab -tile.witchery:spanishmoss.name=Spanish Moss -tile.witchery:leapinglily.name=Leaping Lily -tile.witchery:plantmine.rose_webs.name=Poppy of Webs -tile.witchery:plantmine.rose_ink.name=Poppy of Ink -tile.witchery:plantmine.rose_sprouting.name=Poppy of Sprouting -tile.witchery:plantmine.rose_thorns.name=Poppy of Thorns -tile.witchery:plantmine.dandelion_webs.name=Dandelion of Webs -tile.witchery:plantmine.dandelion_ink.name=Dandelion of Ink -tile.witchery:plantmine.dandelion_sprouting.name=Dandelion of Sprouting -tile.witchery:plantmine.dandelion_thorns.name=Dandelion of Thorns -tile.witchery:plantmine.grass_webs.name=Shrub of Webs -tile.witchery:plantmine.grass_ink.name=Shrub of Ink -tile.witchery:plantmine.grass_sprouting.name=Shrub of Sprouting -tile.witchery:plantmine.grass_thorns.name=Shrub of Thorns -tile.witchery:embermoss.name=Ember Moss -tile.witchery:artichoke.name=Water Artichoke -tile.witchery:alluringskull.name=Alluring Skull -tile.witchery:fumefunnel.name=Fume Funnel -tile.witchery:filteredfumefunnel.name=Filtered Fume Funnel - -entity.witchery.demon.name=Demon -entity.demon.name=Demon -entity.witchery.broom.name=Enchanted Broom -entity.broom.name=Enchanted Broom -entity.witchery.familiar.name=Spectral Familiar -entity.familiar.name=Spectral Familiar -entity.witchery.mandrake.name=Mandrake -entity.mandrake.name=Mandrake -entity.witchery.treefyd.name=Treefyd -entity.treefyd.name=Treefyd - -witchery.book.mushroomred=Red Mushroom -witchery.book.mushroombrown=Brown Mushroom -witchery.book.altarpower=Altar power -witchery.book.oven1={o{lWitchcraft{r{r{o: Collecting Fumes{r||The witches oven gives a practitioner of the art, the opportunity to collect the fumes that may be produced when cooking.||Remember that the oven cannot smelt ore, but it does cook a little faster than a furnace. -witchery.book.oven2=Place {8Clay Jars{0 into the oven when cooking to collect the fumes:||Food {6Foul Fume{0|Wood {6Foul Fume{0||Cooking {2Saplings{0 produces {8Wood Ash{0 and may also release the gaseous essence of the tree. -witchery.book.oven3={nSapling Fumes{r||Oak {8Exhale of the Horned One{0|Birch {8Breath of the Goddess{0|Spruce {8Hint of Rebirth{0|Rowan {8Whiff of Magic{0|Hawthorn {8Odour of Purity{0|Alder {8Reek of Misfortune{0 -witchery.book.distillery1={o{lWitchcraft{r{r{o: Distilling{r||{81.{0 Ensure the distillery is near to an Altar to get power.|{82.{0 Place the items into the distillery along with the required number of clay jars.|{83.{0 Wait for the distillation process to complete. -witchery.book.distillery.jars=Clay Jars -witchery.book.distillery.items={nDistill these items{r -witchery.book.distillery.results={nResultant distillates{r -witchery.book.brews1={o{lWitchcraft{r{r{o: Brews & Infusions{r||{81.{0 Throw the ingredients into a heated, water-filled kettle. Altars provide power, if needed.|{82.{0 Fill the brew into an empty glass bottle.|{83.{0 Use infusions in a Rite of Infusion; but remember, {0Death is almost always assured{0. -witchery.book.rites1={o{lWitchcraft{r{r{o: Circle Magic{r||{81.{0 Draw circles using colored chalk, with a heart glyph at the centre. An altar is often needed for power.|{82.{0 Drop the foci items into the circle.|{83.{0 Activate the heart glyph. -witchery.book.rites2=Chalk & sizes:|7x7, 11x11, 15x15|{7Ritual{0, {5Otherwhere{0, {4Infernal{0 -witchery.book.rites.anycircle=Any circles allowed - -witchery.rite.bindcircle=Rite of Binding{r||Pulls the circles into the talisman. -witchery.rite.bindcircleportable=Rite of Binding{r||Pulls the circles into the talisman. -witchery.rite.bindwaystone=Rite of Binding{r||Binds the Waystone to the location of the ritual. -witchery.rite.chargestone=Rite of Charging{r||Charges the Attuned Stone. -witchery.rite.infusionrecharge=Rite of Charging{r||Recharge infused power by standing in the circle. Lasts indefinitely, but requires 40 power/s. -witchery.rite.teleporttowaystone=Rite of Transposition{r||Teleport to the bound Waystone's location. -witchery.rite.teleportentity=Rite of Transposition{r||Summon the taglock kit's bound creature or player. -witchery.rite.teleportironore=Rite of Transposition{r||Transpose iron from the ore below. -witchery.rite.protection=Rite of Sanctity{r||Monsters cannot enter the circle. Lasts indefinitely, but requires 16 power/s. -witchery.rite.imprisonment=Rite of Imprisonment{r||Monsters cannot leave the circle. Lasts indefinitely, but requires 16 power/s. -witchery.rite.barrier=Rite of Protection{r||Conjure a dome, impenetrable to monsters. Lasts indefinitely, but requires 24 power/s. -witchery.rite.barrierlarge=Rite of Protection{r||Conjure a dome, impenetrable to all. Lasts indefinitely, but requires 28 power/s. -witchery.rite.barrierportable=Rite of Protection{r||Conjure an impenetrable dome for 60 seconds. -witchery.rite.volcano=Rite of Earth's Wrath{r||Raise a volcano. A lava pool must lie below. -witchery.rite.storm=Rite of Sky's Wrath{r||Call a focused lightning storm inside the circle. -witchery.rite.stormlarge=Rite of Sky's Wrath{r||Call a focused lightning storm outside the circle. -witchery.rite.stormportable=Rite of Sky's Wrath{r||Call a focused lightnig storm outside the circle. -witchery.rite.eclipse=Rite of Total Eclipse{r||Block out the sun. -witchery.rite.eclipseportable=Rite of Total Eclipse{r||Block out the sun. -witchery.rite.partearth=Rite of Broken Earth{r||Part the earth, the position of the foci controls the direction. -witchery.rite.raiseearth=Rite of Moving Earth{r||Raise a column of earth. -witchery.rite.banishdemonportable=Rite of Banishing{r||Send nearby Demons back to the Pit. -witchery.rite.banishdemon=Rite of Banishing{r||Send nearby Demons back to the Pit. -witchery.rite.summondemon=Rite of Summoning{r||Call forth a Demon. The inner area must be clear 7x7x4 blocks! -witchery.rite.summondemonexpensive=Rite of Summoning{r||Call forth a Demon. The inner area must be clear 7x7x4 blocks! -witchery.rite.summonwither=Rite of Summoning{r||Call forth a Wither. The inner area must be clear 7x7x4 blocks! -witchery.rite.summonwitherexpensive=Rite of Summoning{r||Call forth a Wither. The inner area must be clear 7x7x4 blocks! -witchery.rite.infusionlight=Rite of Infusion{r||You must stand in the circle. -witchery.rite.infusionearth=Rite of Infusion{r||You must stand in the circle. -witchery.rite.infusionender=Rite of Infusion{r||You must stand in the circle. -witchery.rite.infusionhell=Rite of Infusion{r||You must stand in the circle. -witchery.rite.infusionsky=Rite of Infusion{r||Perform at night. -witchery.rite.necrostone=Rite of Necromancy{r||Creates a Necromantic Stone. Perform at night. -witchery.rite.summonfamiliar=Rite of Summoning{r||Summons a familiar to find things. Try giving the familiar a diamond! The inner area must be clear 7x7x4 blocks! -witchery.rite.bindwaystonecopy=Rite of Binding{r||Binds the Waystone location on one waystone to another waystone. -witchery.rite.fertility=Rite of Fertility{r||Makes nearby land fertile. Heals sick villagers. -witchery.rite.fertilityportable=Rite of Fertility{r||Makes nearby land fertile. Heals sick villagers. -witchery.rite.curseblight=Curse of Blight{r||Makes nearby land infertile and causes sickness. -witchery.rite.curseblindness=Curse of Blindness{r||Makes nearby creatures blind. -witchery.rite.hellonearth=Curse of Hell on Earth{r||Only works in the Overworld at night, requires 200 power/s. -witchery.rite.summonwitch=Rite of Summoning{r||Summon a witch. The inner area must be clear 7x7x4 blocks! -witchery.rite.bindwaystoneportable=Rite of Binding{r||Binds the Waystone to the location of the ritual. -witchery.rite.bindwaystonecopyportable=Rite of Binding{r||Binds the Waystone location on one waystone to another waystone. - -witchery.infuse.cansetrecall=Release mouse button to set Recall Point. -witchery.infuse.setrecall=- Recall Point set to %s (%s, %s, %s). -witchery.infuse.canteleport=Teleport charged, release mouse button to teleport. -witchery.infuse.cannotteleport=Too far, hold mouse button longer to teleport further! - -witchery.familiar.foundsomething=OINK! %s, %s, %s. - -witchery.rite.nullfield=Ritual cannot begin, circle magic is being nullified in this area. -tile.witchery:voidbramble.name=Void Bramble - -witchery.rite.naturespower=Rite of Nature's Power{r||Release nature on a barren area. - -item.witchery:witchrobe.name=Witches Robes -item.witchery:witchrobe.tip=For the discerning witch about town.||{5Creepers will ignore the wearer.{0||{9+35% chance of second brew (except necromantic){0 - -item.witchery:necromancerrobe.name=Necromancer Robes -item.witchery:necromancerrobe.tip=Keeps the undead at bay.||{5Undead will generally ignore the wearer.{0||{9+35% chance of second necromantic brew{0 - -item.witchery:ingredient.creeperHeart.name=Creeper Heart -tile.witchery:glintweed.name=Glint Weed -item.witchery:ingredient.brewLove.name=Brew of Love - -witchery.rite.priorincarnation=Rite of Prior Incarnation{r||Summon a prior incarnation of a player (and their items) near to where they died. - -witchery.structure.apothecary.name=Apothecary - -witchery.rite.disabled=Ritual cannot begin, the rite has been disabled on this server. -witchery.rite.unknownritual=Unknown rite. -witchery.rite.missingitem=Missing foci item. -witchery.rite.missinglivingsacrifice=Missing creature sacrifice. -witchery.rite.missingpowersource=No altar nearby. -witchery.rite.insufficientpower=Altar has insufficient power. -witchery.rite.missinglava=No lava below. - -item.witchery:ingredient.brewIce.name=Brew of Frost -item.witchery:ingredient.brewDepths.name=Brew of the Depths -item.witchery:ingredient.icyNeedle.name=Icy Needle -item.witchery:ingredient.frozenHeart.name=Frozen Heart -item.witchery:iceslippers.name=Icy Slippers -item.witchery:seedssnowbell.name=Snowbell Seeds -tile.witchery:snowbell.name=Snowbell -tile.witchery:wickerbundle.plain.name=Wicker Bundle -tile.witchery:wickerbundle.bloodied.name=Bloodied Wicker Bundle -item.witchery:ingredient.infernalBlood.name=Demonic Blood -entity.witchery.hornedHuntsman.name=Horned Huntsman - - - -item.witchery:ingredient.bookHerbology.name=Witchcraft: Herbology -item.witchery:mysticbranch.name=Mystic Branch -item.witchery:ingredient.mysticunguent.name=Mystic Unguent -item.witchery:ingredient.entbranch.name=Ent Twig -item.witchery:mutator.name=Mutating Sprig - -tile.witchery:glowglobe.name=Glow Globe -tile.witchery:leechchest.name=Leech Chest - -tile.witcheryLeechChest.playernotloggedin=Cannot get taglocks for the following players not in this world: %s. -tile.witcheryLeechChest.onlyowntaglock=Cannot remove your own taglock from the chest. - -witchery.book.herbology1={o{lWitchcraft{r{r{o: Herbology{r||Many common plants are used in the preparation of brews and magicks, this book details those rare or exceptional plants not known to the common folk. -witchery.book.herbology.mandrake=It's parsnip-shaped root has the look of a man. Harvest at night, lest it waken and scream. It grows in tilled earth in stages. Tall grass yields seeds. -witchery.book.herbology.belladonna=Deadly nightshade, so is this plant known, and deadly poisons from it grown. It grows in tilled earth in stages. Tall grass yields seeds. -witchery.book.herbology.snowbell=A curious plant, cold as the snow, freezes moisture as it grows. It grows in tilled earth in stages. Tall grass yields seeds. -witchery.book.herbology.artichoke=A water-bred plant with strange effect, fills the belly then empties it. It grows on still water in stages. Tall grass yields seeds. -witchery.book.herbology.glintweed=Emits an unearthly glow that illuminates it's surround. It can live anywhere, but spreads only on grass, dirt and sand. Mutate this plant from another with Mutandis. -witchery.book.herbology.spanishmoss=A creeper-like moss that grows best on trees, forms the best poppets that can be. Harvest with shears to keep it intact. Mutate this plant from another with Mutandis. -witchery.book.herbology.embermoss=A plant with a unique defense, when disturbed it bursts into flames. Harvest with shears. It can live anywhere, but spreads only on grass, dirt and sand. Mutate this plant from another with Mutandis. -witchery.book.herbology.voidbramble=This strange bramble keeps creatures at bay; for when they get close it teleports them away. Created and fueled with magic no rituals will function near to it. -witchery.book.herbology.rowan=The rowan, or mountain-ash has an affinity with magic other trees seldom match. Mutate the sapling from another plant with Mutandis. -witchery.book.herbology.alder=The alder wood appears to bleed when cut, this tree brings misfortune to all. Mutate the sapling from another plant with Mutandis. -witchery.book.herbology.hawthorn=Hawthorn is the tree of purity, it has a long history in the field of herbalism. Mutate the sapling from another plant with Mutandis. - -witchery.rite.infusiontree=Rite of Infusion{r||Infuse a mystic branch. Perform at night. -witchery.rite.cursecreature1=Curse of Misfortune{r||Curse the taglocked being. Perform in a storm. -witchery.rite.removecurse1=Rite of Remove Curse{r||Cleanse the taglocked being of misfortune. Things may get worse. -witchery.rite.cookfood=Rite of Broiling{r||Cooks any food placed in the circle. May overcook food. -witchery.rite.obstructedcircle=The area around the central glyph is not clear of blocks. - -witchery.infuse.branch.nocharges=You are too low on power to draw this symbol. -witchery.infuse.branch.infusionrequired=You must be infused to perform symbol magic. -witchery.infuse.branch.unknownsymbol=Unknown symbol drawn. -witchery.infuse.branch.infernalrequired=Infernal infusion is required to draw forbidden symbols. - -witchery.pott.accio=Accio -witchery.pott.aguamenti=Aguamenti -witchery.pott.alohomora=Alohomora -witchery.pott.avadakedavra=Avada Kedavra -witchery.pott.caveinimicum=Cave Inimicum -witchery.pott.colloportus=Colloportus -witchery.pott.confundus=Confundus -witchery.pott.crucio=Crucio -witchery.pott.defodio=Defodio -witchery.pott.ennervate=Ennervate -witchery.pott.episkey=Episkey -witchery.pott.expelliarmus=Expelliarmus -witchery.pott.flagrate=Flagrate -witchery.pott.flipendo=Flipendo -witchery.pott.impedimenta=Impedimenta -witchery.pott.imperio=Imperio -witchery.pott.incendio=Incendio -witchery.pott.lumos=Lumos -witchery.pott.meteolojinxrecanto=Meteolojinx Recanto -witchery.pott.nox=Nox -witchery.pott.protego=Protego -witchery.pott.stupefy=Stupefy - -entity.witchery.ent.name=Ent - -witchery.taglockkit.taglockfailed=Failed to get taglock, other player noticed! -witchery.taglockkit.taglockdiscovered=Someone just tried to take a taglock from you, but failed! - - -item.witchery:ingredient.doorKeyring.name=Rowan Keyring -tile.witchery:statuegoddess.name=Statue of The Goddess -witchery.rite.curseinsanity1=Curse of Insanity{r||Curse the taglocked being with monster visions. Perform in a storm. -witchery.rite.removeinsanity1=Rite of Remove Curse{r||Cleanse the taglocked being of insanity. Things may get worse. -tile.witcheryStatusGoddess.curemisfortune=The Goddess cures your misfortune. -tile.witcheryStatusGoddess.cureinsanity=The Goddess cures your insanity. -entity.witchery.illusionCreeper.name=Creeper -entity.witchery.illusionSpider.name=Spider -entity.witchery.illusionZombie.name=Zombie - - - -witchery.book.herbology.enderbramble=This strange bramble keeps creatures at bay; for when they get close it teleports them away. Mutate this plant from sugar cane and spanish moss. -witchery.book.herbology.grassper=A curious plant that holds whatever it is given. Mutate this plant from tall grass and an empty chest. -witchery.book.herbology.crittersnare=Small creatures are this plants prey, it snaps them up - never to get away. Mutate this plant from alder saplings, a web and a zombie. - -entity.witchery.owl.name=Owl -entity.witchery.toad.name=Toad -entity.witchery.cat.name=Cat -entity.witchery.louse.name=Parasytic Louse - -item.witchery:louse.name=Parasytic Louse - -witchery.rite.bindfamiliar=Rite of Binding{r||Bind a tamed owl, toad or cat as a familiar. -witchery.rite.callfamiliar=Rite of Summoning{r||Summon your familiar that has been dismissed or killed. -witchery.rite.corruptvoodooprotection=Curse of Corrupt Poppet{r||Destroy voodoo protection of taglocked being. Needs cat familiar. -witchery.rite.requirescursemastery=This rite can only be performed with a cat familiar. - -item.witchery:ingredient.brewFrogsTongue.name=Brew of Frogs Tongue -item.witchery:ingredient.brewCursedLeaping.name=Brew of Cursed Leaping -item.witchery:ingredient.brewHitchcock.name=Brew of Bodega -item.witchery:ingredient.brewInfection.name=Brew of Infection -item.witchery:ingredient.owletsWing.name=Owlet's Wing -item.witchery:ingredient.toeOfFrog.name=Toe of Frog -item.witchery:ingredient.appleWormy.name=Wormy Apple -tile.witchery:grassper.name=Grassper -item.witchery:poppet.protectPoppet.name=Poppet Protection Poppet -tile.witchery:crittersnare.name=Critter Snare -tile.witchery:crittersnare.empty.name=Critter Snare -tile.witchery:crittersnare.bat.name=Critter Snare (Bat) -tile.witchery:crittersnare.silverfish.name=Critter Snare (Silverfish) -tile.witchery:crittersnare.slime.name=Critter Snare (Slime) -tile.witchery:crittersnare.magmacube.name=Critter Snare (Magma Cube) - - -entity.witchery.babayaga.name=Baba Yaga - -tile.witchery:crystalball.name=Crystal Ball -item.witchery:ingredient.quartzSphere.name=Quartz Sphere -item.witchery:ingredient.happenstanceOil.name=Happenstance Oil -witchery.rite.infusionfuture=Rite of Infusion{r||Infuse a Crystal Ball to see the future. Perform at night. - -witchery.prediction.recharging=The crystal ball is inert for the moment. -witchery.prediction.nopower=The crystal ball cannot get enough power from a nearby altar. -witchery.prediction.unskilled=You gaze into the crystal ball, but do not know how to interpret what you see. -witchery.prediction.none=You gaze into the crystal ball, but %s's future is too murky at the moment. -witchery.prediction.zombie=You gaze into the crystal ball: %s will chance upon the undead. -witchery.prediction.arrowhit=You gaze into the crystal ball: %s will be struck by an arrow. -witchery.prediction.ent=You gaze into the crystal ball: %s will encounter a walking tree. -witchery.prediction.fall=You gaze into the crystal ball: %s will stumble and fall. -witchery.prediction.treasure=You gaze into the crystal ball: %s will find buried treasure. -witchery.prediction.iron=You gaze into the crystal ball: %s will be inundated with iron. -witchery.prediction.diamond=You gaze into the crystal ball: %s will find shinies. -witchery.prediction.emerald=You gaze into the crystal ball: %s will find shinies. -witchery.prediction.love=You gaze into the crystal ball: %s will meet a dark and handsome stranger. -witchery.prediction.babagood=You gaze into the crystal ball: %s has sparked the interest of the crone (and her sisters). -witchery.prediction.bababad=You gaze into the crystal ball: %s has angered the crone (and her sisters). -witchery.prediction.friend=You gaze into the crystal ball: %s will make a new friend. -witchery.prediction.rescued=You gaze into the crystal ball: %s will be saved by a stranger. -witchery.prediction.tothenether=You gaze into the crystal ball: %s will take a trip to the nether. -witchery.prediction.tothenether.summoned=A demon has been watching you and transposed you to the nether. -witchery.prediction.wet=You gaze into the crystal ball: %s will get wet. -witchery.prediction.coal=You gaze into the crystal ball: %s will collect a cache of coal. - -tile.witchery:bramble.ender.name=Ender Bramble -tile.witchery:bramble.wild.name=Wild Bramble -tile.witchery:bloodrose.name=Blood Poppy - -witchery.rite.cursesinking1=Curse of Sinking{r||Curse the taglocked being with extra weight. Perform in a storm. -witchery.rite.removesinking1=Rite of Remove Curse{r||Cleanse the taglocked being of sinking. Things may get worse. -tile.witcheryStatusGoddess.curesinking=The Goddess cures your sinking problem. - -witchery.book.herbology.wildbramble=This thorny bramble spreads around, when you try to pull it down. Mutate this plant from cactus and spanish moss. -witchery.book.herbology.bloodrose=In a witches garden keep in mind, a scratch from this rose leaves your blood behind. Mutate this plant from roses and a leech chest. - -entity.witchery.covenwitch.name=Coven Witch -item.witchery:ingredient.seerStone.name=Seer Stone -witchery.rite.infusionseerstone=Rite of Infusion{r||Infuse a stone to communicate in a coven. Perform at night. -witchery.rite.climatechange=Rite of Shifting Seasons{r||Pick Biome with biome foci and glowstone. Coven of 4 or more. -witchery.rite.iceshell=Rite of Icy Expansion{r||Create an icy sphere. Coven of 2 or more. -witchery.rite.curseoverheating=Curse of Overheating{r||Curse the taglocked being to overheat. -witchery.rite.cureoverheating=Rite of Remove Curse{r||Cleanse the taglocked being of overheating. Things may get worse. -tile.witcheryStatusGoddess.cureoverheating=The Goddess cures your temperature problem. -witchery.rite.wrongdimension=The rite cannot be performed in this dimension. -witchery.rite.coventoosmall=You require more coven members to perform this rite. -witchery.rite.missingbiomefoci=Missing an item to represent the desired biome. -witchery.rite.rainoffrogs=Curse of Raining Toads{r||Rain poisonous toads. Coven of 1 or more. -witchery.rite.glyphictransform=Rite of Glyphic Transformation{r||Drop chalk of the desired color, 1=small, 2=medium, 3=large. -witchery.rite.callbeasts=Rite of Beastial Call{r||Call animals. Coven of 3 or more. - -witchery.witch.pet=%s's pet -witchery.witch.petflesh=%s's pet's flesh -witchery.witch.peteye=%s's pet's eye -witchery.witch.say.covenfull=Your coven is full. Begone! -witchery.witch.say.joinedcoven=I will join your coven. Call me when you have need. -witchery.witch.say.questitemsremaining=%s more to go. -witchery.witch.say.questnotfinished=You have not completed my task! -witchery.witch.say.begone=Begone! -witchery.witch.say.notinterested1=You do not interest me! -witchery.witch.say.notinterested2=Why do you waste my time! -witchery.witch.say.notinterested3=You are not skilled in the Art! -witchery.witch.say.tricked=Just what I needed... a gullible fool... now you die! - -witchery.witch.quest.fightspider=Defeat my pet and bring me its eye, speak to me again if you accept! -witchery.witch.quest.fightzombie=Defeat my pet and bring me its flesh, speak to me again if you accept! -witchery.witch.quest.getdemonheart=Bring me the beating means to master the infernal dimension, speak to me again if you accept! -witchery.witch.quest.makecrystalball=I desire to predict the future, speak to me again if you accept! -witchery.witch.quest.getbones=Kill 30 skeletons and bring me their bones, speak to me again if you accept! -witchery.witch.quest.makegrotesquebrew=I must perform many curses, bring me the necessary brew, speak to me again if you accept! -witchery.witch.quest.makenecrostone=Bring me the means to control the dead, speak to me again if you accept! -witchery.witch.quest.go=Go now! - -witchery.item.seerstone.misfortune=Curse of Misfortune (%d) -witchery.item.seerstone.insanity=Curse of Insanity (%d) -witchery.item.seerstone.sinking=Curse of Sinking (%d) -witchery.item.seerstone.overheating=Curse of Overheating (%d) -witchery.item.seerstone.notcursed=No curses. - -entity.witchery.corpse.name=Body -entity.witchery.nightmare.name=Nightmare - -tile.witchery:somniancotton.name=Wispy Cotton -tile.witchery:spiritflowing.name=Flowing Spirit -tile.witchery:spiritportal.name=Spirit Portal -tile.witchery:spinningwheel.name=Spinning Wheel - -item.witchery:ingredient.brewSleep.name=Brew of Sleeping -item.witchery:ingredient.brewWasting.name=Brew of Wasting -item.witchery:ingredient.sleepingApple.name=Apple -item.witchery:ingredient.disturbedCotton.name=Disturbed Cotton -item.witchery:ingredient.fancifulThread.name=Fanciful Thread -item.witchery:ingredient.tormentedTwine.name=Tormented Twine -item.witchery:ingredient.goldenThread.name=Golden Thread -item.witchery:ingredient.mellifluousHunger.name=Mellifluous Hunger -item.witchery:ingredient.brewFlowingSpirit.name=Brew of Flowing Spirit -item.witchery:ingredient.weaveIntensity.name=Dream Weaver of Intensity -item.witchery:bucketspirit.name=Spirit Bucket -item.witchery:bitingbelt.name=Biting Belt -item.witchery:bitingbelt.tip=Careful... it bites.||{5Craft with up to 2 potions that get{0|{5administered when hit.{0 - -witchery.brew.flowingspirit=Only brew in the Spirit World - -witchery.rite.manifest=Rite of Manifestation{r||Manifest as a ghost from the Spirit World. - -witchery.book.herbology.somniancotton=A make-believe plant that only grows, in the deepest of sleep, where ones dreams go. - - -tile.witchery:demonheart.name=Demon Heart - -witchery.rite.optional=(optional) -witchery.rite.noplacelikehome=there's no place like home -witchery.rite.unknownchant=Unknown chant -witchery.rite.manifestation.countdown=You feel more corporeal, only %s seconds remain. -witchery.rite.slippersoncooldown=Nothing happens (wait %s minute(s)). -witchery.rite.forestation=Rite of the Forest{r||Grow a forest, replace the sapling for the desired type. -witchery.rite.toofaraway=The rite cannot be performed so far away (a large coven may be needed). - -item.witchery:iceslippers.tip=Cool to the touch.||{5Freezes nearby water and{0|{5turns lava to obsidian (damages shoes){0 -item.witchery:brewbag.name=Brew Bag -item.witchery:huntsmanspear.name=Spear of the Huntsman -item.witchery:huntsmanspear.tip={5Can summon a wolf, if struck while blocking{0. -item.witchery:barkbelt.name=Bark Belt -item.witchery:barkbelt.tip=So this is how an Ent feels.||{5Grow bark pieces when standing on grass or mycellium{0|{5Bark pieces mitigate hits.{0 -item.witchery:rubyslippers.name=Ruby Slippers -item.witchery:rubyslippers.tip=There's no place like home.||{5Teleport using a waystone (1 min cooldown){0|{5Teleport to bed (30 min cooldown){0 -item.witchery:seepingshoes.name=Seeping Shoes -item.witchery:seepingshoes.tip=Cave spider's bane.||{5Remove poison effects when standing on ground{0 -item.witcheryTaglockKit.boundto=Bound: {5%s{0 -item.witcheryTaglockKit.unbound=Not bound - -item.witchery:ingredient.bookBiomes.name=Book of Biomes -item.witchery:ingredient.bookWands.name=Witchcraft: Symbology -item.witchery:ingredient.batBall.name=Concentrated Bat Ball -item.witchery:ingredient.brewBats.name=Brew of Bats -item.witchery:ingredient.purifiedMilk.name=Purified Milk -item.witchery:ingredient.charmDisruptedDreams.name=Charm of Fanciful Thinking - -tile.witcheryStatusGoddess.curenightmare=The Goddess cures your nightmare. -witchery.item.seerstone.nightmare=Curse of Waking Nightmare (%d) - -witchery.rite.cursenightmare=Curse of Waking Nightmare{r||Perform in a storm. -witchery.rite.curenightmare=Rite of Remove Curse{r||Cleanse the taglocked being of nightmares. Things may get worse. - -witchery.book.biomes1={o{lBook of Biomes{r{r||Understanding the biomes of the world is the first step to changing them. In these pages can be found the foci items and glowstone dust cost of each biome needed for the {oRite of Shifting Seasons{r. -witchery.book.biomes.foci=Foci -witchery.book.biomes.forest.name=Forest -witchery.book.biomes.forest.item=Oak Sapling -witchery.book.biomes.plains.name=Plains -witchery.book.biomes.plains.item=Tall Grass -witchery.book.biomes.mountain.name=Mountain -witchery.book.biomes.mountain.item=Obsidian -witchery.book.biomes.hills.name=Hills -witchery.book.biomes.hills.item=Stone -witchery.book.biomes.swamp.name=Swamp -witchery.book.biomes.swamp.item=Slimeball -witchery.book.biomes.water.name=Water -witchery.book.biomes.water.item=Water Bucket -witchery.book.biomes.desert.name=Desert -witchery.book.biomes.desert.item=Cactus -witchery.book.biomes.frozen.name=Frozen -witchery.book.biomes.frozen.item=Icy Needle -witchery.book.biomes.jungle.name=Jungle -witchery.book.biomes.jungle.item=Jungle Sapling -witchery.book.biomes.wasteland.name=Wasteland -witchery.book.biomes.wasteland.item=Netherrack -witchery.book.biomes.beach.name=Beach -witchery.book.biomes.beach.item=Sand -witchery.book.biomes.mushroom.name=Mushroom -witchery.book.biomes.mushroom.item=Red Mushroom -witchery.book.biomes.magical.name=Magical -witchery.book.biomes.magical.item=Skeleton Skull - -witchery.book.wands1={o{lWitchcraft{r{r{o: Symbology{r||Drawing symbols with a {oMystic Branch{r, allows a practitioner to sculpt natural energies.||Only {oInfused{r practitioners can use this type of magic.||Forbidden curses require the {oInfernal Infusion{r. -witchery.book.wands.strokes=Strokes -witchery.book.wands.stroke.0=Up -witchery.book.wands.stroke.1=Down -witchery.book.wands.stroke.2=Right -witchery.book.wands.stroke.3=Left -witchery.book.wands.stroke.4=Up-Right -witchery.book.wands.stroke.5=Down-Left -witchery.book.wands.stroke.6=Up-Left -witchery.book.wands.stroke.7=Down-Right - -witchery.pott.accio.info=Pull a dropped item. -witchery.pott.aguamenti.info=Create water. -witchery.pott.alohomora.info=Open a locked door. -witchery.pott.avadakedavra.info={4Forbidden{0: Killing curse. -witchery.pott.caveinimicum.info=Strengthen a block. -witchery.pott.colloportus.info=Lock a door. -witchery.pott.confundus.info=Cause confusion. -witchery.pott.crucio.info={4Forbidden{0: Torture. -witchery.pott.defodio.info=Dig. -witchery.pott.ennervate.info=Counter Stupify. -witchery.pott.episkey.info=Minor healing. -witchery.pott.expelliarmus.info=Disarm the target. -witchery.pott.flagrate.info=Draw an infernal rune. -witchery.pott.flipendo.info=Push the target away. -witchery.pott.impedimenta.info=Slows the target. -witchery.pott.imperio.info={4Forbidden{0: Mind control. -witchery.pott.incendio.info=Start a fire. -witchery.pott.lumos.info=Create light. -witchery.pott.nox.info=Extinguish light. -witchery.pott.protego.info=Shield (ground target). -witchery.pott.stupefy.info=Stun the target. - -item.witchery:poppet.protectArmor.name=Armor Protection Poppet - - - -item.witchery:babashat.name=Baba Yaga's Hat -item.witchery:babashat.tip={5Infused players have a chance to be{0|{5teleported instead of taking a hit{0||{9+25% chance of second brew{0|{9+25% chance of third brew{0 -item.witchery:boline.name=Boline -item.witchery:boline.tip=Like shears, but can harvest|trapped plants and cobwebs. - -witchery.infuse.infusionrequired=You must be infused to use this ability. -witchery.infuse.nocharges=You are too low on power to use this ability. - -item.witchery:ingredient.brewSolidStone.name=Solidifying Brew (Stone) -item.witchery:ingredient.brewSolidDirt.name=Solidifying Brew (Dirt) -item.witchery:ingredient.brewSolidSand.name=Solidifying Brew (Sand) -item.witchery:ingredient.brewSolidSandstone.name=Solidifying Brew (Sandstone) -item.witchery:ingredient.brewSolidErosion.name=Solidifying Brew (Erosion) -item.witchery:ingredient.brewHollowTears.name=Brew of Hollow Tears -item.witchery:ingredient.brewSubstitution.name=Brew of Substitution -item.witchery:ingredient.condensedFear.name=Condensed Fear -item.witchery:ingredient.focusedWill.name=Focused Will -item.witchery:ingredient.brewGrave.name=Infused Brew of the Grave -item.witchery:ingredient.brewSoaring.name=Infused Brew of Soaring -item.witchery:ingredient.infusionBase.name=Infused Brew Base -item.witchery:ingredient.brewRevealing.name=Brew of Revealing -item.witchery:ingredient.wormwood.name=Wormwood -item.witchery:ingredient.subduedSpirit.name=Subdued Spirit -item.witchery:ingredient.brewCongealedSpirit.name=Congealed Spirit -item.witchery:seedswormwood.name=Wormwood Seeds -item.witchery:spectralstone.name=Spectral Stone - -item.witchery:buckethollowtears.name=Hollow Tears Bucket - -witchery.brew.solidification=Substitute Dirt with Stone, Sand, Sandstone or a Brew of Erosion. - -tile.witchery:wormwood.name=Wormwood - -entity.witchery.spectre.name=Spectre -entity.witchery.poltergeist.name=Poltergeist -entity.witchery.banshee.name=Banshee -entity.witchery.spirit.name=Spirit -entity.witchery.death.name=Death - -tile.witchery:brazier.name=Brazier -tile.witchery:scarecrow.name=Scarecrow -tile.witchery.scarecrow.operation.playerwhitelist=Activate for PLAYERS not in whitelist: %s -tile.witchery.scarecrow.operation.playerblacklist=Activate for PLAYERS in blacklist: %s -tile.witchery.scarecrow.operation.creaturewhitelist=Activate for ANYTHING not in whitelist: %s. -tile.witchery.scarecrow.operation.allnotfound=Activate if all in whitelist not found: %s. -tile.witchery.scarecrow.operation.onenotfound=Activate if one in whitlelist not found: %s. -tile.witchery.scarecrow.operation.off=Disabled. [%s] - -tile.witchery:trent.name=Trent Effigy -tile.witchery:witchsladder.name=Witch's Ladder - -witchery.fetish.enhancedpoppets.name=Voodoo Protection -witchery.fetish.enhancedpoppets.desc=The properties of a carried Voodoo Protection Poppet become stronger. -witchery.fetish.screamer.name=Shrieking -witchery.fetish.screamer.desc=Screams when specific beings are near by. -witchery.fetish.sentinal.name=Sentinel -witchery.fetish.sentinal.desc=Launches a spectral assault on unwanted beings. -witchery.fetish.twister.name=Disorientation -witchery.fetish.twister.desc=Confuses approaching beings. -witchery.fetish.ghostwalker.name=Ghost Walking -witchery.fetish.ghostwalker.desc=Sustains manifested creatures from the Spirit World. - -item.witchery:ingredient.seerstone.manifestationtime=Can manifest for %s second(s). -item.witchery:ingredient.seerstone.nomanifestationtime=Cannot manifest. -item.witchery:ingredient.seerstone.covensize=%s witch(es) in coven. -item.witchery:ingredient.seerstone.nocoven=No coven. -item.witchery:ingredient.seerstone.nofamiliar=No familiar. -item.witchery:ingredient.seerstone.familiar=Familiar called %s. -item.witchery:ingredient.bookBurning.name=Witchcraft: Conjuration & Fetishes -item.witchery:ingredient.graveyardDust.name=Graveyard Dust - -item.witchery.swordofdeath.customname=Death's Backup Sword -item.witchery.horseofdeath.customname=Binky - -witchery.rite.infusebrewsoaring=Rite of Infusion{r||Infuse the Brew of Soaring. -witchery.rite.infusebrewgrave=Rite of Infusion{r||Infuse the Brew of the Grave. -witchery.rite.spectralstone=Rite of Necromancy{r||Infuse a Spectral Stone. Perform at night. -witchery.rite.bindspectral=Rite of Binding{r||Bind up to three spectral creatures of the same type into a Spectral Stone. -witchery.rite.bindfetish=Rite of Binding{r||Bind spectral creatures to a Scarecrow, Trent Effigy or Witch's Ladder to create an effect. -witchery.rite.voodooprotectionactivated=Rite failed, player had voodoo protection. - -witchery.brazier.smoke.name=Graveyard Mist -witchery.brazier.smoke.desc=Call forth a thick mist that lingers for some minutes. - -witchery.brazier.spectre.name=Summon Spectre -witchery.brazier.spectre.desc=Pull a dead being back into this world from beyond. - -witchery.brazier.banshee.name=Summon Banshee -witchery.brazier.banshee.desc=Pull a screaming being back into this world from beyond. - -witchery.brazier.strong.name=Anguish of the Dead -witchery.brazier.strong.desc=Inflict the pain of the dead when striking creatures near to the brazier. - -witchery.brazier.tough.name=Fortification of the Corpse -witchery.brazier.tough.desc=Let the dead feel your pain while standing near the brazier. - -witchery.brazier.invisible.name=Deathly Veil -witchery.brazier.invisible.desc=Vanish from sight while standing near to the brazier. - -witchery.brazier.wilting.name=Drain Growth -witchery.brazier.wilting.desc=Suck the life from crops to heal nearby undead. - -witchery.book.burning1={o{lWitchcraft: Conjuration & Fetishes{r{r||A witch may use a Brazier to burn materials with magical purpose, and conjure that which is no longer of this world.||Place the ingredients into the brazier and ignite with a flint and tinder. -witchery.book.burning2={o{lFetish Binding{r{r||A witch may use the Rite of Binding to bind spectral creatures to a fetish to create permanent effects.||The following pages show which beings must be bound for which effect. -witchery.book.burning3=Beings required: - - -entity.witchery.witchhunter.name=Witch Hunter - -item.witchery:handbow.name=Witch Hunter Pistol Crossbow -item.witchery:hunterhat.name=Witch Hunter Hat -item.witchery:hunterhat.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:huntercoat.name=Witch Hunter Coat -item.witchery:huntercoat.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:hunterlegs.name=Witch Hunter Trousers -item.witchery:hunterlegs.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:hunterboots.name=Witch Hunter Boots -item.witchery:hunterboots.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:shelfcompass.name=Poppet Shelf Compass -item.witchery:ingredient.boltStake.name=Wooden Bolt -item.witchery:ingredient.boltAntiMagic.name=Nullifying Bolt -item.witchery:ingredient.boltHoly.name=Bone Bolt -item.witchery:ingredient.boltSplitting.name=Splitting Bolt -item.witchery:ingredient.nullifiedleather.name=Nullified Leather -item.witchery:ingredient.nullcatalyst.name=Null Catalyst -item.witchery:ingredient.binkyhead.name=Binky's Skull -item.witchery:potion.antidote.name=Universal Antidote - -item.witchery:deathscowl.name=Death's Hood -item.witchery:deathscowl.tip={9Its gaze instils fear, causing victims to freeze.{0 -item.witchery:deathsrobe.name=Death's Robe -item.witchery:deathsrobe.tip={9Resistant to fire.{0 -item.witchery:deathsfeet.name=Death's Footwear -item.witchery:deathsfeet.tip={9Walk on water.{0 -item.witchery:deathshand.name=Hand of Death -item.witchery:deathshand.tip={9Spectral touch ignores armor.{0|{9Death set bonus: Summon Death's Scythe{9|{9for AOE and hunger-based damage.{9 - -witchery.rite.blackmagicdampening=Something is dissipating the magic. - -fluid.witchery:hollowtears=Hollow Tears -fluid.witchery:flowingspirit=Flowing Spirit - -tile.witchery:hollowtears.name=Flowing Spirit - - - -entity.witchery.lordoftorment.name=Lord of Torment - -entity.witchery.imp.name=Flame Imp -entity.witchery.imp.goodbye=<%s> Contract is fulfilled! -entity.witchery.imp.contract.notowners=<%s> This contract is not signed with your blood! -entity.witchery.imp.contract.unsigned=<%s> Sign the contract with your blood! -entity.witchery.imp.contract.noxp=<%s> You have too little experience for me to feed! -entity.witchery.imp.contract.deal=<%s> We have a deal! -entity.witchery.imp.gift.like=<%s> Shinies! -entity.witchery.imp.gift.hate=<%s> Me not like! Just new shiny things! -entity.witchery.imp.gift.reciprocate=<%s> I has secret to share! -entity.witchery.imp.gift.toomany=<%s> Shinies... yawn... -entity.witchery.imp.gift.power=<%s> POWER OVERWHELMING! -entity.witchery.imp.gift.powerloss=<%s> Why you do that? -entity.witchery.imp.spell.feelthefire=<%s> %s will feel my flames! -entity.witchery.imp.spell.cannotfind=<%s> Cannot find %s! -entity.witchery.imp.spell.failed=<%s> Something not right. -entity.witchery.imp.spell.notliked=<%s> Why should I do this? -entity.witchery.imp.spell.toooften=<%s> Wait little bit. -entity.witchery.imp.spell.toomuchpower=<%s> Too much POWER to think! - -tile.witchery:force.name=Solid -tile.witchery:tormentportal.name=Torment Portal -tile.witchery:refillingchest.name=Chest - -witchery.infuse.branch.unknowneffect=You have not learned this effect! -witchery.infuse.branch.effectoncooldown=Effect not ready, %s second(s) remain. - -item.witchery:ingredient.seerstone.knownspells=Knows: %s. -item.witchery:ingredient.seerstone.nospells=No mystic branch knowledge. - -item.witchery:ingredient.brewSoulHunger.name=Soul of Hunger Demon -item.witchery:ingredient.brewSoulAnguish.name=Soul of Anguish Demon -item.witchery:ingredient.brewSoulFear.name=Soul of Fear Demon -item.witchery:ingredient.brewSoulTorment.name=Soul of Torment Demon -item.witchery:ingredient.contract.name=Demonic Contract -item.witchery:ingredient.contractTorment.name=Torment -item.witchery:ingredient.contractTorment.tip=Read this text in a circle|of standing stones. Beware its|explosive entrance. -item.witchery:ingredient.contractTorment.nostones=Must stand in the dead centre of a stone circle. -item.witchery:ingredient.contractBlaze.name=Living Flame -item.witchery:ingredient.contractResistFire.name=Fiery Tolerance -item.witchery:ingredient.contractEvaporate.name=Evaporation -item.witchery:ingredient.contractFieryTouch.name=Fiery Touch -item.witchery:ingredient.contractSmelting.name=Melting Touch - -witchery.pott.tormentum=Tormentum -witchery.pott.tormentum.info=Cast the victim into eternal Torment. -witchery.pott.carnosadiem=Carnosa Diem -witchery.pott.carnosadiem.info=Fleshy feast. -witchery.pott.ignianima=Ignianima -witchery.pott.ignianima.info=Soulfire: cause pain equivalent to your own. -witchery.pott.morsmordre=Morsmordre -witchery.pott.morsmordre.info=Conjure the Dark Mark. - -witchery.rite.summonimp=Rite of Summoning{r||Call forth an Imp. The inner area must be clear 7x7x4 blocks! - - -tile.witchery:decurseteleport.name=Statue of Occluded Summons -tile.witchery:decursedirected.name=Statue of Broken Curses -entity.witchery.mindrake.name=Minedrake -entity.witchery.darkmark.name=Morsmordre -item.witchery:seedsmindrake.name=Minedrake Bulb -tile.witchery:mindrake.name=Minedrake - -witchery.rite.bindstatuetoplayer=Rite of Binding{r||Binds a person in the circle to the statue. -witchery.rite.bindwaystonetoplayer=Rite of Binding{r||Create a Blooded Waystone bound to the location of a creature. -entity.witchery.goblin.name=Hobgoblin -entity.witchery.goblinmog.name=Mog -entity.witchery.goblingulg.name=Gulg -item.witchery:ingredient.waystoneCreatureBound.name=Blooded Waystone -item.witchery:quiverofmog.name=Mog's Quiver -item.witchery:quiverofmog.tip={9Limitless fast arrows that obliterate airborne targets.{0|{5Become tougher when close to a player with Gulg's Gurdle.{0 -item.witchery:gurdleofgulg.name=Gulg's Gurdle -item.witchery:gurdleofgulg.tip={9Smash enemies into the air with your bare fists.{0|{5Become tougher when close to a player with Mog's Quiver.{0 -tile.witchery:stockade.oak.name=Oak Stockade -tile.witchery:stockade.spruce.name=Spruce Stockade -tile.witchery:stockade.birch.name=Birch Stockade -tile.witchery:stockade.jungle.name=Jungle Stockade -tile.witchery:stockade.rowan.name=Rowan Stockade -tile.witchery:stockade.alder.name=Alder Stockade -tile.witchery:stockade.hawthorn.name=Hawthorn Stockade -tile.witchery:stockade.acacia.name=Acacia Stockade -tile.witchery:stockade.big_oak.name=Dark Oak Stockade -item.witchery:dupstaff.name=Staff of Duplication -tile.witchery:statueofworship.name=Statue of Hobgoblin Patron -item.witchery:ingredient.kobolditedust.name=Koboldite Dust -item.witchery:ingredient.kobolditenugget.name=Koboldite Nugget -item.witchery:ingredient.kobolditeingot.name=Koboldite Ingot -item.witchery:kobolditepickaxe.name=Koboldite Pickaxe -item.witchery:ingredient.pentacle.name=Pentacle -tile.witchery:perpetualice.name=Perpetual Ice -tile.witchery:tormentstone.name=Torment Stone - -tile.witchery:infinityegg.name=Infinity Egg -item.witchery:kobolditehelm.name=Twisting Band -item.witchery:kobolditehelm.tip={9Disorientates observers.{0 - - - - -witchery:effect.paralysed=Paralysed -witchery:effect.wrappedinvine=Vine Wrapped -witchery:effect.spiked=Spikey -witchery:potion.paralysed=Paralysed -witchery:potion.insane=Insanity -witchery:potion.wrappedinvine=Vine Wrapped -witchery:potion.spiked=Spikey -witchery:potion.sprouting=Sprouting -witchery:potion.grotesque=Grotesque -witchery:potion.love=In Love -witchery:potion.allergysun=Undead's Curse -witchery:potion.allergydark=Grue's Prey -witchery:potion.chilled=Chilled -witchery:potion.snowtrail=Snow Trail -witchery:potion.hellishaura=Hellish Aura -witchery:potion.brewingexpertise=Brewing Expertise -witchery:potion.unknown= -witchery:potion.doublejump=Frog's Leg -witchery:potion.featherfall=Feather Fall -witchery:potion.reincarnate=Reincarnate -witchery:potion.insanity=Insane -witchery:potion.insanity.0=Cheese Flavored -witchery:potion.insanity.1=Finely Groomed -witchery:potion.insanity.2=Waffle Inclined -witchery:potion.insanity.3=Hairy Legged -witchery:potion.insanity.4=Turnip Tonsured -witchery:potion.insanity.5=Captain Incredible -witchery:potion.insanity.6=Tweety Pie -witchery:potion.keepinventory=Sticky Items -witchery:potion.sinking=Sinking -witchery:potion.overheating=Overheating -witchery:potion.wakingnightmare=Waking Nightmare -witchery:potion.queasy=Queasy -witchery:potion.swimming=Swim Boost -witchery:potion.resizing=Resized -witchery:potion.enderinhibition=Ender Inhibition -witchery:potion.illfitting=Ill Fitting -witchery:potion.volatility=Volatility -witchery:potion.enslaved=Enslaved -witchery:potion.mortalcoil=Mortal Coil -witchery:potion.absorbmagic=Absorb Magic -witchery:potion.poisonweapons=Poison Weapons -witchery:potion.reflectprojectiles=Reflect Projectiles -witchery:potion.reflectdamage=Reflect Damage -witchery:potion.attractprojectiles=Attract Projectiles -witchery:potion.repellattacker=Repell -witchery:potion.stoutbelly=Stout Belly -witchery:potion.feelnopain=Feel No Pain -witchery:potion.floating=Floating -witchery:potion.gasmask=Gas Mask -witchery:potion.diseased=Disease -witchery:potion.fortune=Luck -witchery:potion.worship=Worship -witchery:potion.keepeffects=Sticky Potion Effects - -witchery:potion.colorful=Tinting -witchery:potion.colorful.black=Tinting Black -witchery:potion.colorful.red=Tinting Red -witchery:potion.colorful.green=Tinting Green -witchery:potion.colorful.brown=Tinting Brown -witchery:potion.colorful.blue=Tinting Blue -witchery:potion.colorful.purple=Tinting Purple -witchery:potion.colorful.cyan=Tinting Cyan -witchery:potion.colorful.lightgray=Tinting Light Gray -witchery:potion.colorful.gray=Tinting Gray -witchery:potion.colorful.pink=Tinting Pink -witchery:potion.colorful.lime=Tinting Lime -witchery:potion.colorful.yellow=Tinting Yellow -witchery:potion.colorful.lightblue=Tinting Light Blue -witchery:potion.colorful.magenta=Tinting Magenta -witchery:potion.colorful.orange=Tinting Orange -witchery:potion.colorful.white=Tinting White - -item.witchery:brewbottle.name=Brew -item.witchery:brewbucket.name=Bucket of Brew -witchery:brew.planting=Planting -witchery:brew.floating=Floating -witchery:brew.tilling=Tilling -witchery:brew.harvesting=Harvest -witchery:brew.frogtongue=Frog's Tongue -witchery:brew.fertilization=Fertilize -witchery:brew.flowers=Flowers -witchery:brew.blight=Blight -witchery:brew.moonshine=Moonshine -witchery:brew.blast=Blast -witchery:brew.raiseland=Raise Land -witchery:brew.raising=Raising -witchery:brew.frogsleg=Frog's Leg -witchery:brew.potion=Brew of -witchery:brew.potionwater=Colored Water -witchery:brew.dispersal.gas=Gas -witchery:brew.dispersal.liquid=Liquid -witchery:brew.dispersal.splash=Splash -witchery:brew.dispersal.triggered=Triggered -witchery:brew.lifetime=Linger -witchery:brew.drinkspeed={9Quaffing: %s{0 -witchery:brew.drinkspeed.veryslow=Very Slow -witchery:brew.drinkspeed.slow=Slow -witchery:brew.drinkspeed.veryfast=Very Fast -witchery:brew.drinkspeed.fast=Fast - -witchery:brew.levelling=Levelling -witchery:brew.dissipate=Dissipate -witchery:brew.pulverisation=Pulverisation -witchery:brew.removedebuffs=Cure Debuffs -witchery:brew.removebuffs=Cure Buffs -witchery:brew.pruning=Pruning -witchery:brew.tidehold=Tidal Hold -witchery:brew.lavahold=Lava Hold -witchery:brew.inferno=Flames -witchery:brew.resizing=Resizing -witchery:brew.extinguish=Extinguish -witchery:brew.swimming=Swim Boost -witchery:brew.durationboost=Potion Longevity -witchery:brew.keepinventory=Sticky Items -witchery:brew.revealing=Revealing -witchery:brew.fullness=Fullness -witchery:brew.wasting=Wasting -witchery:brew.insanity=Insanity -witchery:brew.airhike=Air Hike -witchery:brew.reincarnate=Reincarnation -witchery:brew.featherfall=Feather Fall -witchery:brew.jump=Jumping -witchery:brew.potionmaster=Decanting -witchery:brew.moveslow=Slowness -witchery:brew.invisibility=Invisibility -witchery:brew.weakness=Weakness -witchery:brew.harming=Harming -witchery:brew.wither=Wither -witchery:brew.poison=Poison -witchery:brew.movespeed=Speed -witchery:brew.waterbreathing=Gills -witchery:brew.resistfire=Fire Resist -witchery:brew.nightvision=Owl Eye -witchery:brew.regeneration=Regeneration -witchery:brew.damageboost=Strength -witchery:brew.healing=Healing -witchery:brew.blindness=Ink -witchery:brew.fear=Fear -witchery:brew.love=Love -witchery:brew.snow=Snow -witchery:brew.allergysun=Undead's Curse -witchery:brew.allergydark=Grue's Prey -witchery:brew.paralysis=Paralysis -witchery:brew.erosion=Erosion -witchery:brew.webs=Webs -witchery:brew.vines=Vines -witchery:brew.thorns=Thorns -witchery:brew.sprouting=Sprouting -witchery:brew.iceshell=Icy Shell -witchery:brew.cold=Cold -witchery:brew.treeoak=Oak -witchery:brew.treespruce=Spruce -witchery:brew.treebirch=Birch -witchery:brew.treejungle=Jungle -witchery:brew.treeacacia=Acacia -witchery:brew.treedarkoak=Dark Oak -witchery:brew.treerowan=Rowan -witchery:brew.treealder=Alder -witchery:brew.treehawthorn=Hawthorn -witchery:brew.knockback=Knockback -witchery:brew.batburst=Bat Burst -witchery:brew.sinking=Sinking -witchery:brew.overheating=Overheating -witchery:brew.wakingnightmare=Waking Nightmare -witchery:brew.drainmagic=Drain Magic -witchery:brew.lilify=Lilify -witchery:brew.hellgate=Inferno -witchery:brew.harmdemons=Demonbane -witchery:brew.harmundead=Undeadbane -witchery:brew.harminsects=Insectbane -witchery:brew.poisontoad=Poison Toad -witchery:brew.seasons=Shifting Seasons -witchery:brew.felling=Felling -witchery:brew.absorbsion=Absorbsion -witchery:brew.healthboost=Health Boost -witchery:brew.transposeore=Transpose Ore -witchery:brew.transpose=Transpose -witchery:brew.stealbuffs=Steal Buffs -witchery:brew.spreaddebuffs=Spread Debuffs -witchery:brew.iceworld=Ice World - -witchery:brew.skillincrease=You feel more skilled at brewing, perhaps less brew will be wasted from now on. - -item.witchery:brew.water.name=Brew of Endless Water -item.witchery:brew.water.tip=Endless Water (%s/%s) - - -tile.witchery:cauldron.name=Witch's Cauldron -tile.witchery:web.name=Web -tile.witchery:vine.name=Vine -tile.witchery:cactus.name=Cactus -tile.witchery:lilypad.name=Water Lily - -tile.witchery:icedoor.name=Ice Door -tile.witchery:icefence.name=Ice Fence -tile.witchery:icefencegate.name=Ice Gate -tile.witchery:iceslab.name=Ice Slab -tile.witchery:icedoubleslab.name=Ice Double Slab -item.witchery:iceslab.name=Ice Slab -item.witchery:icedoubleslab.name=Ice Double Slab -tile.witchery:icestairs.name=Ice Stairs -item.witchery:ingredient.doorIce.name=Ice Door -tile.witchery:icestockade.ice.name=Ice Stockade -tile.witchery:icepressureplate.name=Ice Pressure Plate -tile.witchery:snowpressureplate.name=Snow Pressure Plate - -item.witchery:ingredient.annointingPaste.name=Anointing Paste - -item.witchery:ingredient.seerstone.bottlingskill=Bottling skill: %s. - -tile.witchery:snowstairs.name=Snow Stairs -tile.witchery:snowslab.name=Snow Slab -tile.witchery:snowdoubleslab.name=Snow Double Slab -item.witchery:snowslab.name=Snow Slab -item.witchery:snowdoubleslab.name=Snow Double Slab - -tile.witchery:pitdirt.name=Dirt -tile.witchery:pitpodzol.name=Podzol -tile.witchery:pitgrass.name=Grass - -tile.witchery:cbuttonwood.name=Button -tile.witchery:cbuttonstone.name=Button -tile.witchery:clever.name=Lever -tile.witchery:cwoodpressureplate.name=Pressure Plate -tile.witchery:cstonepressureplate.name=Pressure Plate -tile.witchery:csnowpressureplate.name=Snow Pressure Plate -tile.witchery:cwoodendoor.name=Wooden Door - -item.witchery:leonardsurn.name=Leonard's Urn -item.witchery:leonardsurn.tip=Place a brew in the Urn to|focus its power, then release|it though your wand. -item.witchery:earmuffs.name=Earmuffs -item.witchery:earmuffs.tip=Protection from Mandrakes -item.witchery:playercompass.name=Player Compass -item.witchery:ingredient.subduedSpiritVillage.name=Subdued Village Spirit - -fluid.witchery:disease=Disease -tile.witchery:disease.name=Disease - -item.witchery:brew.fuel.name=Brew of Combustion -item.witchery:brew.fuel.0=Combustion -item.witchery:brew.fuel.1=Combustion II -item.witchery:brew.fuel.2=Combustion III -item.witchery:brew.fuel.3=Combustion IV -item.witchery:bookbiomes2.name=Book of Biomes (Extended Edition) -item.witchery:biomenote.name=Biome %s -witchery.book.biomes.river.name=River -witchery.book.biomes.ocean.name=Ocean -witchery.book.biomes.sandy.name=Sandy -witchery.book.biomes.snowy.name=Snowy -witchery.book.biomes.mesa.name=Mesa -witchery.book.biomes.spooky.name=Spooky -witchery.biomebook.currentpage=Current Page: {5%s{0 -witchery.biomebook.rainfall=Rainfall: %s -witchery.biomebook.snows=Snows: %s -witchery.biomebook.lightning=Lightning: %s -witchery.biomebook.temperature=Temp: %s -witchery.biomebook.temperaturehot=Temp: %s (Humid) -witchery.no=No -witchery.yes=Yes -item.witchery:biomebook2.tip={oCraft the book with a piece of paper,|{oto copy the current biome page (used|{oin some rituals). - -entity.witchery.leonard.name=Shade of Leonard -entity.witchery.lostsoul.name=Lost Soul - -witchery.pott.leonard1=Caelum -witchery.pott.leonard2=Baratrum -witchery.pott.leonard3=Ortus -witchery.pott.leonard4=Occasus - -witchery:color.black=Black -witchery:color.red=Red -witchery:color.green=Green -witchery:color.brown=Brown -witchery:color.blue=Blue -witchery:color.purple=Purple -witchery:color.cyan=Cyan -witchery:color.lightgray=Light Gray -witchery:color.gray=Gray -witchery:color.pink=Pink -witchery:color.lime=Lime -witchery:color.yellow=Yellow -witchery:color.lightblue=Light Blue -witchery:color.magenta=Magenta -witchery:color.orange=Orange -witchery:color.white=White - - - -item.witchery:cauldronbook.name=Witches' Brews -item.witchery:cauldronbook.tip=The definitive guide to cauldrons and potion brewing. - -witchery:cauldronbook.tbench=[i Crafting Bench][br][br][stack=%s][stack=%s][stack=%s][br][stack=%s][stack=%s][stack=%s] [img=witchery:textures/gui/arrowrightresult.png|left|middle|22|15] [stack=%s|left|middle][br] [stack=%s][stack=%s][stack=%s] -witchery:cauldronbook.tcraft=%s[br][img=witchery:textures/gui/cauldron.png|left|top|30|29] [img=witchery:textures/gui/arrowrightresult.png|left|middle|22|15] [stack=%s|left|middle] -witchery:cauldronbook.tritual=%s[br][img=witchery:textures/gui/cauldron.png|center|top|30|29] - -witchery:cauldronbook.toc=[h1 Witches' Brews]> [url Introduction][br]> [url Brewing][br]> [url=rituals Cauldron Rituals][br]> [url Crafting][br]> [url Other rituals][br]> [url Capacity][br]> [url Power][br]> [url Duration][br]> [url Modifiers][br]> [url Dispersal][br]> [url=toc/effects Effects] - -witchery:cauldronbook.introduction=[next=cauldron][h1 Introduction]Fill a [url cauldron] to the brim with water and light a fire beneath. When the water boils, throw in your ingredients for either:[br][br]> [url Brewing][br]> [url Rituals][br]> [url Crafting] -witchery:cauldronbook.cauldron=[next=cauldron2][h1 Cauldron: Recipe]A witch's cauldron is made by placing a normal [i Cauldron] in the world and using [i Anointing Paste] on it:[br][br][template=tbench 6=witchery:ingredient|153 0=witchery:seedsbelladonna 1=witchery:seedsmandrake 2=empty 3=witchery:seedsartichoke 4=witchery:seedssnowbell 5=empty 7=empty 8=empty 9=empty] -witchery:cauldronbook.cauldron2=[h1 Cauldron: Emptying]Empty a cauldron by dropping in one of the following:[br][br][stack=witchery:ingredient|17 Clear cauldron][br][stack=witchery:ingredient|16 Explode contents][br][br][i The witch and nearby structures will not be damaged.] - -witchery:cauldronbook.crafting=[next=toc/crafting2][h1 Crafting]The cauldron can be used to create or imbue items with magical properites. If a suitable combination of ingredients is thrown into the cauldron, the creation process will begin automatically. Use [url=rituals6 ritual circles] to reduce power costs! -witchery:cauldronbook.toc/crafting2=[next=crafting3][h1 Crafting: Recipes]> [url Boiled Meat][br]> [url Mutandis][br]> [url Mutandis Extremis][br]> [url Drop of Luck][br]> [url Otherwhere Chalk][br]> [url Infernal Chalk][br]> [url Golden Chalk][br]> [url Mutating Sprig][br]> [url Nether Wart][br]> [url End Stone][br]> [url Rotten Flesh] -witchery:cauldronbook.crafting3=[h1 Crafting: Recipes]> [url Pit Traps][br]> [url=compass Player Compass] -witchery:cauldronbook.boiledmeat=[h1 Crafting: Cooked Meat]Porkchop, Beef, Chicken and Porkchop? can all be dropped into a boiling cauldron to cook.[br][br][template=tcraft stack|0=porkchop 1=cooked_porkchop] -witchery:cauldronbook.mutandis=[h1 Crafting: Mutandis]Use Mutandis on simple plants, to mutate them into another, perhaps undiscovered, species.[br][br][template=tcraft stack|0=witchery:ingredient|22,witchery:ingredient|31,egg 1=witchery:ingredient|14|6] -witchery:cauldronbook.mutandisextremis=[h1 Crafting: Mutandis Extremis]Use on plants to mutate them. Grass creates mycellium. Underwater dirt creates clay.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|14 1=witchery:ingredient|15] -witchery:cauldronbook.mutatingsprig=[h1 Crafting: Mutating Sprig]Use on plants and creatures as part of mutating rituals.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|82,witchery:ingredient|15 1=witchery:mutator] -witchery:cauldronbook.dropofluck=[h1 Crafting: Drop of Luck]Bottled luck, rare and hard to make.[br][br][template=tcraft stack|0=witchery:ingredient|22,nether_wart,witchery:ingredient|37,witchery:ingredient|38,witchery:ingredient|15 1=witchery:ingredient|39] -witchery:cauldronbook.otherwherechalk=[h1 Crafting: Otherwhere Chalk]Used in rites involving transposition.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|37,ender_pearl,witchery:chalkritual 1=witchery:chalkotherwhere] -witchery:cauldronbook.infernalchalk=[h1 Crafting: Infernal Chalk]Used in rites involving the nether and demons.[br][br][template=tcraft stack|0=nether_wart,blaze_powder,witchery:chalkritual 1=witchery:chalkinfernal] -witchery:cauldronbook.goldenchalk=[h1 Crafting: Golden Chalk]The centrepiece of most rites.[br][br][template=tcraft stack|0=witchery:ingredient|22,gold_nugget,witchery:chalkritual 1=witchery:chalkheart] -witchery:cauldronbook.netherwart=[h1 Crafting: Nether Wart]For when a Nether Fortress is too hard to find.[br][br][template=tcraft stack|0=witchery:ingredient|22,witchery:ingredient|37,witchery:ingredient|29,ender_pearl,wheat,witchery:ingredient|14 1=nether_wart] -witchery:cauldronbook.endstone=[h1 Crafting: End Stone]What happens when the floating island is all gone?[br][br][template=tcraft stack|0=witchery:ingredient|22,stone,end_stone,witchery:ingredient|15 1=end_stone|0|2] -witchery:cauldronbook.rottenflesh=[h1 Crafting: Rotten Flesh]Finally a use for spare hands.[br][br][template=tcraft stack|0=witchery:witchhand 1=rotten_flesh|0|5] -witchery:cauldronbook.pittraps=[h1 Crafting: Pit Traps]Non-solid blocks![br][template=tcraft stack|0=witchery:ingredient|22,dirt,witchery:ingredient|101 1=witchery:pitdirt|0|4][br][br][template=tcraft stack|0=nether_wart,dirt,yellow_flower,witchery:ingredient|101 1=witchery:pitgrass|0|4] -witchery:cauldronbook.compass=[h1 Crafting: Player Compass]Craft with a taglock to find the way to that person.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|37,vine,spider_eye,compass 1=witchery:playercompass] - -witchery:cauldronbook.brewing=[next=brewing2][h1 Brews]Use a glass bottle to retrieve your potion when the cauldron splutters. Certain ingredients may need to draw power from an altar. More brews may be recovered as your [url=bottling expertise] grows.[br][br][stack=glass_bottle Glass Bottle] -witchery:cauldronbook.brewing2=[next=brewing3][h1 Brews: Effects & Modifiers]A brew consists of one or more [url=toc/effects effects] with modifiers and a [url dispersal] method, also with modifiers. Modifiers to an effect or dispersal method must be added in-order before the effect is added. -witchery:cauldronbook.brewing3=[next=brewing4][h1 Brews: Capacity]Each effect added to a brew will require a certain ammout of storage space. Special [url=capacity ingredients] are used to add such capacity to a brew, and they must be added in order to have a cumulative effect. -witchery:cauldronbook.brewing4=[next=brewing5][h1 Brews: Capacity]Multiple effects can be added to a brew, but there must be sufficient capacity for all of them combined. -witchery:cauldronbook.brewing5=[next=brewing6][h1 Brews: Step-by-step]1. Increase [url capacity][br]2. Add [url modifiers][br]3. Increase [url power][br]4. Increase [url duration][br]5. Add [url=toc/effects effect][br]6. Repeat from 3[br]> Bottle or continue[br]7. Increase [url extent][br]8. Increase [url=linger lingering][br]9. Set [url dispersal][br]> Bottle or do [url=rituals ritual] -witchery:cauldronbook.brewing6=[h1 Brews: Splash Brew of Extinguish Fires]Throw the following items into a full, boiling cauldron. Then use a glass bottle on the cauldron.[stack=glass_bottle][br][stack=witchery:ingredient|22][stack=coal][stack=gunpowder][br][img=witchery:textures/gui/cauldron.png|center|top|30|29] -witchery:cauldronbook.bottling=[next=bottling2][h1 Bottling]Inexperienced witches are not so proficient in actually bottling a brew. To obtain more brews from a cauldron practice is needed, eventually requiring more complex brews to be made. -witchery:cauldronbook.bottling2=[h1 Bottling]Wearing the correct clothing also helps an experienced witch, as does a Toad familiar. It may also be possible to use special brews to augment your proficiency. - -witchery:cauldronbook.rituals=[next=rituals2][h1 Rituals]Instead of bottling a brew, a full cauldron may instead be used to cast the effects as a ritual. Ritual casting requires the witch to add either a Taglock of the target or Tongue of Dog to cast it at the cauldron's location. -witchery:cauldronbook.rituals2=[next=rituals3][h1 Rituals: Waystones]A bound waystone may be added before the Tongue of Dog, to cast the ritual at the waystone's location. Some effects may require a second waystone to determine a source location. -witchery:cauldronbook.rituals3=[next=rituals4][h1 Rituals: Covens & Strength]The power of a rituals effects and the maximum range a ritual may be cast is determined by how many witches from a coven participate in the ritual. A maximum of seven witches may participate. -witchery:cauldronbook.rituals4=[next=rituals5][h1 Rituals: Dispersal]Using a taglock to start a ritual targets the bound creature. Otherwise a [url dispersal] ingredient must be added before the Tongue of Dog. Instant splash remains unchanged, but gas become an expanding effect and liquid produces rain. -witchery:cauldronbook.rituals5=[next=rituals6][h1 Rituals: Risks & Power]Performing a ritual with a cauldron needs altar power and, unlike pure circle magic, carries a risk of side-effects.[br]Surrounding the cauldron with chalk circles can help offset the power requirements and augment the risks. -witchery:cauldronbook.rituals6=[next=rituals7][h1 Rituals: Risks & Power]Ritual (white) small and/or medium circles can be used to moderately reduce power costs and eliminate side-effects.[br][br][img=witchery:textures/gui/circles_2white.png|center|top|32|32] -witchery:cauldronbook.rituals7=[next=rituals8][h1 Rituals: Risks & Power]Infernal (red) small and/or medium circles can be used to significantly reduce altar power costs, but at an increased risk of side-effects.[br][br][img=witchery:textures/gui/circles_2red.png|center|top|32|32] -witchery:cauldronbook.rituals8=[next=rituals9][h1 Rituals: Risks & Power]Red and white circles may be mixed as desired to get the appropriate balance of power costs and risks. -witchery:cauldronbook.rituals9=[next=rituals10][h1 Rituals: Failed rituals] When a ritual fails, it will emit colored smoke:[br][br][darkgreen Green] Target too far[br][darkblue Blue] Coven needed[br][darkred Red] Invalid circles[br][darkyellow Yellow] Underpowered[br][darkpurple Purple] Other failure[br][br]Rituals will not start if there is too little power. -witchery:cauldronbook.rituals10=[next=rituals11][h1 Rituals: Ritual of Raise Land]The further from the cauldron the waystone points, the larger the coven must be.[br][br][template=tritual stack|0=nether_wart,witchery:ingredient|37,quartz,witchery:ingredient|13,witchery:ingredient|25] -witchery:cauldronbook.rituals11=[h1 Rituals: Extended Curse of Blindness]The further from the victim, the larger the coven must be.[br][br][template=tritual stack|0=nether_wart,witchery:ingredient|37,redstone,dye|0,witchery:taglockkit|1] - -witchery:cauldronbook.otherrituals=[h1 Other Rituals]New rites that do not require an altar:[br][br]> [url=ritualwaystone Bind Waystone][br]> [url=ritualwaystoneblooded Blooded Waystone][br]> [url=ritualtranspose Transpose][br]> [url=ritualfind Find Structure] -witchery:cauldronbook.ritualwaystone=[h1 Ritual: Bind Waystone]To bind up to eight waystones, draw a 3x3 purple-chalk circle:[br][img=witchery:textures/gui/circles_tinypurple.png|center|top|32|32][br]Drop the waystones into the center, step back and wait. -witchery:cauldronbook.ritualwaystoneblooded=[h1 Ritual: Bind Blooded Waystone]To bind a waystone to a creature, draw a 3x3 purple-chalk circle near an Altar:[br][img=witchery:textures/gui/circles_tinypurple.png|center|top|32|32][br]With the creature near, drop a waysone in the center and wait. -witchery:cauldronbook.ritualtranspose=[h1 Ritual: Transpose]To transpose to a bound waystone, draw a 5x5 purple-chalk circle:[br][img=witchery:textures/gui/circles_spurple.png|center|top|32|32][br]Stand in the circle, drop the waystone inside the circle, and wait. -witchery:cauldronbook.ritualfind=[h1 Ritual: Find Structure]Summon a spirit that flys towards the closest village (or nether fortress). Draw a 3x3 white-chalk circle:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Subdued Spirit or Attuned Stone in the center and wait. - -witchery:cauldronbook.capacity=[i Capacity] - [url=toc/effects Effects] each have a space requirement, add these ingredients, in order, to increase a brew's capacity.[br][br][stack=witchery:ingredient|22 +1][tab][stack=nether_wart +2][br][stack=witchery:ingredient|37 +2][tab][stack=witchery:ingredient|29 +2][br][stack=diamond +2][tab][stack=nether_star|29 +4] -witchery:cauldronbook.power=[i Power] - Add, in order, before an [url=toc/effects effect] to increase its power.[br][br][stack=glowstone_dust +1 (to level II)][br][stack=blaze_rod +1 (to level III)][br][stack=witchery:ingredient|11 +1 (to level IV)] -witchery:cauldronbook.duration=[i Duration] - Add, in order, before an [url=toc/effects effect] to increase its duration.[br][br][stack=redstone +1 (to x2)][br][stack=obsidian +1 (to x4)][br][stack=witchery:seedsmindrake +1 (to x6)] - -witchery:cauldronbook.modifiers=[next=modifiers2][h1 Modifiers: General]These modifiers change the following effect.[br][br][stack=gold_nugget No particles][br][stack=fermented_spider_eye Invert next effect][br][stack=netherbrick Skip block effects][br][stack=brick Skip entity effects] -witchery:cauldronbook.modifiers2=[next=modifiers3][h1 Modifiers: Quaffing]Each quaffing bonus can be added once, before all effects, for a cumulative boost.[br][br][stack=witchery:ingredient|63 Faster quaffing][br][stack=witchery:ingredient|31 Faster quaffing][br][stack=witchery:spanishmoss Faster quaffing] -witchery:cauldronbook.modifiers3=[next=modifiers4][h1 Modifiers: Color]Change brew color.[br][stack=wool|0 White color][br][stack=wool|1 Orange color][br][stack=wool|2 Magenta color][br][stack=wool|3 Light blue color][br][stack=wool|4 Yellow color][br][stack=wool|5 Lime color] -witchery:cauldronbook.modifiers4=[next=modifiers5][h1 Modifiers: Color][stack=wool|6 Pink color][br][stack=wool|7 Gray color][br][stack=wool|8 Light gray color][br][stack=wool|9 Cyan color][br][stack=wool|10 Purple color][br][stack=wool|11 Blue color] -witchery:cauldronbook.modifiers5=[h1 Modifiers: Color][stack=wool|12 Brown color][br][stack=wool|13 Green color][br][stack=wool|14 Red color][br][stack=wool|15 Black color] - -witchery:cauldronbook.dispersal=[i Dispersal] - Add one, after any [url extent] or [url linger] modifiers, to set a splash effect.[br][br][stack=gunpowder or][stack=witchery:ingredient|69 Instant][br][stack=witchery:ingredient|24 Gas][br][stack=witchery:ingredient|111 Liquid][br][stack=skull|2][url=dispersaltrigger|middle Trigger] -witchery:cauldronbook.dispersaltrigger=[next=dispersaltrigger2][h1 Dispersal: Trigger - Brew]Brew the [url=brewing potion] then throw it at a button, lever, wooden door or pressure plate, to apply its effects to the next person who activates the block. -witchery:cauldronbook.dispersaltrigger2=[h1 Dispersal: Trigger - Ritual]Cast the brew as a [url=rituals ritual], then place any item on top of the cauldron, to imbue the item with its effects. The effects will be cast on the next creature to use the item. Repeat the ritual to add more charges to the item. -witchery:cauldronbook.extent=[i Disperal Extent] - Add, in order, before the [url dispersal] ingredient, to increase its area of effect.[br][br][stack=witchery:ingredient|18 +1 (to level II)][br][stack=dye|3 +1 (to level III)][br][stack=witchery:somniancotton +1 (to level IV)] -witchery:cauldronbook.linger=[i Disperal Lingering] - Add, in order, before the [url dispersal], to increase its duration.[br][br][stack=witchery:ingredient|21 +1 (to level II)][br][stack=dye|4 +1 (to level III)][br][stack=end_stone +1 (to level IV)] - -witchery:cauldronbook.toc/effects=[h1 Effects]Add after any [url power] and [url duration] boost or [url modifiers]. Ensure brew has [url capacity].[br][br]> [url Level 1][br]> [url Level 2][br]> [url Level 4][br]> [url Level 5][br]> [url Level 6][br]> [url Level 8][br]> [url Level 12] -witchery:cauldronbook.level1=[next=level1_2][h1 Effect: Level 1][stack=snowball][url=snowburst|middle Snow Burst & Trail][br][stack=fish|0][url=swimspeed|middle Swim Speed][br][stack=witchery:ingredient|67][url=enderinhibition|middle Ender Inhibition][br][stack=wheat][url=moonshine|middle Moonshine][br][stack=sand][url=partwater|middle Part water] -witchery:cauldronbook.level1_2=[next=level1_3][h1 Effect: Level 1][stack=coal|0][url=extinguish|middle Extinguish Fires][br][stack=stone][url=dissipategas|middle Dissipate Gas][br][stack=yellow_flower][url=growflowers|middle Grow flowers][br][stack=dye|15][url=fertilize|middle Fertilize][br][stack=apple][url=harvest|middle Harvest] -witchery:cauldronbook.level1_3=[next=level1_4][h1 Effect: Level 1][stack=dirt][url=tilling|middle Till land][br][stack=wheat_seeds][url=planting|middle Planting][br][stack=brown_mushroom][url=pruning|middle Prune Leaves][br][stack=string][url=felling|middle Fell tree][br][stack=flint][url=pulverize|middle Pulverize rock][br][stack=waterlily][url=growlily|middle Grow lily] -witchery:cauldronbook.level1_4=[h1 Effect: Level 1][stack=witchery:ingredient|156][url=wolfsbane|middle Wolfsbane][br][stack=dye|1][url=tinting|middle Tint skin *][br][br][i * can use any dye for the desired color.][br][br][stack=coal|1][url=combustion|middle Combustion *][br][br][i * cannot be combined with other effects.] - -witchery:cauldronbook.level2=[next=level2_2][h1 Effect: Level 2][stack=cobblestone][url=partlava|middle Part lava][br][stack=witchery:bramble][url=repel|middle Repel attacker][br][stack=gravel][url=brewgasimmunity|middle Brew gas immunity][br][stack=spider_eye][url=poison|middle Poison][br][stack=ghast_tear][url=regeneration|middle Regeneration][br][stack=fermented_spider_eye][stack=ghast_tear][url=poison|middle Poison] -witchery:cauldronbook.level2_2=[next=level2_3][h1 Effect: Level 2][stack=sugar][url=fastmove|middle Fast movement][br][stack=fermented_spider_eye][stack=sugar][url=slowmove|middle Slow movement[br][stack=fish|3][url=waterbreathing|middle Water breathing][br][stack=magma_cream][url=resistfire|middle Resist fire][br][stack=golden_carrot][url=nightvision|middle Night vision][br][stack=fermented_spider_eye][stack=golden_carrot][url=invisible|middle Invisible] -witchery:cauldronbook.level2_3=[next=level2_4][h1 Effect: Level 2][stack=blaze_powder][url=damageboost|middle Damage boost][br][stack=fermented_spider_eye][stack=blaze_powder][url=weakness|middle Weakness][br][stack=speckled_melon][url=heal|middle Heal][br][stack=fermented_spider_eye][stack=speckled_melon][url=harm|middle Harm][br][stack=reeds][url=floating|middle Floating] -witchery:cauldronbook.level2_4=[next=level2_5][h1 Effect: Level 2][stack=leather][url=jump|middle Jump][br][stack=feather][url=slowfall|middle Slow fall][br][stack=web][url=reflectarrows Reflect arrows][br][stack=fermented_spider_eye][stack=web][url=attractarrows|middle Attract arrows][br][stack=red_mushroom][url=poisonweapon|middle Poison weapon] -witchery:cauldronbook.level2_5=[next=level2_6][h1 Effect: Level 2][stack=witchery:ingredient|108][url=batburst|middle Bat burst][br][stack=witchery:ingredient|32][url=airhike|middle Air hike][br][stack=slime_ball][url=pull|middle Pull][br][stack=witchery:ingredient|30][url=erosion|middle Erosion][br][stack=netherrack][url=levelland|middle Level Land][br][stack=witchery:ingredient|56][url=webs|middle Webs] -witchery:cauldronbook.level2_6=[next=level2_7][h1 Effect: Level 2][stack=vine][url=vines|middle Vines & Flammable][br][stack=cactus][url=thorns|middle Cactus & Thorned][br][stack=witchery:ingredient|82][url=sprouting|middle Sprouting][br][stack=witchery:ingredient|78][url=freeze|middle Freeze][br][stack=stick][url=knockback|middle Knockback][br][stack=pumpkin][url=undeadbane|middle Undeadbane] -witchery:cauldronbook.level2_7=[next=level2_8][h1 Effect: Level 2][stack=red_flower|1][url=insectbane|middle Insectbane][br][stack=witchery:witchsapling|0][url=growtree|middle Grow rowan][br][stack=witchery:witchsapling|1][url=growtree|middle Grow alder][br][stack=witchery:witchsapling|2][url=growtree|middle Grow hawthorn][br][stack=sapling|5][url=growtree|middle Grow dark oak] -witchery:cauldronbook.level2_8=[next=level2_9][h1 Effect: Level 2][stack=sapling|0][url=growtree|middle Grow oak][br][stack=sapling|1][url=growtree|middle Grow spruce][br][stack=sapling|2][url=growtree|middle Grow birch][br][stack=sapling|3][url=growtree|middle Grow jungle][br][stack=sapling|4][url=growtree|middle Grow acacia][br][stack=witchery:ingredient|35][url=removebuffs|middle Remove Buffs] -witchery:cauldronbook.level2_9=[h1 Effect: Level 2][stack=witchery:ingredient|105][url=removedebuffs|middle Remove debuffs][br][stack=snow][url=endlesswater|middle Endless Water *][br][br][i * cannot be combined with other effects.] - -witchery:cauldronbook.level4=[next=level4_2][h1 Effect: Level 4][stack=witchery:glintweed][url=flames|middle Flames][br][stack=witchery:ingredient|80][url=fear|middle Fear][br][stack=dye|0][url=blindness|middle Blindness][br][stack=red_flower|0][url=love|middle Love][br][stack=witchery:ingredient|23][url=paralysis|middle Paralysis][br][stack=rotten_flesh][url=disease|middle Disease] -witchery:cauldronbook.level4_2=[next=level4_3][h1 Effect: Level 4][stack=witchery:ingredient|39][url=brewbottling|middle Brew bottling][br][stack=fermented_spider_eye][stack=witchery:ingredient|39][url=insanity|middle Insanity][br][stack=witchery:ingredient|99][url=sinking|middle Sinking][br][stack=witchery:embermoss][url=overheating|middle Overheating][br][stack=witchery:ingredient|103][url=nightmare|middle Nightmare][br][stack=witchery:ingredient|90][url=frogsleg|middle Frog's Leg] -witchery:cauldronbook.level4_3=[next=level4_4][h1 Effect: Level 4][stack=golden_apple][url=absorbtion|middle Absorption][br][stack=golden_apple|1][url=healthboost|middle Health boost][br][stack=witchery:ingredient|112][url=wasting|middle Wasting][br][stack=fermented_spider_eye][stack=witchery:ingredient|112][url=fullness|middle Fullness][br][stack=witchery:ingredient|36][url=revealing|middle Revealing][br][stack=tallgrass|0][url=volatility|middle Volatility] -witchery:cauldronbook.level4_4=[next=level4_5][h1 Effect: Level 4][stack=witchery:ingredient|28][url=stoutbelly|middle Stout belly][br][stack=poisonous_potato][url=blight|middle Blight][br][stack=ender_pearl][url=transpose|middle Transpose][br][stack=iron_ingot][url=transposeore|middle Transpose ore][br][stack=bone][url=raisedead|middle Raise dead][br][stack=quartz][url=raiseland|middle Raise land] -witchery:cauldronbook.level4_5=[next=level4_6][h1 Effect: Level 4][stack=soul_sand][url=gruesprey|middle Grue's Prey][br][stack=witchery:ingredient|34][url=absorbmagic|middle Absorb magic][br][stack=skull|1][url=wither|middle Wither][br][stack=witchery:ingredient|157][url=harmwerewolves|middle Harm Werewolves][br][stack=witchery:garlic][url=weakenvampires|middle Weaken Vampires] -witchery:cauldronbook.level4_6=[h1 Effect: Level 4][stack=witchery:ingredient|165][url=animalattraction|middle Animal attraction][br][stack=fermented_spider_eye][stack=witchery:ingredient|165][url=animalrepulsion|middle Animal replusion] - -witchery:cauldronbook.level5=[next=level5_2][h1 Effect: Level 5][stack=witchery:ingredient|38][url=inferno|middle Inferno][br][stack=gold_ingot][url=blast|middle Blast][br][stack=double_plant][url=poisontoad|middle Poison Toad][br][stack=ender_eye][url=iceworld|middle Ice World][br][stack=witchery:ingredient|79][url=iceshell|middle Ice shell][br][stack=witchery:ingredient|66][url=reflectdamage|middle Reflect damage] -witchery:cauldronbook.level5_2=[h1 Effect: Level 5][stack=ice][url=demonbane|middle Demonbane] - -witchery:cauldronbook.level6=[next=level6_2][h1 Effect: Level 6][stack=fish|1][url=undeadscurse|middle Undead's Curse][br][stack=witchery:bramble|1][url=illfitting|middle Ill Fitting][br][stack=witchery:ingredient|33][url=reincarnate|middle Reincarnate][br][stack=witchery:ingredient|74][url=durationboost|middle Duration Boost][br][stack=emerald][url=resizing|middle Resizing][br][stack=skull|0][url=stealbuffs|middle Steal buffs] -witchery:cauldronbook.level6_2=[stack=clay_ball][url=fortune|middle Fortune][br][stack=witchery:ingredient|114][url=drainmagic|middle Drain magic] - -witchery:cauldronbook.level8=[h1 Effect: Level 8][stack=witchery:ingredient|113][url=keepinventory|middle Keep inventory][br][stack=witchery:biomenote][url=shiftingseasons|middle Shifting seasons][br][stack=skull|4][url=spreaddebuffs|middle Spread debuffs][br][stack=witchery:ingredient|40][url=keepeffects|middle Keep effects] - -witchery:cauldronbook.level12=[h1 Effect: Level 12][stack=witchery:witchhat][url=leonard|middle Summon Leonard] - -witchery:cauldronbook.endlesswater=[h1 Effect: Endless water]This effect cannot be combined with any other. When complete, it will have a number of charges based on the power modifier. One charge can be used to create a water block or fill a cauldron. A dispensor can be used to fill or create water. -witchery:cauldronbook.growtree=[h1 Effect: Grow tree]Causes a tree to grow of the type used when creating the brew. Larger trees can be grown by increasing the power level of the effect. -witchery:cauldronbook.removebuffs=[h1 Effect: Remove buffs]Removes any positive potion effects from hit creatures, that are the same level or lower than that of the power of this effect. -witchery:cauldronbook.insectbane=[h1 Effect: Insect bane]Causes a small amount of damage to all creatures, and a lot of damage to insects. -witchery:cauldronbook.knockback=[h1 Effect: Knockback]Causes creatures to be pushed away from the impact location. The strength of the effect determines how far they are pushed back. -witchery:cauldronbook.undeadbane=[h1 Effect: Undead bane]Causes a small amount of damage to all creatures, and a lot of damage to undead. -witchery:cauldronbook.thorns=[h1 Effect: Thorns]Causes a cactus to grow, or an existing cactus to grow more. Creatures hit with this effect will gain a spikey coating that damages creatures that they walk in to. -witchery:cauldronbook.sprouting=[h1 Effect: Sprouting]Causes a large branch to sprout from the hit surface. Thrown under a creature causes them to ride the branch upwards. Creatures under this effect will occasionally sprout a small branch below them. -witchery:cauldronbook.freeze=[h1 Effect: Freeze]Causes the creature to become very cold, slowing them and at higher levels causing cold damage. Blazes will take more damage from this effect, based on its level. -witchery:cauldronbook.erosion=[h1 Effect: Erosion]This effect causes blocks to melt, instantly destorying any except obsidian (which is mearly broken). Creatures hit will take damage (as will armor they are wearing). -witchery:cauldronbook.levelland=[h1 Effect: Level land]Causes land to be levelled out to the height of the block hit. Blocks above will be removed, and space below will be filled in. The power level influences the area of effect and the number of air blocks that may be filled. -witchery:cauldronbook.webs=[h1 Effect: Webs]Causes a mass of webs to explode at the impact location, trapping creatures, or providing obstacles. -witchery:cauldronbook.airhike=[h1 Effect: Air hike]Throws hit creatures into the air. -witchery:cauldronbook.pull=[h1 Effect: Pull]Unpowered, pulls items and creatures to the impact location. When powered, will pull items and creatures towards the thrower. Very useful in commbination with harvest-type effects. -witchery:cauldronbook.batburst=[h1 Effect: Bat burst]Causes an explosion of bats. -witchery:cauldronbook.poisonweapon=[h1 Effect: Poison weapon]Attacks from an entity, under the influence of this effect, will cause poison to their target. -witchery:cauldronbook.attractarrows=[h1 Effect: Attract arrows]Projectiles in an area based on the power of this effect will home-in on the victim. -witchery:cauldronbook.reflectarrows=[h1 Effect: Reflect arrows]Projectiles targetting the creature under this effect will reflect back to their source. -witchery:cauldronbook.slowfall=[h1 Effect: Slow fall]Creatures under this effect will fall slowly to earth, taking no damage. -witchery:cauldronbook.jump=[h1 Effect: Jump]The jump height of creatures under this effect will be increased based on the power of the effect. -witchery:cauldronbook.floating=[h1 Effect: Floating]Creatures under this effect will float a little way above the ground untill the effect finsihes. The power level determines how high the creatures float. -witchery:cauldronbook.damageboost=[h1 Effect: Damage boost]Increases the attack damage of a creature. -witchery:cauldronbook.weakness=[h1 Effect: Weakness]Reduces the attack damage of a creature. -witchery:cauldronbook.heal=[h1 Effect: Heal]Heals a creature or player. Will harm undead. -witchery:cauldronbook.harm=[h1 Effect: Harm]Damages a creature or player (causes magic damage). Will heal undead. -witchery:cauldronbook.nightvision=[h1 Effect: Night vision]Allows a player to see clearly in the dark. -witchery:cauldronbook.invisible=[h1 Effect: Invisible]Makes a creature under this effect invisible. Their armor and held objects will not be invisible. -witchery:cauldronbook.fastmove=[h1 Effect: Fast movement]Causes a creature under this effect to move faster. -witchery:cauldronbook.slowmove=[h1 Effect: Slow movement]Causes a creature under this effect to move slower. -witchery:cauldronbook.waterbreathing=[h1 Effect: Water breathing]Allows a creature to breath underwater without running out of air. -witchery:cauldronbook.resistfire=[h1 Effect: Resist fire]Makes a creature immune to fire damage. -witchery:cauldronbook.partlava=[h1 Effect: Part lava]Tempoarily pushes back lava. -witchery:cauldronbook.repel=[h1 Effect: Repel attacker]Creature or players hitting a creature under this effect will be knocked back. -witchery:cauldronbook.poison=[h1 Effect: Poison]Causes damage over time to creatures under the effect. -witchery:cauldronbook.regeneration=[h1 Effect: Regeneration]Causes creatures under this effect to heal over time. -witchery:cauldronbook.harmwerewolves=[h1 Effect: Harm werewolves]Causes significant damage to werewolves and minor damage to other creatures. Cast as a ritual, will cause rain to fall. -witchery:cauldronbook.weakenvampires=[h1 Effect: Weaken vampires]Weakens vampire strength and can drain some of their power. - -witchery:cauldronbook.animalattraction=[h1 Effect: Animal Attraction]Will tame any untamed animals in a wide area, and cause animals to move towards the drinker. -witchery:cauldronbook.animalrepulsion=[h1 Effect: Animal Repulsion]Will untame any animals not tamed by the drinker and cause all animals to flee away. - -witchery:cauldronbook.flames=[h1 Effect: Flames]Causes a spread of flames, over an area determined by the power of the effect. -witchery:cauldronbook.blindness=[h1 Effect: Blindness]Causes hit creatures to be blinded. -witchery:cauldronbook.disease=[h1 Effect: Disease]Causes creatures under this effect to be weakened and to spread the disease further. -witchery:cauldronbook.insanity=[h1 Effect: Insanity]Creatures will see and hear things that do not exist. -witchery:cauldronbook.sinking=[h1 Effect: Sinking]Creatures will sink rapidly in water and be unable to fly. -witchery:cauldronbook.overheating=[h1 Effect: Overheating]Creature will catch fire in hot places. -witchery:cauldronbook.nightmare=[h1 Effect: Nightmare]Creatures will occasionally experience their nightmares when awake. -witchery:cauldronbook.absorbtion=[h1 Effect: Absorbsion]Creatures will find they are able to absorb slightly more damage. -witchery:cauldronbook.healthboost=[h1 Effect: Health boost]Creatures will find they have more health. -witchery:cauldronbook.wasting=[h1 Effect: Wasting]Creatures will become very hungry. -witchery:cauldronbook.fullness=[h1 Effect: Fullness]Reduces hunger. -witchery:cauldronbook.revealing=[h1 Effect: Revealing]Makes the invisible, visible. -witchery:cauldronbook.blight=[h1 Effect: Blight]Causes land and crops to die, and villagers to mutate. -witchery:cauldronbook.raisedead=[h1 Effect: Raise dead]Summons undead creatures to assist the summoner. -witchery:cauldronbook.raiseland=[h1 Effect: Raise land]Raises a glock of land with a radius determined by the power of the effect. -witchery:cauldronbook.gruesprey=[h1 Effect: Grue's Prey]Causes creatures under this effect to suffer damage in darkness. The power determines how dark in needs to be (more power = less dark). -witchery:cauldronbook.wither=[h1 Effect: Wither]Causes the victim to suffer damage and hunger until they die, or the effect ends. - -witchery:cauldronbook.demonbane=[h1 Effect: Demonbane]Causes a lot of damage to demons, and a little damage to other creatures. -witchery:cauldronbook.inferno=[h1 Effect: Inferno]Creatures under this effect will burn other creatures nearby. As a ritual, this may summon a demon if the correct circles are used. -witchery:cauldronbook.blast=[h1 Effect: Blast]Causes an explosion. -witchery:cauldronbook.poisontoad=[h1 Effect: Poison toad]Summons a toad that will explode causing nearby creatures to become poisoned. -witchery:cauldronbook.reflectdamage=[h1 Effect: Reflect damage]Redirect some damage back to its source. The higher the level, the more damage reflected. -witchery:cauldronbook.iceshell=[h1 Effect: Ice shell]Forms a hollow icy sphere at the impact location. More power increases the radius. Can be used underwater to create breatheable spaces. - -witchery:cauldronbook.fortune=[h1 Effect: Fortune]Players under this effect, become more fortunate when mining. -witchery:cauldronbook.undeadscurse=[h1 Effect: Undead's Curse]Creatures will be damage by sunlight. - -witchery:cauldronbook.snowburst=[h1 Effect: Snow burst & trail]Causes a light snow covering to burst over hit blocks. Creatures and players will start to leave snow trails (in not too hot biomes). Snowmen may suffer from too much snow. -witchery:cauldronbook.swimspeed=[h1 Effect: Swim speed]Increases movement speed in water. -witchery:cauldronbook.enderinhibition=[h1 Effect: Ender inhibition]Prevents teleportation of most creatures. Higher levels may be required to prevent more powerful teleportation effects and rituals. -witchery:cauldronbook.partwater=[h1 Effect: Part water]Temporarily pushes back water. -witchery:cauldronbook.extinguish=[h1 Effect: Extinguish fires]Extinguishes fires on blocks and creatures in an area. Harms blazes. -witchery:cauldronbook.dissipategas=[h1 Effect: Dissipate brew gas]Removes gas blocks created by a gas brew. When powered also removes other types of gas blocks. Harms spectral undead. -witchery:cauldronbook.growflowers=[h1 Effect: Grow flowers]Causes random flowers to grow on appropriate blocks. -witchery:cauldronbook.fertilize=[h1 Effect: Fertilize]Fertilizes the blocks in an areas in a similar way to bonemeal. -witchery:cauldronbook.harvest=[h1 Effect: Harvest]Breaks nearby harvestable plants, triggering their normal drops. A way of collecting them will still be needed. -witchery:cauldronbook.tilling=[h1 Effect: Tilling]Tills any applicable blocks in an area into farmland. -witchery:cauldronbook.pruning=[h1 Effect: Prune leaves]Removes any leave blocks in an area, triggering their normal drops. -witchery:cauldronbook.felling=[h1 Effect: Fell trees]Breaks any nearby log blocks, triggering their normal drops. -witchery:cauldronbook.growlily=[h1 Effect: Grow lily]Causes a lily to rapidly grow if triggered in water. The lily may expand depending on the brew's power level. -witchery:cauldronbook.tinting=[h1 Effect: Tint skin]Changes the hue of the creature or player's skin to that of the selected dye. - -witchery:cauldronbook.transpose=[next=transpose2][h1 Effect: Transpose]In a brew, this effect will randomly teleport the target a short distance.[br][br]Two ritual casting are possible. Either use a a waystone to target a destination, and finally add a taglock to indentify the target. -witchery:cauldronbook.transpose2=[next=transpose3][h1 Effect: Transpose]The second ritual casting, requires the source location to be added as a waystone [i before] the ender pearl is added.[br][br]The destination needs to be added with a waystone [i after] the ender pearl. -witchery:cauldronbook.transpose3=[h1 Effect: Transpose]The source [i must] be surrounded by a medium otherwhere circle.[br][br][img=witchery:textures/gui/circles_mpurple.png|center|top|32|32] - -witchery:cauldronbook.transposeore=[h1 Effect: Transpose Ore]Breaks ore blocks in a sphere based on the power. Higher power levels break rarer ores. You may need a way to pull the ores to you. -witchery:cauldronbook.frogsleg=[h1 Effect: Frog's Leg]Multi-jump, allows an additional jump in the air for each power level. Only works on witches with a toad familiar. -witchery:cauldronbook.fear=[h1 Effect: Fear]Creatures are too scared to approach. - -witchery:cauldronbook.removedebuffs=[h1 Effect: Remove Debuffs]Removes curable potion effects of the same level or less. Cast as a ritual can remove incurable effects. Level III+ to remove the disease effect. -witchery:cauldronbook.paralysis=[h1 Effect: Paralysis]Cause a creature to freeze in place. Level III+ to also freeze players. -witchery:cauldronbook.combustion=[h1 Effect: Combustion]Creates a potion that may be used as a fuel source in furnaces. The higher the power the longer the burn. - -witchery:cauldronbook.illfitting=[h1 Effect: Ill Fitting]Causes clothing to slip off the victim when the effect countdown finishes. The higher the level, the more chance of multiple losses. -witchery:cauldronbook.leonard=[h1 Leonard]A demon from medieval times, who can preside over a ritual to allow it to affect targets in other dimensions. When summoned he is unlikely to want to leave, unless defeated. - -witchery:cauldronbook.durationboost=[h1 Effect: Duration boost]Boosts the duration of any currently active potion effects. Cannot be used when Quesy. -witchery:cauldronbook.absorbmagic=[h1 Effect: Absorb magic]Convert magical damage into infusion power. -witchery:cauldronbook.reincarnate=[h1 Effect: Reincarnate]When the creature dies, they will be reincarnated as another creature, the power of which is determined by the potion power. -witchery:cauldronbook.moonshine=[h1 Effect: Moonshine]Alcohol makes you feel less pain, but get hungry instead, and occasionally dizzy. -witchery:cauldronbook.stoutbelly=[h1 Effect: Stout belly]Removes the dizzy effects of [url Moonshine]. -witchery:cauldronbook.brewgasimmunity=[h1 Effect: Brew gas immunity]Makes you immune to negative effects from brew-based gas clouds -witchery:cauldronbook.drainmagic=[h1 Effect: Drain magic]Drains the magical power from the victim. -witchery:cauldronbook.keepinventory=[h1 Effect: Keep inventory]Keep your inventory items when you die. -witchery:cauldronbook.shiftingseasons=[h1 Effect: Shifting seasons]Change the targeted location to a new biome. The biome in the Biome Note determines the target biome. -witchery:cauldronbook.keepeffects=[h1 Effect: Keep effects]Keep active beneficial potion effects on death. -witchery:cauldronbook.spreaddebuffs=[h1 Effect: Spread debuffs]Spread any curable negative potions of one level below this potions level to all creatures in a wide area. - -witchery:cauldronbook.brewbottling=[h1 Effect: Brew bottling]Increases the number of bottles of brew a [i skilled] witch may make. -witchery:cauldronbook.planting=[h1 Effect: Planting]Plants any seeds that have been dropped on the floor nearby. -witchery:cauldronbook.pulverize=[h1 Effect: Pulverize]Smashes nearby blocks into increasing fragmented block types. Stone to gravel to sand. -witchery:cauldronbook.vines=[h1 Effect: Vines]Creates climbable vines on a solid surface, at higher levels will even extend the vines to the ground through the air. Creatures hit will become more flammable. -witchery:cauldronbook.love=[h1 Effect: Love]Animals, villagers and zombies will try to mate. -witchery:cauldronbook.volatility=[h1 Effect: Volatility]Creatures hit with this effect, become explosively fragile to hits. -witchery:cauldronbook.iceworld=[h1 Effect: Ice world]Turns blocks and other structures to snow and ice. -witchery:cauldronbook.resizing=[h1 Effect: Resizing]Changes the size of the hit creature:[br][br]> Level I: 1/4 size[br]> Level II: 1/2 size[br]> Level III: 1.5x size[br]> Level IV: 2x size. -witchery:cauldronbook.stealbuffs=[h1 Effect: Steal buffs]Remove all of the positive effects from creatures in a wide area, and apply them to yourself. - - -witchery:cauldronbook.wolfsbane=[h1 Effect: Wolfsbane]Prevents a werewolf from shapeshifting, thus locking it in its current form untill the potion wears off. The power of the effect determines how effective it is against more powerful werewolves. - -witchery.brewing.ingredientpowercost=Altar power cost: %d (for rituals: %d) - -item.witchery:mooncharm.name=Moon Charm -item.witchery:mooncharm.tip=Helps lycanthropes force a transformation. -tile.witchery:wolfaltar.name=Wolf Altar -item.witchery:silversword.name=Silver Sword -item.witchery:silversword.tip=2x unblockable damage against werewolves. -item.witchery:ingredient.boltSilver.name=Silver Bolt -entity.witchery.wolfman.name=Werewolf -entity.witchery.hellhound.name=Hellhound -entity.witchery.werevillager.name=Villager -item.witchery:seedswolfsbane.name=Wolfsbane Seeds -item.witchery:ingredient.wolfsbane.name=Wolfsbane -item.witchery:ingredient.silverdust.name=Silver Deposits -item.witchery:ingredient.muttonraw.name=Raw Lambchop -item.witchery:ingredient.muttoncooked.name=Cooked Lambchop -item.witchery:wolfhead.wolf.name=Wolf Head -item.witchery:wolfhead.hellhound.name=Hellhound Head -tile.witchery:wolfhead.name=Wolf Head -tile.witchery:wolfhead.wolf.name=Wolf Head -tile.witchery:wolfhead.hellhound.name=Hellhound Head -tile.witchery:wolfsbane.name=Wolfsbane -tile.witchery:silvervat.name=Silver Vat -witchery:potion.wolfsbane=Wolfsbane -witchery:brew.harmwerewolves=Harm Werewolves -item.witchery:hornofthehunt.name=Horn of the Hunt -item.witchery:hornofthehunt.tip=Calls forth the Horned Huntsman then vanishes. -item.witchery:wolftoken.name=Creative Bat/Wolf Token -item.witchery:wolftoken.tip=(creative only)|Use to cycle through werewolf levels.|Sneak-use to cycle through vampire levels. -tile.witchery:beartrap.name=Beartrap -tile.witchery:wolftrap.name=Wolftrap - -witchery.nosleep.wolf=You cannot sleep in wolf form! -witchery.nosleep.resized=You cannot sleep while resized! - -witchery.werewolf.infection=Your sense of smell seems a little stronger. -witchery.rite.wolfcurse.alreadyactive=The target is already under the curse. -witchery.rite.wolfcurse.nothuman=The target is not a normal villager or player. -witchery.rite.wolfcurse.notactive=The target is not under the curse. -witchery.rite.wolfcurse.requiresfullmoon=Perform under a full moon. -witchery.rite.wolfcurse.requirescat=A cat familiar is required. -witchery.rite.wolfcurse.requiresfullcoven=A full coven of six additional witches is required. -witchery.rite.wolfcurse.toofar=The werewolf is too powerful, and must be within the circle for the cure to work. - -witchery.rite.wolfcurse.book=Curse of the Wolf{r||Perform under a full moon with a full coven. -witchery.rite.wolfcure.book=Rite of Remove Curse{r||Cleanse the taglocked being of lycanthropy. - -witchery.werewolf.setlevel=Werewolf level set to %s. -witchery.werewolf.chunkvisited=You feel as if you have already been here. -witchery.werewolf.mooncharmcrafted=The voice rumbles, "DO NOT LOSE IT AGAIN!" -witchery.werewolf.notworthy=A voice echoes in your head, "YOU ARE UNWORTHY!" - -witchery.werewolf.level2begin=A voice echoes, "%s INGOTS OF GOLD, GIVE THEM TO ME!" -witchery.werewolf.level2progress=A deep voice bellows, "%s INGOTS OF GOLD ARE SOUGHT, YOU LACK %s!" -witchery.werewolf.level2complete=The voice rumbles, "GOLD IS GIVEN, A CHARM IS MADE, LET THE BEAST WITHIN BE FREED, AND THE MOON HAVE NO SWAY!" - -witchery.werewolf.level3begin=The voice intones, "STRENGTHEN YOUR CLAWS, REND THE FLESH FROM %s OF THE WEAKEST OF PREY, PLACE THEIR MUTTON BEFORE ME!" -witchery.werewolf.level3progress=The voice echoes, "SLAY %s AND BRING THEIR FLESH, YOU REQUIRE %s MORE!" -witchery.werewolf.level3complete=The voice bellows, "MEAT TORN FROM THE WEAKEST, CLAWS LIKE STEEL TEMPERED, TO RIP THE EARTH AND FLESH, THE BEASTS HUNGER NEVER SATED!" - -witchery.werewolf.level4begin=The voice rumbles, "THE FANGS OF THE ALPHA MUST BE HONED, RIP THE THROAT FROM %s LESSER WOLVES AND BRING ME THEIR TONGUES!" -witchery.werewolf.level4progress=The voice echoes, "DOMINATE %s, %s REMAIN!" -witchery.werewolf.level4complete=The voice bellows, "THE PACK IS HUNGERING, FANGS FEAST ON THE KILL, A NEW ALPHA RISES, FROM THE SLAIN EAT YOUR FILL!" - -witchery.werewolf.level5begin=The voice rumbles, "THE WOLF AND THE MAN MUST BECOME ONE, SLAY THE HORNED LORD OF THE WILD HUNT! CALL HIM FORTH WITH THIS HORN AND LAND THE KILLING BLOW!" -witchery.werewolf.level5progress=The voice echoes, "THE HUNTSMAN LIES UNDEFEATED! SUMMON HIM WITH THE HORN AND LAND THE KILLING BLOW!" -witchery.werewolf.level5complete=The voice bellows, "A MIGHTY CHAMPION DEFEATED, STANDING TALL THE VICTOR, THE BEAST IS FULLY AWOKEN, HUNT NOW ON TWO LEGS OR FOUR!" - -witchery.werewolf.level6begin=The voice growls, "BUILD POWERFUL MUSCLES TO SMASH YOUR PREY, LEAP AT %s MONSTERS, AND FROM THE AIR SLAY!" -witchery.werewolf.level6progress=The voice rumbles, "SLAY %s FROM THE AIR WAS BIDDEN, %s REMAIN!" -witchery.werewolf.level6complete=The voice proclaims, "DEATH FROM ABOVE, LIKE LIGHTNING YOU STRIKE, SPRINT NOW WHEN YOU HIT, TO QUICKLY END THE FIGHT!" - -witchery.werewolf.level7begin=The voice bellows, "OTHERS MUST LEARN TO FEAR YOU, TRAVEL THE LAND AT NIGHT, IN %s PLACES LOOK TO THE SKY AND LET YOUR WOLFS VOICE BE HEARD!" -witchery.werewolf.level7progress=The voice intones, "HOWL AT THE NIGHT SKY IN %s PLACES, %s REMAIN!" -witchery.werewolf.level7complete=The voice growls, "YOUR VOICE IS HEARD, YOUR COMING NOT CHEERED, AS WOLFMAN CRY OUT, LET YOUR FOES FREEZE IN FEAR!" - -witchery.werewolf.level8begin=The voice echoes, "MASTER THE PACK! AS A WOLF, FIND AND BEND %s WOLVES TO YOUR WILL!" -witchery.werewolf.level8progress=The voice intones, "FORM A PACK OF %s WOLVES. YOU HAVE YET TO MASTER %s!" -witchery.werewolf.level8complete=The voice rumbles, "THE ALPHA OF THE PACK, MASTERY IS ACHIEVED, HOWL AT THE SKY, TO CALL YOUR SERVANTS AT NEED." - -witchery.werewolf.level9begin=The voice bellows, "CLAWS AS KNIVES, AS WOLFMAN YOU MUST HUNT, SLAY %s OF THE PIGS THAT IN THE NETHER GRUNT!" -witchery.werewolf.level9progress=The voice intones, "AS WOLFMAN, HUNT %s NETHER PIGS, %s MUST BE FOUND!" -witchery.werewolf.level9complete=The voice proclaims, "INFERNAL FOES ARE DEFEATED, CLAWS HONED TO AN EDGE, ARMOR LIKE PAPER, YOU WILL NOW RIP TO SHREADS!" - -witchery.werewolf.level10begin=The voice bellows, "TAKE THE LIFE OF ANOTHER, FROM VILLAGE OR FRIEND, THEN YOU'LL BE GRANTED THE FAVOUR, MY BLESSING TO SPREAD!" -witchery.werewolf.level10progress=The voice echoes, "SLAY ONE FROM A VILLAGE, OR ONE SUCH AS YOU!" -witchery.werewolf.level10complete=The voice exclaims, "YOU HAVE MASTERED MY PATH, NOW SPREAD MY BLESSING!" - -item.witchery:hunterhatsilvered.name=Witch Hunter Hat (Silvered) -item.witchery:hunterhatsilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:huntercoatsilvered.name=Witch Hunter Coat (Silvered) -item.witchery:huntercoatsilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:hunterlegssilvered.name=Witch Hunter Trousers (Silvered) -item.witchery:hunterlegssilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:hunterbootssilvered.name=Witch Hunter Boots (Silvered) -item.witchery:hunterbootssilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 - -entity.witchery.villageguard.name=Guard -entity.witchery.vampire.name=Vampire -item.witchery:coffin.name=Coffin -item.witchery:garlic.name=Garlic -tile.witchery:garlicplant.name=Garlic -tile.witchery:coffinblock.name=Coffin -witchery.nosleep.dayonly=Vampires can only sleep during the day -witchery.nosleep.closedcoffin=Coffin is not open -tile.witchery:garlicgarland.name=Garlic Garland -tile.witchery:bloodedwool.name=Blood-stained Wool - -tile.witchery:shadedglass_active.black.name=Black Shaded Glass -tile.witchery:shadedglass_active.red.name=Red Shaded Glass -tile.witchery:shadedglass_active.green.name=Green Shaded Glass -tile.witchery:shadedglass_active.brown.name=Brown Shaded Glass -tile.witchery:shadedglass_active.blue.name=Blue Shaded Glass -tile.witchery:shadedglass_active.purple.name=Purple Shaded Glass -tile.witchery:shadedglass_active.cyan.name=Cyan Shaded Glass -tile.witchery:shadedglass_active.silver.name=Silver Shaded Glass -tile.witchery:shadedglass_active.gray.name=Gray Shaded Glass -tile.witchery:shadedglass_active.pink.name=Pink Shaded Glass -tile.witchery:shadedglass_active.lime.name=Lime Shaded Glass -tile.witchery:shadedglass_active.yellow.name=Yellow Shaded Glass -tile.witchery:shadedglass_active.light_blue.name=Light Blue Shaded Glass -tile.witchery:shadedglass_active.magenta.name=Magenta Shaded Glass -tile.witchery:shadedglass_active.orange.name=Orange Shaded Glass -tile.witchery:shadedglass_active.white.name=White Shaded Glass - -tile.witchery:shadedglass.black.name=Black Shaded Glass -tile.witchery:shadedglass.red.name=Red Shaded Glass -tile.witchery:shadedglass.green.name=Green Shaded Glass -tile.witchery:shadedglass.brown.name=Brown Shaded Glass -tile.witchery:shadedglass.blue.name=Blue Shaded Glass -tile.witchery:shadedglass.purple.name=Purple Shaded Glass -tile.witchery:shadedglass.cyan.name=Cyan Shaded Glass -tile.witchery:shadedglass.silver.name=Silver Shaded Glass -tile.witchery:shadedglass.gray.name=Gray Shaded Glass -tile.witchery:shadedglass.pink.name=Pink Shaded Glass -tile.witchery:shadedglass.lime.name=Lime Shaded Glass -tile.witchery:shadedglass.yellow.name=Yellow Shaded Glass -tile.witchery:shadedglass.light_blue.name=Light Blue Shaded Glass -tile.witchery:shadedglass.magenta.name=Magenta Shaded Glass -tile.witchery:shadedglass.orange.name=Orange Shaded Glass -tile.witchery:shadedglass.white.name=White Shaded Glass - -item.witchery:glassgoblet.name=Glass Goblet -item.witchery:glassgoblet.full=Glass Goblet (full) -item.witchery:glassgoblet.tip=Blood: {4%s{0 -item.witchery:glassgoblet.chicken=Chicken -item.witchery:glassgoblet.lilith=Lilith -item.witchery:glassgoblet.convertingplayermustsleep=Victim must be asleep -item.witchery:glassgoblet.targetnotdrained=Victim must be drained of blood -item.witchery:glassgoblet.targetnottransfixed=Victim is not mesmerized -item.witchery:glassgoblet.nocoffinnear=There is no coffin nearby -item.witchery:glassgoblet.notenoughblood=Half a droplet of blood is needed to fill the glass -item.witchery:glassgoblet.nothighenoughlevel=Your blood is not yet strong enough for this task -item.witchery:glassgoblet.nothinghappens=Nothing happens -item.witchery:glassgoblet.seemswrong=This does not seem correct -item.witchery:glassgoblet.lilithquest=A voice sings, "Bring my daughter to the lakes of fire in the netherworld" -item.witchery:glassgoblet.lilithquestsummon=Are you worthy of my mistress? -item.witchery:glassgoblet.lilithquestsummon2=My mistress is here... -item.witchery:glassgoblet.lilithquestcomplete=You are worthy... this time... do you desire magic, or death? -item.witchery:glassgoblet.lilithquestcomplete2=If you wish magic, give me an item to enchant. -item.witchery:glassgoblet.lilithquestcompletelife=I take your blood, and gift you mine, drink quickly... -item.witchery:glassgoblet.lilithquestcompletemagic=Take this, as a gift... -item.witchery:glassgoblet.lilithquestcompletelifefail=My child, you have no need of my blood... -item.witchery:glassgoblet.lilithquestcompletecure=If you so wish it, your are mortal once more... -item.witchery:glassgoblet.lilithquestcompletecurefail=Such a thing is meaningless... -item.witchery:glassgoblet.lilithquestcompletebatflight=My child, I grant you freedom... -item.witchery:glassgoblet.lilithquestcompletebatflightfail=You flatter me, but no... - -item.witchery:sungrenade.name=Sun Grenade -item.witchery:stew.name=Meaty Stew -item.witchery:stewraw.name=Raw Meaty Stew -item.witchery:canesword.name=Cane Sword -item.witchery:canesword.tip=Sneak-Use to draw/sheathe.|Siphons blood of kills to an internal|resevoir, use when sheathed to extract.|{4Blood resevoir: %d{0 -tile.witchery:daylightcollector.name=Sun Collector -tile.witchery:bloodcrucible.name=Blood Crucible - -entity.witchery.lilith.name=Lilith -entity.witchery.follower.name=Follower -entity.witchery.follower.elle.name=Elle -entity.witchery.wingedmonkey.name=Winged Monkey -witchery:brew.weakenvampires=Weaken Vampires - -witchery.village.reptoolow=Your reputation is too low to promote guards. -witchery.village.villagetoosmall=This village is too small for more guards. -witchery.village.toomanyguards=This village already has a full complement of guards. -witchery.village.villagerrefusesguardduty=I don't want to be a guard! -witchery.village.villageracceptsguardduty=By your command! - -witchery.book.herbology.wolfsbane=Its name is the clue, the werewolf's secret it does undo. It grows in tilled earth in stages. Tall grass yields seeds. -witchery.book.herbology.garlic=A flavor for food at day, at night it keeps vampires away. It grows in tilled earth in stages. Tall grass yields seeds. - -item.witchery:ingredient.darkCloth.name=Woven Cruor -item.witchery:ingredient.warmBlood.name=Warm Blood -item.witchery:ingredient.lilithsBlood.name=Lilith's Blood -item.witchery:ingredient.stake.name=Wooden Stake -item.witchery:ingredient.vbookPage.name=Torn Page -item.witchery:vampirebook.name=Observations of an Immortal -item.witchery:vampirebook.tip=A doomed scholar's account of discourse with the undead. - -witchery.rite.vampirecure.book=Rite of Remove Curse{r||Cleanse the taglocked being of vampirism. - -witchery.rite.wolfcurse.hybridsnotallow=Vampire/Werewolf hybrids are not allowed -witchery.vampirepower.feed=Drink Blood -witchery.vampirepower.eye=Transfix / Toggle Night Vision -witchery.vampirepower.speed=Speed -witchery.vampirepower.bat=Toggle Bat Form -witchery.vampirepower.unone=None -witchery.vampirepower.ubats=Bat Swarm (%d) -witchery.vampirepower.uteleport=Teleport (%d) -witchery.vampirepower.ustorm=Call Storm (%d) - -witchery:vampirebook.toc=[next=ritual1][h1 Observations of an Immortal][br][br][br][darkred A doomed scholar's account of discourse with the undead] -witchery:vampirebook.ritual1=[next=ritual2]It is with some reluctance I commit these observations to paper, for what I have witnessed is not for the weak of mind. Instead, take my words as a warning... -witchery:vampirebook.ritual2=[next=ritual3][br]...he was reminiscing over dinner this evening about his "birth", a demonic pact of sorts...[br][br]...butchering a chicken over a skull with a boline and holding a glass goblet to collect the blood is barbaric," I told him... -witchery:vampirebook.ritual3=[next=ritual4][br]...apparently start of a long forgotten rite (I made a sketch...[br][img=witchery:textures/gui/vritual.png|center|middle|64|64][br]...night, open to the moon, string, red dust, torches and skull... -witchery:vampirebook.ritual4=[next=ritual5][br][br]...pouring the blood onto the skull...[br][br]...mumbling about taking her to the lakes of lava... ...underworld... -witchery:vampirebook.ritual5=[next=transfix|1][br]...proving his worth to Her...[br][br][br]...that glass goblet again, could someone really drink such a thing? ... -witchery:vampirebook.transfix=[next=knockback|2][br]...Today, or should I say this evening, he told me of his first kill...[br][br][br]...the thirst that first night, he said, was overwhelming, he had to fully sait his hunger... -witchery:vampirebook.knockback=[next=speed|3]...he found he was able to transfix his victims...[br][br]...was now able to drink as he needed without others realizing, so long as he did not drain more than half...[br][br]...did so, from five oblivious souls... -witchery:vampirebook.speed=[next=resistsun|4][br]...strength was flowing into him, the more he drank, as the nights progressed, the stronger he became...[br][br]...it was on the forth night after his mastery of drinking, that the world slowed down... -witchery:vampirebook.resistsun=[next=smashstone|5]...his greatest foe, the sun, was ever present, tormenting and instantly deadly to him...[br][br]...became his obsession... ...found a way to collect sunlight and burnt himself with it ten times during the night... -witchery:vampirebook.smashstone=[next=bats|6]...first walk in the sun after his rebirth brought him to bloody tears, he felt his blood burning, but no longer instantly...[br][br]...he needed more strength, and extingishing creatures of pure fire was his solution...[br]...twenty died. -witchery:vampirebook.bats=[next=mesmerize|7]...he could smash solid stone, but bound to the earth, however fast, he was still limited...[br][br]...he called on Her once more, repeating the rite of his rebirth...[br][br]...gifted Her a flower, the color of the blood She so craves... -witchery:vampirebook.mesmerize=[next=maker|8]...he smiled, a rare event, when he told me of his first flight...[br][br]...he flew from village to village, untill he knew the full extent of his domain, there was now nowhere he could not go... -witchery:vampirebook.maker=[next=maker2|8]...the weak minded would now not only let him drink his fill, but would also follow like faithful hounds...[br][br]...horror of all horrors, he lured five of them to specially prepared iron cages, topped with wood and with a gap at the front. He sealed them inside... -witchery:vampirebook.maker2=[next=finalpowers|9][img=witchery:textures/gui/vcage.png|center|middle|64|64][br][br]...he began feeding from each of them; mezmerising them first, then carefully he drank all he could, without damaging any... -witchery:vampirebook.finalpowers=At last he knew his blood was strong enough to replicate what She had done for him... ...left me weak, close to oblivion, but I watched him fill a glass goblet and hand it to me... ...we both sat next to a coffin, far from the sun's gaze, "drink!" is all he said... - -witchery.vampire.setlevel=Vampire level set to %s. -witchery:death.attack.sun=%1$s burnt to a crisp in the sun -witchery:death.attack.sun.player=%1$s burnt to a crisp in sunlight whilst fighting %2$s -death.attack.sun=%1$s burnt to a crisp in the sun -death.attack.sun.player=%1$s burnt to a crisp in sunlight whilst fighting %2$s -item.witchery:vampirehat.name=Vampire Top Hat -item.witchery:vampirehat.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance -item.witchery:vampirehelmet.name=Vampire Helmet -item.witchery:vampirehelmet.tip=Set bonuses:|2 pieces - Fire resistance -item.witchery:vampirecoat.name=Vampire Dress Coat -item.witchery:vampirecoat.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance -item.witchery:vampirecoat_female.name=Vampire Dress Jacket (Ladies) -item.witchery:vampirecoat_female.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance -item.witchery:vampirechaincoat.name=Vampire Chain Coat -item.witchery:vampirechaincoat.tip=Set bonuses:|2 pieces - Fire resistance -item.witchery:vampirechaincoat_female.name=Vampire Chain Coat (Ladies) -item.witchery:vampirechaincoat_female.tip=Set bonuses:|2 pieces - Fire resistance -item.witchery:vampirelegs.name=Vampire Trousers -item.witchery:vampirelegs.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance -item.witchery:vampirelegs_kilt.name=Vampire Skirted Trousers -item.witchery:vampirelegs_kilt.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance -item.witchery:vampireboots.name=Vampire Oxford Boots -item.witchery:vampireboots.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance - -item.witchery:hunterhatgarlicked.name=Witch Hunter Dawn Hat -item.witchery:hunterhatgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:huntercoatgarlicked.name=Witch Hunter Dawn Coat -item.witchery:huntercoatgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:hunterlegsgarlicked.name=Witch Hunter Dawn Trousers -item.witchery:hunterlegsgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 -item.witchery:hunterbootsgarlicked.name=Witch Hunter Dawn Boots -item.witchery:hunterbootsgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 - - -tile.witchery:mirrorblock.name=Mirror -tile.witchery:mirrorblock2.name=Mirror -tile.witchery:mirrorwall.name=Mirror Surface -item.witchery:mirror.name=Mirror -item.witchery:dupgrenade.name=Duplication Grenade -item.witchery:dupgrenade.tip={3Reflection of: %s{0 -item.witchery:mirror.tip.bridge={5Hollow{0 -item.witchery:mirror.tip.bridgeplus={5Hollow (%s: %d, %d, %d){0 -item.witchery:mirror.tip.inhabited={3Inhabited{0 -entity.witchery.reflection.name=Reflection -item.witchery:ingredient.heartofgold.name=Heart of Gold - -witchery.rite.infusionmirror=Rite of Infusion{r||Trap a Demon into a mirror. -witchery:brew.animalattraction=Animal Attraction -witchery:brew.animalrepulsion=Animal Repulsion -witchery.rite.summonreflection=Rite of Summoning{r||Call forth the demon from a mirror. The inner area must be clear 7x7x4 blocks! -witchery.rite.eclipse.cooldown=The Rite of Total Eclipse has been used recently in this world, wait a while. -witchery.rite.mirrormirror.playersseen=Furthermore, other than thee, others have stood before me: %s -witchery.rite.mirrormirror.playersnotseen=Furthermore, other than thee, no others have stood before me. -witchery.rite.mirrormirror.escapecooldown=Chant fails, cooldown is active (%s seconds remain) - -witchery.rite.mirrormirrorsendmehome=mirror mirror send me home -witchery.rite.mirrormirrorigiveup=mirror mirror i give up -witchery.rite.mirrormirror=<%s> Mirror, mirror, on the wall, who is the fairest one of all? -witchery.rite.mirrormirror.anotherf=Fair indeed you may be. But hold, another do I see. Alas, she is more fair than thee. -witchery.rite.mirrormirror.anotherm=Fair indeed you may be. But hold, another do I see. Alas, he is more fair than thee. -witchery.rite.mirrormirror.anotherplayer=Fair indeed you may be. But hold, another do I see. Alas, they are more fair than thee. -witchery.rite.mirrormirror.you=In all the world I cannot see, one that is more fair than thee. -witchery.rite.mirrormirror.bearing0=North is where the fairest will be. -witchery.rite.mirrormirror.bearing1=North East is where the fairest will be. -witchery.rite.mirrormirror.bearing2=East is where the fairest will be. -witchery.rite.mirrormirror.bearing3=South East is where the fairest will be. -witchery.rite.mirrormirror.bearing4=South is where the fairest will be. -witchery.rite.mirrormirror.bearing5=South West is where the fairest will be. -witchery.rite.mirrormirror.bearing6=West is where the fairest will be. -witchery.rite.mirrormirror.bearing7=North West is where the fairest will be. - -witchery.rite.mirrormirror.opchatreveal=In next message, player "%s" is really: "%s" \ No newline at end of file +itemGroup.tabWitchery=Witchery + +item.witchery:ingredient.candelabra.name=Candelabra +item.witchery:ingredient.chalice.name=Chalice +item.witchery:ingredient.chaliceFull.name=Chalice (Filled) +item.witchery:ingredient.weaveMoveFast.name=Dream Weaver of Fleet Foot +item.witchery:ingredient.weaveDigFast.name=Dream Weaver of Iron Arm +item.witchery:ingredient.weaveSaturation.name=Dream Weaver of Fasting +item.witchery:ingredient.weaveNightmares.name=Dream Weaver of Nightmares +item.witchery:ingredient.boneNeedle.name=Bone Needle +item.witchery:ingredient.broom.name=Broom +item.witchery:ingredient.broomEnchanted.name=Enchanted Broom +item.witchery:ingredient.attunedStone.name=Attuned Stone +item.witchery:ingredient.attunedStoneCharged.name=Attuned Stone (Charged) +item.witchery:ingredient.waystone.name=Waystone +item.witchery:ingredient.waystoneBound.name=Bound Waystone +item.witchery:ingredient.mutandis.name=Mutandis +item.witchery:ingredient.mutandisExtremis.name=Mutandis Extremis +item.witchery:ingredient.quicklime.name=Quicklime +item.witchery:ingredient.gypsum.name=Gypsum +item.witchery:ingredient.ashWood.name=Wood Ash +item.witchery:ingredient.seedsBelladonna.name=Stale Belladonna Seeds +item.witchery:ingredient.seedsMandrake.name=Stale Mandrake Seeds +item.witchery:ingredient.belladonna.name=Belladonna Flower +item.witchery:ingredient.mandrakeRoot.name=Mandrake Root +item.witchery:ingredient.demonHeart.name=Demon Heart +item.witchery:ingredient.batWool.name=Wool of Bat +item.witchery:ingredient.dogTongue.name=Tongue of Dog +item.witchery:ingredient.clayJarSoft.name=Soft Clay Jar +item.witchery:ingredient.clayJar.name=Clay Jar +item.witchery:ingredient.foulFume.name=Foul Fume +item.witchery:ingredient.diamondVapour.name=Diamond Vapor +item.witchery:ingredient.oilOfVitriol.name=Oil of Vitriol +item.witchery:ingredient.exhaleOfTheHornedOne.name=Exhale of the Horned One +item.witchery:ingredient.breathOfTheGoddess.name=Breath of the Goddess +item.witchery:ingredient.hintOfRebirth.name=Hint of Rebirth +item.witchery:ingredient.whiffOfMagic.name=Whiff of Magic +item.witchery:ingredient.reekOfMisfortune.name=Reek of Misfortune +item.witchery:ingredient.odourOfPurity.name=Odour of Purity +item.witchery:ingredient.tearOfTheGoddess.name=Tear of the Goddess +item.witchery:ingredient.refinedEvil.name=Refined Evil +item.witchery:ingredient.dropOfLuck.name=Drop of Luck +item.witchery:ingredient.redstoneSoup.name=Redstone Soup +item.witchery:ingredient.flyingOintment.name=Flying Ointment +item.witchery:ingredient.ghostOfTheLight.name=Ghost of the Light +item.witchery:ingredient.soulOfTheWorld.name=Soul of the World +item.witchery:ingredient.spiritOfOtherwhere.name=Spirit of Otherwhere +item.witchery:ingredient.infernalAnimus.name=Infernal Animus +item.witchery:ingredient.bookOven.name=Witchcraft: Collecting Fumes +item.witchery:ingredient.bookDistilling.name=Witchcraft: Distilling +item.witchery:ingredient.bookCircleMagic.name=Witchcraft: Circle Magic +item.witchery:ingredient.bookInfusions.name=Witchcraft: Brews & Infusions +item.witchery:ingredient.oddPorkchopRaw.name=Raw Porkchop? +item.witchery:ingredient.oddPorkchopCooked.name=Cooked Porkchop? +item.witchery:ingredient.doorRowan.name=Rowan Wood Door +item.witchery:ingredient.doorAlder.name=Alder Wood Door +item.witchery:ingredient.doorKey.name=Rowan Door Key +item.witchery:ingredient.rock.name=Rock +item.witchery:ingredient.web.name=Dense Web +item.witchery:ingredient.brewVines.name=Brew of Vines +item.witchery:ingredient.brewWeb.name=Brew of Webs +item.witchery:ingredient.brewThorns.name=Brew of Thorns +item.witchery:ingredient.brewInk.name=Brew of Ink +item.witchery:ingredient.brewSprouting.name=Brew of Sprouting +item.witchery:ingredient.brewErosion.name=Brew of Erosion +item.witchery:ingredient.berriesRowan.name=Rowan Berries +item.witchery:ingredient.necroStone.name=Necromantic Stone +item.witchery:ingredient.brewRaising.name=Brew of Raising +item.witchery:ingredient.spectralDust.name=Spectral Dust +item.witchery:ingredient.enderDew.name=Ender Dew +item.witchery:ingredient.seedsArtichoke.name=Stale Water Artichoke Seeds +item.witchery:ingredient.artichoke.name=Water Artichoke Globe +item.witchery:ingredient.seedsTreefyd.name=Treefyd Seed +item.witchery:ingredient.brewGrotesque.name=Brew of the Grotesque +item.witchery:ingredient.fumeFilter.name=Fume Filter +item.witchery:ingredient.impregnatedLeather.name=Impregnated Leather +item.witchery:arthana.name=Arthana +item.witchery:witchhand.name=Witches Hand +item.witchery:taglockkit.name=Taglock Kit +item.witchery:poppet.name=Poppet +item.witchery:poppet.protectEarth.name=Earth Protection Poppet +item.witchery:poppet.protectWater.name=Water Protection Poppet +item.witchery:poppet.protectStarvation.name=Hunger Protection Poppet +item.witchery:poppet.protectFire.name=Fire Protection Poppet +item.witchery:poppet.protectTool.name=Tool Protection Poppet +item.witchery:poppet.protectDeath.name=Death Protection Poppet +item.witchery:poppet.protectVoodoo.name=Voodoo Protection Poppet +item.witchery:poppet.voodoo.name=Voodoo Poppet +item.witchery:poppet.vampiric.name=Vampiric Poppet +item.witchery:circletalisman.name=Circle Talisman +item.witchery:divinerwater.name=Water Diviner +item.witchery:divinerlava.name=Lava Diviner +item.witchery:chalkheart.name=Golden Chalk +item.witchery:chalkritual.name=Ritual Chalk +item.witchery:chalkotherwhere.name=Otherwhere Chalk +item.witchery:chalkinfernal.name=Infernal Chalk +item.witchery:polynesiacharm.name=Polynesia Charm +item.witchery:polynesiacharm.tip=He talks to the animals... +item.witchery:devilstonguecharm.name=Devils Tongue Charm +item.witchery:devilstonguecharm.tip=Even demons find your wit|irresistible... most of the time. +item.witchery:witchhat.name=Witches' Hat +item.witchery:witchhat.tip=How original... a pointy hat.||{9+35% chance of second brew{0 +item.witchery:seedsbelladonna.name=Belladonna Seeds +item.witchery:seedsmandrake.name=Mandrake Seeds +item.witchery:seedsartichoke.name=Water Artichoke Seeds + +circletalisman.small.1=Small Ritual +circletalisman.small.2=Small Otherwhere +circletalisman.small.3=Small Infernal +circletalisman.medium.1=Medium Ritual +circletalisman.medium.2=Medium Otherwhere +circletalisman.medium.3=Medium Infernal +circletalisman.large.1=Large Ritual +circletalisman.large.2=Large Otherwhere +circletalisman.large.3=Large Infernal + +tile.witchery:rowanwooddoor.name=Rowan Wood Door +tile.witchery:alderwooddoor.name=Alder Wood Door +tile.witchery:rowandoorwood.name=Rowan Wood Door +tile.witchery:alderdoorwood.name=Alder Wood Door +tile.witchery:altar.name=Altar +tile.witchery:witchesovenidle.name=Witches Oven +tile.witchery:witchesovenburning.name=Witches Oven +tile.witchery:distilleryidle.name=Distillery +tile.witchery:distilleryburning.name=Distillery +tile.witchery:kettle.name=Kettle +tile.witchery:poppetshelf.name=Poppet Shelf +container.witchery:poppetshelf=Poppet Shelf +tile.witchery:witchlog.rowan.name=Rowan Wood +tile.witchery:witchlog.alder.name=Alder Wood +tile.witchery:witchlog.hawthorn.name=Hawthorn Wood +tile.witchery:witchwood.rowan.name=Rowan Planks +tile.witchery:witchwood.alder.name=Alder Planks +tile.witchery:witchwood.hawthorn.name=Hawthorn Planks +tile.witchery:witchsapling.rowan.name=Rowan Sapling +tile.witchery:witchsapling.alder.name=Alder Sapling +tile.witchery:witchsapling.hawthorn.name=Hawthorn Sapling +tile.witchery:witchleaves.rowan.name=Rowan Leaves +tile.witchery:witchleaves.alder.name=Alder Leaves +tile.witchery:witchleaves.hawthorn.name=Hawthorn Leaves +tile.witchery:belladonna.name=Belladonna +tile.witchery:mandrake.name=Mandrake +tile.witchery:barrier.name=Barrier +tile.witchery:dreamcatcher.name=Dream Weaver +tile.witchery:candelabra.name=Candelabra +tile.witchery:chalice.name=Chalice +tile.witchery:circle.name=Heart Glyph +tile.witchery:circleglyphritual.name=Ritual Glyph +tile.witchery:circleglyphotherwhere.name=Otherwhere Glyph +tile.witchery:circleglyphinfernal.name=Infernal Glyph +tile.witchery:stairswoodrowan.name=Rowan Stairs +tile.witchery:stairswoodalder.name=Alder Stairs +tile.witchery:stairswoodhawthorn.name=Hawthorn Stairs +tile.witchery:witchwoodslab.name=Wood Slab +tile.witchery:witchwoodslab.rowan.name=Rowan Slab +tile.witchery:witchwoodslab.alder.name=Alder Slab +tile.witchery:witchwoodslab.hawthorn.name=Hawthorn Slab +tile.witchery:witchwooddoubleslab.name=Wood Double Slab +tile.witchery:spanishmoss.name=Spanish Moss +tile.witchery:leapinglily.name=Leaping Lily +tile.witchery:plantmine.rose_webs.name=Poppy of Webs +tile.witchery:plantmine.rose_ink.name=Poppy of Ink +tile.witchery:plantmine.rose_sprouting.name=Poppy of Sprouting +tile.witchery:plantmine.rose_thorns.name=Poppy of Thorns +tile.witchery:plantmine.dandelion_webs.name=Dandelion of Webs +tile.witchery:plantmine.dandelion_ink.name=Dandelion of Ink +tile.witchery:plantmine.dandelion_sprouting.name=Dandelion of Sprouting +tile.witchery:plantmine.dandelion_thorns.name=Dandelion of Thorns +tile.witchery:plantmine.grass_webs.name=Shrub of Webs +tile.witchery:plantmine.grass_ink.name=Shrub of Ink +tile.witchery:plantmine.grass_sprouting.name=Shrub of Sprouting +tile.witchery:plantmine.grass_thorns.name=Shrub of Thorns +tile.witchery:embermoss.name=Ember Moss +tile.witchery:artichoke.name=Water Artichoke +tile.witchery:alluringskull.name=Alluring Skull +tile.witchery:fumefunnel.name=Fume Funnel +tile.witchery:filteredfumefunnel.name=Filtered Fume Funnel + +entity.witchery.demon.name=Demon +entity.demon.name=Demon +entity.witchery.broom.name=Enchanted Broom +entity.broom.name=Enchanted Broom +entity.witchery.familiar.name=Spectral Familiar +entity.familiar.name=Spectral Familiar +entity.witchery.mandrake.name=Mandrake +entity.mandrake.name=Mandrake +entity.witchery.treefyd.name=Treefyd +entity.treefyd.name=Treefyd + +witchery.book.mushroomred=Red Mushroom +witchery.book.mushroombrown=Brown Mushroom +witchery.book.altarpower=Altar power +witchery.book.oven1={o{lWitchcraft{r{r{o: Collecting Fumes{r||The witches oven gives a practitioner of the art, the opportunity to collect the fumes that may be produced when cooking.||Remember that the oven cannot smelt ore, but it does cook a little faster than a furnace. +witchery.book.oven2=Place {8Clay Jars{0 into the oven when cooking to collect the fumes:||Food {6Foul Fume{0|Wood {6Foul Fume{0||Cooking {2Saplings{0 produces {8Wood Ash{0 and may also release the gaseous essence of the tree. +witchery.book.oven3={nSapling Fumes{r||Oak {8Exhale of the Horned One{0|Birch {8Breath of the Goddess{0|Spruce {8Hint of Rebirth{0|Rowan {8Whiff of Magic{0|Hawthorn {8Odour of Purity{0|Alder {8Reek of Misfortune{0 +witchery.book.distillery1={o{lWitchcraft{r{r{o: Distilling{r||{81.{0 Ensure the distillery is near to an Altar to get power.|{82.{0 Place the items into the distillery along with the required number of clay jars.|{83.{0 Wait for the distillation process to complete. +witchery.book.distillery.jars=Clay Jars +witchery.book.distillery.items={nDistill these items{r +witchery.book.distillery.results={nResultant distillates{r +witchery.book.brews1={o{lWitchcraft{r{r{o: Brews & Infusions{r||{81.{0 Throw the ingredients into a heated, water-filled kettle. Altars provide power, if needed.|{82.{0 Fill the brew into an empty glass bottle.|{83.{0 Use infusions in a Rite of Infusion; but remember, {0Death is almost always assured{0. +witchery.book.rites1={o{lWitchcraft{r{r{o: Circle Magic{r||{81.{0 Draw circles using colored chalk, with a heart glyph at the centre. An altar is often needed for power.|{82.{0 Drop the foci items into the circle.|{83.{0 Activate the heart glyph. +witchery.book.rites2=Chalk & sizes:|7x7, 11x11, 15x15|{7Ritual{0, {5Otherwhere{0, {4Infernal{0 +witchery.book.rites.anycircle=Any circles allowed + +witchery.rite.bindcircle=Rite of Binding{r||Pulls the circles into the talisman. +witchery.rite.bindcircleportable=Rite of Binding{r||Pulls the circles into the talisman. +witchery.rite.bindwaystone=Rite of Binding{r||Binds the Waystone to the location of the ritual. +witchery.rite.chargestone=Rite of Charging{r||Charges the Attuned Stone. +witchery.rite.infusionrecharge=Rite of Charging{r||Recharge infused power by standing in the circle. Lasts indefinitely, but requires 40 power/s. +witchery.rite.teleporttowaystone=Rite of Transposition{r||Teleport to the bound Waystone's location. +witchery.rite.teleportentity=Rite of Transposition{r||Summon the taglock kit's bound creature or player. +witchery.rite.teleportironore=Rite of Transposition{r||Transpose iron from the ore below. +witchery.rite.protection=Rite of Sanctity{r||Monsters cannot enter the circle. Lasts indefinitely, but requires 16 power/s. +witchery.rite.imprisonment=Rite of Imprisonment{r||Monsters cannot leave the circle. Lasts indefinitely, but requires 16 power/s. +witchery.rite.barrier=Rite of Protection{r||Conjure a dome, impenetrable to monsters. Lasts indefinitely, but requires 24 power/s. +witchery.rite.barrierlarge=Rite of Protection{r||Conjure a dome, impenetrable to all. Lasts indefinitely, but requires 28 power/s. +witchery.rite.barrierportable=Rite of Protection{r||Conjure an impenetrable dome for 60 seconds. +witchery.rite.volcano=Rite of Earth's Wrath{r||Raise a volcano. A lava pool must lie below. +witchery.rite.storm=Rite of Sky's Wrath{r||Call a focused lightning storm inside the circle. +witchery.rite.stormlarge=Rite of Sky's Wrath{r||Call a focused lightning storm outside the circle. +witchery.rite.stormportable=Rite of Sky's Wrath{r||Call a focused lightnig storm outside the circle. +witchery.rite.eclipse=Rite of Total Eclipse{r||Block out the sun. +witchery.rite.eclipseportable=Rite of Total Eclipse{r||Block out the sun. +witchery.rite.partearth=Rite of Broken Earth{r||Part the earth, the position of the foci controls the direction. +witchery.rite.raiseearth=Rite of Moving Earth{r||Raise a column of earth. +witchery.rite.banishdemonportable=Rite of Banishing{r||Send nearby Demons back to the Pit. +witchery.rite.banishdemon=Rite of Banishing{r||Send nearby Demons back to the Pit. +witchery.rite.summondemon=Rite of Summoning{r||Call forth a Demon. The inner area must be clear 7x7x4 blocks! +witchery.rite.summondemonexpensive=Rite of Summoning{r||Call forth a Demon. The inner area must be clear 7x7x4 blocks! +witchery.rite.summonwither=Rite of Summoning{r||Call forth a Wither. The inner area must be clear 7x7x4 blocks! +witchery.rite.summonwitherexpensive=Rite of Summoning{r||Call forth a Wither. The inner area must be clear 7x7x4 blocks! +witchery.rite.infusionlight=Rite of Infusion{r||You must stand in the circle. +witchery.rite.infusionearth=Rite of Infusion{r||You must stand in the circle. +witchery.rite.infusionender=Rite of Infusion{r||You must stand in the circle. +witchery.rite.infusionhell=Rite of Infusion{r||You must stand in the circle. +witchery.rite.infusionsky=Rite of Infusion{r||Perform at night. +witchery.rite.necrostone=Rite of Necromancy{r||Creates a Necromantic Stone. Perform at night. +witchery.rite.summonfamiliar=Rite of Summoning{r||Summons a familiar to find things. Try giving the familiar a diamond! The inner area must be clear 7x7x4 blocks! +witchery.rite.bindwaystonecopy=Rite of Binding{r||Binds the Waystone location on one waystone to another waystone. +witchery.rite.fertility=Rite of Fertility{r||Makes nearby land fertile. Heals sick villagers. +witchery.rite.fertilityportable=Rite of Fertility{r||Makes nearby land fertile. Heals sick villagers. +witchery.rite.curseblight=Curse of Blight{r||Makes nearby land infertile and causes sickness. +witchery.rite.curseblindness=Curse of Blindness{r||Makes nearby creatures blind. +witchery.rite.hellonearth=Curse of Hell on Earth{r||Only works in the Overworld at night, requires 200 power/s. +witchery.rite.summonwitch=Rite of Summoning{r||Summon a witch. The inner area must be clear 7x7x4 blocks! +witchery.rite.bindwaystoneportable=Rite of Binding{r||Binds the Waystone to the location of the ritual. +witchery.rite.bindwaystonecopyportable=Rite of Binding{r||Binds the Waystone location on one waystone to another waystone. + +witchery.rite.morsmordre=Rite of the Dark Mark{r||Conjure the Dark Mark high above the circle as an omen of dread. +witchery.rite.horrocrux=Rite of the Horrocrux{r||Split your soul. The next time you would die, you are restored to life instead and the horrocrux is spent. +witchery.rite.horrocrux.created=You feel a sliver of your soul tear away and anchor itself. Death will not claim you... once. +witchery.rite.horrocrux.exists=Your soul is already split; it cannot be divided again until the horrocrux is spent. +witchery.rite.horrocrux.saved=Your horrocrux shatters as your soul is dragged back into your body! +witchery.rite.dementorkiss=Rite of the Dementor's Kiss{r||Devour the soul of a creature bound by a taglock, leaving it withered, blind and hollow. +witchery.rite.dementorkiss.victim=An icy dread engulfs you as something feeds upon your very soul! +witchery.rite.soulthief=Rite of the Soul Thief{r||Tear a fragment of soul from a bound creature, harvesting it as a subdued spirit. +witchery.rite.annihilation=Rite of Annihilation{r||Erase all unprotected blocks above the circle in a great dome. +witchery.rite.fidelio=Rite of Fidelius{r||Conceal the secret-keeper from the world, cleansing and hiding them for a time. +witchery.rite.fidelio.hidden=The Fidelius charm settles over you; you fade from sight, hidden from the world. +witchery.rite.unbreakablevow=Rite of the Unbreakable Vow{r||Bind a lasting boon of protection upon all who stand within the circle. +witchery.rite.unbreakablevow.blessed=An unbreakable vow shields you from harm. +witchery.rite.secretguardian=Rite of the Secret Guardian{r||Raise a protective dome of barriers around the circle. +witchery.rite.legilimency=Rite of Legilimency{r||Probe the mind of a bound creature to reveal where it is and what it holds. +witchery.rite.legilimency.read=Legilimency reveals %s: in %s at (%s, %s, %s), %s health, wielding %s. +witchery.rite.philosopherstone=Rite of the Philosopher's Stone{r||Perform the Great Work: transmute base metals to gold and yield a priceless reward. +witchery.rite.promisedland=Rite of the Promised Land{r||Bless the surrounding land into a lush, flowering paradise. + +witchery.infuse.cansetrecall=Release mouse button to set Recall Point. +witchery.infuse.setrecall=- Recall Point set to %s (%s, %s, %s). +witchery.infuse.canteleport=Teleport charged, release mouse button to teleport. +witchery.infuse.cannotteleport=Too far, hold mouse button longer to teleport further! + +witchery.familiar.foundsomething=OINK! %s, %s, %s. + +witchery.rite.nullfield=Ritual cannot begin, circle magic is being nullified in this area. +tile.witchery:voidbramble.name=Void Bramble + +witchery.rite.naturespower=Rite of Nature's Power{r||Release nature on a barren area. + +item.witchery:witchrobe.name=Witches Robes +item.witchery:witchrobe.tip=For the discerning witch about town.||{5Creepers will ignore the wearer.{0||{9+35% chance of second brew (except necromantic){0 + +item.witchery:necromancerrobe.name=Necromancer Robes +item.witchery:necromancerrobe.tip=Keeps the undead at bay.||{5Undead will generally ignore the wearer.{0||{9+35% chance of second necromantic brew{0 + +item.witchery:ingredient.creeperHeart.name=Creeper Heart +tile.witchery:glintweed.name=Glint Weed +item.witchery:ingredient.brewLove.name=Brew of Love + +witchery.rite.priorincarnation=Rite of Prior Incarnation{r||Summon a prior incarnation of a player (and their items) near to where they died. + +witchery.structure.apothecary.name=Apothecary + +witchery.rite.disabled=Ritual cannot begin, the rite has been disabled on this server. +witchery.rite.unknownritual=Unknown rite. +witchery.rite.missingitem=Missing foci item. +witchery.rite.missinglivingsacrifice=Missing creature sacrifice. +witchery.rite.missingpowersource=No altar nearby. +witchery.rite.insufficientpower=Altar has insufficient power. +witchery.rite.missinglava=No lava below. + +item.witchery:ingredient.brewIce.name=Brew of Frost +item.witchery:ingredient.brewDepths.name=Brew of the Depths +item.witchery:ingredient.icyNeedle.name=Icy Needle +item.witchery:ingredient.frozenHeart.name=Frozen Heart +item.witchery:iceslippers.name=Icy Slippers +item.witchery:seedssnowbell.name=Snowbell Seeds +tile.witchery:snowbell.name=Snowbell +tile.witchery:wickerbundle.plain.name=Wicker Bundle +tile.witchery:wickerbundle.bloodied.name=Bloodied Wicker Bundle +item.witchery:ingredient.infernalBlood.name=Demonic Blood +entity.witchery.hornedHuntsman.name=Horned Huntsman + + + +item.witchery:ingredient.bookHerbology.name=Witchcraft: Herbology +item.witchery:mysticbranch.name=Mystic Branch +item.witchery:ingredient.mysticunguent.name=Mystic Unguent +item.witchery:ingredient.entbranch.name=Ent Twig +item.witchery:mutator.name=Mutating Sprig + +tile.witchery:glowglobe.name=Glow Globe +tile.witchery:leechchest.name=Leech Chest + +tile.witcheryLeechChest.playernotloggedin=Cannot get taglocks for the following players not in this world: %s. +tile.witcheryLeechChest.onlyowntaglock=Cannot remove your own taglock from the chest. + +witchery.book.herbology1={o{lWitchcraft{r{r{o: Herbology{r||Many common plants are used in the preparation of brews and magicks, this book details those rare or exceptional plants not known to the common folk. +witchery.book.herbology.mandrake=It's parsnip-shaped root has the look of a man. Harvest at night, lest it waken and scream. It grows in tilled earth in stages. Tall grass yields seeds. +witchery.book.herbology.belladonna=Deadly nightshade, so is this plant known, and deadly poisons from it grown. It grows in tilled earth in stages. Tall grass yields seeds. +witchery.book.herbology.snowbell=A curious plant, cold as the snow, freezes moisture as it grows. It grows in tilled earth in stages. Tall grass yields seeds. +witchery.book.herbology.artichoke=A water-bred plant with strange effect, fills the belly then empties it. It grows on still water in stages. Tall grass yields seeds. +witchery.book.herbology.glintweed=Emits an unearthly glow that illuminates it's surround. It can live anywhere, but spreads only on grass, dirt and sand. Mutate this plant from another with Mutandis. +witchery.book.herbology.spanishmoss=A creeper-like moss that grows best on trees, forms the best poppets that can be. Harvest with shears to keep it intact. Mutate this plant from another with Mutandis. +witchery.book.herbology.embermoss=A plant with a unique defense, when disturbed it bursts into flames. Harvest with shears. It can live anywhere, but spreads only on grass, dirt and sand. Mutate this plant from another with Mutandis. +witchery.book.herbology.voidbramble=This strange bramble keeps creatures at bay; for when they get close it teleports them away. Created and fueled with magic no rituals will function near to it. +witchery.book.herbology.rowan=The rowan, or mountain-ash has an affinity with magic other trees seldom match. Mutate the sapling from another plant with Mutandis. +witchery.book.herbology.alder=The alder wood appears to bleed when cut, this tree brings misfortune to all. Mutate the sapling from another plant with Mutandis. +witchery.book.herbology.hawthorn=Hawthorn is the tree of purity, it has a long history in the field of herbalism. Mutate the sapling from another plant with Mutandis. + +witchery.rite.infusiontree=Rite of Infusion{r||Infuse a mystic branch. Perform at night. +witchery.rite.cursecreature1=Curse of Misfortune{r||Curse the taglocked being. Perform in a storm. +witchery.rite.removecurse1=Rite of Remove Curse{r||Cleanse the taglocked being of misfortune. Things may get worse. +witchery.rite.cookfood=Rite of Broiling{r||Cooks any food placed in the circle. May overcook food. +witchery.rite.obstructedcircle=The area around the central glyph is not clear of blocks. + +witchery.infuse.branch.nocharges=You are too low on power to draw this symbol. +witchery.infuse.branch.infusionrequired=You must be infused to perform symbol magic. +witchery.infuse.branch.unknownsymbol=Unknown symbol drawn. +witchery.infuse.branch.infernalrequired=Infernal infusion is required to draw forbidden symbols. + +witchery.pott.accio=Accio +witchery.pott.aguamenti=Aguamenti +witchery.pott.alohomora=Alohomora +witchery.pott.avadakedavra=Avada Kedavra +witchery.pott.caveinimicum=Cave Inimicum +witchery.pott.colloportus=Colloportus +witchery.pott.confundus=Confundus +witchery.pott.crucio=Crucio +witchery.pott.defodio=Defodio +witchery.pott.ennervate=Ennervate +witchery.pott.episkey=Episkey +witchery.pott.expelliarmus=Expelliarmus +witchery.pott.flagrate=Flagrate +witchery.pott.flipendo=Flipendo +witchery.pott.impedimenta=Impedimenta +witchery.pott.imperio=Imperio +witchery.pott.incendio=Incendio +witchery.pott.lumos=Lumos +witchery.pott.lumos.info=Place a light. Sneak to toggle a glow that follows you. Nox dispels it. +witchery.pott.lumos.extinguished=Your Lumos was extinguished by Nox. +witchery.pott.meteolojinxrecanto=Meteolojinx Recanto +witchery.pott.nox=Nox +witchery.pott.nox.info=Extinguish all light sources nearby. Also dispels Lumos follower on nearby players. +witchery.pott.protego=Protego +witchery.pott.stupefy=Stupefy + +entity.witchery.ent.name=Ent + +witchery.taglockkit.taglockfailed=Failed to get taglock, other player noticed! +witchery.taglockkit.taglockdiscovered=Someone just tried to take a taglock from you, but failed! + + +item.witchery:ingredient.doorKeyring.name=Rowan Keyring +tile.witchery:statuegoddess.name=Statue of The Goddess +witchery.rite.curseinsanity1=Curse of Insanity{r||Curse the taglocked being with monster visions. Perform in a storm. +witchery.rite.removeinsanity1=Rite of Remove Curse{r||Cleanse the taglocked being of insanity. Things may get worse. +tile.witcheryStatusGoddess.curemisfortune=The Goddess cures your misfortune. +tile.witcheryStatusGoddess.cureinsanity=The Goddess cures your insanity. +entity.witchery.illusionCreeper.name=Creeper +entity.witchery.illusionSpider.name=Spider +entity.witchery.illusionZombie.name=Zombie + + + +witchery.book.herbology.enderbramble=This strange bramble keeps creatures at bay; for when they get close it teleports them away. Mutate this plant from sugar cane and spanish moss. +witchery.book.herbology.grassper=A curious plant that holds whatever it is given. Mutate this plant from tall grass and an empty chest. +witchery.book.herbology.crittersnare=Small creatures are this plants prey, it snaps them up - never to get away. Mutate this plant from alder saplings, a web and a zombie. + +entity.witchery.owl.name=Owl +entity.witchery.toad.name=Toad +entity.witchery.cat.name=Cat +entity.witchery.louse.name=Parasytic Louse + +item.witchery:louse.name=Parasytic Louse + +witchery.rite.bindfamiliar=Rite of Binding{r||Bind a tamed owl, toad or cat as a familiar. +witchery.rite.callfamiliar=Rite of Summoning{r||Summon your familiar that has been dismissed or killed. +witchery.rite.corruptvoodooprotection=Curse of Corrupt Poppet{r||Destroy voodoo protection of taglocked being. Needs cat familiar. +witchery.rite.requirescursemastery=This rite can only be performed with a cat familiar. + +item.witchery:ingredient.brewFrogsTongue.name=Brew of Frogs Tongue +item.witchery:ingredient.brewCursedLeaping.name=Brew of Cursed Leaping +item.witchery:ingredient.brewHitchcock.name=Brew of Bodega +item.witchery:ingredient.brewInfection.name=Brew of Infection +item.witchery:ingredient.owletsWing.name=Owlet's Wing +item.witchery:ingredient.toeOfFrog.name=Toe of Frog +item.witchery:ingredient.appleWormy.name=Wormy Apple +tile.witchery:grassper.name=Grassper +item.witchery:poppet.protectPoppet.name=Poppet Protection Poppet +tile.witchery:crittersnare.name=Critter Snare +tile.witchery:crittersnare.empty.name=Critter Snare +tile.witchery:crittersnare.bat.name=Critter Snare (Bat) +tile.witchery:crittersnare.silverfish.name=Critter Snare (Silverfish) +tile.witchery:crittersnare.slime.name=Critter Snare (Slime) +tile.witchery:crittersnare.magmacube.name=Critter Snare (Magma Cube) + + +entity.witchery.babayaga.name=Baba Yaga + +tile.witchery:crystalball.name=Crystal Ball +item.witchery:ingredient.quartzSphere.name=Quartz Sphere +item.witchery:ingredient.happenstanceOil.name=Happenstance Oil +witchery.rite.infusionfuture=Rite of Infusion{r||Infuse a Crystal Ball to see the future. Perform at night. + +witchery.prediction.recharging=The crystal ball is inert for the moment. +witchery.prediction.nopower=The crystal ball cannot get enough power from a nearby altar. +witchery.prediction.unskilled=You gaze into the crystal ball, but do not know how to interpret what you see. +witchery.prediction.none=You gaze into the crystal ball, but %s's future is too murky at the moment. +witchery.prediction.zombie=You gaze into the crystal ball: %s will chance upon the undead. +witchery.prediction.arrowhit=You gaze into the crystal ball: %s will be struck by an arrow. +witchery.prediction.ent=You gaze into the crystal ball: %s will encounter a walking tree. +witchery.prediction.fall=You gaze into the crystal ball: %s will stumble and fall. +witchery.prediction.treasure=You gaze into the crystal ball: %s will find buried treasure. +witchery.prediction.iron=You gaze into the crystal ball: %s will be inundated with iron. +witchery.prediction.diamond=You gaze into the crystal ball: %s will find shinies. +witchery.prediction.emerald=You gaze into the crystal ball: %s will find shinies. +witchery.prediction.love=You gaze into the crystal ball: %s will meet a dark and handsome stranger. +witchery.prediction.babagood=You gaze into the crystal ball: %s has sparked the interest of the crone (and her sisters). +witchery.prediction.bababad=You gaze into the crystal ball: %s has angered the crone (and her sisters). +witchery.prediction.friend=You gaze into the crystal ball: %s will make a new friend. +witchery.prediction.rescued=You gaze into the crystal ball: %s will be saved by a stranger. +witchery.prediction.tothenether=You gaze into the crystal ball: %s will take a trip to the nether. +witchery.prediction.tothenether.summoned=A demon has been watching you and transposed you to the nether. +witchery.prediction.wet=You gaze into the crystal ball: %s will get wet. +witchery.prediction.coal=You gaze into the crystal ball: %s will collect a cache of coal. + +tile.witchery:bramble.ender.name=Ender Bramble +tile.witchery:bramble.wild.name=Wild Bramble +tile.witchery:bloodrose.name=Blood Poppy + +witchery.rite.cursesinking1=Curse of Sinking{r||Curse the taglocked being with extra weight. Perform in a storm. +witchery.rite.removesinking1=Rite of Remove Curse{r||Cleanse the taglocked being of sinking. Things may get worse. +tile.witcheryStatusGoddess.curesinking=The Goddess cures your sinking problem. + +witchery.book.herbology.wildbramble=This thorny bramble spreads around, when you try to pull it down. Mutate this plant from cactus and spanish moss. +witchery.book.herbology.bloodrose=In a witches garden keep in mind, a scratch from this rose leaves your blood behind. Mutate this plant from roses and a leech chest. + +entity.witchery.covenwitch.name=Coven Witch +item.witchery:ingredient.seerStone.name=Seer Stone +witchery.rite.infusionseerstone=Rite of Infusion{r||Infuse a stone to communicate in a coven. Perform at night. +witchery.rite.climatechange=Rite of Shifting Seasons{r||Pick Biome with biome foci and glowstone. Coven of 4 or more. +witchery.rite.iceshell=Rite of Icy Expansion{r||Create an icy sphere. Coven of 2 or more. +witchery.rite.curseoverheating=Curse of Overheating{r||Curse the taglocked being to overheat. +witchery.rite.cureoverheating=Rite of Remove Curse{r||Cleanse the taglocked being of overheating. Things may get worse. +tile.witcheryStatusGoddess.cureoverheating=The Goddess cures your temperature problem. +witchery.rite.wrongdimension=The rite cannot be performed in this dimension. +witchery.rite.coventoosmall=You require more coven members to perform this rite. +witchery.rite.missingbiomefoci=Missing an item to represent the desired biome. +witchery.rite.rainoffrogs=Curse of Raining Toads{r||Rain poisonous toads. Coven of 1 or more. +witchery.rite.glyphictransform=Rite of Glyphic Transformation{r||Drop chalk of the desired color, 1=small, 2=medium, 3=large. +witchery.rite.callbeasts=Rite of Beastial Call{r||Call animals. Coven of 3 or more. + +witchery.witch.pet=%s's pet +witchery.witch.petflesh=%s's pet's flesh +witchery.witch.peteye=%s's pet's eye +witchery.witch.say.covenfull=Your coven is full. Begone! +witchery.witch.say.joinedcoven=I will join your coven. Call me when you have need. +witchery.witch.say.questitemsremaining=%s more to go. +witchery.witch.say.questnotfinished=You have not completed my task! +witchery.witch.say.begone=Begone! +witchery.witch.say.notinterested1=You do not interest me! +witchery.witch.say.notinterested2=Why do you waste my time! +witchery.witch.say.notinterested3=You are not skilled in the Art! +witchery.witch.say.tricked=Just what I needed... a gullible fool... now you die! + +witchery.witch.quest.fightspider=Defeat my pet and bring me its eye, speak to me again if you accept! +witchery.witch.quest.fightzombie=Defeat my pet and bring me its flesh, speak to me again if you accept! +witchery.witch.quest.getdemonheart=Bring me the beating means to master the infernal dimension, speak to me again if you accept! +witchery.witch.quest.makecrystalball=I desire to predict the future, speak to me again if you accept! +witchery.witch.quest.getbones=Kill 30 skeletons and bring me their bones, speak to me again if you accept! +witchery.witch.quest.makegrotesquebrew=I must perform many curses, bring me the necessary brew, speak to me again if you accept! +witchery.witch.quest.makenecrostone=Bring me the means to control the dead, speak to me again if you accept! +witchery.witch.quest.go=Go now! + +witchery.item.seerstone.misfortune=Curse of Misfortune (%d) +witchery.item.seerstone.insanity=Curse of Insanity (%d) +witchery.item.seerstone.sinking=Curse of Sinking (%d) +witchery.item.seerstone.overheating=Curse of Overheating (%d) +witchery.item.seerstone.notcursed=No curses. + +entity.witchery.corpse.name=Body +entity.witchery.nightmare.name=Nightmare + +tile.witchery:somniancotton.name=Wispy Cotton +tile.witchery:spiritflowing.name=Flowing Spirit +tile.witchery:spiritportal.name=Spirit Portal +tile.witchery:spinningwheel.name=Spinning Wheel + +item.witchery:ingredient.brewSleep.name=Brew of Sleeping +item.witchery:ingredient.brewWasting.name=Brew of Wasting +item.witchery:ingredient.sleepingApple.name=Apple +item.witchery:ingredient.disturbedCotton.name=Disturbed Cotton +item.witchery:ingredient.fancifulThread.name=Fanciful Thread +item.witchery:ingredient.tormentedTwine.name=Tormented Twine +item.witchery:ingredient.goldenThread.name=Golden Thread +item.witchery:ingredient.mellifluousHunger.name=Mellifluous Hunger +item.witchery:ingredient.brewFlowingSpirit.name=Brew of Flowing Spirit +item.witchery:ingredient.weaveIntensity.name=Dream Weaver of Intensity +item.witchery:bucketspirit.name=Spirit Bucket +item.witchery:bitingbelt.name=Biting Belt +item.witchery:bitingbelt.tip=Careful... it bites.||{5Craft with up to 2 potions that get{0|{5administered when hit.{0 + +witchery.brew.flowingspirit=Only brew in the Spirit World + +witchery.rite.manifest=Rite of Manifestation{r||Manifest as a ghost from the Spirit World. + +witchery.book.herbology.somniancotton=A make-believe plant that only grows, in the deepest of sleep, where ones dreams go. + + +tile.witchery:demonheart.name=Demon Heart + +witchery.rite.optional=(optional) +witchery.rite.noplacelikehome=there's no place like home +witchery.rite.unknownchant=Unknown chant +witchery.rite.manifestation.countdown=You feel more corporeal, only %s seconds remain. +witchery.rite.slippersoncooldown=Nothing happens (wait %s minute(s)). +witchery.rite.forestation=Rite of the Forest{r||Grow a forest, replace the sapling for the desired type. +witchery.rite.toofaraway=The rite cannot be performed so far away (a large coven may be needed). + +item.witchery:iceslippers.tip=Cool to the touch.||{5Freezes nearby water and{0|{5turns lava to obsidian (damages shoes){0 +item.witchery:brewbag.name=Brew Bag +item.witchery:huntsmanspear.name=Spear of the Huntsman +item.witchery:huntsmanspear.tip={5Can summon a wolf, if struck while blocking{0. +item.witchery:barkbelt.name=Bark Belt +item.witchery:barkbelt.tip=So this is how an Ent feels.||{5Grow bark pieces when standing on grass or mycellium{0|{5Bark pieces mitigate hits.{0 +item.witchery:rubyslippers.name=Ruby Slippers +item.witchery:rubyslippers.tip=There's no place like home.||{5Teleport using a waystone (1 min cooldown){0|{5Teleport to bed (30 min cooldown){0 +item.witchery:seepingshoes.name=Seeping Shoes +item.witchery:seepingshoes.tip=Cave spider's bane.||{5Remove poison effects when standing on ground{0 +item.witcheryTaglockKit.boundto=Bound: {5%s{0 +item.witcheryTaglockKit.unbound=Not bound + +item.witchery:ingredient.bookBiomes.name=Book of Biomes +item.witchery:ingredient.bookWands.name=Witchcraft: Symbology +item.witchery:ingredient.batBall.name=Concentrated Bat Ball +item.witchery:ingredient.brewBats.name=Brew of Bats +item.witchery:ingredient.purifiedMilk.name=Purified Milk +item.witchery:ingredient.charmDisruptedDreams.name=Charm of Fanciful Thinking + +tile.witcheryStatusGoddess.curenightmare=The Goddess cures your nightmare. +witchery.item.seerstone.nightmare=Curse of Waking Nightmare (%d) + +witchery.rite.cursenightmare=Curse of Waking Nightmare{r||Perform in a storm. +witchery.rite.curenightmare=Rite of Remove Curse{r||Cleanse the taglocked being of nightmares. Things may get worse. + +witchery.book.biomes1={o{lBook of Biomes{r{r||Understanding the biomes of the world is the first step to changing them. In these pages can be found the foci items and glowstone dust cost of each biome needed for the {oRite of Shifting Seasons{r. +witchery.book.biomes.foci=Foci +witchery.book.biomes.forest.name=Forest +witchery.book.biomes.forest.item=Oak Sapling +witchery.book.biomes.plains.name=Plains +witchery.book.biomes.plains.item=Tall Grass +witchery.book.biomes.mountain.name=Mountain +witchery.book.biomes.mountain.item=Obsidian +witchery.book.biomes.hills.name=Hills +witchery.book.biomes.hills.item=Stone +witchery.book.biomes.swamp.name=Swamp +witchery.book.biomes.swamp.item=Slimeball +witchery.book.biomes.water.name=Water +witchery.book.biomes.water.item=Water Bucket +witchery.book.biomes.desert.name=Desert +witchery.book.biomes.desert.item=Cactus +witchery.book.biomes.frozen.name=Frozen +witchery.book.biomes.frozen.item=Icy Needle +witchery.book.biomes.jungle.name=Jungle +witchery.book.biomes.jungle.item=Jungle Sapling +witchery.book.biomes.wasteland.name=Wasteland +witchery.book.biomes.wasteland.item=Netherrack +witchery.book.biomes.beach.name=Beach +witchery.book.biomes.beach.item=Sand +witchery.book.biomes.mushroom.name=Mushroom +witchery.book.biomes.mushroom.item=Red Mushroom +witchery.book.biomes.magical.name=Magical +witchery.book.biomes.magical.item=Skeleton Skull + +witchery.book.wands1={o{lWitchcraft{r{r{o: Symbology{r||Drawing symbols with a {oMystic Branch{r, allows a practitioner to sculpt natural energies.||Only {oInfused{r practitioners can use this type of magic.||Forbidden curses require the {oInfernal Infusion{r. +witchery.book.wands.strokes=Strokes +witchery.book.wands.stroke.0=Up +witchery.book.wands.stroke.1=Down +witchery.book.wands.stroke.2=Right +witchery.book.wands.stroke.3=Left +witchery.book.wands.stroke.4=Up-Right +witchery.book.wands.stroke.5=Down-Left +witchery.book.wands.stroke.6=Up-Left +witchery.book.wands.stroke.7=Down-Right + +witchery.pott.accio.info=Pull a dropped item. +witchery.pott.aguamenti.info=Create water. +witchery.pott.alohomora.info=Open a locked door. +witchery.pott.avadakedavra.info={4Forbidden{0: Killing curse. +witchery.pott.caveinimicum.info=Strengthen a block. +witchery.pott.colloportus.info=Lock a door. +witchery.pott.confundus.info=Cause confusion. +witchery.pott.crucio.info={4Forbidden{0: Torture. +witchery.pott.defodio.info=Dig. +witchery.pott.ennervate.info=Counter Stupify. +witchery.pott.episkey.info=Minor healing. +witchery.pott.expelliarmus.info=Disarm the target. +witchery.pott.flagrate.info=Draw an infernal rune. +witchery.pott.impedimenta.info=Slows the target. +witchery.pott.imperio.info={4Forbidden{0: Mind control. +witchery.pott.incendio.info=Start a fire. +witchery.pott.lumos.info=Place a light. Sneak to toggle a glow that follows you. Nox dispels it. +witchery.pott.nox.info=Extinguish all light sources nearby. Also dispels Lumos follower on nearby players. +witchery.pott.protego.info=Shield (ground target). +witchery.pott.stupefy.info=Stun the target. + +item.witchery:poppet.protectArmor.name=Armor Protection Poppet + + + +item.witchery:babashat.name=Baba Yaga's Hat +item.witchery:babashat.tip={5Infused players have a chance to be{0|{5teleported instead of taking a hit{0||{9+25% chance of second brew{0|{9+25% chance of third brew{0 +item.witchery:boline.name=Boline +item.witchery:boline.tip=Like shears, but can harvest|trapped plants and cobwebs. + +witchery.infuse.infusionrequired=You must be infused to use this ability. +witchery.infuse.nocharges=You are too low on power to use this ability. + +item.witchery:ingredient.brewSolidStone.name=Solidifying Brew (Stone) +item.witchery:ingredient.brewSolidDirt.name=Solidifying Brew (Dirt) +item.witchery:ingredient.brewSolidSand.name=Solidifying Brew (Sand) +item.witchery:ingredient.brewSolidSandstone.name=Solidifying Brew (Sandstone) +item.witchery:ingredient.brewSolidErosion.name=Solidifying Brew (Erosion) +item.witchery:ingredient.brewHollowTears.name=Brew of Hollow Tears +item.witchery:ingredient.brewSubstitution.name=Brew of Substitution +item.witchery:ingredient.condensedFear.name=Condensed Fear +item.witchery:ingredient.focusedWill.name=Focused Will +item.witchery:ingredient.brewGrave.name=Infused Brew of the Grave +item.witchery:ingredient.brewSoaring.name=Infused Brew of Soaring +item.witchery:ingredient.infusionBase.name=Infused Brew Base +item.witchery:ingredient.brewRevealing.name=Brew of Revealing +item.witchery:ingredient.wormwood.name=Wormwood +item.witchery:ingredient.subduedSpirit.name=Subdued Spirit +item.witchery:ingredient.brewCongealedSpirit.name=Congealed Spirit +item.witchery:seedswormwood.name=Wormwood Seeds +item.witchery:spectralstone.name=Spectral Stone + +item.witchery:buckethollowtears.name=Hollow Tears Bucket + +witchery.brew.solidification=Substitute Dirt with Stone, Sand, Sandstone or a Brew of Erosion. + +tile.witchery:wormwood.name=Wormwood + +entity.witchery.spectre.name=Spectre +entity.witchery.poltergeist.name=Poltergeist +entity.witchery.banshee.name=Banshee +entity.witchery.spirit.name=Spirit +entity.witchery.death.name=Death + +tile.witchery:brazier.name=Brazier +tile.witchery:scarecrow.name=Scarecrow +tile.witchery.scarecrow.operation.playerwhitelist=Activate for PLAYERS not in whitelist: %s +tile.witchery.scarecrow.operation.playerblacklist=Activate for PLAYERS in blacklist: %s +tile.witchery.scarecrow.operation.creaturewhitelist=Activate for ANYTHING not in whitelist: %s. +tile.witchery.scarecrow.operation.allnotfound=Activate if all in whitelist not found: %s. +tile.witchery.scarecrow.operation.onenotfound=Activate if one in whitlelist not found: %s. +tile.witchery.scarecrow.operation.off=Disabled. [%s] + +tile.witchery:trent.name=Trent Effigy +tile.witchery:witchsladder.name=Witch's Ladder + +witchery.fetish.enhancedpoppets.name=Voodoo Protection +witchery.fetish.enhancedpoppets.desc=The properties of a carried Voodoo Protection Poppet become stronger. +witchery.fetish.screamer.name=Shrieking +witchery.fetish.screamer.desc=Screams when specific beings are near by. +witchery.fetish.sentinal.name=Sentinel +witchery.fetish.sentinal.desc=Launches a spectral assault on unwanted beings. +witchery.fetish.twister.name=Disorientation +witchery.fetish.twister.desc=Confuses approaching beings. +witchery.fetish.ghostwalker.name=Ghost Walking +witchery.fetish.ghostwalker.desc=Sustains manifested creatures from the Spirit World. + +item.witchery:ingredient.seerstone.manifestationtime=Can manifest for %s second(s). +item.witchery:ingredient.seerstone.nomanifestationtime=Cannot manifest. +item.witchery:ingredient.seerstone.covensize=%s witch(es) in coven. +item.witchery:ingredient.seerstone.nocoven=No coven. +item.witchery:ingredient.seerstone.nofamiliar=No familiar. +item.witchery:ingredient.seerstone.familiar=Familiar called %s. +item.witchery:ingredient.bookBurning.name=Witchcraft: Conjuration & Fetishes +item.witchery:ingredient.graveyardDust.name=Graveyard Dust + +item.witchery.swordofdeath.customname=Death's Backup Sword +item.witchery.horseofdeath.customname=Binky + +witchery.rite.infusebrewsoaring=Rite of Infusion{r||Infuse the Brew of Soaring. +witchery.rite.infusebrewgrave=Rite of Infusion{r||Infuse the Brew of the Grave. +witchery.rite.spectralstone=Rite of Necromancy{r||Infuse a Spectral Stone. Perform at night. +witchery.rite.bindspectral=Rite of Binding{r||Bind up to three spectral creatures of the same type into a Spectral Stone. +witchery.rite.bindfetish=Rite of Binding{r||Bind spectral creatures to a Scarecrow, Trent Effigy or Witch's Ladder to create an effect. +witchery.rite.voodooprotectionactivated=Rite failed, player had voodoo protection. + +witchery.brazier.smoke.name=Graveyard Mist +witchery.brazier.smoke.desc=Call forth a thick mist that lingers for some minutes. + +witchery.brazier.spectre.name=Summon Spectre +witchery.brazier.spectre.desc=Pull a dead being back into this world from beyond. + +witchery.brazier.banshee.name=Summon Banshee +witchery.brazier.banshee.desc=Pull a screaming being back into this world from beyond. + +witchery.brazier.strong.name=Anguish of the Dead +witchery.brazier.strong.desc=Inflict the pain of the dead when striking creatures near to the brazier. + +witchery.brazier.tough.name=Fortification of the Corpse +witchery.brazier.tough.desc=Let the dead feel your pain while standing near the brazier. + +witchery.brazier.invisible.name=Deathly Veil +witchery.brazier.invisible.desc=Vanish from sight while standing near to the brazier. + +witchery.brazier.wilting.name=Drain Growth +witchery.brazier.wilting.desc=Suck the life from crops to heal nearby undead. + +witchery.brazier.infusion.name=Aura of Infusion +witchery.brazier.infusion.desc=Slowly restore the infused power of witches standing near the brazier. +witchery.brazier.growth.name=Verdant Bloom +witchery.brazier.growth.desc=Hasten the growth of nearby crops and plants while burning. +witchery.brazier.magnet.name=Gathering Pyre +witchery.brazier.magnet.desc=Draw nearby dropped items toward the brazier. +witchery.brazier.storm.name=Tempest Call +witchery.brazier.storm.desc=Summon a thunderstorm that rages while the brazier burns. +witchery.brazier.repellent.name=Ward of Repulsion +witchery.brazier.repellent.desc=Push nearby hostile creatures away from the brazier. +witchery.brazier.potionaura.name=Aura of the Cauldron +witchery.brazier.potionaura.desc=Spread the effects of a thrown potion to those near the brazier. +witchery.brazier.poltergeist.name=Summon Poltergeist +witchery.brazier.poltergeist.desc=Conjure a mischievous poltergeist from beyond. + +witchery.book.burning1={o{lWitchcraft: Conjuration & Fetishes{r{r||A witch may use a Brazier to burn materials with magical purpose, and conjure that which is no longer of this world.||Place the ingredients into the brazier and ignite with a flint and tinder. +witchery.book.burning2={o{lFetish Binding{r{r||A witch may use the Rite of Binding to bind spectral creatures to a fetish to create permanent effects.||The following pages show which beings must be bound for which effect. +witchery.book.burning3=Beings required: + + +entity.witchery.witchhunter.name=Witch Hunter + +item.witchery:handbow.name=Witch Hunter Pistol Crossbow +item.witchery:hunterhat.name=Witch Hunter Hat +item.witchery:hunterhat.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:huntercoat.name=Witch Hunter Coat +item.witchery:huntercoat.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:hunterlegs.name=Witch Hunter Trousers +item.witchery:hunterlegs.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:hunterboots.name=Witch Hunter Boots +item.witchery:hunterboots.tip={9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:shelfcompass.name=Poppet Shelf Compass +item.witchery:ingredient.boltStake.name=Wooden Bolt +item.witchery:ingredient.boltAntiMagic.name=Nullifying Bolt +item.witchery:ingredient.boltHoly.name=Bone Bolt +item.witchery:ingredient.boltSplitting.name=Splitting Bolt +item.witchery:ingredient.nullifiedleather.name=Nullified Leather +item.witchery:ingredient.nullcatalyst.name=Null Catalyst +item.witchery:ingredient.binkyhead.name=Binky's Skull +item.witchery:potion.antidote.name=Universal Antidote + +item.witchery:deathscowl.name=Death's Hood +item.witchery:deathscowl.tip={9Its gaze instils fear, causing victims to freeze.{0 +item.witchery:deathsrobe.name=Death's Robe +item.witchery:deathsrobe.tip={9Resistant to fire.{0 +item.witchery:deathsfeet.name=Death's Footwear +item.witchery:deathsfeet.tip={9Walk on water.{0 +item.witchery:deathshand.name=Hand of Death +item.witchery:deathshand.tip={9Spectral touch ignores armor.{0|{9Death set bonus: Summon Death's Scythe{9|{9for AOE and hunger-based damage.{9 + +witchery.rite.blackmagicdampening=Something is dissipating the magic. + +fluid.witchery:hollowtears=Hollow Tears +fluid.witchery:flowingspirit=Flowing Spirit + +tile.witchery:hollowtears.name=Flowing Spirit + + + +entity.witchery.lordoftorment.name=Lord of Torment + +entity.witchery.imp.name=Flame Imp +entity.witchery.imp.goodbye=<%s> Contract is fulfilled! +entity.witchery.imp.contract.notowners=<%s> This contract is not signed with your blood! +entity.witchery.imp.contract.unsigned=<%s> Sign the contract with your blood! +entity.witchery.imp.contract.noxp=<%s> You have too little experience for me to feed! +entity.witchery.imp.contract.deal=<%s> We have a deal! +entity.witchery.imp.gift.like=<%s> Shinies! +entity.witchery.imp.gift.hate=<%s> Me not like! Just new shiny things! +entity.witchery.imp.gift.reciprocate=<%s> I has secret to share! +entity.witchery.imp.gift.toomany=<%s> Shinies... yawn... +entity.witchery.imp.gift.power=<%s> POWER OVERWHELMING! +entity.witchery.imp.gift.powerloss=<%s> Why you do that? +entity.witchery.imp.spell.feelthefire=<%s> %s will feel my flames! +entity.witchery.imp.spell.cannotfind=<%s> Cannot find %s! +entity.witchery.imp.spell.failed=<%s> Something not right. +entity.witchery.imp.spell.notliked=<%s> Why should I do this? +entity.witchery.imp.spell.toooften=<%s> Wait little bit. +entity.witchery.imp.spell.toomuchpower=<%s> Too much POWER to think! + +tile.witchery:force.name=Solid +tile.witchery:tormentportal.name=Torment Portal +tile.witchery:refillingchest.name=Chest + +witchery.infuse.branch.unknowneffect=You have not learned this effect! +witchery.infuse.branch.effectoncooldown=Effect not ready, %s second(s) remain. + +item.witchery:ingredient.seerstone.knownspells=Knows: %s. +item.witchery:ingredient.seerstone.nospells=No mystic branch knowledge. + +item.witchery:ingredient.brewSoulHunger.name=Soul of Hunger Demon +item.witchery:ingredient.brewSoulAnguish.name=Soul of Anguish Demon +item.witchery:ingredient.brewSoulFear.name=Soul of Fear Demon +item.witchery:ingredient.brewSoulTorment.name=Soul of Torment Demon +item.witchery:ingredient.contract.name=Demonic Contract +item.witchery:ingredient.contractTorment.name=Torment +item.witchery:ingredient.contractTorment.tip=Read this text in a circle|of standing stones. Beware its|explosive entrance. +item.witchery:ingredient.contractTorment.nostones=Must stand in the dead centre of a stone circle. +item.witchery:ingredient.contractBlaze.name=Living Flame +item.witchery:ingredient.contractResistFire.name=Fiery Tolerance +item.witchery:ingredient.contractEvaporate.name=Evaporation +item.witchery:ingredient.contractFieryTouch.name=Fiery Touch +item.witchery:ingredient.contractSmelting.name=Melting Touch + +witchery.pott.tormentum=Tormentum +witchery.pott.tormentum.info=Cast the victim into eternal Torment. +witchery.pott.carnosadiem=Carnosa Diem +witchery.pott.carnosadiem.info=Fleshy feast. +witchery.pott.ignianima=Ignianima +witchery.pott.ignianima.info=Soulfire: cause pain equivalent to your own. +witchery.pott.morsmordre=Morsmordre +witchery.pott.morsmordre.info=Conjure the Dark Mark. +witchery.pott.flipendo=Flipendo +witchery.pott.flipendo.info=Push the target away with force. +witchery.pott.obliviate=Obliviate +witchery.pott.obliviate.info=Erase the target's memory (mobs lose target; players get confused). +witchery.pott.confringo=Confringo +witchery.pott.confringo.info=Cause a small explosion on impact. +witchery.pott.lumosmaxima=Lumos Maxima +witchery.pott.lumosmaxima.info=Illuminate a large area with glow globes. +witchery.pott.wingardiumleviosa=Wingardium Leviosa +witchery.pott.wingardiumleviosa.info=Levitate the target upward. Sneak to launch yourself. +witchery.pott.bombarda=Bombarda +witchery.pott.bombarda.info=Cause a moderate explosion. +witchery.pott.bombardamaxima=Bombarda Maxima +witchery.pott.bombardamaxima.info=Cause a massive terrain-destroying explosion. +witchery.pott.avis=Avis +witchery.pott.avis.info=Summon three owls to attack the target. +witchery.pott.oppugno=Oppugno +witchery.pott.oppugno.info=Summon three wolves to attack the target. +witchery.pott.piertotumlocomotor=Piertotum Locomotor +witchery.pott.piertotumlocomotor.info=Animate an iron golem to fight for you. +witchery.pott.reducto=Reducto +witchery.pott.reducto.info=Obliterate blocks and items in the area. +witchery.pott.araniaexumai=Arania Exumai +witchery.pott.araniaexumai.info=Blast spiders away; deals heavy damage to them. +witchery.pott.silencio=Silencio +witchery.pott.silencio.info=Silence a witch, preventing spell casting. +witchery.pott.protegomaxima=Protego Maxima +witchery.pott.protegomaxima.info=Create a full spherical force shield around you. +witchery.pott.revelio=Revelio +witchery.pott.revelio.info=Reveal invisible entities nearby and dispel cursed blocks. +witchery.pott.reparo=Reparo +witchery.pott.reparo.info=Repair all damaged items in your inventory. +witchery.pott.expectopatronum=Expecto Patronum +witchery.pott.expectopatronum.info=Drive away nearby undead and creepers with a burst of light. +witchery.pott.telekinesis=Telekinesis +witchery.pott.telekinesis.info=Pull a target toward you, or sneak to push it away. +witchery.pott.diffindo=Diffindo +witchery.pott.diffindo.info=A severing cut that wounds and bleeds the target. +witchery.pott.descendo=Descendo +witchery.pott.descendo.info=Slam the target violently into the ground and pin it there. +witchery.pott.geminio=Geminio +witchery.pott.geminio.info=Duplicate a minor item lying on the ground (such as a Waystone or Taglock Kit). Will not copy tools, armour or enchanted gear. +witchery.pott.apparition=Apparition +witchery.pott.apparition.info=Blink to the spot where the spell lands. +witchery.pott.fiendfyre=Fiendfyre +witchery.pott.fiendfyre.info=Unleash cursed flames, conjuring withering blazes and setting the area ablaze. Requires Hellfire infusion. +witchery.pott.expulso=Expulso +witchery.pott.expulso.info=Blast nearby entities violently away from the point of impact. +witchery.pott.engorgio=Engorgio +witchery.pott.engorgio.info=Empower the target with Health Boost and Strength. +witchery.pott.meteolojinxrecanto.info=Clear the weather, ending rain and storms. +witchery.rite.summonimp=Rite of Summoning{r||Call forth an Imp. The inner area must be clear 7x7x4 blocks! + + +tile.witchery:decurseteleport.name=Statue of Occluded Summons +tile.witchery:decursedirected.name=Statue of Broken Curses +entity.witchery.mindrake.name=Minedrake +entity.witchery.darkmark.name=Morsmordre +item.witchery:seedsmindrake.name=Minedrake Bulb +tile.witchery:mindrake.name=Minedrake + +witchery.rite.bindstatuetoplayer=Rite of Binding{r||Binds a person in the circle to the statue. +witchery.rite.bindwaystonetoplayer=Rite of Binding{r||Create a Blooded Waystone bound to the location of a creature. +entity.witchery.goblin.name=Hobgoblin +entity.witchery.goblinmog.name=Mog +entity.witchery.goblingulg.name=Gulg +item.witchery:ingredient.waystoneCreatureBound.name=Blooded Waystone +item.witchery:quiverofmog.name=Mog's Quiver +item.witchery:quiverofmog.tip={9Limitless fast arrows that obliterate airborne targets.{0|{5Become tougher when close to a player with Gulg's Gurdle.{0 +item.witchery:gurdleofgulg.name=Gulg's Gurdle +item.witchery:gurdleofgulg.tip={9Smash enemies into the air with your bare fists.{0|{5Become tougher when close to a player with Mog's Quiver.{0 +tile.witchery:stockade.oak.name=Oak Stockade +tile.witchery:stockade.spruce.name=Spruce Stockade +tile.witchery:stockade.birch.name=Birch Stockade +tile.witchery:stockade.jungle.name=Jungle Stockade +tile.witchery:stockade.rowan.name=Rowan Stockade +tile.witchery:stockade.alder.name=Alder Stockade +tile.witchery:stockade.hawthorn.name=Hawthorn Stockade +tile.witchery:stockade.acacia.name=Acacia Stockade +tile.witchery:stockade.big_oak.name=Dark Oak Stockade +item.witchery:dupstaff.name=Staff of Duplication +tile.witchery:statueofworship.name=Statue of Hobgoblin Patron +item.witchery:ingredient.kobolditedust.name=Koboldite Dust +item.witchery:ingredient.kobolditenugget.name=Koboldite Nugget +item.witchery:ingredient.kobolditeingot.name=Koboldite Ingot +item.witchery:kobolditepickaxe.name=Koboldite Pickaxe +item.witchery:ingredient.pentacle.name=Pentacle +tile.witchery:perpetualice.name=Perpetual Ice +tile.witchery:tormentstone.name=Torment Stone + +tile.witchery:infinityegg.name=Infinity Egg +item.witchery:kobolditehelm.name=Twisting Band +item.witchery:kobolditehelm.tip={9Disorientates observers.{0 + + + + +witchery:effect.paralysed=Paralysed +witchery:effect.wrappedinvine=Vine Wrapped +witchery:effect.spiked=Spikey +witchery:potion.paralysed=Paralysed +witchery:potion.insane=Insanity +witchery:potion.wrappedinvine=Vine Wrapped +witchery:potion.spiked=Spikey +witchery:potion.sprouting=Sprouting +witchery:potion.grotesque=Grotesque +witchery:potion.love=In Love +witchery:potion.allergysun=Undead's Curse +witchery:potion.allergydark=Grue's Prey +witchery:potion.chilled=Chilled +witchery:potion.snowtrail=Snow Trail +witchery:potion.hellishaura=Hellish Aura +witchery:potion.brewingexpertise=Brewing Expertise +witchery:potion.unknown= +witchery:potion.doublejump=Frog's Leg +witchery:potion.featherfall=Feather Fall +witchery:potion.reincarnate=Reincarnate +witchery:potion.insanity=Insane +witchery:potion.insanity.0=Cheese Flavored +witchery:potion.insanity.1=Finely Groomed +witchery:potion.insanity.2=Waffle Inclined +witchery:potion.insanity.3=Hairy Legged +witchery:potion.insanity.4=Turnip Tonsured +witchery:potion.insanity.5=Captain Incredible +witchery:potion.insanity.6=Tweety Pie +witchery:potion.keepinventory=Sticky Items +witchery:potion.sinking=Sinking +witchery:potion.overheating=Overheating +witchery:potion.wakingnightmare=Waking Nightmare +witchery:potion.queasy=Queasy +witchery:potion.swimming=Swim Boost +witchery:potion.resizing=Resized +witchery:potion.enderinhibition=Ender Inhibition +witchery:potion.illfitting=Ill Fitting +witchery:potion.volatility=Volatility +witchery:potion.enslaved=Enslaved +witchery:potion.mortalcoil=Mortal Coil +witchery:potion.absorbmagic=Absorb Magic +witchery:potion.poisonweapons=Poison Weapons +witchery:potion.reflectprojectiles=Reflect Projectiles +witchery:potion.reflectdamage=Reflect Damage +witchery:potion.attractprojectiles=Attract Projectiles +witchery:potion.repellattacker=Repell +witchery:potion.stoutbelly=Stout Belly +witchery:potion.feelnopain=Feel No Pain +witchery:potion.floating=Floating +witchery:potion.gasmask=Gas Mask +witchery:potion.diseased=Disease +witchery:potion.brittle=Brittle +witchery:potion.fortune=Luck +witchery:potion.worship=Worship +witchery:potion.keepeffects=Sticky Potion Effects +witchery:potion.phasewalk=Phase Walk +witchery:potion.rooted=Rooted +witchery:potion.lifesteal=Lifesteal +witchery:potion.frailty=Frailty +witchery:potion.berserk=Berserk +witchery:potion.pacified=Pacified +witchery:potion.manasiphon=Mana Siphon +witchery:potion.comprehension=Comprehension +witchery:potion.provoke=Provoke +witchery:potion.spectralsight=Spectral Sight + +witchery:potion.colorful=Tinting +witchery:potion.colorful.black=Tinting Black +witchery:potion.colorful.red=Tinting Red +witchery:potion.colorful.green=Tinting Green +witchery:potion.colorful.brown=Tinting Brown +witchery:potion.colorful.blue=Tinting Blue +witchery:potion.colorful.purple=Tinting Purple +witchery:potion.colorful.cyan=Tinting Cyan +witchery:potion.colorful.lightgray=Tinting Light Gray +witchery:potion.colorful.gray=Tinting Gray +witchery:potion.colorful.pink=Tinting Pink +witchery:potion.colorful.lime=Tinting Lime +witchery:potion.colorful.yellow=Tinting Yellow +witchery:potion.colorful.lightblue=Tinting Light Blue +witchery:potion.colorful.magenta=Tinting Magenta +witchery:potion.colorful.orange=Tinting Orange +witchery:potion.colorful.white=Tinting White + +item.witchery:brewbottle.name=Brew +item.witchery:brewbucket.name=Bucket of Brew +witchery:brew.planting=Planting +witchery:brew.floating=Floating +witchery:brew.tilling=Tilling +witchery:brew.harvesting=Harvest +witchery:brew.frogtongue=Frog's Tongue +witchery:brew.fertilization=Fertilize +witchery:brew.flowers=Flowers +witchery:brew.blight=Blight +witchery:brew.moonshine=Moonshine +witchery:brew.blast=Blast +witchery:brew.raiseland=Raise Land +witchery:brew.raising=Raising +witchery:brew.frogsleg=Frog's Leg +witchery:brew.potion=Brew of +witchery:brew.potionwater=Colored Water +witchery:brew.dispersal.gas=Gas +witchery:brew.dispersal.liquid=Liquid +witchery:brew.dispersal.splash=Splash +witchery:brew.dispersal.triggered=Triggered +witchery:brew.lifetime=Linger +witchery:brew.drinkspeed={9Quaffing: %s{0 +witchery:brew.drinkspeed.veryslow=Very Slow +witchery:brew.drinkspeed.slow=Slow +witchery:brew.drinkspeed.veryfast=Very Fast +witchery:brew.drinkspeed.fast=Fast + +witchery:brew.levelling=Levelling +witchery:brew.dissipate=Dissipate +witchery:brew.pulverisation=Pulverisation +witchery:brew.removedebuffs=Cure Debuffs +witchery:brew.removebuffs=Cure Buffs +witchery:brew.pruning=Pruning +witchery:brew.tidehold=Tidal Hold +witchery:brew.lavahold=Lava Hold +witchery:brew.inferno=Flames +witchery:brew.resizing=Resizing +witchery:brew.extinguish=Extinguish +witchery:brew.swimming=Swim Boost +witchery:brew.durationboost=Potion Longevity +witchery:brew.keepinventory=Sticky Items +witchery:brew.revealing=Revealing +witchery:brew.fullness=Fullness +witchery:brew.wasting=Wasting +witchery:brew.insanity=Insanity +witchery:brew.airhike=Air Hike +witchery:brew.reincarnate=Reincarnation +witchery:brew.featherfall=Feather Fall +witchery:brew.jump=Jumping +witchery:brew.potionmaster=Decanting +witchery:brew.moveslow=Slowness +witchery:brew.invisibility=Invisibility +witchery:brew.weakness=Weakness +witchery:brew.harming=Harming +witchery:brew.wither=Wither +witchery:brew.poison=Poison +witchery:brew.movespeed=Speed +witchery:brew.waterbreathing=Gills +witchery:brew.resistfire=Fire Resist +witchery:brew.nightvision=Owl Eye +witchery:brew.regeneration=Regeneration +witchery:brew.damageboost=Strength +witchery:brew.healing=Healing +witchery:brew.blindness=Ink +witchery:brew.fear=Fear +witchery:brew.love=Love +witchery:brew.snow=Snow +witchery:brew.allergysun=Undead's Curse +witchery:brew.allergydark=Grue's Prey +witchery:brew.paralysis=Paralysis +witchery:brew.erosion=Erosion +witchery:brew.webs=Webs +witchery:brew.vines=Vines +witchery:brew.thorns=Thorns +witchery:brew.sprouting=Sprouting +witchery:brew.iceshell=Icy Shell +witchery:brew.cold=Cold +witchery:brew.treeoak=Oak +witchery:brew.treespruce=Spruce +witchery:brew.treebirch=Birch +witchery:brew.treejungle=Jungle +witchery:brew.treeacacia=Acacia +witchery:brew.treedarkoak=Dark Oak +witchery:brew.treerowan=Rowan +witchery:brew.treealder=Alder +witchery:brew.treehawthorn=Hawthorn +witchery:brew.knockback=Knockback +witchery:brew.batburst=Bat Burst +witchery:brew.sinking=Sinking +witchery:brew.overheating=Overheating +witchery:brew.wakingnightmare=Waking Nightmare +witchery:brew.drainmagic=Drain Magic +witchery:brew.lilify=Lilify +witchery:brew.regrowth=Regrowth +witchery:brew.brittle=Brittleness +witchery:brew.hellgate=Inferno +witchery:brew.harmdemons=Demonbane +witchery:brew.harmundead=Undeadbane +witchery:brew.harminsects=Insectbane +witchery:brew.poisontoad=Poison Toad +witchery:brew.seasons=Shifting Seasons +witchery:brew.felling=Felling +witchery:brew.absorbsion=Absorbsion +witchery:brew.healthboost=Health Boost +witchery:brew.transposeore=Transpose Ore +witchery:brew.transpose=Transpose +witchery:brew.stealbuffs=Steal Buffs +witchery:brew.spreaddebuffs=Spread Debuffs +witchery:brew.iceworld=Ice World +witchery:brew.phasewalk=Phase Walk +witchery:brew.rooted=Rooting +witchery:brew.lifesteal=Lifesteal +witchery:brew.frailty=Frailty +witchery:brew.berserk=Berserk +witchery:brew.pacified=Pacify +witchery:brew.manasiphon=Mana Siphon +witchery:brew.comprehension=Comprehension +witchery:brew.provoke=Provoke +witchery:brew.spectralsight=Spectral Sight +witchery:brew.petrify=Petrify +witchery:brew.glaciate=Glaciate +witchery:brew.glasswork=Vitrify +witchery:brew.soultether=Soul Tether + +witchery:brew.skillincrease=You feel more skilled at brewing, perhaps less brew will be wasted from now on. + +item.witchery:brew.water.name=Brew of Endless Water +item.witchery:brew.water.tip=Endless Water (%s/%s) + + +tile.witchery:cauldron.name=Witch's Cauldron +tile.witchery:web.name=Web +tile.witchery:vine.name=Vine +tile.witchery:cactus.name=Cactus +tile.witchery:lilypad.name=Water Lily + +tile.witchery:icedoor.name=Ice Door +tile.witchery:icefence.name=Ice Fence +tile.witchery:icefencegate.name=Ice Gate +tile.witchery:iceslab.name=Ice Slab +tile.witchery:icedoubleslab.name=Ice Double Slab +item.witchery:iceslab.name=Ice Slab +item.witchery:icedoubleslab.name=Ice Double Slab +tile.witchery:icestairs.name=Ice Stairs +item.witchery:ingredient.doorIce.name=Ice Door +tile.witchery:icestockade.ice.name=Ice Stockade +tile.witchery:icepressureplate.name=Ice Pressure Plate +tile.witchery:snowpressureplate.name=Snow Pressure Plate + +item.witchery:ingredient.annointingPaste.name=Anointing Paste + +item.witchery:ingredient.seerstone.bottlingskill=Bottling skill: %s. + +tile.witchery:snowstairs.name=Snow Stairs +tile.witchery:snowslab.name=Snow Slab +tile.witchery:snowdoubleslab.name=Snow Double Slab +item.witchery:snowslab.name=Snow Slab +item.witchery:snowdoubleslab.name=Snow Double Slab + +tile.witchery:pitdirt.name=Dirt +tile.witchery:pitpodzol.name=Podzol +tile.witchery:pitgrass.name=Grass + +tile.witchery:cbuttonwood.name=Button +tile.witchery:cbuttonstone.name=Button +tile.witchery:clever.name=Lever +tile.witchery:cwoodpressureplate.name=Pressure Plate +tile.witchery:cstonepressureplate.name=Pressure Plate +tile.witchery:csnowpressureplate.name=Snow Pressure Plate +tile.witchery:cwoodendoor.name=Wooden Door + +item.witchery:leonardsurn.name=Leonard's Urn +item.witchery:leonardsurn.tip=Place a brew in the Urn to|focus its power, then release|it though your wand. +item.witchery:earmuffs.name=Earmuffs +item.witchery:earmuffs.tip=Protection from Mandrakes +item.witchery:playercompass.name=Player Compass +item.witchery:ingredient.subduedSpiritVillage.name=Subdued Village Spirit + +fluid.witchery:disease=Disease +tile.witchery:disease.name=Disease + +item.witchery:brew.fuel.name=Brew of Combustion +item.witchery:brew.fuel.0=Combustion +item.witchery:brew.fuel.1=Combustion II +item.witchery:brew.fuel.2=Combustion III +item.witchery:brew.fuel.3=Combustion IV +item.witchery:bookbiomes2.name=Book of Biomes (Extended Edition) +item.witchery:biomenote.name=Biome %s +witchery.book.biomes.river.name=River +witchery.book.biomes.ocean.name=Ocean +witchery.book.biomes.sandy.name=Sandy +witchery.book.biomes.snowy.name=Snowy +witchery.book.biomes.mesa.name=Mesa +witchery.book.biomes.spooky.name=Spooky +witchery.biomebook.currentpage=Current Page: {5%s{0 +witchery.biomebook.rainfall=Rainfall: %s +witchery.biomebook.snows=Snows: %s +witchery.biomebook.lightning=Lightning: %s +witchery.biomebook.temperature=Temp: %s +witchery.biomebook.temperaturehot=Temp: %s (Humid) +witchery.no=No +witchery.yes=Yes +item.witchery:biomebook2.tip={oCraft the book with a piece of paper,|{oto copy the current biome page (used|{oin some rituals). + +entity.witchery.leonard.name=Shade of Leonard +entity.witchery.lostsoul.name=Lost Soul + +witchery.pott.leonard1=Caelum +witchery.pott.leonard1.info=Release the brew focused in Leonard's Urn skyward (upward). +witchery.pott.leonard2=Baratrum +witchery.pott.leonard2.info=Release the brew focused in Leonard's Urn into the depths (downward). +witchery.pott.leonard3=Ortus +witchery.pott.leonard3.info=Release the brew focused in Leonard's Urn to the east. +witchery.pott.leonard4=Occasus +witchery.pott.leonard4.info=Release the brew focused in Leonard's Urn to the west. + +witchery:color.black=Black +witchery:color.red=Red +witchery:color.green=Green +witchery:color.brown=Brown +witchery:color.blue=Blue +witchery:color.purple=Purple +witchery:color.cyan=Cyan +witchery:color.lightgray=Light Gray +witchery:color.gray=Gray +witchery:color.pink=Pink +witchery:color.lime=Lime +witchery:color.yellow=Yellow +witchery:color.lightblue=Light Blue +witchery:color.magenta=Magenta +witchery:color.orange=Orange +witchery:color.white=White + + + +item.witchery:cauldronbook.name=Witches' Brews +item.witchery:cauldronbook.tip=The definitive guide to cauldrons and potion brewing. + +witchery:cauldronbook.tbench=[i Crafting Bench][br][br][stack=%s][stack=%s][stack=%s][br][stack=%s][stack=%s][stack=%s] [img=witchery:textures/gui/arrowrightresult.png|left|middle|22|15] [stack=%s|left|middle][br] [stack=%s][stack=%s][stack=%s] +witchery:cauldronbook.tcraft=%s[br][img=witchery:textures/gui/cauldron.png|left|top|30|29] [img=witchery:textures/gui/arrowrightresult.png|left|middle|22|15] [stack=%s|left|middle] +witchery:cauldronbook.tritual=%s[br][img=witchery:textures/gui/cauldron.png|center|top|30|29] +witchery:cauldronbook.toc=[h1 Witches' Brews]> [url Introduction][br]> [url Brewing][br]> [url=rituals Cauldron Rituals][br]> [url Crafting][br]> [url Other rituals][br]> [url Capacity][br]> [url Power][br]> [url Duration][br]> [url Modifiers][br]> [url Dispersal][br]> [url=toc/effects Effects][br]> [url=toc/additions New Additions] +witchery:cauldronbook.toc/additions=[h1 New Additions]Recent secrets uncovered by the coven:[br][br]> [url=floopowder Floo Powder][br]> [url=floofire Floo Fire][br]> [url=geminio Geminio Charm][br]> [url=glyphbrew Impregnated Glyphs] +witchery:cauldronbook.floopowder=[next=floofire][h1 Floo Powder]Brewed in the kettle from Ash Wood, redstone and glowstone dust. Cast a pinch onto an open flame and the fire turns an eerie green - this is [url=floofire Floo Fire]. The powder is spent, but the journey it opens is well worth it.[br][br][stack=witchery:ingredient|166 Floo Powder] +witchery:cauldronbook.floofire=[next=geminio][h1 Floo Fire]An open fire dusted with [url=floopowder Floo Powder] burns green. While [b holding a Waystone bound] to a location, simply step into the green flames to be whisked there at once.[br][br][i The Waystone is the destination key, not fuel - it is never consumed.] +witchery:cauldronbook.geminio=[next=glyphbrew][h1 Geminio Charm]A Mystic Branch gesture that copies a [b minor] item lying on the ground - such as a Waystone or a Taglock Kit - producing a single duplicate where it lands.[br][br][i It will not copy tools, armour or enchanted gear.] +witchery:cauldronbook.glyphbrew=[h1 Impregnated Glyphs]Just as a thrown [url dispersal] Triggered brew can curse a lever or button, it can also be cast upon a chalk [b glyph]. Items resting on that glyph drink in the brew, carrying its blessing or curse until used. + +witchery:cauldronbook.introduction=[next=cauldron][h1 Introduction]Fill a [url cauldron] to the brim with water and light a fire beneath. When the water boils, throw in your ingredients for either:[br][br]> [url Brewing][br]> [url Rituals][br]> [url Crafting] +witchery:cauldronbook.cauldron=[next=cauldron2][h1 Cauldron: Recipe]A witch's cauldron is made by placing a normal [i Cauldron] in the world and using [i Anointing Paste] on it:[br][br][template=tbench 6=witchery:ingredient|153 0=witchery:seedsbelladonna 1=witchery:seedsmandrake 2=empty 3=witchery:seedsartichoke 4=witchery:seedssnowbell 5=empty 7=empty 8=empty 9=empty] +witchery:cauldronbook.cauldron2=[h1 Cauldron: Emptying]Empty a cauldron by dropping in one of the following:[br][br][stack=witchery:ingredient|17 Clear cauldron][br][stack=witchery:ingredient|16 Explode contents][br][br][i The witch and nearby structures will not be damaged.] + +witchery:cauldronbook.crafting=[next=toc/crafting2][h1 Crafting]The cauldron can be used to create or imbue items with magical properites. If a suitable combination of ingredients is thrown into the cauldron, the creation process will begin automatically. Use [url=rituals6 ritual circles] to reduce power costs! +witchery:cauldronbook.toc/crafting2=[next=crafting3][h1 Crafting: Recipes]> [url Boiled Meat][br]> [url Mutandis][br]> [url Mutandis Extremis][br]> [url Drop of Luck][br]> [url Otherwhere Chalk][br]> [url Infernal Chalk][br]> [url Golden Chalk][br]> [url Mutating Sprig][br]> [url Nether Wart][br]> [url End Stone][br]> [url Rotten Flesh] +witchery:cauldronbook.crafting3=[h1 Crafting: Recipes]> [url Pit Traps][br]> [url=compass Player Compass] +witchery:cauldronbook.boiledmeat=[h1 Crafting: Cooked Meat]Porkchop, Beef, Chicken and Porkchop? can all be dropped into a boiling cauldron to cook.[br][br][template=tcraft stack|0=porkchop 1=cooked_porkchop] +witchery:cauldronbook.mutandis=[h1 Crafting: Mutandis]Use Mutandis on simple plants, to mutate them into another, perhaps undiscovered, species.[br][br][template=tcraft stack|0=witchery:ingredient|22,witchery:ingredient|31,egg 1=witchery:ingredient|14|6] +witchery:cauldronbook.mutandisextremis=[h1 Crafting: Mutandis Extremis]Use on plants to mutate them. Grass creates mycellium. Underwater dirt creates clay.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|14 1=witchery:ingredient|15] +witchery:cauldronbook.mutatingsprig=[h1 Crafting: Mutating Sprig]Use on plants and creatures as part of mutating rituals.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|82,witchery:ingredient|15 1=witchery:mutator] +witchery:cauldronbook.dropofluck=[h1 Crafting: Drop of Luck]Bottled luck, rare and hard to make.[br][br][template=tcraft stack|0=witchery:ingredient|22,nether_wart,witchery:ingredient|37,witchery:ingredient|38,witchery:ingredient|15 1=witchery:ingredient|39] +witchery:cauldronbook.otherwherechalk=[h1 Crafting: Otherwhere Chalk]Used in rites involving transposition.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|37,ender_pearl,witchery:chalkritual 1=witchery:chalkotherwhere] +witchery:cauldronbook.infernalchalk=[h1 Crafting: Infernal Chalk]Used in rites involving the nether and demons.[br][br][template=tcraft stack|0=nether_wart,blaze_powder,witchery:chalkritual 1=witchery:chalkinfernal] +witchery:cauldronbook.goldenchalk=[h1 Crafting: Golden Chalk]The centrepiece of most rites.[br][br][template=tcraft stack|0=witchery:ingredient|22,gold_nugget,witchery:chalkritual 1=witchery:chalkheart] +witchery:cauldronbook.netherwart=[h1 Crafting: Nether Wart]For when a Nether Fortress is too hard to find.[br][br][template=tcraft stack|0=witchery:ingredient|22,witchery:ingredient|37,witchery:ingredient|29,ender_pearl,wheat,witchery:ingredient|14 1=nether_wart] +witchery:cauldronbook.endstone=[h1 Crafting: End Stone]What happens when the floating island is all gone?[br][br][template=tcraft stack|0=witchery:ingredient|22,stone,end_stone,witchery:ingredient|15 1=end_stone|0|2] +witchery:cauldronbook.rottenflesh=[h1 Crafting: Rotten Flesh]Finally a use for spare hands.[br][br][template=tcraft stack|0=witchery:witchhand 1=rotten_flesh|0|5] +witchery:cauldronbook.pittraps=[h1 Crafting: Pit Traps]Non-solid blocks![br][template=tcraft stack|0=witchery:ingredient|22,dirt,witchery:ingredient|101 1=witchery:pitdirt|0|4][br][br][template=tcraft stack|0=nether_wart,dirt,yellow_flower,witchery:ingredient|101 1=witchery:pitgrass|0|4] +witchery:cauldronbook.compass=[h1 Crafting: Player Compass]Craft with a taglock to find the way to that person.[br][br][template=tcraft stack|0=nether_wart,witchery:ingredient|37,vine,spider_eye,compass 1=witchery:playercompass] + +witchery:cauldronbook.brewing=[next=brewing2][h1 Brews]Use a glass bottle to retrieve your potion when the cauldron splutters. Certain ingredients may need to draw power from an altar. More brews may be recovered as your [url=bottling expertise] grows.[br][br][stack=glass_bottle Glass Bottle] +witchery:cauldronbook.brewing2=[next=brewing3][h1 Brews: Effects & Modifiers]A brew consists of one or more [url=toc/effects effects] with modifiers and a [url dispersal] method, also with modifiers. Modifiers to an effect or dispersal method must be added in-order before the effect is added. +witchery:cauldronbook.brewing3=[next=brewing4][h1 Brews: Capacity]Each effect added to a brew will require a certain ammout of storage space. Special [url=capacity ingredients] are used to add such capacity to a brew, and they must be added in order to have a cumulative effect. +witchery:cauldronbook.brewing4=[next=brewing5][h1 Brews: Capacity]Multiple effects can be added to a brew, but there must be sufficient capacity for all of them combined. +witchery:cauldronbook.brewing5=[next=brewing6][h1 Brews: Step-by-step]1. Increase [url capacity][br]2. Add [url modifiers][br]3. Increase [url power][br]4. Increase [url duration][br]5. Add [url=toc/effects effect][br]6. Repeat from 3[br]> Bottle or continue[br]7. Increase [url extent][br]8. Increase [url=linger lingering][br]9. Set [url dispersal][br]> Bottle or do [url=rituals ritual] +witchery:cauldronbook.brewing6=[h1 Brews: Splash Brew of Extinguish Fires]Throw the following items into a full, boiling cauldron. Then use a glass bottle on the cauldron.[stack=glass_bottle][br][stack=witchery:ingredient|22][stack=coal][stack=gunpowder][br][img=witchery:textures/gui/cauldron.png|center|top|30|29] +witchery:cauldronbook.bottling=[next=bottling2][h1 Bottling]Inexperienced witches are not so proficient in actually bottling a brew. To obtain more brews from a cauldron practice is needed, eventually requiring more complex brews to be made. +witchery:cauldronbook.bottling2=[h1 Bottling]Wearing the correct clothing also helps an experienced witch, as does a Toad familiar. It may also be possible to use special brews to augment your proficiency. + +witchery:cauldronbook.rituals=[next=rituals2][h1 Rituals]Instead of bottling a brew, a full cauldron may instead be used to cast the effects as a ritual. Ritual casting requires the witch to add either a Taglock of the target or Tongue of Dog to cast it at the cauldron's location. +witchery:cauldronbook.rituals2=[next=rituals3][h1 Rituals: Waystones]A bound waystone may be added before the Tongue of Dog, to cast the ritual at the waystone's location. Some effects may require a second waystone to determine a source location. +witchery:cauldronbook.rituals3=[next=rituals4][h1 Rituals: Covens & Strength]The power of a rituals effects and the maximum range a ritual may be cast is determined by how many witches from a coven participate in the ritual. A maximum of seven witches may participate. +witchery:cauldronbook.rituals4=[next=rituals5][h1 Rituals: Dispersal]Using a taglock to start a ritual targets the bound creature. Otherwise a [url dispersal] ingredient must be added before the Tongue of Dog. Instant splash remains unchanged, but gas become an expanding effect and liquid produces rain. +witchery:cauldronbook.rituals5=[next=rituals6][h1 Rituals: Risks & Power]Performing a ritual with a cauldron needs altar power and, unlike pure circle magic, carries a risk of side-effects.[br]Surrounding the cauldron with chalk circles can help offset the power requirements and augment the risks. +witchery:cauldronbook.rituals6=[next=rituals7][h1 Rituals: Risks & Power]Ritual (white) small and/or medium circles can be used to moderately reduce power costs and eliminate side-effects.[br][br][img=witchery:textures/gui/circles_2white.png|center|top|32|32] +witchery:cauldronbook.rituals7=[next=rituals8][h1 Rituals: Risks & Power]Infernal (red) small and/or medium circles can be used to significantly reduce altar power costs, but at an increased risk of side-effects.[br][br][img=witchery:textures/gui/circles_2red.png|center|top|32|32] +witchery:cauldronbook.rituals8=[next=rituals9][h1 Rituals: Risks & Power]Red and white circles may be mixed as desired to get the appropriate balance of power costs and risks. +witchery:cauldronbook.rituals9=[next=rituals10][h1 Rituals: Failed rituals] When a ritual fails, it will emit colored smoke:[br][br][darkgreen Green] Target too far[br][darkblue Blue] Coven needed[br][darkred Red] Invalid circles[br][darkyellow Yellow] Underpowered[br][darkpurple Purple] Other failure[br][br]Rituals will not start if there is too little power. +witchery:cauldronbook.rituals10=[next=rituals11][h1 Rituals: Ritual of Raise Land]The further from the cauldron the waystone points, the larger the coven must be.[br][br][template=tritual stack|0=nether_wart,witchery:ingredient|37,quartz,witchery:ingredient|13,witchery:ingredient|25] +witchery:cauldronbook.rituals11=[h1 Rituals: Extended Curse of Blindness]The further from the victim, the larger the coven must be.[br][br][template=tritual stack|0=nether_wart,witchery:ingredient|37,redstone,dye|0,witchery:taglockkit|1] + +witchery:cauldronbook.otherrituals=[h1 Other Rituals]New rites that do not require an altar:[br][br]> [url=ritualwaystone Bind Waystone][br]> [url=ritualwaystoneblooded Blooded Waystone][br]> [url=ritualtranspose Transpose][br]> [url=ritualfind Find Structure] +witchery:cauldronbook.ritualwaystone=[h1 Ritual: Bind Waystone]To bind up to eight waystones, draw a 3x3 purple-chalk circle:[br][img=witchery:textures/gui/circles_tinypurple.png|center|top|32|32][br]Drop the waystones into the center, step back and wait. +witchery:cauldronbook.ritualwaystoneblooded=[h1 Ritual: Bind Blooded Waystone]To bind a waystone to a creature, draw a 3x3 purple-chalk circle near an Altar:[br][img=witchery:textures/gui/circles_tinypurple.png|center|top|32|32][br]With the creature near, drop a waysone in the center and wait. +witchery:cauldronbook.ritualtranspose=[h1 Ritual: Transpose]To transpose to a bound waystone, draw a 5x5 purple-chalk circle:[br][img=witchery:textures/gui/circles_spurple.png|center|top|32|32][br]Stand in the circle, drop the waystone inside the circle, and wait. +witchery:cauldronbook.ritualfind=[h1 Ritual: Find Structure]Summon a spirit that flys towards the closest village (or nether fortress). Draw a 3x3 white-chalk circle:[br][img=witchery:textures/gui/circles_tinywhite.png|center|top|32|32][br]Drop a Subdued Spirit or Attuned Stone in the center and wait. + +witchery:cauldronbook.capacity=[i Capacity] - [url=toc/effects Effects] each have a space requirement, add these ingredients, in order, to increase a brew's capacity.[br][br][stack=witchery:ingredient|22 +1][tab][stack=nether_wart +2][br][stack=witchery:ingredient|37 +2][tab][stack=witchery:ingredient|29 +2][br][stack=diamond +2][tab][stack=nether_star +4] +witchery:cauldronbook.power=[i Power] - Add, in order, before an [url=toc/effects effect] to increase its power.[br][br][stack=glowstone_dust +1 (to level II)][br][stack=blaze_rod +1 (to level III)][br][stack=witchery:ingredient|11 +1 (to level IV)] +witchery:cauldronbook.duration=[i Duration] - Add, in order, before an [url=toc/effects effect] to increase its duration.[br][br][stack=redstone +1 (to x2)][br][stack=obsidian +1 (to x4)][br][stack=witchery:seedsmindrake +1 (to x6)] + +witchery:cauldronbook.modifiers=[next=modifiers2][h1 Modifiers: General]These modifiers change the following effect.[br][br][stack=gold_nugget No particles][br][stack=fermented_spider_eye Invert next effect][br][stack=netherbrick Skip block effects][br][stack=brick Skip entity effects] +witchery:cauldronbook.modifiers2=[next=modifiers3][h1 Modifiers: Quaffing]Each quaffing bonus can be added once, before all effects, for a cumulative boost.[br][br][stack=witchery:ingredient|63 Faster quaffing][br][stack=witchery:ingredient|31 Faster quaffing][br][stack=witchery:spanishmoss Faster quaffing] +witchery:cauldronbook.modifiers3=[next=modifiers4][h1 Modifiers: Color]Change brew color.[br][stack=wool|0 White color][br][stack=wool|1 Orange color][br][stack=wool|2 Magenta color][br][stack=wool|3 Light blue color][br][stack=wool|4 Yellow color][br][stack=wool|5 Lime color] +witchery:cauldronbook.modifiers4=[next=modifiers5][h1 Modifiers: Color][stack=wool|6 Pink color][br][stack=wool|7 Gray color][br][stack=wool|8 Light gray color][br][stack=wool|9 Cyan color][br][stack=wool|10 Purple color][br][stack=wool|11 Blue color] +witchery:cauldronbook.modifiers5=[h1 Modifiers: Color][stack=wool|12 Brown color][br][stack=wool|13 Green color][br][stack=wool|14 Red color][br][stack=wool|15 Black color] + +witchery:cauldronbook.dispersal=[i Dispersal] - Add one, after any [url extent] or [url linger] modifiers, to set a splash effect.[br][br][stack=gunpowder or][stack=witchery:ingredient|69 Instant][br][stack=witchery:ingredient|24 Gas][br][stack=witchery:ingredient|111 Liquid][br][stack=skull|2][url=dispersaltrigger|middle Trigger] +witchery:cauldronbook.dispersaltrigger=[next=dispersaltrigger2][h1 Dispersal: Trigger - Brew]Brew the [url=brewing potion] then throw it at a button, lever, wooden door or pressure plate, to apply its effects to the next person who activates the block. +witchery:cauldronbook.dispersaltrigger2=[h1 Dispersal: Trigger - Ritual]Cast the brew as a [url=rituals ritual], then place any item on top of the cauldron, to imbue the item with its effects. The effects will be cast on the next creature to use the item. Repeat the ritual to add more charges to the item. +witchery:cauldronbook.extent=[i Disperal Extent] - Add, in order, before the [url dispersal] ingredient, to increase its area of effect.[br][br][stack=witchery:ingredient|18 +1 (to level II)][br][stack=dye|3 +1 (to level III)][br][stack=witchery:somniancotton +1 (to level IV)] +witchery:cauldronbook.linger=[i Disperal Lingering] - Add, in order, before the [url dispersal], to increase its duration.[br][br][stack=witchery:ingredient|21 +1 (to level II)][br][stack=dye|4 +1 (to level III)][br][stack=end_stone +1 (to level IV)] + +witchery:cauldronbook.toc/effects=[h1 Effects]Add after any [url power] and [url duration] boost or [url modifiers]. Ensure brew has [url capacity].[br][br]> [url Level 1][br]> [url Level 2][br]> [url Level 4][br]> [url Level 5][br]> [url Level 6][br]> [url Level 8][br]> [url Level 12] +witchery:cauldronbook.level1=[next=level1_2][h1 Effect: Level 1][stack=snowball][url=snowburst|middle Snow Burst & Trail][br][stack=fish|0][url=swimspeed|middle Swim Speed][br][stack=witchery:ingredient|67][url=enderinhibition|middle Ender Inhibition][br][stack=wheat][url=moonshine|middle Moonshine][br][stack=sand][url=partwater|middle Part water] +witchery:cauldronbook.level1_2=[next=level1_3][h1 Effect: Level 1][stack=coal|0][url=extinguish|middle Extinguish Fires][br][stack=stone][url=dissipategas|middle Dissipate Gas][br][stack=yellow_flower][url=growflowers|middle Grow flowers][br][stack=dye|15][url=fertilize|middle Fertilize][br][stack=apple][url=harvest|middle Harvest] +witchery:cauldronbook.level1_3=[next=level1_4][h1 Effect: Level 1][stack=dirt][url=tilling|middle Till land][br][stack=wheat_seeds][url=planting|middle Planting][br][stack=brown_mushroom][url=pruning|middle Prune Leaves][br][stack=string][url=felling|middle Fell tree][br][stack=flint][url=pulverize|middle Pulverize rock][br][stack=waterlily][url=growlily|middle Grow lily] +witchery:cauldronbook.level1_4=[h1 Effect: Level 1][stack=witchery:ingredient|156][url=wolfsbane|middle Wolfsbane][br][stack=dye|1][url=tinting|middle Tint skin *][br][br][i * can use any dye for the desired color.][br][br][stack=coal|1][url=combustion|middle Combustion *][br][br][i * cannot be combined with other effects.] + +witchery:cauldronbook.level2=[next=level2_2][h1 Effect: Level 2][stack=cobblestone][url=partlava|middle Part lava][br][stack=witchery:bramble][url=repel|middle Repel attacker][br][stack=gravel][url=brewgasimmunity|middle Brew gas immunity][br][stack=spider_eye][url=poison|middle Poison][br][stack=ghast_tear][url=regeneration|middle Regeneration][br][stack=fermented_spider_eye][stack=ghast_tear][url=poison|middle Poison] +witchery:cauldronbook.level2_2=[next=level2_3][h1 Effect: Level 2][stack=sugar][url=fastmove|middle Fast movement][br][stack=fermented_spider_eye][stack=sugar][url=slowmove|middle Slow movement][br][stack=fish|3][url=waterbreathing|middle Water breathing][br][stack=magma_cream][url=resistfire|middle Resist fire][br][stack=golden_carrot][url=nightvision|middle Night vision][br][stack=fermented_spider_eye][stack=golden_carrot][url=invisible|middle Invisible] +witchery:cauldronbook.level2_3=[next=level2_4][h1 Effect: Level 2][stack=blaze_powder][url=damageboost|middle Damage boost][br][stack=fermented_spider_eye][stack=blaze_powder][url=weakness|middle Weakness][br][stack=speckled_melon][url=heal|middle Heal][br][stack=fermented_spider_eye][stack=speckled_melon][url=harm|middle Harm][br][stack=reeds][url=floating|middle Floating] +witchery:cauldronbook.level2_4=[next=level2_5][h1 Effect: Level 2][stack=leather][url=jump|middle Jump][br][stack=feather][url=slowfall|middle Slow fall][br][stack=web][url=reflectarrows Reflect arrows][br][stack=fermented_spider_eye][stack=web][url=attractarrows|middle Attract arrows][br][stack=red_mushroom][url=poisonweapon|middle Poison weapon] +witchery:cauldronbook.level2_5=[next=level2_6][h1 Effect: Level 2][stack=witchery:ingredient|108][url=batburst|middle Bat burst][br][stack=witchery:ingredient|32][url=airhike|middle Air hike][br][stack=slime_ball][url=pull|middle Pull][br][stack=witchery:ingredient|30][url=erosion|middle Erosion][br][stack=netherrack][url=levelland|middle Level Land][br][stack=witchery:ingredient|56][url=webs|middle Webs] +witchery:cauldronbook.level2_6=[next=level2_7][h1 Effect: Level 2][stack=vine][url=vines|middle Vines & Flammable][br][stack=cactus][url=thorns|middle Cactus & Thorned][br][stack=witchery:ingredient|82][url=sprouting|middle Sprouting][br][stack=witchery:ingredient|78][url=freeze|middle Freeze][br][stack=stick][url=knockback|middle Knockback][br][stack=pumpkin][url=undeadbane|middle Undeadbane] +witchery:cauldronbook.level2_7=[next=level2_8][h1 Effect: Level 2][stack=red_flower|1][url=insectbane|middle Insectbane][br][stack=witchery:witchsapling|0][url=growtree|middle Grow rowan][br][stack=witchery:witchsapling|1][url=growtree|middle Grow alder][br][stack=witchery:witchsapling|2][url=growtree|middle Grow hawthorn][br][stack=sapling|5][url=growtree|middle Grow dark oak] +witchery:cauldronbook.level2_8=[next=level2_9][h1 Effect: Level 2][stack=sapling|0][url=growtree|middle Grow oak][br][stack=sapling|1][url=growtree|middle Grow spruce][br][stack=sapling|2][url=growtree|middle Grow birch][br][stack=sapling|3][url=growtree|middle Grow jungle][br][stack=sapling|4][url=growtree|middle Grow acacia][br][stack=witchery:ingredient|35][url=removebuffs|middle Remove Buffs] +witchery:cauldronbook.level2_9=[h1 Effect: Level 2][stack=witchery:ingredient|105][url=removedebuffs|middle Remove debuffs][br][stack=snow][url=endlesswater|middle Endless Water *][br][br][i * cannot be combined with other effects.][br][stack=glass_bottle][url=spectralsight|middle Spectral Sight] + +witchery:cauldronbook.level4=[next=level4_2][h1 Effect: Level 4][stack=witchery:glintweed][url=flames|middle Flames][br][stack=witchery:ingredient|80][url=fear|middle Fear][br][stack=dye|0][url=blindness|middle Blindness][br][stack=red_flower|0][url=love|middle Love][br][stack=witchery:ingredient|23][url=paralysis|middle Paralysis][br][stack=rotten_flesh][url=disease|middle Disease] +witchery:cauldronbook.level4_2=[next=level4_3][h1 Effect: Level 4][stack=witchery:ingredient|39][url=brewbottling|middle Brew bottling][br][stack=fermented_spider_eye][stack=witchery:ingredient|39][url=insanity|middle Insanity][br][stack=witchery:ingredient|99][url=sinking|middle Sinking][br][stack=witchery:embermoss][url=overheating|middle Overheating][br][stack=witchery:ingredient|103][url=nightmare|middle Nightmare][br][stack=witchery:ingredient|90][url=frogsleg|middle Frog's Leg] +witchery:cauldronbook.level4_3=[next=level4_4][h1 Effect: Level 4][stack=golden_apple][url=absorbtion|middle Absorption][br][stack=golden_apple|1][url=healthboost|middle Health boost][br][stack=witchery:ingredient|112][url=wasting|middle Wasting][br][stack=fermented_spider_eye][stack=witchery:ingredient|112][url=fullness|middle Fullness][br][stack=witchery:ingredient|36][url=revealing|middle Revealing][br][stack=tallgrass|0][url=volatility|middle Volatility] +witchery:cauldronbook.level4_4=[next=level4_5][h1 Effect: Level 4][stack=witchery:ingredient|28][url=stoutbelly|middle Stout belly][br][stack=poisonous_potato][url=blight|middle Blight][br][stack=ender_pearl][url=transpose|middle Transpose][br][stack=iron_ingot][url=transposeore|middle Transpose ore][br][stack=bone][url=raisedead|middle Raise dead][br][stack=quartz][url=raiseland|middle Raise land] +witchery:cauldronbook.level4_5=[next=level4_6][h1 Effect: Level 4][stack=soul_sand][url=gruesprey|middle Grue's Prey][br][stack=witchery:ingredient|34][url=absorbmagic|middle Absorb magic][br][stack=skull|1][url=wither|middle Wither][br][stack=witchery:ingredient|157][url=harmwerewolves|middle Harm Werewolves][br][stack=witchery:garlic][url=weakenvampires|middle Weaken Vampires] +witchery:cauldronbook.level4_6=[next=level4_7][h1 Effect: Level 4][stack=witchery:ingredient|165][url=animalattraction|middle Animal attraction][br][stack=fermented_spider_eye][stack=witchery:ingredient|165][url=animalrepulsion|middle Animal replusion][br][stack=name_tag][url=comprehension|middle Comprehension][br][stack=packed_ice][url=glaciate|middle Glaciate][br][stack=sandstone][url=glasswork|middle Glasswork] +witchery:cauldronbook.level4_7=[h1 Effect: Level 4][stack=lead][url=soulswap|middle Soul Swap][br][stack=map][url=amnesia|middle Amnesia] + +witchery:cauldronbook.level5=[next=level5_2][h1 Effect: Level 5][stack=witchery:ingredient|38][url=inferno|middle Inferno][br][stack=gold_ingot][url=blast|middle Blast][br][stack=double_plant][url=poisontoad|middle Poison Toad][br][stack=ender_eye][url=iceworld|middle Ice World][br][stack=witchery:ingredient|79][url=iceshell|middle Ice shell][br][stack=witchery:ingredient|66][url=reflectdamage|middle Reflect damage] +witchery:cauldronbook.level5_2=[h1 Effect: Level 5][stack=ice][url=demonbane|middle Demonbane][br][stack=melon][url=lifesteal|middle Lifesteal][br][stack=fire_charge][url=berserk|middle Berserk][br][stack=iron_sword][url=frenzy|middle Frenzy][br][stack=shears][url=spectralthief|middle Spectral Thief] + +witchery:cauldronbook.level6=[next=level6_2][h1 Effect: Level 6][stack=fish|1][url=undeadscurse|middle Undead's Curse][br][stack=witchery:bramble|1][url=illfitting|middle Ill Fitting][br][stack=witchery:ingredient|33][url=reincarnate|middle Reincarnate][br][stack=witchery:ingredient|74][url=durationboost|middle Duration Boost][br][stack=emerald][url=resizing|middle Resizing][br][stack=skull|0][url=stealbuffs|middle Steal buffs] +witchery:cauldronbook.level6_2=[next=level6_3][h1 Effect: Level 6][stack=clay_ball][url=fortune|middle Fortune][br][stack=witchery:ingredient|114][url=drainmagic|middle Drain magic][br][stack=glass_pane][url=phasewalk|middle Phasewalk][br][stack=experience_bottle][url=manasiphon|middle Mana Siphon][br][stack=stonebrick][url=petrify|middle Petrify] +witchery:cauldronbook.level6_3=[h1 Effect: Level 6][stack=bed][url=astralprojection|middle Astral Projection][br][stack=paper][url=voodoolink|middle Voodoo Link][br][stack=saddle][url=polymorph|middle Polymorph][br][stack=fishing_rod][url=etherealchains|middle Ethereal Chains][br][stack=reeds][url=sirensong|middle Siren's Song][br][stack=book][url=covencall|middle Coven's Call] + +witchery:cauldronbook.level8=[next=level8_2][h1 Effect: Level 8][stack=witchery:ingredient|113][url=keepinventory|middle Keep inventory][br][stack=witchery:biomenote][url=shiftingseasons|middle Shifting seasons][br][stack=skull|4][url=spreaddebuffs|middle Spread debuffs][br][stack=witchery:ingredient|40][url=keepeffects|middle Keep effects][br][stack=clock][url=soultether|middle Soul Tether] +witchery:cauldronbook.level8_2=[h1 Effect: Level 8][stack=iron_door][url=banishment|middle Banishment][br][stack=name_tag][url=doppelganger|middle Doppelganger][br][stack=string][url=marionette|middle Marionette][br][stack=sponge][url=silence|middle Silence] + +witchery:cauldronbook.level12=[h1 Effect: Level 12][stack=witchery:witchhat][url=leonard|middle Summon Leonard] + +witchery:cauldronbook.endlesswater=[h1 Effect: Endless water]This effect cannot be combined with any other. When complete, it will have a number of charges based on the power modifier. One charge can be used to create a water block or fill a cauldron. A dispensor can be used to fill or create water. +witchery:cauldronbook.growtree=[h1 Effect: Grow tree]Causes a tree to grow of the type used when creating the brew. Larger trees can be grown by increasing the power level of the effect. +witchery:cauldronbook.removebuffs=[h1 Effect: Remove buffs]Removes any positive potion effects from hit creatures, that are the same level or lower than that of the power of this effect. +witchery:cauldronbook.insectbane=[h1 Effect: Insect bane]Causes a small amount of damage to all creatures, and a lot of damage to insects. +witchery:cauldronbook.knockback=[h1 Effect: Knockback]Causes creatures to be pushed away from the impact location. The strength of the effect determines how far they are pushed back. +witchery:cauldronbook.undeadbane=[h1 Effect: Undead bane]Causes a small amount of damage to all creatures, and a lot of damage to undead. +witchery:cauldronbook.thorns=[h1 Effect: Thorns]Causes a cactus to grow, or an existing cactus to grow more. Creatures hit with this effect will gain a spikey coating that damages creatures that they walk in to. +witchery:cauldronbook.sprouting=[h1 Effect: Sprouting]Causes a large branch to sprout from the hit surface. Thrown under a creature causes them to ride the branch upwards. Creatures under this effect will occasionally sprout a small branch below them. +witchery:cauldronbook.freeze=[h1 Effect: Freeze]Causes the creature to become very cold, slowing them and at higher levels causing cold damage. Blazes will take more damage from this effect, based on its level. +witchery:cauldronbook.erosion=[h1 Effect: Erosion]This effect causes blocks to melt, instantly destorying any except obsidian (which is mearly broken). Creatures hit will take damage (as will armor they are wearing). +witchery:cauldronbook.levelland=[h1 Effect: Level land]Causes land to be levelled out to the height of the block hit. Blocks above will be removed, and space below will be filled in. The power level influences the area of effect and the number of air blocks that may be filled. +witchery:cauldronbook.webs=[h1 Effect: Webs]Causes a mass of webs to explode at the impact location, trapping creatures, or providing obstacles. +witchery:cauldronbook.airhike=[h1 Effect: Air hike]Throws hit creatures into the air. +witchery:cauldronbook.pull=[h1 Effect: Pull]Unpowered, pulls items and creatures to the impact location. When powered, will pull items and creatures towards the thrower. Very useful in commbination with harvest-type effects. +witchery:cauldronbook.batburst=[h1 Effect: Bat burst]Causes an explosion of bats. +witchery:cauldronbook.poisonweapon=[h1 Effect: Poison weapon]Attacks from an entity, under the influence of this effect, will cause poison to their target. +witchery:cauldronbook.attractarrows=[h1 Effect: Attract arrows]Projectiles in an area based on the power of this effect will home-in on the victim. +witchery:cauldronbook.reflectarrows=[h1 Effect: Reflect arrows]Projectiles targetting the creature under this effect will reflect back to their source. +witchery:cauldronbook.slowfall=[h1 Effect: Slow fall]Creatures under this effect will fall slowly to earth, taking no damage. +witchery:cauldronbook.jump=[h1 Effect: Jump]The jump height of creatures under this effect will be increased based on the power of the effect. +witchery:cauldronbook.floating=[h1 Effect: Floating]Creatures under this effect will float a little way above the ground untill the effect finsihes. The power level determines how high the creatures float. +witchery:cauldronbook.damageboost=[h1 Effect: Damage boost]Increases the attack damage of a creature. +witchery:cauldronbook.weakness=[h1 Effect: Weakness]Reduces the attack damage of a creature. +witchery:cauldronbook.heal=[h1 Effect: Heal]Heals a creature or player. Will harm undead. +witchery:cauldronbook.harm=[h1 Effect: Harm]Damages a creature or player (causes magic damage). Will heal undead. +witchery:cauldronbook.nightvision=[h1 Effect: Night vision]Allows a player to see clearly in the dark. +witchery:cauldronbook.invisible=[h1 Effect: Invisible]Makes a creature under this effect invisible. Their armor and held objects will not be invisible. +witchery:cauldronbook.fastmove=[h1 Effect: Fast movement]Causes a creature under this effect to move faster. +witchery:cauldronbook.slowmove=[h1 Effect: Slow movement]Causes a creature under this effect to move slower. +witchery:cauldronbook.waterbreathing=[h1 Effect: Water breathing]Allows a creature to breath underwater without running out of air. +witchery:cauldronbook.resistfire=[h1 Effect: Resist fire]Makes a creature immune to fire damage. +witchery:cauldronbook.partlava=[h1 Effect: Part lava]Tempoarily pushes back lava. +witchery:cauldronbook.repel=[h1 Effect: Repel attacker]Creature or players hitting a creature under this effect will be knocked back. +witchery:cauldronbook.poison=[h1 Effect: Poison]Causes damage over time to creatures under the effect. +witchery:cauldronbook.regeneration=[h1 Effect: Regeneration]Causes creatures under this effect to heal over time. +witchery:cauldronbook.harmwerewolves=[h1 Effect: Harm werewolves]Causes significant damage to werewolves and minor damage to other creatures. Cast as a ritual, will cause rain to fall. +witchery:cauldronbook.weakenvampires=[h1 Effect: Weaken vampires]Weakens vampire strength and can drain some of their power. + +witchery:cauldronbook.animalattraction=[h1 Effect: Animal Attraction]Will tame any untamed animals in a wide area, and cause animals to move towards the drinker. +witchery:cauldronbook.animalrepulsion=[h1 Effect: Animal Repulsion]Will untame any animals not tamed by the drinker and cause all animals to flee away. + +witchery:cauldronbook.flames=[h1 Effect: Flames]Causes a spread of flames, over an area determined by the power of the effect. +witchery:cauldronbook.blindness=[h1 Effect: Blindness]Causes hit creatures to be blinded. +witchery:cauldronbook.disease=[h1 Effect: Disease]Causes creatures under this effect to be weakened and to spread the disease further. +witchery:cauldronbook.insanity=[h1 Effect: Insanity]Creatures will see and hear things that do not exist. +witchery:cauldronbook.sinking=[h1 Effect: Sinking]Creatures will sink rapidly in water and be unable to fly. +witchery:cauldronbook.overheating=[h1 Effect: Overheating]Creature will catch fire in hot places. +witchery:cauldronbook.nightmare=[h1 Effect: Nightmare]Creatures will occasionally experience their nightmares when awake. +witchery:cauldronbook.absorbtion=[h1 Effect: Absorbsion]Creatures will find they are able to absorb slightly more damage. +witchery:cauldronbook.healthboost=[h1 Effect: Health boost]Creatures will find they have more health. +witchery:cauldronbook.wasting=[h1 Effect: Wasting]Creatures will become very hungry. +witchery:cauldronbook.fullness=[h1 Effect: Fullness]Reduces hunger. +witchery:cauldronbook.revealing=[h1 Effect: Revealing]Makes the invisible, visible. +witchery:cauldronbook.blight=[h1 Effect: Blight]Causes land and crops to die, and villagers to mutate. +witchery:cauldronbook.raisedead=[h1 Effect: Raise dead]Summons undead creatures to assist the summoner. +witchery:cauldronbook.raiseland=[h1 Effect: Raise land]Raises a glock of land with a radius determined by the power of the effect. +witchery:cauldronbook.gruesprey=[h1 Effect: Grue's Prey]Causes creatures under this effect to suffer damage in darkness. The power determines how dark in needs to be (more power = less dark). +witchery:cauldronbook.wither=[h1 Effect: Wither]Causes the victim to suffer damage and hunger until they die, or the effect ends. + +witchery:cauldronbook.demonbane=[h1 Effect: Demonbane]Causes a lot of damage to demons, and a little damage to other creatures. +witchery:cauldronbook.inferno=[h1 Effect: Inferno]Creatures under this effect will burn other creatures nearby. As a ritual, this may summon a demon if the correct circles are used. +witchery:cauldronbook.blast=[h1 Effect: Blast]Causes an explosion. +witchery:cauldronbook.poisontoad=[h1 Effect: Poison toad]Summons a toad that will explode causing nearby creatures to become poisoned. +witchery:cauldronbook.reflectdamage=[h1 Effect: Reflect damage]Redirect some damage back to its source. The higher the level, the more damage reflected. +witchery:cauldronbook.iceshell=[h1 Effect: Ice shell]Forms a hollow icy sphere at the impact location. More power increases the radius. Can be used underwater to create breatheable spaces. + +witchery:cauldronbook.fortune=[h1 Effect: Fortune]Players under this effect, become more fortunate when mining. +witchery:cauldronbook.undeadscurse=[h1 Effect: Undead's Curse]Creatures will be damage by sunlight. + +witchery:cauldronbook.snowburst=[h1 Effect: Snow burst & trail]Causes a light snow covering to burst over hit blocks. Creatures and players will start to leave snow trails (in not too hot biomes). Snowmen may suffer from too much snow. +witchery:cauldronbook.swimspeed=[h1 Effect: Swim speed]Increases movement speed in water. +witchery:cauldronbook.enderinhibition=[h1 Effect: Ender inhibition]Prevents teleportation of most creatures. Higher levels may be required to prevent more powerful teleportation effects and rituals. +witchery:cauldronbook.partwater=[h1 Effect: Part water]Temporarily pushes back water. +witchery:cauldronbook.extinguish=[h1 Effect: Extinguish fires]Extinguishes fires on blocks and creatures in an area. Harms blazes. +witchery:cauldronbook.dissipategas=[h1 Effect: Dissipate brew gas]Removes gas blocks created by a gas brew. When powered also removes other types of gas blocks. Harms spectral undead. +witchery:cauldronbook.growflowers=[h1 Effect: Grow flowers]Causes random flowers to grow on appropriate blocks. +witchery:cauldronbook.fertilize=[h1 Effect: Fertilize]Fertilizes the blocks in an areas in a similar way to bonemeal. +witchery:cauldronbook.harvest=[h1 Effect: Harvest]Breaks nearby harvestable plants, triggering their normal drops. A way of collecting them will still be needed. +witchery:cauldronbook.tilling=[h1 Effect: Tilling]Tills any applicable blocks in an area into farmland. +witchery:cauldronbook.pruning=[h1 Effect: Prune leaves]Removes any leave blocks in an area, triggering their normal drops. +witchery:cauldronbook.felling=[h1 Effect: Fell trees]Breaks any nearby log blocks, triggering their normal drops. +witchery:cauldronbook.growlily=[h1 Effect: Grow lily]Causes a lily to rapidly grow if triggered in water. The lily may expand depending on the brew's power level. +witchery:cauldronbook.tinting=[h1 Effect: Tint skin]Changes the hue of the creature or player's skin to that of the selected dye. + +witchery:cauldronbook.transpose=[next=transpose2][h1 Effect: Transpose]In a brew, this effect will randomly teleport the target a short distance.[br][br]Two ritual casting are possible. Either use a a waystone to target a destination, and finally add a taglock to indentify the target. +witchery:cauldronbook.transpose2=[next=transpose3][h1 Effect: Transpose]The second ritual casting, requires the source location to be added as a waystone [i before] the ender pearl is added.[br][br]The destination needs to be added with a waystone [i after] the ender pearl. +witchery:cauldronbook.transpose3=[h1 Effect: Transpose]The source [i must] be surrounded by a medium otherwhere circle.[br][br][img=witchery:textures/gui/circles_mpurple.png|center|top|32|32] + +witchery:cauldronbook.transposeore=[h1 Effect: Transpose Ore]Breaks ore blocks in a sphere based on the power. Higher power levels break rarer ores. You may need a way to pull the ores to you. +witchery:cauldronbook.frogsleg=[h1 Effect: Frog's Leg]Multi-jump, allows an additional jump in the air for each power level. Only works on witches with a toad familiar. +witchery:cauldronbook.fear=[h1 Effect: Fear]Creatures are too scared to approach. + +witchery:cauldronbook.removedebuffs=[h1 Effect: Remove Debuffs]Removes curable potion effects of the same level or less. Cast as a ritual can remove incurable effects. Level III+ to remove the disease effect. +witchery:cauldronbook.paralysis=[h1 Effect: Paralysis]Cause a creature to freeze in place. Level III+ to also freeze players. +witchery:cauldronbook.combustion=[h1 Effect: Combustion]Creates a potion that may be used as a fuel source in furnaces. The higher the power the longer the burn. + +witchery:cauldronbook.illfitting=[h1 Effect: Ill Fitting]Causes clothing to slip off the victim when the effect countdown finishes. The higher the level, the more chance of multiple losses. +witchery:cauldronbook.leonard=[h1 Leonard]A demon from medieval times, who can preside over a ritual to allow it to affect targets in other dimensions. When summoned he is unlikely to want to leave, unless defeated. + +witchery:cauldronbook.durationboost=[h1 Effect: Duration boost]Boosts the duration of any currently active potion effects. Cannot be used when Quesy. +witchery:cauldronbook.absorbmagic=[h1 Effect: Absorb magic]Convert magical damage into infusion power. +witchery:cauldronbook.reincarnate=[h1 Effect: Reincarnate]When the creature dies, they will be reincarnated as another creature, the power of which is determined by the potion power. +witchery:cauldronbook.moonshine=[h1 Effect: Moonshine]Alcohol makes you feel less pain, but get hungry instead, and occasionally dizzy. +witchery:cauldronbook.stoutbelly=[h1 Effect: Stout belly]Removes the dizzy effects of [url Moonshine]. +witchery:cauldronbook.brewgasimmunity=[h1 Effect: Brew gas immunity]Makes you immune to negative effects from brew-based gas clouds +witchery:cauldronbook.drainmagic=[h1 Effect: Drain magic]Drains the magical power from the victim. +witchery:cauldronbook.keepinventory=[h1 Effect: Keep inventory]Keep your inventory items when you die. +witchery:cauldronbook.shiftingseasons=[h1 Effect: Shifting seasons]Change the targeted location to a new biome. The biome in the Biome Note determines the target biome. +witchery:cauldronbook.keepeffects=[h1 Effect: Keep effects]Keep active beneficial potion effects on death. +witchery:cauldronbook.spreaddebuffs=[h1 Effect: Spread debuffs]Spread any curable negative potions of one level below this potions level to all creatures in a wide area. + +witchery:cauldronbook.brewbottling=[h1 Effect: Brew bottling]Increases the number of bottles of brew a [i skilled] witch may make. +witchery:cauldronbook.planting=[h1 Effect: Planting]Plants any seeds that have been dropped on the floor nearby. +witchery:cauldronbook.pulverize=[h1 Effect: Pulverize]Smashes nearby blocks into increasing fragmented block types. Stone to gravel to sand. +witchery:cauldronbook.vines=[h1 Effect: Vines]Creates climbable vines on a solid surface, at higher levels will even extend the vines to the ground through the air. Creatures hit will become more flammable. +witchery:cauldronbook.love=[h1 Effect: Love]Animals, villagers and zombies will try to mate. +witchery:cauldronbook.volatility=[h1 Effect: Volatility]Creatures hit with this effect, become explosively fragile to hits. +witchery:cauldronbook.iceworld=[h1 Effect: Ice world]Turns blocks and other structures to snow and ice. +witchery:cauldronbook.resizing=[h1 Effect: Resizing]Changes the size of the hit creature:[br][br]> Level I: 1/4 size[br]> Level II: 1/2 size[br]> Level III: 1.5x size[br]> Level IV: 2x size. +witchery:cauldronbook.stealbuffs=[h1 Effect: Steal buffs]Remove all of the positive effects from creatures in a wide area, and apply them to yourself. + + +witchery:cauldronbook.wolfsbane=[h1 Effect: Wolfsbane]Prevents a werewolf from shapeshifting, thus locking it in its current form untill the potion wears off. The power of the effect determines how effective it is against more powerful werewolves. + +witchery.brewing.ingredientpowercost=Altar power cost: %d (for rituals: %d) + +item.witchery:mooncharm.name=Moon Charm +item.witchery:mooncharm.tip=Helps lycanthropes force a transformation. +tile.witchery:wolfaltar.name=Wolf Altar +item.witchery:silversword.name=Silver Sword +item.witchery:silversword.tip=2x unblockable damage against werewolves. +item.witchery:ingredient.boltSilver.name=Silver Bolt +entity.witchery.wolfman.name=Werewolf +entity.witchery.hellhound.name=Hellhound +entity.witchery.werevillager.name=Villager +item.witchery:seedswolfsbane.name=Wolfsbane Seeds +item.witchery:ingredient.wolfsbane.name=Wolfsbane +item.witchery:ingredient.silverdust.name=Silver Deposits +item.witchery:ingredient.muttonraw.name=Raw Lambchop +item.witchery:ingredient.muttoncooked.name=Cooked Lambchop +item.witchery:wolfhead.wolf.name=Wolf Head +item.witchery:wolfhead.hellhound.name=Hellhound Head +tile.witchery:wolfhead.name=Wolf Head +tile.witchery:wolfhead.wolf.name=Wolf Head +tile.witchery:wolfhead.hellhound.name=Hellhound Head +tile.witchery:wolfsbane.name=Wolfsbane +tile.witchery:silvervat.name=Silver Vat +witchery:potion.wolfsbane=Wolfsbane +witchery:brew.harmwerewolves=Harm Werewolves +item.witchery:hornofthehunt.name=Horn of the Hunt +item.witchery:hornofthehunt.tip=Calls forth the Horned Huntsman then vanishes. +item.witchery:wolftoken.name=Creative Bat/Wolf Token +item.witchery:wolftoken.tip=(creative only)|Use to cycle through werewolf levels.|Sneak-use to cycle through vampire levels. +tile.witchery:beartrap.name=Beartrap +tile.witchery:wolftrap.name=Wolftrap + +witchery.nosleep.wolf=You cannot sleep in wolf form! +witchery.nosleep.resized=You cannot sleep while resized! + +witchery.werewolf.infection=Your sense of smell seems a little stronger. +witchery.rite.wolfcurse.alreadyactive=The target is already under the curse. +witchery.rite.wolfcurse.nothuman=The target is not a normal villager or player. +witchery.rite.wolfcurse.notactive=The target is not under the curse. +witchery.rite.wolfcurse.requiresfullmoon=Perform under a full moon. +witchery.rite.wolfcurse.requirescat=A cat familiar is required. +witchery.rite.wolfcurse.requiresfullcoven=A full coven of six additional witches is required. +witchery.rite.wolfcurse.toofar=The werewolf is too powerful, and must be within the circle for the cure to work. + +witchery.rite.wolfcurse.book=Curse of the Wolf{r||Perform under a full moon with a full coven. +witchery.rite.wolfcure.book=Rite of Remove Curse{r||Cleanse the taglocked being of lycanthropy. + +witchery.werewolf.setlevel=Werewolf level set to %s. +witchery.werewolf.chunkvisited=You feel as if you have already been here. +witchery.werewolf.mooncharmcrafted=The voice rumbles, DO NOT LOSE IT AGAIN! +witchery.werewolf.notworthy=A voice echoes in your head, YOU ARE UNWORTHY! + +witchery.werewolf.level2begin=A voice echoes, %s INGOTS OF GOLD, GIVE THEM TO ME! +witchery.werewolf.level2progress=A deep voice bellows, %s INGOTS OF GOLD ARE SOUGHT, YOU LACK %s! +witchery.werewolf.level2complete=The voice rumbles, GOLD IS GIVEN, A CHARM IS MADE, LET THE BEAST WITHIN BE FREED, AND THE MOON HAVE NO SWAY! + +witchery.werewolf.level3begin=The voice intones, STRENGTHEN YOUR CLAWS, REND THE FLESH FROM %s OF THE WEAKEST OF PREY, PLACE THEIR MUTTON BEFORE ME! +witchery.werewolf.level3progress=The voice echoes, SLAY %s AND BRING THEIR FLESH, YOU REQUIRE %s MORE! +witchery.werewolf.level3complete=The voice bellows, MEAT TORN FROM THE WEAKEST, CLAWS LIKE STEEL TEMPERED, TO RIP THE EARTH AND FLESH, THE BEASTS HUNGER NEVER SATED! + +witchery.werewolf.level4begin=The voice rumbles, THE FANGS OF THE ALPHA MUST BE HONED, RIP THE THROAT FROM %s LESSER WOLVES AND BRING ME THEIR TONGUES! +witchery.werewolf.level4progress=The voice echoes, DOMINATE %s, %s REMAIN! +witchery.werewolf.level4complete=The voice bellows, THE PACK IS HUNGERING, FANGS FEAST ON THE KILL, A NEW ALPHA RISES, FROM THE SLAIN EAT YOUR FILL! + +witchery.werewolf.level5begin=The voice rumbles, THE WOLF AND THE MAN MUST BECOME ONE, SLAY THE HORNED LORD OF THE WILD HUNT! CALL HIM FORTH WITH THIS HORN AND LAND THE KILLING BLOW! +witchery.werewolf.level5progress=The voice echoes, THE HUNTSMAN LIES UNDEFEATED! SUMMON HIM WITH THE HORN AND LAND THE KILLING BLOW! +witchery.werewolf.level5complete=The voice bellows, A MIGHTY CHAMPION DEFEATED, STANDING TALL THE VICTOR, THE BEAST IS FULLY AWOKEN, HUNT NOW ON TWO LEGS OR FOUR! + +witchery.werewolf.level6begin=The voice growls, BUILD POWERFUL MUSCLES TO SMASH YOUR PREY, LEAP AT %s MONSTERS, AND FROM THE AIR SLAY! +witchery.werewolf.level6progress=The voice rumbles, SLAY %s FROM THE AIR WAS BIDDEN, %s REMAIN! +witchery.werewolf.level6complete=The voice proclaims, DEATH FROM ABOVE, LIKE LIGHTNING YOU STRIKE, SPRINT NOW WHEN YOU HIT, TO QUICKLY END THE FIGHT! + +witchery.werewolf.level7begin=The voice bellows, OTHERS MUST LEARN TO FEAR YOU, TRAVEL THE LAND AT NIGHT, IN %s PLACES LOOK TO THE SKY AND LET YOUR WOLFS VOICE BE HEARD! +witchery.werewolf.level7progress=The voice intones, HOWL AT THE NIGHT SKY IN %s PLACES, %s REMAIN! +witchery.werewolf.level7complete=The voice growls, YOUR VOICE IS HEARD, YOUR COMING NOT CHEERED, AS WOLFMAN CRY OUT, LET YOUR FOES FREEZE IN FEAR! + +witchery.werewolf.level8begin=The voice echoes, MASTER THE PACK! AS A WOLF, FIND AND BEND %s WOLVES TO YOUR WILL! +witchery.werewolf.level8progress=The voice intones, FORM A PACK OF %s WOLVES. YOU HAVE YET TO MASTER %s! +witchery.werewolf.level8complete=The voice rumbles, THE ALPHA OF THE PACK, MASTERY IS ACHIEVED, HOWL AT THE SKY, TO CALL YOUR SERVANTS AT NEED. + +witchery.werewolf.level9begin=The voice bellows, CLAWS AS KNIVES, AS WOLFMAN YOU MUST HUNT, SLAY %s OF THE PIGS THAT IN THE NETHER GRUNT! +witchery.werewolf.level9progress=The voice intones, AS WOLFMAN, HUNT %s NETHER PIGS, %s MUST BE FOUND! +witchery.werewolf.level9complete=The voice proclaims, INFERNAL FOES ARE DEFEATED, CLAWS HONED TO AN EDGE, ARMOR LIKE PAPER, YOU WILL NOW RIP TO SHREADS! + +witchery.werewolf.level10begin=The voice bellows, TAKE THE LIFE OF ANOTHER, FROM VILLAGE OR FRIEND, THEN YOU'LL BE GRANTED THE FAVOUR, MY BLESSING TO SPREAD! +witchery.werewolf.level10progress=The voice echoes, SLAY ONE FROM A VILLAGE, OR ONE SUCH AS YOU! +witchery.werewolf.level10complete=The voice exclaims, YOU HAVE MASTERED MY PATH, NOW SPREAD MY BLESSING! + +item.witchery:hunterhatsilvered.name=Witch Hunter Hat (Silvered) +item.witchery:hunterhatsilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:huntercoatsilvered.name=Witch Hunter Coat (Silvered) +item.witchery:huntercoatsilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:hunterlegssilvered.name=Witch Hunter Trousers (Silvered) +item.witchery:hunterlegssilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:hunterbootssilvered.name=Witch Hunter Boots (Silvered) +item.witchery:hunterbootssilvered.tip={9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 + +entity.witchery.villageguard.name=Guard +entity.witchery.vampire.name=Vampire +item.witchery:coffin.name=Coffin +item.witchery:garlic.name=Garlic +tile.witchery:garlicplant.name=Garlic +tile.witchery:coffinblock.name=Coffin +witchery.nosleep.dayonly=Vampires can only sleep during the day +witchery.nosleep.closedcoffin=Coffin is not open +tile.witchery:garlicgarland.name=Garlic Garland +tile.witchery:bloodedwool.name=Blood-stained Wool + +tile.witchery:shadedglass_active.black.name=Black Shaded Glass +tile.witchery:shadedglass_active.red.name=Red Shaded Glass +tile.witchery:shadedglass_active.green.name=Green Shaded Glass +tile.witchery:shadedglass_active.brown.name=Brown Shaded Glass +tile.witchery:shadedglass_active.blue.name=Blue Shaded Glass +tile.witchery:shadedglass_active.purple.name=Purple Shaded Glass +tile.witchery:shadedglass_active.cyan.name=Cyan Shaded Glass +tile.witchery:shadedglass_active.silver.name=Silver Shaded Glass +tile.witchery:shadedglass_active.gray.name=Gray Shaded Glass +tile.witchery:shadedglass_active.pink.name=Pink Shaded Glass +tile.witchery:shadedglass_active.lime.name=Lime Shaded Glass +tile.witchery:shadedglass_active.yellow.name=Yellow Shaded Glass +tile.witchery:shadedglass_active.light_blue.name=Light Blue Shaded Glass +tile.witchery:shadedglass_active.magenta.name=Magenta Shaded Glass +tile.witchery:shadedglass_active.orange.name=Orange Shaded Glass +tile.witchery:shadedglass_active.white.name=White Shaded Glass + +tile.witchery:shadedglass.black.name=Black Shaded Glass +tile.witchery:shadedglass.red.name=Red Shaded Glass +tile.witchery:shadedglass.green.name=Green Shaded Glass +tile.witchery:shadedglass.brown.name=Brown Shaded Glass +tile.witchery:shadedglass.blue.name=Blue Shaded Glass +tile.witchery:shadedglass.purple.name=Purple Shaded Glass +tile.witchery:shadedglass.cyan.name=Cyan Shaded Glass +tile.witchery:shadedglass.silver.name=Silver Shaded Glass +tile.witchery:shadedglass.gray.name=Gray Shaded Glass +tile.witchery:shadedglass.pink.name=Pink Shaded Glass +tile.witchery:shadedglass.lime.name=Lime Shaded Glass +tile.witchery:shadedglass.yellow.name=Yellow Shaded Glass +tile.witchery:shadedglass.light_blue.name=Light Blue Shaded Glass +tile.witchery:shadedglass.magenta.name=Magenta Shaded Glass +tile.witchery:shadedglass.orange.name=Orange Shaded Glass +tile.witchery:shadedglass.white.name=White Shaded Glass + +item.witchery:glassgoblet.name=Glass Goblet +item.witchery:glassgoblet.full=Glass Goblet (full) +item.witchery:glassgoblet.tip=Blood: {4%s{0 +item.witchery:glassgoblet.chicken=Chicken +item.witchery:glassgoblet.lilith=Lilith +item.witchery:glassgoblet.convertingplayermustsleep=Victim must be asleep +item.witchery:glassgoblet.targetnotdrained=Victim must be drained of blood +item.witchery:glassgoblet.targetnottransfixed=Victim is not mesmerized +item.witchery:glassgoblet.nocoffinnear=There is no coffin nearby +item.witchery:glassgoblet.notenoughblood=Half a droplet of blood is needed to fill the glass +item.witchery:glassgoblet.nothighenoughlevel=Your blood is not yet strong enough for this task +item.witchery:glassgoblet.nothinghappens=Nothing happens +item.witchery:glassgoblet.seemswrong=This does not seem correct +item.witchery:glassgoblet.lilithquest=A voice sings, Bring my daughter to the lakes of fire in the netherworld +item.witchery:glassgoblet.lilithquestsummon=Are you worthy of my mistress? +item.witchery:glassgoblet.lilithquestsummon2=My mistress is here... +item.witchery:glassgoblet.lilithquestcomplete=You are worthy... this time... do you desire magic, or death? +item.witchery:glassgoblet.lilithquestcomplete2=If you wish magic, give me an item to enchant. +item.witchery:glassgoblet.lilithquestcompletelife=I take your blood, and gift you mine, drink quickly... +item.witchery:glassgoblet.lilithquestcompletemagic=Take this, as a gift... +item.witchery:glassgoblet.lilithquestcompletelifefail=My child, you have no need of my blood... +item.witchery:glassgoblet.lilithquestcompletecure=If you so wish it, your are mortal once more... +item.witchery:glassgoblet.lilithquestcompletecurefail=Such a thing is meaningless... +item.witchery:glassgoblet.lilithquestcompletebatflight=My child, I grant you freedom... +item.witchery:glassgoblet.lilithquestcompletebatflightfail=You flatter me, but no... + +item.witchery:sungrenade.name=Sun Grenade +item.witchery:stew.name=Meaty Stew +item.witchery:stewraw.name=Raw Meaty Stew +item.witchery:canesword.name=Cane Sword +item.witchery:canesword.tip=Sneak-Use to draw/sheathe.|Siphons blood of kills to an internal|resevoir, use when sheathed to extract.|{4Blood resevoir: %d{0 +tile.witchery:daylightcollector.name=Sun Collector +tile.witchery:bloodcrucible.name=Blood Crucible + +entity.witchery.lilith.name=Lilith +entity.witchery.follower.name=Follower +entity.witchery.follower.elle.name=Elle +entity.witchery.wingedmonkey.name=Winged Monkey +witchery:brew.weakenvampires=Weaken Vampires + +witchery.village.reptoolow=Your reputation is too low to promote guards. +witchery.village.villagetoosmall=This village is too small for more guards. +witchery.village.toomanyguards=This village already has a full complement of guards. +witchery.village.villagerrefusesguardduty=I don't want to be a guard! +witchery.village.villageracceptsguardduty=By your command! + +witchery.book.herbology.wolfsbane=Its name is the clue, the werewolf's secret it does undo. It grows in tilled earth in stages. Tall grass yields seeds. +witchery.book.herbology.garlic=A flavor for food at day, at night it keeps vampires away. It grows in tilled earth in stages. Tall grass yields seeds. + +item.witchery:ingredient.darkCloth.name=Woven Cruor +item.witchery:ingredient.warmBlood.name=Warm Blood +item.witchery:ingredient.lilithsBlood.name=Lilith's Blood +item.witchery:ingredient.stake.name=Wooden Stake +item.witchery:ingredient.vbookPage.name=Torn Page +item.witchery:vampirebook.name=Observations of an Immortal +item.witchery:vampirebook.tip=A doomed scholar's account of discourse with the undead. + +witchery.rite.vampirecure.book=Rite of Remove Curse{r||Cleanse the taglocked being of vampirism. + +witchery.rite.wolfcurse.hybridsnotallow=Vampire/Werewolf hybrids are not allowed +witchery.vampirepower.feed=Drink Blood +witchery.vampirepower.eye=Transfix / Toggle Night Vision +witchery.vampirepower.speed=Speed +witchery.vampirepower.bat=Toggle Bat Form +witchery.vampirepower.unone=None +witchery.vampirepower.ubats=Bat Swarm (%d) +witchery.vampirepower.uteleport=Teleport (%d) +witchery.vampirepower.ustorm=Call Storm (%d) + +witchery:vampirebook.toc=[next=ritual1][h1 Observations of an Immortal][br][br][br][darkred A doomed scholar's account of discourse with the undead] +witchery:vampirebook.ritual1=[next=ritual2]It is with some reluctance I commit these observations to paper, for what I have witnessed is not for the weak of mind. Instead, take my words as a warning... +witchery:vampirebook.ritual2=[next=ritual3][br]...he was reminiscing over dinner this evening about his birth, a demonic pact of sorts...[br][br]...butchering a chicken over a skull with a boline and holding a glass goblet to collect the blood is barbaric, I told him... +witchery:vampirebook.ritual3=[next=ritual4][br]...apparently start of a long forgotten rite (I made a sketch...[br][img=witchery:textures/gui/vritual.png|center|middle|64|64][br]...night, open to the moon, string, red dust, torches and skull... +witchery:vampirebook.ritual4=[next=ritual5][br][br]...pouring the blood onto the skull...[br][br]...mumbling about taking her to the lakes of lava... ...underworld... +witchery:vampirebook.ritual5=[next=transfix|1][br]...proving his worth to Her...[br][br][br]...that glass goblet again, could someone really drink such a thing? ... +witchery:vampirebook.transfix=[next=knockback|2][br]...Today, or should I say this evening, he told me of his first kill...[br][br][br]...the thirst that first night, he said, was overwhelming, he had to fully sait his hunger... +witchery:vampirebook.knockback=[next=speed|3]...he found he was able to transfix his victims...[br][br]...was now able to drink as he needed without others realizing, so long as he did not drain more than half...[br][br]...did so, from five oblivious souls... +witchery:vampirebook.speed=[next=resistsun|4][br]...strength was flowing into him, the more he drank, as the nights progressed, the stronger he became...[br][br]...it was on the forth night after his mastery of drinking, that the world slowed down... +witchery:vampirebook.resistsun=[next=smashstone|5]...his greatest foe, the sun, was ever present, tormenting and instantly deadly to him...[br][br]...became his obsession... ...found a way to collect sunlight and burnt himself with it ten times during the night... +witchery:vampirebook.smashstone=[next=bats|6]...first walk in the sun after his rebirth brought him to bloody tears, he felt his blood burning, but no longer instantly...[br][br]...he needed more strength, and extingishing creatures of pure fire was his solution...[br]...twenty died. +witchery:vampirebook.bats=[next=mesmerize|7]...he could smash solid stone, but bound to the earth, however fast, he was still limited...[br][br]...he called on Her once more, repeating the rite of his rebirth...[br][br]...gifted Her a flower, the color of the blood She so craves... +witchery:vampirebook.mesmerize=[next=maker|8]...he smiled, a rare event, when he told me of his first flight...[br][br]...he flew from village to village, untill he knew the full extent of his domain, there was now nowhere he could not go... +witchery:vampirebook.maker=[next=maker2|8]...the weak minded would now not only let him drink his fill, but would also follow like faithful hounds...[br][br]...horror of all horrors, he lured five of them to specially prepared iron cages, topped with wood and with a gap at the front. He sealed them inside... +witchery:vampirebook.maker2=[next=finalpowers|9][img=witchery:textures/gui/vcage.png|center|middle|64|64][br][br]...he began feeding from each of them; mezmerising them first, then carefully he drank all he could, without damaging any... +witchery:vampirebook.finalpowers=At last he knew his blood was strong enough to replicate what She had done for him... ...left me weak, close to oblivion, but I watched him fill a glass goblet and hand it to me... ...we both sat next to a coffin, far from the sun's gaze, drink! is all he said... + +witchery.vampire.setlevel=Vampire level set to %s. +witchery:death.attack.sun=%1$s burnt to a crisp in the sun +witchery:death.attack.sun.player=%1$s burnt to a crisp in sunlight whilst fighting %2$s +death.attack.sun=%1$s burnt to a crisp in the sun +death.attack.sun.player=%1$s burnt to a crisp in sunlight whilst fighting %2$s +item.witchery:vampirehat.name=Vampire Top Hat +item.witchery:vampirehat.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance +item.witchery:vampirehelmet.name=Vampire Helmet +item.witchery:vampirehelmet.tip=Set bonuses:|2 pieces - Fire resistance +item.witchery:vampirecoat.name=Vampire Dress Coat +item.witchery:vampirecoat.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance +item.witchery:vampirecoat_female.name=Vampire Dress Jacket (Ladies) +item.witchery:vampirecoat_female.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance +item.witchery:vampirechaincoat.name=Vampire Chain Coat +item.witchery:vampirechaincoat.tip=Set bonuses:|2 pieces - Fire resistance +item.witchery:vampirechaincoat_female.name=Vampire Chain Coat (Ladies) +item.witchery:vampirechaincoat_female.tip=Set bonuses:|2 pieces - Fire resistance +item.witchery:vampirelegs.name=Vampire Trousers +item.witchery:vampirelegs.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance +item.witchery:vampirelegs_kilt.name=Vampire Skirted Trousers +item.witchery:vampirelegs_kilt.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance +item.witchery:vampireboots.name=Vampire Oxford Boots +item.witchery:vampireboots.tip=Set bonuses:|2 pieces - Faster drinking|3 pieces - Fire resistance|3 pieces - Mesmerize boost|4 pieces - Extended fire resistance + +item.witchery:hunterhatgarlicked.name=Witch Hunter Dawn Hat +item.witchery:hunterhatgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:huntercoatgarlicked.name=Witch Hunter Dawn Coat +item.witchery:huntercoatgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:hunterlegsgarlicked.name=Witch Hunter Dawn Trousers +item.witchery:hunterlegsgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 +item.witchery:hunterbootsgarlicked.name=Witch Hunter Dawn Boots +item.witchery:hunterbootsgarlicked.tip={9Vampire protection.{0|{9Werewolf protection.{0|{9Set bonuses: Protection from curses.{0|{9Enables draining bolts.{0|{9Cannot use poppets.{0 + + +tile.witchery:mirrorblock.name=Mirror +tile.witchery:mirrorblock2.name=Mirror +tile.witchery:mirrorwall.name=Mirror Surface +item.witchery:mirror.name=Mirror +item.witchery:dupgrenade.name=Duplication Grenade +item.witchery:dupgrenade.tip={3Reflection of: %s{0 +item.witchery:mirror.tip.bridge={5Hollow{0 +item.witchery:mirror.tip.bridgeplus={5Hollow (%s: %d, %d, %d){0 +item.witchery:mirror.tip.inhabited={3Inhabited{0 +entity.witchery.reflection.name=Reflection +item.witchery:ingredient.heartofgold.name=Heart of Gold +item.witchery:ingredient.floopowder.name=Floo Powder +tile.witchery:floofire.name=Floo Fire +witchery.book.floopowder=[h1 Floo Powder]Brewed in the kettle from Ash Wood, redstone and glowstone dust. Cast a pinch onto a burning fire and the flames turn an eerie green. While holding a Waystone bound to a location, step into the green Floo Fire to be whisked there at once. The Waystone is the key, not fuel - it is never consumed. + +witchery.rite.infusionmirror=Rite of Infusion{r||Trap a Demon into a mirror. +witchery:brew.animalattraction=Animal Attraction +witchery:brew.animalrepulsion=Animal Repulsion +witchery.rite.summonreflection=Rite of Summoning{r||Call forth the demon from a mirror. The inner area must be clear 7x7x4 blocks! +witchery.rite.eclipse.cooldown=The Rite of Total Eclipse has been used recently in this world, wait a while. +witchery.rite.mirrormirror.playersseen=Furthermore, other than thee, others have stood before me: %s +witchery.rite.mirrormirror.playersnotseen=Furthermore, other than thee, no others have stood before me. +witchery.rite.mirrormirror.escapecooldown=Chant fails, cooldown is active (%s seconds remain) + +witchery.rite.mirrormirrorsendmehome=mirror mirror send me home +witchery.rite.mirrormirrorigiveup=mirror mirror i give up +witchery.rite.mirrormirror=<%s> Mirror, mirror, on the wall, who is the fairest one of all? +witchery.rite.mirrormirror.anotherf=Fair indeed you may be. But hold, another do I see. Alas, she is more fair than thee. +witchery.rite.mirrormirror.anotherm=Fair indeed you may be. But hold, another do I see. Alas, he is more fair than thee. +witchery.rite.mirrormirror.anotherplayer=Fair indeed you may be. But hold, another do I see. Alas, they are more fair than thee. +witchery.rite.mirrormirror.you=In all the world I cannot see, one that is more fair than thee. +witchery.rite.mirrormirror.bearing0=North is where the fairest will be. +witchery.rite.mirrormirror.bearing1=North East is where the fairest will be. +witchery.rite.mirrormirror.bearing2=East is where the fairest will be. +witchery.rite.mirrormirror.bearing3=South East is where the fairest will be. +witchery.rite.mirrormirror.bearing4=South is where the fairest will be. +witchery.rite.mirrormirror.bearing5=South West is where the fairest will be. +witchery.rite.mirrormirror.bearing6=West is where the fairest will be. +witchery.rite.mirrormirror.bearing7=North West is where the fairest will be. + +witchery.rite.mirrormirror.opchatreveal=In next message, player %s is really: %s +witchery.pott.petrificustotalus=Petrificus Totalus +witchery.pott.petrificustotalus.info=Petrify the target, holding it immobile and blind indefinitely. +witchery.pott.glacius=Glacius +witchery.pott.glacius.info=Freeze the target and chill the area, turning water to ice and quenching fire. +witchery.pott.flagrateritualis=Flagrate Ritualis +witchery.pott.flagrateritualis.info=Draw a Ritual glyph on the block you are looking at. +witchery.pott.flagrateaureus=Flagrate Aureus +witchery.pott.flagrateaureus.info=Draw a Golden Chalk circle on the block you are looking at. +witchery.pott.flagratealibi=Flagrate Alibi +witchery.pott.flagratealibi.info=Draw an Otherwhere glyph on the block you are looking at. +witchery.pott.revelopotionis=Revelio +witchery.pott.revelopotionis.info=Reveal invisible entities nearby and dispel cursed blocks. +witchery.pott.ictus=Ictus +witchery.pott.ictus.info=Strike the target for damage and drain a portion of its infused power. +witchery.pott.sectumsempra=Sectumsempra +witchery.pott.sectumsempra.info=A deep cutting curse that deals heavy damage and inflicts Wither. +witchery.pott.finiteincantatem=Finite Incantatem +witchery.pott.finiteincantatem.info=Sneak to cleanse negative effects from yourself, or cast normally to end magical effects. +witchery.pott.herbivicus=Herbivicus +witchery.pott.herbivicus.info=Instantly grow nearby crops and plants, as if bonemealed. +witchery.pott.impervius=Impervius +witchery.pott.impervius.info=Grant fire resistance, water breathing and damage resistance to the target or yourself. +witchery.pott.erecto=Erecto +witchery.pott.erecto.info=Conjure a temporary protective shelter of force blocks. Sneak to dismiss it. +witchery.pott.portuspersonal=Portus Personal +witchery.pott.portuspersonal.info=Set a personal recall point, then cast again to teleport back to it. +witchery.pott.portustraslador=Portus Traslador +witchery.pott.portustraslador.info=Create a Waystone Portkey bound to your current position. Right-click it to return. +witchery.pott.taglockhex=Taglock Hex +witchery.pott.taglockhex.info=Steal a taglock from the target, capturing their blood and identity. +witchery.pott.smeltray=Smelt Ray +witchery.pott.smeltray.info=Smelt the block or dropped item it hits, as if cooked in a furnace. +witchery.pott.earthpillar=Earth Pillar +witchery.pott.earthpillar.info=Raise a pillar of earth beneath the target block, lifting you if you stand on it. +witchery.pott.transmutation=Transmutation +witchery.pott.transmutation.info=Transmute a block into a related material (dirt and sand, stone and cobble, logs to planks). +witchery.pott.excavation=Excavation +witchery.pott.excavation.info=Excavate a 3x3x3 cube of blocks, dropping them as items. +witchery.pott.broomsummon=Broom Summon +witchery.pott.broomsummon.info=Summon a flying broom at the targeted block. +witchery.pott.toadleap=Toad Leap +witchery.pott.toadleap.info=Launch yourself high into the air and negate fall damage. +witchery.pott.etherealvault=Ethereal Vault +witchery.pott.etherealvault.info=Open your Ender Chest from anywhere. +witchery.pott.asis=Asis +witchery.pott.asis.info=A basic bolt of force. Hit the same target rapidly to build a damage combo. +witchery.pott.orchideous=Orchideous +witchery.pott.orchideous.info=Scatter grass and flowers across the targeted ground. +witchery.pott.fumos=Fumos +witchery.pott.fumos.info=Create a dense cloud of smoke. Sneak to release it at your own feet. +witchery.pott.incarcerous=Incarcerous +witchery.pott.incarcerous.info=Bind the target in cobwebs, trapping it in place. +witchery.pott.vermillious=Vermillious +witchery.pott.vermillious.info=Launch a bright red firework as a signal flare. + +witchery.rite.reparo=Rite of Reparo +witchery.rite.identify=Rite of Identification +witchery.rite.aparecium=Rite of Aparecium +witchery.rite.vociferador=Rite of the Howler +witchery.rite.lumosmaxima=Rite of Lumos Maxima +witchery.rite.dimensionalanchor=Rite of Dimensional Anchor +witchery.rite.empaticlink=Rite of Empathic Link +witchery.rite.herbivicus=Rite of Herbivicus +witchery.rite.identify.result=Identification reveals: %s +witchery.rite.identify.enchanted=This item is enchanted! +witchery.rite.magicalprison=Magical Prison + +witchery:cauldronbook.spectralsight=[h1 Effect: Spectral Sight]Grants the ability to see spectral and invisible entities. +witchery:cauldronbook.comprehension=[h1 Effect: Comprehension]Allows you to understand languages you normally wouldn't. +witchery:cauldronbook.glaciate=[h1 Effect: Glaciate]Freezes water into ice and lava into obsidian within a large radius. +witchery:cauldronbook.glasswork=[h1 Effect: Glasswork]Turns sand into glass within a radius. +witchery:cauldronbook.lifesteal=[h1 Effect: Lifesteal]Drains health from enemies and heals the caster. +witchery:cauldronbook.berserk=[h1 Effect: Berserk]Greatly increases damage dealt but lowers defense. +witchery:cauldronbook.phasewalk=[h1 Effect: Phasewalk]Allows the imbiber to pass through solid obstacles temporarily. +witchery:cauldronbook.manasiphon=[h1 Effect: Mana Siphon]Drains magical energy from targets to restore the caster's. +witchery:cauldronbook.petrify=[h1 Effect: Petrify]Roots the target to the spot and turns their skin to stone. +witchery:cauldronbook.soultether=[h1 Effect: Soul Tether]Tethers the target's soul to yours, pulling them to you across dimensions. + +witchery:brew.soulswap=Soul Swap +witchery:brew.astralprojection=Astral Projection +witchery:brew.banishment=Banishment +witchery:brew.voodoolink=Voodoo Link +witchery:brew.polymorph=Polymorph +witchery:brew.frenzy=Frenzy +witchery:brew.covencall=Coven's Call +witchery:potion.banishment=Banished +witchery:potion.astralprojection=Astral Form +witchery:potion.voodoolink=Voodoo Bound +witchery:potion.polymorph=Polymorphed +witchery:potion.frenzy=Frenzied + +witchery:cauldronbook.soulswap=[h1 Effect: Soul Swap]Swaps the physical location of the caster and the target. +witchery:cauldronbook.astralprojection=[h1 Effect: Astral Projection]Grants the ability to leave your physical body behind and fly freely as a spirit. +witchery:cauldronbook.banishment=[h1 Effect: Banishment]Forcefully teleports the target to the Nether for the duration of the effect. +witchery:cauldronbook.voodoolink=[h1 Effect: Voodoo Link]Links the target to the caster. Any damage the target receives is redirected to the caster instead. +witchery:cauldronbook.polymorph=[h1 Effect: Polymorph]Visually transforms the target into a harmless pig. +witchery:cauldronbook.frenzy=[h1 Effect: Frenzy]Causes the targeted monster to lose its mind and attack anything nearby. +witchery:cauldronbook.covencall=[h1 Effect: Coven's Call]Summons members of your coven to your side to assist you. +witchery:cauldronbook.amnesia=[h1 Effect: Amnesia]Causes the victim to forget how to organize their inventory, completely scrambling the items they hold. +witchery:cauldronbook.spectralthief=[h1 Effect: Spectral Thief]Steals the item currently held by the target and places it in your own inventory. +witchery:cauldronbook.doppelganger=[h1 Effect: Doppelganger]Spawns an exact replica of yourself holding your current equipment while turning you invisible. +witchery:cauldronbook.etherealchains=[h1 Effect: Ethereal Chains]Anchors the victim to their current location. If they move too far, they are forcefully pulled back. +witchery:cauldronbook.marionette=[h1 Effect: Marionette]Links the victim's mind to yours, forcing them to walk and look exactly where you do. +witchery:cauldronbook.sirensong=[h1 Effect: Siren's Song]Emits an aura that mesmerizes nearby hostile creatures, causing them to walk peacefully towards you. +witchery:cauldronbook.silence=[h1 Effect: Silence]A powerful anti-magic ward that forces the victim to drop any Witchery wands or brews they try to hold. + +witchery:potion.etherealchains=Ethereally Chained +witchery:potion.marionette=Marionetted +witchery:potion.sirensong=Siren's Aura +witchery:potion.silence=Silenced diff --git a/src/main/resources/assets/witchery/lang/es_ES.lang b/src/main/resources/assets/witchery/lang/es_ES.lang index 010fee9..3b4b674 100644 --- a/src/main/resources/assets/witchery/lang/es_ES.lang +++ b/src/main/resources/assets/witchery/lang/es_ES.lang @@ -857,4 +857,150 @@ tile.witchery:tormentstone.name=Piedra del Tormento tile.witchery:infinityegg.name=Huevo de la Infinidad item.witchery:kobolditehelm.name=Banda de la Distorsión -item.witchery:kobolditehelm.tip={9Desorienta a los observadores.{0 \ No newline at end of file +item.witchery:kobolditehelm.tip={9Desorienta a los observadores.{0 +witchery.pott.petrificustotalus=Petrificus Totalus +witchery.pott.petrificustotalus.info=Petrificus Totalus +witchery.pott.glacius=Glacius +witchery.pott.glacius.info=Glacius +witchery.pott.leonard1=Leonard1 +witchery.pott.leonard1.info=Leonard1 +witchery.pott.leonard2=Leonard2 +witchery.pott.leonard2.info=Leonard2 +witchery.pott.leonard3=Leonard3 +witchery.pott.leonard3.info=Leonard3 +witchery.pott.leonard4=Leonard4 +witchery.pott.leonard4.info=Leonard4 +witchery.pott.flagrateritualis=Flagrateritualis +witchery.pott.flagrateritualis.info=Flagrateritualis +witchery.pott.flagrateaureus=Flagrateaureus +witchery.pott.flagrateaureus.info=Flagrateaureus +witchery.pott.flagratealibi=Flagratealibi +witchery.pott.flagratealibi.info=Flagratealibi +witchery.pott.revelopotionis=Revelopotionis +witchery.pott.revelopotionis.info=Revelopotionis +witchery.pott.reparo=Reparo +witchery.pott.reparo.info=Reparo +witchery.pott.ictus=Ictus +witchery.pott.ictus.info=Ictus +witchery.pott.expectopatronum=Expectopatronum +witchery.pott.expectopatronum.info=Expectopatronum +witchery.pott.sectumsempra=Sectumsempra +witchery.pott.sectumsempra.info=Sectumsempra +witchery.pott.obliviate=Obliviate +witchery.pott.obliviate.info=Obliviate +witchery.pott.confringo=Confringo +witchery.pott.confringo.info=Confringo +witchery.pott.lumosmaxima=Lumosmaxima +witchery.pott.lumosmaxima.info=Lumosmaxima +witchery.pott.wingardiumleviosa=Wingardiumleviosa +witchery.pott.wingardiumleviosa.info=Wingardiumleviosa +witchery.pott.bombarda=Bombarda +witchery.pott.bombarda.info=Bombarda +witchery.pott.bombardamaxima=Bombardamaxima +witchery.pott.bombardamaxima.info=Bombardamaxima +witchery.pott.avis=Avis +witchery.pott.avis.info=Avis +witchery.pott.oppugno=Oppugno +witchery.pott.oppugno.info=Oppugno +witchery.pott.piertotumlocomotor=Piertotumlocomotor +witchery.pott.piertotumlocomotor.info=Piertotumlocomotor +witchery.pott.reducto=Reducto +witchery.pott.reducto.info=Reducto +witchery.pott.araniaexumai=Araniaexumai +witchery.pott.araniaexumai.info=Araniaexumai +witchery.pott.silencio=Silencio +witchery.pott.silencio.info=Silencio +witchery.pott.protegomaxima=Protegomaxima +witchery.pott.protegomaxima.info=Protegomaxima +witchery.pott.apparition=Apparition +witchery.pott.apparition.info=Apparition +witchery.pott.fiendfyre=Fiendfyre +witchery.pott.fiendfyre.info=Fiendfyre +witchery.pott.expulso=Expulso +witchery.pott.expulso.info=Expulso +witchery.pott.engorgio=Engorgio +witchery.pott.engorgio.info=Engorgio +witchery.pott.finiteincantatem=Finite Incantatem +witchery.pott.finiteincantatem.info=Finite Incantatem +witchery.pott.herbivicus=Herbivicus +witchery.pott.herbivicus.info=Herbivicus +witchery.pott.impervius=Impervius +witchery.pott.impervius.info=Impervius +witchery.pott.erecto=Erecto +witchery.pott.erecto.info=Erecto +witchery.pott.portuspersonal=Portus Personal +witchery.pott.portuspersonal.info=Portus Personal +witchery.pott.portustraslador=Portus Traslador +witchery.pott.portustraslador.info=Portus Traslador +witchery.pott.taglockhex=Taglock Hex +witchery.pott.taglockhex.info=Taglock Hex +witchery.pott.smeltray=Smelt Ray +witchery.pott.smeltray.info=Smelt Ray +witchery.pott.earthpillar=Earth Pillar +witchery.pott.earthpillar.info=Earth Pillar +witchery.pott.transmutation=Transmutation +witchery.pott.transmutation.info=Transmutation +witchery.pott.excavation=Excavation +witchery.pott.excavation.info=Excavation +witchery.pott.broomsummon=Broom Summon +witchery.pott.broomsummon.info=Broom Summon +witchery.pott.toadleap=Toad Leap +witchery.pott.toadleap.info=Toad Leap +witchery.pott.etherealvault=Ethereal Vault +witchery.pott.etherealvault.info=Ethereal Vault +witchery.pott.asis=Asis +witchery.pott.asis.info=Asis +witchery.pott.orchideous=Orchideous +witchery.pott.orchideous.info=Orchideous +witchery.pott.fumos=Fumos +witchery.pott.fumos.info=Fumos +witchery.pott.incarcerous=Incarcerous +witchery.pott.incarcerous.info=Incarcerous +witchery.pott.vermillious=Vermillious +witchery.pott.vermillious.info=Vermillious + +witchery.rite.reparo=Ritual de Reparación +witchery.rite.identify=Ritual de Identificación +witchery.rite.aparecium=Ritual de Aparecium +witchery.rite.vociferador=Ritual del Vociferador +witchery.rite.lumosmaxima=Ritual de Luz Eterna (Lumos Maxima) +witchery.rite.dimensionalanchor=Ritual de Anclaje Dimensional +witchery.rite.empaticlink=Ritual de Vínculo Empático +witchery.rite.herbivicus=Ritual de Crecimiento Fenfocalizado (Herbivicus) +witchery.rite.identify.result=La identificación revela: %s +witchery.rite.identify.enchanted=¡Este ítem está encantado! +witchery.rite.magicalprison=Prisión Mágica + +witchery:brew.soulswap=Intercambio de Almas +witchery:brew.astralprojection=Proyección Astral +witchery:brew.banishment=Destierro +witchery:brew.voodoolink=Vínculo Vudú +witchery:brew.polymorph=Polimorfia +witchery:brew.frenzy=Frenesí +witchery:brew.covencall=Llamado del Aquelarre +witchery:potion.banishment=Desterrado +witchery:potion.astralprojection=Forma Astral +witchery:potion.voodoolink=Vudú Vinculado +witchery:potion.polymorph=Polimorfado +witchery:potion.frenzy=Frenético + +witchery:cauldronbook.soulswap=[h1 Effect: Intercambio de Almas]Intercambia la ubicación física del lanzador y el objetivo. +witchery:cauldronbook.astralprojection=[h1 Effect: Proyección Astral]Otorga la habilidad de dejar tu cuerpo físico atrás y volar libremente como un espíritu. +witchery:cauldronbook.banishment=[h1 Effect: Destierro]Teletransporta forzosamente al objetivo al Nether durante el efecto. +witchery:cauldronbook.voodoolink=[h1 Effect: Vínculo Vudú]Vincula al objetivo con el lanzador. El daño que reciba el objetivo es redirigido al lanzador. +witchery:cauldronbook.polymorph=[h1 Effect: Polimorfia]Transforma visualmente al objetivo en un cerdo inofensivo. +witchery:cauldronbook.frenzy=[h1 Effect: Frenesí]Causa que el monstruo objetivo pierda la cabeza y ataque cualquier cosa cercana. +witchery:cauldronbook.covencall=[h1 Effect: Llamado del Aquelarre]Invoca a miembros de tu aquelarre a tu lado para asistirte. + +witchery:cauldronbook.amnesia=[h1 Effect: Amnesia]Hace que la víctima olvide cómo organizar su inventario, desordenando todos los objetos que lleva. +witchery:cauldronbook.spectralthief=[h1 Effect: Ladrón Espectral]Arrebata el objeto que la víctima tiene en la mano y lo transfiere a tu propio inventario. +witchery:cauldronbook.doppelganger=[h1 Effect: Doppelgänger]Invoca una réplica exacta de ti con tu equipamiento actual mientras te vuelve invisible. +witchery:cauldronbook.etherealchains=[h1 Effect: Cadenas Etéreas]Ancla a la víctima a su ubicación actual. Si se aleja demasiado, es arrastrada de vuelta forzosamente. +witchery:cauldronbook.marionette=[h1 Effect: Marioneta]Vincula la mente de la víctima a la tuya, forzándola a caminar y mirar exactamente a donde tú lo hagas. +witchery:cauldronbook.sirensong=[h1 Effect: Canto de Sirena]Emite un aura que hipnotiza a las criaturas hostiles cercanas, haciendo que caminen pacíficamente hacia ti. +witchery:cauldronbook.silence=[h1 Effect: Silencio]Una poderosa guardia antimagia que obliga a la víctima a soltar cualquier rama mística o brebaje que intente sostener. + +witchery:potion.etherealchains=Cadenas Etéreas +witchery:potion.marionette=Controlado +witchery:potion.sirensong=Canto de Sirena +witchery:potion.silence=Silenciado diff --git a/src/main/resources/assets/witchery/textures/items/ingredient.floopowder.png b/src/main/resources/assets/witchery/textures/items/ingredient.floopowder.png new file mode 100644 index 0000000..f93258c Binary files /dev/null and b/src/main/resources/assets/witchery/textures/items/ingredient.floopowder.png differ diff --git a/update_lang.py b/update_lang.py new file mode 100644 index 0000000..1062f66 --- /dev/null +++ b/update_lang.py @@ -0,0 +1,44 @@ +import re + +file_path = "/Users/brianchirinos/Documents/WitcheryRepo/src/main/resources/assets/witchery/lang/en_US.lang" + +with open(file_path, "r") as f: + lines = f.readlines() + +new_lines = [] +for line in lines: + if line.startswith("witchery:cauldronbook.level2_9="): + line = line.strip() + "[br][stack=glass_bottle][url=spectralsight|middle Spectral Sight]\n" + elif line.startswith("witchery:cauldronbook.level4_6="): + line = line.strip() + "[br][stack=name_tag][url=comprehension|middle Comprehension][br][stack=packed_ice][url=glaciate|middle Glaciate][br][stack=sandstone][url=glasswork|middle Glasswork]\n" + elif line.startswith("witchery:cauldronbook.level5_2="): + line = line.strip() + "[br][stack=melon][url=lifesteal|middle Lifesteal][br][stack=fire_charge][url=berserk|middle Berserk]\n" + elif line.startswith("witchery:cauldronbook.level6_2="): + line = line.strip() + "[br][stack=glass_pane][url=phasewalk|middle Phasewalk][br][stack=experience_bottle][url=manasiphon|middle Mana Siphon][br][stack=stonebrick][url=petrify|middle Petrify]\n" + elif line.startswith("witchery:cauldronbook.level8="): + line = line.strip() + "[br][stack=clock][url=soultether|middle Soul Tether]\n" + + new_lines.append(line) + +# Now we must append the actual localized names for these keys if they are not already there +# and also the descriptions for the book pages! +descriptions = """ +witchery:cauldronbook.spectralsight=[h1 Effect: Spectral Sight]Grants the ability to see spectral and invisible entities. +witchery:cauldronbook.comprehension=[h1 Effect: Comprehension]Allows you to understand languages you normally wouldn't. +witchery:cauldronbook.glaciate=[h1 Effect: Glaciate]Freezes water into ice and lava into obsidian within a large radius. +witchery:cauldronbook.glasswork=[h1 Effect: Glasswork]Turns sand into glass within a radius. +witchery:cauldronbook.lifesteal=[h1 Effect: Lifesteal]Drains health from enemies and heals the caster. +witchery:cauldronbook.berserk=[h1 Effect: Berserk]Greatly increases damage dealt but lowers defense. +witchery:cauldronbook.phasewalk=[h1 Effect: Phasewalk]Allows the imbiber to pass through solid obstacles temporarily. +witchery:cauldronbook.manasiphon=[h1 Effect: Mana Siphon]Drains magical energy from targets to restore the caster's. +witchery:cauldronbook.petrify=[h1 Effect: Petrify]Roots the target to the spot and turns their skin to stone. +witchery:cauldronbook.soultether=[h1 Effect: Soul Tether]Tethers the target's soul to yours, pulling them to you across dimensions. +""" + +# Let's add them at the end of the file +new_lines.append(descriptions) + +with open(file_path, "w") as f: + f.writelines(new_lines) + +print("en_US.lang updated successfully!")