totos51

TileEntityCreepyBlock

Jun 11th, 2014
38
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Gallad.Mineald.tile;
  2.  
  3. import java.util.List;
  4. import java.util.Random;
  5.  
  6. import Gallad.Mineald.MommyFilter;
  7. import Gallad.Mineald.entity.EntityMommyCreepy;
  8. import Gallad.Mineald.world.MommyDungeon;
  9. import net.minecraft.command.IEntitySelector;
  10. import net.minecraft.entity.Entity;
  11. import net.minecraft.entity.EnumCreatureType;
  12. import net.minecraft.entity.monster.EntityCreeper;
  13. import net.minecraft.nbt.NBTTagCompound;
  14. import net.minecraft.tileentity.TileEntity;
  15. import net.minecraft.util.AxisAlignedBB;
  16. import net.minecraft.util.IProgressUpdate;
  17. import net.minecraft.world.ChunkPosition;
  18. import net.minecraft.world.World;
  19. import net.minecraft.world.chunk.Chunk;
  20. import net.minecraft.world.chunk.IChunkProvider;
  21.  
  22. public class TileEntityCreepyBlock extends TileEntity
  23. {
  24. public Random rand;
  25. public int count = 0;
  26.  
  27. @Override
  28. public void updateEntity()
  29. {
  30. if (new java.util.Date().getHours() == 12 && new java.util.Date().getHours() == 17 && new java.util.Date().getHours() == 11)
  31. {
  32. if (new java.util.Date().getMinutes() == 30)
  33. {
  34. if (new java.util.Date().getSeconds() == 0)
  35. {
  36. if (count == 0)
  37. {
  38. System.out.println("Mommy Creepy Respawn!");
  39. final IEntitySelector livingFilter = new MommyFilter();
  40. AxisAlignedBB Axis = AxisAlignedBB.getAABBPool().getAABB(this.xCoord - 24, this.yCoord - 2, this.zCoord - 25, this.xCoord + 24, this.yCoord + 2, this.zCoord + 25);
  41. List entityTargetList = this.worldObj.selectEntitiesWithinAABB(Entity.class, Axis, livingFilter);
  42. for (int i = 0; i < entityTargetList.size(); i++)
  43. {
  44. Entity entityTarget = (Entity)entityTargetList.get(i);
  45. if (entityTarget instanceof EntityMommyCreepy)
  46. {
  47. entityTarget.setDead();
  48. }
  49. }
  50. new MommyDungeon(this.worldObj, rand, this.xCoord, this.yCoord, this.zCoord);
  51. if(!worldObj.isRemote)
  52. {
  53. spawnMommyCreepy(this.worldObj, (double)(this.xCoord + 23), (double)(this.yCoord + 1), (double)(this.zCoord + 24));
  54. }
  55. count++;
  56. }
  57.  
  58. }
  59. if (new java.util.Date().getSeconds() == 1)
  60. {
  61. count = 0;
  62. }
  63. }
  64. }
  65. }
  66.  
  67. public void spawnMommyCreepy(World world, double posX, double posY, double posZ)
  68. {
  69. Entity entity = new EntityMommyCreepy(world);
  70. entity.setPosition(posX, posY, posZ);
  71. world.spawnEntityInWorld(entity);
  72. }
  73. }
RAW Paste Data