Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.thvardhan.ytstuff.functions;
- import java.util.Random;
- import com.mojang.realmsclient.gui.ChatFormatting;
- import com.thvardhan.ytstuff.blocks.ModBlocks;
- import com.thvardhan.ytstuff.entity.EntityAntVenom;
- import com.thvardhan.ytstuff.entity.EntityCaptainSparklez;
- import com.thvardhan.ytstuff.entity.EntityDanTDM;
- import com.thvardhan.ytstuff.entity.EntityGhost;
- import com.thvardhan.ytstuff.entity.EntityISquid;
- import com.thvardhan.ytstuff.entity.EntityLogDotZip;
- import com.thvardhan.ytstuff.entity.EntityPopularMMO;
- import com.thvardhan.ytstuff.entity.EntitySerialPlayer;
- import com.thvardhan.ytstuff.entity.EntitySkyDoesMinecraft;
- import com.thvardhan.ytstuff.entity.EntitySuperGirlyGamer;
- import com.thvardhan.ytstuff.entity.EntityTruemu;
- import com.thvardhan.ytstuff.items.ModItems;
- import net.minecraft.block.Block;
- import net.minecraft.client.Minecraft;
- import net.minecraft.enchantment.Enchantment;
- import net.minecraft.entity.boss.EntityWither;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.item.EntityTNTPrimed;
- import net.minecraft.entity.monster.EntityBlaze;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityGhast;
- import net.minecraft.entity.monster.EntityIronGolem;
- import net.minecraft.entity.monster.EntitySkeleton;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.entity.passive.EntityCow;
- import net.minecraft.entity.passive.EntityPig;
- import net.minecraft.entity.passive.EntityRabbit;
- import net.minecraft.entity.passive.EntitySquid;
- import net.minecraft.entity.passive.EntityWolf;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.BlockPos;
- import net.minecraft.util.ChatComponentText;
- import net.minecraft.world.World;
- public class ExtraFunctions {
- /**
- * Summon Blocks As Drop With Loops
- * 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)
- *
- */
- public static void summonBlockWithLoop(World worldIn, BlockPos pos,Block block,int loop,int style,int skip) {
- float f = 0.5F;
- double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(block));
- entityitem.setDefaultPickupDelay();
- for(int i=0;i<=loop-1;i++){
- if(style==1){
- EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() , (double)pos.getY() +i+skip, (double)pos.getZ() , new ItemStack(block));
- worldIn.spawnEntityInWorld(entityitem1);}
- else{
- EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(block));
- worldIn.spawnEntityInWorld(entityitem1);
- }
- }
- }
- /**
- *
- * Summons A Block Like A Drop
- */
- public static void summonBlockAsDrop(BlockPos pos, World worldIn,Block block) {
- float f = 0.5F;
- double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(block));
- entityitem.setDefaultPickupDelay();
- worldIn.spawnEntityInWorld(entityitem);
- }
- /**
- *
- * Summons A Item Like A Drop
- */
- public static void summonItemAsDrop(BlockPos pos, World worldIn,ItemStack stack) {
- float f = 0.5F;
- double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2,stack);
- entityitem.setDefaultPickupDelay();
- worldIn.spawnEntityInWorld(entityitem);
- }
- /**
- *
- * Summons A Zombie
- * Pars- World,pos,loop(ammount of Zombie)
- */
- public static void summonZombie(World worldIn,BlockPos pos,int loop) {
- for(int i=0;i<=loop-1;i++){
- EntityZombie z = new EntityZombie(worldIn);
- z.setPosition(pos.getX(),pos.getY(), pos.getZ());
- worldIn.spawnEntityInWorld(z);
- }
- }
- /**
- * Set Tnt on top of random block.
- * from location of block broken to x+5 x-5 z+5 z-5
- * @param worldIn
- * @param pos
- */
- public static void setTntWithBlock(World worldIn,BlockPos pos) {
- Block random;
- Random rand = new Random();
- switch(rand.nextInt(5)){
- case 0:{
- random=Blocks.diamond_block;
- break;
- }
- case 1:{
- random=Blocks.obsidian;
- break;
- }
- case 2:{
- random=Blocks.dirt;
- break;
- }
- case 3:{
- random = Blocks.log;
- break;
- }
- case 4:{
- random = Blocks.anvil;
- break;
- }
- default:{
- random = Blocks.dragon_egg;
- break;
- }
- }
- for(int i=0;i<=4;i++)
- {
- BlockPos a=new BlockPos(pos.getX()+5, pos.getY(), pos.getZ()-2+i);
- worldIn.setBlockState(a, random.getDefaultState(),3);
- BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
- worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
- BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
- worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
- }
- for(int i=0;i<=4;i++)
- {
- BlockPos a=new BlockPos(pos.getX()-5, pos.getY(), pos.getZ()+2-i);
- worldIn.setBlockState(a, random.getDefaultState(),3);
- BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
- worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
- BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
- worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
- }
- for(int i=0;i<=4;i++)
- {
- BlockPos a=new BlockPos(pos.getX()-2+i, pos.getY(), pos.getZ()+5);
- worldIn.setBlockState(a, random.getDefaultState(),3);
- BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
- worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
- BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
- worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
- }
- for(int i=0;i<=4;i++)
- {
- BlockPos a=new BlockPos(pos.getX()+2-i, pos.getY(), pos.getZ()-5);
- worldIn.setBlockState(a, random.getDefaultState(),3);
- BlockPos b=new BlockPos(a.getX(), a.getY()+1, a.getZ());
- worldIn.setBlockState(b, Blocks.tnt.getDefaultState(),3);
- BlockPos c=new BlockPos(b.getX(),b.getY()+1,b.getZ());
- worldIn.setBlockState(c, Blocks.fire.getDefaultState(), 3);
- }
- }
- /**
- *
- * @param worldIn
- * @param pos
- * @param item in game name
- * @param item changed name
- * @param enchantment
- * @param amplifier
- */
- public static void summonEnchantedItemAsDrop(World worldIn, BlockPos pos,
- Item i, String name, Enchantment e, int amp) {
- ItemStack itemE=new ItemStack(i);
- itemE.addEnchantment(e, amp);
- itemE.setStackDisplayName(name);
- summonItemAsDrop(pos, worldIn, itemE);
- }
- /**
- *
- * Summons A logdotzip (medium)
- * Pars- World,pos
- */
- public static void summonLogdotzip(World worldIn,BlockPos pos) {
- Random rand=new Random();
- for(int i=0;i<=rand.nextInt(3)+1;i++){
- EntityLogDotZip l = new EntityLogDotZip(worldIn);
- l.setPosition(pos.getX(),pos.getY(), pos.getZ());
- worldIn.spawnEntityInWorld(l);
- }
- }
- /**
- *
- * Tp to Random Loc.
- *
- */
- public static void tpPlayer(EntityPlayer player) {
- player.setPosition(player.posX, player.serverPosY=(int)player.posY+500, player.posZ);
- }
- /**
- *
- * Summons A Wolf
- * Pars- World,pos,loop(ammount of Wolf)
- */
- public static void summonWolf(World worldIn,BlockPos pos,int loop) {
- for(int i=0;i<=loop-1;i++){
- EntityWolf z = new EntityWolf(worldIn);
- z.setPosition(pos.getX(),pos.getY(), pos.getZ());
- worldIn.spawnEntityInWorld(z);
- }
- }
- /**
- *
- * Summons A Blaze
- * Pars- World,pos,loop(ammount of Blaze)
- */
- public static void summonBlaze(World worldIn,BlockPos pos,int loop) {
- for(int i=0;i<=loop-1;i++){
- EntityBlaze z = new EntityBlaze(worldIn);
- z.setPosition(pos.getX(),pos.getY(), pos.getZ());
- z.setHealth(100);
- worldIn.spawnEntityInWorld(z);
- }
- }
- public static void setOneBlock(World worldIn,BlockPos pos,Block block){
- worldIn.setBlockState(pos, block.getDefaultState(), 2);
- }
- /**
- * Summon Items As Drop With Loops
- * 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)
- *
- */
- public static void summonItemWithLoop(World worldIn, BlockPos pos,Item item,int loop,int style,int skip) {
- float f = 0.5F;
- double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- for(int i=0;i<=loop-1;i++){
- if(style==1){
- EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() , (double)pos.getY() +i+skip, (double)pos.getZ() , new ItemStack(item));
- entityitem1.setDefaultPickupDelay();
- worldIn.spawnEntityInWorld(entityitem1);}
- else{
- EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, new ItemStack(item));
- entityitem1.setDefaultPickupDelay();
- worldIn.spawnEntityInWorld(entityitem1);
- }
- }
- }
- /**
- *
- * Summons A PopularMMO
- * Pars- World,pos,loop(ammount of popularmmo)
- */
- public static void summonPopularMMO(World worldIn,BlockPos pos,int loop) {
- for(int i=0;i<=loop-1;i++){
- EntityPopularMMO e = new EntityPopularMMO(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- * Summon ItemsStack As Drop With Loops
- * 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)
- *
- */
- public static void summonItemStackWithLoop(World worldIn, BlockPos pos,ItemStack item,int loop,int style,int skip) {
- float f = 0.5F;
- double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
- EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, item);
- entityitem.setDefaultPickupDelay();
- for(int i=0;i<=loop-1;i++){
- if(style==1){
- EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() , (double)pos.getY() +i+skip, (double)pos.getZ() , item);
- worldIn.spawnEntityInWorld(entityitem1);}
- else{
- EntityItem entityitem1 = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, item);
- worldIn.spawnEntityInWorld(entityitem1);
- }
- }
- }
- /**
- *
- * Summons A Skeleton
- * Pars- World,pos,loop(ammount of Skeleton)
- */
- public static void summonSkeleton(World worldIn,BlockPos pos,int loop) {
- for(int i=0;i<=loop-1;i++){
- EntitySkeleton e = new EntitySkeleton(worldIn);
- e.setCustomNameTag("Eagle Hunters");
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- e.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- *
- * lets make a troll chat XD
- */
- public static void trollChat(World worldIn,BlockPos pos, EntityPlayer player){
- player.addChatMessage(new ChatComponentText(ChatFormatting.BLUE+"It Was A Troll... Or Maybe...."));
- }
- public static void toVoid(World worldIn,BlockPos pos){
- int h=pos.getY();
- for(int i=0;i<=h;i++)
- {
- BlockPos air=new BlockPos(pos.getX(),pos.getY()-i,pos.getZ());
- worldIn.setBlockState(air, Blocks.air.getDefaultState(), 2);
- }
- }
- /**
- * contains Some Stuff!
- * @param worldIn
- * @param pos
- */
- public static void redstoneKit(World worldIn,BlockPos pos)
- {
- summonItemWithLoop(worldIn, pos, Items.redstone, 64, 0, 0);
- summonBlockWithLoop(worldIn, pos, Blocks.sticky_piston, 20, 0, 0);
- summonItemWithLoop(worldIn, pos, Items.slime_ball, 40, 1, 5);
- summonItemWithLoop(worldIn, pos, Items.repeater, 10, 0, 0);
- }
- public static void hellWellStructure(World worldIn,BlockPos pos){
- worldIn.setBlockState(pos, Blocks.lava.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
- Random rand=new Random();
- int r=rand.nextInt(5)+1;
- for(int i=0;i<r;i++)
- {
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()+1), Blocks.nether_brick_fence.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()-1), Blocks.nether_brick_fence.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()-1), Blocks.nether_brick_fence.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()+1), Blocks.nether_brick_fence.getDefaultState(), 2);
- }
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()), Blocks.glowstone.getDefaultState(), 2);
- //setting bricks and netherracks
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()+1), Blocks.netherrack.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()-1), Blocks.netherrack.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()+1), Blocks.netherrack.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()-1), Blocks.netherrack.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()+1), Blocks.fire.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()-1), Blocks.fire.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()+1), Blocks.fire.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()-1), Blocks.fire.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()-1), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()+1), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()), Blocks.nether_brick.getDefaultState(), 2);
- }
- public static void endWellStruct(World worldIn,BlockPos pos){
- worldIn.setBlockState(pos, Blocks.water.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY(),pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY(),pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
- Random rand=new Random();
- int r=rand.nextInt(6)+1;
- for(int i=0;i<r;i++)
- {
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()+1), Blocks.birch_fence.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()-1), Blocks.birch_fence.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+1+i,pos.getZ()-1), Blocks.birch_fence.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+1+i,pos.getZ()+1), Blocks.birch_fence.getDefaultState(), 2);
- }
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()), Blocks.beacon.getDefaultState(), 2);
- //setting bricks and netherracks
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()+1), Blocks.obsidian.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()-1), Blocks.obsidian.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()+1), Blocks.obsidian.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()-1), Blocks.obsidian.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()+1), Blocks.end_portal_frame.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()-1), Blocks.end_portal_frame.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+2,pos.getZ()+1), Blocks.end_portal_frame.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+2,pos.getZ()-1), Blocks.end_portal_frame.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()-1), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+r+1,pos.getZ()+1), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()-1,pos.getY()+r+1,pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX()+1,pos.getY()+r+1,pos.getZ()), Blocks.end_stone.getDefaultState(), 2);
- }
- public static void addEnchantsMany(ItemStack stack,Enchantment[] e,int amp,World worldIn,BlockPos pos){
- for(int i=0;i<e.length;i++)
- {
- stack.addEnchantment(e[i], amp);
- }
- summonItemAsDrop(pos, worldIn, stack);
- }
- public static void addRandomEnchtToRandomItems(World worldIn,ItemStack[] stack,Enchantment[] ench,int ampUpperLimit,BlockPos pos){
- Random rand = new Random();
- int r=rand.nextInt(stack.length);
- int a=rand.nextInt(stack.length);
- if(r==a){a-=1;}
- for(int i=a;i<r;i++)
- {
- int y=rand.nextInt(ench.length);
- int z=rand.nextInt(ench.length);
- if(y==z){z-=1;}
- for(int j=z;j<y;j++){
- int n=rand.nextInt(ench.length);
- stack[i].addEnchantment(ench[n], rand.nextInt(ampUpperLimit)+1);
- }
- summonItemStackWithLoop(worldIn, pos, stack[i],1, 0, 0);
- }
- }
- public static void holeDeathTrap(World worldIn,BlockPos pos){
- int h=pos.getY();
- for(int i=0;i<h;i++)
- {
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-i,pos.getZ()), Blocks.air.getDefaultState(), 2);
- }
- }
- public static void mountain(World worldIn,BlockPos pos)
- {
- Random rand=new Random();
- int r=rand.nextInt(6)+1;
- for(int i=0;i<r;i++)
- {
- for(int j=0;j<3;j++)
- {
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+i,pos.getZ()+j), Blocks.diamond_block.getDefaultState(),2);
- }
- }
- }
- public static void mountainOne(World worldIn,BlockPos pos)
- {
- Random rand=new Random();
- int r=rand.nextInt(6)+1;
- for(int i=0;i<r;i++)
- {
- for(int j=0;j<3;j++)
- {
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+i,pos.getZ()+j), Blocks.emerald_block.getDefaultState(),2);
- }
- }
- }
- /**
- *
- * Summons A Ghost
- * Pars- World,pos,loop(amount of Ghosts)
- */
- public static void summonGhost(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityGhost e = new EntityGhost(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- *
- * Summons Captain Sparklez army :D
- * Pars- World,pos,loop(size of army)
- */
- public static void summonCaptainSparklezWithCustomName(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityCaptainSparklez e = new EntityCaptainSparklez(worldIn);
- e.setCustomNameTag("CaptainSparklez Army");
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void foodKit(World worldIn,BlockPos pos){
- summonBlockAsDrop(pos, worldIn, Blocks.cake);
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.golden_apple,1,1), 10, 1, 30);
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.bread), 16, 1, 10);
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.apple), 5, 0, 0);
- summonItemAsDrop(pos, worldIn, new ItemStack(Items.golden_apple));
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.cooked_beef),34, 0, 0);
- }
- /**
- *
- * lets make a chat
- */
- public static void chat(World worldIn,BlockPos pos,String chat,EntityPlayer player){
- player.addChatMessage(new ChatComponentText(chat));
- }
- public static void materialKit(World worldIn,BlockPos pos)
- {
- Random rand=new Random();
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.diamond), rand.nextInt(50)+1, 1, rand.nextInt(5));
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.gold_ingot), rand.nextInt(50)+1, 1, rand.nextInt(15));
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.iron_ingot), rand.nextInt(30)+1, 1, rand.nextInt(10));
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.emerald), rand.nextInt(40)+1, 1, rand.nextInt(4));
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.coal), rand.nextInt(10)+1, 1, rand.nextInt(30));
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.chest_minecart), rand.nextInt(10)+1, 0, 0);
- summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.blaze_powder), rand.nextInt(64)+1, 1, rand.nextInt(15));
- }
- /**
- *
- * Summons A AntVenom
- * Pars- World,pos,loop(amount of Ant)
- */
- public static void summonAntVenom(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityAntVenom e = new EntityAntVenom(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- *
- * Summons A Dan
- * Pars- World,pos,loop(amount of Dan)
- */
- public static void summonDanTDM(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityDanTDM e = new EntityDanTDM(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void burgerStruct(World worldIn,BlockPos pos)
- {
- for(int i=0;i<3;i++)
- {
- for(int j=0;j<3;j++){
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY(),pos.getZ()+i), Blocks.iron_block.getDefaultState(), 2);
- }
- }
- for(int i=0;i<3;i++)
- {
- for(int j=0;j<3;j++){
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+1,pos.getZ()+i), Blocks.diamond_block.getDefaultState(), 2);
- }
- }
- for(int i=0;i<3;i++)
- {
- for(int j=0;j<3;j++){
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+2,pos.getZ()+i), Blocks.emerald_block.getDefaultState(), 2);
- }
- }
- }
- public static void burgerStructOne(World worldIn,BlockPos pos)
- {
- for(int i=0;i<3;i++)
- {
- for(int j=0;j<3;j++){
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY(),pos.getZ()+i), Blocks.glowstone.getDefaultState(), 2);
- }
- }
- for(int i=0;i<3;i++)
- {
- for(int j=0;j<3;j++){
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+1,pos.getZ()+i), Blocks.dragon_egg.getDefaultState(), 2);
- }
- }
- for(int i=0;i<3;i++)
- {
- for(int j=0;j<3;j++){
- worldIn.setBlockState(new BlockPos(pos.getX()+j,pos.getY()+2,pos.getZ()+i), Blocks.beacon.getDefaultState(), 2);
- }
- }
- }
- /**
- *
- * Summons A SP
- * Pars- World,pos,loop(amount of SP)
- */
- public static void summonSP(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntitySerialPlayer e = new EntitySerialPlayer(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void orcArmy(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit){
- Random rand=new Random();
- int r=loop;
- if(isRandom)
- {
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityZombie e = new EntityZombie(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- e.setCustomNameTag("Orc Army");
- e.setCurrentItemOrArmor(4, new ItemStack(ModItems.ytHelmet));
- switch(rand.nextInt(5))
- {
- case 1:{
- e.setCurrentItemOrArmor(0, new ItemStack(Items.diamond_sword));
- break;}
- case 2:{
- e.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
- break;
- }
- case 3:{
- e.setCurrentItemOrArmor(0, new ItemStack(Items.stone_axe));
- break;
- }
- case 0:{
- e.setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword));
- break;
- }
- case 4:{
- e.setCurrentItemOrArmor(0, new ItemStack(ModItems.devilSword));
- }
- }
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void lookUp(World w,BlockPos pos,EntityPlayer p)
- {
- double x=p.posX;
- double y=p.posY;
- double z=p.posZ;
- setOneBlock(w,new BlockPos(x,y+10,z), Blocks.anvil);
- }
- public static void summonBunny(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityRabbit e = new EntityRabbit(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- e.setRabbitType(99);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void giveBlocks(World worldIn,BlockPos pos,ItemStack block,int loop,EntityPlayer p){
- for(int i=0;i<loop;i++)
- {p.inventory.addItemStackToInventory(block);}
- }
- public static void tntFix(World worldIn,BlockPos pos,int amOfTnt)
- {
- for(int i=0;i<amOfTnt;i++){
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F),Minecraft.getMinecraft().thePlayer );
- entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
- worldIn.spawnEntityInWorld(entitytntprimed);
- }
- }
- public static void tntNearby(World worldIn,BlockPos pos,int amOfTnt)
- {
- Random rand=new Random();
- for(int i=0;i<amOfTnt;i++){
- 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 );
- entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
- worldIn.spawnEntityInWorld(entitytntprimed);
- }
- }
- public static void tntRain(World worldIn,BlockPos pos,int amOfTnt,int skip)
- {
- for(int i=0;i<amOfTnt;i++){
- 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 );
- entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
- worldIn.spawnEntityInWorld(entitytntprimed);
- }
- }
- public static void potionKit(World worldIn,BlockPos pos){
- Random rand=new Random();
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.ender_pearl), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.ender_eye), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.magma_cream), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.brewing_stand),1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.fermented_spider_eye), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.speckled_melon), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.gold_nugget), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.spider_eye), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.nether_wart), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.glass_bottle), rand.nextInt(50)+1, 0, 0);
- ExtraFunctions.summonItemStackWithLoop(worldIn, pos, new ItemStack(Items.blaze_rod), rand.nextInt(50)+1, 0, 0);
- }
- public static void musicKit(World worldIn,BlockPos pos)
- {
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Blocks.jukebox));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_11));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_13));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_blocks));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_cat));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_chirp));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_far));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_mall));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_mellohi));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_stal));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_strad));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_wait));
- ExtraFunctions.summonItemAsDrop(pos, worldIn, new ItemStack(Items.record_ward));
- }
- public static void towerStruct(World worldIn,BlockPos pos)
- {
- int flags=2;
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()), Blocks.redstone_block.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+1,pos.getZ()), Blocks.lapis_block.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+2,pos.getZ()), Blocks.coal_block.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+3,pos.getZ()), Blocks.gold_block.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+4,pos.getZ()), Blocks.iron_block.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+5,pos.getZ()), Blocks.emerald_block.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+6,pos.getZ()), Blocks.diamond_block.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+7,pos.getZ()), Blocks.obsidian.getDefaultState(), flags);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+8,pos.getZ()), Blocks.dragon_egg.getDefaultState(), flags);
- }
- /**
- *
- * Summons A ghast? idk either...
- * Pars- World,pos,loop(amount of Ghast)
- */
- public static void summonGhast(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityGhast e = new EntityGhast(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- *
- * Summons A wither boss...
- * Pars- World,pos,loop(amount of boss)
- */
- public static void summonWitherBoss(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityWither e = new EntityWither(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void randomSixtyFourTower(World worldIn,BlockPos pos){
- Random rand = new Random();
- for(int i=0;i<64;i++)
- {
- int r=rand.nextInt(8);
- if(r==0)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.iron_block.getDefaultState(), 2);}
- else if(r==1)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.diamond_block.getDefaultState(), 2);}
- else if(r==2)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.gold_block.getDefaultState(), 2);}
- else if(r==3)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.emerald_block.getDefaultState(), 2);}
- else if(r==4)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.beacon.getDefaultState(), 2);}
- else if(r==5)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.coal_block.getDefaultState(), 2);}
- else if(r==6)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.redstone_block.getDefaultState(), 2);}
- else if(r==7)
- {worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+i,pos.getZ()), Blocks.dragon_egg.getDefaultState(), 2);}
- }
- }
- /**
- *
- * Summons A jen
- * Pars- World,pos,loop(amount of jen)
- */
- public static void summonSuperGirly(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntitySuperGirlyGamer e = new EntitySuperGirlyGamer(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void trollDiamondTrapWithChanceOfNotTroll(World worldIn,BlockPos pos,boolean isTrap)
- {
- if(isTrap){
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-1,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-2,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-3,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-4,pos.getZ()), Blocks.flowing_lava.getDefaultState(),2);
- }
- else
- {
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-1,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-2,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-3,pos.getZ()), Blocks.diamond_ore.getDefaultState(),2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()-4,pos.getZ()), Blocks.flowing_water.getDefaultState(),2);
- }
- }
- /**
- *
- * Summons A cow
- * Pars- World,pos,loop(amount of cows)
- */
- public static void summonCowNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- Random rand=new Random();
- if(isRandom)
- {
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityCow e = new EntityCow(worldIn);
- e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
- e.setAlwaysRenderNameTag(true);
- e.setEquipmentDropChance(0, 100F);
- e.setCurrentItemOrArmor(0, new ItemStack(Items.golden_apple));
- e.setEquipmentDropChance(1, 100F);
- e.setCurrentItemOrArmor(1, new ItemStack(Items.gold_ingot));
- e.setCustomNameTag("I AM SPECIAL");
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void summonPigNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- Random rand=new Random();
- if(isRandom)
- {
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityPig e = new EntityPig(worldIn);
- e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
- e.setAlwaysRenderNameTag(true);
- e.setEquipmentDropChance(0, 100F);
- e.setCurrentItemOrArmor(0, new ItemStack(Items.golden_apple,rand.nextInt(5)+1,1));
- e.setEquipmentDropChance(1, 100F);
- e.setCurrentItemOrArmor(1, new ItemStack(Blocks.diamond_block));
- e.setCustomNameTag("I AM SPECIAL");
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void summonGolemNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- Random rand=new Random();
- if(isRandom)
- {
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityIronGolem e = new EntityIronGolem(worldIn);
- e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void summonCreepsNearby(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- Random rand=new Random();
- if(isRandom)
- {
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityCreeper e = new EntityCreeper(worldIn);
- e.setPosition(pos.getX()+rand.nextInt(30),pos.getY(), pos.getZ()+rand.nextInt(30));
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void summonSquidRain(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- Random rand=new Random();
- if(isRandom)
- {
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntitySquid e = new EntitySquid(worldIn);
- e.setPosition(pos.getX()+rand.nextInt(30),pos.getY()+20, pos.getZ()+rand.nextInt(30));
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- *
- * Summons A Isquid
- * Pars- World,pos,loop(amount of squid)
- */
- public static void summonISquid(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityISquid e = new EntityISquid(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- *
- * Summons A Sky
- * Pars- World,pos,loop(amount of Sky)
- */
- public static void summonSkyDoesMinecraft(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntitySkyDoesMinecraft e = new EntitySkyDoesMinecraft(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- /**
- *
- * Summons A Truemu
- * Pars- World,pos,loop(amount of truemu)
- */
- public static void summonTruemu(World worldIn,BlockPos pos,int loop,boolean isRandom,int upperlimit) {
- int r=loop;
- if(isRandom)
- {
- Random rand=new Random();
- r=rand.nextInt(upperlimit)+2;
- }
- for(int i=0;i<=r-1;i++){
- EntityTruemu e = new EntityTruemu(worldIn);
- e.setPosition(pos.getX(),pos.getY(), pos.getZ());
- e.setAlwaysRenderNameTag(true);
- worldIn.spawnEntityInWorld(e);
- }
- }
- public static void luckyBlockTower(World worldIn,BlockPos pos)
- {
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY(),pos.getZ()), ModBlocks.youtube.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+1,pos.getZ()), ModBlocks.youtubeLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+2,pos.getZ()), ModBlocks.antVenomLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+3,pos.getZ()), ModBlocks.captainSparkelzLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+4,pos.getZ()), ModBlocks.danTDMLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+5,pos.getZ()), ModBlocks.gamingWithJenLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+6,pos.getZ()), ModBlocks.iBallisticSquidLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+7,pos.getZ()), ModBlocks.popularMMOLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+8,pos.getZ()), ModBlocks.serialPlayerLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+9,pos.getZ()), ModBlocks.skyDoesMinecraftLuckyBlock.getDefaultState(), 2);
- worldIn.setBlockState(new BlockPos(pos.getX(),pos.getY()+10,pos.getZ()), ModBlocks.trueMuLuckyBlock.getDefaultState(), 2);
- }
- }//CLASS END HERE
Add Comment
Please, Sign In to add comment