diff --git a/StevenDimDoors/mod_pocketDim/CommonProxy.java b/StevenDimDoors/mod_pocketDim/CommonProxy.java index eee4b831..951244e5 100644 --- a/StevenDimDoors/mod_pocketDim/CommonProxy.java +++ b/StevenDimDoors/mod_pocketDim/CommonProxy.java @@ -3,6 +3,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import StevenDimDoors.mod_pocketDimClient.ClientTickHandler; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.CompressedStreamTools; @@ -138,4 +140,6 @@ public class CommonProxy implements IGuiHandler { } + + } \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/CommonTickHandler.java b/StevenDimDoors/mod_pocketDim/CommonTickHandler.java index 352238fd..e74feea0 100644 --- a/StevenDimDoors/mod_pocketDim/CommonTickHandler.java +++ b/StevenDimDoors/mod_pocketDim/CommonTickHandler.java @@ -14,6 +14,11 @@ public class CommonTickHandler implements ITickHandler Random rand= new Random(); public int tickCount=0; public int tickCount2=0; + + + + + @Override @@ -170,6 +175,11 @@ public class CommonTickHandler implements ITickHandler mod_pocketDim.teleTimer--; } + + + + + } } \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/Spells.java b/StevenDimDoors/mod_pocketDim/Spells.java new file mode 100644 index 00000000..0237777d --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/Spells.java @@ -0,0 +1,137 @@ +package StevenDimDoors.mod_pocketDim; + +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; + +public class Spells +{ + public EntityPlayer player; + public int spellID; + public int castingTime=0; + + public int fireCastTime=40; + public int smokeCastTime=5; + public int plagueCastTime=5; + + public Random rand= new Random(); + + public int fireSpell=1; + public int smokeVanish=2; + public int enderPush=3; + public int flood=4; + public int nightVision=5; + public int heal = 6; + public int plague = 7; + public int butcher = 8; + + + public Spells(EntityPlayer player, int spellID) + { + this.spellID=spellID; + this.player=player; + } + + public boolean cast() + { + this.castingTime++; + + if(this.spellID==this.fireSpell) + { + return this.castFire(); + + } + + if(this.spellID==this.smokeVanish) + { + return this.castSmoke(); + } + + + + + return false; + } + + public boolean castSmoke() + { + + if(!this.player.isPotionActive(Potion.invisibility)) + { + this.player.addPotionEffect(new PotionEffect(Potion.invisibility.id, 2 * 200, 200)); + } + + if(this.castingTime list = player.worldObj.getEntitiesWithinAABBExcludingEntity(player,AxisAlignedBB.getBoundingBox( player.posX-7, player.posY-3, player.posZ-7, player.posX+7, player.posY+7, player.posZ+7)); + for(Entity entity : list) + { + entity.setFire(3); + entity.attackEntityFrom(DamageSource.lava, 2); + } + + return true; + } + /** + public boolean castEnderPush() + { + + } + + public boolean castFlood() + { + + } + + public boolean castNightVision() + { + + } + + public boolean castPlague() + { + + } + **/ +} \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/items/ItemStableFabric.java b/StevenDimDoors/mod_pocketDim/items/ItemStableFabric.java index 5ce057aa..c2c11b79 100644 --- a/StevenDimDoors/mod_pocketDim/items/ItemStableFabric.java +++ b/StevenDimDoors/mod_pocketDim/items/ItemStableFabric.java @@ -2,9 +2,12 @@ package StevenDimDoors.mod_pocketDim.items; import java.util.List; +import StevenDimDoors.mod_pocketDim.CommonTickHandler; import StevenDimDoors.mod_pocketDim.LinkData; +import StevenDimDoors.mod_pocketDim.Spells; import StevenDimDoors.mod_pocketDim.dimHelper; import StevenDimDoors.mod_pocketDim.mod_pocketDim; +import StevenDimDoors.mod_pocketDimClient.ClientTickHandler; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -77,6 +80,17 @@ public class ItemStableFabric extends Item public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + + + if(this.isSteven(par3EntityPlayer)) + { + new Spells(par3EntityPlayer, par1ItemStack.stackSize).cast(); + //mod_pocketDim.proxy.startCasting(par3EntityPlayer, par1ItemStack.stackSize); + + + + + } Boolean didFindThing=false; MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false ); if(hit!=null&&!par2World.isRemote) @@ -135,6 +149,15 @@ public class ItemStableFabric extends Item } + + public boolean isSteven(EntityPlayer player) + { + if(player.username=="stevenrs11"||player.username=="Stevenrs11"||player.username=="StevenRS11") + { + return true; + } + return false; + } public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java index 0be3738b..9ff1c9ff 100644 --- a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java +++ b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java @@ -246,6 +246,8 @@ public class mod_pocketDim + + //public Spells spells = null; diff --git a/StevenDimDoors/mod_pocketDimClient/ClientProxy.java b/StevenDimDoors/mod_pocketDimClient/ClientProxy.java index 24a9cb4f..6c1668d5 100644 --- a/StevenDimDoors/mod_pocketDimClient/ClientProxy.java +++ b/StevenDimDoors/mod_pocketDimClient/ClientProxy.java @@ -4,9 +4,12 @@ import java.io.File; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.src.ModLoader; import net.minecraftforge.client.MinecraftForgeClient; import StevenDimDoors.mod_pocketDim.CommonProxy; +import StevenDimDoors.mod_pocketDim.CommonTickHandler; +import StevenDimDoors.mod_pocketDim.Spells; import StevenDimDoors.mod_pocketDim.TileEntityDimDoor; import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.ticking.MobObelisk; @@ -14,6 +17,7 @@ import StevenDimDoors.mod_pocketDim.ticking.MobObelisk; public class ClientProxy extends CommonProxy { + @Override public void registerRenderers() { @@ -31,6 +35,8 @@ public class ClientProxy extends CommonProxy } + + @Override public void loadTextures() { diff --git a/StevenDimDoors/mod_pocketDimClient/ClientTickHandler.java b/StevenDimDoors/mod_pocketDimClient/ClientTickHandler.java index 8561237e..1b9ad557 100644 --- a/StevenDimDoors/mod_pocketDimClient/ClientTickHandler.java +++ b/StevenDimDoors/mod_pocketDimClient/ClientTickHandler.java @@ -1,6 +1,9 @@ package StevenDimDoors.mod_pocketDimClient; import java.util.EnumSet; +import StevenDimDoors.mod_pocketDim.Spells; +import StevenDimDoors.mod_pocketDim.mod_pocketDim; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import cpw.mods.fml.common.ITickHandler; @@ -8,6 +11,7 @@ import cpw.mods.fml.common.TickType; public class ClientTickHandler implements ITickHandler { + @Override public void tickStart(EnumSet type, Object... tickData) {}