• 1

    posted a message on Help Spawning Custom Structure

    Hello, I have been working on a mod that will add new generated structures. Except I can not for the life of me figure out how to/why my code isn't working. Could anyone please help me. All help is appreciated thanks!

    Here is the code for generating the house.


    package world;

    import java.util.Arrays; import java.util.List; import java.util.Random;

    import net.minecraft.block.state.IBlockState; import net.minecraft.init.Biomes; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.BiomeDesert; import net.minecraft.world.biome.BiomePlains; import net.minecraft.world.biome.BiomeProvider; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator;

    import structure.gen.House; import structure.gen.StructStructureName;

    public class WorldGen implements IWorldGenerator {

    House house = new House();

    //@formatter:on

    @Override

    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {

    switch(world.provider.getDimension()) {

    case 0: //Overworld

    this.runHouseGenerator(world, random, chunkX, chunkZ);

    break;

    case -1: //Nether

    break;

    case 1: //End

    break;

    }

    }

    public void runHouseGenerator(World world, Random random, int chunkX, int chunkZ) {

    int x = chunkX * 16 + random.nextInt(16);

    int z = chunkZ * 16 + random.nextInt(16);

    int xy = x >> 4;

    int zy = z >> 4;

    int height = world.getChunkFromChunkCoords(xy, zy).getHeight(new BlockPos(x & 15, 0, z & 15));

    int y = height - 1;

    if(world.getBiome(new BlockPos(x,y,z)).getBiomeClass().equals(BiomePlains.class) || world.getBiome(new BlockPos(x,y,z)).getBiomeClass().equals(BiomeDesert.class)) {

    if((random.nextInt(1000) + 1) <= 10) {

    boolean place = true;

    for(int j = 0; j < 6; j++) {

    for(int k = 0; k < 9; k++) {

    for(int i = 0; i < 11; i++) {

    if(world.getBlockState(new BlockPos(i + x, j + y+ 1, k + z)).getBlock() != Blocks.AIR) {

    place = false;

    }

    }

    }

    }

    if(place) {

    house.generate(world, random, new BlockPos(x,y,z));

    }

    }

    }

    }

    }


    Here is the code for the house I want to generate.


    package structure.gen;

    import java.util.Random;

    import net.minecraft.init.Blocks; import net.minecraft.item.ItemDoor; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator;

    public class House extends WorldGenerator{

    @Override

    public boolean generate(World worldIn, Random rand, BlockPos position) {

    int x = position.getX();

    int y = position.getY();

    int z = position.getZ();

    //Front Porch

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x,y+1,z+3), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x,y+1,z+4), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x,y+1,z+5), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+2,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+3,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+4,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+2,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x,y+1,z+5), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+2,z+6), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+3,z+6), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+4,z+6), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+2,z+6), Blocks.OAK_FENCE.getDefaultState());

    //Walls

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+7), Blocks.LOG.getStateFromMeta(0));

    ItemDoor.placeDoor(worldIn, new BlockPos(x+3,y+2,z+4), EnumFacing.EAST, Blocks.OAK_DOOR, false);

    worldIn.setBlockState(new BlockPos(x+2,y+3,z+3), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+2,y+3,z+5), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+3,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+3,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+3,z+1), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+3,z+1), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+3,z+1), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+3,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+3,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+3,z+7), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+3,z+7), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+3,z+7), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+3), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+4), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+5), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+7), Blocks.LOG.getStateFromMeta(0));

    //Floor

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    //Inside

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+2), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+6), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+2), Blocks.TORCH.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+6), Blocks.TORCH.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+6), Blocks.FURNACE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+6), Blocks.CRAFTING_TABLE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+2), Blocks.BED.getStateFromMeta(11));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+2), Blocks.BED.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+2), Blocks.CHEST.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+3), Blocks.CHEST.getDefaultState());

    //Roof

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+10,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+1), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+2), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+3), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+4), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+5), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+6), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+7), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    return true;

    }

    }

    Posted in: Modification Development
  • 0

    posted a message on Help spawning custom structure

    Hello, I have been working on a mod that will add new generated structures. Except I can not for the life of me figure out how to/why my code isn't working. Could anyone please help me. All help is appreciated thanks!


    Here is the code for generating the house.


    package world;

    import java.util.Arrays; import java.util.List; import java.util.Random;

    import net.minecraft.block.state.IBlockState; import net.minecraft.init.Biomes; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.BiomeDesert; import net.minecraft.world.biome.BiomePlains; import net.minecraft.world.biome.BiomeProvider; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator;

    import structure.gen.House; import structure.gen.StructStructureName;

    public class WorldGen implements IWorldGenerator {

    House house = new House();

    //@formatter:on

    @Override

    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {

    switch(world.provider.getDimension()) {

    case 0: //Overworld

    this.runHouseGenerator(world, random, chunkX, chunkZ);

    break;

    case -1: //Nether

    break;

    case 1: //End

    break;

    }

    }

    public void runHouseGenerator(World world, Random random, int chunkX, int chunkZ) {

    int x = chunkX * 16 + random.nextInt(16);

    int z = chunkZ * 16 + random.nextInt(16);

    int xy = x >> 4;

    int zy = z >> 4;

    int height = world.getChunkFromChunkCoords(xy, zy).getHeight(new BlockPos(x & 15, 0, z & 15));

    int y = height - 1;

    if(world.getBiome(new BlockPos(x,y,z)).getBiomeClass().equals(BiomePlains.class) || world.getBiome(new BlockPos(x,y,z)).getBiomeClass().equals(BiomeDesert.class)) {

    if((random.nextInt(1000) + 1) <= 10) {

    boolean place = true;

    for(int j = 0; j < 6; j++) {

    for(int k = 0; k < 9; k++) {

    for(int i = 0; i < 11; i++) {

    if(world.getBlockState(new BlockPos(i + x, j + y+ 1, k + z)).getBlock() != Blocks.AIR) {

    place = false;

    }

    }

    }

    }

    if(place) {

    house.generate(world, random, new BlockPos(x,y,z));

    }

    }

    }

    }

    }


    Here is the code for the house I want to generate.


    package structure.gen;

    import java.util.Random;

    import net.minecraft.init.Blocks;
    import net.minecraft.item.ItemDoor;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.util.math.BlockPos;
    import net.minecraft.world.World;
    import net.minecraft.world.gen.feature.WorldGenerator;

    public class House extends WorldGenerator{


    @Override

    public boolean generate(World worldIn, Random rand, BlockPos position) {

    int x = position.getX();

    int y = position.getY();

    int z = position.getZ();

    //Front Porch

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+2,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x,y+1,z+3), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x,y+1,z+4), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x,y+1,z+5), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+2,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+3,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+4,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+2,z+2), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x,y+1,z+5), Blocks.OAK_STAIRS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+1,y+2,z+6), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+3,z+6), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+4,z+6), Blocks.OAK_FENCE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+2,z+6), Blocks.OAK_FENCE.getDefaultState());

    //Walls

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+1,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+2,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+3,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+7), Blocks.LOG.getStateFromMeta(0));

    ItemDoor.placeDoor(worldIn, new BlockPos(x+3,y+2,z+4), EnumFacing.EAST, Blocks.OAK_DOOR, false);

    worldIn.setBlockState(new BlockPos(x+2,y+3,z+3), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+2,y+3,z+5), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+3,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+3,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+1), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+3,z+1), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+3,z+1), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+3,z+1), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+3,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+3,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+7), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+3,z+7), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+3,z+7), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+3,z+7), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+1), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+3), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+4), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+5), Blocks.GLASS.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+1,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+2,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+3,z+7), Blocks.LOG.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+7), Blocks.LOG.getStateFromMeta(0));

    //Floor

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+4,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+5,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+6,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+7,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+2), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+3), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+4), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+5), Blocks.PLANKS.getStateFromMeta(0));

    worldIn.setBlockState(new BlockPos(x+8,y+1,z+6), Blocks.PLANKS.getStateFromMeta(0));

    //Inside

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+2), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+6), Blocks.TORCH.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+2), Blocks.TORCH.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+6), Blocks.TORCH.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+6), Blocks.FURNACE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+6), Blocks.CRAFTING_TABLE.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+2,z+2), Blocks.BED.getStateFromMeta(11));

    worldIn.setBlockState(new BlockPos(x+7,y+2,z+2), Blocks.BED.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+2), Blocks.CHEST.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+2,z+3), Blocks.CHEST.getDefaultState());

    //Roof

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+1,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+2,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+3,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+4,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+5,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+6,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+7,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+8,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+1), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+2), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+3), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+4), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+5), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+6), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+9,y+5,z+7), Blocks.WOODEN_SLAB.getDefaultState());

    worldIn.setBlockState(new BlockPos(x+10,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+1), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+2), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+3), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+4), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+5), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+6), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+7), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+10,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(1));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z), Blocks.OAK_STAIRS.getStateFromMeta(2));

    worldIn.setBlockState(new BlockPos(x+3,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+4,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+5,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+6,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+7,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+8,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    worldIn.setBlockState(new BlockPos(x+9,y+4,z+8), Blocks.OAK_STAIRS.getStateFromMeta(3));

    return true;

    }

    }

    Posted in: WIP Mods
  • 0

    posted a message on Help Animationg Custom Mob

    Hello, I have made a deer. I gave it antler and a nose and I have the head turn. The problem is I need the antlers and Nose to turn with the head. I heard there is a way to do it with the addChild(); method but haven't been able to get it to work. If someone could point me in the right direction I would greatly appreciate it. Here is the code for the model:

    package deermob;
    
    
    
    import net.minecraft.client.model.ModelBase;
    import net.minecraft.client.model.ModelRenderer;
    import net.minecraft.client.renderer.GlStateManager;
    import net.minecraft.entity.Entity;
    import net.minecraft.util.math.MathHelper;
    
    public class Deer extends ModelBase
    {
      //fields
        ModelRenderer Leg1;
        ModelRenderer Leg2;
        ModelRenderer Leg3;
        ModelRenderer Leg4;
        ModelRenderer Body;
        ModelRenderer Neck;
        ModelRenderer Head;
        ModelRenderer Nose;
        ModelRenderer Antler1;
        ModelRenderer Antler13;
        ModelRenderer Antler24;
        ModelRenderer Antler14;
        ModelRenderer Antler15;
        ModelRenderer Antler16;
        ModelRenderer Antler_25;
        ModelRenderer Antler19;
        ModelRenderer Antler20;
        ModelRenderer Antler22;
        ModelRenderer Antler23;
        ModelRenderer Antler17;
        ModelRenderer Antler18;
        ModelRenderer Antler21;
        ModelRenderer Antler2;
        ModelRenderer Antler3;
        ModelRenderer Antler4;
        ModelRenderer Antler5;
        ModelRenderer Antler6;
        ModelRenderer Antler7;
        ModelRenderer Antler8;
        ModelRenderer Antler9;
        ModelRenderer Antler12;
        ModelRenderer Antler10;
        ModelRenderer Antler11;
        ModelRenderer Tail;
      
      public Deer()
      {
        textureWidth = 128;
        textureHeight = 64;
        
          Leg1 = new ModelRenderer(this, 9, 50);
          Leg1.addBox(0F, 0F, 0F, 2, 12, 2);
          Leg1.setRotationPoint(2F, 12F, -8F);
          Leg1.setTextureSize(128, 64);
          Leg1.mirror = true;
          setRotation(Leg1, 0F, 0F, 0F);
          Leg2 = new ModelRenderer(this, 0, 50);
          Leg2.addBox(0F, 0F, 0F, 2, 12, 2);
          Leg2.setRotationPoint(-5F, 12F, -8F);
          Leg2.setTextureSize(128, 64);
          Leg2.mirror = true;
          setRotation(Leg2, 0F, 0F, 0F);
          Leg3 = new ModelRenderer(this, 0, 35);
          Leg3.addBox(0F, 0F, 0F, 2, 12, 2);
          Leg3.setRotationPoint(-5F, 12F, 6F);
          Leg3.setTextureSize(128, 64);
          Leg3.mirror = true;
          setRotation(Leg3, 0F, 0F, 0F);
          Leg4 = new ModelRenderer(this, 9, 35);
          Leg4.addBox(0F, 0F, 0F, 2, 12, 2);
          Leg4.setRotationPoint(2F, 12F, 6F);
          Leg4.setTextureSize(128, 64);
          Leg4.mirror = true;
          setRotation(Leg4, 0F, 0F, 0F);
          Body = new ModelRenderer(this, 18, 42);
          Body.addBox(0F, 0F, 0F, 9, 6, 16);
          Body.setRotationPoint(-5F, 7F, -8F);
          Body.setTextureSize(128, 64);
          Body.mirror = true;
          setRotation(Body, 0F, 0F, 0F);
          Neck = new ModelRenderer(this, 18, 33);
          Neck.addBox(0F, 0F, 0F, 3, 5, 3);
          Neck.setRotationPoint(-2F, 5F, -11F);
          Neck.setTextureSize(128, 64);
          Neck.mirror = true;
          setRotation(Neck, 0.6632251F, 0F, 0F);
          Head = new ModelRenderer(this, 18, 22);
          Head.addBox(-3F, -4F, -3F, 5, 5, 5);
          Head.setRotationPoint(0F, 4F, -9F);
          Head.setTextureSize(128, 64);
          Head.mirror = true;
          setRotation(Head, 0F, 0F, 0F);
          Nose = new ModelRenderer(this, 18, 16);
          Nose.addBox(-2F, -1F, -2F, 3, 2, 3);
          Nose.setRotationPoint(0F, 4F, -12F);
          Nose.setTextureSize(128, 64);
          Nose.mirror = true;
          setRotation(Nose, 0F, 0F, 0F);
          Antler1 = new ModelRenderer(this, 6, 0);
          Antler1.addBox(0F, 0F, 0F, 2, 2, 2);
          Antler1.setRotationPoint(1F, -2F, -9F);
          Antler1.setTextureSize(128, 64);
          Antler1.mirror = true;
          setRotation(Antler1, 0F, 0F, 0F);
          Antler13 = new ModelRenderer(this, 14, 0);
          Antler13.addBox(0F, 0F, 0F, 2, 2, 2);
          Antler13.setRotationPoint(-4F, -2F, -9F);
          Antler13.setTextureSize(128, 64);
          Antler13.mirror = true;
          setRotation(Antler13, 0F, 0F, 0F);
          Antler24 = new ModelRenderer(this, 0, 0);
          Antler24.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler24.setRotationPoint(-5F, -2F, -8F);
          Antler24.setTextureSize(128, 64);
          Antler24.mirror = true;
          setRotation(Antler24, 0F, 0F, 0F);
          Antler14 = new ModelRenderer(this, 22, 0);
          Antler14.addBox(0F, 0F, 0F, 1, 2, 1);
          Antler14.setRotationPoint(-5F, -4F, -7F);
          Antler14.setTextureSize(128, 64);
          Antler14.mirror = true;
          setRotation(Antler14, 0F, 0F, 0F);
          Antler15 = new ModelRenderer(this, 26, 0);
          Antler15.addBox(0F, 0F, 0F, 1, 1, 1);
          Antler15.setRotationPoint(-6F, -4F, -7F);
          Antler15.setTextureSize(128, 64);
          Antler15.mirror = true;
          setRotation(Antler15, 0F, 0F, 0F);
          Antler16 = new ModelRenderer(this, 86, 0);
          Antler16.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler16.setRotationPoint(-7F, -5F, -8F);
          Antler16.setTextureSize(128, 64);
          Antler16.mirror = true;
          setRotation(Antler16, 0F, 0F, 0F);
          Antler_25 = new ModelRenderer(this, 92, 0);
          Antler_25.addBox(0F, 0F, 0F, 1, 1, 1);
          Antler_25.setRotationPoint(-7F, -6F, -9F);
          Antler_25.setTextureSize(128, 64);
          Antler_25.mirror = true;
          setRotation(Antler_25, 0F, 0F, 0F);
          Antler19 = new ModelRenderer(this, 96, 0);
          Antler19.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler19.setRotationPoint(-7F, -6F, -10F);
          Antler19.setTextureSize(128, 64);
          Antler19.mirror = true;
          setRotation(Antler19, 0F, 0F, 0F);
          Antler20 = new ModelRenderer(this, 38, 0);
          Antler20.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler20.setRotationPoint(-6F, -7F, -12F);
          Antler20.setTextureSize(128, 64);
          Antler20.mirror = true;
          setRotation(Antler20, 0F, 0F, 0F);
          Antler22 = new ModelRenderer(this, 44, 0);
          Antler22.addBox(0F, 0F, 0F, 1, 1, 1);
          Antler22.setRotationPoint(-6F, -8F, -13F);
          Antler22.setTextureSize(128, 64);
          Antler22.mirror = true;
          setRotation(Antler22, 0F, 0F, 0F);
          Antler23 = new ModelRenderer(this, 34, 0);
          Antler23.addBox(0F, 0F, 0F, 1, 2, 1);
          Antler23.setRotationPoint(-5F, -9F, -13F);
          Antler23.setTextureSize(128, 64);
          Antler23.mirror = true;
          setRotation(Antler23, 0F, 0F, 0F);
          Antler17 = new ModelRenderer(this, 48, 0);
          Antler17.addBox(0F, 0F, 0F, 1, 4, 1);
          Antler17.setRotationPoint(-7F, -9F, -7F);
          Antler17.setTextureSize(128, 64);
          Antler17.mirror = true;
          setRotation(Antler17, 0F, 0F, 0F);
          Antler18 = new ModelRenderer(this, 52, 0);
          Antler18.addBox(0F, 0F, 0F, 1, 4, 1);
          Antler18.setRotationPoint(-7F, -10F, -9F);
          Antler18.setTextureSize(128, 64);
          Antler18.mirror = true;
          setRotation(Antler18, 0F, 0F, 0F);
          Antler21 = new ModelRenderer(this, 56, 0);
          Antler21.addBox(0F, 0F, 0F, 1, 3, 1);
          Antler21.setRotationPoint(-6F, -10F, -11F);
          Antler21.setTextureSize(128, 64);
          Antler21.mirror = true;
          setRotation(Antler21, 0F, 0F, 0F);
          Antler2 = new ModelRenderer(this, 60, 0);
          Antler2.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler2.setRotationPoint(3F, -2F, -8F);
          Antler2.setTextureSize(128, 64);
          Antler2.mirror = true;
          setRotation(Antler2, 0F, 0F, 0F);
          Antler3 = new ModelRenderer(this, 66, 0);
          Antler3.addBox(0F, 0F, 0F, 1, 2, 1);
          Antler3.setRotationPoint(3F, -4F, -7F);
          Antler3.setTextureSize(128, 64);
          Antler3.mirror = true;
          setRotation(Antler3, 0F, 0F, 0F);
          Antler4 = new ModelRenderer(this, 30, 0);
          Antler4.addBox(0F, 0F, 0F, 1, 1, 1);
          Antler4.setRotationPoint(4F, -4F, -7F);
          Antler4.setTextureSize(128, 64);
          Antler4.mirror = true;
          setRotation(Antler4, 0F, 0F, 0F);
          Antler5 = new ModelRenderer(this, 70, 0);
          Antler5.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler5.setRotationPoint(5F, -5F, -8F);
          Antler5.setTextureSize(128, 64);
          Antler5.mirror = true;
          setRotation(Antler5, 0F, 0F, 0F);
          Antler6 = new ModelRenderer(this, 76, 0);
          Antler6.addBox(0F, 0F, 0F, 1, 4, 1);
          Antler6.setRotationPoint(5F, -9F, -7F);
          Antler6.setTextureSize(128, 64);
          Antler6.mirror = true;
          setRotation(Antler6, 0F, 0F, 0F);
          Antler7 = new ModelRenderer(this, 80, 0);
          Antler7.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler7.setRotationPoint(5F, -6F, -10F);
          Antler7.setTextureSize(128, 64);
          Antler7.mirror = true;
          setRotation(Antler7, 0F, 0F, 0F);
          Antler8 = new ModelRenderer(this, 102, 0);
          Antler8.addBox(0F, 0F, 0F, 1, 4, 1);
          Antler8.setRotationPoint(5F, -10F, -9F);
          Antler8.setTextureSize(128, 64);
          Antler8.mirror = true;
          setRotation(Antler8, 0F, 0F, 0F);
          Antler9 = new ModelRenderer(this, 106, 0);
          Antler9.addBox(0F, 0F, 0F, 1, 1, 2);
          Antler9.setRotationPoint(4F, -7F, -12F);
          Antler9.setTextureSize(128, 64);
          Antler9.mirror = true;
          setRotation(Antler9, 0F, 0F, 0F);
          Antler12 = new ModelRenderer(this, 112, 0);
          Antler12.addBox(0F, 0F, 0F, 1, 2, 1);
          Antler12.setRotationPoint(3F, -9F, -13F);
          Antler12.setTextureSize(128, 64);
          Antler12.mirror = true;
          setRotation(Antler12, 0F, 0F, 0F);
          Antler10 = new ModelRenderer(this, 116, 0);
          Antler10.addBox(0F, 0F, 0F, 1, 3, 1);
          Antler10.setRotationPoint(4F, -10F, -11F);
          Antler10.setTextureSize(128, 64);
          Antler10.mirror = true;
          setRotation(Antler10, 0F, 0F, 0F);
          Antler11 = new ModelRenderer(this, 120, 0);
          Antler11.addBox(0F, 0F, 0F, 1, 1, 1);
          Antler11.setRotationPoint(4F, -8F, -13F);
          Antler11.setTextureSize(128, 64);
          Antler11.mirror = true;
          setRotation(Antler11, 0F, 0F, 0F);
          Tail = new ModelRenderer(this, 0, 30);
          Tail.addBox(0F, 0F, 0F, 1, 1, 3);
          Tail.setRotationPoint(-1F, 8F, 8F);
          Tail.setTextureSize(128, 64);
          Tail.mirror = true;
          setRotation(Tail, -0.5235988F, 0F, 0F);
         
          
      }
      
      public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
      {
        super.render(entity, f, f1, f2, f3, f4, f5);
        setRotationAngles(f, f1, f2, f3, f4, f5, entity);
        
        
        Leg1.render(f5);
        Leg2.render(f5);
        Leg3.render(f5);
        Leg4.render(f5);
        Body.render(f5);
        Neck.render(f5);
        Head.render(f5);
        Nose.render(f5);
        Antler1.render(f5);
        Antler13.render(f5);
        Antler24.render(f5);
        Antler14.render(f5);
        Antler15.render(f5);
        Antler16.render(f5);
        Antler_25.render(f5);
        Antler19.render(f5);
        Antler20.render(f5);
        Antler22.render(f5);
        Antler23.render(f5);
        Antler17.render(f5);
        Antler18.render(f5);
        Antler21.render(f5);
        Antler2.render(f5);
        Antler3.render(f5);
        Antler4.render(f5);
        Antler5.render(f5);
        Antler6.render(f5);
        Antler7.render(f5);
        Antler8.render(f5);
        Antler9.render(f5);
        Antler12.render(f5);
        Antler10.render(f5);
        Antler11.render(f5);
        Tail.render(f5);
        }
        
        
      
      
      private void setRotation(ModelRenderer model, float x, float y, float z)
      {
        model.rotateAngleX = x;
        model.rotateAngleY = y;
        model.rotateAngleZ = z;
      }
      
      public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
      {
    	  super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
          this.Head.rotateAngleX = headPitch * 0.017453292F;
          this.Head.rotateAngleY = netHeadYaw * 0.017453292F;
          
         
        
          this.Leg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
          this.Leg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
          this.Leg3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
          this.Leg4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
          
       
      }
      
      
      
    }
      
    
    Posted in: WIP Mods
  • 0

    posted a message on The Animal Revolution Mod (Modders Wanted)

    What is your four digit tag, I nned that to add you on discord, or you could add me: Funsize#4908

    Posted in: WIP Mods
  • 0

    posted a message on The Animal Revolution Mod (Modders Wanted)

    Thank you for your quick reply's, I just got started on the deer, here is the model so far

    Also do you have discord because we need an easier way to chat

    Here is the turtle, honestly I think we should just add him, it would be easier being as I wouldn't need to setup eclipse again. Also Sorry hes not very detailed, I was just trying to make him cute because I like turtle lol.

    Posted in: WIP Mods
  • 0

    posted a message on The Animal Revolution Mod (Modders Wanted)

    Also I think it might be better/easier to just make the new mobs instead of replacing old ones. Also and preference on what u want me to start with?

    Posted in: WIP Mods
  • 0

    posted a message on The Animal Revolution Mod (Modders Wanted)

    I'd be able to help mostly with the new animals, in fact I just got done coding a turtle myself. Definitely other stuff too but for now, just that. This seems like a very good mod!

    Posted in: WIP Mods
  • 0

    posted a message on The Animal Revolution Mod (Modders Wanted)

    I might be able to help with this, Are you yourself going to be a modder? or are you just giving the idea.

    Posted in: WIP Mods
  • 0

    posted a message on The Xenomorph mod

    I'd be willing to help, was looking at doing something like this myself

    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on Help with custom mob

    Hello, I am having trouble with my custom mob. So I have been able to render it and give it ai, that's all fine. But because it is a turtle, I made it slow. In doing so the legs move really slow and it looks like it's moving without moving its legs. It there anyway to make the legs move faster but still keep the mob slow?

    Any help is appreciated.

    Posted in: WIP Mods
  • 0

    posted a message on Help Coding Mob Egg

    Thank you I got it to work!

    Posted in: Modification Development
  • 0

    posted a message on Help Coding Mob Egg

    Hello, I made a mob mod in 1.7.10 and am trying to update to 1.11.2. The code for spawn eggs have drastically changed and I need help on how to creat and register them. Any help is appreciated. Thanks!

    Posted in: Modification Development
  • 0

    posted a message on Friday the 13th Mod

    Some reply or I'll sniff your butt

    Posted in: WIP Mods
  • 0

    posted a message on Friday the 13th Mod

    Bump

    Posted in: WIP Mods
  • To post a comment, please or register a new account.