diff --git a/assets/forbidden/lang/en_US.lang b/assets/forbidden/lang/en_US.lang new file mode 100644 index 0000000..22e3eba --- /dev/null +++ b/assets/forbidden/lang/en_US.lang @@ -0,0 +1,142 @@ +# +# Aspects +tc.aspect.infernus=The Nether, Demons, Hellfire +tc.aspect.ira=Wrath, Anger, Rage +tc.aspect.gula=Gluttony, Consumption, Indulgence +tc.aspect.invidia=Envy, Jealousy, Insecurity +tc.aspect.superbia=Pride, Arrogance, Disdain +tc.aspect.desidia=Sloth, Laziness, Procrastination +tc.aspect.luxuria=Lust, Desire, Excess +# +# Items +item.NetherShard.wrath.name=Wrath Shard +item.NetherShard.envy.name=Envy Shard +item.NetherShard.gluttony.name=Gluttony Shard +item.NetherShard.pride.name=Pride Shard +item.NetherShard.lust.name=Lust Shard +item.NetherShard.sloth.name=Sloth Shard +item.NetherShard.greed.name=Greed Shard +item.NetherShard.taint.name=Taint Shard +item.NetherShard.despair.name=Despair Shard +item.SkullAxe.name=Axe of the Skulltaker +item.ArcaneCake.name=Thaumic Cake +item.TaintShovel.name=Shovel of the Purifier +item.TaintPickaxe.name=Pickaxe of Distortion +item.MorphPickaxe.name=Chameleon Pickaxe +item.MorphSword.name=Chameleon Sword +item.MorphShovel.name=Chameleon Shovel +item.MorphAxe.name=Chameleon Axe +item.WandCores.tainted.name=Tainted Rod +item.WandCores.infernal.name=Infernal Rod +item.WandCores.soul.name=Eldritch Rod +item.WandCores.blood.name=Blood Rod +item.Wand.tainted.rod=Tainted +item.Wand.infernal.rod=Infernal +item.Wand.neutronium.rod=Cosmic Neutronium +item.Wand.soul.rod=Eldritch +item.Wand.blood.rod=Blood +item.Wand.orichalcum.cap=Orichalcum Studded +item.FMResource.0.name=Emerald Fragment +item.FMResource.1.name=Shadow Ink +item.MobCrystalEmpty.name=Blank Imprinting Crystal +item.MobCrystal.name=Imprinted Crystal +item.DiabolistFork.name=Diabolist Fork +item.DiabolistSpork.name=Spork of Doom +# +# Blocks +tile.ArcaneCake.name=Thaumic Cake +tile.InkFlower.name=Umbral Rose +tile.WrathCage.name=Wrath Cage +# +# Enchantments +enchantment.cluster=Fiery Core +enchantment.pigbane=Porcivore +enchantment.greedy=Greedy +enchantment.consuming=Consuming +# +# Misc +itemGroup.forbidden=Forbidden Magic +itemGroup.mobcrystal=Imprinting Crystals +tc.research_category.INFERNALISM=Infernalism +# +# Research +forbidden.research_name.NETHERSHARDS=Nether Shards +forbidden.research_text.NETHERSHARDS=Aim to misbehave. +forbidden.research_page.NETHERSHARDS.1=Strange energies swirl through the Nether. On occasion, they have been known to solidify into crystal shards when certain sympathetic events occur. +forbidden.research_page.NETHERSHARDS.2=These crystals are imbued with different vices and have many uses for more unscrupulous Thaumaturges.
There are seven documented types of nether shard, each attuned to a different "deadly sin."

forbidden:textures/misc/research.png:0:0:111:16:1
+forbidden.research_page.NETHERSHARDS.2b=These crystals are imbued with different vices and have many uses for more unscrupulous Thaumaturges.
There are six documented types of nether shard, each attuned to a different "deadly sin."

forbidden:textures/misc/research.png:0:16:95:16:1
+forbidden.research_page.NETHERSHARDS.3=Wrath Shards crystallize around acts of violence. The more excessive the physical force used, the more likely it is for a Wrath Shard to appear.

Sloth Shards congeal when proxies and accidents are used to collect resources without effort.

Envy Shards are taken from those who have them by those that covet them.

Pride Shards materialize when a creature of truly great power is cut down to size.

More sympathetic events may reveal themselves as time goes on. +# +forbidden.research_name.SKULLAXE=Axe of the Skulltaker +forbidden.research_text.SKULLAXE=Off with their heads! +forbidden.research_page.SKULLAXE.1=Some monsters just really boil your blood. Skeletons! Always clacking around and using you for target practice. Or those Creepers! They just creep around blowing things up like they own the place! You wish you could just chop all their smug heads off and place them on pikes.

Fortunately, you've discovered an item that will let you do just that. The Axe of the Skulltaker has a chance to remove the heads of monsters it slays. It might even work on other humans! Unfortunately, the infusion leaves the axe far too bloodthirsty to effectively cleave through boring plant matter. +# +forbidden.research_name.ARCANECAKE=Thaumic Cake +forbidden.research_text.ARCANECAKE=Let them eat cake. +forbidden.research_page.ARCANECAKE.1=If there's one thing you love, it's cake. You would eat its delicious goodness all day if you could, but it always runs out in the end.

To remedy this, you have devised a recipe to infuse a cake with longevity-enhancing magic. The Thaumic Cake lasts significantly longer than a mundane one and will slowly repair itself as long as there's at least a sliver left. The enchantments are unstable, however, and the cake cannot be moved again through conventional means once placed down. +# +forbidden.research_name.TAINTSHOVEL=Shovel of the Purifier +forbidden.research_text.TAINTSHOVEL=Like a hot knife through really gross butter +forbidden.research_page.TAINTSHOVEL.1=Sometimes, the easiest way to remove patches of taint is to just physically remove them.

By reinforcing a thaumium shovel with Silverwood and Order Shards, you have created a tool capable of combating Taint. The Shovel of the Purifier can dig through pulpy tainted lands as effectively as it can through normal earth. If held in your hand and right-clicked, the shovel cures you of Flux Taint at the cost of durability. +forbidden.research_page.TAINTSHOVEL.2=When digging through taint with the shovel, there's a chance that the twisted energies released will crystallize into Taint Shards. Unlike other tainted materials, the crystalline pattern keeps these shards stable enough to carry around. +# +forbidden.research_name.TAINTPICK=Pickaxe of Distortion +forbidden.research_text.TAINTPICK=Obsidian Buster +forbidden.research_page.TAINTPICK.1=By infusing a thaumium pickaxe with taint, you create a tool capable of cutting through difficult materials.

The Pickaxe of Distortion infects hard materials with taint, weakening them. The harder the material, the more effective the pickaxe is at removing it. Unfortunately, the effects of the taint have an inverse effect when mining softer materials, rendering the pickaxe less effective than just pawing at the block with your bare hands. +# +forbidden.research_name.ROD_tainted=Tainted Wand Core +forbidden.research_text.ROD_tainted=Squiggly vis storage +forbidden.research_page.ROD_tainted.1=Tainted Lands are places of great and terrible power for those Thaumaturges who know how to tap into them.

The Tainted Wand Core can store up to 150 vis of each type and slowly replenishes itself up to 10% in every aspect as long as it is being held inside of a Tainted Land. While the wand is held in your hand, it can also feed off of taint coursing through your veins, randomly restoring vis every time you take damage from flux taint. +# +forbidden.research_name.ROD_infernal=Infernal Wand Core +forbidden.research_text.ROD_infernal=Devilish vis storage +forbidden.research_page.ROD_infernal.1=A great and powerful thaumaturge like you deserves a powerful and imposing wand befitting your station. Some hippy silverwood wand just won't cut it. You need a wand that will serve as your scepter of authority.

You've discovered a way to create a wand infused with the power of the Nether. The Infernal Wand Core can hold up to 150 vis and will slowly replenish its supply of Ignis up to 20%. While within the Nether, the wand will also replenish its other aspects to 10%. +forbidden.research_page.ROD_infernal.2=The wand also imbues you with some protection from the Nether's hazards, extinguishing you if you are on fire or protecting you from the effects of Withering as long as it is in your inventory. While the wand is held in your hand, it will completely protect you from all fire damage. +# +forbidden.research_name.ROD_soul=Eldritch Wand Core +forbidden.research_text.ROD_soul=Corrupting vis storage +forbidden.research_page.ROD_soul.1=You've discovered a way to tap the energy flowing through a Player Beacon and turn it into vis. As long as you're in a dimension with an active Player Beacon attuned to yourself, the Eldritch Wand Core will slowly charge all its internal reserves, which can hold up to 100 vis.

Channeling such great amounts of energy through your soul comes at a price, however. Each point of vis creates large amounts of corruption in your soul. It's best not to rely on its recharge abilities too greatly... +# +forbidden.research_name.ROD_blood=Blood Wand Core +forbidden.research_text.ROD_blood=Bloody vis storage +forbidden.research_page.ROD_blood.1=You've created a bridge between Thaumaturgy and Alchemical Wizardry. The Blood Wand can store up to 100 vis and will gradually fill itself using Life Points.

Be very careful with this wand! It will bind itself to the first person to pick it up and can be excessively lethal if you have no Life Points to spare. +# +forbidden.research_name.TRANSEMERALD=Emerald Transmutation +forbidden.research_text.TRANSEMERALD=Transformation of valuables into emerald +forbidden.research_page.TRANSEMERALD.1=You have discovered a way to multiply emeralds by steeping emerald fragments in lucrum harvested from other substances. +# +forbidden.research_name.BLACKFLOWER=Umbral Rose +forbidden.research_text.BLACKFLOWER=Save the squid! +forbidden.research_page.BLACKFLOWER.1=There's no sight more pathetic than a soggy Thaumaturge. For all your great and miraculous powers, you still have to go jump in the nearest lake and hunt for squids every time you want to refill your inkwell.

You're done squid hunting. By infusing a rose with tenebrae and victus, you create a flower that spreads like a weed and whose petals can be crushed for ink. +# +forbidden.research_name.WRATHCAGE=Wrath Cage +forbidden.research_text.WRATHCAGE=Neverending battle +forbidden.research_page.WRATHCAGE.1=Sometimes, it's not enough to just kill something. Sure, slaying a single monster may be rather cathartic, but imagine just mowing down a crowd of the obnoxious little jerks.

To that end, you've discovered a way to recreate the monster spawners found in the ancient ruins. Unlike the original monster spawners, the Wrath Cage responds to redstone controls instead of the presence of human beings and can run much faster than the ancient devices. +forbidden.research_page.WRATHCAGE.2=However, you haven't been able to duplicate the original method of infinite creation. For every creature spawned, the Wrath Cage requires a bit of essentia piped into its internal reserves. The device will accept different types of essentia depending on the creature it is attuned to. Alternatively, piping Ira into the cage can serve as a fuel. The cage can also accept Desidia for some reason. +forbidden.research_page.WRATHCAGE.3=To attune a wrath cage to a specific creature, right click on it with an imprinted crystal. Slaying a compatible creature with a Diabolist Fork while carrying a blank imprinting crystal will attune the crystal to that monster. +# +forbidden.research_name.FORK=Diabolist Fork +forbidden.research_text.FORK=Arcane tinkering tool +forbidden.research_page.FORK.1=You've created a tool to help you tinker with various infernal contraptions. The quartz prongs on the Diabolist Fork allow it to attune itself to arcane energies.

Along with being used to tune devices, the fork also makes for a functional weapon.

More information should appear in the following pages as you uncover more research. +forbidden.research_page.FORK.wc=If the Diabolist Fork is used to slay a compatible creature with a Blank Imprinting Crystal in your inventory, it will imprint on the crystal. The Imprinted Crystal can then be used to attune a Wrath Cage to that monster. +# +forbidden.research_name.MORPHTOOLS=Chameleon Tools +forbidden.research_text.MORPHTOOLS=There's an enchantment for that... +forbidden.research_page.MORPHTOOLS.1=Chameleon Tools are like three tools in one. When first enchanted, right-clicking while sneaking with the tool in your hand changes it to a blank new enchanting slate, allowing you to enchant it with a completely different set of enchantments. Each tool can hold up to three separate enchantment sets which can be alternated between by right-clicking while sneaking.

The tools have no innate way to remove enchantments once fully enchanted, so make each enchantment count! +# +forbidden.research_name.CLUSTER=Enchantment: Fiery Core +forbidden.research_text.CLUSTER=Chameleon of the Core +forbidden.research_page.CLUSTER.1=You've discovered an enchantment to allow the Chameleon Pickaxe to imitate the effects of the Pickaxe of the Core. A Chameleon Pickaxe with the Fiery Core enchantment has a chance of dropping clusters when mining certain ores. Clusters are a lot purer than raw ore and can be smelted for two of the ore's normal smelting result. Higher levels of Fiery Core increase the chance of dropping clusters. +# +forbidden.research_name.GREEDY=Enchantment: Greedy +forbidden.research_text.GREEDY=I want your money AND your life! +forbidden.research_page.GREEDY.1=You've discovered a weapon enchantment that allows you to profit from taking lives. Every time a Greedy weapon slays a hostile creature, there's a chance to drop an Emerald Fragment. If a Greedy Weapon is used to kill a villager, it will instead drop one of the villager's emeralds. +# +forbidden.research_name.CONSUMING=Enchantment: Consuming +forbidden.research_text.CONSUMING=Garbage Disposal +forbidden.research_page.CONSUMING.1=Sick of having to empty your pack of worthless junk, you've devised an enchantment that will automatically destroy common, unwanted materials. Any Cobblestone, Dirt, or Netherrack mined by a Consuming tool will be destroyed instead of falling to the ground. +# +forbidden.research_name.PIGBANE=Enchantment: Porcivore +forbidden.research_text.PIGBANE=Show those Zombie Pigmen who's at the top of the food chain! +forbidden.research_page.PIGBANE.1=Zombie Pigmen think they're so great. They're always stomping around the Nether ganging up on innocent travelers. It's time someone put a stop to them.

