Jump to content

Recommended Posts

Posted

ok I have a mix of problems I cant for my life seem to figure out why they are happening, even tried updating to #1013 from #998 with no effect, I'm mostly new with making an actual minecraftforge mod but I'm pretty sure I'm doing things at least mostly correctly...

 

textures;

textures for everything don't load at initial start, so everything shows as the purple and black filler texture, though of course vanilla stuff is perfectly fine, if I go to resourcepacks and click done to trigger a reload the textures are then loaded correctly and everything looks perfectly fine.

 

ore generation; [FIXED]; yea the block class you enter must be a Block, or it odly dumps it and doesn't even spit an error message...

I have a generator and ores all set up, but very strangely,  gen.generate(world, random, x, y, z); instead of generating the ore in the world, generates holes, on testing worlds I can see the various perfectly shaped holes where ore should be, but its just filled with air and black surfaces from the lighting not being updated, however, if I just use a basic block replace it all works fine (albeit, only whatever shape I make the algorithm for).

 

mod items and blocks are left out of a world if it is created after loading or deleting another one;

ok, if I have a test world, close the game, load the game, select that world and delete it, then generate a new test world, inside this world will be nothing from my mod bar the creative tab, cant even spawn the blocks manually, and this world stays like this permanently, however, starting the game, not touching any other worlds (not even selecting) and creating a new world or loading a world with the mod data already in it, is perfectly fine.

 

apart from these above, the blocks and items seem to work fine, I haven't quite gotten to crafting or tile entities yet but the blocks otherwise behave as they should, no crashing or java errors, all my stuff is held in individual static finals just like minecraft does its own blocks, and they are all registered correctly, I even tried preinit instead of init but with the exact same results...

 

some parts of my code;

public class VPOres {

//ores
public static final VPOre copper_ore 	= new VPOreCopper();

//reg
public static void register()
{
	//ores
	regOre(copper_ore);

}

static void regOre(VPOre ore)
{
	GameRegistry.registerBlock(ore, ore.func_149739_a());
	VPGeneratorOre.registerOre(ore);
}

}

generator;

public class VPGeneratorOre implements IWorldGenerator 
{
static Random random = new Random();

static Vector<VPOre> orelist = new Vector<VPOre>();

static VPOre activeOreList[];
static WorldGenMinable activeGenList[];
static int oreCount;

public static void registerOre(VPOre ore)
{
	orelist.add(ore);
	System.out.println(ore.func_149739_a() + " added to ore generation");
}
    
public static void finaliseOreSet()
{
	//activeOreList = orelist.toArray();

	oreCount = orelist.size();

	activeOreList = new VPOre[oreCount];
	activeGenList = new WorldGenMinable[oreCount];

	for(int i = 0; i < oreCount; ++i)
	{
		VPOre ore = orelist.elementAt(i);
		activeOreList[i] = orelist.elementAt(i);
		activeGenList[i] = new WorldGenMinable(ore, ore.blobGenSize);
	}

	System.out.println("ore list finalised!");
}

    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
    {
    	//System.out.println("gentest");
    	
    	for(int i = 0; i < oreCount; ++i)
    	{
    		VPOre ore = activeOreList[i];
    		WorldGenMinable gen = activeGenList[i];
    		
    		if(ore.blobGenChunkChance != 0)
    		if(random.nextInt(ore.blobGenChunkChance) == 0)
    		{
    			//gen in the chunk
    			int count = 1 + random.nextInt(ore.blobGenCountMax);
    			
    			for(; count > 0; --count)
    			{
    				int x = (chunkX * 16) + random.nextInt(16);
    				int y = ore.blobGenHeightMin + random.nextInt(ore.blobGenHeightMax - ore.blobGenHeightMin);
    				int z = (chunkZ * 16) + random.nextInt(16);
    				
    			 	//getBiomeGenForCoords(int par1, int par2)
    				
    				gen.generate(world, random, x, y, z);
    				
    				
    			}
    		}
    	}
    	
    }

}

 

register functions are called in init, generator after the blocks of course, the ore blocks also contain some additional variables for generation alongside the standard block ones, noticable in the generator code, though I don't see how this could affect the generator as standard block replacing works fine, unless it specifically needs a standard block class...?

Posted

ok yea refactored my ore system to use a container class (boo java no has structs), changed the block to be actual Blocks instead of VPOres (still initialized with VPOres though) and the generator now generates correctly, so ie;

 

public static final VPOre copper_ore = new VPOreCopper();  will fail

 

public static final Block copper_ore = new VPOreCopper();    will generate correctly

 

of course if your code depended on the block being a specific derivative, refactor using containers or similar instead.

 

as for the textures and sporadic mod behavior, I can only assume these are forge bugs that are still getting fixed...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.