2022-09-23 23:25:00 +02:00
|
|
|
package com.minelittlepony.unicopia.block;
|
|
|
|
|
2022-09-25 00:14:29 +02:00
|
|
|
import com.minelittlepony.unicopia.Unicopia;
|
|
|
|
|
|
|
|
import net.minecraft.block.*;
|
2022-09-23 23:25:00 +02:00
|
|
|
import net.minecraft.tag.BlockTags;
|
|
|
|
import net.minecraft.util.math.intprovider.ConstantIntProvider;
|
|
|
|
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
2022-09-25 00:14:29 +02:00
|
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
import net.minecraft.world.gen.foliage.BlobFoliagePlacer;
|
2022-09-23 23:25:00 +02:00
|
|
|
import net.minecraft.world.gen.foliage.JungleFoliagePlacer;
|
2022-09-25 00:14:29 +02:00
|
|
|
import net.minecraft.world.gen.trunk.StraightTrunkPlacer;
|
2022-09-23 23:25:00 +02:00
|
|
|
import net.minecraft.world.gen.trunk.UpwardsBranchingTrunkPlacer;
|
|
|
|
|
|
|
|
public interface UTreeGen {
|
2022-09-25 00:14:29 +02:00
|
|
|
Tree ZAP_APPLE_TREE = Tree.Builder.create(Unicopia.id("zap_apple_tree"), new UpwardsBranchingTrunkPlacer(
|
|
|
|
7, 2, 3,
|
|
|
|
UniformIntProvider.create(3, 6),
|
|
|
|
0.3f,
|
2022-09-23 23:25:00 +02:00
|
|
|
UniformIntProvider.create(1, 3),
|
|
|
|
Registry.BLOCK.getOrCreateEntryList(BlockTags.MANGROVE_LOGS_CAN_GROW_THROUGH)
|
2022-09-25 00:14:29 +02:00
|
|
|
), new JungleFoliagePlacer(
|
2022-09-23 23:25:00 +02:00
|
|
|
ConstantIntProvider.create(3),
|
|
|
|
ConstantIntProvider.create(2),
|
|
|
|
3
|
2022-09-25 00:14:29 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
.log(UBlocks.ZAP_LOG)
|
|
|
|
.leaves(UBlocks.ZAP_LEAVES)
|
|
|
|
.sapling(Unicopia.id("zapling"))
|
|
|
|
.biomes(Tree.Builder.IS_FOREST)
|
|
|
|
.count(0, 0.01F, 1)
|
|
|
|
.build();
|
|
|
|
Tree GREEN_APPLE_TREE = createAppleTree("green_apple", UBlocks.GREEN_APPLE_LEAVES);
|
2022-09-25 15:39:07 +02:00
|
|
|
Tree SWEET_APPLE_TREE = createAppleTree("sweet_apple", UBlocks.SWEET_APPLE_LEAVES);
|
2022-09-23 23:25:00 +02:00
|
|
|
|
2022-09-25 00:14:29 +02:00
|
|
|
static Tree createAppleTree(String name, Block leaves) {
|
|
|
|
return Tree.Builder.create(Unicopia.id(name + "_tree"),
|
|
|
|
new StraightTrunkPlacer(4, 6, 2),
|
|
|
|
new BlobFoliagePlacer(ConstantIntProvider.create(3), ConstantIntProvider.create(0), 3)
|
|
|
|
)
|
|
|
|
.log(Blocks.OAK_LOG)
|
|
|
|
.leaves(leaves)
|
|
|
|
.sapling(Unicopia.id(name + "_sapling"))
|
|
|
|
.build();
|
2022-09-23 23:25:00 +02:00
|
|
|
}
|
2022-09-25 00:14:29 +02:00
|
|
|
|
|
|
|
static void bootstrap() { }
|
2022-09-23 23:25:00 +02:00
|
|
|
}
|