Weapons with the Porcivore enchantment will do excessive amounts of damage to Pigs and Zombie Pigmen. +# \ No newline at end of file diff --git a/assets/forbidden/textures/aspects/desidia.png b/assets/forbidden/textures/aspects/desidia.png new file mode 100644 index 0000000..a29e791 Binary files /dev/null and b/assets/forbidden/textures/aspects/desidia.png differ diff --git a/assets/forbidden/textures/aspects/gula.png b/assets/forbidden/textures/aspects/gula.png new file mode 100644 index 0000000..d83eaea Binary files /dev/null and b/assets/forbidden/textures/aspects/gula.png differ diff --git a/assets/forbidden/textures/aspects/infernus.png b/assets/forbidden/textures/aspects/infernus.png new file mode 100644 index 0000000..e5ec8d7 Binary files /dev/null and b/assets/forbidden/textures/aspects/infernus.png differ diff --git a/assets/forbidden/textures/aspects/invidia.png b/assets/forbidden/textures/aspects/invidia.png new file mode 100644 index 0000000..24b5019 Binary files /dev/null and b/assets/forbidden/textures/aspects/invidia.png differ diff --git a/assets/forbidden/textures/aspects/ira.png b/assets/forbidden/textures/aspects/ira.png new file mode 100644 index 0000000..4d19799 Binary files /dev/null and b/assets/forbidden/textures/aspects/ira.png differ diff --git a/assets/forbidden/textures/aspects/luxuria.png b/assets/forbidden/textures/aspects/luxuria.png new file mode 100644 index 0000000..6473040 Binary files /dev/null and b/assets/forbidden/textures/aspects/luxuria.png differ diff --git a/assets/forbidden/textures/aspects/superbia.png b/assets/forbidden/textures/aspects/superbia.png new file mode 100644 index 0000000..4cf7972 Binary files /dev/null and b/assets/forbidden/textures/aspects/superbia.png differ diff --git a/assets/forbidden/textures/blocks/cake_bottom.png b/assets/forbidden/textures/blocks/cake_bottom.png new file mode 100644 index 0000000..3daee78 Binary files /dev/null and b/assets/forbidden/textures/blocks/cake_bottom.png differ diff --git a/assets/forbidden/textures/blocks/cake_inner.png b/assets/forbidden/textures/blocks/cake_inner.png new file mode 100644 index 0000000..e173e19 Binary files /dev/null and b/assets/forbidden/textures/blocks/cake_inner.png differ diff --git a/assets/forbidden/textures/blocks/cake_side.png b/assets/forbidden/textures/blocks/cake_side.png new file mode 100644 index 0000000..e8313e5 Binary files /dev/null and b/assets/forbidden/textures/blocks/cake_side.png differ diff --git a/assets/forbidden/textures/blocks/cake_top.png b/assets/forbidden/textures/blocks/cake_top.png new file mode 100644 index 0000000..63f963e Binary files /dev/null and b/assets/forbidden/textures/blocks/cake_top.png differ diff --git a/assets/forbidden/textures/blocks/crucible1.png b/assets/forbidden/textures/blocks/crucible1.png new file mode 100644 index 0000000..9fec2eb Binary files /dev/null and b/assets/forbidden/textures/blocks/crucible1.png differ diff --git a/assets/forbidden/textures/blocks/crucible2.png b/assets/forbidden/textures/blocks/crucible2.png new file mode 100644 index 0000000..fe0616c Binary files /dev/null and b/assets/forbidden/textures/blocks/crucible2.png differ diff --git a/assets/forbidden/textures/blocks/crucible3.png b/assets/forbidden/textures/blocks/crucible3.png new file mode 100644 index 0000000..8e1e1ad Binary files /dev/null and b/assets/forbidden/textures/blocks/crucible3.png differ diff --git a/assets/forbidden/textures/blocks/crucible4.png b/assets/forbidden/textures/blocks/crucible4.png new file mode 100644 index 0000000..041eb5c Binary files /dev/null and b/assets/forbidden/textures/blocks/crucible4.png differ diff --git a/assets/forbidden/textures/blocks/crucible5.png b/assets/forbidden/textures/blocks/crucible5.png new file mode 100644 index 0000000..7d4f8b5 Binary files /dev/null and b/assets/forbidden/textures/blocks/crucible5.png differ diff --git a/assets/forbidden/textures/blocks/crucible6.png b/assets/forbidden/textures/blocks/crucible6.png new file mode 100644 index 0000000..0aecb70 Binary files /dev/null and b/assets/forbidden/textures/blocks/crucible6.png differ diff --git a/assets/forbidden/textures/blocks/flower_black.png b/assets/forbidden/textures/blocks/flower_black.png new file mode 100644 index 0000000..6a9ba6a Binary files /dev/null and b/assets/forbidden/textures/blocks/flower_black.png differ diff --git a/assets/forbidden/textures/blocks/spirit_box.png b/assets/forbidden/textures/blocks/spirit_box.png new file mode 100644 index 0000000..8d69876 Binary files /dev/null and b/assets/forbidden/textures/blocks/spirit_box.png differ diff --git a/assets/forbidden/textures/items/cake.png b/assets/forbidden/textures/items/cake.png new file mode 100644 index 0000000..619167c Binary files /dev/null and b/assets/forbidden/textures/items/cake.png differ diff --git a/assets/forbidden/textures/items/chameleonaxe.png b/assets/forbidden/textures/items/chameleonaxe.png new file mode 100644 index 0000000..b1fe488 Binary files /dev/null and b/assets/forbidden/textures/items/chameleonaxe.png differ diff --git a/assets/forbidden/textures/items/chameleonpick.png b/assets/forbidden/textures/items/chameleonpick.png new file mode 100644 index 0000000..84ecdc0 Binary files /dev/null and b/assets/forbidden/textures/items/chameleonpick.png differ diff --git a/assets/forbidden/textures/items/chameleonshovel.png b/assets/forbidden/textures/items/chameleonshovel.png new file mode 100644 index 0000000..6bc4f21 Binary files /dev/null and b/assets/forbidden/textures/items/chameleonshovel.png differ diff --git a/assets/forbidden/textures/items/chameleonsword.png b/assets/forbidden/textures/items/chameleonsword.png new file mode 100644 index 0000000..ad3eb9e Binary files /dev/null and b/assets/forbidden/textures/items/chameleonsword.png differ diff --git a/assets/forbidden/textures/items/despairshard.png b/assets/forbidden/textures/items/despairshard.png new file mode 100644 index 0000000..ea2e847 Binary files /dev/null and b/assets/forbidden/textures/items/despairshard.png differ diff --git a/assets/forbidden/textures/items/dye_powder_black.png b/assets/forbidden/textures/items/dye_powder_black.png new file mode 100644 index 0000000..6ff487b Binary files /dev/null and b/assets/forbidden/textures/items/dye_powder_black.png differ diff --git a/assets/forbidden/textures/items/emerald_nugget.png b/assets/forbidden/textures/items/emerald_nugget.png new file mode 100644 index 0000000..557207d Binary files /dev/null and b/assets/forbidden/textures/items/emerald_nugget.png differ diff --git a/assets/forbidden/textures/items/emptycrystal.png b/assets/forbidden/textures/items/emptycrystal.png new file mode 100644 index 0000000..93429d4 Binary files /dev/null and b/assets/forbidden/textures/items/emptycrystal.png differ diff --git a/assets/forbidden/textures/items/envyshard.png b/assets/forbidden/textures/items/envyshard.png new file mode 100644 index 0000000..50834d4 Binary files /dev/null and b/assets/forbidden/textures/items/envyshard.png differ diff --git a/assets/forbidden/textures/items/eyeaxe.png b/assets/forbidden/textures/items/eyeaxe.png new file mode 100644 index 0000000..7737b03 Binary files /dev/null and b/assets/forbidden/textures/items/eyeaxe.png differ diff --git a/assets/forbidden/textures/items/eyepick.png b/assets/forbidden/textures/items/eyepick.png new file mode 100644 index 0000000..baa90a6 Binary files /dev/null and b/assets/forbidden/textures/items/eyepick.png differ diff --git a/assets/forbidden/textures/items/eyeshovel.png b/assets/forbidden/textures/items/eyeshovel.png new file mode 100644 index 0000000..7348f9d Binary files /dev/null and b/assets/forbidden/textures/items/eyeshovel.png differ diff --git a/assets/forbidden/textures/items/eyesword.png b/assets/forbidden/textures/items/eyesword.png new file mode 100644 index 0000000..31a5275 Binary files /dev/null and b/assets/forbidden/textures/items/eyesword.png differ diff --git a/assets/forbidden/textures/items/focus_wrath.png b/assets/forbidden/textures/items/focus_wrath.png new file mode 100644 index 0000000..dd301ee Binary files /dev/null and b/assets/forbidden/textures/items/focus_wrath.png differ diff --git a/assets/forbidden/textures/items/fork.png b/assets/forbidden/textures/items/fork.png new file mode 100644 index 0000000..6d9b43d Binary files /dev/null and b/assets/forbidden/textures/items/fork.png differ diff --git a/assets/forbidden/textures/items/gluttonyshard.png b/assets/forbidden/textures/items/gluttonyshard.png new file mode 100644 index 0000000..7641485 Binary files /dev/null and b/assets/forbidden/textures/items/gluttonyshard.png differ diff --git a/assets/forbidden/textures/items/greedshard.png b/assets/forbidden/textures/items/greedshard.png new file mode 100644 index 0000000..aefbc72 Binary files /dev/null and b/assets/forbidden/textures/items/greedshard.png differ diff --git a/assets/forbidden/textures/items/hexiteingot.png b/assets/forbidden/textures/items/hexiteingot.png new file mode 100644 index 0000000..aecc213 Binary files /dev/null and b/assets/forbidden/textures/items/hexiteingot.png differ diff --git a/assets/forbidden/textures/items/lustshard.png b/assets/forbidden/textures/items/lustshard.png new file mode 100644 index 0000000..e5eeb36 Binary files /dev/null and b/assets/forbidden/textures/items/lustshard.png differ diff --git a/assets/forbidden/textures/items/mobcrystal.png b/assets/forbidden/textures/items/mobcrystal.png new file mode 100644 index 0000000..fddc7a1 Binary files /dev/null and b/assets/forbidden/textures/items/mobcrystal.png differ diff --git a/assets/forbidden/textures/items/prideshard.png b/assets/forbidden/textures/items/prideshard.png new file mode 100644 index 0000000..eb79d7f Binary files /dev/null and b/assets/forbidden/textures/items/prideshard.png differ diff --git a/assets/forbidden/textures/items/skullaxe.png b/assets/forbidden/textures/items/skullaxe.png new file mode 100644 index 0000000..02bcf1c Binary files /dev/null and b/assets/forbidden/textures/items/skullaxe.png differ diff --git a/assets/forbidden/textures/items/slothshard.png b/assets/forbidden/textures/items/slothshard.png new file mode 100644 index 0000000..ff1af42 Binary files /dev/null and b/assets/forbidden/textures/items/slothshard.png differ diff --git a/assets/forbidden/textures/items/slothshard.png.mcmeta b/assets/forbidden/textures/items/slothshard.png.mcmeta new file mode 100644 index 0000000..8e55e43 --- /dev/null +++ b/assets/forbidden/textures/items/slothshard.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/assets/forbidden/textures/items/spork.png b/assets/forbidden/textures/items/spork.png new file mode 100644 index 0000000..52e12a7 Binary files /dev/null and b/assets/forbidden/textures/items/spork.png differ diff --git a/assets/forbidden/textures/items/taintpickaxe.png b/assets/forbidden/textures/items/taintpickaxe.png new file mode 100644 index 0000000..118c2e8 Binary files /dev/null and b/assets/forbidden/textures/items/taintpickaxe.png differ diff --git a/assets/forbidden/textures/items/taintshard.png b/assets/forbidden/textures/items/taintshard.png new file mode 100644 index 0000000..372ae18 Binary files /dev/null and b/assets/forbidden/textures/items/taintshard.png differ diff --git a/assets/forbidden/textures/items/taintshard.png.mcmeta b/assets/forbidden/textures/items/taintshard.png.mcmeta new file mode 100644 index 0000000..8e55e43 --- /dev/null +++ b/assets/forbidden/textures/items/taintshard.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/assets/forbidden/textures/items/taintshovel.png b/assets/forbidden/textures/items/taintshovel.png new file mode 100644 index 0000000..85991ae Binary files /dev/null and b/assets/forbidden/textures/items/taintshovel.png differ diff --git a/assets/forbidden/textures/items/wand_rod_blood.png b/assets/forbidden/textures/items/wand_rod_blood.png new file mode 100644 index 0000000..4630cbd Binary files /dev/null and b/assets/forbidden/textures/items/wand_rod_blood.png differ diff --git a/assets/forbidden/textures/items/wand_rod_infernal.png b/assets/forbidden/textures/items/wand_rod_infernal.png new file mode 100644 index 0000000..141673f Binary files /dev/null and b/assets/forbidden/textures/items/wand_rod_infernal.png differ diff --git a/assets/forbidden/textures/items/wand_rod_soul.png b/assets/forbidden/textures/items/wand_rod_soul.png new file mode 100644 index 0000000..f184ebd Binary files /dev/null and b/assets/forbidden/textures/items/wand_rod_soul.png differ diff --git a/assets/forbidden/textures/items/wand_rod_tainted.png b/assets/forbidden/textures/items/wand_rod_tainted.png new file mode 100644 index 0000000..936649d Binary files /dev/null and b/assets/forbidden/textures/items/wand_rod_tainted.png differ diff --git a/assets/forbidden/textures/items/wrathshard.png b/assets/forbidden/textures/items/wrathshard.png new file mode 100644 index 0000000..30d7e24 Binary files /dev/null and b/assets/forbidden/textures/items/wrathshard.png differ diff --git a/assets/forbidden/textures/items/wrathshard.png.mcmeta b/assets/forbidden/textures/items/wrathshard.png.mcmeta new file mode 100644 index 0000000..b84e69f --- /dev/null +++ b/assets/forbidden/textures/items/wrathshard.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 4 + } +} diff --git a/assets/forbidden/textures/misc/consuming.png b/assets/forbidden/textures/misc/consuming.png new file mode 100644 index 0000000..065d061 Binary files /dev/null and b/assets/forbidden/textures/misc/consuming.png differ diff --git a/assets/forbidden/textures/misc/educational.png b/assets/forbidden/textures/misc/educational.png new file mode 100644 index 0000000..487b830 Binary files /dev/null and b/assets/forbidden/textures/misc/educational.png differ diff --git a/assets/forbidden/textures/misc/greedy.png b/assets/forbidden/textures/misc/greedy.png new file mode 100644 index 0000000..c1f5543 Binary files /dev/null and b/assets/forbidden/textures/misc/greedy.png differ diff --git a/assets/forbidden/textures/misc/infernalism.png b/assets/forbidden/textures/misc/infernalism.png new file mode 100644 index 0000000..da80c60 Binary files /dev/null and b/assets/forbidden/textures/misc/infernalism.png differ diff --git a/assets/forbidden/textures/misc/lucrative.png b/assets/forbidden/textures/misc/lucrative.png new file mode 100644 index 0000000..1f5710d Binary files /dev/null and b/assets/forbidden/textures/misc/lucrative.png differ diff --git a/assets/forbidden/textures/misc/pigbane.png b/assets/forbidden/textures/misc/pigbane.png new file mode 100644 index 0000000..05c9e00 Binary files /dev/null and b/assets/forbidden/textures/misc/pigbane.png differ diff --git a/assets/forbidden/textures/misc/research.png b/assets/forbidden/textures/misc/research.png new file mode 100644 index 0000000..d8f5bb7 Binary files /dev/null and b/assets/forbidden/textures/misc/research.png differ diff --git a/assets/forbidden/textures/models/wand_cap_orichalcum.png b/assets/forbidden/textures/models/wand_cap_orichalcum.png new file mode 100644 index 0000000..f97c403 Binary files /dev/null and b/assets/forbidden/textures/models/wand_cap_orichalcum.png differ diff --git a/assets/forbidden/textures/models/wand_rod_blood.pdn b/assets/forbidden/textures/models/wand_rod_blood.pdn new file mode 100644 index 0000000..39b8d76 Binary files /dev/null and b/assets/forbidden/textures/models/wand_rod_blood.pdn differ diff --git a/assets/forbidden/textures/models/wand_rod_blood.png b/assets/forbidden/textures/models/wand_rod_blood.png new file mode 100644 index 0000000..6376a37 Binary files /dev/null and b/assets/forbidden/textures/models/wand_rod_blood.png differ diff --git a/assets/forbidden/textures/models/wand_rod_infernal.png b/assets/forbidden/textures/models/wand_rod_infernal.png new file mode 100644 index 0000000..442d19d Binary files /dev/null and b/assets/forbidden/textures/models/wand_rod_infernal.png differ diff --git a/assets/forbidden/textures/models/wand_rod_neutronium.png b/assets/forbidden/textures/models/wand_rod_neutronium.png new file mode 100644 index 0000000..d165b00 Binary files /dev/null and b/assets/forbidden/textures/models/wand_rod_neutronium.png differ diff --git a/assets/forbidden/textures/models/wand_rod_soul.png b/assets/forbidden/textures/models/wand_rod_soul.png new file mode 100644 index 0000000..2042790 Binary files /dev/null and b/assets/forbidden/textures/models/wand_rod_soul.png differ diff --git a/assets/forbidden/textures/models/wand_rod_tainted.png b/assets/forbidden/textures/models/wand_rod_tainted.png new file mode 100644 index 0000000..19d784d Binary files /dev/null and b/assets/forbidden/textures/models/wand_rod_tainted.png differ diff --git a/src/com/spiteful/forbidden/CommonProxy.java b/src/com/spiteful/forbidden/CommonProxy.java new file mode 100644 index 0000000..a71a860 --- /dev/null +++ b/src/com/spiteful/forbidden/CommonProxy.java @@ -0,0 +1,9 @@ +package com.spiteful.forbidden; + +public class CommonProxy { + + public void registerRenderInfo(){ + + } + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/Compat.java b/src/com/spiteful/forbidden/Compat.java new file mode 100644 index 0000000..e2077bd --- /dev/null +++ b/src/com/spiteful/forbidden/Compat.java @@ -0,0 +1,193 @@ +package com.spiteful.forbidden; + +import com.spiteful.forbidden.items.ForbiddenItems; + +import java.util.logging.Level; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.util.ResourceLocation; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.ItemApi; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IEssentiaContainerItem; +import thaumcraft.api.wands.WandCap; +import thaumcraft.api.wands.WandRod; +import thaumcraft.api.wands.WandTriggerRegistry; +import thaumcraft.api.crafting.InfusionRecipe; +import thaumcraft.api.research.ResearchCategories; +import thaumcraft.api.research.ResearchCategoryList; +import thaumcraft.api.research.ResearchItem; +import thaumcraft.api.research.ResearchPage; +import playerbeacons.common.PlayerBeacons; + +public class Compat { + + public static boolean tt = false; + public static boolean kami = false; + public static boolean tx = false; + public static boolean natura = false; + public static boolean pb = false; + public static boolean bm = false; + + public static int tabletID = -1; + + public static void initiate() + { + if(Loader.isModLoaded("ThaumicTinkerer")) + tt = true; + if(Loader.isModLoaded("ThaumicTinkererKami")) + kami = true; + if(Loader.isModLoaded("ThaumicExploration")) + tx = true; + if(Loader.isModLoaded("Natura")) + natura = true; + if(Loader.isModLoaded("PlayerBeacons")) + pb = true; + if(Loader.isModLoaded("AWWayofTime")) + bm = true; + } + + public static void compatify() + { + ItemStack i; + AspectList list; + + if(tt && pb) + { + try + { + tabletID = ((Block)(Class.forName("vazkii.tinkerer.common.block.ModBlocks").getField("animationTablet").get(null))).blockID; + } + catch(Exception e) + { + FMLLog.log(Level.INFO, e, "Forbidden Magic doesn't have Thaumic Tinkerer's nose."); + e.printStackTrace(); + } + } + + if(tt && kami) + { + try { + + Item kamiShards = (Item)(Class.forName("vazkii.tinkerer.common.item.ModItems").getField("kamiResource").get(null)); + list = new AspectList().add(DarkAspects.NETHER, 2).add(Aspect.MAGIC, 1).add(Aspect.CRYSTAL, 1); + ThaumcraftApi.registerObjectTag(kamiShards.itemID, 6, list); + list = new AspectList().add(Aspect.ELDRITCH, 2).add(Aspect.MAGIC, 1).add(Aspect.CRYSTAL, 1); + ThaumcraftApi.registerObjectTag(kamiShards.itemID, 7, list); + + } + catch(Exception e) + { + FMLLog.log(Level.INFO, e, "Forbidden Magic doesn't have Thaumic Tinkerer's nose."); + e.printStackTrace(); + } + } + + if(natura) + { + try + { + list = (new AspectList()).add(Aspect.BEAST, 2).add(DarkAspects.NETHER, 4).add(DarkAspects.SLOTH, 2); + ThaumcraftApi.registerEntityTag("Natura.Imp", list); + list = (new AspectList()).add(Aspect.BEAST, 3).add(Aspect.FIRE, 3).add(DarkAspects.NETHER, 2); + ThaumcraftApi.registerEntityTag("Natura.HeatscarSpider", list); + ThaumcraftApi.registerEntityTag("Natura.FlameSpider", list); + list = (new AspectList()).add(Aspect.BEAST, 1).add(Aspect.FIRE, 2).add(DarkAspects.NETHER, 1); + ThaumcraftApi.registerEntityTag("Natura.BabyHeatscarSpider", list); + ThaumcraftApi.registerEntityTag("Natura.FlameSpiderBaby", list); + list = (new AspectList()).add(Aspect.BEAST, 2).add(Aspect.FIRE, 4).add(DarkAspects.NETHER, 2).add(Aspect.ENTROPY, 4); + ThaumcraftApi.registerEntityTag("Natura.NitroCreeper", list); + + i = GameRegistry.findItemStack("Natura", "Dark Tree", 1); + if(i != null){ + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(i.itemID, 1, 1)); + list.add(DarkAspects.WRATH, 2); + ThaumcraftApi.registerObjectTag(i.itemID, 1, list); + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(i.itemID, 1, 0)); + list.add(Aspect.DARKNESS, 2); + ThaumcraftApi.registerObjectTag(i.itemID, 0, list); + } + i = GameRegistry.findItemStack("Natura", "soil.tainted", 1); + if(i != null){ + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(i.itemID, 1, 0)); + list.add(DarkAspects.NETHER, 1); + ThaumcraftApi.registerObjectTag(i.itemID, -1, list); + } + i = GameRegistry.findItemStack("Natura", "heatsand", 1); + if(i != null){ + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(i.itemID, 1, 0)); + list.add(DarkAspects.NETHER, 1); + ThaumcraftApi.registerObjectTag(i.itemID, -1, list); + } + i = GameRegistry.findItemStack("Natura", "rawImphide", 1); + if(i != null){ + list = (new AspectList()).add(Aspect.FLESH, 4).add(Aspect.HUNGER, 1).add(DarkAspects.NETHER, 1); + ThaumcraftApi.registerObjectTag(i.itemID, 0, list); + list = (new AspectList()).add(Aspect.FLESH, 4).add(Aspect.POISON, 2).add(Aspect.FIRE, 2).add(DarkAspects.NETHER, 1); + ThaumcraftApi.registerObjectTag(i.itemID, 1, list); + } + } + catch(Exception e) + { + FMLLog.log(Level.INFO, e, "Forbidden Magic had an allergic reaction to Natura."); + e.printStackTrace(); + } + } + if(pb) + { + try + { + InfusionRecipe soul_recipe = ThaumcraftApi.addInfusionCraftingRecipe("ROD_soul", new ItemStack(ForbiddenItems.wandCore, 1, 2), 5, (new AspectList()).add(Aspect.ELDRITCH, 32).add(Aspect.MAGIC, 12).add(Aspect.SOUL, 16), new ItemStack(PlayerBeacons.defiledSoulPylonBlock), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(PlayerBeacons.defiledSoulConductorBlock), new ItemStack(PlayerBeacons.defiledSoulConductorBlock), new ItemStack(PlayerBeacons.defiledSoulConductorBlock), new ItemStack(PlayerBeacons.defiledSoulConductorBlock), new ItemStack(Item.eyeOfEnder), new ItemStack(Item.eyeOfEnder)}); + (new DarkResearchItem("ROD_soul", "THAUMATURGY", (new AspectList()).add(Aspect.ELDRITCH, 2).add(Aspect.SOUL, 1).add(Aspect.TOOL, 1), -5, 7, 4, new ItemStack(ForbiddenItems.wandCore, 1, 2))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.ROD_soul.1"), new ResearchPage(soul_recipe)}).setParents(new String[]{"ROD_silverwood", "PB_CRYSTAL"}).setConcealed().registerResearchItem(); + } + catch(Exception e) + { + FMLLog.log(Level.INFO, e, "Player Beacons showed Forbidden Magic who the Alpha Fox is."); + e.printStackTrace(); + } + } + if(bm) + { + try + { + Class bloodItems; + try + { + bloodItems = Class.forName("WayofTime.alchemicalWizardry.common.ModItems"); + } + catch(Exception e) + { + bloodItems = Class.forName("WayofTime.alchemicalWizardry.AlchemicalWizardry"); + } + Item masterOrb = (Item)(bloodItems.getField("masterBloodOrb").get(null)); + Item imbuedSlate = (Item)(bloodItems.getField("imbuedSlate").get(null)); + Item magicales = (Item)(bloodItems.getField("magicales").get(null)); + Item aether = (Item)(bloodItems.getField("aether").get(null)); + Item terrae = (Item)(bloodItems.getField("terrae").get(null)); + Item aquasalus = (Item)(bloodItems.getField("aquasalus").get(null)); + Item incendium = (Item)(bloodItems.getField("incendium").get(null)); + Item sanctus = (Item)(bloodItems.getField("sanctus").get(null)); + Item tennebrae = (Item)(bloodItems.getField("tennebrae").get(null)); + + InfusionRecipe blood_recipe = ThaumcraftApi.addInfusionCraftingRecipe("ROD_blood", new ItemStack(ForbiddenItems.wandCore, 1, 3), 2, (new AspectList()).add(Aspect.LIFE, 32).add(Aspect.MAGIC, 12).add(Aspect.WATER, 16), new ItemStack(masterOrb), new ItemStack[]{new ItemStack(magicales), new ItemStack(imbuedSlate), new ItemStack(imbuedSlate), new ItemStack(tennebrae), new ItemStack(sanctus), new ItemStack(aquasalus), new ItemStack(incendium), new ItemStack(terrae), new ItemStack(aether)}); + (new DarkResearchItem("ROD_blood", "THAUMATURGY", (new AspectList()).add(Aspect.LIFE, 2).add(Aspect.WATER, 1).add(Aspect.WEAPON, 1), -5, 9, 4, new ItemStack(ForbiddenItems.wandCore, 1, 3))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.ROD_blood.1"), new ResearchPage(blood_recipe)}).setParents(new String[]{"ROD_silverwood"}).setConcealed().registerResearchItem(); + + } + catch(Exception e) + { + FMLLog.log(Level.INFO, e, "Forbidden Magic tried to do some Blood Magic, but bled out."); + e.printStackTrace(); + } + } + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/Config.java b/src/com/spiteful/forbidden/Config.java new file mode 100644 index 0000000..b874324 --- /dev/null +++ b/src/com/spiteful/forbidden/Config.java @@ -0,0 +1,203 @@ +package com.spiteful.forbidden; + +import java.io.File; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.logging.Level; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.Property; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.FMLLog; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.ItemApi; + +public class Config +{ + public static HashMap spawnerMobs = new HashMap(); + + public static int shardID; + public static int skullAxeID; + public static int arcaneCakeItemID; + public static int taintShovelID; + public static int wandCoreID; + public static int resourceID; + public static int taintPickaxeID; + public static int mobCrystalID; + public static int forkID; + public static int morphPickaxeID; + public static int morphSwordID; + public static int morphShovelID; + public static int morphAxeID; + + public static int arcaneCakeBlockID; + public static int blackFlowerBlockID; + public static int wrathCageID; + + public static int clusterEnchID; + public static int pigBaneEnchID; + public static int greedyEnchID; + public static int consumingEnchID; + + public static int thaumcraftResourceID; + public static int thaumcraftTaintBlockID; + public static int thaumcraftTaintPotionID; + public static int thaumcraftTaintBiomeID; + + public static boolean noLust = false; + public static boolean silverfishEmeralds = true; + public static boolean noMeddling = false; + public static boolean tagResearch = true; + public static boolean wrathCage = true; + public static boolean spork = false; + public static boolean greedyEnch = true; + + public static int wrathCost = 5; + public static int wrathEff = 4; + + public static Material taintMaterial; + + public static void configurate(File targ) + { + Configuration conf = new Configuration(targ); + + try + { + conf.load(); + int idCount = 9342; + shardID = conf.getItem("Nether Shards", idCount++).getInt(); + skullAxeID = conf.getItem("Axe of the Skulltaker", idCount++).getInt(); + arcaneCakeItemID = conf.getItem("Thaumic Cake", idCount++).getInt(); + taintShovelID = conf.getItem("Shovel of the Purifier", idCount++).getInt(); + wandCoreID = conf.getItem("Wand Cores", idCount++).getInt(); + resourceID = conf.getItem("Various Resources", idCount++).getInt(); + taintPickaxeID = conf.getItem("Pickaxe of Distortion", idCount++).getInt(); + mobCrystalID = conf.getItem("Imprinting Crystal", idCount++).getInt(); + forkID = conf.getItem("Diabolist Fork", idCount++).getInt(); + morphPickaxeID = conf.getItem("Chameleon Pickaxe", idCount++).getInt(); + morphSwordID = conf.getItem("Chameleon Sword", idCount++).getInt(); + morphShovelID = conf.getItem("Chameleon Shovel", idCount++).getInt(); + morphAxeID = conf.getItem("Chameleon Axe", idCount++).getInt(); + + int blockCount = 3000; + arcaneCakeBlockID = conf.getBlock("Thaumic Cake", blockCount++).getInt(); + blackFlowerBlockID = conf.getBlock("Umbral Rose", blockCount++).getInt(); + wrathCageID = conf.getBlock("Wrath Cage", blockCount++).getInt(); + + int enchCount = 66; + clusterEnchID = conf.get("enchantments", "Lucrative", enchCount++).getInt(); + pigBaneEnchID = conf.get("enchantments", "Porcivore", enchCount++).getInt(); + greedyEnchID = conf.get("enchantments", "Greedy", enchCount++).getInt(); + consumingEnchID = conf.get("enchantments", "Consuming", enchCount++).getInt(); + + Property nl = conf.get("general", "No Lust", noLust); + nl.comment = "Enable to remove Luxuria aspect and related items."; + noLust = nl.getBoolean(false); + Property sf = conf.get("general", "Silverfish Drop Emerald Nuggets", silverfishEmeralds); + sf.comment = "Disable to prevent Silverfish from dropping emerald nuggets."; + silverfishEmeralds = sf.getBoolean(true); + Property ge = conf.get("general", "Greedy Enchantment", greedyEnch); + ge.comment = "Disable to remove the recipe and effects of the Greedy enchantment."; + greedyEnch = ge.getBoolean(true); + Property nm = conf.get("general", "Don't Be That Guy", noMeddling); + nm.comment = "Enable to turn the Infernal Furnace and Wand Focus: Nine Hells back to normal."; + noMeddling = nm.getBoolean(true); + Property tr = conf.get("general", "Tag Research Items", tagResearch); + tr.comment = "Disable to get rid of the [FM] tags in the Thaumonomicon."; + tagResearch = tr.getBoolean(true); + Property wc = conf.get("general", "Wrath Cage Enabled", wrathCage); + wc.comment = "Disable if you don't want players using the Wrath Cage."; + wrathCage = wc.getBoolean(true); + Property wf = conf.get("general", "Wrath Cage Fuel Cost", wrathCost); + wf.comment = "Cost of essentia per round of spawns in the Wrath Cage. Raise to increase essentia costs. Defaults to 1. Set to 0 to remove the need to fuel the Wrath Cage. Setting the cost above 64 is not recommended."; + wrathCost = wf.getInt(5); + Property we = conf.get("general", "Wrath Cage Fuel Efficiency", wrathEff); + we.comment = "Number of spawns a Wrath Cage can get per fuel cost. Defaults to 5. Lower to make the cage less efficient and raise to make it more efficient."; + wrathEff = we.getInt(4); + if(wrathEff < 0) + wrathEff = 4; + Property sd = conf.get("general", "Spork of Doom", spork); + sd.comment = "What is this? I don't even..."; + spork = sd.getBoolean(false); + } + catch (Exception e) + { + FMLLog.log(Level.SEVERE, e, "Forbidden Magic has a problem loading its configuration."); + } + finally + { + conf.save(); + } + + try { + + thaumcraftResourceID = ItemApi.getItem("itemResource", 0).itemID; + thaumcraftTaintBlockID = ItemApi.getBlock("blockTaint", 0).itemID; + taintMaterial = Block.blocksList[thaumcraftTaintBlockID].blockMaterial; + + thaumcraftTaintPotionID = Class.forName("thaumcraft.common.config.Config").getField("potionFluxTaintID").getInt(null); + thaumcraftTaintBiomeID = Class.forName("thaumcraft.common.config.Config").getField("biomeTaintID").getInt(null); + } + catch(Exception e) + { + FMLLog.log(Level.SEVERE, e, "Forbidden Magic is having a problem retrieving information from Thaumcraft."); + e.printStackTrace(); + } + + } + + public static void spawnilify() + { + if(wrathCage){ + spawnerMobs.put("Zombie", Aspect.FLESH); + spawnerMobs.put("Skeleton", Aspect.DEATH); + spawnerMobs.put("Creeper", Aspect.FIRE); + spawnerMobs.put("EntityHorse", Aspect.BEAST); + spawnerMobs.put("Pig", Aspect.BEAST); + spawnerMobs.put("Sheep", Aspect.CLOTH); + spawnerMobs.put("Cow", Aspect.BEAST); + spawnerMobs.put("MushroomCow", Aspect.PLANT); + spawnerMobs.put("Ozelot", Aspect.BEAST); + spawnerMobs.put("Chicken", Aspect.FLIGHT); + spawnerMobs.put("Squid", Aspect.SENSES); + spawnerMobs.put("Wolf", Aspect.BEAST); + spawnerMobs.put("Bat", Aspect.FLIGHT); + spawnerMobs.put("Spider", Aspect.CLOTH); + spawnerMobs.put("Slime", Aspect.SLIME); + spawnerMobs.put("Ghast", DarkAspects.NETHER); + spawnerMobs.put("PigZombie", Aspect.GREED); + spawnerMobs.put("Enderman", Aspect.ELDRITCH); + spawnerMobs.put("CaveSpider", Aspect.POISON); + if(silverfishEmeralds) + spawnerMobs.put("Silverfish", Aspect.GREED); + else + spawnerMobs.put("Silverfish", Aspect.STONE); + spawnerMobs.put("Blaze", Aspect.FIRE); + spawnerMobs.put("LavaSlime", Aspect.FIRE); + spawnerMobs.put("Witch", Aspect.MAGIC); + spawnerMobs.put("Firebat", Aspect.FIRE); + spawnerMobs.put("Wisp", Aspect.AURA); + spawnerMobs.put("ThaumSlime", Aspect.TAINT); + spawnerMobs.put("BrainyZombie", Aspect.MIND); + spawnerMobs.put("TaintSpider", Aspect.TAINT); + spawnerMobs.put("TaintSwarm", Aspect.TAINT); + spawnerMobs.put("TaintedPig", Aspect.TAINT); + //spawnerMobs.put("TaintedSheep", Aspect.TAINT); + spawnerMobs.put("TaintedCow", Aspect.TAINT); + spawnerMobs.put("TaintedChicken", Aspect.TAINT); + spawnerMobs.put("TaintedVillager", Aspect.TAINT); + //spawnerMobs.put("Taintacle", DarkAspects.LUST); + + } + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/DarkAspects.java b/src/com/spiteful/forbidden/DarkAspects.java new file mode 100644 index 0000000..d841b57 --- /dev/null +++ b/src/com/spiteful/forbidden/DarkAspects.java @@ -0,0 +1,262 @@ +package com.spiteful.forbidden; + +import com.spiteful.forbidden.items.ForbiddenItems; +import com.spiteful.forbidden.blocks.ForbiddenBlocks; + +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.ItemApi; +import net.minecraft.util.ResourceLocation; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import java.util.Iterator; + +public class DarkAspects +{ + public static Aspect NETHER; + public static Aspect WRATH; + public static Aspect ENVY; + public static Aspect GLUTTONY; + public static Aspect PRIDE; + public static Aspect LUST; + public static Aspect SLOTH; + + public static void initAspects() + { + NETHER = new Aspect("infernus", 0xff0000, new Aspect[] {Aspect.FIRE, Aspect.MAGIC}, new ResourceLocation("forbidden", "textures/aspects/infernus.png"), 771); + if(!Config.noLust){ + LUST = new Aspect("luxuria", 0xffc1ce, new Aspect[] {Aspect.FLESH, Aspect.HUNGER}, new ResourceLocation("forbidden", "textures/aspects/luxuria.png"), 1); + } + PRIDE = new Aspect("superbia", 0x9639ff, new Aspect[] {Aspect.FLIGHT, Aspect.VOID}, new ResourceLocation("forbidden", "textures/aspects/superbia.png"), 1); + GLUTTONY = new Aspect("gula", 0xd59c46, new Aspect[] {Aspect.HUNGER, Aspect.HUNGER}, new ResourceLocation("forbidden", "textures/aspects/gula.png"), 1); + ENVY = new Aspect("invidia", 0x00ba00, new Aspect[] {Aspect.SENSES, Aspect.HUNGER}, new ResourceLocation("forbidden", "textures/aspects/invidia.png"), 1); + SLOTH = new Aspect("desidia", 0x6e6e6e, new Aspect[] {Aspect.TRAP, Aspect.SOUL}, new ResourceLocation("forbidden", "textures/aspects/desidia.png"), 771); + WRATH = new Aspect("ira", 0x870404, new Aspect[] {Aspect.WEAPON, Aspect.FIRE}, new ResourceLocation("forbidden", "textures/aspects/ira.png"), 771); + } + + public static void addAspects() + { + AspectList list; + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Block.netherrack)); + list.add(NETHER, 1); + ThaumcraftApi.registerObjectTag(Block.netherrack.blockID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Block.portal)); + list.add(NETHER, 4); + ThaumcraftApi.registerObjectTag(Block.portal.blockID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Block.oreNetherQuartz)); + list.add(NETHER, 2); + ThaumcraftApi.registerObjectTag(Block.oreNetherQuartz.blockID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.netherStar)); + list.add(NETHER, 8).add(PRIDE, 8); + ThaumcraftApi.registerObjectTag(Item.netherStar.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.netherStalkSeeds)); + list.add(NETHER, 1); + ThaumcraftApi.registerObjectTag(Item.netherStalkSeeds.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.netherrackBrick)); + list.add(NETHER, 1); + ThaumcraftApi.registerObjectTag(Item.netherrackBrick.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.ghastTear)); + list.add(NETHER, 4); + ThaumcraftApi.registerObjectTag(Item.ghastTear.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.skull.itemID, 1, 1)); + list.add(NETHER, 4); + ThaumcraftApi.registerObjectTag(Item.skull.itemID, 1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.skull.itemID, 1, 4)); + list.add(WRATH, 2); + ThaumcraftApi.registerObjectTag(Item.skull.itemID, 4, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.enderPearl)); + list.add(PRIDE, 1); + ThaumcraftApi.registerObjectTag(Item.enderPearl.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.rottenFlesh)); + list.add(GLUTTONY, 1); + ThaumcraftApi.registerObjectTag(Item.rottenFlesh.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Block.slowSand)); + list.add(NETHER, 1); + ThaumcraftApi.registerObjectTag(Block.slowSand.blockID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Block.tnt)); + list.add(WRATH, 2); + ThaumcraftApi.registerObjectTag(Block.tnt.blockID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.helmetGold)); + list.add(PRIDE, 2); + ThaumcraftApi.registerObjectTag(Item.helmetGold.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.plateGold)); + list.add(PRIDE, 1); + ThaumcraftApi.registerObjectTag(Item.plateGold.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.legsGold)); + list.add(PRIDE, 1); + ThaumcraftApi.registerObjectTag(Item.legsGold.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.bootsGold)); + list.add(PRIDE, 1); + ThaumcraftApi.registerObjectTag(Item.bootsGold.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.swordGold)); + if(list != null) + list.add(PRIDE, 2); + ThaumcraftApi.registerObjectTag(Item.swordGold.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.bed)); + list.add(SLOTH, 2); + ThaumcraftApi.registerObjectTag(Item.bed.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.eyeOfEnder)); + list.add(ENVY, 4); + ThaumcraftApi.registerObjectTag(Item.eyeOfEnder.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.cake)); + list.add(GLUTTONY, 7); + ThaumcraftApi.registerObjectTag(Item.cake.itemID, -1, list); + + list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.cookie)); + list.add(GLUTTONY, 1); + ThaumcraftApi.registerObjectTag(Item.cookie.itemID, -1, list); + + Iterator mobCount = ThaumcraftApi.scanEntities.iterator(); + + while (mobCount.hasNext()) + { + ThaumcraftApi.EntityTags mobTag = (ThaumcraftApi.EntityTags)mobCount.next(); + + if (mobTag.entityName.equals("BrainyZombie")) + { + mobTag.aspects.add(WRATH, 3); + } + + else if (mobTag.entityName.equals("GiantBrainyZombie")) + { + mobTag.aspects.add(WRATH, 4); + } + + else if (mobTag.entityName.equals("Firebat")) + { + mobTag.aspects.add(WRATH, 1).add(NETHER, 2); + } + + else if (mobTag.entityName.equals("Skeleton") && mobTag.nbts.length > 0) + { + mobTag.aspects.add(NETHER, 3); + } + + else if (mobTag.entityName.equals("Creeper")) + { + if(mobTag.nbts.length > 0) + mobTag.aspects.add(WRATH, 4); + else + mobTag.aspects.add(WRATH, 2); + } + + else if (mobTag.entityName.equals("WitherBoss")) + { + mobTag.aspects.add(NETHER, 7).add(WRATH, 7); + } + + else if (mobTag.entityName.equals("Ozelot")) + { + mobTag.aspects.add(SLOTH, 3); + } + + else if (mobTag.entityName.equals("Enderman")) + { + mobTag.aspects.add(PRIDE, 4).add(ENVY, 4); + } + + else if (mobTag.entityName.equals("Ghast")) + { + mobTag.aspects.add(NETHER, 3).add(WRATH, 3); + } + + else if (mobTag.entityName.equals("PigZombie")) + { + mobTag.aspects.add(WRATH, 6); + } + + else if (mobTag.entityName.equals("EnderDragon")) + { + mobTag.aspects.add(PRIDE, 10); + } + + else if (!Config.noLust && mobTag.entityName.equals("Taintacle")) + { + mobTag.aspects.add(LUST, 3); + } + + else if (mobTag.entityName.equals("Pig")) + { + mobTag.aspects.add(GLUTTONY, 3); + } + + else if(mobTag.entityName.equals("LavaSlime")) + { + mobTag.aspects.add(NETHER, 1); + } + + else if(!Config.noLust && mobTag.entityName.equals("TwilightForest.Forest Bunny")) + { + mobTag.aspects.add(LUST, 5); + } + + else if(mobTag.entityName.equals("TwilightForest.Mini Ghast")) + { + mobTag.aspects.add(NETHER, 1).add(WRATH, 1); + } + + else if(mobTag.entityName.equals("TwilightForest.Tower Boss")) + { + mobTag.aspects.add(NETHER, 10).add(WRATH, 10); + } + + else if(mobTag.entityName.equals("TwilightForest.Tower Ghast")) + { + mobTag.aspects.add(NETHER, 3).add(WRATH, 3); + } + + else if(mobTag.entityName.equals("TwilightForest.Twilight Lich")) + { + mobTag.aspects.add(PRIDE, 10); + } + + else if(!Config.noLust && mobTag.entityName.equals("TwilightForest.Pinch Beetle")) + { + mobTag.aspects.add(LUST, 3); + } + + else if(mobTag.entityName.equals("TwilightForest.King Spider")) + { + mobTag.aspects.add(PRIDE, 4); + } + } + + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 0, (new AspectList()).add(NETHER, 1).add(WRATH, 2).add(Aspect.CRYSTAL, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 1, (new AspectList()).add(NETHER, 1).add(ENVY, 2).add(Aspect.CRYSTAL, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 2, (new AspectList()).add(Aspect.TAINT, 3).add(Aspect.CRYSTAL, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 3, (new AspectList()).add(NETHER, 1).add(PRIDE, 2).add(Aspect.CRYSTAL, 1)); + if(!Config.noLust) + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 4, (new AspectList()).add(NETHER, 1).add(LUST, 2).add(Aspect.CRYSTAL, 1)); + else + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 4, (new AspectList()).add(Aspect.VOID, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 5, (new AspectList()).add(NETHER, 1).add(SLOTH, 2).add(Aspect.CRYSTAL, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenItems.deadlyShards.itemID, 6, (new AspectList()).add(NETHER, 1).add(Aspect.GREED, 2).add(Aspect.CRYSTAL, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenItems.resource.itemID, 0, (new AspectList()).add(Aspect.CRYSTAL, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenItems.resource.itemID, 1, (new AspectList()).add(Aspect.DARKNESS, 1)); + ThaumcraftApi.registerObjectTag(ForbiddenBlocks.blackFlower.blockID, -1, (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.LIFE, 1).add(Aspect.SENSES, 1).add(Aspect.DARKNESS, 1)); + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/DarkResearchItem.java b/src/com/spiteful/forbidden/DarkResearchItem.java new file mode 100644 index 0000000..2b69fa7 --- /dev/null +++ b/src/com/spiteful/forbidden/DarkResearchItem.java @@ -0,0 +1,43 @@ +package com.spiteful.forbidden; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import thaumcraft.api.research.ResearchItem; + +public class DarkResearchItem extends ResearchItem +{ + public DarkResearchItem(String par1, String par2) + { + super(par1, par2); + } + + public DarkResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ResourceLocation icon) + { + super(par1, par2, tags, par3, par4, par5, icon); + } + + public DarkResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ItemStack icon) + { + super(par1, par2, tags, par3, par4, par5, icon); + } + + @SideOnly(Side.CLIENT) + public String getName() + { + return StatCollector.translateToLocal("forbidden.research_name." + key); + } + + @SideOnly(Side.CLIENT) + public String getText() + { + if(Config.tagResearch) + return "[FM] " + StatCollector.translateToLocal("forbidden.research_text." + key); + else + return StatCollector.translateToLocal("forbidden.research_text." + key); + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/FMEventHandler.java b/src/com/spiteful/forbidden/FMEventHandler.java new file mode 100644 index 0000000..bea0d30 --- /dev/null +++ b/src/com/spiteful/forbidden/FMEventHandler.java @@ -0,0 +1,355 @@ +package com.spiteful.forbidden; + +import com.spiteful.forbidden.items.ForbiddenItems; +import com.spiteful.forbidden.blocks.ForbiddenBlocks; +import com.spiteful.forbidden.blocks.BlockBlackFlower; +import com.spiteful.forbidden.enchantments.*; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.item.ItemSword; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.FakePlayer; +import net.minecraftforge.event.ForgeSubscribe; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; +import net.minecraftforge.event.entity.living.LivingSpawnEvent; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; +import net.minecraftforge.event.Event.Result; +import net.minecraftforge.event.entity.player.BonemealEvent; +import thaumcraft.common.entities.ITaintedMob; +import thaumcraft.common.entities.monster.EntityFireBat; +import thaumcraft.common.items.wands.ItemWandCasting; +import thaumcraft.common.lib.Utils; +import thaumcraft.api.aspects.Aspect; + +public class FMEventHandler +{ + Random randy = new Random(); + final Aspect[] primals = {Aspect.ENTROPY, Aspect.ORDER, Aspect.FIRE, Aspect.WATER, Aspect.EARTH, Aspect.AIR}; + + @ForgeSubscribe + public void onLivingDrops(LivingDropsEvent event) + { + if(Config.silverfishEmeralds && event.entityLiving instanceof EntitySilverfish){ + + if(event.entityLiving.worldObj.getBiomeGenForCoords((int)event.entityLiving.posX, (int)event.entityLiving.posZ).biomeID == + BiomeGenBase.extremeHills.biomeID){ + if(event.recentlyHit && event.source.getEntity() != null + && event.source.getEntity() instanceof EntityPlayer && randy.nextInt(30) <= (2 + event.lootingLevel * 2)) + addDrop(event, new ItemStack(ForbiddenItems.resource, 1, 0)); + } + else if(event.recentlyHit && event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer + && !(event.source.getEntity() instanceof FakePlayer) && randy.nextInt(70) <= (1 + event.lootingLevel * 3)){ + + addDrop(event, new ItemStack(ForbiddenItems.resource, 1, 0)); + } + + } + + if(Config.greedyEnch && (event.entityLiving instanceof EntityVillager || event.entityLiving instanceof IMob) && + event.recentlyHit && event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + ItemStack equip = player.getCurrentEquippedItem(); + if(equip != null && EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.greedy.effectId, equip) > 0 + && event.lootingLevel <= 0) + { + if(event.entityLiving instanceof EntityVillager) + addDrop(event, new ItemStack(Item.emerald, 1)); + else if(randy.nextInt(35) < 3) + addDrop(event, new ItemStack(ForbiddenItems.resource, 1, 0)); + } + } + + if (event.entityLiving.getClass() == EntitySkeleton.class && event.recentlyHit && event.source.getEntity() != null + && event.source.getEntity() instanceof EntityPlayer) + { + ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem(); + + if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (3 + EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap))) + { + addDrop(event, new ItemStack(Item.skull.itemID, 1, ((EntitySkeleton)event.entityLiving).getSkeletonType())); + } + } + + if (event.entityLiving.getClass() == EntityZombie.class && event.recentlyHit && event.source.getEntity() != null + && event.source.getEntity() instanceof EntityPlayer) + { + ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem(); + + if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (2 + 2 * EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap))) + { + addDrop(event, new ItemStack(Item.skull.itemID, 1, 2)); + } + } + + if (event.entityLiving.getClass() == EntityCreeper.class && event.recentlyHit && event.source.getEntity() != null + && event.source.getEntity() instanceof EntityPlayer) + { + ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem(); + + if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (2 + 2 * EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap))) + { + addDrop(event, new ItemStack(Item.skull.itemID, 1, 4)); + } + } + + if (event.entityLiving instanceof EntityPlayer && event.recentlyHit && event.source.getEntity() != null + && event.source.getEntity() instanceof EntityPlayer) + { + ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem(); + + if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(11) <= (1 + EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap))) + { + ItemStack head = new ItemStack(Item.skull.itemID, 1, 3); + NBTTagCompound nametag = new NBTTagCompound(); + nametag.setString("SkullOwner", ((EntityPlayer)event.entityLiving).username); + head.setTagInfo("SkullOwner", nametag); + addDrop(event, head); + } + } + + if (event.entityLiving.worldObj.provider.dimensionId != -1) + return; + + if (!event.recentlyHit || event.source.getEntity() == null || !(event.source.getEntity() instanceof EntityPlayer) + || event.source.getEntity() instanceof FakePlayer) + { + if (randy.nextInt(30) < 4) + { + addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1 + randy.nextInt(3), 5)); + } + } + + if (event.recentlyHit && event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer + && !(event.source.getEntity() instanceof FakePlayer)) + { + if (event.entityLiving instanceof IMob) + { + int wrath = 2; + ItemStack heldItem = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem(); + + if (heldItem != null) + { + if (heldItem.getItem() instanceof ItemTool) + { + wrath += (int)(((ItemTool)heldItem.getItem()).damageVsEntity); + } + else if (heldItem.getItem() instanceof ItemSword) + { + wrath += (int)(((ItemSword)heldItem.getItem()).func_82803_g() + 4.0F); + } + + wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.sharpness.effectId, heldItem); + wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, heldItem); + + if (!event.entityLiving.isImmuneToFire()) + { + wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, heldItem); + wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, heldItem); + } + + if (event.entityLiving.isEntityUndead()) + { + wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.smite.effectId, heldItem); + } + + if (event.entityLiving.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) + { + wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.baneOfArthropods.effectId, heldItem); + } + } + + if (randy.nextInt(61) <= wrath) + { + addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1, 0)); + } + + if(event.entityLiving instanceof IBossDisplayData){ + addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 2 + randy.nextInt(1 + event.lootingLevel), 3)); + } + } + + if (event.entityLiving instanceof EntityPigZombie && !(event.source.getEntity() instanceof FakePlayer)) + { + if (event.entityLiving.getHeldItem() != null && event.entityLiving.getHeldItem().itemID == ForbiddenItems.deadlyShards.itemID + && event.entityLiving.getHeldItem().getItemDamage() == 1) + { + addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1, 1)); + } + } + } + } + + public void addDrop(LivingDropsEvent event, ItemStack drop) + { + EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop); + entityitem.delayBeforeCanPickup = 10; + event.drops.add(entityitem); + } + + @ForgeSubscribe + public void onDeath(LivingDeathEvent event){ + if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer + && ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem() != null + && ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem().itemID == ForbiddenItems.fork.itemID){ + String name = null; + try { + name = EntityList.getEntityString(event.entityLiving); + } + catch(Exception e){ + try { + name = event.entityLiving.getEntityName(); + } + catch(Exception ee){ + return; + } + } + finally { + if(name == null) + return; + } + if(Config.spawnerMobs.containsKey(name)) + imprintCrystal((EntityPlayer)(event.source.getEntity()), name); + } + } + + public void imprintCrystal(EntityPlayer player, String mob){ + for(int x = 0; x < player.inventory.getSizeInventory(); ++x) { + ItemStack item = player.inventory.getStackInSlot(x); + if(item != null && item.itemID == ForbiddenItems.mobCrystal.itemID + && (!item.hasTagCompound() || item.getTagCompound().getTag("mob") == null)){ + NBTTagString mobTag = new NBTTagString("mob", mob); + item.setTagInfo("mob", mobTag); + return; + } + } + } + + @ForgeSubscribe + public void onHarvest(HarvestDropsEvent event) + { + EntityPlayer player = event.harvester; + if(player != null && player.inventory.getCurrentItem() != null) + { + ItemStack equip = player.inventory.getCurrentItem(); + if(equip.itemID == ForbiddenItems.taintShovel.itemID + && event.block.blockMaterial == Config.taintMaterial && !(event.block.blockID == Config.thaumcraftTaintBlockID && event.blockMetadata == 2)) + { + int fortune = EnchantmentHelper.getFortuneModifier(player); + int chance = 1 + (2 * fortune); + if(event.isSilkTouching) + chance += 6; + + if(randy.nextInt(51) <= chance) { + event.drops.add(new ItemStack(ForbiddenItems.deadlyShards, 1, 2)); + } + } + if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.cluster.effectId, equip) > 0 && EnchantmentHelper.getFortuneModifier(player) == 0){ + if(event.drops != null && event.drops.size() > 0) { + int cluster = EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.cluster.effectId, equip); + float chance = 0.2F + (float)cluster * 0.075F; + + for(int a = 0; a < event.drops.size(); ++a) + { + ItemStack is = (ItemStack)event.drops.get(a); + ItemStack smr = Utils.findSpecialMiningResult(is, chance, event.world.rand); + if(!is.isItemEqual(smr)) + { + event.drops.set(a, smr); + if(!event.world.isRemote) + { + event.world.playSoundEffect((double)((float)event.x + 0.5F), (double)((float)event.y + 0.5F), (double)((float)event.z + 0.5F), "random.orb", 0.2F, 0.7F + event.world.rand.nextFloat() * 0.2F); + } + } + } + } + } + if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.consuming.effectId, equip) > 0){ + for(int x = 0;x < event.drops.size();x++) + { + ItemStack drop = (ItemStack)event.drops.get(x); + if(drop != null && (drop.itemID == Block.cobblestone.blockID || drop.itemID == Block.dirt.blockID || drop.itemID == Block.netherrack.blockID)) + event.drops.remove(x); + } + } + } + } + + @ForgeSubscribe + public void onBonemeal(BonemealEvent event){ + if(event.ID == ForbiddenBlocks.blackFlower.blockID){ + ((BlockBlackFlower)ForbiddenBlocks.blackFlower).spreadFlowers(event.world, event.X, event.Y, event.Z, randy); + event.setResult(Result.ALLOW); + } + } + + @ForgeSubscribe + public void onSpawn(LivingSpawnEvent event){ + if(event.entityLiving.worldObj.provider.dimensionId == -1 && event.entityLiving instanceof EntityPigZombie + && randy.nextInt(175) == 1) + event.entityLiving.setCurrentItemOrArmor(0, new ItemStack(ForbiddenItems.deadlyShards, 1, 1)); + } + + @ForgeSubscribe + public void onGetHurt(LivingHurtEvent event){ + if(event.entityLiving instanceof EntityPlayer && ((EntityPlayer)event.entityLiving).getCurrentEquippedItem() != null + && ((EntityPlayer)event.entityLiving).getCurrentEquippedItem().getItem() instanceof ItemWandCasting){ + + ItemStack wand = ((EntityPlayer)event.entityLiving).getCurrentEquippedItem(); + if(event.source.getDamageType().equals("taint") && ((ItemWandCasting)wand.getItem()).getRod(wand).getTag().equals("tainted")){ + + for(int x = 0;x < 3;x++){ + ((ItemWandCasting)wand.getItem()).addVis(wand, primals[randy.nextInt(6)], 1, true); + } + + } + + if((event.source.getDamageType().equals("wither") || event.source.isFireDamage()) + && ((ItemWandCasting)wand.getItem()).getRod(wand).getTag().equals("infernal")){ + + event.setCanceled(true); + } + } + } + + @ForgeSubscribe + public void onTooltip(ItemTooltipEvent event) + { + if(!Compat.bm) + return; + if(event.itemStack.getItem() instanceof ItemWandCasting && ((ItemWandCasting)event.itemStack.getItem()).getRod(event.itemStack).getTag().equals("blood")){ + if (!event.itemStack.stackTagCompound.getString("ownerName").equals("")) + { + event.toolTip.add("Current owner: " + event.itemStack.stackTagCompound.getString("ownerName")); + } + } + } + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/FauxResearchItem.java b/src/com/spiteful/forbidden/FauxResearchItem.java new file mode 100644 index 0000000..14c2000 --- /dev/null +++ b/src/com/spiteful/forbidden/FauxResearchItem.java @@ -0,0 +1,82 @@ +package com.spiteful.forbidden; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.research.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class FauxResearchItem extends ResearchItem +{ + public ResearchItem original; + + public FauxResearchItem(String name, String cat, String origin, String originCategory, int x, int y, ResourceLocation icon) + { + super(name, cat, new AspectList(), x, y, 1, icon); + original = ((ResearchCategoryList)ResearchCategories.researchCategories.get(originCategory)).research.get(origin); + bindToOriginal(); + setStub(); + setHidden(); + } + + public FauxResearchItem(String name, String cat, String origin, String originCategory, int x, int y, ItemStack icon) + { + super(name, cat, new AspectList(), x, y, 1, icon); + original = ((ResearchCategoryList)ResearchCategories.researchCategories.get(originCategory)).research.get(origin); + bindToOriginal(); + setStub(); + setHidden(); + } + + private void bindToOriginal() + { + if(original.siblings == null) + original.setSiblings(new String[]{key}); + else + { + String[] family = original.siblings; + String[] newFamily = new String[family.length + 1]; + for(int x = 0;x < family.length;x++){ + newFamily[x] = family[x]; + } + newFamily[family.length] = key; + original.setSiblings(newFamily); + } + } + + public ResearchPage[] getPages() + { + return original.getPages(); + } + + @SideOnly(Side.CLIENT) + public String getName() + { + return original.getName(); + } + + @SideOnly(Side.CLIENT) + public String getText() + { + return original.getText(); + } + + public boolean isStub() + { + return true; + } + + public boolean isHidden() + { + return true; + } + + public int getComplexity() + { + return 1; + } + +} diff --git a/src/com/spiteful/forbidden/Forbidden.java b/src/com/spiteful/forbidden/Forbidden.java new file mode 100644 index 0000000..c834b9d --- /dev/null +++ b/src/com/spiteful/forbidden/Forbidden.java @@ -0,0 +1,81 @@ +package com.spiteful.forbidden; + +import com.spiteful.forbidden.items.ForbiddenItems; +import com.spiteful.forbidden.blocks.ForbiddenBlocks; +import com.spiteful.forbidden.enchantments.DarkEnchantments; +import com.spiteful.forbidden.client.ClientProxy; + +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.ServerStarting; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.Mod.PostInit; +import cpw.mods.fml.common.Mod.PreInit; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.NetworkMod; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import thaumcraft.api.aspects.Aspect; +import java.util.logging.Level; + +@Mod( + modid = "ForbiddenMagic", + name = "Forbidden Magic", + version = "0.2", + dependencies = "required-after:Thaumcraft;after:Natura;after:ThaumicTinkerer;after:ThaumicExplorer" +) +@NetworkMod( + clientSideRequired = true, + serverSideRequired = false + //channels = {"forbiddenmagic"}, + //packetHandler = PacketHandler.class +) +public class Forbidden +{ + @Instance("ForbiddenMagic") + public static Forbidden instance; + public static ForbiddenTab tab = new ForbiddenTab("forbidden"); + public static ForbiddenTab crysTab = new ForbiddenTab("mobcrystal", true); + @SidedProxy( + clientSide = "com.spiteful.forbidden.client.ClientProxy", + serverSide = "com.spiteful.forbidden.CommonProxy" + ) + public static CommonProxy proxy; + + @EventHandler + public void prelude(FMLPreInitializationEvent event) + { + instance = this; + Config.configurate(event.getSuggestedConfigurationFile()); + Compat.initiate(); + DarkAspects.initAspects(); + Config.spawnilify(); + ForbiddenItems.addItems(); + ForbiddenBlocks.addBlocks(); + DarkEnchantments.hex(); + proxy.registerRenderInfo(); + } + + @EventHandler + public void crescendo(FMLInitializationEvent event) + { + MinecraftForge.EVENT_BUS.register(new FMEventHandler()); + } + + @EventHandler + public void outro(FMLPostInitializationEvent event) + { + DarkAspects.addAspects(); + ForbiddenRecipes.addRecipes(); + ForbiddenResearch.addResearch(); + Compat.compatify(); + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/ForbiddenRecipes.java b/src/com/spiteful/forbidden/ForbiddenRecipes.java new file mode 100644 index 0000000..526e953 --- /dev/null +++ b/src/com/spiteful/forbidden/ForbiddenRecipes.java @@ -0,0 +1,113 @@ +package com.spiteful.forbidden; + +import com.spiteful.forbidden.items.ForbiddenItems; +import com.spiteful.forbidden.blocks.ForbiddenBlocks; +import com.spiteful.forbidden.enchantments.DarkEnchantments; + +import cpw.mods.fml.common.registry.GameRegistry; +import java.util.Arrays; +import java.util.Iterator; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagByte; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.ItemApi; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IEssentiaContainerItem; +import thaumcraft.api.wands.WandCap; +import thaumcraft.api.wands.WandRod; +import thaumcraft.api.wands.WandTriggerRegistry; +import thaumcraft.api.crafting.InfusionRecipe; +import thaumcraft.common.items.wands.ItemWandCasting; + +public class ForbiddenRecipes +{ + public static void addRecipes() + { + ForbiddenResearch.recipes.put("SkullAxe", ThaumcraftApi.addInfusionCraftingRecipe("SKULLAXE", new ItemStack(ForbiddenItems.skullAxe), 1, (new AspectList()).add(DarkAspects.WRATH, 8).add(Aspect.WEAPON, 8).add(DarkAspects.NETHER, 8), ItemApi.getItem("itemAxeThaumium", 0), new ItemStack[] {new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 0), new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 0), new ItemStack(Item.diamond), new ItemStack(Item.skull.itemID, 1, 1)})); + ForbiddenResearch.recipes.put("ArcaneCake", ThaumcraftApi.addInfusionCraftingRecipe("ARCANECAKE", new ItemStack(ForbiddenItems.arcaneCakeItem), 3, (new AspectList()).add(DarkAspects.GLUTTONY, 12).add(Aspect.HUNGER, 24).add(Aspect.CRAFT, 24), new ItemStack(Item.cake), new ItemStack[] {ItemApi.getItem("itemResource", 14), new ItemStack(Item.egg), new ItemStack(Item.bucketMilk), new ItemStack(Item.egg), new ItemStack(Item.sugar), new ItemStack(Item.sugar)})); + ForbiddenResearch.recipes.put("TaintShovel", ThaumcraftApi.addInfusionCraftingRecipe("TAINTSHOVEL", new ItemStack(ForbiddenItems.taintShovel), 5, (new AspectList()).add(Aspect.HEAL, 8).add(Aspect.CRYSTAL, 24).add(Aspect.MINE, 12), ItemApi.getItem("itemShovelThaumium", 0), new ItemStack[]{ItemApi.getItem("itemShard", 4), ItemApi.getItem("itemShard", 4), new ItemStack(Item.diamond), ItemApi.getBlock("blockMagicalLog", 1)})); + ForbiddenResearch.recipes.put("TaintPick", ThaumcraftApi.addInfusionCraftingRecipe("TAINTPICK", new ItemStack(ForbiddenItems.taintPickaxe), 1, (new AspectList()).add(Aspect.ENTROPY, 8).add(Aspect.MINE, 8).add(Aspect.TAINT, 12), ItemApi.getItem("itemPickThaumium", 0), new ItemStack[]{ItemApi.getItem("itemShard", 5), ItemApi.getItem("itemShard", 5), new ItemStack(Item.diamond), ItemApi.getBlock("blockMagicalLog", 0)})); + ForbiddenResearch.recipes.put("MorphPick", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphPickaxe), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemPickThaumium", 0), new ItemStack[]{new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(Item.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1)})); + ForbiddenResearch.recipes.put("MorphSword", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphSword), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.WEAPON, 16), ItemApi.getItem("itemSwordThaumium", 0), new ItemStack[]{new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(Item.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1)})); + ForbiddenResearch.recipes.put("MorphShovel", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphShovel), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemShovelThaumium", 0), new ItemStack[]{new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(Item.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1)})); + ForbiddenResearch.recipes.put("MorphAxe", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphAxe), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemAxeThaumium", 0), new ItemStack[]{new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(Item.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1)})); + ForbiddenResearch.recipes.put("WandRodTainted", ThaumcraftApi.addInfusionCraftingRecipe("ROD_tainted", new ItemStack(ForbiddenItems.wandCore, 1, 0), 5, (new AspectList()).add(Aspect.TAINT, 24).add(Aspect.MAGIC, 12).add(Aspect.ENTROPY, 12), ItemApi.getItem("itemResource", 12), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2)})); + ForbiddenResearch.recipes.put("WandRodInfernal", ThaumcraftApi.addInfusionCraftingRecipe("ROD_infernal", new ItemStack(ForbiddenItems.wandCore, 1, 1), 5, (new AspectList()).add(DarkAspects.NETHER, 32).add(Aspect.MAGIC, 12).add(DarkAspects.PRIDE, 12), new ItemStack(Item.blazeRod), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 3), new ItemStack(ForbiddenItems.deadlyShards, 1, 3), new ItemStack(Block.slowSand), new ItemStack(Item.skull.itemID, 1, 1), new ItemStack(Item.netherQuartz), new ItemStack(Item.blazePowder)})); + if(Config.wrathCage){ + ForbiddenResearch.recipes.put("WrathCage", ThaumcraftApi.addInfusionCraftingRecipe("WRATHCAGE", new ItemStack(ForbiddenBlocks.wrathCage, 1, 0), 10, (new AspectList()).add(DarkAspects.WRATH, 32).add(Aspect.MAGIC, 32).add(Aspect.BEAST, 32).add(Aspect.MECHANISM, 16), ItemApi.getBlock("blockCosmeticSolid", 4), new ItemStack[]{new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(Item.diamond, 1, 0), new ItemStack(Item.diamond, 1, 0), new ItemStack(Item.diamond, 1, 0), new ItemStack(Item.diamond, 1, 0), ItemApi.getBlock("blockJar", 0), ItemApi.getBlock("blockJar", 0), ItemApi.getBlock("blockJar", 0)})); + ForbiddenResearch.recipes.put("MobCrystal", ThaumcraftApi.addCrucibleRecipe("WRATHCAGE", new ItemStack(ForbiddenItems.mobCrystal, 1, 0), new ItemStack(Item.diamond, 1), (new AspectList()).merge(Aspect.MIND, 10).merge(Aspect.ENERGY, 10))); + } + + ForbiddenResearch.recipes.put("Fork", ThaumcraftApi.addInfusionCraftingRecipe("FORK", new ItemStack(ForbiddenItems.fork, 1, 0), 1, (new AspectList()).add(DarkAspects.NETHER, 8).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 8), ItemApi.getItem("itemSwordThaumium", 0), new ItemStack[]{new ItemStack(Item.netherQuartz), new ItemStack(Item.netherQuartz), new ItemStack(Item.netherQuartz), new ItemStack(Item.redstone)})); + + ForbiddenResearch.recipes.put("TransEmerald", ThaumcraftApi.addCrucibleRecipe("TRANSEMERALD", new ItemStack(ForbiddenItems.resource, 4, 0), "nuggetEmerald", (new AspectList()).merge(Aspect.CRYSTAL, 2).merge(Aspect.GREED, 2))); + ForbiddenResearch.recipes.put("BlackFlower", ThaumcraftApi.addCrucibleRecipe("BLACKFLOWER", new ItemStack(ForbiddenBlocks.blackFlower, 1, 0), new ItemStack(Block.plantRed), (new AspectList()).merge(Aspect.DARKNESS, 5).merge(Aspect.LIFE, 5))); + ForbiddenResearch.recipes.put("BlackInk", CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenItems.resource, 2, 1), new Object[]{"#", Character.valueOf('#'), new ItemStack(ForbiddenBlocks.blackFlower, 1, 0)})); + + ForbiddenResearch.recipes.put("Cluster", ThaumcraftApi.addInfusionEnchantmentRecipe("CLUSTER", DarkEnchantments.cluster, 3, (new AspectList()).add(Aspect.FIRE, 4).add(Aspect.METAL, 4).add(Aspect.GREED, 4), new ItemStack[]{ItemApi.getItem("itemPickElemental", 0), ItemApi.getItem("itemResource", 14)})); + if(Config.greedyEnch) + ForbiddenResearch.recipes.put("Greedy", ThaumcraftApi.addInfusionEnchantmentRecipe("GREEDY", DarkEnchantments.greedy, 4, (new AspectList()).add(DarkAspects.NETHER, 16).add(Aspect.WEAPON, 8).add(Aspect.GREED, 16), new ItemStack[]{new ItemStack(Item.swordGold), new ItemStack(Item.diamond), new ItemStack(Block.blockGold), ItemApi.getItem("itemResource", 14)})); + ForbiddenResearch.recipes.put("Consuming", ThaumcraftApi.addInfusionEnchantmentRecipe("CONSUMING", DarkEnchantments.consuming, 3, (new AspectList()).add(Aspect.VOID, 8).add(Aspect.TOOL, 8).add(Aspect.HUNGER, 8), new ItemStack[]{new ItemStack(Item.pickaxeIron), new ItemStack(Item.bucketLava), ItemApi.getItem("itemResource", 14)})); + ForbiddenResearch.recipes.put("Pigbane", ThaumcraftApi.addInfusionEnchantmentRecipe("PIGBANE", DarkEnchantments.pigBane, 1, (new AspectList()).add(Aspect.HUNGER, 4).add(Aspect.WEAPON, 4).add(Aspect.BEAST, 4), new ItemStack[]{new ItemStack(Item.swordIron), new ItemStack(Item.porkRaw), ItemApi.getItem("itemResource", 14)})); + + CraftingManager.getInstance().addRecipe(new ItemStack(Item.emerald, 1, 0), new Object[]{"###", "###", "###", Character.valueOf('#'), new ItemStack(ForbiddenItems.resource, 1, 0)}); + CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenItems.resource, 9, 0), new Object[]{"#", Character.valueOf('#'), new ItemStack(Item.emerald, 1, 0)}); + ThaumcraftApi.addSmeltingBonus(new ItemStack(Item.emerald), new ItemStack(ForbiddenItems.resource, 0, 0)); + + Iterator i$ = WandCap.caps.keySet().iterator(); + + while(i$.hasNext()) { + String captag = (String)i$.next(); + Iterator i$1 = WandRod.rods.keySet().iterator(); + + while(i$1.hasNext()) { + String rodtag = (String)i$1.next(); + if((rodtag.equals("tainted") || rodtag.equals("infernal") || rodtag.equals("soul")) && !rodtag.equals("mercurial") && !rodtag.equals("neutronium") && !captag.equals("orichalcum")){ + int cost = ((WandCap)WandCap.caps.get(captag)).getCraftCost() * ((WandRod)WandRod.rods.get(rodtag)).getCraftCost(); + ItemStack wand = ItemApi.getItem("itemWandCasting", cost); + ((ItemWandCasting)wand.getItem()).setCap(wand, (WandCap)WandCap.caps.get(captag)); + ((ItemWandCasting)wand.getItem()).setRod(wand, (WandRod)WandRod.rods.get(rodtag)); + String key = "WAND_" + captag + "_" + rodtag; + String res = "THAUMIUM"; + if(rodtag.equals("tainted")) + res = "ROD_tainted"; + else if(rodtag.equals("infernal")) + res = "ROD_infernal"; + else if(rodtag.equals("soul")) + res = "ROD_soul"; + ForbiddenResearch.recipes.put(key, ThaumcraftApi.addArcaneCraftingRecipe(res, wand, (new AspectList()).add(Aspect.AIR, cost).add(Aspect.ORDER, cost).add(Aspect.EARTH, cost).add(Aspect.FIRE, cost).add(Aspect.WATER, cost).add(Aspect.ENTROPY, cost), new Object[]{" C", " R ", "C ", Character.valueOf('C'), ((WandCap)WandCap.caps.get(captag)).getItem(), Character.valueOf('R'), ((WandRod)WandRod.rods.get(rodtag)).getItem()})); + } + } + } + + if(!Config.noMeddling){ + + i$ = ThaumcraftApi.getCraftingRecipes().iterator(); + + while(i$.hasNext()){ + Object recipe = i$.next(); + if(recipe instanceof InfusionRecipe){ + InfusionRecipe fuse = (InfusionRecipe)recipe; + if(fuse.getResearch().equals("FOCUSHELLBAT")){ + fuse.aspects = (new AspectList()).add(Aspect.FIRE, 25).add(DarkAspects.WRATH, 15).add(DarkAspects.NETHER, 15).add(Aspect.ENTROPY, 25); + fuse.recipeInput = new ItemStack(ForbiddenItems.deadlyShards, 1, 0); + ForbiddenResearch.recipes.put("FocusHellbat", fuse); + break; + + } + } + } + + ForbiddenResearch.recipes.put("InfernalFurnace", Arrays.asList(new Object[]{(new AspectList()).add(Aspect.FIRE, 50).add(Aspect.EARTH, 50), Integer.valueOf(3), Integer.valueOf(3), Integer.valueOf(3), Arrays.asList(new ItemStack[]{new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), ItemApi.getBlock("blockHole", 15), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.lavaMoving), new ItemStack(Block.fenceIron), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.obsidian), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick)})})); + } + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/ForbiddenResearch.java b/src/com/spiteful/forbidden/ForbiddenResearch.java new file mode 100644 index 0000000..07c7115 --- /dev/null +++ b/src/com/spiteful/forbidden/ForbiddenResearch.java @@ -0,0 +1,96 @@ +package com.spiteful.forbidden; + +import com.spiteful.forbidden.items.ForbiddenItems; +import com.spiteful.forbidden.blocks.ForbiddenBlocks; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagByte; +import net.minecraft.util.ResourceLocation; +import thaumcraft.api.ItemApi; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.crafting.CrucibleRecipe; +import thaumcraft.api.crafting.IArcaneRecipe; +import thaumcraft.api.crafting.InfusionEnchantmentRecipe; +import thaumcraft.api.crafting.InfusionRecipe; +import thaumcraft.api.nodes.NodeModifier; +import thaumcraft.api.nodes.NodeType; +import thaumcraft.api.research.ResearchCategories; +import thaumcraft.api.research.ResearchCategoryList; +import thaumcraft.api.research.ResearchItem; +import thaumcraft.api.research.ResearchPage; + +public class ForbiddenResearch +{ + public static HashMap recipes = new HashMap(); + + public static void addResearch() + { + addInfernalism(); + + (new DarkResearchItem("TAINTSHOVEL", "ARTIFICE", (new AspectList()).add(Aspect.CRYSTAL, 1).add(Aspect.TAINT, 2).add(Aspect.TOOL, 1), -9, 6, 4, new ItemStack(ForbiddenItems.taintShovel))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.TAINTSHOVEL.1"), new ResearchPage((InfusionRecipe)recipes.get("TaintShovel")), new ResearchPage("forbidden.research_page.TAINTSHOVEL.2")}).setParentsHidden(new String[]{"THAUMIUM", "INFUSION", "ETHEREALBLOOM"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("TAINTPICK", "ARTIFICE", (new AspectList()).add(Aspect.TOOL, 1).add(Aspect.TAINT, 2).add(Aspect.ENTROPY, 1), -9, 3, 3, new ItemStack(ForbiddenItems.taintPickaxe))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.TAINTPICK.1"), new ResearchPage((InfusionRecipe)recipes.get("TaintPick"))}).setParentsHidden(new String[]{"THAUMIUM", "INFUSION"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("ROD_tainted", "THAUMATURGY", (new AspectList()).add(Aspect.MAGIC, 1).add(Aspect.TAINT, 2).add(Aspect.TOOL, 1), -3, 7, 4, new ItemStack(ForbiddenItems.wandCore, 1, 0))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.ROD_tainted.1"), new ResearchPage((InfusionRecipe)recipes.get("WandRodTainted"))}).setParents(new String[]{"ROD_silverwood", "TAINTSHOVEL"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("TRANSEMERALD", "ALCHEMY", (new AspectList()).add(Aspect.CRYSTAL, 1).add(Aspect.EXCHANGE, 1).add(Aspect.GREED, 2), -6, 3, 3, new ItemStack(ForbiddenItems.resource, 1, 0))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.TRANSEMERALD.1"), new ResearchPage((CrucibleRecipe)recipes.get("TransEmerald"))}).setConcealed().setParents(new String[]{"TRANSGOLD"}).registerResearchItem(); + (new DarkResearchItem("BLACKFLOWER", "ALCHEMY", (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.SENSES, 1).add(Aspect.DARKNESS, 2), -4, -1, 3, new ItemStack(ForbiddenBlocks.blackFlower, 1, 0))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.BLACKFLOWER.1"), new ResearchPage((CrucibleRecipe)recipes.get("BlackFlower")), new ResearchPage((IRecipe)recipes.get("BlackInk"))}).setParents(new String[]{"CRUCIBLE"}).registerResearchItem(); + + if(Compat.tt) + { + (new DarkResearchItem("CONSUMING", "TT_ENCHANTING", (new AspectList()).add(Aspect.VOID, 2).add(Aspect.ENTROPY, 1).add(Aspect.MAGIC, 1), -6, -4, 3, new ResourceLocation("forbidden", "textures/misc/consuming.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.CONSUMING.1"), new ResearchPage((InfusionEnchantmentRecipe)recipes.get("Consuming"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("PIGBANE", "TT_ENCHANTING", (new AspectList()).add(Aspect.HUNGER, 2).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), -6, -2, 2, new ResourceLocation("forbidden", "textures/misc/pigbane.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.PIGBANE.1"), new ResearchPage((InfusionEnchantmentRecipe)recipes.get("Pigbane"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setConcealed().registerResearchItem(); + } + else + { + (new DarkResearchItem("CONSUMING", "ARTIFICE", (new AspectList()).add(Aspect.VOID, 2).add(Aspect.ENTROPY, 1).add(Aspect.MAGIC, 1), -8, 11, 3, new ResourceLocation("forbidden", "textures/misc/consuming.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.CONSUMING.1"), new ResearchPage((InfusionEnchantmentRecipe)recipes.get("Consuming"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("PIGBANE", "ARTIFICE", (new AspectList()).add(Aspect.HUNGER, 2).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), -8, 13, 2, new ResourceLocation("forbidden", "textures/misc/pigbane.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.PIGBANE.1"), new ResearchPage((InfusionEnchantmentRecipe)recipes.get("Pigbane"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setConcealed().registerResearchItem(); + } + + + } + + public static void addInfernalism() + { + ResearchCategories.registerCategory("INFERNALISM", new ResourceLocation("forbidden", "textures/misc/infernalism.png"), new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png")); + (new FauxResearchItem("INFAUXSION", "INFERNALISM", "INFUSION", "ARTIFICE", -5, 0, ItemApi.getBlock("blockStoneDevice", 2))).registerResearchItem(); + if(!Compat.tt) + (new FauxResearchItem("INFAUXSIONENCHANTMENT", "INFERNALISM", "INFUSIONENCHANTMENT", "ARTIFICE", -3, 3, new ResourceLocation("thaumcraft", "textures/misc/r_enchant.png"))).setParents(new String[]{"INFAUXSION"}).registerResearchItem(); + else + (new FauxResearchItem("INFAUXSIONENCHANTMENT", "INFERNALISM", "INFUSIONENCHANTMENT", "TT_ENCHANTING", -3, 3, new ResourceLocation("thaumcraft", "textures/misc/r_enchant.png"))).setParents(new String[]{"INFAUXSION"}).registerResearchItem(); + + if(!Config.noLust) + (new DarkResearchItem("NETHERSHARDS", "INFERNALISM", new AspectList(), 0, 0, 0, new ItemStack(ForbiddenItems.deadlyShards, 1, 0))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.NETHERSHARDS.1"), new ResearchPage("forbidden.research_page.NETHERSHARDS.2"), new ResearchPage("forbidden.research_page.NETHERSHARDS.3")}).setStub().setRound().setAutoUnlock().registerResearchItem(); + else + (new DarkResearchItem("NETHERSHARDS", "INFERNALISM", new AspectList(), 0, 0, 0, new ItemStack(ForbiddenItems.deadlyShards, 1, 0))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.NETHERSHARDS.1"), new ResearchPage("forbidden.research_page.NETHERSHARDS.2b"), new ResearchPage("forbidden.research_page.NETHERSHARDS.3")}).setStub().setRound().setAutoUnlock().registerResearchItem(); + + (new DarkResearchItem("SKULLAXE", "INFERNALISM", (new AspectList()).add(Aspect.WEAPON, 1).add(DarkAspects.WRATH, 2).add(DarkAspects.NETHER, 1), -8, -2, 4, new ItemStack(ForbiddenItems.skullAxe))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.SKULLAXE.1"), new ResearchPage((InfusionRecipe)recipes.get("SkullAxe"))}).setParents(new String[] {"THAUMIUM", "INFAUXSION"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("ARCANECAKE", "INFERNALISM", (new AspectList()).add(DarkAspects.GLUTTONY, 2).add(Aspect.HUNGER, 1).add(Aspect.CRAFT, 1), -8, 1, 3, new ItemStack(ForbiddenItems.arcaneCakeItem))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.ARCANECAKE.1"), new ResearchPage((InfusionRecipe)recipes.get("ArcaneCake"))}).setParents(new String[] {"INFAUXSION"}).setHidden().registerResearchItem(); + (new DarkResearchItem("MORPHTOOLS", "INFERNALISM", (new AspectList()).add(Aspect.TOOL, 2).add(DarkAspects.ENVY, 3).add(Aspect.EXCHANGE, 2), -5, 5, 5, new ItemStack(ForbiddenItems.morphPickaxe))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.MORPHTOOLS.1"), new ResearchPage((InfusionRecipe)recipes.get("MorphPick")), new ResearchPage((InfusionRecipe)recipes.get("MorphSword")), new ResearchPage((InfusionRecipe)recipes.get("MorphShovel")), new ResearchPage((InfusionRecipe)recipes.get("MorphAxe"))}).setParentsHidden(new String[]{"THAUMIUM", "INFUSIONENCHANTMENT"}).setParents(new String[]{"INFAUXSIONENCHANTMENT"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("ROD_infernal", "INFERNALISM", (new AspectList()).add(DarkAspects.NETHER, 2).add(Aspect.FIRE, 1).add(Aspect.TOOL, 1), -8, 0, 5, new ItemStack(ForbiddenItems.wandCore, 1, 1))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.ROD_infernal.1"), new ResearchPage((InfusionRecipe)recipes.get("WandRodInfernal")), new ResearchPage("forbidden.research_page.ROD_infernal.2")}).setParents(new String[]{"ROD_silverwood", "INFAUXSION"}).setConcealed().registerResearchItem(); + (new DarkResearchItem("CLUSTER", "INFERNALISM", (new AspectList()).add(Aspect.METAL, 1).add(Aspect.FIRE, 2).add(DarkAspects.ENVY, 1), -7, 7, 3, new ResourceLocation("forbidden", "textures/misc/lucrative.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.CLUSTER.1"), new ResearchPage((InfusionEnchantmentRecipe)recipes.get("Cluster"))}).setParents(new String[]{"MORPHTOOLS", "ELEMENTALPICK"}).setConcealed().registerResearchItem(); + if(Config.greedyEnch) + (new DarkResearchItem("GREEDY", "INFERNALISM", (new AspectList()).add(Aspect.MAGIC, 1).add(Aspect.WEAPON, 1).add(Aspect.GREED, 2), -5, 3, 4, new ResourceLocation("forbidden", "textures/misc/greedy.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.GREEDY.1"), new ResearchPage((InfusionEnchantmentRecipe)recipes.get("Greedy"))}).setParents(new String[]{"INFAUXSIONENCHANTMENT"}).setConcealed().registerResearchItem(); + + if(Config.wrathCage){ + if(Config.wrathCost > 0) + (new DarkResearchItem("WRATHCAGE", "INFERNALISM", (new AspectList()).add(DarkAspects.WRATH, 2).add(Aspect.MECHANISM, 1).add(Aspect.BEAST, 1), -3, 0, 6, new ItemStack(ForbiddenBlocks.wrathCage))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.WRATHCAGE.1"), new ResearchPage((InfusionRecipe)recipes.get("WrathCage")), new ResearchPage("forbidden.research_page.WRATHCAGE.2"), new ResearchPage("forbidden.research_page.WRATHCAGE.3"), new ResearchPage((CrucibleRecipe)recipes.get("MobCrystal"))}).setParents(new String[]{"INFAUXSION"}).setParentsHidden(new String[]{"THAUMIUM"}).setSiblings(new String[]{"FORK"}).setHidden().registerResearchItem(); + else + (new DarkResearchItem("WRATHCAGE", "INFERNALISM", (new AspectList()).add(DarkAspects.WRATH, 2).add(Aspect.MECHANISM, 1).add(Aspect.BEAST, 1), -3, 0, 6, new ItemStack(ForbiddenBlocks.wrathCage))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.WRATHCAGE.1"), new ResearchPage((InfusionRecipe)recipes.get("WrathCage")), new ResearchPage("forbidden.research_page.WRATHCAGE.3"), new ResearchPage((CrucibleRecipe)recipes.get("MobCrystal"))}).setParents(new String[]{"INFAUXSION"}).setParentsHidden(new String[]{"THAUMIUM"}).setSiblings(new String[]{"FORK"}).setHidden().registerResearchItem(); + + } + + (new DarkResearchItem("FORK", "INFERNALISM", (new AspectList()), -1, 2, 0, new ItemStack(ForbiddenItems.fork))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.FORK.1"), new ResearchPage((InfusionRecipe)recipes.get("Fork")), new ResearchPage("WRATHCAGE", "forbidden.research_page.FORK.wc")}).setStub().setHidden().registerResearchItem(); + + if(!Config.noMeddling){ + ((ResearchCategoryList)ResearchCategories.researchCategories.get("THAUMATURGY")).research.remove("FOCUSHELLBAT"); + (new ResearchItem("FOCUSHELLBAT", "INFERNALISM", (new AspectList()).add(Aspect.TRAVEL, 1).add(DarkAspects.NETHER, 2).add(Aspect.FIRE, 1).add(DarkAspects.WRATH, 1), -8, -1, 4, ItemApi.getItem("itemFocusHellbat", 0))).setPages(new ResearchPage[]{new ResearchPage("tc.research_page.FOCUSHELLBAT.1"), new ResearchPage((InfusionRecipe)recipes.get("FocusHellbat"))}).setConcealed().setParents(new String[]{"FOCUSTRADE", "INFAUXSION"}).registerResearchItem(); + ((ResearchCategoryList)ResearchCategories.researchCategories.get("ARTIFICE")).research.remove("INFERNALFURNACE"); + (new ResearchItem("INFERNALFURNACE", "INFERNALISM", (new AspectList()).add(Aspect.FIRE, 2).add(DarkAspects.NETHER, 1).add(Aspect.CRAFT, 1).add(Aspect.AURA, 1), -1, -2, 4, new ResourceLocation("thaumcraft", "textures/misc/r_infernalfurnace.png"))).setPages(new ResearchPage[]{new ResearchPage("tc.research_page.INFERNALFURNACE.1"), new ResearchPage((List)recipes.get("InfernalFurnace")), new ResearchPage("tc.research_page.INFERNALFURNACE.2")}).setParents(new String[]{"NITOR", "ALUMENTUM"}).setConcealed().registerResearchItem(); + } + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/ForbiddenTab.java b/src/com/spiteful/forbidden/ForbiddenTab.java new file mode 100644 index 0000000..50da187 --- /dev/null +++ b/src/com/spiteful/forbidden/ForbiddenTab.java @@ -0,0 +1,32 @@ +package com.spiteful.forbidden; + +import com.spiteful.forbidden.items.ForbiddenItems; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.creativetab.CreativeTabs; + +public final class ForbiddenTab extends CreativeTabs +{ + private boolean crystal = false; + + public ForbiddenTab(String tabName) + { + super(tabName); + } + + public ForbiddenTab(String tabName, boolean mobCrystal) + { + super(tabName); + crystal = mobCrystal; + } + + @SideOnly(Side.CLIENT) + public int getTabIconItemIndex() + { + if(!crystal) + return ForbiddenItems.fork.itemID; + else + return ForbiddenItems.mobCrystal.itemID; + } +} diff --git a/src/com/spiteful/forbidden/blocks/BlockArcaneCake.java b/src/com/spiteful/forbidden/blocks/BlockArcaneCake.java new file mode 100644 index 0000000..0fd0e32 --- /dev/null +++ b/src/com/spiteful/forbidden/blocks/BlockArcaneCake.java @@ -0,0 +1,232 @@ +package com.spiteful.forbidden.blocks; + +import com.spiteful.forbidden.items.ForbiddenItems; + +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.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Icon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockArcaneCake extends Block +{ + @SideOnly(Side.CLIENT) + private Icon cakeTopIcon; + @SideOnly(Side.CLIENT) + private Icon cakeBottomIcon; + @SideOnly(Side.CLIENT) + private Icon cakeInsideIcon; + + protected BlockArcaneCake(int par1) + { + super(par1, Material.cake); + this.setTickRandomly(true); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + float f = 0.0625F; + float f1 = (float)(1 + l) / 12.0F; + this.setBlockBounds(f1, 0.0F, f, 1.0F - f, 0.5F, 1.0F - f); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float f = 0.0625F; + float f1 = 0.5F; + this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + int l = par1World.getBlockMetadata(par2, par3, par4); + float f = 0.0625F; + float f1 = (float)(1 + l) / 12.0F; + float f2 = 0.5F; + return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f1), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)par3 + f2 - f), (double)((float)(par4 + 1) - f)); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + @SideOnly(Side.CLIENT) + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + int l = par1World.getBlockMetadata(par2, par3, par4); + float f = 0.0625F; + float f1 = (float)(1 + l) / 12.0F; + float f2 = 0.5F; + return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f1), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)par3 + f2), (double)((float)(par4 + 1) - f)); + } + + @SideOnly(Side.CLIENT) + + /** + * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata + */ + public Icon getIcon(int par1, int par2) + { + return par1 == 1 ? this.cakeTopIcon : (par1 == 0 ? this.cakeBottomIcon : (par2 > 0 && par1 == 4 ? this.cakeInsideIcon : this.blockIcon)); + } + + @SideOnly(Side.CLIENT) + + /** + * When this method is called, your block should register all the icons it needs with the given IconRegister. This + * is the only chance you get to register icons. + */ + public void registerIcons(IconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon("forbidden:cake_side"); + this.cakeInsideIcon = par1IconRegister.registerIcon("forbidden:cake_inner"); + this.cakeTopIcon = par1IconRegister.registerIcon("forbidden:cake_top"); + this.cakeBottomIcon = par1IconRegister.registerIcon("forbidden:cake_bottom"); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer); + return true; + } + + /** + * Called when the block is clicked by a player. Args: x, y, z, entityPlayer + */ + public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) + { + this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer); + } + + /** + * Heals the player and removes a slice from the cake. + */ + private void eatCakeSlice(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) + { + if (par5EntityPlayer.canEat(false)) + { + par5EntityPlayer.getFoodStats().addStats(2, 3.0F); + int l = par1World.getBlockMetadata(par2, par3, par4) + 1; + + if (l >= 12) + { + par1World.setBlockToAir(par2, par3, par4); + } + else + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2); + } + + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + super.updateTick(par1World, par2, par3, par4, par5Random); + int l = par1World.getBlockMetadata(par2, par3, par4); + + if (l > 0) + { + //if (par5Random.nextInt((int)(25.0F / f) + 1) == 0) + //{ + --l; + par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2); + //} + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + { + return !super.canPlaceBlockAt(par1World, par2, par3, par4) ? false : this.canBlockStay(par1World, par2, par3, par4); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor blockID + */ + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) + { + if (!this.canBlockStay(par1World, par2, par3, par4)) + { + par1World.setBlockToAir(par2, par3, par4); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World par1World, int par2, int par3, int par4) + { + return par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid(); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 0; + } + + /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return 0; + } + + @SideOnly(Side.CLIENT) + + /** + * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) + */ + public int idPicked(World par1World, int par2, int par3, int par4) + { + return ForbiddenItems.arcaneCakeItem.itemID; + } +} diff --git a/src/com/spiteful/forbidden/blocks/BlockBlackFlower.java b/src/com/spiteful/forbidden/blocks/BlockBlackFlower.java new file mode 100644 index 0000000..c64a18a --- /dev/null +++ b/src/com/spiteful/forbidden/blocks/BlockBlackFlower.java @@ -0,0 +1,109 @@ +package com.spiteful.forbidden.blocks; + +import com.spiteful.forbidden.Forbidden; + +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.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.world.World; + +import net.minecraftforge.common.ForgeDirection; + +public class BlockBlackFlower extends BlockFlower +{ + protected BlockBlackFlower(int par1) + { + super(par1); + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setTickRandomly(true); + this.setCreativeTab(Forbidden.tab); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!par1World.isRemote && par5Random.nextInt(16) == 1) + spreadFlowers(par1World, par2, par3, par4, par5Random); + } + + public void spreadFlowers(World par1World, int par2, int par3, int par4, Random par5Random){ + int l = 15; + int i1; + int j1; + int k1; + + for (i1 = par2 - 2; i1 <= par2 + 2; ++i1) + { + for (j1 = par4 - 2; j1 <= par4 + 2; ++j1) + { + for (k1 = par3 - 1; k1 <= par3 + 1; ++k1) + { + if (par1World.getBlockId(i1, k1, j1) == this.blockID) + { + --l; + + if (l <= 0) + { + return; + } + } + } + } + } + + i1 = par2 + par5Random.nextInt(3) - 1; + j1 = par3 + par5Random.nextInt(2) - par5Random.nextInt(2); + k1 = par4 + par5Random.nextInt(3) - 1; + + for (int l1 = 0; l1 < 4; ++l1) + { + if (par1World.isAirBlock(i1, j1, k1) && this.canBlockStay(par1World, i1, j1, k1)) + { + par2 = i1; + par3 = j1; + par4 = k1; + } + + i1 = par2 + par5Random.nextInt(3) - 1; + j1 = par3 + par5Random.nextInt(2) - par5Random.nextInt(2); + k1 = par4 + par5Random.nextInt(3) - 1; + } + + if (par1World.isAirBlock(i1, j1, k1) && this.canBlockStay(par1World, i1, j1, k1)) + { + par1World.setBlock(i1, j1, k1, this.blockID, 0, 2); + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + { + return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canBlockStay(par1World, par2, par3, par4); + } + + /** + * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of + * blockID passed in. Args: blockID + */ + protected boolean canThisPlantGrowOnThisBlockID(int par1) + { + return Block.opaqueCubeLookup[par1]; + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World par1World, int par2, int par3, int par4) + { + int l = par1World.getBlockId(par2, par3 - 1, par4); + return (l == Block.dirt.blockID || l == Block.grass.blockID); + } +} diff --git a/src/com/spiteful/forbidden/blocks/BlockWrathCage.java b/src/com/spiteful/forbidden/blocks/BlockWrathCage.java new file mode 100644 index 0000000..a31c035 --- /dev/null +++ b/src/com/spiteful/forbidden/blocks/BlockWrathCage.java @@ -0,0 +1,148 @@ +package com.spiteful.forbidden.blocks; + +import com.spiteful.forbidden.tiles.TileEntityWrathCage; +import com.spiteful.forbidden.items.ForbiddenItems; +import com.spiteful.forbidden.Forbidden; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.world.World; + +public class BlockWrathCage extends BlockContainer +{ + protected BlockWrathCage(int par1) + { + super(par1, Material.iron); + this.setCreativeTab(Forbidden.tab); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World par1World) + { + return new TileEntityWrathCage(); + } + + /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return blockID; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 1; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) + { + super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); + int j1 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); + this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) + { + ItemStack held = player.getCurrentEquippedItem(); + if(held != null && held.itemID == ForbiddenItems.mobCrystal.itemID){ + NBTTagCompound nbttagcompound = held.getTagCompound(); + NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob"); + + if (nbttagstring != null) + { + if(!par1World.isRemote){ + TileEntityWrathCage spawner = (TileEntityWrathCage)par1World.getBlockTileEntity(x, y, z); + String mob = null; + ItemStack crystal = null; + if(spawner.getSpawnerLogic().isMobSet()){ + mob = spawner.getSpawnerLogic().getEntityNameToSpawn(); + crystal = new ItemStack(ForbiddenItems.mobCrystal, 1); + NBTTagString mobTag = new NBTTagString("mob", mob); + crystal.setTagInfo("mob", mobTag); + } + spawner.getSpawnerLogic().setMobID(nbttagstring.toString()); + spawner.getSpawnerLogic().mobIsSet(true); + spawner.checkAspect(); + par1World.markBlockForUpdate(x, y, z); + player.setCurrentItemOrArmor(0, crystal); + } + player.swingItem(); + return true; + } + } + return false; + } + + /** + * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a + * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old + * metadata + */ + public void breakBlock(World par1World, int x, int y, int z, int par5, int par6) + { + TileEntityWrathCage spawner = (TileEntityWrathCage)par1World.getBlockTileEntity(x, y, z); + + if (spawner != null && spawner.getSpawnerLogic().isMobSet()) + { + float f = par1World.rand.nextFloat() * 0.8F + 0.1F; + float f1 = par1World.rand.nextFloat() * 0.8F + 0.1F; + float f2 = par1World.rand.nextFloat() * 0.8F + 0.1F; + + ItemStack crystal = new ItemStack(ForbiddenItems.mobCrystal, 1); + String mob = spawner.getSpawnerLogic().getEntityNameToSpawn(); + NBTTagString mobTag = new NBTTagString("mob", mob); + crystal.setTagInfo("mob", mobTag); + + EntityItem entityitem = new EntityItem(par1World, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), crystal); + + entityitem.motionX = (double)((float)par1World.rand.nextGaussian() * 0.05F); + entityitem.motionY = (double)((float)par1World.rand.nextGaussian() * 0.05F + 0.2F); + entityitem.motionZ = (double)((float)par1World.rand.nextGaussian() * 0.05F); + par1World.spawnEntityInWorld(entityitem); + + } + + super.breakBlock(par1World, x, y, z, par5, par6); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + @SideOnly(Side.CLIENT) + + /** + * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) + */ + public int idPicked(World par1World, int par2, int par3, int par4) + { + return blockID; + } +} diff --git a/src/com/spiteful/forbidden/blocks/ForbiddenBlocks.java b/src/com/spiteful/forbidden/blocks/ForbiddenBlocks.java new file mode 100644 index 0000000..ce906a3 --- /dev/null +++ b/src/com/spiteful/forbidden/blocks/ForbiddenBlocks.java @@ -0,0 +1,32 @@ +package com.spiteful.forbidden.blocks; + +import com.spiteful.forbidden.*; +import com.spiteful.forbidden.tiles.*; + +import cpw.mods.fml.common.registry.GameRegistry; +import java.util.Arrays; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.block.Block; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.aspects.Aspect; + +public class ForbiddenBlocks +{ + public static Block arcaneCake; + public static Block blackFlower; + public static Block wrathCage; + + public static void addBlocks() + { + arcaneCake = new BlockArcaneCake(Config.arcaneCakeBlockID).setHardness(0.5F).setStepSound(Block.soundClothFootstep).setUnlocalizedName("ArcaneCake"); + GameRegistry.registerBlock(arcaneCake, "ArcaneCake"); + blackFlower = new BlockBlackFlower(Config.blackFlowerBlockID).setStepSound(Block.soundGrassFootstep).setTextureName("forbidden:flower_black").setUnlocalizedName("InkFlower"); + GameRegistry.registerBlock(blackFlower, "InkFlower"); + wrathCage = new BlockWrathCage(Config.wrathCageID).setHardness(5.0F).setResistance(2000.0F).setStepSound(Block.soundMetalFootstep).setTextureName("forbidden:spirit_box").setUnlocalizedName("WrathCage"); + GameRegistry.registerBlock(wrathCage, "WrathCage"); + GameRegistry.registerTileEntity(TileEntityWrathCage.class, "WrathCage"); + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/client/ClientProxy.java b/src/com/spiteful/forbidden/client/ClientProxy.java new file mode 100644 index 0000000..8f1c8b9 --- /dev/null +++ b/src/com/spiteful/forbidden/client/ClientProxy.java @@ -0,0 +1,18 @@ +package com.spiteful.forbidden.client; + +import com.spiteful.forbidden.*; +import com.spiteful.forbidden.tiles.*; + +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; + +public class ClientProxy extends CommonProxy { + + @Override + public void registerRenderInfo(){ + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWrathCage.class, new TileEntityWrathCageRenderer()); + } + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/client/TileEntityWrathCageRenderer.java b/src/com/spiteful/forbidden/client/TileEntityWrathCageRenderer.java new file mode 100644 index 0000000..af7a168 --- /dev/null +++ b/src/com/spiteful/forbidden/client/TileEntityWrathCageRenderer.java @@ -0,0 +1,56 @@ +package com.spiteful.forbidden.client; + +import com.spiteful.forbidden.tiles.TileEntityWrathCage; +import com.spiteful.forbidden.tiles.WrathSpawnerLogic; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class TileEntityWrathCageRenderer extends TileEntitySpecialRenderer +{ + public void renderTileEntityWrathCage(TileEntityWrathCage wrathCage, double par2, double par4, double par6, float par8) + { + if(!wrathCage.getSpawnerLogic().isMobSet()) + return; + GL11.glPushMatrix(); + GL11.glTranslatef((float)par2 + 0.5F, (float)par4, (float)par6 + 0.5F); + renderMob(wrathCage.getSpawnerLogic(), par2, par4, par6, par8); + GL11.glPopMatrix(); + } + + public static void renderMob(WrathSpawnerLogic spawnLogic, double par1, double par3, double par5, float par7) + { + Entity entity = spawnLogic.getEntityForRender(); + + if (entity != null) + { + entity.setWorld(spawnLogic.getSpawnerWorld()); + float f1 = 0.4375F; + if(spawnLogic.getEntityNameToSpawn().equals("Ghast")) + f1 = 0.1F; + else if(spawnLogic.getEntityNameToSpawn().equals("Slime") || spawnLogic.getEntityNameToSpawn().equals("ThaumSlime")) + f1 = 0.4F; + else if(spawnLogic.getEntityNameToSpawn().equals("Enderman")) + f1 = 0.3F; + GL11.glTranslatef(0.0F, 0.4F, 0.0F); + if(!spawnLogic.getSpawnerWorld().isBlockIndirectlyGettingPowered(spawnLogic.getSpawnerX(), spawnLogic.getSpawnerY(), spawnLogic.getSpawnerZ())) + GL11.glRotatef((float)(spawnLogic.field_98284_d + (spawnLogic.field_98287_c - spawnLogic.field_98284_d) * (double)par7) * 10.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.4F, 0.0F); + GL11.glScalef(f1, f1, f1); + entity.setLocationAndAngles(par1, par3, par5, 0.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, par7); + } + } + + public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) + { + this.renderTileEntityWrathCage((TileEntityWrathCage)par1TileEntity, par2, par4, par6, par8); + } +} diff --git a/src/com/spiteful/forbidden/enchantments/DarkEnchantments.java b/src/com/spiteful/forbidden/enchantments/DarkEnchantments.java new file mode 100644 index 0000000..e4248f6 --- /dev/null +++ b/src/com/spiteful/forbidden/enchantments/DarkEnchantments.java @@ -0,0 +1,29 @@ +package com.spiteful.forbidden.enchantments; + +import com.spiteful.forbidden.*; + +import net.minecraft.enchantment.Enchantment; +import net.minecraftforge.common.MinecraftForge; +//import vazkii.tinkerer.common.enchantment.core.*; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; + +public class DarkEnchantments +{ + public static Enchantment cluster; + public static Enchantment pigBane; + public static Enchantment greedy; + public static Enchantment consuming; + + public static void hex() + { + cluster = new EnchantmentCluster(Config.clusterEnchID); + pigBane = new EnchantmentPigBane(Config.pigBaneEnchID); + greedy = new EnchantmentGreedy(Config.greedyEnchID); + consuming = new EnchantmentConsuming(Config.consumingEnchID); + + //EnchantmentManager.registerExponentialCostData(pigBane, "forbidden:textures/misc/pigbane.png", false, (new AspectList()).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), "PIGBANE"); + //EnchantmentManager.registerExponentialCostData(cluster, "forbidden:textures/misc/lucrative.png", false, (new AspectList()).add(Aspect.FIRE, 5).add(Aspect.EARTH, 5).add(Aspect.ORDER, 5), "CLUSTER"); + } + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/enchantments/EnchantmentCluster.java b/src/com/spiteful/forbidden/enchantments/EnchantmentCluster.java new file mode 100644 index 0000000..a5e0599 --- /dev/null +++ b/src/com/spiteful/forbidden/enchantments/EnchantmentCluster.java @@ -0,0 +1,58 @@ +package com.spiteful.forbidden.enchantments; + +import com.spiteful.forbidden.*; +import com.spiteful.forbidden.items.ItemMorphPickaxe; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.item.ItemStack; + +public class EnchantmentCluster extends Enchantment +{ + public EnchantmentCluster(int id) + { + super(id, 0, EnumEnchantmentType.digger); + setName("cluster"); + } + + @Override + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 4; + } + + @Override + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment ench) + { + return super.canApplyTogether(ench) && ench.effectId != Enchantment.fortune.effectId; + } + + @Override + public boolean canApply(ItemStack item) + { + if(item.getItem() instanceof ItemMorphPickaxe) + return true; + else + return false; + } + + @Override + /** + * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} + * applies for all possible enchantments. + * @param stack + * @return + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { + return false; + } + + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/enchantments/EnchantmentConsuming.java b/src/com/spiteful/forbidden/enchantments/EnchantmentConsuming.java new file mode 100644 index 0000000..ac33a4f --- /dev/null +++ b/src/com/spiteful/forbidden/enchantments/EnchantmentConsuming.java @@ -0,0 +1,59 @@ +package com.spiteful.forbidden.enchantments; + +import com.spiteful.forbidden.*; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; + +public class EnchantmentConsuming extends Enchantment +{ + public EnchantmentConsuming(int id) + { + super(id, 0, EnumEnchantmentType.digger); + setName("consuming"); + } + + @Override + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } + + @Override + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment ench) + { + return super.canApplyTogether(ench) && ench.effectId != Enchantment.silkTouch.effectId; + } + + @Override + public boolean canApply(ItemStack item) + { + if(item.getItem() instanceof ItemPickaxe || item.getItem() instanceof ItemSpade) + return true; + else + return false; + } + + @Override + /** + * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} + * applies for all possible enchantments. + * @param stack + * @return + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { + return false; + } + + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/enchantments/EnchantmentEducational.java b/src/com/spiteful/forbidden/enchantments/EnchantmentEducational.java new file mode 100644 index 0000000..47821fb --- /dev/null +++ b/src/com/spiteful/forbidden/enchantments/EnchantmentEducational.java @@ -0,0 +1,65 @@ +package com.spiteful.forbidden.enchantments; + +import com.spiteful.forbidden.*; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.item.ItemStack; + +public class EnchantmentEducational extends Enchantment +{ + public EnchantmentEducational(int id) + { + super(id, 0, EnumEnchantmentType.weapon); + setName("educational"); + } + + @Override + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int par1) + { + return 15; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int par1) + { + return super.getMinEnchantability(par1) + 50; + } + + @Override + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment ench) + { + return super.canApplyTogether(ench) && ench.effectId != Enchantment.looting.effectId; + } + + @Override + /** + * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} + * applies for all possible enchantments. + * @param stack + * @return + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { + return false; + } + + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/enchantments/EnchantmentGreedy.java b/src/com/spiteful/forbidden/enchantments/EnchantmentGreedy.java new file mode 100644 index 0000000..3e96f9a --- /dev/null +++ b/src/com/spiteful/forbidden/enchantments/EnchantmentGreedy.java @@ -0,0 +1,65 @@ +package com.spiteful.forbidden.enchantments; + +import com.spiteful.forbidden.*; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.item.ItemStack; + +public class EnchantmentGreedy extends Enchantment +{ + public EnchantmentGreedy(int id) + { + super(id, 0, EnumEnchantmentType.weapon); + setName("greedy"); + } + + @Override + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int par1) + { + return 20; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int par1) + { + return super.getMinEnchantability(par1) + 50; + } + + @Override + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment ench) + { + return super.canApplyTogether(ench) && ench.effectId != Enchantment.looting.effectId; + } + + @Override + /** + * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} + * applies for all possible enchantments. + * @param stack + * @return + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { + return false; + } + + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/enchantments/EnchantmentPigBane.java b/src/com/spiteful/forbidden/enchantments/EnchantmentPigBane.java new file mode 100644 index 0000000..e00ec13 --- /dev/null +++ b/src/com/spiteful/forbidden/enchantments/EnchantmentPigBane.java @@ -0,0 +1,78 @@ +package com.spiteful.forbidden.enchantments; + +import com.spiteful.forbidden.*; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.item.ItemStack; + +public class EnchantmentPigBane extends Enchantment +{ + public EnchantmentPigBane(int id) + { + super(id, 0, EnumEnchantmentType.weapon); + setName("pigbane"); + } + + @Override + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 5; + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int par1) + { + return 1 + (par1 - 1) * 8; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int par1) + { + return this.getMinEnchantability(par1) + 20; + } + + @Override + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment ench) + { + return super.canApplyTogether(ench) && ench.effectId != Enchantment.sharpness.effectId && ench.effectId != Enchantment.smite.effectId && ench.effectId != Enchantment.baneOfArthropods.effectId; + } + + /** + * Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed. + */ + public float calcModifierLiving(int level, EntityLivingBase victim) + { + if(victim instanceof EntityPig || victim instanceof EntityPigZombie) + return (float)level * 4.0F; + else + return 0.0F; + } + + @Override + /** + * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} + * applies for all possible enchantments. + * @param stack + * @return + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { + return false; + } + + +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/items/BloodWandUpdate.java b/src/com/spiteful/forbidden/items/BloodWandUpdate.java new file mode 100644 index 0000000..df0e13d --- /dev/null +++ b/src/com/spiteful/forbidden/items/BloodWandUpdate.java @@ -0,0 +1,69 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Config; +import com.spiteful.forbidden.Compat; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.wands.IWandRodOnUpdate; +import thaumcraft.common.items.wands.ItemWandCasting; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +//import WayofTime.alchemicalWizardry.common.EnergyItems; + +public class BloodWandUpdate implements IWandRodOnUpdate { + + Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); + Method checkOwner; + Method syphon; + + public BloodWandUpdate() + { + try + { + Class energyItems; + try + { + energyItems = Class.forName("WayofTime.alchemicalWizardry.EnergyItems"); + } + catch(Exception e) + { + energyItems = Class.forName("WayofTime.alchemicalWizardry.common.itemsEnergyItems"); + } + if(energyItems == null) + return; + checkOwner = energyItems.getDeclaredMethod("checkAndSetItemOwner", new Class[] {ItemStack.class, EntityPlayer.class}); + syphon = energyItems.getDeclaredMethod("syphonBatteries", new Class[] {ItemStack.class, EntityPlayer.class, Integer.TYPE}); + } + catch(Exception e){} + } + + public void onUpdate(ItemStack itemstack, EntityPlayer player) + { + if(Compat.bm && player.ticksExisted % 80 == 0 && player.getCurrentEquippedItem() == itemstack) + { + try + { + checkOwner.invoke(null, itemstack, player); + + for(int x = 0;x < primals.length;x++) + { + if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack)) + { + if(((Boolean)(syphon.invoke(null, itemstack, player, 100))).booleanValue()) + ((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true); + else + return; + } + } + + } + catch(Exception e) + { + return; + } + } + + } +} diff --git a/src/com/spiteful/forbidden/items/CreativeWandUpdate.java b/src/com/spiteful/forbidden/items/CreativeWandUpdate.java new file mode 100644 index 0000000..287c98c --- /dev/null +++ b/src/com/spiteful/forbidden/items/CreativeWandUpdate.java @@ -0,0 +1,23 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Config; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.wands.IWandRodOnUpdate; +import thaumcraft.common.items.wands.ItemWandCasting; + +public class CreativeWandUpdate implements IWandRodOnUpdate { + + Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); + + public void onUpdate(ItemStack itemstack, EntityPlayer player) { + for(int x = 0;x < primals.length;x++){ + if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack)) { + ((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], + ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack) - ((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]), true); + } + } + } +} diff --git a/src/com/spiteful/forbidden/items/DarkWandCap.java b/src/com/spiteful/forbidden/items/DarkWandCap.java new file mode 100644 index 0000000..e9ae00d --- /dev/null +++ b/src/com/spiteful/forbidden/items/DarkWandCap.java @@ -0,0 +1,30 @@ +package com.spiteful.forbidden.items; + +import java.util.LinkedHashMap; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.wands.WandCap; + +/** + * This class is used to keep the material information for the various caps. + * It is also used to generate the wand recipes ingame. + * @author Azanor + * + */ +public class DarkWandCap extends WandCap +{ + public DarkWandCap(String tag, float discount, ItemStack item, int craftCost, ResourceLocation skin) + { + super(tag, discount, item, craftCost); + setTexture(skin); + } + + public DarkWandCap(String tag, float discount, List specialAspects, float discountSpecial, ItemStack item, int craftCost, ResourceLocation skin) + { + super(tag, discount, specialAspects, discountSpecial, item, craftCost); + setTexture(skin); + } +} diff --git a/src/com/spiteful/forbidden/items/ForbiddenItems.java b/src/com/spiteful/forbidden/items/ForbiddenItems.java new file mode 100644 index 0000000..7cfee3b --- /dev/null +++ b/src/com/spiteful/forbidden/items/ForbiddenItems.java @@ -0,0 +1,100 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.*; + +import cpw.mods.fml.common.registry.GameRegistry; +import java.util.Arrays; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraft.util.ResourceLocation; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.wands.WandCap; +import thaumcraft.api.wands.WandRod; + +public class ForbiddenItems +{ + public static Item deadlyShards; + public static Item skullAxe; + public static Item arcaneCakeItem; + public static Item taintShovel; + public static Item wandCore; + public static Item resource; + public static Item taintPickaxe; + public static Item mobCrystal; + public static Item fork; + public static Item morphPickaxe; + public static Item morphSword; + public static Item morphShovel; + public static Item morphAxe; + + public static WandRod WAND_ROD_TAINTED; + public static WandRod WAND_ROD_INFERNAL; + public static WandRod WAND_ROD_NEUTRONIUM; + public static WandRod WAND_ROD_SOUL; + public static WandRod WAND_ROD_BLOOD; + public static WandCap WAND_CAP_ORICHALCUM; + + public static void addItems() + { + deadlyShards = new ItemDeadlyShard(Config.shardID).setUnlocalizedName("NetherShard"); + GameRegistry.registerItem(deadlyShards, "NetherShard"); + + skullAxe = new ItemSkullAxe(Config.skullAxeID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("SkullAxe"); + GameRegistry.registerItem(skullAxe, "SkullAxe"); + + arcaneCakeItem = new ItemArcaneCake(Config.arcaneCakeItemID).setUnlocalizedName("ArcaneCake"); + GameRegistry.registerItem(arcaneCakeItem, "ArcaneCakeItem"); + + taintShovel = new ItemTaintShovel(Config.taintShovelID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("TaintShovel"); + GameRegistry.registerItem(taintShovel, "TaintShovel"); + MinecraftForge.setToolClass(taintShovel, "shovel", 3); + + taintPickaxe = new ItemTaintPickaxe(Config.taintPickaxeID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("TaintPickaxe"); + GameRegistry.registerItem(taintPickaxe, "TaintPickaxe"); + MinecraftForge.setToolClass(taintPickaxe, "pickaxe", 5); + + morphPickaxe = new ItemMorphPickaxe(Config.morphPickaxeID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("MorphPickaxe"); + GameRegistry.registerItem(morphPickaxe, "MorphPickaxe"); + MinecraftForge.setToolClass(morphPickaxe, "pickaxe", 4); + + morphSword = new ItemMorphSword(Config.morphSwordID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("MorphSword"); + GameRegistry.registerItem(morphSword, "MorphSword"); + + morphShovel = new ItemMorphShovel(Config.morphShovelID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("MorphShovel"); + GameRegistry.registerItem(morphShovel, "MorphShovel"); + MinecraftForge.setToolClass(morphShovel, "shovel", 4); + + morphAxe = new ItemMorphAxe(Config.morphAxeID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("MorphAxe"); + GameRegistry.registerItem(morphAxe, "MorphAxe"); + MinecraftForge.setToolClass(morphAxe, "axe", 4); + + wandCore = new ItemWandCores(Config.wandCoreID).setUnlocalizedName("WandCores"); + GameRegistry.registerItem(wandCore, "WandCores"); + WAND_ROD_TAINTED = new WandRod("tainted", 150, new ItemStack(wandCore, 1, 0), 12, new TaintedWandUpdate(), new ResourceLocation("forbidden", "textures/models/wand_rod_tainted.png")); + WAND_ROD_INFERNAL = new WandRod("infernal", 150, new ItemStack(wandCore, 1, 1), 12, new InfernalWandUpdate(), new ResourceLocation("forbidden", "textures/models/wand_rod_infernal.png")); + WAND_ROD_NEUTRONIUM = new WandRod("neutronium", 9001, new ItemStack(Block.bedrock, 1), 1000, new CreativeWandUpdate(), new ResourceLocation("forbidden", "textures/models/wand_rod_neutronium.png")); + WAND_ROD_NEUTRONIUM.setGlowing(true); + WAND_ROD_SOUL = new WandRod("soul", 100, new ItemStack(wandCore, 1, 2), 12, new SoulWandUpdate(), new ResourceLocation("forbidden", "textures/models/wand_rod_soul.png")); + WAND_ROD_SOUL.setGlowing(true); + WAND_ROD_BLOOD = new WandRod("blood", 100, new ItemStack(wandCore, 1, 3), 12, new BloodWandUpdate(), new ResourceLocation("forbidden", "textures/models/wand_rod_blood.png")); + WAND_CAP_ORICHALCUM = new DarkWandCap("orichalcum", 0.0F, new ItemStack(Block.commandBlock, 1), 1000, new ResourceLocation("forbidden", "textures/models/wand_cap_orichalcum.png")); + + resource = new ItemResource(Config.resourceID).setUnlocalizedName("FMResource"); + GameRegistry.registerItem(resource, "FMResource"); + OreDictionary.registerOre("nuggetEmerald", new ItemStack(resource, 1, 0)); + OreDictionary.registerOre("dyeBlack", new ItemStack(resource, 1, 1)); + + mobCrystal = new ItemMobCrystal(Config.mobCrystalID).setUnlocalizedName("MobCrystal"); + GameRegistry.registerItem(mobCrystal, "MobCrystal"); + + fork = new ItemDiabolistFork(Config.forkID, ThaumcraftApi.toolMatThaumium).setUnlocalizedName("DiabolistFork"); + if(Config.spork) + fork.setUnlocalizedName("DiabolistSpork"); + GameRegistry.registerItem(fork, "DiabolistFork"); + + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/items/InfernalWandUpdate.java b/src/com/spiteful/forbidden/items/InfernalWandUpdate.java new file mode 100644 index 0000000..2344975 --- /dev/null +++ b/src/com/spiteful/forbidden/items/InfernalWandUpdate.java @@ -0,0 +1,41 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Config; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.wands.IWandRodOnUpdate; +import thaumcraft.common.items.wands.ItemWandCasting; + +public class InfernalWandUpdate implements IWandRodOnUpdate { + + Aspect primals[] = {Aspect.ORDER, Aspect.ENTROPY, Aspect.AIR, Aspect.EARTH, Aspect.WATER}; + + public void onUpdate(ItemStack itemstack, EntityPlayer player) { + if(player.ticksExisted % 100 == 0){ + if(player.worldObj.provider.dimensionId == -1){ + for(int x = 0;x < primals.length;x++){ + if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack) / 10) { + ((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true); + } + } + } + + if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, Aspect.FIRE) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack) / 5) { + ((ItemWandCasting)itemstack.getItem()).addVis(itemstack, Aspect.FIRE, 1, true); + } + } + + if(player.isBurning()) + player.extinguish(); + + if(player.isPotionActive(Potion.wither.id)) { + if(player.worldObj.isRemote) + player.removePotionEffectClient(Potion.wither.id); + else + player.removePotionEffect(Potion.wither.id); + } + } +} diff --git a/src/com/spiteful/forbidden/items/ItemArcaneCake.java b/src/com/spiteful/forbidden/items/ItemArcaneCake.java new file mode 100644 index 0000000..a32fd44 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemArcaneCake.java @@ -0,0 +1,106 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.blocks.ForbiddenBlocks; +import com.spiteful.forbidden.Forbidden; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraft.client.renderer.texture.IconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemArcaneCake extends Item +{ + public ItemArcaneCake(int par1) + { + super(par1); + this.setCreativeTab(Forbidden.tab); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + int i1 = par3World.getBlockId(par4, par5, par6); + + if (i1 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) + { + par7 = 1; + } + else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID) + { + if (par7 == 0) + { + --par5; + } + + if (par7 == 1) + { + ++par5; + } + + if (par7 == 2) + { + --par6; + } + + if (par7 == 3) + { + ++par6; + } + + if (par7 == 4) + { + --par4; + } + + if (par7 == 5) + { + ++par4; + } + } + + if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) + { + return false; + } + else if (par1ItemStack.stackSize == 0) + { + return false; + } + else + { + if (par3World.canPlaceEntityOnSide(ForbiddenBlocks.arcaneCake.blockID, par4, par5, par6, false, par7, (Entity)null, par1ItemStack)) + { + Block block = Block.blocksList[ForbiddenBlocks.arcaneCake.blockID]; + int j1 = block.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0); + + if (par3World.setBlock(par4, par5, par6, ForbiddenBlocks.arcaneCake.blockID, j1, 3)) + { + if (par3World.getBlockId(par4, par5, par6) == ForbiddenBlocks.arcaneCake.blockID) + { + Block.blocksList[ForbiddenBlocks.arcaneCake.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); + Block.blocksList[ForbiddenBlocks.arcaneCake.blockID].onPostBlockPlaced(par3World, par4, par5, par6, j1); + } + + par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); + --par1ItemStack.stackSize; + } + } + + return true; + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister par1IconRegister) + { + this.itemIcon = par1IconRegister.registerIcon("forbidden:cake"); + } +} diff --git a/src/com/spiteful/forbidden/items/ItemDeadlyShard.java b/src/com/spiteful/forbidden/items/ItemDeadlyShard.java new file mode 100644 index 0000000..b6325d4 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemDeadlyShard.java @@ -0,0 +1,72 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; + +public class ItemDeadlyShard extends Item +{ + public static final String[] vices = new String[] {"wrath", "envy", "taint", "pride", "lust", "sloth", "greed"}; + + @SideOnly(Side.CLIENT) + public Icon[] icons; + + public ItemDeadlyShard(int par1) + { + super(par1); + this.setMaxStackSize(64); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(Forbidden.tab); + if(Config.noLust) + vices[4] = "despair"; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + icons = new Icon[7]; + + for (int x = 0; x < 7; x++) + { + icons[x] = ir.registerIcon("forbidden:" + vices[x] + "shard"); + } + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int dam) + { + return this.icons[dam]; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack par1ItemStack) + { + int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 6); + return super.getUnlocalizedName() + "." + vices[i]; + } + + @SideOnly(Side.CLIENT) + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int j = 0; j < 7; ++j) + { + par3List.add(new ItemStack(par1, 1, j)); + } + } +} diff --git a/src/com/spiteful/forbidden/items/ItemDiabolistFork.java b/src/com/spiteful/forbidden/items/ItemDiabolistFork.java new file mode 100644 index 0000000..021dfa8 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemDiabolistFork.java @@ -0,0 +1,106 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; + +public class ItemDiabolistFork extends ItemSword implements IRepairable { + + public Icon icon; + + public ItemDiabolistFork(int id, EnumToolMaterial mat){ + super(id, mat); + this.setCreativeTab(Forbidden.tab); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + if(Config.spork) + this.icon = ir.registerIcon("forbidden:spork"); + else + this.icon = ir.registerIcon("forbidden:fork"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int par1) + { + return this.icon; + } + + @Override + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + return 1.0F; + } + + @Override + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.none; + } + + @Override + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack par1ItemStack) + { + return 0; + } + + @Override + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + return par1ItemStack; + } + + @Override + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.itemID == Item.netherQuartz.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block par1Block) + { + return false; + } +} \ No newline at end of file diff --git a/src/com/spiteful/forbidden/items/ItemMobCrystal.java b/src/com/spiteful/forbidden/items/ItemMobCrystal.java new file mode 100644 index 0000000..c6b68fa --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemMobCrystal.java @@ -0,0 +1,133 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.*; + +import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import thaumcraft.api.aspects.Aspect; + +public class ItemMobCrystal extends Item { + + Icon[] icons; + + public ItemMobCrystal(int par1) { + super(par1); + this.setMaxStackSize(1); + //this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(Forbidden.crysTab); + } + + @SideOnly(Side.CLIENT) + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + if (par1ItemStack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); + NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob"); + + if (nbttagstring != null) + { + Aspect mobAspect = Config.spawnerMobs.get(nbttagstring.toString()); + if(mobAspect != null) + par3List.add(mobAspect.getName()); + } + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + icons = new Icon[2]; + + icons[0] = ir.registerIcon("forbidden:emptycrystal"); + icons[1] = ir.registerIcon("forbidden:mobcrystal"); + } + + @SideOnly(Side.CLIENT) + /** + * Player, Render pass, and item usage sensitive version of getIconIndex. + * + * @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null) + * @param renderPass The pass to get the icon for, 0 is default. + * @param player The player holding the item + * @param usingItem The item the player is actively using. Can be null if not using anything. + * @param useRemaining The ticks remaining for the active item. + * @return The icon index + */ + public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + NBTTagString nbttagstring = (NBTTagString)(nbttagcompound.getTag("mob")); + + if(nbttagstring != null) + return icons[1]; + } + + return icons[0]; + } + + @SideOnly(Side.CLIENT) + /** + * Returns the icon index of the stack given as argument. + */ + public Icon getIconIndex(ItemStack par1ItemStack) + { + if (par1ItemStack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); + NBTTagString nbttagstring = (NBTTagString)(nbttagcompound.getTag("mob")); + + if(nbttagstring != null) + return icons[1]; + } + + return icons[0]; + } + + @SideOnly(Side.CLIENT) + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + par3List.add(new ItemStack(par1, 1, 0)); + + for (String mob: Config.spawnerMobs.keySet()){ + ItemStack crystal = new ItemStack(par1, 1, 0); + NBTTagString mobTag = new NBTTagString("mob", mob); + crystal.setTagInfo("mob", mobTag); + par3List.add(crystal); + } + } + + public String getItemDisplayName(ItemStack par1ItemStack) + { + if (par1ItemStack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); + NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob"); + + if(nbttagstring != null) + return ("" + StatCollector.translateToLocal("entity." + nbttagstring.toString() + ".name") + " " + StatCollector.translateToLocal("item.MobCrystal.name")).trim(); + } + + return ("" + StatCollector.translateToLocal("item.MobCrystalEmpty.name")).trim(); + } +} diff --git a/src/com/spiteful/forbidden/items/ItemMorphAxe.java b/src/com/spiteful/forbidden/items/ItemMorphAxe.java new file mode 100644 index 0000000..f4e67c3 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemMorphAxe.java @@ -0,0 +1,111 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemAxe; +import net.minecraft.block.Block; +import net.minecraft.nbt.*; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; +import thaumcraft.api.ItemApi; +import net.minecraftforge.common.ForgeHooks; + +public class ItemMorphAxe extends ItemAxe implements IRepairable +{ + public Icon[] icon; + + public ItemMorphAxe(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, enumtoolmaterial); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + icon = new Icon[2]; + this.icon[0] = ir.registerIcon("forbidden:chameleonaxe"); + this.icon[1] = ir.registerIcon("forbidden:eyeaxe"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamageForRenderPass(int par1, int renderPass) { + return renderPass != 1?icon[0]:icon[1]; + } + + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.epic; + } + + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) + { + if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){ + NBTTagCompound tags = itemstack.getTagCompound(); + byte phase = tags.getByte("phase"); + NBTTagList enchants = itemstack.getEnchantmentTagList(); + if(enchants != null) + tags.setTag("enchants" + phase, enchants); + else + tags.removeTag("enchants" + phase); + if(++phase > 2) + phase = 0; + tags.setByte("phase", phase); + enchants = (NBTTagList)(tags.getTag("enchants" + phase)); + if(enchants == null) + tags.removeTag("ench"); + else + tags.setTag("ench", enchants); + + itemstack.setTagCompound(tags); + itemstack.damageItem(5, player); + player.swingItem(); + world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); + } + return itemstack; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack itemstack, int renderpass) + { + if(renderpass != 1) + return 16777215; + else + { + if(!itemstack.hasTagCompound()) + return 0x980000; + byte phase = itemstack.getTagCompound().getByte("phase"); + if(phase == 1) + return 0x0010CC; + else if(phase == 2) + return 0xE5DA00; + else + return 0x980000; + } + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + +} diff --git a/src/com/spiteful/forbidden/items/ItemMorphPickaxe.java b/src/com/spiteful/forbidden/items/ItemMorphPickaxe.java new file mode 100644 index 0000000..40a3e80 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemMorphPickaxe.java @@ -0,0 +1,121 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.block.Block; +import net.minecraft.nbt.*; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; +import thaumcraft.api.ItemApi; +import net.minecraftforge.common.ForgeHooks; + +public class ItemMorphPickaxe extends ItemPickaxe implements IRepairable +{ + public Icon[] icon; + + public ItemMorphPickaxe(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, enumtoolmaterial); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + icon = new Icon[2]; + this.icon[0] = ir.registerIcon("forbidden:chameleonpick"); + this.icon[1] = ir.registerIcon("forbidden:eyepick"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamageForRenderPass(int par1, int renderPass) { + return renderPass != 1?icon[0]:icon[1]; + } + + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.epic; + } + + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) + { + if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){ + NBTTagCompound tags = itemstack.getTagCompound(); + byte phase = tags.getByte("phase"); + NBTTagList enchants = itemstack.getEnchantmentTagList(); + if(enchants != null) + tags.setTag("enchants" + phase, enchants); + else + tags.removeTag("enchants" + phase); + if(++phase > 2) + phase = 0; + tags.setByte("phase", phase); + enchants = (NBTTagList)(tags.getTag("enchants" + phase)); + if(enchants == null) + tags.removeTag("ench"); + else + tags.setTag("ench", enchants); + + itemstack.setTagCompound(tags); + itemstack.damageItem(5, player); + player.swingItem(); + world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); + } + return itemstack; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack itemstack, int renderpass) + { + if(renderpass != 1) + return 16777215; + else + { + if(!itemstack.hasTagCompound()) + return 0x980000; + byte phase = itemstack.getTagCompound().getByte("phase"); + if(phase == 1) + return 0x0010CC; + else if(phase == 2) + return 0xE5DA00; + else + return 0x980000; + } + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + //@Override + //public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) { + // if(!itemstack.hasTagCompound()) + // return false; + // else { + // player.swingItem(); + // return true; + //} + //return false; + //} +} diff --git a/src/com/spiteful/forbidden/items/ItemMorphShovel.java b/src/com/spiteful/forbidden/items/ItemMorphShovel.java new file mode 100644 index 0000000..a3e5e28 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemMorphShovel.java @@ -0,0 +1,111 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSpade; +import net.minecraft.block.Block; +import net.minecraft.nbt.*; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; +import thaumcraft.api.ItemApi; +import net.minecraftforge.common.ForgeHooks; + +public class ItemMorphShovel extends ItemSpade implements IRepairable +{ + public Icon[] icon; + + public ItemMorphShovel(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, enumtoolmaterial); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + icon = new Icon[2]; + this.icon[0] = ir.registerIcon("forbidden:chameleonshovel"); + this.icon[1] = ir.registerIcon("forbidden:eyeshovel"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamageForRenderPass(int par1, int renderPass) { + return renderPass != 1?icon[0]:icon[1]; + } + + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.epic; + } + + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) + { + if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){ + NBTTagCompound tags = itemstack.getTagCompound(); + byte phase = tags.getByte("phase"); + NBTTagList enchants = itemstack.getEnchantmentTagList(); + if(enchants != null) + tags.setTag("enchants" + phase, enchants); + else + tags.removeTag("enchants" + phase); + if(++phase > 2) + phase = 0; + tags.setByte("phase", phase); + enchants = (NBTTagList)(tags.getTag("enchants" + phase)); + if(enchants == null) + tags.removeTag("ench"); + else + tags.setTag("ench", enchants); + + itemstack.setTagCompound(tags); + itemstack.damageItem(5, player); + player.swingItem(); + world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); + } + return itemstack; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack itemstack, int renderpass) + { + if(renderpass != 1) + return 16777215; + else + { + if(!itemstack.hasTagCompound()) + return 0x980000; + byte phase = itemstack.getTagCompound().getByte("phase"); + if(phase == 1) + return 0x0010CC; + else if(phase == 2) + return 0xE5DA00; + else + return 0x980000; + } + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + +} diff --git a/src/com/spiteful/forbidden/items/ItemMorphSword.java b/src/com/spiteful/forbidden/items/ItemMorphSword.java new file mode 100644 index 0000000..97ea326 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemMorphSword.java @@ -0,0 +1,113 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.block.Block; +import net.minecraft.nbt.*; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; +import thaumcraft.api.ItemApi; +import net.minecraftforge.common.ForgeHooks; + +public class ItemMorphSword extends ItemSword implements IRepairable +{ + public Icon[] icon; + + public ItemMorphSword(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, enumtoolmaterial); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + icon = new Icon[2]; + this.icon[0] = ir.registerIcon("forbidden:chameleonsword"); + this.icon[1] = ir.registerIcon("forbidden:eyesword"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamageForRenderPass(int par1, int renderPass) { + return renderPass != 1?icon[0]:icon[1]; + } + + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.epic; + } + + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) + { + //player.setItemInUse(itemstack, getMaxItemUseDuration(itemstack)); + + if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){ + NBTTagCompound tags = itemstack.getTagCompound(); + byte phase = tags.getByte("phase"); + NBTTagList enchants = itemstack.getEnchantmentTagList(); + if(enchants != null) + tags.setTag("enchants" + phase, enchants); + else + tags.removeTag("enchants" + phase); + if(++phase > 2) + phase = 0; + tags.setByte("phase", phase); + enchants = (NBTTagList)(tags.getTag("enchants" + phase)); + if(enchants == null) + tags.removeTag("ench"); + else + tags.setTag("ench", enchants); + + itemstack.setTagCompound(tags); + itemstack.damageItem(5, player); + player.swingItem(); + world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); + } + return itemstack; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack itemstack, int renderpass) + { + if(renderpass != 1) + return 16777215; + else + { + if(!itemstack.hasTagCompound()) + return 0x980000; + byte phase = itemstack.getTagCompound().getByte("phase"); + if(phase == 1) + return 0x0010CC; + else if(phase == 2) + return 0xE5DA00; + else + return 0x980000; + } + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + +} diff --git a/src/com/spiteful/forbidden/items/ItemResource.java b/src/com/spiteful/forbidden/items/ItemResource.java new file mode 100644 index 0000000..7918e24 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemResource.java @@ -0,0 +1,92 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; + +public class ItemResource extends Item +{ + @SideOnly(Side.CLIENT) + public Icon[] icons; + + public ItemResource(int par1) + { + super(par1); + this.setMaxStackSize(64); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + icons = new Icon[2]; + + icons[0] = ir.registerIcon("forbidden:emerald_nugget"); + icons[1] = ir.registerIcon("forbidden:dye_powder_black"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int dam) + { + return this.icons[dam]; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack par1ItemStack) + { + int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 6); + return super.getUnlocalizedName() + "." + i; + } + + @SideOnly(Side.CLIENT) + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int j = 0; j < 2; ++j) + { + par3List.add(new ItemStack(par1, 1, j)); + } + } + + @Override + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) + { + if (par3EntityLivingBase instanceof EntitySheep && par1ItemStack.getItemDamage() == 1) + { + EntitySheep entitysheep = (EntitySheep)par3EntityLivingBase; + + if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != 15) + { + entitysheep.setFleeceColor(15); + --par1ItemStack.stackSize; + } + + return true; + } + else + { + return false; + } + } +} diff --git a/src/com/spiteful/forbidden/items/ItemSkullAxe.java b/src/com/spiteful/forbidden/items/ItemSkullAxe.java new file mode 100644 index 0000000..4d70101 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemSkullAxe.java @@ -0,0 +1,63 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.block.Block; +import net.minecraft.util.Icon; +import thaumcraft.api.IRepairable; +import thaumcraft.api.ItemApi; + +public class ItemSkullAxe extends ItemSword implements IRepairable +{ + public Icon icon; + + public ItemSkullAxe(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, enumtoolmaterial); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + this.icon = ir.registerIcon("forbidden:skullaxe"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int par1) + { + return this.icon; + } + + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.uncommon; + } + + @Override + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + return 1.0F; + } +} diff --git a/src/com/spiteful/forbidden/items/ItemTaintPickaxe.java b/src/com/spiteful/forbidden/items/ItemTaintPickaxe.java new file mode 100644 index 0000000..06696da --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemTaintPickaxe.java @@ -0,0 +1,66 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.block.Block; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; +import thaumcraft.api.ItemApi; +import net.minecraftforge.common.ForgeHooks; + +public class ItemTaintPickaxe extends ItemPickaxe implements IRepairable +{ + public Icon icon; + + public ItemTaintPickaxe(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, enumtoolmaterial); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + this.icon = ir.registerIcon("forbidden:taintpickaxe"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int par1) + { + return this.icon; + } + + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.rare; + } + + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + public float getStrVsBlock(ItemStack stack, Block block, int meta) + { + if(block.blockHardness == 0.0F) + return 0.0F; + else if(block.blockHardness < 5.0F) + return 0.1F; + else if(block.blockHardness < 20.0F) + return block.blockHardness / 2.0F; + else + return 5.0F + block.blockHardness; + + } +} diff --git a/src/com/spiteful/forbidden/items/ItemTaintShovel.java b/src/com/spiteful/forbidden/items/ItemTaintShovel.java new file mode 100644 index 0000000..8066a2c --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemTaintShovel.java @@ -0,0 +1,79 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Config; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSpade; +import net.minecraft.block.Block; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; +import thaumcraft.api.ItemApi; +import net.minecraftforge.common.ForgeHooks; + +public class ItemTaintShovel extends ItemSpade implements IRepairable +{ + public Icon icon; + + public ItemTaintShovel(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, enumtoolmaterial); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) + { + this.icon = ir.registerIcon("forbidden:taintshovel"); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int par1) + { + return this.icon; + } + + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.rare; + } + + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + public float getStrVsBlock(ItemStack stack, Block block, int meta) + { + if (ForgeHooks.isToolEffective(stack, block, meta) || block.blockMaterial == Config.taintMaterial) + { + return efficiencyOnProperMaterial; + } + + return getStrVsBlock(stack, block); + } + + @Override + public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) { + if(player != null && player.isPotionActive(Config.thaumcraftTaintPotionID)) { + itemstack.damageItem(5, player); + player.swingItem(); + if(player.worldObj.isRemote) + player.removePotionEffectClient(Config.thaumcraftTaintPotionID); + else { + world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); + player.removePotionEffect(Config.thaumcraftTaintPotionID); + } + return true; + } + return super.onItemUse(itemstack, player, world, x, y, z, side, par8, par9, par10); + } +} diff --git a/src/com/spiteful/forbidden/items/ItemWandCores.java b/src/com/spiteful/forbidden/items/ItemWandCores.java new file mode 100644 index 0000000..67db8b5 --- /dev/null +++ b/src/com/spiteful/forbidden/items/ItemWandCores.java @@ -0,0 +1,81 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Forbidden; +import com.spiteful.forbidden.Compat; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import thaumcraft.api.ItemApi; +import thaumcraft.api.wands.WandCap; +import thaumcraft.api.wands.WandRod; +import thaumcraft.common.items.wands.ItemWandCasting; + +public class ItemWandCores extends Item { + + public final String[] types = {"tainted", "infernal", "soul", "blood"}; + public Icon[] icon = new Icon[4]; + + + public ItemWandCores(int par1) { + super(par1); + this.setMaxStackSize(64); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(Forbidden.tab); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister ir) { + for(int x = 0; x < types.length; x++) + this.icon[x] = ir.registerIcon("forbidden:wand_rod_" + types[x]); + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int meta) { + return this.icon[meta]; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { + for(int x = 0; x < types.length; x++){ + par3List.add(new ItemStack(this, 1, x)); + } + + ItemStack taint = ItemApi.getItem("itemWandCasting", 72); + ((ItemWandCasting)taint.getItem()).setCap(taint, (WandCap)WandCap.caps.get("thaumium")); + ((ItemWandCasting)taint.getItem()).setRod(taint, (WandRod)WandRod.rods.get("tainted")); + par3List.add(taint); + ItemStack infernal = ItemApi.getItem("itemWandCasting", 72); + ((ItemWandCasting)infernal.getItem()).setCap(infernal, (WandCap)WandCap.caps.get("thaumium")); + ((ItemWandCasting)infernal.getItem()).setRod(infernal, (WandRod)WandRod.rods.get("infernal")); + par3List.add(infernal); + ItemStack creative = ItemApi.getItem("itemWandCasting", 2000); + ((ItemWandCasting)creative.getItem()).setCap(creative, (WandCap)WandCap.caps.get("orichalcum")); + ((ItemWandCasting)creative.getItem()).setRod(creative, (WandRod)WandRod.rods.get("neutronium")); + par3List.add(creative); + if(Compat.pb) + { + ItemStack soul = ItemApi.getItem("itemWandCasting", 72); + ((ItemWandCasting)creative.getItem()).setCap(soul, (WandCap)WandCap.caps.get("thaumium")); + ((ItemWandCasting)creative.getItem()).setRod(soul, (WandRod)WandRod.rods.get("soul")); + par3List.add(soul); + } + if(Compat.bm) + { + ItemStack blood = ItemApi.getItem("itemWandCasting", 72); + ((ItemWandCasting)creative.getItem()).setCap(blood, (WandCap)WandCap.caps.get("thaumium")); + ((ItemWandCasting)creative.getItem()).setRod(blood, (WandRod)WandRod.rods.get("blood")); + par3List.add(blood); + } + } + + public String getUnlocalizedName(ItemStack par1ItemStack) { + return super.getUnlocalizedName() + "." + types[par1ItemStack.getItemDamage()]; + } +} diff --git a/src/com/spiteful/forbidden/items/SoulWandUpdate.java b/src/com/spiteful/forbidden/items/SoulWandUpdate.java new file mode 100644 index 0000000..c4ce37d --- /dev/null +++ b/src/com/spiteful/forbidden/items/SoulWandUpdate.java @@ -0,0 +1,71 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Config; +import com.spiteful.forbidden.Compat; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.wands.IWandRodOnUpdate; +import thaumcraft.common.items.wands.ItemWandCasting; +import playerbeacons.common.PlayerBeacons; +import playerbeacons.tileentity.TileEntityPlayerBeacon; + +public class SoulWandUpdate implements IWandRodOnUpdate { + + Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); + + public void onUpdate(ItemStack itemstack, EntityPlayer player) + { + if(Compat.pb && player.ticksExisted % 150 == 0) + { + try + { + NBTTagCompound info = null; + info = PlayerBeacons.beaconData.loadBeaconInformation(player.worldObj, player.username); + + if(info == null) + return; + + int x = info.getInteger("x"); + int y = info.getInteger("y"); + int z = info.getInteger("z"); + + TileEntityPlayerBeacon bacon = (TileEntityPlayerBeacon) player.worldObj.getBlockTileEntity(x, y, z); + if(bacon != null) + { + if(Compat.tt) + { + if(player.worldObj.getBlockId(x - 1, y, z) == Compat.tabletID) + return; + if(player.worldObj.getBlockId(x + 1, y, z) == Compat.tabletID) + return; + if(player.worldObj.getBlockId(x, y, z + 1) == Compat.tabletID) + return; + if(player.worldObj.getBlockId(x, y, z - 1) == Compat.tabletID) + return; + } + int charge = 0; + for(int j = 0;j < primals.length;j++) + { + if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[j]) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack)) + { + ((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[j], 1, true); + bacon.setCorruption(bacon.getCorruption() + 50, true); + bacon.doCorruption(false); + charge++; + } + } + if(player.worldObj.rand.nextInt(100) < charge) + bacon.doCorruption(true); + + } + } + catch(Exception e) + { + return; + } + } + } +} diff --git a/src/com/spiteful/forbidden/items/TaintedWandUpdate.java b/src/com/spiteful/forbidden/items/TaintedWandUpdate.java new file mode 100644 index 0000000..e205de7 --- /dev/null +++ b/src/com/spiteful/forbidden/items/TaintedWandUpdate.java @@ -0,0 +1,31 @@ +package com.spiteful.forbidden.items; + +import com.spiteful.forbidden.Config; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.wands.IWandRodOnUpdate; +import thaumcraft.common.items.wands.ItemWandCasting; + +public class TaintedWandUpdate implements IWandRodOnUpdate { + + Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); + + public void onUpdate(ItemStack itemstack, EntityPlayer player) { + if(player.ticksExisted % 100 == 0 && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).biomeID == Config.thaumcraftTaintBiomeID){ + for(int x = 0;x < primals.length;x++){ + if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack) / 10) { + ((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true); + } + } + } + + //if(player.isPotionActive(Config.thaumcraftTaintPotionID)) { + // if(player.worldObj.isRemote) + // player.removePotionEffectClient(Config.thaumcraftTaintPotionID); + // else + // player.removePotionEffect(Config.thaumcraftTaintPotionID); + //} + } +} diff --git a/src/com/spiteful/forbidden/tiles/TileEntityWrathCage.java b/src/com/spiteful/forbidden/tiles/TileEntityWrathCage.java new file mode 100644 index 0000000..a019ef9 --- /dev/null +++ b/src/com/spiteful/forbidden/tiles/TileEntityWrathCage.java @@ -0,0 +1,373 @@ +package com.spiteful.forbidden.tiles; + +import com.spiteful.forbidden.DarkAspects; +import com.spiteful.forbidden.Config; + +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.Packet250CustomPayload; +import net.minecraft.network.INetworkManager; +import net.minecraft.network.packet.Packet132TileEntityData; +import cpw.mods.fml.common.network.PacketDispatcher; +import net.minecraftforge.common.ForgeDirection; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.logging.Level; +import cpw.mods.fml.common.FMLLog; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IAspectContainer; +import thaumcraft.api.aspects.IEssentiaTransport; + + +public class TileEntityWrathCage extends TileEntity implements IAspectContainer, IEssentiaTransport +{ + private final WrathSpawnerLogic spawnLogic = new WrathSpawnerLogic(this); + public int wrath = 0; + public int sloth = 0; + public int special = 0; + Aspect aspect; + + @Override + /** + * Reads a tile entity from NBT. + */ + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + this.spawnLogic.readFromNBT(par1NBTTagCompound); + this.wrath = par1NBTTagCompound.getShort("Wrath"); + this.sloth = par1NBTTagCompound.getShort("Sloth"); + this.special = par1NBTTagCompound.getShort("Special"); + aspect = spawnLogic.getAspect(); + } + + @Override + /** + * Writes a tile entity to NBT. + */ + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + this.spawnLogic.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setShort("Wrath", (short)this.wrath); + par1NBTTagCompound.setShort("Sloth", (short)this.sloth); + par1NBTTagCompound.setShort("Special", (short)this.special); + } + + @Override + public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) { + readFromNBT(pkt.data); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound tag = new NBTTagCompound(); + writeToNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, tag); + } + + /** + * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count + * ticks and creates a new spawn inside its implementation. + */ + public void updateEntity() + { + if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ + this.spawnLogic.updateSpawner(); + } + + if(Config.wrathCost > 0 && spawnLogic.isMobSet() && !(special >= 64 || wrath >= 64 || sloth >= 64)) + drawEssentia(); + + super.updateEntity(); + } + + void drawEssentia() + { + for(int x = 0;x < ForgeDirection.VALID_DIRECTIONS.length;x++){ + ForgeDirection current = ForgeDirection.VALID_DIRECTIONS[x]; + TileEntity te = ThaumcraftApiHelper.getConnectableTile(worldObj, xCoord, yCoord, zCoord, current); + if(te != null) { + IEssentiaTransport ic = (IEssentiaTransport)te; + if(ic.canOutputTo(current.getOpposite()) && special < 64 + && ic.getSuction(current.getOpposite()).getAmount(aspect) < this.getSuction(current).getAmount(aspect) && ic.takeVis(aspect, 1) == 1) { + special++; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return; + } + else if(ic.canOutputTo(current.getOpposite()) && wrath < 64 && special < Config.wrathCost + && ic.getSuction(current.getOpposite()).getAmount(DarkAspects.WRATH) < this.getSuction(current).getAmount(DarkAspects.WRATH) && ic.takeVis(DarkAspects.WRATH, 1) == 1) { + wrath++; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return; + } + else if(ic.canOutputTo(current.getOpposite()) && sloth < 64 && special < Config.wrathCost && wrath < Config.wrathCost + && ic.getSuction(current.getOpposite()).getAmount(DarkAspects.SLOTH) < this.getSuction(current).getAmount(DarkAspects.SLOTH) && ic.takeVis(DarkAspects.SLOTH, 1) == 1) { + sloth++; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return; + } + } + } + } + + public void checkAspect() { + if(aspect != spawnLogic.getAspect()) + special = 0; + aspect = spawnLogic.getAspect(); + } + + /** + * Called when a client event is received with the event number and argument, see World.sendClientEvent + */ + public boolean receiveClientEvent(int par1, int par2) + { + return this.spawnLogic.setDelayToMin(par1) ? true : super.receiveClientEvent(par1, par2); + } + + /** + * Returns the spawner logic associated with this spawner + */ + public WrathSpawnerLogic getSpawnerLogic() + { + return this.spawnLogic; + } + + public AspectList getAspects() + { + AspectList list = new AspectList(); + if(Config.wrathCost > 0 && spawnLogic.isMobSet()) + list.add(DarkAspects.WRATH, wrath).add(DarkAspects.SLOTH, sloth).add(aspect, special); + return list; + } + + public void setAspects(AspectList aspects) + { + + } + + /** + * This method is used to determine of a specific aspect can be added to this container. + * @param tag + * @return true or false + */ + public boolean doesContainerAccept(Aspect tag) + { + if(Config.wrathCost <= 0) + return false; + else + return (tag == DarkAspects.WRATH || tag == DarkAspects.SLOTH || tag == aspect); + } + + /** + * This method is used to add a certain amount of an aspect to the tile entity. + * @param tag + * @param amount + * @return the amount of aspect left over that could not be added. + */ + public int addToContainer(Aspect tag, int amount) + { + if(Config.wrathCost <= 0) + return amount; + if(tag == DarkAspects.WRATH){ + wrath += amount; + return 0; + } + else if(tag == DarkAspects.SLOTH){ + sloth += amount; + return 0; + } + else if(tag == aspect){ + special += amount; + return 0; + } + else + return amount; + } + + /** + * Removes a certain amount of a specific aspect from the tile entity + * @param tag + * @param amount + * @return true if that amount of aspect was available and was removed + */ + public boolean takeFromContainer(Aspect tag, int amount) + { + return false; + } + + /** + * removes a bunch of different aspects and amounts from the tile entity. + * @param ot the ObjectTags object that contains the aspects and their amounts. + * @return true if all the aspects and their amounts were available and successfully removed + */ + public boolean takeFromContainer(AspectList ot) + { + return false; + } + + /** + * Checks if the tile entity contains the listed amount (or more) of the aspect + * @param tag + * @param amount + * @return + */ + public boolean doesContainerContainAmount(Aspect tag, int amount) + { + if(tag == DarkAspects.WRATH) + return wrath >= amount; + else if(tag == DarkAspects.SLOTH) + return sloth >= amount; + else if(tag == aspect) + return special >= amount; + else + return false; + } + + /** + * Checks if the tile entity contains all the listed aspects and their amounts + * @param ot the ObjectTags object that contains the aspects and their amounts. + * @return + */ + public boolean doesContainerContain(AspectList ot){ + for (Aspect asp: ot.getAspects()) + { + if(asp == DarkAspects.WRATH && wrath < ot.getAmount(DarkAspects.WRATH)) + return false; + else if(asp == DarkAspects.SLOTH && sloth < ot.getAmount(DarkAspects.SLOTH)) + return false; + else if(asp == aspect && special < ot.getAmount(aspect)) + return false; + else if(asp != DarkAspects.WRATH && asp != DarkAspects.SLOTH && asp != aspect) + return false; + } + return true; + } + + /** + * Returns how much of the aspect this tile entity contains + * @param tag + * @return the amount of that aspect found + */ + public int containerContains(Aspect tag) + { + if(tag == DarkAspects.WRATH) + return wrath; + else if(tag == DarkAspects.SLOTH) + return sloth; + else if(tag == aspect) + return special; + else + return 0; + } + + /** + * Is this tile able to connect to other vis users/sources on the specified side? + * @param face + * @return + */ + public boolean isConnectable(ForgeDirection face) + { + return true; + } + + /** + * Is this side used to input essentia? + * @param face + * @return + */ + public boolean canInputFrom(ForgeDirection face) + { + return true; + } + + /** + * Is this side used to output essentia? + * @param face + * @return + */ + public boolean canOutputTo(ForgeDirection face) + { + return false; + } + + /** + * Sets the amount of suction this block will apply + * @param suction + */ + public void setSuction(AspectList suction) + { + + } + + /** + * Sets the amount of suction this block will apply + * @param suction + */ + public void setSuction(Aspect aspect, int amount) + { + + } + + /** + * Returns the amount of suction this block is applying. + * @param loc + * the location from where the suction is being checked + * @return + */ + public AspectList getSuction(ForgeDirection face) + { + AspectList list = new AspectList(); + if(Config.wrathCost <= 0) + return list; + if(special < 64) + list.add(aspect, 256); + if(special < Config.wrathCost && wrath < 64) + list.add(DarkAspects.WRATH, 256); + if(special < Config.wrathCost && wrath < Config.wrathCost && sloth < 64) + list.add(DarkAspects.SLOTH, 256); + + return list; + } + + /** + * remove the specified amount of vis from this transport tile + * @param suction + * @return how much was actually taken + */ + public int takeVis(Aspect aspect, int amount) + { + return 0; + } + + public AspectList getEssentia(ForgeDirection face) + { + return getAspects(); + } + + /** + * Essentia will not be drawn from this container unless the suction exceeds this amount. + * @return the amount + */ + public int getMinimumSuction() + { + return 9000; + } + + /** + * Return true if you want the conduit to extend a little further into the block. + * Used by jars and alembics that have smaller than normal hitboxes + * @return + */ + public boolean renderExtendedTube() + { + return false; + } +} diff --git a/src/com/spiteful/forbidden/tiles/WrathSpawnerLogic.java b/src/com/spiteful/forbidden/tiles/WrathSpawnerLogic.java new file mode 100644 index 0000000..5ad7be9 --- /dev/null +++ b/src/com/spiteful/forbidden/tiles/WrathSpawnerLogic.java @@ -0,0 +1,343 @@ +package com.spiteful.forbidden.tiles; + +import com.spiteful.forbidden.*; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityLivingData; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.Packet132TileEntityData; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.World; +import thaumcraft.api.aspects.Aspect; + +import thaumcraft.common.Thaumcraft; + +public class WrathSpawnerLogic +{ + /** The mob spawner we deal with */ + final TileEntityWrathCage mobSpawnerEntity; + + public boolean mobSet = false; + + /** The delay to spawn. */ + public int spawnDelay = 20; + private String mobID = "Pig"; + Aspect aspect = Aspect.GREED; + private boolean slothful = false; + private int fuel = 0; + + public double field_98287_c; + public double field_98284_d; + private int minSpawnDelay = 200; + private int maxSpawnDelay = 300; + + /** A counter for spawn tries. */ + private int spawnCount = 3; + private Entity renderEntity; + private int maxNearbyEntities = 6; + + /** The distance from which a player activates the spawner. */ + private int activatingRangeFromPlayer = 16; + + /** The range coefficient for spawning entities around. */ + private int spawnRange = 4; + + WrathSpawnerLogic(TileEntityWrathCage par1TileEntityMobSpawner) + { + this.mobSpawnerEntity = par1TileEntityMobSpawner; + } + + /** + * Gets the entity name that should be spawned. + */ + public String getEntityNameToSpawn() + { + return this.mobID; + } + + public Aspect getAspect() + { + return aspect; + } + + public void setMobID(String par1Str) + { + this.mobID = par1Str; + if(Config.spawnerMobs.containsKey(mobID)) + aspect = Config.spawnerMobs.get(mobID); + else + aspect = Aspect.GREED; + } + + public void mobIsSet(boolean inp){ + mobSet = inp; + } + + public boolean isMobSet() + { + return mobSet; + } + + public void updateSpawnerBlock(int par1) + { + this.mobSpawnerEntity.worldObj.addBlockEvent(this.mobSpawnerEntity.xCoord, this.mobSpawnerEntity.yCoord, this.mobSpawnerEntity.zCoord, Block.mobSpawner.blockID, par1, 0); + } + + public World getSpawnerWorld() + { + return this.mobSpawnerEntity.worldObj; + } + + public int getSpawnerX() + { + return this.mobSpawnerEntity.xCoord; + } + + public int getSpawnerY() + { + return this.mobSpawnerEntity.yCoord; + } + + public int getSpawnerZ() + { + return this.mobSpawnerEntity.zCoord; + } + + public void updateSpawner() + { + if(!mobSet) + return; + + double d0; + + if (this.getSpawnerWorld().isRemote && (fuel > 0 || Config.wrathCost <= 0)) + { + double d1 = (double)((float)this.getSpawnerX() + this.getSpawnerWorld().rand.nextFloat()); + double d2 = (double)((float)this.getSpawnerY() + this.getSpawnerWorld().rand.nextFloat()); + d0 = (double)((float)this.getSpawnerZ() + this.getSpawnerWorld().rand.nextFloat()); + //this.getSpawnerWorld().spawnParticle("smoke", d1, d2, d0, 0.0D, 0.0D, 0.0D); + //this.getSpawnerWorld().spawnParticle("flame", d1, d2, d0, 0.0D, 0.0D, 0.0D); + Thaumcraft.proxy.sparkle((float)d1, (float)d2, (float)d0, 0x870404); + + if (this.spawnDelay > 0) + { + --this.spawnDelay; + } + + this.field_98284_d = this.field_98287_c; + this.field_98287_c = (this.field_98287_c + (double)(1000.0F / ((float)this.spawnDelay + 200.0F))) % 360.0D; + } + else if(Config.wrathCage) + { + if(Config.wrathCost > 0 && fuel <= 0){ + if(mobSpawnerEntity.special >= Config.wrathCost){ + mobSpawnerEntity.special -= Config.wrathCost; + slothful = false; + fuel = Config.wrathEff; + mobSpawnerEntity.worldObj.markBlockForUpdate(getSpawnerX(), getSpawnerY(), getSpawnerZ()); + } + else if(mobSpawnerEntity.wrath >= Config.wrathCost){ + mobSpawnerEntity.wrath -= Config.wrathCost; + slothful = false; + fuel = Config.wrathEff; + mobSpawnerEntity.worldObj.markBlockForUpdate(getSpawnerX(), getSpawnerY(), getSpawnerZ()); + } + else if(mobSpawnerEntity.sloth >= Config.wrathCost){ + mobSpawnerEntity.sloth -= Config.wrathCost; + slothful = true; + fuel = Config.wrathEff; + mobSpawnerEntity.worldObj.markBlockForUpdate(getSpawnerX(), getSpawnerY(), getSpawnerZ()); + } + } + + if (this.spawnDelay == -1) + { + this.updateDelay(); + } + + if(fuel <= 0 && Config.wrathCost > 0) + return; + + if (this.spawnDelay > 0) + { + --this.spawnDelay; + return; + } + + for (int i = 0; i < this.spawnCount && (fuel > 0 || Config.wrathCost <= 0); ++i) + { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); + + if (entity == null) + { + return; + } + + int j = this.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getAABBPool().getAABB((double)this.getSpawnerX(), (double)this.getSpawnerY(), (double)this.getSpawnerZ(), (double)(this.getSpawnerX() + 1), (double)(this.getSpawnerY() + 1), (double)(this.getSpawnerZ() + 1)).expand((double)(this.spawnRange * 2), 4.0D, (double)(this.spawnRange * 2))).size(); + + if (j >= this.maxNearbyEntities) + { + this.updateDelay(); + return; + } + + d0 = (double)this.getSpawnerX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; + double d3 = (double)(this.getSpawnerY() + this.getSpawnerWorld().rand.nextInt(3) - 1); + double d4 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; + EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null; + entity.setLocationAndAngles(d0, d3, d4, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); + + if ( + //entityliving == null || + entityCanSpawn(entityliving)) + //entityliving.getCanSpawnHere()) + { + this.spawnMob(entity); + this.getSpawnerWorld().playAuxSFX(2004, this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 0); + + if (entityliving != null) + { + entityliving.spawnExplosionParticle(); + fuel--; + } + + this.updateDelay(); + } + else if(entityliving != null) + entityliving.isDead = true; + } + + } + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean entityCanSpawn(EntityLiving entity) + { + return entity.worldObj.checkNoEntityCollision(entity.boundingBox) && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty() && !entity.worldObj.isAnyLiquid(entity.boundingBox); + } + + private void updateDelay() + { + if (this.maxSpawnDelay <= this.minSpawnDelay) + { + this.spawnDelay = this.minSpawnDelay; + } + else + { + int i = this.maxSpawnDelay - this.minSpawnDelay; + this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(i); + } + + if(slothful) + spawnDelay += 200; + + this.updateSpawnerBlock(1); + } + + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + mobID = par1NBTTagCompound.getString("EntityId"); + if(Config.spawnerMobs.containsKey(mobID)) + aspect = Config.spawnerMobs.get(mobID); + else + aspect = Aspect.GREED; + mobSet = par1NBTTagCompound.getBoolean("MobSet"); + slothful = par1NBTTagCompound.getBoolean("Slothful"); + this.fuel = par1NBTTagCompound.getShort("Fuel"); + this.spawnDelay = par1NBTTagCompound.getShort("Delay"); + + //if (par1NBTTagCompound.hasKey("MinSpawnDelay")) + //{ + // this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); + // this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); + // this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); + //} + + if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) + { + this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); + } + + if (par1NBTTagCompound.hasKey("SpawnRange")) + { + this.spawnRange = par1NBTTagCompound.getShort("SpawnRange"); + } + + if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote) + { + this.renderEntity = null; + } + } + + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setString("EntityId", this.getEntityNameToSpawn()); + par1NBTTagCompound.setBoolean("MobSet", mobSet); + par1NBTTagCompound.setBoolean("Slothful", slothful); + par1NBTTagCompound.setShort("Fuel", (short)this.fuel); + par1NBTTagCompound.setShort("Delay", (short)this.spawnDelay); + //par1NBTTagCompound.setShort("MinSpawnDelay", (short)this.minSpawnDelay); + //par1NBTTagCompound.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); + //par1NBTTagCompound.setShort("SpawnCount", (short)this.spawnCount); + par1NBTTagCompound.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); + par1NBTTagCompound.setShort("SpawnRange", (short)this.spawnRange); + + } + + public Entity spawnMob(Entity par1Entity) + { + if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null) + { + ((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null); + this.getSpawnerWorld().spawnEntityInWorld(par1Entity); + } + + return par1Entity; + } + + /** + * Sets the delay to minDelay if parameter given is 1, else return false. + */ + public boolean setDelayToMin(int par1) + { + if (par1 == 1 && this.getSpawnerWorld().isRemote) + { + this.spawnDelay = this.minSpawnDelay; + return true; + } + else + { + return false; + } + } + + @SideOnly(Side.CLIENT) + public Entity getEntityForRender() + { + if (this.renderEntity == null) + { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null); + entity = this.spawnMob(entity); + this.renderEntity = entity; + } + + return this.renderEntity; + } + +}