Posted May 10, 20178 yr Anyone know if saplingGrowTreeEvent has changed for 1.11.2? I am trying to hook an event to whenever a tree is generated. According to this it should be triggered during world gen but I'm only getting a response on a player created sapling growth. Even then its finicky, where I am verifying the result as not being denied but it still runs the if block when bonemeal is used on a sapling but the tree is not grown. EDIT: Posted wrong link on "this". Replaced. Update: Solved at Edited May 11, 20178 yr by Xentripetal
May 10, 20178 yr Nothing about that says it is fired during world generation it says it is fired on the TERRAIN_GEN_BUS. 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.
May 11, 20178 yr Author @Draco18s Well you're not wrong. I must have posted the wrong link. This is the correct one.
May 11, 20178 yr Author Update: It seems that nowhere in the generation code does it trigger that event. I have solved what I wanted to do by overriding decoration generation of trees with the following: @SubscribeEvent public void decorateBiomeEvent(DecorateBiomeEvent.Decorate e) { if(e.getType().equals(DecorateBiomeEvent.Decorate.EventType.TREE)) { Random random = e.getRand(); World worldIn = e.getWorld(); BlockPos chunkPos = e.getPos(); Biome biomeIn = worldIn.getBiome(chunkPos); int k1 = biomeIn.theBiomeDecorator.treesPerChunk; for (int j2 = 0; j2 < k1; ++j2) { int k6 = random.nextInt(16) + 8; int l = random.nextInt(16) + 8; WorldGenAbstractTree worldgenabstracttree = biomeIn.genBigTreeChance(random); worldgenabstracttree.setDecorationDefaults(); BlockPos blockpos = worldIn.getHeight(chunkPos.add(k6, 0, l)); if (worldgenabstracttree.generate(worldIn, random, blockpos)) { System.out.println("Tree at " + blockpos.toString()); worldgenabstracttree.generateSaplings(worldIn, random, blockpos); } } e.setResult(Result.DENY); } }
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.