Thanks man, I apologize for being a tad harsh earlier. That really helped me out with Re-aligning the Registry from ID to Name.
I'll see if this works for the Spawners now.
[Edit]
I'm having a small problem. Everything works except that in the "EntityRegistry" Method I could not register the "entity.name" inside the variable. I take it that this is important for the Spawners, but I couldn't tell where you put the Code.
I actually have no problems with your code, it works. But for some reason whenever the two (5 Now) spawners generate in the World, The Mod Spawners are empty, The Sheep and Creeper spawner are the only ones that work, Can I have help with this subject?
Thanks man, I apologize for being a tad harsh earlier. That really helped me out with Re-aligning the Registry from ID to Name.
I'll see if this works for the Spawners now.
[Edit]
I'm having a small problem. Everything works except that in the "EntityRegistry" Method I could not register the "entity.name" inside the variable. I take it that this is important for the Spawners, but I couldn't tell where you put the Code.
name is a just a static field of those classes containing the name to register the Entity with. You could just hardcode the names (i.e. pass registerModEntity"Wasp" as the name instead of EntityWasp.name).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I actually have no problems with your code, it works. But for some reason whenever the two (5 Now) spawners generate in the World, The Mod Spawners are empty, and the Sheep one won't spawn Sheep. Can I have help with this subject?
I have a Picture of this below:
Is there enough light around the spawner for the Sheep to spawn?
Can we see your latest world gen and entity registration code?
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
and here is the Basic Structure, a bunch of Spawners:
package com.stormarmory.structures;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import java.util.Random;
public class Spawner implements IWorldGenerator {
private void generateSpawner(World world, int x, int y, int z, String entityName){
world.setBlock(x, y, z, Blocks.mob_spawner);
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(x, y, z);
spawner.func_145881_a().setEntityName(entityName);
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
if (world.provider.dimensionId == 0 && chunkX % 16 == 0 && chunkZ % 16 == 0) {
int x = chunkX * 16;
int z = chunkZ * 16;
int y = world.getTopSolidOrLiquidBlock(x, z) + 1;
generateSpawner(world, x, y, z, "Sheep");
generateSpawner(world, x + 1, y, z, "Wasp");
generateSpawner(world, x + 2, y, z, "Devil");
generateSpawner(world, x + 3, y, z, "ArchDevil");
generateSpawner(world, x + 4, y, z, "Creeper");
}
}
}
I put this line in my MainRegistry to allow it to spawn:
I can't see any obvious errors. Can you spawn the entities with their eggs? Do they spawn naturally?
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oddly enough, they work perfectly! Nothing is wrong with them. The Spawn Eggs work too, it's just the Spawners It seems. Thought it might have been a Graphical Glitch at first with the Empty Mob Spawners, but even at Night they don't Spawn Anything.
I've found the problem. When you register your Entity with registerModEntity, FML uses the equivalent of modID + "." + entityName as its name when adding to EntityList. When you register your Entity with registerGlobalEntityID, FML uses the entityName argument directly when adding it to EntityList.
Assuming your mod ID is "stormarmory", use "stormarmory.Wasp" to generate a Wasp spawner.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I've found the problem. When you register your Entity with registerModEntity, FML uses the equivalent of modID + "." + entityName as its name when adding to EntityList. When you register your Entity with registerGlobalEntity, FML uses the entityName argument directly when adding it to EntityList.
Assuming your mod ID is "stormarmory", use "stormarmory.Wasp" to generate a Wasp spawner.
Oh My God, Thank you both so much! Thanks to you guys, the Spawners finally work! This community needs more stars in the sky like you dudes. Now I can get to Structure Generating in my Mod at long last. I'll find out about how to do the "One use Spawner" later, because as of now, this is completely satisfiable. Thanks again, and I hope you have a good time on your Mods.
public class StructureGenerationHandler implements IWorldGenerator
{
@Override
public void generate(
Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
int Xcoord = chunkX * 16 + random.nextInt(16);
int Ycoord = random.nextInt(200);
int Zcoord = chunkZ * 16 + random.nextInt(16);
new WaspHive().generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
You have two generate methods, but only one of them overrides a super method (boolean generate(World world, Random rand, int x, int y, int z)). This method places a spawner block, but never calls generateSpawner to set its Entity.
Get rid of the other (non-override) generate method, add @Override to any override methods and call generateSpawner in the remaining (override) generate method.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
You're calling generateSpawner inside generateSpawner, which is pointless. If you did this and then called generateSpawner from any other method, it would throw a StackOverflowError because generateSpawner is recursively calling itself infinitely.
You need to call generateSpawner in the generate_r0 method with the same coordinates that you placed a spawner block at.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
[/p]
[p]@Override
public boolean generate(World world, Random rand, int x, int y, int z)
{
int i = rand.nextInt(1); if(i == 0)
{
generate_r0(world, rand, x, y, z);
} return true;
}
private void generateSpawner(World world, int x, int y, int z, String entityName){
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(x, y, z);
} public boolean generate_r0(World world, Random rand, int x, int y, int z)
{
generateSpawner(world, x + 1, y + 1, z + 1, "stormarmory.Wasp");
if(!LocationIsValidSpawn(world, x + 1, y, z + 1))
{
return false;
}[/p]
[p]
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Assuming generate is called for every chunk, the following code is what determines whether or not to generate a wasp hive in that chunk:
int i = rand.nextInt(1);
if(i == 0)
{
generate_r0(world, rand, x, y, z);
}
Random#nextInt(int) returns a random number between 0 (inclusive) and the argument (exclusive). At the moment, the hive will always be generated because 0 is the only possible return of nextInt(1). Passing a higher number to nextInt will reduce the chance of a hive being generated in that chunk.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Mine is open source, anyone can look at it (if they know where to find it):
https://github.com/DracoAnimus/Coding/blob/master/src/main/java/net/wildbill22/draco/entities/ModEntities.java
[url=2482915-wip-arkcraft-survival-evolved-dinos-taming]
Thanks man, I apologize for being a tad harsh earlier. That really helped me out with Re-aligning the Registry from ID to Name.
I'll see if this works for the Spawners now.
[Edit]
I'm having a small problem. Everything works except that in the "EntityRegistry" Method I could not register the "entity.name" inside the variable. I take it that this is important for the Spawners, but I couldn't tell where you put the Code.
I actually have no problems with your code, it works. But for some reason whenever the two (5 Now) spawners generate in the World, The Mod Spawners are empty, The Sheep and Creeper spawner are the only ones that work, Can I have help with this subject?
I have a Picture of this below:
name is a just a static field of those classes containing the name to register the Entity with. You could just hardcode the names (i.e. pass registerModEntity "Wasp" as the name instead of EntityWasp.name).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Is there enough light around the spawner for the Sheep to spawn?
Can we see your latest world gen and entity registration code?
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
import com.stormarmory.client.entity.EntityAris;
import com.stormarmory.client.entity.EntityChaos;
import com.stormarmory.client.entity.EntityDevil;
import com.stormarmory.client.entity.EntityMutatedWasp; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;
import cpw.mods.fml.common.registry.EntityRegistry; public class EntityRegistration {
private static int modEntityID = 0;
public static void preInit() {
EntityRegistry.registerModEntity(EntityMutatedWasp.class, "Wasp", ++modEntityID, StormArmory.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityAris.class, "Aris", ++modEntityID, StormArmory.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityDevil.class, "Devil", ++modEntityID, StormArmory.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityArchDevil.class, "ArchDevil", ++modEntityID, StormArmory.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityChaos.class, "Chaos", ++modEntityID, StormArmory.instance, 80, 3, true);
addMobSpawns();
registerEggs();
}
private static void addMobSpawns() {
EntityRegistry.addSpawn(EntityMutatedWasp.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.plains, BiomeGenBase.forest, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleEdge, BiomeGenBase.jungleHills, BiomeGenBase.roofedForest);
EntityRegistry.addSpawn(EntityAris.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.hell);
EntityRegistry.addSpawn(EntityDevil.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.hell);
EntityRegistry.addSpawn(EntityArchDevil.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.hell);
EntityRegistry.addSpawn(EntityChaos.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.hell);
}
static int startEntityId = 300;
public static void registerEggs() {
System.err.println("EntitiyRegistration: Registering the creative eggs!");
registerEntityEgg(EntityMutatedWasp.class, 0xdabb9d, 0xa73c1a);
registerEntityEgg(EntityAris.class, 0xdabb9d, 0xa93c1a);
registerEntityEgg(EntityChaos.class, 0xdabb9d, 0xa93c1a);
registerEntityEgg(EntityArchDevil.class, 0xdabb9d, 0xa93c1a);
registerEntityEgg(EntityDevil.class, 0xdabb9d, 0xa93c1a);
}
@SuppressWarnings("unchecked")
public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) {
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityList.EntityEggInfo(id, primaryColor, secondaryColor));
}
public static int getUniqueEntityId() {
do {
startEntityId++;
}
while (EntityList.getStringFromID(startEntityId) != null);
return startEntityId;
}
}
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider; import java.util.Random; public class Spawner implements IWorldGenerator {
private void generateSpawner(World world, int x, int y, int z, String entityName){
world.setBlock(x, y, z, Blocks.mob_spawner);
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(x, y, z);
spawner.func_145881_a().setEntityName(entityName);
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
if (world.provider.dimensionId == 0 && chunkX % 16 == 0 && chunkZ % 16 == 0) {
int x = chunkX * 16;
int z = chunkZ * 16;
int y = world.getTopSolidOrLiquidBlock(x, z) + 1; generateSpawner(world, x, y, z, "Sheep");
generateSpawner(world, x + 1, y, z, "Wasp");
generateSpawner(world, x + 2, y, z, "Devil");
generateSpawner(world, x + 3, y, z, "ArchDevil");
generateSpawner(world, x + 4, y, z, "Creeper");
}
}
}
I can't see any obvious errors. Can you spawn the entities with their eggs? Do they spawn naturally?
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oddly enough, they work perfectly! Nothing is wrong with them. The Spawn Eggs work too, it's just the Spawners It seems. Thought it might have been a Graphical Glitch at first with the Empty Mob Spawners, but even at Night they don't Spawn Anything.
I've found the problem. When you register your Entity with registerModEntity, FML uses the equivalent of modID + "." + entityName as its name when adding to EntityList. When you register your Entity with registerGlobalEntityID, FML uses the entityName argument directly when adding it to EntityList.
Assuming your mod ID is "stormarmory", use "stormarmory.Wasp" to generate a Wasp spawner.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh My God, Thank you both so much! Thanks to you guys, the Spawners finally work! This community needs more stars in the sky like you dudes. Now I can get to Structure Generating in my Mod at long last. I'll find out about how to do the "One use Spawner" later, because as of now, this is completely satisfiable. Thanks again, and I hope you have a good time on your Mods.
Oh man, I got a huge flaw in my Structure now. The Spawner generates, but it is still pigs. Here is my Structure's Code:
package com.stormarmory.structures;
import java.util.Random;
import com.stormarmory.blocks.MBlocks;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WaspHive extends WorldGenerator
{
protected Block[] GetValidSpawnBlocks()
{
return new Block[]
{
Blocks.grass,
Blocks.stone,
Blocks.dirt,
};
}
public boolean LocationIsValidSpawn(World world, int x, int y, int z)
{
Block checkBlock = world.getBlock(x, y - 1, z);
Block blockAbove = world.getBlock(x, y , z);
Block blockBelow = world.getBlock(x, y - 2, z);
for (Block i : GetValidSpawnBlocks())
{
if (blockAbove != Blocks.air)
{
return false;
}
if (checkBlock == i)
{
return true;
}
else if (checkBlock == Blocks.snow_layer && blockBelow == i)
{
return true;
}
else if (checkBlock.getMaterial() == Material.plants && blockBelow == i)
{
return true;
}
}
return false;
}
public boolean generate(World world, Random rand, int x, int y, int z)
{
int i = rand.nextInt(1);
if(i == 0)
{
generate_r0(world, rand, x, y, z);
}
return true;
}
public boolean generate_r0(World world, Random rand, int x, int y, int z)
{
if(!LocationIsValidSpawn(world, x + 1, y, z + 1))
{
return false;
}
world.setBlock(x + 0, y + 0, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 0, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 0, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 0, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 0, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 0, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 0, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 0, z + 2, MBlocks.HiveEntrance, 0, 3);
world.setBlock(x + 2, y + 0, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 1, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 1, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 1, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 1, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 1, z + 1, Blocks.mob_spawner, 0, 3);
world.setBlock(x + 2, y + 1, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 1, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 1, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 1, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 2, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 2, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 2, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 2, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 2, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 2, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 2, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 2, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 2, z + 2, MBlocks.HiveBlock, 0, 3);
return true;
}
private void generateSpawner(World world, int x, int y, int z, String entityName){
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(x, y, z);
spawner.func_145881_a().setEntityName(entityName);
}
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
if (world.provider.dimensionId == 0 && chunkX % 16 == 0 && chunkZ % 16 == 0) {
int x = chunkX * 16;
int z = chunkZ * 16;
int y = world.getTopSolidOrLiquidBlock(x, z) + 1;
generateSpawner(world, x + 1, y + 1, z + 1, "stormarmory.Wasp");
}
}
}
I registered it in here:
package com.stormarmory.world;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import java.util.Random;
import com.stormarmory.structures.WaspHive;
public class StructureGenerationHandler implements IWorldGenerator
{
@Override
public void generate(
Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
int Xcoord = chunkX * 16 + random.nextInt(16);
int Ycoord = random.nextInt(200);
int Zcoord = chunkZ * 16 + random.nextInt(16);
new WaspHive().generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
Placed this line in the MainRegistry:
You have two generate methods, but only one of them overrides a super method (boolean generate(World world, Random rand, int x, int y, int z)). This method places a spawner block, but never calls generateSpawner to set its Entity.
Get rid of the other (non-override) generate method, add @Override to any override methods and call generateSpawner in the remaining (override) generate method.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenerator; public class WaspHive extends WorldGenerator
{
protected Block[] GetValidSpawnBlocks()
{
return new Block[]
{
Blocks.grass,
Blocks.stone,
Blocks.dirt,
};
} public boolean LocationIsValidSpawn(World world, int x, int y, int z)
{ Block checkBlock = world.getBlock(x, y - 1, z);
Block blockAbove = world.getBlock(x, y , z);
Block blockBelow = world.getBlock(x, y - 2, z); for (Block i : GetValidSpawnBlocks())
{
if (blockAbove != Blocks.air)
{
return false;
}
if (checkBlock == i)
{
return true;
}
else if (checkBlock == Blocks.snow_layer && blockBelow == i)
{
return true;
}
else if (checkBlock.getMaterial() == Material.plants && blockBelow == i)
{
return true;
}
}
return false;
}
@Override
public boolean generate(World world, Random rand, int x, int y, int z)
{
int i = rand.nextInt(1); if(i == 0)
{
generate_r0(world, rand, x, y, z);
} return true;
}
private void generateSpawner(World world, int x, int y, int z, String entityName){
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(x, y, z);
spawner.func_145881_a().setEntityName(entityName);
generateSpawner(world, x + 1, y + 1, z + 1, "stormarmory.Wasp");
} public boolean generate_r0(World world, Random rand, int x, int y, int z)
{
if(!LocationIsValidSpawn(world, x + 1, y, z + 1))
{
return false;
} world.setBlock(x + 0, y + 0, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 0, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 0, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 0, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 0, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 0, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 0, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 0, z + 2, MBlocks.HiveEntrance, 0, 3);
world.setBlock(x + 2, y + 0, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 1, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 1, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 1, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 1, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 1, z + 1, Blocks.mob_spawner, 0, 3);
world.setBlock(x + 2, y + 1, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 1, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 1, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 1, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 2, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 2, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 2, z + 0, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 2, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 2, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 2, z + 1, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 0, y + 2, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 1, y + 2, z + 2, MBlocks.HiveBlock, 0, 3);
world.setBlock(x + 2, y + 2, z + 2, MBlocks.HiveBlock, 0, 3);
return true;
}
}
You're calling generateSpawner inside generateSpawner, which is pointless. If you did this and then called generateSpawner from any other method, it would throw a StackOverflowError because generateSpawner is recursively calling itself infinitely.
You need to call generateSpawner in the generate_r0 method with the same coordinates that you placed a spawner block at.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Here is what the Line looks like now:
I had to get rid of
because it was causing an Error on World generation, Problem is, that Line is needed for the Spawner.
You need to call generateSpawner after you place the spawner block, otherwise there won't be a TileEntitySpawner at those coordinates to modify.
You also need to call it with the same coordinates that you placed the spawner at.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Okay, they spawn now. Sorry about that, it's 2:00 AM Over here, so my mind was a tad Obscured!
Btw, on the Subject, you wouldn't happen to know how to make a Structure more or less common, would you?
Assuming generate is called for every chunk, the following code is what determines whether or not to generate a wasp hive in that chunk:
Random#nextInt(int) returns a random number between 0 (inclusive) and the argument (exclusive). At the moment, the hive will always be generated because 0 is the only possible return of nextInt(1). Passing a higher number to nextInt will reduce the chance of a hive being generated in that chunk.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.