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!
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!
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:
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.
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!
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?
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!
1
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;
}
}
0
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;
}
}
0
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:
0
What is your four digit tag, I nned that to add you on discord, or you could add me: Funsize#4908
0
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.
0
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?
0
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!
0
I might be able to help with this, Are you yourself going to be a modder? or are you just giving the idea.
0
I'd be willing to help, was looking at doing something like this myself
0
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.
0
Thank you I got it to work!
0
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!
0
Some reply or I'll sniff your butt
0
Bump
0
Bump