All I need is some help with generating structures (like obelisk) on the surface. I have already looked though the game files, and basically found nothing. I seen people use programs, that will give you the x, y coords relative to the spawning point (making a structure).
Ok, my question is:
Basic layout / explanation for world gen.
Registration of the world gen.
Thank you, and sorry for my dumb grammar, its 2 am, and im coding... rip
that is the tutorial i followed, there a few things I had to do differently , like go in and set all the 0's that were suppose to be air to Blocks.air. And comment out "//if(b1.isAir(world, x, y, z) || b1.isLeaves(world, x, y, z))" and //k = k - 10; //i = i - 10;"
Now mine spawn fine.
This is the tutorial I followed for Ore Gen, its basically the same, except you dont want the MinY, vein size and all that, you just want
public void generateStructure(World world, Random random, int chunkX, int chunkZ, int chance, int height)
Also, when I made mine I had a hard time setting the randomness to an acceptable number. I had to use a random number generator, then decide what % of the time I wanted to to spawn, and check to see if the random int was lower than that value. Hope this helps, im a noob at this, but want to be as helpful as I can when I "think" I know how to help lol
Okay, So I just have to register it now, and I found how, with just GameRegistry, but one of the parameters, is 'modGenerationWeight' and it tells the game when to run this, and I don't have any clue, on when, or what int I should use
And another thing, I had to comment out ALOT of stuff, and only stairs and the stone brick exisit, (there should be planks, and beacon aswell for this test).
/*
*** MADE BY MRPONYCAPTAIN'S .SCHEMATIC TO .JAVA CONVERTING TOOL v2.0 ***
*/
package com.unassigned.unassignedmod.worldgen.schematic;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenerator;
public class Obelisk extends WorldGenerator implements IWorldGenerator
{
protected Block[] getValidSpawnBlocks() {
return new Block[] {
Blocks.grass,
Blocks.dirt,
Blocks.sand
};
}
public boolean locationIsValidSpawn(World world, int i, int j, int k){
int distanceToAir = 0;
Block check = world.getBlock(i, j, k);
while (check != Blocks.air){
if (distanceToAir > 1){
return false;
}
distanceToAir++;
check = world.getBlock(i, j + distanceToAir, k);
}
j += distanceToAir - 1;
Block block = world.getBlock(i, j, k);
Block blockAbove = world.getBlock(i, j+1, k);
Block blockBelow = world.getBlock(i, j-1, k);
for (Block x : getValidSpawnBlocks()){
if (blockAbove != Blocks.air){
return false;
}
if (block == x){
return true;
}else if (block == Blocks.snow && blockBelow == x){
return true;
}
}
return false;
}
public Obelisk() { }
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { }
public void setBlock(World world, int x, int y, int z, Block block, int metadata)
{
Block b1 = world.getBlock(x, y, z);
if(b1.isAir(world, x, y, z) || b1.isLeaves(world, x, y, z))
{
world.setBlock(x, y, z, block, metadata, 2);
}
}
public boolean generate(World world, Random rand, int i, int j, int k) {
//check that each corner is one of the valid spawn blocks
if(!locationIsValidSpawn(world, i, j, k) || !locationIsValidSpawn(world, i + 2, j, k) || !locationIsValidSpawn(world, i + 2, j, k + 2) || !locationIsValidSpawn(world, i, j, k + 2))
{
return false;
}
k = k - 10;
i = i - 10;
// this.setBlock(world, i + 0, j + 0, k + 0, 0, 0);
this.setBlock(world, i + 0, j + 0, k + 1, Blocks.oak_stairs, 0);
/* this.setBlock(world, i + 0, j + 0, k + 2, 0, 0);
this.setBlock(world, i + 0, j + 1, k + 0, 0, 0);
this.setBlock(world, i + 0, j + 1, k + 1, 0, 0);
this.setBlock(world, i + 0, j + 1, k + 2, 0, 0);
this.setBlock(world, i + 0, j + 2, k + 0, 0, 0);
this.setBlock(world, i + 0, j + 2, k + 1, 0, 0);
this.setBlock(world, i + 0, j + 2, k + 2, 0, 0);
this.setBlock(world, i + 0, j + 3, k + 0, 0, 0);
this.setBlock(world, i + 0, j + 3, k + 1, 0, 0);
this.setBlock(world, i + 0, j + 3, k + 2, 0, 0); */
this.setBlock(world, i + 1, j + 0, k + 0, Blocks.oak_stairs, 2);
// this.setBlock(world, i + 1, j + 0, k + 1, 0, 0);
this.setBlock(world, i + 1, j + 0, k + 2, Blocks.oak_stairs, 3);
// this.setBlock(world, i + 1, j + 1, k + 0, 0, 0);
this.setBlock(world, i + 1, j + 1, k + 1, Blocks.stonebrick, 1);
// this.setBlock(world, i + 1, j + 1, k + 2, 0, 0);
// this.setBlock(world, i + 1, j + 2, k + 0, 0, 0);
this.setBlock(world, i + 1, j + 2, k + 1, Blocks.stonebrick, 1);
/* this.setBlock(world, i + 1, j + 2, k + 2, 0, 0);
this.setBlock(world, i + 1, j + 3, k + 0, 0, 0);
this.setBlock(world, i + 1, j + 3, k + 1, -118, 0);
this.setBlock(world, i + 1, j + 3, k + 2, 0, 0);
this.setBlock(world, i + 2, j + 0, k + 0, 0, 0); */
this.setBlock(world, i + 2, j + 0, k + 1, Blocks.oak_stairs, 1);
/* this.setBlock(world, i + 2, j + 0, k + 2, 0, 0);
this.setBlock(world, i + 2, j + 1, k + 0, 0, 0);
this.setBlock(world, i + 2, j + 1, k + 1, 0, 0);
this.setBlock(world, i + 2, j + 1, k + 2, 0, 0);
this.setBlock(world, i + 2, j + 2, k + 0, 0, 0);
this.setBlock(world, i + 2, j + 2, k + 1, 0, 0);
this.setBlock(world, i + 2, j + 2, k + 2, 0, 0);
this.setBlock(world, i + 2, j + 3, k + 0, 0, 0);
this.setBlock(world, i + 2, j + 3, k + 1, 0, 0);
this.setBlock(world, i + 2, j + 3, k + 2, 0, 0);
*/
return true;
}
}
And another thing, I had to comment out ALOT of stuff, and only stairs and the stone brick exisit, (there should be planks, and beacon aswell for this test).
For the second problem I don't see any reference to set block to beacon or planks.
For the commented part as said above:
that is the tutorial i followed, there a few things I had to do differently , like go in and set all the 0's that were suppose to be air to Blocks.air.
Okay, Will do, I figured out the Registry, just required a simple change. Anyways, to generate it I would do? Just basically an ore, but... what, this is where i'm stumped, I just needed some time for the rest.
Honestly, I gave up on using schematic converters. It always takes too much time to track down and fix bugs. It's easiest to sit down with some graph paper, a pencil, and some patience.
What I do for small structures is make an array of points where the blocks will be placed, one array per section.
for(int[] coord : floorBlocks)
{
world.setBlock(x + coord[0], y + coord[1], z + coord[2], Blocks.dirt, 0, 2);
}
Notice that I do not pass it an integer ID. I do, however, pass it a metadata of 0 and a flag of 2, which only notifies the client that the block looks different.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
Okay, so after some sleep and troubleshooting, I got this so far,
Main:
package com.unassigned.unassignedmod;
import com.unassigned.unassignedmod.client.ClientProxy;
import com.unassigned.unassignedmod.combined.CommonProxy;
import com.unassigned.unassignedmod.items.ModItems;
import com.unassigned.unassignedmod.worldgen.ObeliskGeneration;
import com.unassigned.unassignedmod.worldgen.schematic.WorldGenObelisk;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.world.gen.feature.WorldGenerator;
@Mod(modid = Main.MODID, name = Main.MODNAME, version = Main.VERSION)
public class Main {
public static final String MODID = "unnamed";
public static final String MODNAME = "Unassigned Mod";
public static final String VERSION = "0.0.1";
@Instance
public static Main instance = new Main();
@SidedProxy(clientSide="com.unassigned.unassignedmod.client.ClientProxy",
serverSide="com.unassigned.unassignedmod.server.ServerProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
GameRegistry.registerWorldGenerator(new ObeliskGeneration(), 0);
proxy.preInit(e);
}
@EventHandler
public void init(FMLInitializationEvent e) {
proxy.init(e);
}
@EventHandler
public void postInit(FMLPostInitializationEvent e) {
proxy.postInit(e);
}
public static CreativeTabs tabCustom = new CreativeTabs("unnamedMod") {
@Override
@SideOnly(Side.CLIENT)
public Item getTabIconItem() {
return ModItems.questionMarkItem;
}
};
}
Client and Server proxy are basically the same,
package com.unassigned.unassignedmod.client;
import com.unassigned.unassignedmod.combined.CommonProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
public class ClientProxy extends CommonProxy {
@Override
public void preInit(FMLPreInitializationEvent e) {
super.preInit(e);
}
@Override
public void init(FMLInitializationEvent e) {
super.init(e);
}
@Override
public void postInit(FMLPostInitializationEvent e) {
super.postInit(e);
}
}
Common Proxy
package com.unassigned.unassignedmod.combined;
import com.unassigned.unassignedmod.items.ModItems;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
public class CommonProxy {
public void preInit(FMLPreInitializationEvent e) {
ModItems.init();
}
public void init(FMLInitializationEvent e) {
}
public void postInit(FMLPostInitializationEvent e) {
}
}
WorldGenObelisk:
/*
*** MADE BY MRPONYCAPTAIN'S .SCHEMATIC TO .JAVA CONVERTING TOOL v2.0 ***
*/
package com.unassigned.unassignedmod.worldgen.schematic;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenObelisk extends WorldGenerator implements IWorldGenerator
{
protected Block[] getValidSpawnBlocks() {
return new Block[] {
Blocks.grass,
Blocks.dirt,
Blocks.sand
};
}
public boolean locationIsValidSpawn(World world, int i, int j, int k){
int distanceToAir = 0;
Block check = world.getBlock(i, j, k);
while (check != Blocks.air){
if (distanceToAir > 1){
return false;
}
distanceToAir++;
check = world.getBlock(i, j + distanceToAir, k);
}
j += distanceToAir - 1;
Block block = world.getBlock(i, j, k);
Block blockAbove = world.getBlock(i, j+1, k);
Block blockBelow = world.getBlock(i, j-1, k);
for (Block x : getValidSpawnBlocks()){
if (blockAbove != Blocks.air){
return false;
}
if (block == x){
return true;
}else if (block == Blocks.snow && blockBelow == x){
return true;
}
}
return false;
}
public WorldGenObelisk() { }
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
}
public void setBlock(World world, int x, int y, int z, Block block, int metadata)
{
Block b1 = world.getBlock(x, y, z);
if(b1.isAir(world, x, y, z) || b1.isLeaves(world, x, y, z))
{
world.setBlock(x, y, z, block, metadata, 2);
}
}
public boolean generate(World world, Random rand, int i, int j, int k) {
//check that each corner is one of the valid spawn blocks
if(!locationIsValidSpawn(world, i, j, k) || !locationIsValidSpawn(world, i + 2, j, k) || !locationIsValidSpawn(world, i + 2, j, k + 2) || !locationIsValidSpawn(world, i, j, k + 2))
{
return false;
}
k = k - 10;
i = i - 10;
this.setBlock(world, i + 0, j + 0, k + 0, Blocks.planks, 2);
this.setBlock(world, i + 0, j + 0, k + 1, Blocks.planks, 2);
this.setBlock(world, i + 0, j + 0, k + 2, Blocks.planks, 2);
this.setBlock(world, i + 0, j + 1, k + 0, Blocks.air, 0);
this.setBlock(world, i + 0, j + 1, k + 1, Blocks.oak_stairs, 0);
this.setBlock(world, i + 0, j + 1, k + 2, Blocks.air, 0);
this.setBlock(world, i + 0, j + 2, k + 0, Blocks.air, 0);
this.setBlock(world, i + 0, j + 2, k + 1, Blocks.air, 0);
this.setBlock(world, i + 0, j + 2, k + 2, Blocks.air, 0);
this.setBlock(world, i + 0, j + 3, k + 0, Blocks.air, 0);
this.setBlock(world, i + 0, j + 3, k + 1, Blocks.air, 0);
this.setBlock(world, i + 0, j + 3, k + 2, Blocks.air, 0);
this.setBlock(world, i + 0, j + 4, k + 0, Blocks.air, 0);
this.setBlock(world, i + 0, j + 4, k + 1, Blocks.air, 0);
this.setBlock(world, i + 0, j + 4, k + 2, Blocks.air, 0);
this.setBlock(world, i + 0, j + 5, k + 0, Blocks.air, 0);
this.setBlock(world, i + 0, j + 5, k + 1, Blocks.air, 0);
this.setBlock(world, i + 0, j + 5, k + 2, Blocks.air, 0);
this.setBlock(world, i + 1, j + 0, k + 0, Blocks.planks, 2);
this.setBlock(world, i + 1, j + 0, k + 1, Blocks.planks, 2);
this.setBlock(world, i + 1, j + 0, k + 2, Blocks.planks, 2);
this.setBlock(world, i + 1, j + 1, k + 0, Blocks.oak_stairs, 2);
this.setBlock(world, i + 1, j + 1, k + 1, Blocks.diamond_block, 0);
this.setBlock(world, i + 1, j + 1, k + 2, Blocks.oak_stairs, 3);
this.setBlock(world, i + 1, j + 2, k + 0, Blocks.air, 0);
this.setBlock(world, i + 1, j + 2, k + 1, Blocks.stonebrick, 0);
this.setBlock(world, i + 1, j + 2, k + 2, Blocks.air, 0);
this.setBlock(world, i + 1, j + 3, k + 0, Blocks.air, 0);
this.setBlock(world, i + 1, j + 3, k + 1, Blocks.stonebrick, 0);
this.setBlock(world, i + 1, j + 3, k + 2, Blocks.air, 0);
this.setBlock(world, i + 1, j + 4, k + 0, Blocks.air, 0);
this.setBlock(world, i + 1, j + 4, k + 1, Blocks.beacon, 0);
this.setBlock(world, i + 1, j + 4, k + 2, Blocks.air, 0);
this.setBlock(world, i + 1, j + 5, k + 0, Blocks.air, 0);
this.setBlock(world, i + 1, j + 5, k + 1, Blocks.air, 0);
this.setBlock(world, i + 1, j + 5, k + 2, Blocks.air, 0);
this.setBlock(world, i + 2, j + 0, k + 0, Blocks.planks, 2);
this.setBlock(world, i + 2, j + 0, k + 1, Blocks.planks, 2);
this.setBlock(world, i + 2, j + 0, k + 2, Blocks.planks, 2);
this.setBlock(world, i + 2, j + 1, k + 0, Blocks.air, 0);
this.setBlock(world, i + 2, j + 1, k + 1, Blocks.oak_stairs, 1);
this.setBlock(world, i + 2, j + 1, k + 2, Blocks.air, 0);
this.setBlock(world, i + 2, j + 2, k + 0, Blocks.air, 0);
this.setBlock(world, i + 2, j + 2, k + 1, Blocks.air, 0);
this.setBlock(world, i + 2, j + 2, k + 2, Blocks.air, 0);
this.setBlock(world, i + 2, j + 3, k + 0, Blocks.air, 0);
this.setBlock(world, i + 2, j + 3, k + 1, Blocks.air, 0);
this.setBlock(world, i + 2, j + 3, k + 2, Blocks.air, 0);
this.setBlock(world, i + 2, j + 4, k + 0, Blocks.air, 0);
this.setBlock(world, i + 2, j + 4, k + 1, Blocks.air, 0);
this.setBlock(world, i + 2, j + 4, k + 2, Blocks.air, 0);
this.setBlock(world, i + 2, j + 5, k + 0, Blocks.air, 0);
this.setBlock(world, i + 2, j + 5, k + 1, Blocks.air, 0);
this.setBlock(world, i + 2, j + 5, k + 2, Blocks.air, 0);
return true;
}
}
Obelisk Generation (Where I'm stuck)
package com.unassigned.unassignedmod.worldgen;
import java.util.Random;
import com.unassigned.unassignedmod.worldgen.schematic.WorldGenObelisk;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
public class ObeliskGeneration implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
switch(world.provider.dimensionId) {
case 1:
break;
case 0:
break;
case -1:
break;
}
}
public void generatedEnd(World world, Random rand, int x, int z){
}
public void generatedOverworld(World world, Random rand, int x, int z){
generateStructure(world, rand, z, z, z, z);
}
public void generatedNether(World world, Random rand, int x, int z){
}
public void generateStructure(World world, Random random, int chunkX, int chunkZ, int chance, int height) {
WorldGenObelisk gen = new WorldGenObelisk();
for(int i = 0; i < chance; i++) {
int xRand = chunkX * 16 + random.nextInt(16);
int zRand = chunkZ * 16 + random.nextInt(16);
gen.generate(world, random, i, xRand, zRand);
}
}
}
In the generation of the structure im stuck at generating my structure in the overworld, (just let eclipse fill in varibles for example)
public void generatedOverworld(World world, Random rand, int x, int z){
generateStructure(world, rand, z, z, z, z); //z are auto gen.
}
edit***
Changed my overworld function to :
public void generatedOverworld(World world, Random random, int chunkX, int chunkZ, int chance, int height){
generateStructure(world, random, chunkX, chunkZ, chance, height);
}
Honestly, I gave up on using schematic converters. It always takes too much time to track down and fix bugs. It's easiest to sit down with some graph paper, a pencil, and some patience.
What I do for small structures is make an array of points where the blocks will be placed, one array per section.
for(int[] coord : floorBlocks)
{
world.setBlock(x + coord[0], y + coord[1], z + coord[2], Blocks.dirt, 0, 2);
}
Notice that I do not pass it an integer ID. I do, however, pass it a metadata of 0 and a flag of 2, which only notifies the client that the block looks different.
Ye, and just with my first experience with it, its quite broken. See, the main concept of generating is not whats hard, all I want to know is how to ACTUALLY make it generate in the world. Only tutorials ive seen is with ore,
Why are you confused? generateStructure takes these parameters, you typed it yourself:
generateStructure(World world, Random random, int chunkX, int chunkZ, int chance, int height)
generateOverworld receives chunkX and chunkZ from generate.
So pass generateStructure the x and z and how many structures per chunk you want (chance) and the y-coordinate (height).
Also, I have a feeling you don't know what you're doing. When you do this:
gen.generate(world, random, i, xRand, zRand);
why are you giving it i for the x-coordinate and xRand for the y-coordinate? You should give it height for the y-coordinate.
Take a step back and write your own code, one bit at a time, and really understand what it is doing. You're methods name the parameters they take, so if you slow down you should easily be able to at least give them the right values.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
okay, found my second error, didnt call it in the switch function,
but again, I cant fit that many parameters in it.
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
switch(world.provider.dimensionId) {
case 1:
break;
case 0:
generatedOverworld(world, random, chunkZ, chunkZ, chunkZ, chunkZ); //ChunkZ are auto fillers.
break;
case -1:
break;
}
YOUR PARAMETERS ARE NAMED. IT'S NOT HARD TO TELL THAT IF generatedOverworld TAKES world, rand, x, z YOU SHOULD GIVE IT THE WORLD, A RANDOM, CHUNKX AND CHUNKZ.
Sorry about the yelling. To me this seems incredibly obvious.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
Inside the generateOverworld function (called from the generate function where you check dimension) is where you should call generateStructure. The last two variables, chance and height, can be set inside generateOverworld to be whatever you want.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
public void generatedOverworld(World world, Random rand, int x, int z){
final int CHANCE = 1; // how many you want per chunk
final int HEIGHT = world.getChunkFromChunkCoords(x, z).getHeight(x, z);
generateStructure(world, rand, x, z, CHANCE, HEIGHT);
}
You may want to make your own function to return the value for HEIGHT, because the methods I call above are not very precise.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
Hello, and thank you for reading...
All I need is some help with generating structures (like obelisk) on the surface. I have already looked though the game files, and basically found nothing. I seen people use programs, that will give you the x, y coords relative to the spawning point (making a structure).
Ok, my question is:
Basic layout / explanation for world gen.
Registration of the world gen.
Thank you, and sorry for my dumb grammar, its 2 am, and im coding... rip
Hm, I think that I might go outside today.
http://septoxel.wix.com/forgingmc#!structure-generation/c17uy
that is the tutorial i followed, there a few things I had to do differently , like go in and set all the 0's that were suppose to be air to Blocks.air. And comment out "//if(b1.isAir(world, x, y, z) || b1.isLeaves(world, x, y, z))" and //k = k - 10; //i = i - 10;"
Now mine spawn fine.
This is the tutorial I followed for Ore Gen, its basically the same, except you dont want the MinY, vein size and all that, you just want
public void generateStructure(World world, Random random, int chunkX, int chunkZ, int chance, int height)
Also, when I made mine I had a hard time setting the randomness to an acceptable number. I had to use a random number generator, then decide what % of the time I wanted to to spawn, and check to see if the random int was lower than that value. Hope this helps, im a noob at this, but want to be as helpful as I can when I "think" I know how to help lol
Okay, I will try it out
Hm, I think that I might go outside today.
Okay, So I just have to register it now, and I found how, with just GameRegistry, but one of the parameters, is 'modGenerationWeight' and it tells the game when to run this, and I don't have any clue, on when, or what int I should use
And another thing, I had to comment out ALOT of stuff, and only stairs and the stone brick exisit, (there should be planks, and beacon aswell for this test).
Hm, I think that I might go outside today.
Okay, looking though the Obelisk code, it already seems like I have a generate function
Would I call that in my main class?
Hm, I think that I might go outside today.
For the second problem I don't see any reference to set block to beacon or planks.
For the commented part as said above:
sorry for my bad english I'm Italian
Okay, Will do, I figured out the Registry, just required a simple change. Anyways, to generate it I would do? Just basically an ore, but... what, this is where i'm stumped, I just needed some time for the rest.
(Thank you for your time)
Hm, I think that I might go outside today.
I agree, In MC edit I did select all, I will probably troubleshoot, when I get in game, and change the variables.
Hm, I think that I might go outside today.
Hm, I think that I might go outside today.
Honestly, I gave up on using schematic converters. It always takes too much time to track down and fix bugs. It's easiest to sit down with some graph paper, a pencil, and some patience.
What I do for small structures is make an array of points where the blocks will be placed, one array per section.
Example:
Then in the generate function, I do this:
Notice that I do not pass it an integer ID. I do, however, pass it a metadata of 0 and a flag of 2, which only notifies the client that the block looks different.
Okay, so after some sleep and troubleshooting, I got this so far,
Main:
Client and Server proxy are basically the same,
Common Proxy
WorldGenObelisk:
Obelisk Generation (Where I'm stuck)
In the generation of the structure im stuck at generating my structure in the overworld, (just let eclipse fill in varibles for example)
edit***
Changed my overworld function to :
Hm, I think that I might go outside today.
Is there anyway I could debug this?
Hm, I think that I might go outside today.
Ye, and just with my first experience with it, its quite broken. See, the main concept of generating is not whats hard, all I want to know is how to ACTUALLY make it generate in the world. Only tutorials ive seen is with ore,
Hm, I think that I might go outside today.
Why are you confused? generateStructure takes these parameters, you typed it yourself:
generateOverworld receives chunkX and chunkZ from generate.
So pass generateStructure the x and z and how many structures per chunk you want (chance) and the y-coordinate (height).
Also, I have a feeling you don't know what you're doing. When you do this:
why are you giving it i for the x-coordinate and xRand for the y-coordinate? You should give it height for the y-coordinate.
Take a step back and write your own code, one bit at a time, and really understand what it is doing. You're methods name the parameters they take, so if you slow down you should easily be able to at least give them the right values.
okay, found my second error, didnt call it in the switch function,
but again, I cant fit that many parameters in it.
Hm, I think that I might go outside today.
YOUR PARAMETERS ARE NAMED. IT'S NOT HARD TO TELL THAT IF generatedOverworld TAKES world, rand, x, z YOU SHOULD GIVE IT THE WORLD, A RANDOM, CHUNKX AND CHUNKZ.
Sorry about the yelling. To me this seems incredibly obvious.
Yes, this might seem easy to you, and yes I'm quite a noob at generation, because I have never messed with it.
Im looking at this tutorial this guy sent me for ores and told me just to modify some variables, but its not adding up.
because I had to edit the generateOverworld function and add two variables for the generateStructure to work. I was told to use:
BUT because we are implementing IWorldGenerator, I cannot pass in the chance and height variable when we try to call it under case 0:
this here:
WILL not work because I have to pass in 2 more variables,
Im sorry if this is easy stuff to you, but we were all like this at some point. Need for help
Hm, I think that I might go outside today.
Inside the generateOverworld function (called from the generate function where you check dimension) is where you should call generateStructure. The last two variables, chance and height, can be set inside generateOverworld to be whatever you want.
So for chance, what would do if i want less than 1 per-chunk, maybe 1 every tens chunks?
Hm, I think that I might go outside today.
This is what should be inside generateOverworld:
You may want to make your own function to return the value for HEIGHT, because the methods I call above are not very precise.