• 0

    posted a message on Need Help With Making a RF Mod

    Hello I have been making a base mod and I would love to add rf power to it and power generation to it how would I do that is there any videos anywhere that would help me?

    Posted in: Modification Development
  • 0

    posted a message on How to spawn lightining bolt

    I still don't understand?!


    public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    	    {
    	        pos = pos.offset(facing);
    
    	        if (!playerIn.canPlayerEdit(pos, facing, stack))
    	        {
    	            return EnumActionResult.FAIL;
    	        }
    	        else
    	        {
    	            if (worldIn.isAirBlock(pos))
    	            {
    	                worldIn.playSound(playerIn, pos, SoundEvents.item_flintandsteel_use, SoundCategory.BLOCKS, 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
    	                worldIn.setBlockState(pos, Blocks.end_portal.getDefaultState(), 11);
    	                worldIn.spawnEntityInWorld(EntityLightningBolt);
    	            }
    
    	            stack.damageItem(500, playerIn);
    	            return EnumActionResult.SUCCESS;
    	        }
    	    }
    Posted in: Modification Development
  • 0

    posted a message on How to spawn lightining bolt

    How do I spawn a lightning bolt with the following code I have everything set up it works as is but I want it to spawn lightning!


    	 public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    	    {
    	        pos = pos.offset(facing);
    
    	        if (!playerIn.canPlayerEdit(pos, facing, stack))
    	        {
    	            return EnumActionResult.FAIL;
    	        }
    	        else
    	        {
    	            if (worldIn.isAirBlock(pos))
    	            {
    	                worldIn.playSound(playerIn, pos, SoundEvents.item_flintandsteel_use, SoundCategory.BLOCKS, 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
    	                worldIn.setBlockState(pos, Blocks.fire.getDefaultState(), 11);
    	                worldIn.getLastLightningBolt();
    	            }
    
    	            stack.damageItem(1, playerIn);
    	            return EnumActionResult.SUCCESS;
    	        }
    	    }
    Posted in: Modification Development
  • 0

    posted a message on Rubythings Mod

    Beta Finally release

    Posted in: Minecraft Mods
  • 0

    posted a message on adding a guide book to minecraft

    how would I implement the api

    Posted in: Modification Development
  • 0

    posted a message on adding a guide book to minecraft

    in my mod there are a lot of things I would like to explain in a "book" how would I make it/add it

    Posted in: Modification Development
  • 0

    posted a message on how would i randomly spawn a crater in minecraft like a structure?
    package net.minecraft.world.gen;
    
    import com.google.common.base.Objects;
    import java.util.Random;
    import net.minecraft.block.BlockSand;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.init.Blocks;
    import net.minecraft.util.math.BlockPos;
    import net.minecraft.util.math.MathHelper;
    import net.minecraft.world.World;
    import net.minecraft.world.chunk.ChunkPrimer;
    
    public class MapGenCaves extends MapGenBase
    {
        protected static final IBlockState BLK_LAVA = Blocks.lava.getDefaultState();
        protected static final IBlockState BLK_AIR = Blocks.air.getDefaultState();
        protected static final IBlockState BLK_SANDSTONE = Blocks.sandstone.getDefaultState();
        protected static final IBlockState BLK_RED_SANDSTONE = Blocks.red_sandstone.getDefaultState();
    
        protected void func_180703_a(long p_180703_1_, int p_180703_3_, int p_180703_4_, ChunkPrimer p_180703_5_, double p_180703_6_, double p_180703_8_, double p_180703_10_)
        {
            this.func_180702_a(p_180703_1_, p_180703_3_, p_180703_4_, p_180703_5_, p_180703_6_, p_180703_8_, p_180703_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
        }
    
        protected void func_180702_a(long p_180702_1_, int p_180702_3_, int p_180702_4_, ChunkPrimer p_180702_5_, double p_180702_6_, double p_180702_8_, double p_180702_10_, float p_180702_12_, float p_180702_13_, float p_180702_14_, int p_180702_15_, int p_180702_16_, double p_180702_17_)
        {
            double d0 = (double)(p_180702_3_ * 16 + 8);
            double d1 = (double)(p_180702_4_ * 16 + 8);
            float f = 0.0F;
            float f1 = 0.0F;
            Random random = new Random(p_180702_1_);
    
            if (p_180702_16_ <= 0)
            {
                int i = this.range * 16 - 16;
                p_180702_16_ = i - random.nextInt(i / 4);
            }
    
            boolean flag2 = false;
    
            if (p_180702_15_ == -1)
            {
                p_180702_15_ = p_180702_16_ / 2;
                flag2 = true;
            }
    
            int j = random.nextInt(p_180702_16_ / 2) + p_180702_16_ / 4;
    
            for (boolean flag = random.nextInt(6) == 0; p_180702_15_ < p_180702_16_; ++p_180702_15_)
            {
                double d2 = 1.5D + (double)(MathHelper.sin((float)p_180702_15_ * (float)Math.PI / (float)p_180702_16_) * p_180702_12_);
                double d3 = d2 * p_180702_17_;
                float f2 = MathHelper.cos(p_180702_14_);
                float f3 = MathHelper.sin(p_180702_14_);
                p_180702_6_ += (double)(MathHelper.cos(p_180702_13_) * f2);
                p_180702_8_ += (double)f3;
                p_180702_10_ += (double)(MathHelper.sin(p_180702_13_) * f2);
    
                if (flag)
                {
                    p_180702_14_ = p_180702_14_ * 0.92F;
                }
                else
                {
                    p_180702_14_ = p_180702_14_ * 0.7F;
                }
    
                p_180702_14_ = p_180702_14_ + f1 * 0.1F;
                p_180702_13_ += f * 0.1F;
                f1 = f1 * 0.9F;
                f = f * 0.75F;
                f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
                f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F;
    
                if (!flag2 && p_180702_15_ == j && p_180702_12_ > 1.0F && p_180702_16_ > 0)
                {
                    this.func_180702_a(random.nextLong(), p_180702_3_, p_180702_4_, p_180702_5_, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ - ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D);
                    this.func_180702_a(random.nextLong(), p_180702_3_, p_180702_4_, p_180702_5_, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ + ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D);
                    return;
                }
    
                if (flag2 || random.nextInt(4) != 0)
                {
                    double d4 = p_180702_6_ - d0;
                    double d5 = p_180702_10_ - d1;
                    double d6 = (double)(p_180702_16_ - p_180702_15_);
                    double d7 = (double)(p_180702_12_ + 2.0F + 16.0F);
    
                    if (d4 * d4 + d5 * d5 - d6 * d6 > d7 * d7)
                    {
                        return;
                    }
    
                    if (p_180702_6_ >= d0 - 16.0D - d2 * 2.0D && p_180702_10_ >= d1 - 16.0D - d2 * 2.0D && p_180702_6_ <= d0 + 16.0D + d2 * 2.0D && p_180702_10_ <= d1 + 16.0D + d2 * 2.0D)
                    {
                        int k2 = MathHelper.floor_double(p_180702_6_ - d2) - p_180702_3_ * 16 - 1;
                        int k = MathHelper.floor_double(p_180702_6_ + d2) - p_180702_3_ * 16 + 1;
                        int l2 = MathHelper.floor_double(p_180702_8_ - d3) - 1;
                        int l = MathHelper.floor_double(p_180702_8_ + d3) + 1;
                        int i3 = MathHelper.floor_double(p_180702_10_ - d2) - p_180702_4_ * 16 - 1;
                        int i1 = MathHelper.floor_double(p_180702_10_ + d2) - p_180702_4_ * 16 + 1;
    
                        if (k2 < 0)
                        {
                            k2 = 0;
                        }
    
                        if (k > 16)
                        {
                            k = 16;
                        }
    
                        if (l2 < 1)
                        {
                            l2 = 1;
                        }
    
                        if (l > 248)
                        {
                            l = 248;
                        }
    
                        if (i3 < 0)
                        {
                            i3 = 0;
                        }
    
                        if (i1 > 16)
                        {
                            i1 = 16;
                        }
    
                        boolean flag3 = false;
    
                        for (int j1 = k2; !flag3 && j1 < k; ++j1)
                        {
                            for (int k1 = i3; !flag3 && k1 < i1; ++k1)
                            {
                                for (int l1 = l + 1; !flag3 && l1 >= l2 - 1; --l1)
                                {
                                    if (l1 >= 0 && l1 < 256)
                                    {
                                        if (isOceanBlock(p_180702_5_, j1, l1, k1, p_180702_3_, p_180702_4_))
                                        {
                                            flag3 = true;
                                        }
    
                                        if (l1 != l2 - 1 && j1 != k2 && j1 != k - 1 && k1 != i3 && k1 != i1 - 1)
                                        {
                                            l1 = l2;
                                        }
                                    }
                                }
                            }
                        }
    
                        if (!flag3)
                        {
                            BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
    
                            for (int j3 = k2; j3 < k; ++j3)
                            {
                                double d10 = ((double)(j3 + p_180702_3_ * 16) + 0.5D - p_180702_6_) / d2;
    
                                for (int i2 = i3; i2 < i1; ++i2)
                                {
                                    double d8 = ((double)(i2 + p_180702_4_ * 16) + 0.5D - p_180702_10_) / d2;
                                    boolean flag1 = false;
    
                                    if (d10 * d10 + d8 * d8 < 1.0D)
                                    {
                                        for (int j2 = l; j2 > l2; --j2)
                                        {
                                            double d9 = ((double)(j2 - 1) + 0.5D - p_180702_8_) / d3;
    
                                            if (d9 > -0.7D && d10 * d10 + d9 * d9 + d8 * d8 < 1.0D)
                                            {
                                                IBlockState iblockstate1 = p_180702_5_.getBlockState(j3, j2, i2);
                                                IBlockState iblockstate2 = (IBlockState)Objects.firstNonNull(p_180702_5_.getBlockState(j3, j2 + 1, i2), BLK_AIR);
    
                                                if (isTopBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_))
                                                {
                                                    flag1 = true;
                                                }
    
                                                digBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_, flag1, iblockstate1, iblockstate2);
                                            }
                                        }
                                    }
                                }
                            }
    
                            if (flag2)
                            {
                                break;
                            }
                        }
                    }
                }
            }
        }
    
        protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
        {
            return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getMaterial() != Material.water))))))));
        }
    
        /**
         * Recursively called by generate()
         */
        protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
        {
            int i = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(15) + 1) + 1);
    
            if (this.rand.nextInt(7) != 0)
            {
                i = 0;
            }
    
            for (int j = 0; j < i; ++j)
            {
                double d0 = (double)(chunkX * 16 + this.rand.nextInt(16));
                double d1 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8);
                double d2 = (double)(chunkZ * 16 + this.rand.nextInt(16));
                int k = 1;
    
                if (this.rand.nextInt(4) == 0)
                {
                    this.func_180703_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2);
                    k += this.rand.nextInt(4);
                }
    
                for (int l = 0; l < k; ++l)
                {
                    float f = this.rand.nextFloat() * ((float)Math.PI * 2F);
                    float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
                    float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();
    
                    if (this.rand.nextInt(10) == 0)
                    {
                        f2 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F;
                    }
    
                    this.func_180702_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2, f, f1, 0, 0, 1.0D);
                }
            }
        }
    
        protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ)
        {
            net.minecraft.block.Block block = data.getBlockState(x, y, z).getBlock();
            return block== Blocks.flowing_water || block == Blocks.water;
        }
    
        //Exception biomes to make sure we generate like vanilla
        private boolean isExceptionBiome(net.minecraft.world.biome.BiomeGenBase biome)
        {
            if (biome == net.minecraft.init.Biomes.beach) return true;
            if (biome == net.minecraft.init.Biomes.desert) return true;
            return false;
        }
    
        //Determine if the block at the specified location is the top block for the biome, we take into account
        //Vanilla bugs to make sure that we generate the map the same way vanilla does.
        private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ)
        {
            net.minecraft.world.biome.BiomeGenBase biome = worldObj.getBiomeGenForCoords(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
            IBlockState state = data.getBlockState(x, y, z);
            return (isExceptionBiome(biome) ? state.getBlock() == Blocks.grass : state.getBlock() == biome.topBlock);
        }
    
        /**
         * Digs out the current block, default implementation removes stone, filler, and top block
         * Sets the block to lava if y is less then 10, and air other wise.
         * If setting to air, it also checks to see if we've broken the surface and if so
         * tries to make the floor the biome's top block
         *
         * @param data Block data array
         * @param index Pre-calculated index into block data
         * @param x local X position
         * @param y local Y position
         * @param z local Z position
         * @param chunkX Chunk X position
         * @param chunkZ Chunk Y position
         * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface.
         */
        protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop, IBlockState state, IBlockState up)
        {
            net.minecraft.world.biome.BiomeGenBase biome = worldObj.getBiomeGenForCoords(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
            IBlockState top = biome.topBlock;
            IBlockState filler = biome.fillerBlock;
    
            if (this.func_175793_a(state, up) || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock())
            {
                if (y - 1 < 10)
                {
                    data.setBlockState(x, y, z, BLK_LAVA);
                }
                else
                {
                    data.setBlockState(x, y, z, BLK_AIR);
    
                    if (up.getBlock() == Blocks.sand)
                    {
                        data.setBlockState(x, y + 1, z, up.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? BLK_RED_SANDSTONE : BLK_SANDSTONE);
                    }
    
                    if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock())
                    {
                        data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState());
                    }
                }
            }
        }
    }



    I don't think I can figure this out

    Posted in: Modification Development
  • 0

    posted a message on how would i randomly spawn a crater in minecraft like a structure?

    how would i randomly spawn a crater in Minecraft like a structure? could you be guide be step by step

    Posted in: Modification Development
  • 0

    posted a message on how would i edit/add loot tables

    how would i edit/add loot tables because my mod needs it and could you show an example of what I would need to do step by step please the Minecraft source isn't helpful

    Posted in: Modification Development
  • 0

    posted a message on how would i add biomes

    how would I generate a biome in Minecraft like one of my choice aka custom

    Posted in: Modification Development
  • 0

    posted a message on Rubythings Mod

    New version released you should check out

    Posted in: Minecraft Mods
  • 0

    posted a message on Rubythings Mod

    There you go

    Posted in: Minecraft Mods
  • 0

    posted a message on Rubythings Mod

    yes no problem one minute

    Posted in: Minecraft Mods
  • 0

    posted a message on How would i export my eclipse project for a minecraft mod for INTELLIJ IDEA

    title says it all How would i export my eclipse project for a Minecraft mod for INTELLIJ IDEA

    Posted in: Modification Development
  • To post a comment, please or register a new account.