Getting more spell stuff done

This commit is contained in:
WayofTime 2014-03-07 07:02:18 -05:00
parent 9d9d376e4a
commit b34ff3c58e
78 changed files with 1133 additions and 159 deletions

View file

@ -946,14 +946,14 @@ public class AlchemicalWizardry
{
this.isForestryLoaded = true;
ModItems.itemBloodFrame = new ItemBloodFrame(this.itemBloodFrameItemID).setUnlocalizedName("bloodFrame");
ItemStack provenFrame = GameRegistry.findItemStack("Forestry", "frameImpregnated", 1);
if(provenFrame !=null)
{
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.itemBloodFrame), provenFrame, 3, 30000, 20, 20, false);
}
// ModItems.itemBloodFrame = new ItemBloodFrame(this.itemBloodFrameItemID).setUnlocalizedName("bloodFrame");
//
// ItemStack provenFrame = GameRegistry.findItemStack("Forestry", "frameImpregnated", 1);
//
// if(provenFrame !=null)
// {
// AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.itemBloodFrame), provenFrame, 3, 30000, 20, 20, false);
// }
}else
{
this.isForestryLoaded = false;

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
@ -95,6 +96,12 @@ public class ActivationCrystal extends EnergyItems
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
return par1ItemStack;
}

View file

@ -1,6 +1,7 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -54,6 +55,11 @@ public class BlankSpell extends EnergyItems
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
return par1ItemStack;

View file

@ -1,11 +1,7 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.IBindable;
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.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -22,9 +18,16 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import thaumcraft.api.IGoggles;
import thaumcraft.api.nodes.IRevealer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.IBindable;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
@Optional.InterfaceList(value = {@Interface(iface="IRevealer", modid = "Thaumcraft"), @Interface(iface="IGoggles", modid = "Thaumcraft")})
public class BoundArmour extends ItemArmor implements ISpecialArmor, IRevealer, IGoggles, IBindable
{
private static int invSize = 9;

View file

@ -1,6 +1,7 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import com.google.common.collect.Multimap;
@ -55,10 +56,18 @@ public class DaggerOfSacrifice extends EnergyItems
@Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
if (par3EntityLivingBase == null || par2EntityLivingBase == null || par3EntityLivingBase.worldObj.isRemote || !(par3EntityLivingBase.getClass().equals(EntityPlayerMP.class)))
if (par3EntityLivingBase == null || par2EntityLivingBase == null || par3EntityLivingBase.worldObj.isRemote)
{
return false;
}
if(par3EntityLivingBase instanceof EntityPlayer)
{
if(SpellHelper.isFakePlayer(par3EntityLivingBase.worldObj, (EntityPlayer)par3EntityLivingBase))
{
return false;
}
}
//EntityWither d;
if (par2EntityLivingBase.isChild() || par2EntityLivingBase instanceof EntityWither || par2EntityLivingBase instanceof EntityDragon || par2EntityLivingBase instanceof EntityPlayer || par2EntityLivingBase instanceof IBossDisplayData)

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.*;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;
@ -68,9 +69,9 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
World world = par3EntityPlayer.worldObj;
if (par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP)
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
return par1ItemStack;
}
if (world != null)

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
@ -68,6 +69,11 @@ public class EnergyBazooka extends EnergyItems
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
@ -68,6 +69,11 @@ public class EnergyBlast extends EnergyItems
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.IBindable;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;
@ -59,11 +60,11 @@ public class ItemDiabloKey extends EnergyItems
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
World world = par3EntityPlayer.worldObj;
if (par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP)
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
return par1ItemStack;
}
if (world != null)
{
double posX = par3EntityPlayer.posX;

View file

@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.common.rituals.Rituals;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -125,6 +126,12 @@ public class ItemRitualDiviner extends EnergyItems
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer);
if(SpellHelper.isFakePlayer(par2EntityPlayer.worldObj, par2EntityPlayer))
{
return false;
}
ItemStack[] playerInventory = par2EntityPlayer.inventory.mainInventory;
TileEntity tileEntity = par3World.getBlockTileEntity(par4, par5, par6);

View file

@ -1,6 +1,7 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -46,9 +47,9 @@ public class SacrificialDagger extends Item
par3EntityPlayer.setHealth(par3EntityPlayer.getHealth() - 2);
}
if (par3EntityPlayer instanceof FakePlayer)
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
return par1ItemStack;
}
double posX = par3EntityPlayer.posX;

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
@ -49,6 +50,11 @@ public class AirSigil extends EnergyItems implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
return par1ItemStack;

View file

@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -52,6 +53,11 @@ public class DivinationSigil extends Item implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (!par3EntityPlayer.worldObj.isRemote)
{
return par1ItemStack;

View file

@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
@ -51,6 +52,12 @@ public class ItemBloodLightSigil extends EnergyItems
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer);
if(SpellHelper.isFakePlayer(par2EntityPlayer.worldObj, par2EntityPlayer))
{
return false;
}
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed());
if (par3World.isRemote)

View file

@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@ -72,6 +73,11 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
return par1ItemStack;

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.*;
@ -103,6 +104,11 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer);
if(SpellHelper.isFakePlayer(par2EntityPlayer.worldObj, par2EntityPlayer))
{
return false;
}
if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer))
{
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed());
@ -161,6 +167,11 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade
{
return;
}
if(SpellHelper.isFakePlayer(par3Entity.worldObj, (EntityPlayer)par3Entity))
{
return;
}
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
@ -97,6 +98,11 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
return par1ItemStack;
@ -141,6 +147,11 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade
return;
}
if(SpellHelper.isFakePlayer(par2World,(EntityPlayer) par3Entity))
{
return;
}
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
if (par1ItemStack.stackTagCompound == null)

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
@ -116,6 +117,11 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
return par1ItemStack;
@ -153,6 +159,11 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade
{
return;
}
if(SpellHelper.isFakePlayer(par2World, (EntityPlayer)par3Entity))
{
return;
}
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;

View file

@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.MaterialLiquid;
@ -145,6 +146,11 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
return par1ItemStack;

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@ -79,6 +80,11 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}
if (par3EntityPlayer.isSneaking())
{
return par1ItemStack;

View file

@ -900,7 +900,7 @@ public class Rituals
ritualList.add(new Rituals(biomeChangerRitual, 2, 1000000, new RitualEffectBiomeChanger(), "Ritual of Gaia's Transformation"));
ritualList.add(new Rituals(flightRitual, 2, 1000000, new RitualEffectFlight(), "Reverence of the Condor"));
ritualList.add(new Rituals(meteorRitual, 2, 1000000, new RitualEffectSummonMeteor(), "Mark of the Falling Tower"));
ritualList.add(new Rituals(apiaryRitual,1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock"));
//ritualList.add(new Rituals(apiaryRitual,1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock"));
}
public static int getCostForActivation(int ritualID)

View file

@ -5,12 +5,15 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.FakePlayer;
import net.minecraftforge.common.ForgeDirection;
public class SpellHelper
@ -105,4 +108,30 @@ public class SpellHelper
world.setBlock(posX, posY, posZ, Block.ice.blockID);
}
}
public static boolean isFakePlayer(World world, EntityPlayer player)
{
if(world.isRemote)
{
return false;
}
if(player instanceof FakePlayer)
{
return true;
}
String str = player.getClass().getCanonicalName();
if(str.contains("GCEntityPlayerMP"))
{
return false;
}
if(player.getClass().equals(EntityPlayerMP.class))
{
return false;
}
return true;
}
}