mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-20 12:09:50 +00:00
Adding Educational enchant
Putting in the pieces for the Educational enchant. Disabled use of the Cured Brains. Doubling up on infusions seemed too pointlessly grindy.
This commit is contained in:
1 parent
7460a99149
commit
2caf7d54b6
7 files changed
+47
-22
No files matched your search
@@ -40,6 +40,7 @@ public class Compat {
|
||||
public static boolean bm = false;
|
||||
|
||||
public static int tabletID = -1;
|
||||
public static int curedBrainID = -1;
|
||||
|
||||
public static void initiate()
|
||||
{
|
||||
@@ -93,6 +94,19 @@ public class Compat {
|
||||
}
|
||||
}
|
||||
|
||||
//if(tx)
|
||||
//{
|
||||
//try
|
||||
//{
|
||||
//curedBrainID = ((Item)(Class.forName("flaxbeard.thaumicexploration.ThaumicExploration").getField("pureZombieBrain").get(null))).itemID;
|
||||
//}
|
||||
//catch(Exception e)
|
||||
//{
|
||||
//FMLLog.log(Level.INFO, e, "Forbidden Magic trusts not a man who's made of flax.");
|
||||
//e.printStackTrace();
|
||||
//}
|
||||
//}
|
||||
|
||||
if(natura)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -48,6 +48,7 @@ public class Config
|
||||
public static int pigBaneEnchID;
|
||||
public static int greedyEnchID;
|
||||
public static int consumingEnchID;
|
||||
public static int educationalEnchID;
|
||||
|
||||
public static int thaumcraftResourceID;
|
||||
public static int thaumcraftTaintBlockID;
|
||||
@@ -95,10 +96,11 @@ public class Config
|
||||
wrathCageID = conf.getBlock("Wrath Cage", blockCount++).getInt();
|
||||
|
||||
int enchCount = 66;
|
||||
clusterEnchID = conf.get("enchantments", "Lucrative", enchCount++).getInt();
|
||||
clusterEnchID = conf.get("enchantments", "Fiery Core", enchCount++).getInt();
|
||||
pigBaneEnchID = conf.get("enchantments", "Porcivore", enchCount++).getInt();
|
||||
greedyEnchID = conf.get("enchantments", "Greedy", enchCount++).getInt();
|
||||
consumingEnchID = conf.get("enchantments", "Consuming", enchCount++).getInt();
|
||||
educationalEnchID = conf.get("enchantments", "Educational", enchCount++).getInt();
|
||||
|
||||
Property nl = conf.get("general", "No Lust", noLust);
|
||||
nl.comment = "Enable to remove Luxuria aspect and related items.";
|
||||
|
||||
@@ -13,6 +13,7 @@ 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.item.EntityXPOrb;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
@@ -215,8 +216,11 @@ public class FMEventHandler
|
||||
@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){
|
||||
&& ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem() != null)
|
||||
{
|
||||
ItemStack equip = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
|
||||
|
||||
if(equip.itemID == ForbiddenItems.fork.itemID){
|
||||
String name = null;
|
||||
try {
|
||||
name = EntityList.getEntityString(event.entityLiving);
|
||||
@@ -235,6 +239,19 @@ public class FMEventHandler
|
||||
}
|
||||
if(Config.spawnerMobs.containsKey(name))
|
||||
imprintCrystal((EntityPlayer)(event.source.getEntity()), name);
|
||||
}
|
||||
|
||||
if(EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.educational.effectId, equip) > 0 && event.entityLiving instanceof EntityLiving)
|
||||
{
|
||||
int learning = 3 * ((EntityLiving)event.entityLiving).experienceValue * EnchantmentHelper.getEnchantmentLevel(DarkEnchantments.educational.effectId, equip);
|
||||
while(learning > 0)
|
||||
{
|
||||
int xp = EntityXPOrb.getXPSplit(learning);
|
||||
learning -= xp;
|
||||
event.entityLiving.worldObj.spawnEntityInWorld(new EntityXPOrb(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, xp));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,10 @@ public class ForbiddenRecipes
|
||||
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)}));
|
||||
//if(Compat.tx && Compat.curedBrainID != -1)
|
||||
//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[]{new ItemStack(Compat.curedBrainID, 1, 0), new ItemStack(Item.book), ItemApi.getItem("itemResource", 14)}));
|
||||
//else
|
||||
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(Item.book), 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)});
|
||||
|
||||
@@ -43,12 +43,14 @@ public class ForbiddenResearch
|
||||
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();
|
||||
(new DarkResearchItem("PIGBANE", "TT_ENCHANTING", (new AspectList()).add(Aspect.HUNGER, 2).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), -6, -3, 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();
|
||||
(new DarkResearchItem("EDUCATIONAL", "TT_ENCHANTING", (new AspectList()).add(Aspect.MIND, 2).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), -6, -2, 4, 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[]{"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();
|
||||
(new DarkResearchItem("PIGBANE", "ARTIFICE", (new AspectList()).add(Aspect.HUNGER, 2).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), -8, 12, 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();
|
||||
(new DarkResearchItem("EDUCATIONAL", "ARTIFICE", (new AspectList()).add(Aspect.MIND, 2).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), -8, 13, 4, 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[]{"INFUSIONENCHANTMENT"}).setConcealed().registerResearchItem();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ public class DarkEnchantments
|
||||
public static Enchantment pigBane;
|
||||
public static Enchantment greedy;
|
||||
public static Enchantment consuming;
|
||||
public static Enchantment educational;
|
||||
|
||||
public static void hex()
|
||||
{
|
||||
@@ -21,6 +22,7 @@ public class DarkEnchantments
|
||||
pigBane = new EnchantmentPigBane(Config.pigBaneEnchID);
|
||||
greedy = new EnchantmentGreedy(Config.greedyEnchID);
|
||||
consuming = new EnchantmentConsuming(Config.consumingEnchID);
|
||||
educational = new EnchantmentEducational(Config.educationalEnchID);
|
||||
|
||||
//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");
|
||||
|
||||
@@ -21,23 +21,7 @@ public class EnchantmentEducational extends Enchantment
|
||||
*/
|
||||
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;
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user