Jump to content

[1.8] Unknown net.minecraftforge.common.chunkio.QueuedChunk


Recommended Posts

Posted

Maybe i am just doing it wrong, but the following code produces "Unknown net.minecraftforge.common.chunkio.QueuedChunk".

Additionally to that i had to, somewhat ugly, prevent an "Already decorating" exception caused by the call of "tp = world.getTopSolidOrLiquidBlock(tp);".

 

	@SubscribeEvent(priority=EventPriority.LOWEST)
public void onWorldDecoration(DecorateBiomeEvent.Decorate event)
{
	Logger log = FMLLog.getLogger();
	try {
		int startx = event.pos.getX();
		int startz = event.pos.getZ();
		World world = event.world;
		for(int x=startx;x<startx+16;x++)
			for(int z=startz;z<startz+16;z++)
			{
				BlockPos tp = new BlockPos(x,0,z);
				BiomeGenBase tb = world.getBiomeGenForCoords(tp);
				//log.info("Biome: " + tb.biomeName);
				if(tb == tb.plains)
				{
			    	//log.info("Plains biome...");

					////// This can, for whatever reason, cause an exception
					tp = world.getTopSolidOrLiquidBlock(tp);
					////// This can, for whatever reason, cause an exception

					tp = tp.down();
					//log.info(tp.getX() +","+ tp.getY()+","+ tp.getZ() + ":" + world.getBlockState(tp).getBlock().getUnlocalizedName());
					if(world.getBlockState(tp).getBlock() == Blocks.grass)
					{					
						//log.info("And a grass block!");
						Random rand = event.world.rand;
						if(rand.nextInt(1000) < 1)
						{
							log.info("Planted at " + tp.getX() +","+ tp.getY()+","+ tp.getZ());
							world.setBlockState(tp, Blocks.farmland.getDefaultState());
							tp = tp.up();
							world.setBlockState(tp, Blocks.wheat.getDefaultState());								

						}
					}
				}

			}
	} catch (Exception e) {
		log.warn("Ignoring an Already decorating exception...");
	}
}

 

The actual error that brought me here:

[02:52:42] [server thread/INFO] [FML]: Unknown net.minecraftforge.common.chunkio.QueuedChunk {
x: -58
z: 20
loader: null
world: New World
dimension: 0
provider: net.minecraft.world.WorldProviderSurface
}
[02:52:42] [server thread/INFO] [FML]: This should not happen. Please report this error to Forge.

 

Using:

MCP v9.10

FML v8.0.14.1281

Forge 11.14.0.1281

 

Started unobfuscated as debug out of Eclipse.

 

Java version:

java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

 

EDIT: I tested the code under "extreme" conditions with a flat world with just the plains biome.

 

BTW:

Kinda works and does what it should, but i would love a better way of adding natural wheat plants to plain biomes, this method feels clunky and much like doing it in the old hMod-Style of ways.

SELECT signature FROM dumbsignatures WHERE forumtopic LIKE forum;

0 rows returned.

Posted

The Decorate and Decorate.Pre/Post events are notoriously prone to throwing exceptions, though I don't recall the exact reason. One way to deal with it is to handle the exception:

@SubscribeEvent
public void onDecorate(DecorateBiomeEvent.Post event) {
	try {
		// Your gen code here
	} catch (Exception e) {
		Throwable cause = e.getCause();
		if (e.getMessage() != null && e.getMessage().equals("Already decorating!!") ||
				(cause != null && cause.getMessage() != null && cause.getMessage().equals("Already decorating!!")))
		{
			;
		} else {
			e.printStackTrace();
		}
	}
}

There is very likely a better way to get around this, but I have used that and it allows the custom generation code to function without crashing.

Posted

I am only adding a 1x2x1 structure that should not get out of a chunk. And unless Minecraft decides it would be a great idea to place a Plains biome at around 255 i am save in height also. :)

So there might be some other problem i am not getting there, maybe on my side, maybe on Forges side.

But for now i think it has something to do with Forge for 1.8 being beta, so i hope that gets fixed eventually.

 

The dream solution would be a convenience function that you can fill with (simple) structures, the biomes to place them in and the chance of them getting placed. ;D

 

BTW:

If i plan on doing bigger structures i would have a look at that Roguelike Dungeons plugin first to look how its solved there.

No copy and paste, thats just wrong, but to get the idea you can steal with the eyes. Something along the lines of not reinventing the wheel and such.

SELECT signature FROM dumbsignatures WHERE forumtopic LIKE forum;

0 rows returned.

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.