thvardhan

extrafunctions-2

Jul 11th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 46.76 KB | None | 0 0
  1. package com.thvardhan.ytstuff.functions;
  2.  
  3. import java.util.Random;
  4.  
  5. import com.mojang.realmsclient.gui.ChatFormatting;
  6. import com.thvardhan.ytstuff.blocks.ModBlocks;
  7. import com.thvardhan.ytstuff.entity.EntityAntVenom;
  8. import com.thvardhan.ytstuff.entity.EntityCaptainSparklez;
  9. import com.thvardhan.ytstuff.entity.EntityDanTDM;
  10. import com.thvardhan.ytstuff.entity.EntityGhost;
  11. import com.thvardhan.ytstuff.entity.EntityISquid;
  12. import com.thvardhan.ytstuff.entity.EntityLogDotZip;
  13. import com.thvardhan.ytstuff.entity.EntityPopularMMO;
  14. import com.thvardhan.ytstuff.entity.EntitySerialPlayer;
  15. import com.thvardhan.ytstuff.entity.EntitySkyDoesMinecraft;
  16. import com.thvardhan.ytstuff.entity.EntitySuperGirlyGamer;
  17. import com.thvardhan.ytstuff.entity.EntityTruemu;
  18. import com.thvardhan.ytstuff.items.ModItems;
  19.  
  20. import net.minecraft.block.Block;
  21. import net.minecraft.client.Minecraft;
  22. import net.minecraft.enchantment.Enchantment;
  23. import net.minecraft.entity.boss.EntityWither;
  24. import net.minecraft.entity.item.EntityItem;
  25. import net.minecraft.entity.item.EntityTNTPrimed;
  26. import net.minecraft.entity.monster.EntityBlaze;
  27. import net.minecraft.entity.monster.EntityCreeper;
  28. import net.minecraft.entity.monster.EntityGhast;
  29. import net.minecraft.entity.monster.EntityIronGolem;
  30. import net.minecraft.entity.monster.EntitySkeleton;
  31. import net.minecraft.entity.monster.EntityZombie;
  32. import net.minecraft.entity.passive.EntityCow;
  33. import net.minecraft.entity.passive.EntityPig;
  34. import net.minecraft.entity.passive.EntityRabbit;
  35. import net.minecraft.entity.passive.EntitySquid;
  36. import net.minecraft.entity.passive.EntityWolf;
  37. import net.minecraft.entity.player.EntityPlayer;
  38. import net.minecraft.init.Blocks;
  39. import net.minecraft.init.Items;
  40. import net.minecraft.item.Item;
  41. import net.minecraft.item.ItemStack;
  42. import net.minecraft.util.BlockPos;
  43. import net.minecraft.util.ChatComponentText;
  44. import net.minecraft.world.World;
  45.  
  46. public class ExtraFunctions {
  47.  
  48.    
  49.     /**
  50.      * Summon Blocks As Drop With Loops
  51.      * Par World,BlockPos,Block,loop(how many items you want to summon),style(1=down-top, anything else simple.),skip(ONLY USE FOR STYLE=1)
  52.      *
  53.      */
  54.    
  55.     public static void summonBlockWithLoop(World worldIn, BlockPos pos,Block block,int loop,int style,int skip) {
  56.  
  57.          float f = 0.5F;
  58.         double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  59.          double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  60.          double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  61.          EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(block));
  62.          entityitem.setDefaultPickupDelay();
  63.          for(int i=0;i<=loop-1;i++){
  64.              
  65.              if(style==1){
  66.                  EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() , (double)pos.getY() +i+skip, (double)pos.getZ() , new ItemStack(block));
  67.             worldIn.spawnEntityInWorld(entityitem1);}
  68.              else{
  69.                  EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(block));
  70.                  worldIn.spawnEntityInWorld(entityitem1);
  71.              }
  72.              }
  73.        
  74.          }
  75.        
  76.    
  77.    
  78.     /**
  79.      *
  80.      * Summons A Block Like A Drop
  81.      */
  82.  
  83.     public static void summonBlockAsDrop(BlockPos pos, World worldIn,Block block) {
  84.    
  85.          float f = 0.5F;
  86.         double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  87.         double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  88.         double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  89.         EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(block));
  90.         entityitem.setDefaultPickupDelay();
  91.         worldIn.spawnEntityInWorld(entityitem);
  92.        
  93.     }
  94.    
  95.    
  96.    
  97.     /**
  98.      *
  99.      * Summons A Item Like A Drop
  100.      */
  101.  
  102.     public static void summonItemAsDrop(BlockPos pos, World worldIn,ItemStack stack) {
  103.        
  104.          float f = 0.5F;
  105.         double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  106.         double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  107.         double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  108.         EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2,stack);
  109.         entityitem.setDefaultPickupDelay();
  110.         worldIn.spawnEntityInWorld(entityitem);
  111.        
  112.     }
  113.    
  114.    
  115.    
  116.  
  117.     /**
  118.      *
  119.      * Summons A Zombie
  120.      * Pars- World,pos,loop(ammount of Zombie)
  121.      */
  122.  
  123.     public static void summonZombie(World worldIn,BlockPos pos,int loop) {
  124.        
  125.  
  126.             for(int i=0;i<=loop-1;i++){
  127.                
  128.                 EntityZombie z = new EntityZombie(worldIn);
  129.                
  130.                 z.setPosition(pos.getX(),pos.getY(), pos.getZ());
  131.                
  132.             worldIn.spawnEntityInWorld(z);
  133.             }
  134.                                        
  135.            
  136.         }
  137.  
  138.  
  139.     /**
  140.      * Set Tnt on top of random block.
  141.      * from location of block broken to x+5 x-5 z+5 z-5
  142.      * @param worldIn
  143.      * @param pos
  144.      */
  145.  
  146.     public static void setTntWithBlock(World worldIn,BlockPos pos) {
  147.        
  148.             Block random;
  149.         Random rand = new Random();
  150.         switch(rand.nextInt(5)){
  151.         case 0:{
  152.                 random=Blocks.diamond_block;
  153.                 break;
  154.                 }
  155.         case 1:{
  156.                 random=Blocks.obsidian;
  157.                 break;
  158.                 }
  159.         case 2:{
  160.                  random=Blocks.dirt;
  161.                  break;
  162.                 }
  163.         case 3:{
  164.              random = Blocks.log;
  165.              break;
  166.             }
  167.         case 4:{
  168.              random = Blocks.anvil;
  169.              break;
  170.         }
  171.         default:{
  172.              random = Blocks.dragon_egg;
  173.              break;
  174.         }
  175.         }
  176.  
  177.         for(int i=0;i<=4;i++)
  178.         {
  179.             BlockPos a=new BlockPos(pos.getX()+5, pos.getY(), pos.getZ()-2+i);
  180.             worldIn.setBlockState(a, random.getDefaultState(),3);
  181.             BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
  182.             worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
  183.             BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
  184.             worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
  185.         }
  186.         for(int i=0;i<=4;i++)
  187.         {
  188.             BlockPos a=new BlockPos(pos.getX()-5, pos.getY(), pos.getZ()+2-i);
  189.             worldIn.setBlockState(a, random.getDefaultState(),3);
  190.  
  191.             BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
  192.             worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
  193.             BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
  194.             worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
  195.         }
  196.         for(int i=0;i<=4;i++)
  197.         {
  198.             BlockPos a=new BlockPos(pos.getX()-2+i, pos.getY(), pos.getZ()+5);
  199.             worldIn.setBlockState(a, random.getDefaultState(),3);
  200.  
  201.             BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
  202.             worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
  203.             BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
  204.             worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
  205.         }
  206.         for(int i=0;i<=4;i++)
  207.         {
  208.             BlockPos a=new BlockPos(pos.getX()+2-i, pos.getY(), pos.getZ()-5);
  209.             worldIn.setBlockState(a, random.getDefaultState(),3);
  210.  
  211.             BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
  212.             worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
  213.             BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
  214.             worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
  215.         }
  216.    
  217.        
  218.     }
  219.  
  220.    
  221.     /**
  222.      *
  223.      * @param worldIn
  224.      * @param pos
  225.      * @param item in game name
  226.      * @param item changed name
  227.      * @param enchantment
  228.      * @param amplifier
  229.      */
  230.  
  231.  
  232.     public static void summonEnchantedItemAsDrop(World worldIn, BlockPos pos,
  233.             Item i, String name, Enchantment e, int amp) {
  234.    
  235.         ItemStack itemE=new ItemStack(i);
  236.         itemE.addEnchantment(e, amp);
  237.         itemE.setStackDisplayName(name);
  238.         summonItemAsDrop(pos, worldIn, itemE);
  239.     }
  240.  
  241.  
  242.  
  243.  
  244.     /**
  245.      *
  246.      * Summons A logdotzip (medium)
  247.      * Pars- World,pos
  248.      */
  249.  
  250.     public static void summonLogdotzip(World worldIn,BlockPos pos) {
  251.        
  252.  
  253.             Random rand=new Random();
  254.            
  255.             for(int i=0;i<=rand.nextInt(3)+1;i++){
  256.                
  257.                 EntityLogDotZip l = new EntityLogDotZip(worldIn);
  258.                
  259.                 l.setPosition(pos.getX(),pos.getY(), pos.getZ());
  260.                
  261.             worldIn.spawnEntityInWorld(l);
  262.             }
  263.                                        
  264.            
  265.         }
  266.  
  267.  
  268.     /**
  269.      *
  270.      * Tp to Random Loc.
  271.      *
  272.      */
  273.    
  274.  
  275.     public static void tpPlayer(EntityPlayer player) {
  276.         player.setPosition(player.posX, player.serverPosY=(int)player.posY+500, player.posZ);
  277.        
  278.        
  279.     }
  280.  
  281.  
  282.        
  283.  
  284.     /**
  285.      *
  286.      * Summons A Wolf
  287.      * Pars- World,pos,loop(ammount of Wolf)
  288.      */
  289.  
  290.     public static void summonWolf(World worldIn,BlockPos pos,int loop) {
  291.    
  292.  
  293.             for(int i=0;i<=loop-1;i++){
  294.                
  295.                 EntityWolf z = new EntityWolf(worldIn);
  296.                
  297.                 z.setPosition(pos.getX(),pos.getY(), pos.getZ());
  298.                
  299.             worldIn.spawnEntityInWorld(z);
  300.             }
  301.                                        
  302.            
  303.         }
  304.    
  305.    
  306.     /**
  307.      *
  308.      * Summons A Blaze
  309.      * Pars- World,pos,loop(ammount of Blaze)
  310.      */
  311.    
  312.    
  313.     public static void summonBlaze(World worldIn,BlockPos pos,int loop) {
  314.        
  315.  
  316.             for(int i=0;i<=loop-1;i++){
  317.                
  318.                 EntityBlaze z = new EntityBlaze(worldIn);
  319.                
  320.                 z.setPosition(pos.getX(),pos.getY(), pos.getZ());
  321.                 z.setHealth(100);
  322.                
  323.             worldIn.spawnEntityInWorld(z);
  324.             }
  325.                                        
  326.            
  327.         }
  328.    
  329.    
  330.    
  331.     public static void setOneBlock(World worldIn,BlockPos pos,Block block){
  332.    
  333.        
  334.         worldIn.setBlockState(pos, block.getDefaultState(), 2);
  335.        
  336.        
  337.    
  338.     }
  339.    
  340.    
  341.      /**
  342.      * Summon Items As Drop With Loops
  343.      * Par World,BlockPos,Item,loop(how many items you want to summon),style(1=down-top, anything else simple.),skip(ONLY USE FOR STYLE=1)
  344.      *
  345.      */
  346.    
  347.     public static void summonItemWithLoop(World worldIn, BlockPos pos,Item item,int loop,int style,int skip) {
  348.        
  349.          float f = 0.5F;
  350.         double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  351.          double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  352.          double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  353.    
  354.          for(int i=0;i<=loop-1;i++){
  355.              
  356.              if(style==1){
  357.                  EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() , (double)pos.getY() +i+skip, (double)pos.getZ() , new ItemStack(item));
  358.                  entityitem1.setDefaultPickupDelay();
  359.             worldIn.spawnEntityInWorld(entityitem1);}
  360.              else{
  361.                  EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(item));
  362.                  entityitem1.setDefaultPickupDelay();
  363.                  worldIn.spawnEntityInWorld(entityitem1);
  364.              }
  365.              }
  366.        
  367.          }
  368.    
  369.    
  370.  
  371.  
  372.     /**
  373.      *
  374.      * Summons A PopularMMO
  375.      * Pars- World,pos,loop(ammount of popularmmo)
  376.      */
  377.  
  378.     public static void summonPopularMMO(World worldIn,BlockPos pos,int loop) {
  379.        
  380.  
  381.            
  382.             for(int i=0;i<=loop-1;i++){
  383.                
  384.                 EntityPopularMMO e = new EntityPopularMMO(worldIn);
  385.                
  386.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  387.                 e.setAlwaysRenderNameTag(true);
  388.  
  389.             worldIn.spawnEntityInWorld(e);
  390.             }
  391.                                        
  392.            
  393.         }
  394.    
  395.    
  396.    
  397.    
  398.    
  399.    
  400.    
  401.      /**
  402.      * Summon ItemsStack As Drop With Loops
  403.      * Par World,BlockPos,Itemstack,loop(how many items you want to summon),style(1=down-top, anything else simple.),skip(ONLY USE FOR STYLE=1)
  404.      *
  405.      */
  406.    
  407.     public static void summonItemStackWithLoop(World worldIn, BlockPos pos,ItemStack item,int loop,int style,int skip) {
  408.        
  409.          float f = 0.5F;
  410.         double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  411.          double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  412.          double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
  413.          EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, item);
  414.          entityitem.setDefaultPickupDelay();
  415.          for(int i=0;i<=loop-1;i++){
  416.              
  417.              if(style==1){
  418.                  EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() , (double)pos.getY() +i+skip, (double)pos.getZ() , item);
  419.             worldIn.spawnEntityInWorld(entityitem1);}
  420.              else{
  421.                  EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, item);
  422.                  worldIn.spawnEntityInWorld(entityitem1);
  423.              }
  424.              }
  425.        
  426.          }
  427.    
  428.    
  429.    
  430.  
  431.     /**
  432.      *
  433.      * Summons A Skeleton
  434.      * Pars- World,pos,loop(ammount of Skeleton)
  435.      */
  436.  
  437.     public static void summonSkeleton(World worldIn,BlockPos pos,int loop) {
  438.        
  439.  
  440.             for(int i=0;i<=loop-1;i++){
  441.                
  442.                 EntitySkeleton e = new EntitySkeleton(worldIn);
  443.                 e.setCustomNameTag("Eagle Hunters");
  444.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  445.                 e.setAlwaysRenderNameTag(true);
  446.                 e.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
  447.                
  448.             worldIn.spawnEntityInWorld(e);
  449.             }
  450.                                        
  451.            
  452.         }
  453.    
  454.    
  455.     /**
  456.      *
  457.      * lets make a troll chat XD
  458.      */
  459.     public static void trollChat(World worldIn,BlockPos pos, EntityPlayer player){
  460.        
  461.        
  462.             player.addChatMessage(new ChatComponentText(ChatFormatting.BLUE+"It Was A Troll... Or Maybe...."));
  463.        
  464.        
  465.     }
  466.    
  467.    
  468.     public static void toVoid(World worldIn,BlockPos pos){
  469.        
  470.        
  471.             int h=pos.getY();
  472.             for(int i=0;i<=h;i++)
  473.             {
  474.                 BlockPos air=new BlockPos(pos.getX(),pos.getY()-i,pos.getZ());
  475.                 worldIn.setBlockState(air, Blocks.air.getDefaultState(), 2);
  476.             }
  477.        
  478.        
  479.     }
  480.    
  481.    
  482.     /**
  483.      * contains Some Stuff!
  484.      * @param worldIn
  485.      * @param pos
  486.      */
  487.    
  488.     public static void redstoneKit(World worldIn,BlockPos pos)
  489.     {
  490.        
  491.         summonItemWithLoop(worldIn, pos, Items.redstone, 64, 0, 0);
  492.         summonBlockWithLoop(worldIn, pos, Blocks.sticky_piston, 20, 0, 0);
  493.         summonItemWithLoop(worldIn, pos, Items.slime_ball, 40, 1, 5);
  494.         summonItemWithLoop(worldIn, pos, Items.repeater, 10, 0, 0);
  495.        
  496.     }
  497.    
  498.    
  499.    
  500.     public static void hellWellStructure(World worldIn,BlockPos pos){
  501.        
  502.        
  503.         worldIn.setBlockState(pos, Blocks.lava.getDefaultState(), 2);
  504.         worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
  505.         worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
  506.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
  507.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
  508.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
  509.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
  510.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
  511.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
  512.        
  513.         Random rand=new Random();
  514.         int r=rand.nextInt(5)+1;
  515.         for(int i=0;i<r;i++)
  516.         {
  517.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()+1), Blocks.nether_brick_fence.getDefaultState(), 2);
  518.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()-1), Blocks.nether_brick_fence.getDefaultState(), 2);
  519.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()-1), Blocks.nether_brick_fence.getDefaultState(), 2);
  520.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()+1), Blocks.nether_brick_fence.getDefaultState(), 2);
  521.            
  522.         }
  523.        
  524.         worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()), Blocks.glowstone.getDefaultState(), 2);
  525.         //setting bricks and netherracks
  526.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()+1), Blocks.netherrack.getDefaultState(), 2);
  527.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()-1), Blocks.netherrack.getDefaultState(), 2);
  528.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()+1), Blocks.netherrack.getDefaultState(), 2);
  529.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()-1), Blocks.netherrack.getDefaultState(), 2);
  530.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()+1), Blocks.fire.getDefaultState(), 2);
  531.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()-1), Blocks.fire.getDefaultState(), 2);
  532.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()+1), Blocks.fire.getDefaultState(), 2);
  533.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()-1), Blocks.fire.getDefaultState(), 2);
  534.        
  535.         worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
  536.         worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
  537.         worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
  538.         worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
  539.        
  540.        
  541.        
  542.     }
  543.    
  544.    
  545.     public static void endWellStruct(World worldIn,BlockPos pos){
  546.        
  547.        
  548.            
  549.             worldIn.setBlockState(pos, Blocks.water.getDefaultState(), 2);
  550.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
  551.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
  552.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
  553.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
  554.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
  555.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
  556.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
  557.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
  558.            
  559.             Random rand=new Random();
  560.             int r=rand.nextInt(6)+1;
  561.             for(int i=0;i<r;i++)
  562.             {
  563.                 worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()+1), Blocks.birch_fence.getDefaultState(), 2);
  564.                 worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()-1), Blocks.birch_fence.getDefaultState(), 2);
  565.                 worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()-1), Blocks.birch_fence.getDefaultState(), 2);
  566.                 worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()+1), Blocks.birch_fence.getDefaultState(), 2);
  567.                
  568.             }
  569.            
  570.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()), Blocks.beacon.getDefaultState(), 2);
  571.             //setting bricks and netherracks
  572.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()+1), Blocks.obsidian.getDefaultState(), 2);
  573.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()-1), Blocks.obsidian.getDefaultState(), 2);
  574.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()+1), Blocks.obsidian.getDefaultState(), 2);
  575.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()-1), Blocks.obsidian.getDefaultState(), 2);
  576.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()+1), Blocks.end_portal_frame.getDefaultState(), 2);
  577.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()-1), Blocks.end_portal_frame.getDefaultState(), 2);
  578.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()+1), Blocks.end_portal_frame.getDefaultState(), 2);
  579.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()-1), Blocks.end_portal_frame.getDefaultState(), 2);
  580.            
  581.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
  582.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
  583.             worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
  584.             worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
  585.            
  586.            
  587.        
  588.        
  589.     }
  590.    
  591.    
  592.    
  593.    
  594.     public static void addEnchantsMany(ItemStack stack,Enchantment[] e,int amp,World worldIn,BlockPos pos){
  595.        
  596.         for(int i=0;i<e.length;i++)
  597.         {
  598.             stack.addEnchantment(e[i], amp);
  599.         }
  600.        
  601.         summonItemAsDrop(pos, worldIn, stack);
  602.        
  603.     }
  604.    
  605.    
  606.     public static void addRandomEnchtToRandomItems(World worldIn,ItemStack[] stack,Enchantment[] ench,int ampUpperLimit,BlockPos pos){
  607.        
  608.        
  609.             Random rand = new Random();
  610.            
  611.            
  612.             int r=rand.nextInt(stack.length);
  613.             int a=rand.nextInt(stack.length);
  614.             if(r==a){a-=1;}
  615.             for(int i=a;i<r;i++)
  616.             {
  617.                 int y=rand.nextInt(ench.length);
  618.                 int z=rand.nextInt(ench.length);
  619.                 if(y==z){z-=1;}
  620.                 for(int j=z;j<y;j++){
  621.                    
  622.                     int n=rand.nextInt(ench.length);
  623.                     stack[i].addEnchantment(ench[n], rand.nextInt(ampUpperLimit)+1);   
  624.                
  625.                
  626.                
  627.                 }
  628.                 summonItemStackWithLoop(worldIn, pos, stack[i],1, 0, 0);
  629.                
  630.             }
  631.        
  632.        
  633.        
  634.     }
  635.    
  636.    
  637.     public static void holeDeathTrap(World worldIn,BlockPos pos){
  638.        
  639.        
  640.             int h=pos.getY();
  641.             for(int i=0;i<h;i++)
  642.             {
  643.                 worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-i,pos.getZ()), Blocks.air.getDefaultState(), 2);
  644.             }
  645.            
  646.        
  647.        
  648.     }
  649.    
  650.    
  651.     public static void mountain(World worldIn,BlockPos pos)
  652.     {  
  653.         Random rand=new Random();
  654.         int r=rand.nextInt(6)+1;
  655.        
  656.         for(int i=0;i<r;i++)
  657.         {
  658.             for(int j=0;j<3;j++)
  659.             {
  660.                 worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+i,pos.getZ()+j), Blocks.diamond_block.getDefaultState(),2);
  661.                
  662.                
  663.             }
  664.            
  665.         }
  666.        
  667.     }
  668.    
  669.     public static void mountainOne(World worldIn,BlockPos pos)
  670.     {  
  671.         Random rand=new Random();
  672.         int r=rand.nextInt(6)+1;
  673.        
  674.         for(int i=0;i<r;i++)
  675.         {
  676.             for(int j=0;j<3;j++)
  677.             {
  678.                 worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+i,pos.getZ()+j), Blocks.emerald_block.getDefaultState(),2);
  679.                
  680.                
  681.             }
  682.            
  683.         }
  684.        
  685.     }
  686.    
  687.     /**
  688.      *
  689.      * Summons A Ghost
  690.      * Pars- World,pos,loop(amount of Ghosts)
  691.      */
  692.  
  693.     public static void summonGhost(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  694.        
  695.             int r=loop;
  696.             if(isRandom)
  697.             {
  698.                 Random rand=new Random();
  699.                 r=rand.nextInt(upperlimit)+2;
  700.             }
  701.            
  702.             for(int i=0;i<=r-1;i++){
  703.                
  704.                 EntityGhost e = new EntityGhost(worldIn);
  705.                
  706.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  707.                 e.setAlwaysRenderNameTag(true);
  708.                
  709.             worldIn.spawnEntityInWorld(e);
  710.             }
  711.                                        
  712.            
  713.         }
  714.    
  715.     /**
  716.      *
  717.      * Summons Captain Sparklez army :D
  718.      * Pars- World,pos,loop(size of army)
  719.      */
  720.  
  721.     public static void summonCaptainSparklezWithCustomName(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  722.        
  723.             int r=loop;
  724.             if(isRandom)
  725.             {
  726.                 Random rand=new Random();
  727.                 r=rand.nextInt(upperlimit)+2;
  728.             }
  729.            
  730.             for(int i=0;i<=r-1;i++){
  731.                
  732.                 EntityCaptainSparklez e = new EntityCaptainSparklez(worldIn);
  733.                 e.setCustomNameTag("CaptainSparklez Army");
  734.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  735.                 e.setAlwaysRenderNameTag(true);
  736.                
  737.             worldIn.spawnEntityInWorld(e);
  738.             }
  739.                                        
  740.            
  741.         }
  742.    
  743.    
  744.     public static void foodKit(World worldIn,BlockPos pos){
  745.        
  746.         summonBlockAsDrop(pos, worldIn, Blocks.cake);
  747.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.golden_apple,1,1), 10, 1, 30);
  748.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.bread), 16, 1, 10);
  749.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.apple), 5, 0, 0);
  750.         summonItemAsDrop(pos, worldIn, new ItemStack(Items.golden_apple));
  751.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.cooked_beef),34, 0, 0);
  752.        
  753.     }
  754.    
  755.    
  756.     /**
  757.      *
  758.      * lets make a chat
  759.      */
  760.     public static void chat(World worldIn,BlockPos pos,String chat,EntityPlayer player){
  761.        
  762.        
  763.             player.addChatMessage(new ChatComponentText(chat));
  764.        
  765.        
  766.     }
  767.    
  768.     public static void materialKit(World worldIn,BlockPos pos)
  769.     {
  770.        
  771.         Random rand=new Random();
  772.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.diamond), rand.nextInt(50)+1, 1, rand.nextInt(5));
  773.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.gold_ingot), rand.nextInt(50)+1, 1, rand.nextInt(15));
  774.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.iron_ingot), rand.nextInt(30)+1, 1, rand.nextInt(10));
  775.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.emerald), rand.nextInt(40)+1, 1, rand.nextInt(4));
  776.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.coal), rand.nextInt(10)+1, 1, rand.nextInt(30));
  777.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.chest_minecart), rand.nextInt(10)+1, 0, 0);
  778.         summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.blaze_powder), rand.nextInt(64)+1, 1, rand.nextInt(15));
  779.        
  780.     }
  781.    
  782.     /**
  783.      *
  784.      * Summons A AntVenom
  785.      * Pars- World,pos,loop(amount of Ant)
  786.      */
  787.  
  788.     public static void summonAntVenom(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  789.        
  790.             int r=loop;
  791.             if(isRandom)
  792.             {
  793.                 Random rand=new Random();
  794.                 r=rand.nextInt(upperlimit)+2;
  795.             }
  796.            
  797.             for(int i=0;i<=r-1;i++){
  798.                
  799.                 EntityAntVenom e = new EntityAntVenom(worldIn);
  800.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  801.                 e.setAlwaysRenderNameTag(true);
  802.                
  803.             worldIn.spawnEntityInWorld(e);
  804.             }
  805.                                        
  806.            
  807.         }
  808.    
  809.     /**
  810.      *
  811.      * Summons A Dan
  812.      * Pars- World,pos,loop(amount of Dan)
  813.      */
  814.  
  815.     public static void summonDanTDM(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  816.        
  817.             int r=loop;
  818.             if(isRandom)
  819.             {
  820.                 Random rand=new Random();
  821.                 r=rand.nextInt(upperlimit)+2;
  822.             }
  823.            
  824.             for(int i=0;i<=r-1;i++){
  825.                
  826.                 EntityDanTDM e = new EntityDanTDM(worldIn);
  827.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  828.                 e.setAlwaysRenderNameTag(true);
  829.            
  830.                
  831.             worldIn.spawnEntityInWorld(e);
  832.             }
  833.                                        
  834.            
  835.         }
  836.    
  837.    
  838.     public static void burgerStruct(World worldIn,BlockPos pos)
  839.     {
  840.        
  841.            
  842.         for(int i=0;i<3;i++)
  843.         {
  844.             for(int j=0;j<3;j++){
  845.             worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY(),pos.getZ()+i), Blocks.iron_block.getDefaultState(), 2);
  846.                 }
  847.         }
  848.        
  849.         for(int i=0;i<3;i++)
  850.         {
  851.             for(int j=0;j<3;j++){
  852.             worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+1,pos.getZ()+i), Blocks.diamond_block.getDefaultState(), 2);
  853.                 }
  854.         }
  855.        
  856.         for(int i=0;i<3;i++)
  857.         {
  858.             for(int j=0;j<3;j++){
  859.             worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+2,pos.getZ()+i), Blocks.emerald_block.getDefaultState(), 2);
  860.                 }
  861.         }
  862.        
  863.        
  864.        
  865.     }
  866.    
  867.    
  868.    
  869.    
  870.    
  871.     public static void burgerStructOne(World worldIn,BlockPos pos)
  872.     {
  873.        
  874.            
  875.         for(int i=0;i<3;i++)
  876.         {
  877.             for(int j=0;j<3;j++){
  878.             worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY(),pos.getZ()+i), Blocks.glowstone.getDefaultState(), 2);
  879.                 }
  880.         }
  881.        
  882.         for(int i=0;i<3;i++)
  883.         {
  884.             for(int j=0;j<3;j++){
  885.             worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+1,pos.getZ()+i), Blocks.dragon_egg.getDefaultState(), 2);
  886.                 }
  887.         }
  888.        
  889.         for(int i=0;i<3;i++)
  890.         {
  891.             for(int j=0;j<3;j++){
  892.             worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+2,pos.getZ()+i), Blocks.beacon.getDefaultState(), 2);
  893.                 }
  894.         }
  895.        
  896.        
  897.        
  898.     }
  899.    
  900.    
  901.    
  902.     /**
  903.      *
  904.      * Summons A SP
  905.      * Pars- World,pos,loop(amount of SP)
  906.      */
  907.  
  908.     public static void summonSP(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  909.        
  910.             int r=loop;
  911.             if(isRandom)
  912.             {
  913.                 Random rand=new Random();
  914.                 r=rand.nextInt(upperlimit)+2;
  915.             }
  916.            
  917.             for(int i=0;i<=r-1;i++){
  918.                
  919.                 EntitySerialPlayer e = new EntitySerialPlayer(worldIn);
  920.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  921.                 e.setAlwaysRenderNameTag(true);
  922.            
  923.                
  924.             worldIn.spawnEntityInWorld(e);
  925.             }
  926.                                        
  927.            
  928.         }
  929.    
  930.    
  931.    
  932.     public static void orcArmy(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit){
  933.        
  934.  
  935.             Random rand=new Random();
  936.             int r=loop;
  937.             if(isRandom)
  938.             {
  939.                 r=rand.nextInt(upperlimit)+2;
  940.             }
  941.            
  942.             for(int i=0;i<=r-1;i++){
  943.                
  944.                 EntityZombie e = new EntityZombie(worldIn);
  945.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  946.                 e.setAlwaysRenderNameTag(true);
  947.                 e.setCustomNameTag("Orc Army");
  948.                
  949.                 e.setCurrentItemOrArmor(4, new ItemStack(ModItems.ytHelmet));
  950.                
  951.                 switch(rand.nextInt(5))
  952.                 {
  953.                 case 1:{
  954.                     e.setCurrentItemOrArmor(0, new ItemStack(Items.diamond_sword));
  955.                     break;}
  956.                 case 2:{
  957.                     e.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
  958.                     break;
  959.                 }
  960.                 case 3:{
  961.                     e.setCurrentItemOrArmor(0, new ItemStack(Items.stone_axe));
  962.                     break;
  963.                 }
  964.                 case 0:{
  965.                     e.setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword));
  966.                     break;
  967.                 }
  968.                
  969.                 case 4:{
  970.                     e.setCurrentItemOrArmor(0, new ItemStack(ModItems.devilSword));
  971.                    
  972.                 }
  973.                
  974.                 }
  975.                
  976.                
  977.             worldIn.spawnEntityInWorld(e);
  978.             }
  979.                                        
  980.            
  981.        
  982.        
  983.        
  984.     }
  985.    
  986.    
  987.     public static void lookUp(World w,BlockPos pos,EntityPlayer p)
  988.     {
  989.  
  990.        
  991.             double x=p.posX;
  992.             double y=p.posY;
  993.             double z=p.posZ;
  994.            
  995.             setOneBlock(w,new BlockPos(x,y+10,z), Blocks.anvil);
  996.            
  997.        
  998.        
  999.     }
  1000.    
  1001.    
  1002.     public static void summonBunny(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1003.        
  1004.             int r=loop;
  1005.             if(isRandom)
  1006.             {
  1007.                 Random rand=new Random();
  1008.                 r=rand.nextInt(upperlimit)+2;
  1009.             }
  1010.            
  1011.             for(int i=0;i<=r-1;i++){
  1012.                
  1013.                 EntityRabbit e = new EntityRabbit(worldIn);
  1014.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  1015.                 e.setAlwaysRenderNameTag(true);
  1016.                 e.setRabbitType(99);
  1017.                
  1018.             worldIn.spawnEntityInWorld(e);
  1019.             }
  1020.                                        
  1021.            
  1022.         }
  1023.    
  1024.     public static void giveBlocks(World worldIn,BlockPos pos,ItemStack block,int loop,EntityPlayer p){
  1025.        
  1026.        
  1027.             for(int i=0;i<loop;i++)
  1028.             {p.inventory.addItemStackToInventory(block);}
  1029.        
  1030.    
  1031.     }
  1032.    
  1033.     public static void tntFix(World worldIn,BlockPos pos,int amOfTnt)
  1034.     {
  1035.        
  1036.             for(int i=0;i<amOfTnt;i++){
  1037.              EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F),Minecraft.getMinecraft().thePlayer );
  1038.                 entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
  1039.                 worldIn.spawnEntityInWorld(entitytntprimed);
  1040.            
  1041.             }
  1042.        
  1043.     }
  1044.    
  1045.     public static void tntNearby(World worldIn,BlockPos pos,int amOfTnt)
  1046.     {
  1047.        
  1048.             Random rand=new Random();
  1049.             for(int i=0;i<amOfTnt;i++){
  1050.              EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F)+rand.nextInt(20), (double)pos.getY()+rand.nextInt(20), (double)((float)pos.getZ() + 0.5F)+rand.nextInt(20),Minecraft.getMinecraft().thePlayer );
  1051.                 entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
  1052.                 worldIn.spawnEntityInWorld(entitytntprimed);
  1053.            
  1054.             }
  1055.        
  1056.     }
  1057.    
  1058.     public static void tntRain(World worldIn,BlockPos pos,int amOfTnt,int skip)
  1059.     {
  1060.        
  1061.             for(int i=0;i<amOfTnt;i++){
  1062.              EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY()+(skip*i), (double)((float)pos.getZ() + 0.5F),Minecraft.getMinecraft().thePlayer );
  1063.                 entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
  1064.                 worldIn.spawnEntityInWorld(entitytntprimed);
  1065.            
  1066.             }
  1067.        
  1068.     }
  1069.    
  1070.     public static void potionKit(World worldIn,BlockPos pos){
  1071.        
  1072.         Random rand=new Random();
  1073.            
  1074.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.ender_pearl), rand.nextInt(50)+1, 0, 0);
  1075.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.ender_eye), rand.nextInt(50)+1, 0, 0);
  1076.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.magma_cream), rand.nextInt(50)+1, 0, 0);
  1077.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.brewing_stand),1, 0, 0);
  1078.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.fermented_spider_eye), rand.nextInt(50)+1, 0, 0);
  1079.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.speckled_melon), rand.nextInt(50)+1, 0, 0);
  1080.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.gold_nugget), rand.nextInt(50)+1, 0, 0);
  1081.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.spider_eye), rand.nextInt(50)+1, 0, 0);
  1082.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.nether_wart), rand.nextInt(50)+1, 0, 0);
  1083.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.glass_bottle), rand.nextInt(50)+1, 0, 0);
  1084.         ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.blaze_rod), rand.nextInt(50)+1, 0, 0);
  1085.        
  1086.        
  1087.        
  1088.     }
  1089.    
  1090.    
  1091.     public static void musicKit(World worldIn,BlockPos pos)
  1092.     {
  1093.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Blocks.jukebox));
  1094.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_11));
  1095.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_13));
  1096.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_blocks));
  1097.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_cat));
  1098.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_chirp));
  1099.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_far));
  1100.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_mall));
  1101.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_mellohi));
  1102.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_stal));
  1103.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_strad));
  1104.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_wait));
  1105.             ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_ward));
  1106.            
  1107.        
  1108.     }
  1109.    
  1110.     public static void towerStruct(World worldIn,BlockPos pos)
  1111.     {
  1112.        
  1113.             int flags=2;
  1114.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()), Blocks.redstone_block.getDefaultState(), flags);
  1115.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+1,pos.getZ()), Blocks.lapis_block.getDefaultState(), flags);
  1116.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+2,pos.getZ()), Blocks.coal_block.getDefaultState(), flags);
  1117.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+3,pos.getZ()), Blocks.gold_block.getDefaultState(), flags);
  1118.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+4,pos.getZ()), Blocks.iron_block.getDefaultState(), flags);
  1119.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+5,pos.getZ()), Blocks.emerald_block.getDefaultState(), flags);
  1120.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+6,pos.getZ()), Blocks.diamond_block.getDefaultState(), flags);
  1121.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+7,pos.getZ()), Blocks.obsidian.getDefaultState(), flags);
  1122.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+8,pos.getZ()), Blocks.dragon_egg.getDefaultState(), flags);
  1123.            
  1124.        
  1125.        
  1126.        
  1127.     }
  1128.    
  1129.    
  1130.     /**
  1131.      *
  1132.      * Summons A ghast? idk either...
  1133.      * Pars- World,pos,loop(amount of Ghast)
  1134.      */
  1135.  
  1136.     public static void summonGhast(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1137.        
  1138.             int r=loop;
  1139.             if(isRandom)
  1140.             {
  1141.                 Random rand=new Random();
  1142.                 r=rand.nextInt(upperlimit)+2;
  1143.             }
  1144.            
  1145.             for(int i=0;i<=r-1;i++){
  1146.                
  1147.                 EntityGhast e = new EntityGhast(worldIn);
  1148.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  1149.                 e.setAlwaysRenderNameTag(true);
  1150.            
  1151.                
  1152.             worldIn.spawnEntityInWorld(e);
  1153.             }
  1154.                                        
  1155.            
  1156.         }
  1157.    
  1158.     /**
  1159.      *
  1160.      * Summons A wither boss...
  1161.      * Pars- World,pos,loop(amount of boss)
  1162.      */
  1163.  
  1164.     public static void summonWitherBoss(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1165.        
  1166.             int r=loop;
  1167.             if(isRandom)
  1168.             {
  1169.                 Random rand=new Random();
  1170.                 r=rand.nextInt(upperlimit)+2;
  1171.             }
  1172.            
  1173.             for(int i=0;i<=r-1;i++){
  1174.                
  1175.                 EntityWither e = new EntityWither(worldIn);
  1176.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  1177.                 e.setAlwaysRenderNameTag(true);
  1178.            
  1179.                
  1180.             worldIn.spawnEntityInWorld(e);
  1181.             }
  1182.                                        
  1183.            
  1184.         }
  1185.    
  1186.    
  1187.     public static void randomSixtyFourTower(World worldIn,BlockPos pos){
  1188.        
  1189.         Random rand = new Random();
  1190.         for(int i=0;i<64;i++)
  1191.         {
  1192.             int r=rand.nextInt(8);
  1193.             if(r==0)
  1194.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.iron_block.getDefaultState(), 2);}
  1195.             else if(r==1)
  1196.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.diamond_block.getDefaultState(), 2);}
  1197.             else if(r==2)
  1198.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.gold_block.getDefaultState(), 2);}
  1199.             else if(r==3)
  1200.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.emerald_block.getDefaultState(), 2);}
  1201.             else if(r==4)
  1202.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.beacon.getDefaultState(), 2);}
  1203.             else if(r==5)
  1204.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.coal_block.getDefaultState(), 2);}
  1205.             else if(r==6)
  1206.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.redstone_block.getDefaultState(), 2);}
  1207.             else if(r==7)
  1208.             {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.dragon_egg.getDefaultState(), 2);}
  1209.  
  1210.        
  1211.        
  1212.        
  1213.            
  1214.            
  1215.        
  1216.         }
  1217.     }
  1218.    
  1219.     /**
  1220.      *
  1221.      * Summons A jen
  1222.      * Pars- World,pos,loop(amount of jen)
  1223.      */
  1224.  
  1225.     public static void summonSuperGirly(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1226.        
  1227.             int r=loop;
  1228.             if(isRandom)
  1229.             {
  1230.                 Random rand=new Random();
  1231.                 r=rand.nextInt(upperlimit)+2;
  1232.             }
  1233.            
  1234.             for(int i=0;i<=r-1;i++){
  1235.                
  1236.                 EntitySuperGirlyGamer e = new EntitySuperGirlyGamer(worldIn);
  1237.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  1238.                 e.setAlwaysRenderNameTag(true);
  1239.                
  1240.             worldIn.spawnEntityInWorld(e);
  1241.             }
  1242.                                        
  1243.            
  1244.         }
  1245.    
  1246.     public static void trollDiamondTrapWithChanceOfNotTroll(World worldIn,BlockPos pos,boolean isTrap)
  1247.     {
  1248.        
  1249.            
  1250.             if(isTrap){
  1251.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-1,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
  1252.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-2,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
  1253.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-3,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
  1254.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-4,pos.getZ()), Blocks.flowing_lava.getDefaultState(),2);
  1255.            
  1256.             }
  1257.             else
  1258.             {
  1259.                 worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-1,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
  1260.                 worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-2,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
  1261.                 worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-3,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
  1262.                 worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-4,pos.getZ()), Blocks.flowing_water.getDefaultState(),2);
  1263.            
  1264.             }
  1265.            
  1266.            
  1267.        
  1268.     }
  1269.    
  1270.    
  1271.     /**
  1272.      *
  1273.      * Summons A cow
  1274.      * Pars- World,pos,loop(amount of cows)
  1275.      */
  1276.  
  1277.     public static void summonCowNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1278.        
  1279.             int r=loop;
  1280.             Random rand=new Random();
  1281.            
  1282.             if(isRandom)
  1283.             {
  1284.                 r=rand.nextInt(upperlimit)+2;
  1285.             }
  1286.            
  1287.             for(int i=0;i<=r-1;i++){
  1288.                
  1289.                 EntityCow e = new EntityCow(worldIn);
  1290.                 e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
  1291.                 e.setAlwaysRenderNameTag(true);
  1292.                 e.setEquipmentDropChance(0, 100F);
  1293.                 e.setCurrentItemOrArmor(0, new ItemStack(Items.golden_apple));
  1294.                 e.setEquipmentDropChance(1, 100F);
  1295.                 e.setCurrentItemOrArmor(1, new ItemStack(Items.gold_ingot));
  1296.                 e.setCustomNameTag("I AM SPECIAL");
  1297.             worldIn.spawnEntityInWorld(e);
  1298.             }
  1299.                                        
  1300.            
  1301.         }
  1302.    
  1303.    
  1304.     public static void summonPigNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1305.        
  1306.             int r=loop;
  1307.             Random rand=new Random();
  1308.            
  1309.             if(isRandom)
  1310.             {
  1311.                 r=rand.nextInt(upperlimit)+2;
  1312.             }
  1313.            
  1314.             for(int i=0;i<=r-1;i++){
  1315.                
  1316.                 EntityPig e = new EntityPig(worldIn);
  1317.                 e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
  1318.                 e.setAlwaysRenderNameTag(true);
  1319.                 e.setEquipmentDropChance(0, 100F);
  1320.                 e.setCurrentItemOrArmor(0, new ItemStack(Items.golden_apple,rand.nextInt(5)+1,1));
  1321.                 e.setEquipmentDropChance(1, 100F);
  1322.                 e.setCurrentItemOrArmor(1, new ItemStack(Blocks.diamond_block));
  1323.                 e.setCustomNameTag("I AM SPECIAL");
  1324.             worldIn.spawnEntityInWorld(e);
  1325.             }
  1326.                                        
  1327.            
  1328.         }
  1329.    
  1330.    
  1331.    
  1332.     public static void summonGolemNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1333.        
  1334.             int r=loop;
  1335.             Random rand=new Random();
  1336.            
  1337.             if(isRandom)
  1338.             {
  1339.                 r=rand.nextInt(upperlimit)+2;
  1340.             }
  1341.            
  1342.             for(int i=0;i<=r-1;i++){
  1343.                
  1344.                 EntityIronGolem e = new EntityIronGolem(worldIn);
  1345.                 e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
  1346.                 e.setAlwaysRenderNameTag(true);
  1347.             worldIn.spawnEntityInWorld(e);
  1348.             }
  1349.                                        
  1350.            
  1351.         }
  1352.    
  1353.    
  1354.     public static void summonCreepsNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1355.        
  1356.             int r=loop;
  1357.             Random rand=new Random();
  1358.            
  1359.             if(isRandom)
  1360.             {
  1361.                 r=rand.nextInt(upperlimit)+2;
  1362.             }
  1363.            
  1364.             for(int i=0;i<=r-1;i++){
  1365.                
  1366.                 EntityCreeper e = new EntityCreeper(worldIn);
  1367.                 e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
  1368.                 e.setAlwaysRenderNameTag(true);
  1369.             worldIn.spawnEntityInWorld(e);
  1370.             }
  1371.                                        
  1372.            
  1373.         }
  1374.    
  1375.    
  1376.    
  1377.     public static void summonSquidRain(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1378.        
  1379.             int r=loop;
  1380.             Random rand=new Random();
  1381.            
  1382.             if(isRandom)
  1383.             {
  1384.                 r=rand.nextInt(upperlimit)+2;
  1385.             }
  1386.            
  1387.             for(int i=0;i<=r-1;i++){
  1388.                
  1389.                 EntitySquid e = new EntitySquid(worldIn);
  1390.                 e.setPosition(pos.getX()+rand.nextInt(30),pos.getY()+20, pos.getZ()+rand.nextInt(30));
  1391.                 e.setAlwaysRenderNameTag(true);
  1392.             worldIn.spawnEntityInWorld(e);
  1393.             }
  1394.                                        
  1395.            
  1396.         }
  1397.    
  1398.    
  1399.     /**
  1400.      *
  1401.      * Summons A Isquid
  1402.      * Pars- World,pos,loop(amount of squid)
  1403.      */
  1404.  
  1405.     public static void summonISquid(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1406.        
  1407.             int r=loop;
  1408.             if(isRandom)
  1409.             {
  1410.                 Random rand=new Random();
  1411.                 r=rand.nextInt(upperlimit)+2;
  1412.             }
  1413.            
  1414.             for(int i=0;i<=r-1;i++){
  1415.                
  1416.                 EntityISquid e = new EntityISquid(worldIn);
  1417.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  1418.                 e.setAlwaysRenderNameTag(true);
  1419.            
  1420.                
  1421.             worldIn.spawnEntityInWorld(e);
  1422.             }
  1423.                                        
  1424.            
  1425.         }
  1426.    
  1427.     /**
  1428.      *
  1429.      * Summons A Sky
  1430.      * Pars- World,pos,loop(amount of Sky)
  1431.      */
  1432.  
  1433.     public static void summonSkyDoesMinecraft(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1434.        
  1435.             int r=loop;
  1436.             if(isRandom)
  1437.             {
  1438.                 Random rand=new Random();
  1439.                 r=rand.nextInt(upperlimit)+2;
  1440.             }
  1441.            
  1442.             for(int i=0;i<=r-1;i++){
  1443.                
  1444.                 EntitySkyDoesMinecraft e = new EntitySkyDoesMinecraft(worldIn);
  1445.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  1446.                 e.setAlwaysRenderNameTag(true);
  1447.            
  1448.                
  1449.             worldIn.spawnEntityInWorld(e);
  1450.             }
  1451.                                        
  1452.            
  1453.         }
  1454.    
  1455.     /**
  1456.      *
  1457.      * Summons A Truemu
  1458.      * Pars- World,pos,loop(amount of truemu)
  1459.      */
  1460.  
  1461.     public static void summonTruemu(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
  1462.        
  1463.             int r=loop;
  1464.             if(isRandom)
  1465.             {
  1466.                 Random rand=new Random();
  1467.                 r=rand.nextInt(upperlimit)+2;
  1468.             }
  1469.            
  1470.             for(int i=0;i<=r-1;i++){
  1471.                
  1472.                 EntityTruemu e = new EntityTruemu(worldIn);
  1473.                 e.setPosition(pos.getX(),pos.getY(), pos.getZ());
  1474.                 e.setAlwaysRenderNameTag(true);
  1475.            
  1476.                
  1477.             worldIn.spawnEntityInWorld(e);
  1478.             }
  1479.                                        
  1480.            
  1481.         }
  1482.    
  1483.    
  1484.     public static void luckyBlockTower(World worldIn,BlockPos pos)
  1485.     {
  1486.        
  1487.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()), ModBlocks.youtube.getDefaultState(), 2);
  1488.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+1,pos.getZ()), ModBlocks.youtubeLuckyBlock.getDefaultState(), 2);
  1489.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+2,pos.getZ()), ModBlocks.antVenomLuckyBlock.getDefaultState(), 2);
  1490.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+3,pos.getZ()), ModBlocks.captainSparkelzLuckyBlock.getDefaultState(), 2);
  1491.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+4,pos.getZ()), ModBlocks.danTDMLuckyBlock.getDefaultState(), 2);
  1492.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+5,pos.getZ()), ModBlocks.gamingWithJenLuckyBlock.getDefaultState(), 2);
  1493.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+6,pos.getZ()), ModBlocks.iBallisticSquidLuckyBlock.getDefaultState(), 2);
  1494.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+7,pos.getZ()), ModBlocks.popularMMOLuckyBlock.getDefaultState(), 2);
  1495.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+8,pos.getZ()), ModBlocks.serialPlayerLuckyBlock.getDefaultState(), 2);
  1496.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+9,pos.getZ()), ModBlocks.skyDoesMinecraftLuckyBlock.getDefaultState(), 2);
  1497.             worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+10,pos.getZ()), ModBlocks.trueMuLuckyBlock.getDefaultState(), 2);
  1498.            
  1499.            
  1500.        
  1501.     }
  1502.    
  1503. }//CLASS END HERE
Add Comment
Please, Sign In to add comment