Posted June 30, 20169 yr So I've made some corn and I'm trying to get it to generate as a Village field. I basically copied what happens in net.minecraft.world.gen.structure.StructureVillagePieces#Field2 since it will be exactly the same except for replacing the crop. The field base generates fine but everything I try to get my corn generated does not work. It generates an empty field. It looks to me through some testing that I'm either getting a block state wrong to spawn but It could be that I've missed something in my actual block class that messes with calling a block state of corn externally. I get no relevant console output during init or village generation. Can anyone help? If this is an issue with the forge version i'm using (1.8-11.14.4.1563), let me know that too... BlockCorn: http://pastebin.com/0f49NDuS ComponentCornField: http://pastebin.com/sTTHZtSE CornWorldGen: http://pastebin.com/Pu3u2PJs In my main class I've added the lines MapGenStructureIO.registerStructureComponent(ComponentCornField.class, "Vicf"); VillagerRegistry.instance().registerVillageCreationHandler(new CornWorldGen());
July 17, 20169 yr if you get an empty field, then you're almost there. just find the bug. check the max height in debugger - if it's 1 you get an empty field. i see a weird line with maxY in it (copied from the torches class), maybe you should rework that. next thing to try is using world.setblockstate instead of component.func_175804_a i had problems with those methods - clipping logic in there is weird. also, try replacing corn with carrots in one row, just to see if it's about corn.
July 18, 20169 yr Author Alright so It looks like you're right with that function. I generated my block just fine at a world spawn point. I already know that I can generate other blocks in the dirt patches in the field, so that works too, but I've figured it out, thanks. I wanted to use world.setblockstate originally but I didn't see how I can get the position of the generated village part within addComponentParts() to do so. If youre reading this in the future, it can be done as follows but is not needed BlockPos pos = new BlockPos(this.getXWithOffset(0,0),this.getYWithOffset(0),this.getZWithOffset(0,0)); [solution] function func_175811_a works fine for me, I needed to change how I get my block to Block corn = GameRegistry.findBlock(Corn.MODID, "corn"); Instead of referencing the final instance I had been using in my main class for registration.
July 18, 20169 yr Its more than likely that you never set the field in your main class to anything. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
July 18, 20169 yr Author I don't see how that could be possible, I used that variable to register the block, which has been working as expected for weeks.
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.