Advertisement
jayhillx

EvergreenTreeFeature

Dec 5th, 2024
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 58.55 KB | None | 0 0
  1. package com.dreamlands.common.world.feature.tree;
  2.  
  3. import com.dreamlands.common.block.DreamLeavesBlock;
  4. import com.mojang.serialization.Codec;
  5. import net.minecraft.core.BlockPos;
  6. import net.minecraft.core.Direction;
  7. import net.minecraft.tags.BlockTags;
  8. import net.minecraft.util.RandomSource;
  9. import net.minecraft.world.level.LevelAccessor;
  10. import net.minecraft.world.level.LevelSimulatedReader;
  11. import net.minecraft.world.level.WorldGenLevel;
  12. import net.minecraft.world.level.block.Blocks;
  13. import net.minecraft.world.level.block.RotatedPillarBlock;
  14. import net.minecraft.world.level.block.state.BlockState;
  15. import net.minecraft.world.level.levelgen.feature.Feature;
  16. import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
  17.  
  18. /**
  19.  * this is actually the worst code i have ever seen this needs to change ASAP, but it's the best tree shape i can have for now.
  20.  */
  21. public class EvergreenTreeFeature extends Feature<DreamTreeConfiguration> {
  22.  
  23.     public EvergreenTreeFeature(Codec<DreamTreeConfiguration> codec) {
  24.         super(codec);
  25.     }
  26.  
  27.     @Override
  28.     public boolean place(FeaturePlaceContext<DreamTreeConfiguration> context) {
  29.         WorldGenLevel level = context.level();
  30.         RandomSource random = context.random();
  31.         BlockPos startPos = context.origin();
  32.         DreamTreeConfiguration config = context.config();
  33.         int trunkHeight = 25;
  34.  
  35.         BlockPos belowPos = startPos.below();
  36.         level.setBlock(belowPos, Blocks.DIRT.defaultBlockState(), 2);
  37.         BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos();
  38.  
  39.         for (int i = 0; i < trunkHeight; ++i) {
  40.             this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 0), random, config, Direction.Axis.Y);
  41.  
  42.             if (i < 9) {
  43.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config, Direction.Axis.Y);
  44.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config, Direction.Axis.Y);
  45.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config, Direction.Axis.Y);
  46.             }
  47.  
  48.             if (i == 6) {
  49.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, -2), random, config);
  50.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -3), random, config);
  51.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -2), random, config);
  52.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -1), random, config);
  53.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -3), random, config);
  54.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -2), random, config);
  55.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  56.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  57.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -5), random, config);
  58.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -4), random, config);
  59.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -3), random, config);
  60.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config, Direction.Axis.X);
  61.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  62.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  63.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  64.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -5), random, config);
  65.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -4), random, config);
  66.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config, Direction.Axis.Z);
  67.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, -3), random, config, Direction.Axis.Z);
  68.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  69.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -4), random, config);
  70.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -3), random, config);
  71.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  72.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config, Direction.Axis.Z);
  73.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  74.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 3), random, config);
  75.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 4), random, config);
  76.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -3), random, config);
  77.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -2), random, config);
  78.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config);
  79.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  80.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config, Direction.Axis.Z);
  81.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config, Direction.Axis.Z);
  82.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 3), random, config);
  83.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 4), random, config);
  84.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 5), random, config);
  85.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 0), random, config);
  86.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 1), random, config);
  87.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -2, i, 2), random, config, Direction.Axis.Z);
  88.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -2, i, 3), random, config, Direction.Axis.Z);
  89.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 4), random, config);
  90.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 5), random, config);
  91.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 0), random, config);
  92.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 1), random, config);
  93.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 2), random, config);
  94.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 3), random, config);
  95.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 4), random, config);
  96.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, 1), random, config);
  97.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, 2), random, config);
  98.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, 3), random, config);
  99.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, 4), random, config);
  100.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -5, i, 2), random, config);
  101.             }
  102.  
  103.             if (i == 7) {
  104.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -2), random, config);
  105.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -1), random, config);
  106.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -2), random, config);
  107.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  108.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -3), random, config);
  109.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  110.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  111.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  112.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -4), random, config);
  113.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -3), random, config);
  114.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  115.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  116.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -4), random, config);
  117.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -3), random, config);
  118.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  119.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  120.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  121.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  122.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  123.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  124.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 3), random, config);
  125.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 1), random, config);
  126.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 2), random, config);
  127.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 3), random, config);
  128.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 1), random, config);
  129.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 2), random, config);
  130.             }
  131.  
  132.             if (i == 8) {
  133.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 1), random, config);
  134.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 2), random, config);
  135.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  136.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  137.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  138.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 3), random, config);
  139.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  140.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  141.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  142.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  143.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 4), random, config);
  144.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 5), random, config);
  145.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  146.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config, Direction.Axis.Z);
  147.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config, Direction.Axis.Z);
  148.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 4), random, config);
  149.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 5), random, config);
  150.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 6), random, config);
  151.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  152.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  153.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 3), random, config);
  154.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 4), random, config);
  155.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 5), random, config);
  156.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 6), random, config);
  157.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -3), random, config);
  158.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -2), random, config);
  159.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config, Direction.Axis.Z);
  160.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  161.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  162.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  163.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 3), random, config);
  164.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 4), random, config);
  165.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -4), random, config);
  166.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -3), random, config);
  167.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -2, i, -2), random, config, Direction.Axis.Z);
  168.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -1), random, config);
  169.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 0), random, config);
  170.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 1), random, config);
  171.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 2), random, config);
  172.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, -4), random, config);
  173.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, -3), random, config);
  174.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, -2), random, config);
  175.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, -1), random, config);
  176.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, -2), random, config);
  177.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, -1), random, config);
  178.             }
  179.  
  180.             if (i == 9) {
  181.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 6, i, 1), random, config);
  182.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 6, i, 2), random, config);
  183.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, -4), random, config);
  184.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, -3), random, config);
  185.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, -2), random, config);
  186.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 0), random, config);
  187.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 1), random, config);
  188.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 2), random, config);
  189.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 3), random, config);
  190.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 4), random, config);
  191.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -4), random, config);
  192.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -3), random, config);
  193.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -2), random, config);
  194.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 0), random, config);
  195.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 1), random, config);
  196.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 2), random, config);
  197.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 3), random, config);
  198.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 4), random, config);
  199.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -4), random, config);
  200.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -3), random, config);
  201.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 3, i, -2), random, config, Direction.Axis.X);
  202.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  203.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  204.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  205.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  206.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 3), random, config);
  207.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 4), random, config);
  208.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -3), random, config);
  209.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  210.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config, Direction.Axis.X);
  211.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  212.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  213.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  214.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  215.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  216.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  217.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  218.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  219.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 4), random, config);
  220.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  221.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  222.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  223.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 3), random, config);
  224.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 4), random, config);
  225.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 5), random, config);
  226.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -3), random, config);
  227.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -2), random, config);
  228.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config);
  229.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  230.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  231.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  232.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -3), random, config);
  233.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -2), random, config);
  234.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -1), random, config);
  235.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 0), random, config);
  236.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, -2), random, config);
  237.             }
  238.  
  239.             if (i == 10) {
  240.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 2), random, config);
  241.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -3), random, config);
  242.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -2), random, config);
  243.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 0), random, config);
  244.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 1), random, config);
  245.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 2), random, config);
  246.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 3), random, config);
  247.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -3), random, config);
  248.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -2), random, config);
  249.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  250.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  251.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  252.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  253.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 3), random, config);
  254.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -3), random, config);
  255.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  256.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  257.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  258.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  259.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  260.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  261.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  262.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  263.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  264.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  265.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  266.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  267.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  268.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  269.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config, Direction.Axis.X);
  270.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  271.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  272.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config, Direction.Axis.X);
  273.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  274.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 3), random, config);
  275.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 1), random, config);
  276.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -2, i, 2), random, config, Direction.Axis.X);
  277.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 3), random, config);
  278.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 4), random, config);
  279.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 1), random, config);
  280.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 2), random, config);
  281.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 3), random, config);
  282.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 4), random, config);
  283.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, 2), random, config);
  284.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -4, i, 3), random, config);
  285.             }
  286.  
  287.             if (i == 11) {
  288.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 2), random, config);
  289.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 3), random, config);
  290.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  291.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  292.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  293.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 3), random, config);
  294.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 4), random, config);
  295.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -4), random, config);
  296.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -3), random, config);
  297.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  298.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  299.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  300.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  301.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  302.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  303.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 4), random, config);
  304.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 5), random, config);
  305.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -4), random, config);
  306.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -3), random, config);
  307.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  308.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  309.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 0), random, config);
  310.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  311.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  312.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  313.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 4), random, config);
  314.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 5), random, config);
  315.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -5), random, config);
  316.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -4), random, config);
  317.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -3), random, config);
  318.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  319.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  320.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  321.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  322.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  323.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 4), random, config);
  324.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -4), random, config);
  325.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -3), random, config);
  326.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  327.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config, Direction.Axis.X);
  328.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  329.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  330.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  331.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 3), random, config);
  332.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -2), random, config);
  333.                 this.placeLog(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config, Direction.Axis.X);
  334.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  335.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  336.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  337.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 3), random, config);
  338.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -2), random, config);
  339.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -1), random, config);
  340.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 0), random, config);
  341.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 1), random, config);
  342.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 2), random, config);
  343.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, -1), random, config);
  344.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 0), random, config);
  345.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 2), random, config);
  346.             }
  347.  
  348.             if (i == 12) {
  349.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, -2), random, config);
  350.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, -1), random, config);
  351.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -3), random, config);
  352.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -2), random, config);
  353.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -1), random, config);
  354.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -3), random, config);
  355.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -2), random, config);
  356.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  357.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  358.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  359.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  360.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -3), random, config);
  361.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  362.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  363.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  364.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  365.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  366.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  367.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -3), random, config);
  368.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  369.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  370.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  371.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  372.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  373.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  374.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  375.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  376.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  377.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  378.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config);
  379.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  380.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -1), random, config);
  381.             }
  382.  
  383.             if (i == 13) {
  384.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 1), random, config);
  385.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 2), random, config);
  386.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -2), random, config);
  387.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -1), random, config);
  388.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 0), random, config);
  389.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 1), random, config);
  390.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 2), random, config);
  391.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 3), random, config);
  392.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 4), random, config);
  393.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 5), random, config);
  394.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  395.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  396.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  397.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  398.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 3), random, config);
  399.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  400.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  401.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  402.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  403.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  404.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  405.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 4), random, config);
  406.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  407.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  408.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  409.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  410.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  411.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 4), random, config);
  412.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 5), random, config);
  413.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  414.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  415.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  416.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  417.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 3), random, config);
  418.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 4), random, config);
  419.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config);
  420.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  421.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  422.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  423.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 1), random, config);
  424.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 2), random, config);
  425.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 3), random, config);
  426.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 1), random, config);
  427.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 2), random, config);
  428.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -3, i, 3), random, config);
  429.             }
  430.  
  431.             if (i == 14) {
  432.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -3), random, config);
  433.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -2), random, config);
  434.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, -1), random, config);
  435.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 1), random, config);
  436.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 2), random, config);
  437.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -3), random, config);
  438.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -2), random, config);
  439.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  440.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  441.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  442.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  443.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 3), random, config);
  444.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -3), random, config);
  445.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  446.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  447.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  448.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  449.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  450.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  451.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  452.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  453.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  454.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  455.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  456.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -4), random, config);
  457.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -3), random, config);
  458.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  459.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  460.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  461.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  462.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  463.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -3), random, config);
  464.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -2), random, config);
  465.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config);
  466.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  467.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  468.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  469.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -2), random, config);
  470.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -1), random, config);
  471.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 1), random, config);
  472.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 2), random, config);
  473.             }
  474.  
  475.             if (i == 15) {
  476.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 5, i, 0), random, config);
  477.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 0), random, config);
  478.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -2), random, config);
  479.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  480.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  481.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  482.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  483.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  484.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  485.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  486.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  487.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  488.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  489.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config, Direction.Axis.Z);
  490.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  491.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  492.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  493.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  494.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  495.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config);
  496.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  497.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  498.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  499.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 0), random, config);
  500.             }
  501.  
  502.             if (i == 16) {
  503.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 0), random, config);
  504.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  505.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  506.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  507.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 2), random, config);
  508.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 3), random, config);
  509.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  510.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  511.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  512.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  513.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  514.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 3), random, config);
  515.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -3), random, config);
  516.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  517.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  518.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  519.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  520.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  521.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  522.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  523.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  524.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  525.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  526.             }
  527.  
  528.             if (i == 17) {
  529.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  530.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  531.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  532.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  533.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  534.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  535.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  536.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config, Direction.Axis.Z);
  537.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -2), random, config);
  538.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  539.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  540.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  541.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  542.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, -1), random, config);
  543.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  544.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  545.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 2), random, config);
  546.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, -1), random, config);
  547.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -2, i, 0), random, config);
  548.             }
  549.  
  550.             if (i == 18) {
  551.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 4, i, 0), random, config);
  552.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, -1), random, config);
  553.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  554.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 1), random, config);
  555.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -2), random, config);
  556.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  557.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  558.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  559.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  560.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  561.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  562.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 3), random, config);
  563.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  564.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  565.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  566.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  567.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  568.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  569.             }
  570.  
  571.             if (i == 19) {
  572.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  573.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  574.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  575.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  576.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  577.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  578.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  579.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config, Direction.Axis.Z);
  580.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  581.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  582.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  583.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  584.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  585.             }
  586.  
  587.             if (i == 20) {
  588.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  589.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 2), random, config);
  590.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  591.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  592.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  593.             }
  594.  
  595.             if (i == 21) {
  596.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 3, i, 0), random, config);
  597.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  598.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config, Direction.Axis.X);
  599.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  600.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -2), random, config);
  601.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  602.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 0), random, config);
  603.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  604.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  605.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, -1), random, config);
  606.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config, Direction.Axis.X);
  607.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  608.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 2), random, config);
  609.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 0), random, config);
  610.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, -1, i, 1), random, config);
  611.             }
  612.  
  613.             if (i == 22) {
  614.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, -1), random, config);
  615.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  616.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  617.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  618.             }
  619.  
  620.             if (i == 23) {
  621.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 1), random, config);
  622.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  623.                 this.placeLog(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config, Direction.Axis.Z);
  624.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 2), random, config);
  625.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 1), random, config);
  626.             }
  627.  
  628.             if (i == 24) {
  629.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i, 0), random, config);
  630.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, -1), random, config);
  631.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i, 1), random, config);
  632.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 0, i, 0), random, config);
  633.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 2, i + 1, 0), random, config);
  634.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i + 1, 0), random, config);
  635.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i + 1, 1), random, config);
  636.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i + 1, 0), random, config);
  637.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i + 2, 0), random, config);
  638.                 this.placeLeaves(level, mutablePos.setWithOffset(startPos, 1, i + 3, 0), random, config);
  639.             }
  640.         }
  641.         return true;
  642.     }
  643.  
  644.     private void placeLog(LevelAccessor level, BlockPos pos, RandomSource random, DreamTreeConfiguration config, Direction.Axis axis) {
  645.         level.setBlock(pos, config.trunkProvider.getState(random, pos).setValue(RotatedPillarBlock.AXIS, axis), 2);
  646.     }
  647.  
  648.     private void placeLeaves(LevelAccessor level, BlockPos pos, RandomSource random, DreamTreeConfiguration config) {
  649.         BlockState state = level.getBlockState(pos);
  650.         if (state.canBeReplaced() || state.isAir()) {
  651.             level.setBlock(pos, config.foliageProvider.getState(random, pos).setValue(DreamLeavesBlock.DISTANCE, 1), 2);
  652.         }
  653.     }
  654.  
  655.     private static boolean isReplaceable(LevelSimulatedReader level, BlockPos pos) {
  656.         return level.isStateAtPosition(pos, EvergreenTreeFeature::isReplaceableBlock);
  657.     }
  658.  
  659.     private static boolean isReplaceableBlock(BlockState state) {
  660.         return state.is(BlockTags.REPLACEABLE_BY_TREES);
  661.     }
  662.  
  663. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement