mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-19 11:49:12 +00:00
Stuffy Stuff
This commit is contained in:
1 parent
0f6790b505
commit
0f1ba9c124
29 files changed
+721
-210
No files matched your search
@@ -17,12 +17,13 @@ public class Config {
|
||||
public static HashMap<String, Aspect> spawnerMobs = new HashMap<String, Aspect>();
|
||||
|
||||
public static int clusterEnchID;
|
||||
public static int pigBaneEnchID;
|
||||
public static int wrathEnchID;
|
||||
public static int greedyEnchID;
|
||||
public static int consumingEnchID;
|
||||
public static int educationalEnchID;
|
||||
public static int corruptingEnchID;
|
||||
public static int eternalEnchID;
|
||||
public static int voidEnchID;
|
||||
public static int impactEnchID;
|
||||
|
||||
public static int bloodSealPotionID = 70;
|
||||
|
||||
@@ -53,12 +54,13 @@ public class Config {
|
||||
|
||||
int enchCount = 66;
|
||||
clusterEnchID = conf.get("enchantments", "Fiery Core", enchCount++).getInt();
|
||||
pigBaneEnchID = conf.get("enchantments", "Porcivore", enchCount++).getInt();
|
||||
wrathEnchID = conf.get("enchantments", "Wrath", enchCount++).getInt();
|
||||
greedyEnchID = conf.get("enchantments", "Capitalist", enchCount++).getInt();
|
||||
consumingEnchID = conf.get("enchantments", "Consuming", enchCount++).getInt();
|
||||
educationalEnchID = conf.get("enchantments", "Educational", enchCount++).getInt();
|
||||
corruptingEnchID = conf.get("enchantments", "Corrupting", enchCount++).getInt();
|
||||
eternalEnchID = conf.get("enchantments", "Eternal", enchCount++).getInt();
|
||||
voidEnchID = conf.get("enchantments", "Voidtouched", enchCount++).getInt();
|
||||
impactEnchID = conf.get("enchantments", "Impact", enchCount++).getInt();
|
||||
|
||||
noLust = conf.get("general", "No Lust", noLust, "Enable to remove Luxuria aspect and related items.").getBoolean(false);
|
||||
silverfishEmeralds = conf.get("general", "Silverfish Drop Emerald Nuggets", silverfishEmeralds, "Disable to prevent Silverfish from dropping emerald nuggets.").getBoolean(true);
|
||||
|
||||
@@ -7,6 +7,7 @@ import fox.spiteful.forbidden.blocks.BlockBlackFlower;
|
||||
import fox.spiteful.forbidden.compat.Compat;
|
||||
import fox.spiteful.forbidden.items.ItemTaintPickaxe;
|
||||
import fox.spiteful.forbidden.potions.DarkPotions;
|
||||
import fox.spiteful.forbidden.tiles.SubTileEuclidaisy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
@@ -38,10 +39,10 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
|
||||
@@ -51,7 +52,7 @@ import org.apache.logging.log4j.Level;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.entities.ITaintedMob;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.Utils;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import fox.spiteful.forbidden.blocks.ForbiddenBlocks;
|
||||
|
||||
@@ -18,7 +18,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(modid = "ForbiddenMagic", name = "Forbidden Magic", dependencies = "required-after:Thaumcraft;after:ThaumicTinkerer;after:AWWayofTime")
|
||||
@Mod(modid = "ForbiddenMagic", name = "Forbidden Magic", dependencies = "required-after:Thaumcraft;after:ThaumicTinkerer;after:AWWayofTime;after:Botania")
|
||||
public class Forbidden {
|
||||
@Instance("ForbiddenMagic")
|
||||
public static Forbidden instance;
|
||||
|
||||
@@ -2,6 +2,7 @@ package fox.spiteful.forbidden;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import fox.spiteful.forbidden.compat.Compat;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -44,14 +45,17 @@ public class ForbiddenRecipes {
|
||||
|
||||
ForbiddenResearch.recipes.put("Crystalwell", ThaumcraftApi.addShapelessArcaneCraftingRecipe("CRYSTALWELL", new ItemStack(ForbiddenItems.crystalwell, 1, 0), (new AspectList()).add(Aspect.EARTH, 2).add(Aspect.FIRE, 2).add(Aspect.AIR, 2).add(Aspect.WATER, 2).add(Aspect.ORDER, 2).add(Aspect.ENTROPY, 2), new Object[] { ItemApi.getItem("itemInkwell", 32767), "dyeBlack", ItemApi.getItem("itemShard", 32767), ItemApi.getItem("itemShard", 32767) }));
|
||||
|
||||
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(Items.golden_sword), new ItemStack(Items.diamond), new ItemStack(Blocks.gold_block), 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(Items.iron_pickaxe), new ItemStack(Items.lava_bucket), 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(Items.iron_sword), new ItemStack(Items.porkchop), ItemApi.getItem("itemResource", 14) }));
|
||||
ForbiddenResearch.recipes.put("Educational", ThaumcraftApi.addInfusionEnchantmentRecipe("EDUCATIONAL", DarkEnchantments.educational, 3, (new AspectList()).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 4).add(Aspect.MIND, 8), new ItemStack[] { ItemApi.getItem("itemResource", 5), new ItemStack(Items.book), ItemApi.getItem("itemResource", 14) }));
|
||||
ForbiddenResearch.recipes.put("Wrath", ThaumcraftApi.addInfusionEnchantmentRecipe("WRATH", DarkEnchantments.wrath, 8, (new AspectList()).add(DarkAspects.WRATH, 16).add(Aspect.WEAPON, 16).add(DarkAspects.NETHER, 8), new ItemStack[] { ItemApi.getItem("itemResource", 14), new ItemStack(Items.diamond_sword, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0) }));
|
||||
ForbiddenResearch.recipes.put("Educational", ThaumcraftApi.addInfusionEnchantmentRecipe("EDUCATIONAL", DarkEnchantments.educational, 3, (new AspectList()).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 4).add(Aspect.MIND, 8), new ItemStack[] { ItemApi.getItem("itemZombieBrain", 0), new ItemStack(Items.book), ItemApi.getItem("itemResource", 14) }));
|
||||
ForbiddenResearch.recipes.put("Corrupting", ThaumcraftApi.addInfusionEnchantmentRecipe("CORRUPTING", DarkEnchantments.corrupting, 4, (new AspectList()).add(DarkAspects.NETHER, 16).add(Aspect.EXCHANGE, 16).add(Aspect.CRYSTAL, 8), new ItemStack[] { new ItemStack(Items.nether_wart), new ItemStack(Blocks.soul_sand), ItemApi.getItem("itemResource", 14) }));
|
||||
ForbiddenResearch.recipes.put("Eternal", ThaumcraftApi.addInfusionEnchantmentRecipe("ETERNAL", DarkEnchantments.eternal, 12, (new AspectList()).add(Aspect.CRAFT, 32).add(Aspect.TOOL, 64).add(DarkAspects.ENVY, 76).add(Aspect.MAGIC, 64), new ItemStack[] { new ItemStack(Items.nether_star), ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1) }));
|
||||
|
||||
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(!Compat.tc)
|
||||
ForbiddenResearch.recipes.put("Impact", ThaumcraftApi.addInfusionEnchantmentRecipe("IMPACT", DarkEnchantments.impact, 4, (new AspectList()).add(Aspect.ENTROPY, 16).add(Aspect.MINE, 16), new ItemStack[] { ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Blocks.tnt, 1), new ItemStack(Items.stone_pickaxe, 1, 0), new ItemStack(Items.stone_pickaxe, 1, 0) }));
|
||||
ForbiddenResearch.recipes.put("Voidtouched", ThaumcraftApi.addInfusionEnchantmentRecipe("VOIDTOUCHED", DarkEnchantments.voidtouched, 8, (new AspectList()).add(Aspect.VOID, 16).add(Aspect.DARKNESS, 16).add(DarkAspects.ENVY, 24).add(Aspect.ELDRITCH, 16), new ItemStack[] { ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1) }));
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(Items.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(Items.emerald, 1, 0) });
|
||||
|
||||
@@ -3,6 +3,7 @@ package fox.spiteful.forbidden;
|
||||
import java.util.HashMap;
|
||||
|
||||
import fox.spiteful.forbidden.blocks.ForbiddenBlocks;
|
||||
import fox.spiteful.forbidden.compat.Compat;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
@@ -42,7 +43,6 @@ public class ForbiddenResearch {
|
||||
(new DarkResearchItem("CRYSTALWELL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 3).add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 1), -9, 4, 1, new ItemStack(ForbiddenItems.crystalwell, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.CRYSTALWELL.1"), new ResearchPage((IArcaneRecipe) recipes.get("Crystalwell")) }).setParents(new String[] { "RESEARCH" }).setAspectTriggers(new Aspect[] { Aspect.MIND }).setConcealed().registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("CRYSTALWELL", 1);
|
||||
(new DarkResearchItem("CONSUMING", "FORBIDDEN", (new AspectList()).add(Aspect.VOID, 4).add(Aspect.ENTROPY, 3).add(Aspect.MAGIC, 2), -1, 2, 2, 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[] { "INFAUXSIONENCHANTMENT" }).setSecondary().setConcealed().registerResearchItem();
|
||||
(new DarkResearchItem("PIGBANE", "FORBIDDEN", (new AspectList()).add(Aspect.HUNGER, 3).add(Aspect.WEAPON, 4).add(Aspect.MAGIC, 2), -1, 3, 1, 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[] { "INFAUXSIONENCHANTMENT" }).setSecondary().setConcealed().registerResearchItem();
|
||||
(new DarkResearchItem("EDUCATIONAL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 5).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 3), -1, 4, 2, new ResourceLocation("forbidden", "textures/misc/educational.png"))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.EDUCATIONAL.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Educational")) }).setParents(new String[] { "INFAUXSIONENCHANTMENT" }).setSecondary().setConcealed().registerResearchItem();
|
||||
|
||||
}
|
||||
@@ -63,13 +63,18 @@ public class ForbiddenResearch {
|
||||
ThaumcraftApi.addWarpToResearch("MORPHTOOLS", 4);
|
||||
(new DarkResearchItem("ROD_infernal", "FORBIDDEN", (new AspectList()).add(DarkAspects.NETHER, 4).add(Aspect.FIRE, 3).add(Aspect.TOOL, 1), -6, -3, 4, 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();
|
||||
ThaumcraftApi.addWarpToResearch("ROD_infernal", 2);
|
||||
(new DarkResearchItem("CLUSTER", "FORBIDDEN", (new AspectList()).add(Aspect.METAL, 1).add(Aspect.FIRE, 4).add(DarkAspects.ENVY, 3), -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" }).setSecondary().setConcealed().registerResearchItem();
|
||||
|
||||
(new DarkResearchItem("WRATH", "FORBIDDEN", (new AspectList()).add(DarkAspects.WRATH, 16).add(Aspect.WEAPON, 20).add(Aspect.MAGIC, 10), -1, 3, 5, new ResourceLocation("forbidden", "textures/misc/wrath.png"))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.WRATH.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Wrath")) }).setParents(new String[] { "INFAUXSIONENCHANTMENT" }).setConcealed().registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("WRATH", 3);
|
||||
if (Config.greedyEnch)
|
||||
(new DarkResearchItem("GREEDY", "FORBIDDEN", (new AspectList()).add(Aspect.MAGIC, 2).add(Aspect.WEAPON, 1).add(Aspect.GREED, 3), -1, 5, 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();
|
||||
(new DarkResearchItem("CORRUPTING", "FORBIDDEN", (new AspectList()).add(DarkAspects.NETHER, 5).add(Aspect.CRYSTAL, 2).add(Aspect.EXCHANGE, 1), -1, 6, 3, new ResourceLocation("forbidden", "textures/misc/corrupting.png"))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.CORRUPTING.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Corrupting")) }).setParents(new String[] { "INFAUXSIONENCHANTMENT" }).setConcealed().registerResearchItem();
|
||||
|
||||
(new DarkResearchItem("ETERNAL", "FORBIDDEN", (new AspectList()).add(Aspect.MAGIC, 16).add(Aspect.TOOL, 10).add(Aspect.CRAFT, 8).add(DarkAspects.ENVY, 32), -5, 7, 6, new ResourceLocation("forbidden", "textures/misc/eternal.png"))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.ETERNAL.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Eternal")) }).setParents(new String[] { "MORPHTOOLS", "ICHOR_TOOLS" }).setConcealed().registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("ETERNAL", 5);
|
||||
(new DarkResearchItem("CLUSTER", "FORBIDDEN", (new AspectList()).add(Aspect.METAL, 1).add(Aspect.FIRE, 4).add(DarkAspects.ENVY, 3), -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" }).setSecondary().setConcealed().registerResearchItem();
|
||||
if(!Compat.tc)
|
||||
(new DarkResearchItem("IMPACT", "FORBIDDEN", (new AspectList()).add(Aspect.ENTROPY, 8).add(Aspect.TOOL, 10).add(Aspect.MINE, 16).add(DarkAspects.ENVY, 10), -6, 7, 4, new ResourceLocation("forbidden", "textures/misc/impact.png"))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.IMPACT.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Impact")) }).setParents(new String[] { "MORPHTOOLS" }).setConcealed().registerResearchItem();
|
||||
(new DarkResearchItem("VOIDTOUCHED", "FORBIDDEN", (new AspectList()).add(Aspect.ELDRITCH, 16).add(Aspect.TOOL, 10).add(Aspect.CRAFT, 8).add(DarkAspects.ENVY, 32), -5, 7, 4, new ResourceLocation("forbidden", "textures/misc/voidtouched.png"))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.VOIDTOUCHED.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Voidtouched")) }).setParents(new String[] { "MORPHTOOLS", "VOIDMETAL" }).setConcealed().registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("VOIDTOUCHED", 3);
|
||||
|
||||
if (Config.wrathCage) {
|
||||
if (Config.wrathCost > 0)
|
||||
|
||||
@@ -6,13 +6,16 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockResource extends Block {
|
||||
public BlockResource() {
|
||||
super(Material.iron);
|
||||
this.setCreativeTab(Forbidden.tab);
|
||||
}
|
||||
public BlockResource() {
|
||||
|
||||
super(Material.iron);
|
||||
this.setCreativeTab(Forbidden.tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package fox.spiteful.forbidden.compat;
|
||||
|
||||
import fox.spiteful.forbidden.DarkAspects;
|
||||
import fox.spiteful.forbidden.LogHandler;
|
||||
import fox.spiteful.forbidden.*;
|
||||
import fox.spiteful.forbidden.tiles.SubTileEuclidaisy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -13,21 +16,25 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import thaumcraft.api.ItemApi;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||
import thaumcraft.api.crafting.InfusionEnchantmentRecipe;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
import fox.spiteful.forbidden.DarkResearchItem;
|
||||
import fox.spiteful.forbidden.enchantments.DarkEnchantments;
|
||||
import fox.spiteful.forbidden.items.ForbiddenItems;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import vazkii.botania.api.lexicon.LexiconCategory;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.List;
|
||||
|
||||
public class Compat {
|
||||
public static boolean tt = false;
|
||||
@@ -38,7 +45,7 @@ public class Compat {
|
||||
public static boolean bm = false;
|
||||
public static boolean am2 = false;
|
||||
public static boolean botan = false;
|
||||
public static boolean totes = false;
|
||||
public static boolean tc = false;
|
||||
|
||||
public static void initiate() {
|
||||
if (Loader.isModLoaded("ThaumicTinkerer"))
|
||||
@@ -57,6 +64,8 @@ public class Compat {
|
||||
am2 = true;
|
||||
if (Loader.isModLoaded("Botania"))
|
||||
botan = true;
|
||||
if (Loader.isModLoaded("TConstruct"))
|
||||
tc = true;
|
||||
}
|
||||
|
||||
public static void compatify() {
|
||||
@@ -80,13 +89,24 @@ public class Compat {
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(kamiResource, 1, 7), list);
|
||||
|
||||
} catch (Exception e) {
|
||||
LogHandler.log(Level.INFO, e, "We don't have Thaumic Tinkerer's nose.");
|
||||
LogHandler.log(Level.INFO, e, "Forbidden Magic doesn't have Thaumic Tinkerer's nose.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (natura) {
|
||||
if(tc){
|
||||
try {
|
||||
Item hammerHead = GameRegistry.findItem("TConstruct", "hammerHead");
|
||||
InfusionEnchantmentRecipe impact = ThaumcraftApi.addInfusionEnchantmentRecipe("IMPACT", DarkEnchantments.impact, 4, (new AspectList()).add(Aspect.ENTROPY, 16).add(Aspect.MINE, 16), new ItemStack[] { ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Blocks.tnt, 1), new ItemStack(hammerHead, 1, 1), new ItemStack(hammerHead, 1, 1) });
|
||||
(new DarkResearchItem("IMPACT", "FORBIDDEN", (new AspectList()).add(Aspect.ENTROPY, 8).add(Aspect.TOOL, 10).add(Aspect.MINE, 16).add(DarkAspects.ENVY, 10), -6, 7, 4, new ResourceLocation("forbidden", "textures/misc/impact.png"))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.IMPACT.1"), new ResearchPage(impact) }).setParents(new String[] { "MORPHTOOLS" }).setConcealed().registerResearchItem();
|
||||
} catch (Exception e) {
|
||||
LogHandler.log(Level.INFO, e, "Forbidden Magic fell into Tinkers Construct's smeltery.");
|
||||
tc = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (natura) {
|
||||
try {
|
||||
list = (new AspectList()).add(Aspect.BEAST, 2).add(DarkAspects.NETHER, 4).add(DarkAspects.SLOTH, 2);
|
||||
ThaumcraftApi.registerEntityTag("Natura.Imp", list);
|
||||
@@ -184,76 +204,36 @@ public class Compat {
|
||||
BloodMagic.stab();
|
||||
}
|
||||
|
||||
// TODO: Readd ArsMagica2 Support when it's updated
|
||||
/*
|
||||
* if (am2) { try { Class amItems =
|
||||
* Class.forName("am2.items.ItemsCommonProxy"); Class amBlocks =
|
||||
* Class.forName("am2.blocks.BlocksCommonProxy"); Item essence = (Item)
|
||||
* (amItems.getField("essence").get(null)); Item amOre = (Item)
|
||||
* (amItems.getField("itemOre").get(null)); Block witchwood = (Block)
|
||||
* (amBlocks.getField("witchwoodLog").get(null));
|
||||
*
|
||||
* InfusionRecipe witchwood_recipe =
|
||||
* ThaumcraftApi.addInfusionCraftingRecipe("ROD_witchwood", new
|
||||
* ItemStack(ForbiddenItems.wandCore, 1, 4), 5, (new
|
||||
* AspectList()).add(Aspect.MAGIC, 16).add(Aspect.EARTH,
|
||||
* 9).add(Aspect.WATER, 9).add(Aspect.FIRE, 9).add(Aspect.AIR, 9), new
|
||||
* ItemStack(witchwood), new ItemStack[] { new ItemStack(essence, 1, 0),
|
||||
* new ItemStack(amOre, 1, 3), new ItemStack(essence, 1, 1), new
|
||||
* ItemStack(essence, 1, 2), new ItemStack(essence, 1, 3), new
|
||||
* ItemStack(essence, 1, 4), new ItemStack(amOre, 1, 6), new
|
||||
* ItemStack(amOre, 1, 7), new ItemStack(amOre, 1, 2) }); (new
|
||||
* DarkResearchItem("ROD_witchwood", "FORBIDDEN", "[AM2]", (new
|
||||
* AspectList()).add(Aspect.MAGIC, 6).add(Aspect.TREE,
|
||||
* 5).add(Aspect.MIND, 4), -4, -3, 3, new
|
||||
* ItemStack(ForbiddenItems.wandCore, 1, 4))).setPages(new
|
||||
* ResearchPage[] { new
|
||||
* ResearchPage("forbidden.research_page.ROD_witchwood.1"), new
|
||||
* ResearchPage(witchwood_recipe) }).setParents(new String[] {
|
||||
* "ROD_silverwood", "INFAUXSION"
|
||||
* }).setConcealed().registerResearchItem();
|
||||
*
|
||||
* InfusionRecipe vinteum_recipe =
|
||||
* ThaumcraftApi.addInfusionCraftingRecipe("CAP_vinteum", new
|
||||
* ItemStack(ForbiddenItems.wandCap, 1, 1), 5, (new
|
||||
* AspectList()).add(Aspect.ENERGY, 12).add(Aspect.MAGIC, 6),
|
||||
* ItemApi.getItem("itemWandCap", 6), new ItemStack[] { new
|
||||
* ItemStack(amOre, 1, 0), new ItemStack(amOre, 1, 0), new
|
||||
* ItemStack(amOre, 1, 0) }); (new DarkResearchItem("CAP_vinteum",
|
||||
* "FORBIDDEN", "[AM2]", (new AspectList()).add(Aspect.MAGIC,
|
||||
* 4).add(Aspect.TOOL, 1).add(Aspect.ENERGY, 2), -4, -5, 1, new
|
||||
* ItemStack(ForbiddenItems.wandCap, 1, 1))).setPages(new ResearchPage[]
|
||||
* { new ResearchPage("forbidden.research_page.CAP_vinteum.1"), new
|
||||
* ResearchPage(vinteum_recipe) }).setParents(new String[] {
|
||||
* "ROD_witchwood", "CAP_thaumium"
|
||||
* }).setSecondary().setConcealed().registerResearchItem();
|
||||
*
|
||||
* IArcaneRecipe witchwood_staff =
|
||||
* ThaumcraftApi.addArcaneCraftingRecipe("ROD_witchwood_staff", new
|
||||
* ItemStack(ForbiddenItems.wandCore, 1, 10), (new
|
||||
* AspectList()).add(Aspect.ENTROPY, 26).add(Aspect.FIRE,
|
||||
* 26).add(Aspect.WATER, 26).add(Aspect.AIR, 26).add(Aspect.EARTH,
|
||||
* 26).add(Aspect.ORDER, 26), new Object[] { "__D", "_B_", "B__",
|
||||
* Character.valueOf('B'), new ItemStack(ForbiddenItems.wandCore, 1, 4),
|
||||
* Character.valueOf('D'), new ItemStack(essence, 1, 10) }); (new
|
||||
* DarkResearchItem("ROD_witchwood_staff", "FORBIDDEN", "[AM2]", (new
|
||||
* AspectList()).add(Aspect.MAGIC, 8).add(Aspect.MIND,
|
||||
* 7).add(Aspect.TOOL, 6), -4, -7, 5, new
|
||||
* ItemStack(ForbiddenItems.wandCore, 1, 10))).setPages(new
|
||||
* ResearchPage[] { new
|
||||
* ResearchPage("forbidden.research_page.ROD_witchwood_staff.1"), new
|
||||
* ResearchPage(witchwood_staff) }).setParents(new String[] {
|
||||
* "ROD_silverwood_staff", "ROD_witchwood"
|
||||
* }).setSpecial().setConcealed().registerResearchItem(); } catch
|
||||
* (Exception e) { LogHandler.log(Level.INFO, e,
|
||||
* "Forbidden Magic was slain by a Hecate."); am2 = false; } }
|
||||
*/
|
||||
if (am2) {
|
||||
try {
|
||||
Class amItems = Class.forName("am2.items.ItemsCommonProxy");
|
||||
Class amBlocks = Class.forName("am2.blocks.BlocksCommonProxy");
|
||||
Item essence = (Item)(amItems.getField("essence").get(null));
|
||||
Item amOre = (Item)(amItems.getField("itemOre").get(null));
|
||||
Block witchwood = (Block)(amBlocks.getField("witchwoodLog").get(null));
|
||||
|
||||
InfusionRecipe witchwood_recipe = ThaumcraftApi.addInfusionCraftingRecipe("ROD_witchwood", new ItemStack(ForbiddenItems.wandCore, 1, 4), 5, (new AspectList()).add(Aspect.MAGIC, 16).add(Aspect.EARTH, 9).add(Aspect.WATER, 9).add(Aspect.FIRE, 9).add(Aspect.AIR, 9), new ItemStack(witchwood), new ItemStack[]{new ItemStack(essence, 1, 0), new ItemStack(amOre, 1, 3), new ItemStack(essence, 1, 1), new ItemStack(essence, 1, 2), new ItemStack(essence, 1, 3), new ItemStack(essence, 1, 4), new ItemStack(amOre, 1, 6), new ItemStack(amOre, 1, 7), new ItemStack(amOre, 1, 2)});
|
||||
(new DarkResearchItem("ROD_witchwood", "FORBIDDEN", "[AM2]", (new AspectList()).add(Aspect.MAGIC, 6).add(Aspect.TREE, 5).add(Aspect.MIND, 4), -4, -3, 3, new ItemStack(ForbiddenItems.wandCore, 1, 4))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.ROD_witchwood.1"), new ResearchPage(witchwood_recipe)}).setParents(new String[]{ "ROD_silverwood", "INFAUXSION" }).setConcealed().registerResearchItem();
|
||||
|
||||
InfusionRecipe vinteum_recipe = ThaumcraftApi.addInfusionCraftingRecipe("CAP_vinteum", new ItemStack(ForbiddenItems.wandCap, 1, 1), 5, (new AspectList()).add(Aspect.ENERGY, 12).add(Aspect.MAGIC, 6), ItemApi.getItem("itemWandCap", 6), new ItemStack[]{new ItemStack(amOre, 1, 0), new ItemStack(amOre, 1, 0), new ItemStack(amOre, 1, 0)});
|
||||
(new DarkResearchItem("CAP_vinteum", "FORBIDDEN", "[AM2]", (new AspectList()).add(Aspect.MAGIC, 4).add(Aspect.TOOL, 1).add(Aspect.ENERGY, 2), -4, -5, 1, new ItemStack(ForbiddenItems.wandCap, 1, 1))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.CAP_vinteum.1"), new ResearchPage(vinteum_recipe)}).setParents(new String[]{"ROD_witchwood", "CAP_thaumium"}).setSecondary().setConcealed().registerResearchItem();
|
||||
|
||||
IArcaneRecipe witchwood_staff = ThaumcraftApi.addArcaneCraftingRecipe("ROD_witchwood_staff", new ItemStack(ForbiddenItems.wandCore, 1, 10), (new AspectList()).add(Aspect.ENTROPY, 26).add(Aspect.FIRE, 26).add(Aspect.WATER, 26).add(Aspect.AIR, 26).add(Aspect.EARTH, 26).add(Aspect.ORDER, 26), new Object[]{"__D", "_B_", "B__", Character.valueOf('B'), new ItemStack(ForbiddenItems.wandCore, 1, 4), Character.valueOf('D'), new ItemStack(essence, 1, 10)});
|
||||
(new DarkResearchItem("ROD_witchwood_staff", "FORBIDDEN", "[AM2]", (new AspectList()).add(Aspect.MAGIC, 8).add(Aspect.MIND, 7).add(Aspect.TOOL, 6), -4, -7, 5, new ItemStack(ForbiddenItems.wandCore, 1, 10))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.ROD_witchwood_staff.1"), new ResearchPage(witchwood_staff)}).setParents(new String[]{"ROD_silverwood_staff", "ROD_witchwood"}).setSpecial().setConcealed().registerResearchItem();
|
||||
} catch (Exception e) {
|
||||
LogHandler.log(Level.INFO, e, "Forbidden Magic was slain by a Hecate.");
|
||||
am2 = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (botan) {
|
||||
try {
|
||||
Item rune = GameRegistry.findItem("Botania", "rune");
|
||||
Item resource = GameRegistry.findItem("Botania", "manaResource");
|
||||
Item livingLog = GameRegistry.findItem("Botania", "livingwood");
|
||||
Item flower = GameRegistry.findItem("Botania", "flower");
|
||||
Item specialFlower = GameRegistry.findItem("Botania", "specialFlower");
|
||||
Item manaPetal = GameRegistry.findItem("Botania", "manaPetal");
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(resource, 1, 0), new Object[] { "###", "###", "###", Character.valueOf('#'), new ItemStack(ForbiddenItems.resource, 1, 2) });
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenItems.resource, 9, 2), new Object[] { "#", Character.valueOf('#'), new ItemStack(resource, 1, 0) });
|
||||
@@ -266,6 +246,29 @@ public class Compat {
|
||||
IArcaneRecipe manasteel_cap = ThaumcraftApi.addArcaneCraftingRecipe("CAP_manasteel", new ItemStack(ForbiddenItems.wandCap, 1, 4), (new AspectList()).add(Aspect.ENTROPY, 6).add(Aspect.FIRE, 6).add(Aspect.WATER, 6).add(Aspect.AIR, 6).add(Aspect.EARTH, 6).add(Aspect.ORDER, 6), new Object[] { "NNN", "N N", Character.valueOf('N'), new ItemStack(ForbiddenItems.resource, 1, 2) });
|
||||
(new DarkResearchItem("CAP_manasteel", "FORBIDDEN", "[B]", (new AspectList()).add(Aspect.ELDRITCH, 3).add(Aspect.MAGIC, 2).add(Aspect.ENTROPY, 4), -1, -5, 2, new ItemStack(ForbiddenItems.wandCap, 1, 3))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.CAP_manasteel.1"), new ResearchPage(manasteel_cap) }).setParents(new String[] { "ROD_livingwood" }).setSecondary().setConcealed().registerResearchItem();
|
||||
BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ForbiddenItems.wandCap, 1, 3), new ItemStack(ForbiddenItems.wandCap, 1, 4), 1000);
|
||||
|
||||
BotaniaAPI.registerSubTile("euclidaisy", SubTileEuclidaisy.class);
|
||||
BotaniaAPI.registerSubTileSignature(SubTileEuclidaisy.class, new DarkSignature("euclidaisy"));
|
||||
BotaniaAPI.addSubTileToCreativeMenu("euclidaisy");
|
||||
|
||||
List<LexiconCategory> cats = BotaniaAPI.getAllCategories();
|
||||
LexiconCategory functional = null;
|
||||
for(LexiconCategory cat : cats){
|
||||
if(cat.getUnlocalizedName().equals("botania.category.functionalFlowers"))
|
||||
functional = cat;
|
||||
}
|
||||
SubTileEuclidaisy.lexicon = new ForbiddenLexicon("euclidaisy", functional);
|
||||
|
||||
SubTileEuclidaisy.lexicon.addPage(BotaniaAPI.internalHandler.textPage("forbidden.lexicon.euclidaisy.0"));
|
||||
|
||||
ItemStack euclidaisy = new ItemStack(specialFlower, 1, 0);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("type", "euclidaisy");
|
||||
euclidaisy.setTagCompound(tag);
|
||||
|
||||
InfusionRecipe euclid = ThaumcraftApi.addInfusionCraftingRecipe("EUCLIDAISY", euclidaisy, 8, (new AspectList()).add(Aspect.AURA, 8).add(Aspect.ELDRITCH, 10).add(Aspect.MAGIC, 8), new ItemStack(flower, 1, 6), new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(resource, 1, 8), new ItemStack(resource, 1, 6), new ItemStack(manaPetal, 1, 6), new ItemStack(manaPetal, 1, 6), new ItemStack(rune, 1, 12), new ItemStack(rune, 1, 11) });
|
||||
(new DarkResearchItem("EUCLIDAISY", "FORBIDDEN", "[B]", (new AspectList()).add(Aspect.PLANT, 8).add(Aspect.MAGIC, 4).add(Aspect.AURA, 12), -7, 5, 3, euclidaisy)).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.EUCLIDAISY.1"), new ResearchPage(euclid) }).setParents(new String[] { "INFAUXSION" }).setConcealed().registerResearchItem();
|
||||
|
||||
} catch (Throwable e) {
|
||||
LogHandler.log(Level.INFO, e, "Forbidden Magic: Botania? Do you wanna build a snowman?");
|
||||
botan = false;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package fox.spiteful.forbidden.compat;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.botania.api.subtile.signature.SubTileSignature;
|
||||
|
||||
public class DarkSignature extends SubTileSignature {
|
||||
String name;
|
||||
IIcon icon;
|
||||
|
||||
public DarkSignature(String nombre){
|
||||
name = nombre;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister reg){
|
||||
icon = reg.registerIcon("forbidden:" + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconForStack(ItemStack item){
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForStack(ItemStack item){
|
||||
return "tile.darkflower." + name + ".name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedLoreTextForStack(ItemStack item){
|
||||
return "tile.darkflower." + name + ".lore";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package fox.spiteful.forbidden.compat;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.IAddonEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconCategory;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
|
||||
public class ForbiddenLexicon extends LexiconEntry implements IAddonEntry {
|
||||
|
||||
|
||||
public ForbiddenLexicon(String name, LexiconCategory category){
|
||||
super(name, category);
|
||||
BotaniaAPI.addEntry(this, category);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSubtitle(){
|
||||
return "[Forbidden Magic]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "forbidden.lexicon." + super.getUnlocalizedName();
|
||||
}
|
||||
}
|
||||
@@ -10,30 +10,33 @@ import fox.spiteful.forbidden.Config;
|
||||
|
||||
public class DarkEnchantments {
|
||||
public static Enchantment cluster;
|
||||
public static Enchantment pigBane;
|
||||
public static Enchantment wrath;
|
||||
public static Enchantment greedy;
|
||||
public static Enchantment consuming;
|
||||
public static Enchantment educational;
|
||||
public static Enchantment corrupting;
|
||||
public static Enchantment eternal;
|
||||
public static Enchantment voidtouched;
|
||||
public static Enchantment impact;
|
||||
|
||||
public static void hex() {
|
||||
cluster = new EnchantmentCluster(Config.clusterEnchID);
|
||||
pigBane = new EnchantmentPigBane(Config.pigBaneEnchID);
|
||||
wrath = new EnchantmentWrath(Config.wrathEnchID);
|
||||
greedy = new EnchantmentGreedy(Config.greedyEnchID);
|
||||
consuming = new EnchantmentConsuming(Config.consumingEnchID);
|
||||
educational = new EnchantmentEducational(Config.educationalEnchID);
|
||||
corrupting = new EnchantmentCorrupting(Config.corruptingEnchID);
|
||||
eternal = new EnchantmentEternal(Config.eternalEnchID);
|
||||
voidtouched = new EnchantmentVoid(Config.voidEnchID);
|
||||
impact = new EnchantmentImpact(Config.impactEnchID);
|
||||
|
||||
if (Compat.tt) {
|
||||
try {
|
||||
EnchantmentManager.registerExponentialCostData(pigBane, "forbidden:textures/misc/pigbane.png", false, (new AspectList()).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), "PIGBANE");
|
||||
EnchantmentManager.registerExponentialCostData(wrath, "forbidden:textures/misc/pigbane.png", false, (new AspectList()).add(Aspect.ENTROPY, 6).add(Aspect.FIRE, 6), "WRATH");
|
||||
EnchantmentManager.registerExponentialCostData(cluster, "forbidden:textures/misc/lucrative.png", false, (new AspectList()).add(Aspect.FIRE, 5).add(Aspect.EARTH, 5).add(Aspect.ORDER, 5), "CLUSTER");
|
||||
EnchantmentManager.registerExponentialCostData(greedy, "forbidden:textures/misc/greedy.png", false, (new AspectList()).add(Aspect.ENTROPY, 50).add(Aspect.EARTH, 30).add(Aspect.ORDER, 20), "GREEDY");
|
||||
EnchantmentManager.registerExponentialCostData(educational, "forbidden:textures/misc/educational.png", false, new AspectList().add(Aspect.AIR, 10).add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 15).add(Aspect.ENTROPY, 15), "EDUCATIONAL");
|
||||
EnchantmentManager.registerExponentialCostData(consuming, "forbidden:textures/misc/consuming.png", false, (new AspectList()).add(Aspect.ENTROPY, 10), "CONSUMING");
|
||||
EnchantmentManager.registerExponentialCostData(corrupting, "forbidden:textures/misc/corrupting.png", false, (new AspectList()).add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 15).add(Aspect.EARTH, 10), "CORRUPTING");
|
||||
EnchantmentManager.registerExponentialCostData(voidtouched, "forbidden:textures/misc/voidtouched.png", false, (new AspectList()).add(Aspect.ENTROPY, 70), "VOIDTOUCHED");
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package fox.spiteful.forbidden.enchantments;
|
||||
|
||||
import fox.spiteful.forbidden.items.ItemMorphAxe;
|
||||
import fox.spiteful.forbidden.items.ItemMorphPickaxe;
|
||||
import fox.spiteful.forbidden.items.ItemMorphShovel;
|
||||
import fox.spiteful.forbidden.items.ItemMorphSword;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnumEnchantmentType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class EnchantmentImpact extends Enchantment {
|
||||
public EnchantmentImpact(int id) {
|
||||
super(id, 0, EnumEnchantmentType.digger);
|
||||
setName("impact");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinEnchantability(int par1) {
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnchantability(int par1) {
|
||||
return super.getMinEnchantability(par1) + 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApply(ItemStack item) {
|
||||
return (item.getItem() instanceof ItemMorphPickaxe || item.getItem() instanceof ItemMorphShovel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApplyAtEnchantingTable(ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package fox.spiteful.forbidden.enchantments;
|
||||
|
||||
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
|
||||
public int getMaxLevel() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinEnchantability(int par1) {
|
||||
return 1 + (par1 - 1) * 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnchantability(int par1) {
|
||||
return this.getMinEnchantability(par1) + 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApplyTogether(Enchantment ench) {
|
||||
return super.canApplyTogether(ench) && ench.effectId != Enchantment.sharpness.effectId && ench.effectId != Enchantment.smite.effectId && ench.effectId != Enchantment.baneOfArthropods.effectId;
|
||||
}
|
||||
|
||||
public float calcModifierLiving(int level, EntityLivingBase victim) {
|
||||
if (victim instanceof EntityPig || victim instanceof EntityPigZombie)
|
||||
return (float) level * 4.0F;
|
||||
else
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApplyAtEnchantingTable(ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+5
-10
@@ -9,10 +9,10 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import fox.spiteful.forbidden.items.ItemMorphShovel;
|
||||
|
||||
public class EnchantmentEternal extends Enchantment {
|
||||
public EnchantmentEternal(int id) {
|
||||
public class EnchantmentVoid extends Enchantment {
|
||||
public EnchantmentVoid(int id) {
|
||||
super(id, 0, EnumEnchantmentType.digger);
|
||||
setName("eternal");
|
||||
setName("voidtouched");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -22,17 +22,12 @@ public class EnchantmentEternal extends Enchantment {
|
||||
|
||||
@Override
|
||||
public int getMinEnchantability(int par1) {
|
||||
return 70;
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnchantability(int par1) {
|
||||
return super.getMinEnchantability(par1) + 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApplyTogether(Enchantment ench) {
|
||||
return super.canApplyTogether(ench) && ench.effectId != Enchantment.unbreaking.effectId && ench.effectId != DarkEnchantments.educational.effectId;
|
||||
return super.getMinEnchantability(par1) + 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +1,61 @@
|
||||
package fox.spiteful.forbidden.enchantments;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnumEnchantmentType;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.EnumCreatureAttribute;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
public class EnchantmentWrath extends Enchantment
|
||||
{
|
||||
public EnchantmentWrath(int id)
|
||||
{
|
||||
super(id, 0, EnumEnchantmentType.weapon);
|
||||
setName("wrath");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimal value of enchantability needed on the enchantment level passed.
|
||||
*/
|
||||
public int getMinEnchantability(int level)
|
||||
{
|
||||
return 5 + (level - 1) * 11;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum value of enchantability nedded on the enchantment level passed.
|
||||
*/
|
||||
public int getMaxEnchantability(int level)
|
||||
{
|
||||
return this.getMinEnchantability(level) + 20;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum level that the enchantment can have.
|
||||
*/
|
||||
public int getMaxLevel()
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
//Amount of bonus damage added by the enchant on hit
|
||||
public float func_152376_a(int level, EnumCreatureAttribute target)
|
||||
{
|
||||
return (float)level * 1.25F;
|
||||
}
|
||||
|
||||
public boolean canApply(ItemStack stack)
|
||||
{
|
||||
return stack.getItem() instanceof ItemAxe ? true : super.canApply(stack);
|
||||
}
|
||||
|
||||
//Effect that enchant does on hit
|
||||
public void func_151368_a(EntityLivingBase wut, Entity who, int level)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,9 @@ import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
|
||||
public class ItemDivineOrb extends Item implements IBloodOrb, IBindable {
|
||||
public class ItemDivineOrb extends Item implements IBloodOrb, IBindable, IWarpingGear {
|
||||
public ItemDivineOrb() {
|
||||
setCreativeTab(Forbidden.tab);
|
||||
AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(this), 5, 140);
|
||||
@@ -76,4 +77,8 @@ public class ItemDivineOrb extends Item implements IBloodOrb, IBindable {
|
||||
public int getOrbLevel() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public int getWarp(ItemStack itemstack, EntityPlayer player) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package fox.spiteful.forbidden.items;
|
||||
import fox.spiteful.forbidden.Forbidden;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
@@ -17,8 +19,9 @@ import fox.spiteful.forbidden.enchantments.DarkEnchantments;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
|
||||
public class ItemMorphAxe extends ItemAxe implements IRepairable {
|
||||
public class ItemMorphAxe extends ItemAxe implements IRepairable, IWarpingGear {
|
||||
public IIcon[] icon;
|
||||
|
||||
public ItemMorphAxe(ToolMaterial enumtoolmaterial) {
|
||||
@@ -112,11 +115,19 @@ public class ItemMorphAxe extends ItemAxe implements IRepairable {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
if (EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.eternal.effectId, stack) > 0)
|
||||
super.setDamage(stack, 0);
|
||||
else
|
||||
super.setDamage(stack, damage);
|
||||
}
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int fuckObfuscation, boolean fuckObfuscation2) {
|
||||
super.onUpdate(stack, world, entity, fuckObfuscation, fuckObfuscation2);
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, stack) > 0 && stack.isItemDamaged() && entity != null && entity.ticksExisted % 10 == 0 && entity instanceof EntityLivingBase) {
|
||||
stack.damageItem(-1, (EntityLivingBase)entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getWarp(ItemStack itemstack, EntityPlayer player) {
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, itemstack) > 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,27 @@
|
||||
package fox.spiteful.forbidden.items;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.play.client.C07PacketPlayerDigging;
|
||||
import net.minecraft.network.play.server.S23PacketBlockChange;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
import fox.spiteful.forbidden.Forbidden;
|
||||
@@ -17,8 +29,9 @@ import fox.spiteful.forbidden.enchantments.DarkEnchantments;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
|
||||
public class ItemMorphPickaxe extends ItemPickaxe implements IRepairable {
|
||||
public class ItemMorphPickaxe extends ItemPickaxe implements IRepairable, IWarpingGear {
|
||||
public IIcon[] icon;
|
||||
|
||||
public ItemMorphPickaxe(ToolMaterial enumtoolmaterial) {
|
||||
@@ -117,11 +130,151 @@ public class ItemMorphPickaxe extends ItemPickaxe implements IRepairable {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
if (EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.eternal.effectId, stack) > 0)
|
||||
super.setDamage(stack, 0);
|
||||
else
|
||||
super.setDamage(stack, damage);
|
||||
}
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int fuckObfuscation, boolean fuckObfuscation2) {
|
||||
super.onUpdate(stack, world, entity, fuckObfuscation, fuckObfuscation2);
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, stack) > 0 && stack.isItemDamaged() && entity != null && entity.ticksExisted % 10 == 0 && entity instanceof EntityLivingBase) {
|
||||
stack.damageItem(-1, (EntityLivingBase)entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getWarp(ItemStack itemstack, EntityPlayer player) {
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, itemstack) > 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Public Domain AOE code courtesy of Tinkers Construct's authors
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
|
||||
// only effective materials matter. We don't want to aoe when beraking dirt with a hammer.
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.impact.effectId, stack) <= 0)
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
Block block = player.worldObj.getBlock(x,y,z);
|
||||
int meta = player.worldObj.getBlockMetadata(x,y,z);
|
||||
if(block == null || !ForgeHooks.isToolEffective(stack, block, meta))
|
||||
return super.onBlockStartBreak(stack, x,y,z, player);
|
||||
MovingObjectPosition mop = raytraceFromEntity(player.worldObj, player, false, 4.5d);
|
||||
if(mop == null)
|
||||
return super.onBlockStartBreak(stack, x,y,z, player);
|
||||
int sideHit = mop.sideHit;
|
||||
//int sideHit = Minecraft.getMinecraft().objectMouseOver.sideHit;
|
||||
// we successfully destroyed a block. time to do AOE!
|
||||
int xRange = 1;
|
||||
int yRange = 1;
|
||||
int zRange = 0;
|
||||
switch (sideHit) {
|
||||
case 0:
|
||||
case 1:
|
||||
yRange = 0;
|
||||
zRange = 1;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
xRange = 1;
|
||||
zRange = 0;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
xRange = 0;
|
||||
zRange = 1;
|
||||
break;
|
||||
}
|
||||
for (int xPos = x - xRange; xPos <= x + xRange; xPos++)
|
||||
for (int yPos = y - yRange; yPos <= y + yRange; yPos++)
|
||||
for (int zPos = z - zRange; zPos <= z + zRange; zPos++) {
|
||||
// don't break the originally already broken block, duh
|
||||
if (xPos == x && yPos == y && zPos == z)
|
||||
continue;
|
||||
breakExtraBlock(player.worldObj, stack, xPos, yPos, zPos, sideHit, player, x,y,z);
|
||||
}
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
}
|
||||
|
||||
public static MovingObjectPosition raytraceFromEntity (World world, Entity player, boolean par3, double range)
|
||||
{
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f;
|
||||
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f;
|
||||
if (!world.isRemote && player instanceof EntityPlayer)
|
||||
d1 += 1.62D;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
|
||||
Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.017453292F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = range;
|
||||
if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
|
||||
}
|
||||
Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
return world.func_147447_a(vec3, vec31, par3, !par3, par3);
|
||||
}
|
||||
|
||||
protected void breakExtraBlock(World world, ItemStack stack, int x, int y, int z, int sidehit, EntityPlayer player, int refX, int refY, int refZ) {
|
||||
// prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events
|
||||
if (world.isAirBlock(x, y, z))
|
||||
return;
|
||||
// check if the block can be broken, since extra block breaks shouldn't instantly break stuff like obsidian
|
||||
// or precious ores you can't harvest while mining stone
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
// only effective materials
|
||||
if (!ForgeHooks.isToolEffective(stack, block, meta))
|
||||
return;
|
||||
Block refBlock = world.getBlock(refX, refY, refZ);
|
||||
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
|
||||
float strength = ForgeHooks.blockStrength(block, player, world, x,y,z);
|
||||
// only harvestable blocks that aren't impossibly slow to harvest
|
||||
if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f)
|
||||
return;
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
block.onBlockHarvested(world, x, y, z, meta, player);
|
||||
if (block.removedByPlayer(world, player, x, y, z, false))
|
||||
block.onBlockDestroyedByPlayer(world, x, y, z, meta);
|
||||
// send update to client
|
||||
if (!world.isRemote) {
|
||||
((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
|
||||
}
|
||||
return;
|
||||
}
|
||||
// server sided handling
|
||||
if (!world.isRemote) {
|
||||
// serverside we reproduce ItemInWorldManager.tryHarvestBlock
|
||||
// ItemInWorldManager.removeBlock
|
||||
block.onBlockHarvested(world, x,y,z, meta, player);
|
||||
if(block.removedByPlayer(world, player, x,y,z, true)) // boolean is if block can be harvested, checked above
|
||||
{
|
||||
block.onBlockDestroyedByPlayer( world, x,y,z, meta);
|
||||
block.harvestBlock(world, player, x,y,z, meta);
|
||||
}
|
||||
// always send block update to client
|
||||
EntityPlayerMP mpPlayer = (EntityPlayerMP) player;
|
||||
mpPlayer.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
|
||||
}
|
||||
// client sided handling
|
||||
else {
|
||||
PlayerControllerMP pcmp = Minecraft.getMinecraft().playerController;
|
||||
// clientside we do a "this clock has been clicked on long enough to be broken" call. This should not send any new packets
|
||||
// the code above, executed on the server, sends a block-updates that give us the correct state of the block we destroy.
|
||||
// following code can be found in PlayerControllerMP.onPlayerDestroyBlock
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
|
||||
if(block.removedByPlayer(world, player, x,y,z))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, x,y,z, meta);
|
||||
}
|
||||
pcmp.onPlayerDestroyBlock(x, y, z, sidehit);
|
||||
// send an update to the server, so we get an update back
|
||||
//if(PHConstruct.extraBlockUpdates)
|
||||
Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, x,y,z, Minecraft.getMinecraft().objectMouseOver.sideHit));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,22 +2,33 @@ package fox.spiteful.forbidden.items;
|
||||
|
||||
import fox.spiteful.forbidden.Forbidden;
|
||||
import fox.spiteful.forbidden.enchantments.DarkEnchantments;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.play.client.C07PacketPlayerDigging;
|
||||
import net.minecraft.network.play.server.S23PacketBlockChange;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
|
||||
public class ItemMorphShovel extends ItemSpade implements IRepairable {
|
||||
public class ItemMorphShovel extends ItemSpade implements IRepairable, IWarpingGear {
|
||||
public IIcon[] icon;
|
||||
|
||||
public ItemMorphShovel(ToolMaterial enumtoolmaterial) {
|
||||
@@ -111,12 +122,126 @@ public class ItemMorphShovel extends ItemSpade implements IRepairable {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
if (EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.eternal.effectId, stack) > 0)
|
||||
super.setDamage(stack, 0);
|
||||
else
|
||||
super.setDamage(stack, damage);
|
||||
}
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int fuckObfuscation, boolean fuckObfuscation2) {
|
||||
super.onUpdate(stack, world, entity, fuckObfuscation, fuckObfuscation2);
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, stack) > 0 && stack.isItemDamaged() && entity != null && entity.ticksExisted % 10 == 0 && entity instanceof EntityLivingBase) {
|
||||
stack.damageItem(-1, (EntityLivingBase)entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getWarp(ItemStack itemstack, EntityPlayer player) {
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, itemstack) > 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Public Domain AOE code courtesy of Tinkers Construct's authors
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
|
||||
// only effective materials matter. We don't want to aoe when beraking dirt with a hammer.
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.impact.effectId, stack) <= 0)
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
Block block = player.worldObj.getBlock(x,y,z);
|
||||
int meta = player.worldObj.getBlockMetadata(x,y,z);
|
||||
if(block == null || !ForgeHooks.isToolEffective(stack, block, meta))
|
||||
return super.onBlockStartBreak(stack, x,y,z, player);
|
||||
MovingObjectPosition mop = ItemMorphPickaxe.raytraceFromEntity(player.worldObj, player, false, 4.5d);
|
||||
if(mop == null)
|
||||
return super.onBlockStartBreak(stack, x,y,z, player);
|
||||
int sideHit = mop.sideHit;
|
||||
//int sideHit = Minecraft.getMinecraft().objectMouseOver.sideHit;
|
||||
// we successfully destroyed a block. time to do AOE!
|
||||
int xRange = 1;
|
||||
int yRange = 1;
|
||||
int zRange = 0;
|
||||
switch (sideHit) {
|
||||
case 0:
|
||||
case 1:
|
||||
yRange = 0;
|
||||
zRange = 1;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
xRange = 1;
|
||||
zRange = 0;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
xRange = 0;
|
||||
zRange = 1;
|
||||
break;
|
||||
}
|
||||
for (int xPos = x - xRange; xPos <= x + xRange; xPos++)
|
||||
for (int yPos = y - yRange; yPos <= y + yRange; yPos++)
|
||||
for (int zPos = z - zRange; zPos <= z + zRange; zPos++) {
|
||||
// don't break the originally already broken block, duh
|
||||
if (xPos == x && yPos == y && zPos == z)
|
||||
continue;
|
||||
breakExtraBlock(player.worldObj, stack, xPos, yPos, zPos, sideHit, player, x,y,z);
|
||||
}
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
}
|
||||
|
||||
protected void breakExtraBlock(World world, ItemStack stack, int x, int y, int z, int sidehit, EntityPlayer player, int refX, int refY, int refZ) {
|
||||
// prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events
|
||||
if (world.isAirBlock(x, y, z))
|
||||
return;
|
||||
// check if the block can be broken, since extra block breaks shouldn't instantly break stuff like obsidian
|
||||
// or precious ores you can't harvest while mining stone
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
// only effective materials
|
||||
if (!ForgeHooks.isToolEffective(stack, block, meta))
|
||||
return;
|
||||
Block refBlock = world.getBlock(refX, refY, refZ);
|
||||
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
|
||||
float strength = ForgeHooks.blockStrength(block, player, world, x,y,z);
|
||||
// only harvestable blocks that aren't impossibly slow to harvest
|
||||
if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f)
|
||||
return;
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
block.onBlockHarvested(world, x, y, z, meta, player);
|
||||
if (block.removedByPlayer(world, player, x, y, z, false))
|
||||
block.onBlockDestroyedByPlayer(world, x, y, z, meta);
|
||||
// send update to client
|
||||
if (!world.isRemote) {
|
||||
((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
|
||||
}
|
||||
return;
|
||||
}
|
||||
// server sided handling
|
||||
if (!world.isRemote) {
|
||||
// serverside we reproduce ItemInWorldManager.tryHarvestBlock
|
||||
// ItemInWorldManager.removeBlock
|
||||
block.onBlockHarvested(world, x,y,z, meta, player);
|
||||
if(block.removedByPlayer(world, player, x,y,z, true)) // boolean is if block can be harvested, checked above
|
||||
{
|
||||
block.onBlockDestroyedByPlayer( world, x,y,z, meta);
|
||||
block.harvestBlock(world, player, x,y,z, meta);
|
||||
}
|
||||
// always send block update to client
|
||||
EntityPlayerMP mpPlayer = (EntityPlayerMP) player;
|
||||
mpPlayer.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
|
||||
}
|
||||
// client sided handling
|
||||
else {
|
||||
PlayerControllerMP pcmp = Minecraft.getMinecraft().playerController;
|
||||
// clientside we do a "this clock has been clicked on long enough to be broken" call. This should not send any new packets
|
||||
// the code above, executed on the server, sends a block-updates that give us the correct state of the block we destroy.
|
||||
// following code can be found in PlayerControllerMP.onPlayerDestroyBlock
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
|
||||
if(block.removedByPlayer(world, player, x,y,z))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, x,y,z, meta);
|
||||
}
|
||||
pcmp.onPlayerDestroyBlock(x, y, z, sidehit);
|
||||
// send an update to the server, so we get an update back
|
||||
//if(PHConstruct.extraBlockUpdates)
|
||||
Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, x,y,z, Minecraft.getMinecraft().objectMouseOver.sideHit));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package fox.spiteful.forbidden.items;
|
||||
import fox.spiteful.forbidden.Forbidden;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -17,8 +19,9 @@ import fox.spiteful.forbidden.enchantments.DarkEnchantments;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
|
||||
public class ItemMorphSword extends ItemSword implements IRepairable {
|
||||
public class ItemMorphSword extends ItemSword implements IRepairable, IWarpingGear {
|
||||
public IIcon[] icon;
|
||||
|
||||
public ItemMorphSword(ToolMaterial enumtoolmaterial) {
|
||||
@@ -113,11 +116,18 @@ public class ItemMorphSword extends ItemSword implements IRepairable {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
if (EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.eternal.effectId, stack) > 0)
|
||||
super.setDamage(stack, 0);
|
||||
else
|
||||
super.setDamage(stack, damage);
|
||||
}
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int fuckObfuscation, boolean fuckObfuscation2) {
|
||||
super.onUpdate(stack, world, entity, fuckObfuscation, fuckObfuscation2);
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, stack) > 0 && stack.isItemDamaged() && entity != null && entity.ticksExisted % 10 == 0 && entity instanceof EntityLivingBase) {
|
||||
stack.damageItem(-1, (EntityLivingBase)entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getWarp(ItemStack itemstack, EntityPlayer player) {
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.voidtouched.effectId, itemstack) > 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -67,12 +67,12 @@ public class ItemWandCores extends Item {
|
||||
((ItemWandCasting) wand.getItem()).setCap(wand, (WandCap) WandCap.caps.get("orichalcum"));
|
||||
((ItemWandCasting) wand.getItem()).setRod(wand, (WandRod) WandRod.rods.get("neutronium_staff"));
|
||||
list.add(wand);
|
||||
if (Compat.pb) {
|
||||
/*if (Compat.pb) {
|
||||
wand = ItemApi.getItem("itemWandCasting", 84);
|
||||
((ItemWandCasting) wand.getItem()).setCap(wand, (WandCap) WandCap.caps.get("soul"));
|
||||
((ItemWandCasting) wand.getItem()).setRod(wand, (WandRod) WandRod.rods.get("soul"));
|
||||
list.add(wand);
|
||||
}
|
||||
}*/
|
||||
if (Compat.bm) {
|
||||
wand = ItemApi.getItem("itemWandCasting", 84);
|
||||
((ItemWandCasting) wand.getItem()).setCap(wand, (WandCap) WandCap.caps.get("alchemical"));
|
||||
@@ -93,12 +93,6 @@ public class ItemWandCores extends Item {
|
||||
((ItemWandCasting) wand.getItem()).setRod(wand, (WandRod) WandRod.rods.get("witchwood_staff"));
|
||||
list.add(wand);
|
||||
}
|
||||
if (Compat.totes) {
|
||||
wand = ItemApi.getItem("itemWandCasting", 24);
|
||||
((ItemWandCasting) wand.getItem()).setCap(wand, (WandCap) WandCap.caps.get("thaumium"));
|
||||
((ItemWandCasting) wand.getItem()).setRod(wand, (WandRod) WandRod.rods.get("totem"));
|
||||
list.add(wand);
|
||||
}
|
||||
if (Compat.botan) {
|
||||
wand = ItemApi.getItem("itemWandCasting", 84);
|
||||
((ItemWandCasting) wand.getItem()).setCap(wand, (WandCap) WandCap.caps.get("manasteel"));
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package fox.spiteful.forbidden.items.wands;
|
||||
|
||||
import am2.api.ArsMagicaApi;
|
||||
import am2.api.IExtendedProperties;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.wands.IWandRodOnUpdate;
|
||||
|
||||
import fox.spiteful.forbidden.compat.Compat;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class ManaWandUpdate implements IWandRodOnUpdate {
|
||||
|
||||
@@ -18,8 +21,7 @@ public class ManaWandUpdate implements IWandRodOnUpdate {
|
||||
|
||||
try
|
||||
{
|
||||
//TODO: Readd Ars Magica
|
||||
/* IExtendedProperties prop = ArsMagicaApi.instance.getExtendedProperties(player);
|
||||
IExtendedProperties prop = ArsMagicaApi.instance.getExtendedProperties(player);
|
||||
|
||||
float cost;
|
||||
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("vinteum"))
|
||||
@@ -39,7 +41,7 @@ public class ManaWandUpdate implements IWandRodOnUpdate {
|
||||
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
|
||||
}
|
||||
}
|
||||
} */
|
||||
}
|
||||
}
|
||||
catch(Throwable e){}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package fox.spiteful.forbidden.tiles;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.items.ItemWispEssence;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
|
||||
public class SubTileEuclidaisy extends SubTileFunctional {
|
||||
private static final int cost = 9000;
|
||||
public static LexiconEntry lexicon;
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
super.onUpdate();
|
||||
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
if(mana >= cost && !supertile.getWorldObj().isRemote && supertile.getWorldObj().getTotalWorldTime() % 400 == 0) {
|
||||
Thaumcraft.proxy.burst(supertile.getWorldObj(), (double)supertile.xCoord + 0.5D, (double)supertile.yCoord + 0.5D, (double)supertile.zCoord + 0.5D, 1.0F);
|
||||
AspectList aspect;
|
||||
if(supertile.getWorldObj().rand.nextInt(10) < 4)
|
||||
aspect = (new AspectList()).add(Aspect.AURA, 2);
|
||||
else {
|
||||
Aspect[] aspects = Aspect.aspects.values().toArray(new Aspect[0]);
|
||||
aspect = (new AspectList()).add(aspects[supertile.getWorldObj().rand.nextInt(aspects.length)], 2);
|
||||
}
|
||||
ItemStack ess = new ItemStack(ConfigItems.itemWispEssence);
|
||||
((ItemWispEssence)ess.getItem()).setAspects(ess, aspect);
|
||||
dropItem(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord, supertile.zCoord, ess);
|
||||
mana -= cost;
|
||||
sync();
|
||||
}
|
||||
}
|
||||
|
||||
public void dropItem(World world, int x, int y, int z, ItemStack item){
|
||||
float f = 0.7F;
|
||||
double d0 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
EntityItem entityitem = new EntityItem(world, (double)x + d0, (double)y + d1, (double)z + d2, item);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor(){
|
||||
return 0xFF8CFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(){
|
||||
return lexicon;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user