Cross-Mod Stuff

Fixes #89
Fixes #79
This commit is contained in:
Jeremy Diamond committed 2015-11-13 00:57:02 -08:00
1 parent f9254095eb
commit b61ed5716a
99 files changed
+74 -7402

No files matched your search

@@ -59,6 +59,9 @@ public class Config {
public static boolean emc = true;
//public static boolean eewand = true;
public static int bloodvis = 5;
public static int manavis = 8;
public static int wrathCost = 5;
public static int wrathEff = 4;
@@ -115,6 +118,9 @@ public class Config {
twilight = conf.get("compatibility", "Twilight Forest Interaction", twilight).getBoolean(true);
emc = conf.get("compatibility", "Equivalent Exchange 3 EMC", emc, "Disable if you don't want Forbidden Magic to add EMC values to items.").getBoolean(true);
//eewand = conf.get("compatibility", "Equivalent Exchange 3 Wand", eewand, "Disable to specifically disable the EMC to Vis wand.").getBoolean(true);
bloodvis = conf.get("power converters", "LP to Vis", bloodvis).getInt(bloodvis);
manavis = conf.get("power converters", "Mana to Vis", manavis).getInt(manavis);
} catch (Exception e) {
LogHandler.log(Level.ERROR, e, "Had a problem loading its configuration.");
} finally {
@@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@@ -46,8 +47,10 @@ public class ItemDivineOrb extends Item implements IBloodOrb, IBindable, IWarpin
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
if (Compat.bm)
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
if (!Compat.bm)
return itemstack;
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
if (world != null) {
double posX = player.posX;
@@ -55,7 +58,7 @@ public class ItemDivineOrb extends Item implements IBloodOrb, IBindable, IWarpin
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
}
if (!world.isRemote) {
if (world.isRemote) {
return itemstack;
}
@@ -65,9 +68,13 @@ public class ItemDivineOrb extends Item implements IBloodOrb, IBindable, IWarpin
return itemstack;
}
if(!player.capabilities.isCreativeMode)
player.setHealth(player.getHealth() - 1);
if(itemTag.getString("ownerName").equals(SoulNetworkHandler.getUsername(player)))
{
SoulNetworkHandler.setMaxOrbToMax(itemTag.getString("ownerName"), 6);
}
SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 200, 700000000);
hurtPlayer(player, 200);
return itemstack;
}
@@ -109,4 +116,35 @@ public class ItemDivineOrb extends Item implements IBloodOrb, IBindable, IWarpin
{
return itemStack;
}
private void hurtPlayer(EntityPlayer user, int energySyphoned)
{
if (energySyphoned < 100 && energySyphoned > 0)
{
if (!user.capabilities.isCreativeMode)
{
user.setHealth((user.getHealth() - 1));
if (user.getHealth() <= 0.0005f)
{
user.func_110142_aN().func_94547_a(new DamageSource("blooderp"), 1, 1);
user.onDeath(new DamageSource("blooderp"));
}
}
} else if (energySyphoned >= 100)
{
if (!user.capabilities.isCreativeMode)
{
for (int i = 0; i < ((energySyphoned + 99) / 100); i++)
{
user.setHealth((user.getHealth() - 1));
if (user.getHealth() <= 0.0005f)
{
user.func_110142_aN().func_94547_a(new DamageSource("blooderp"), 1, 1);
user.onDeath(new DamageSource("blooderp"));
break;
}
}
}
}
}
}
@@ -3,6 +3,7 @@ package fox.spiteful.forbidden.items.wands;
import fox.spiteful.forbidden.Config;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.wands.IWandRodOnUpdate;
import thaumcraft.common.items.wands.ItemWandCasting;
@@ -27,9 +28,11 @@ public class BloodStaffUpdate implements IWandRodOnUpdate {
int cost;
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("alchemical"))
cost = 9;
cost = Config.bloodvis - 1;
else
cost = 10;
cost = Config.bloodvis;
cost = Math.max(0, cost);
for(int x = 0;x < primals.length;x++)
{
@@ -60,21 +63,23 @@ public class BloodStaffUpdate implements IWandRodOnUpdate {
}
public boolean syphonHealth(EntityPlayer player)
{
if(player.getHealth() > 0)
{
public boolean syphonHealth(EntityPlayer player){
if(player.getHealth() > 3){
player.setHealth(player.getHealth() - 3);
return true;
}
else if(player.getHealth() > 0){
player.func_110142_aN().func_94547_a(new DamageSource("blooderp"), 3, 3);
player.setHealth(0);
player.onDeath(new DamageSource("blooderp"));
return true;
}
else
return false;
}
private boolean checkHotbar(ItemStack stack, EntityPlayer player)
{
for(int x = 0; x < 9; ++x)
{
private boolean checkHotbar(ItemStack stack, EntityPlayer player){
for(int x = 0; x < 9; ++x){
ItemStack item = player.inventory.getStackInSlot(x);
if(item == stack)
return true;
@@ -20,12 +20,14 @@ public class BloodWandUpdate implements IWandRodOnUpdate {
try
{
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
int cost;
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("alchemical"))
cost = 9;
cost = Config.bloodvis - 1;
else
cost = 10;
cost = Config.bloodvis;
cost = Math.max(0, cost);
for(int x = 0;x < primals.length;x++)
{
@@ -25,9 +25,11 @@ public class YandereWandUpdate implements IWandRodOnUpdate {
int cost;
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("manasteel")
||((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("elementium"))
cost = 9;
cost = Config.manavis - 2;
else
cost = 11;
cost = Config.manavis;
cost = Math.max(0, cost);
for(int x = 0;x < primals.length;x++)
{