-
Notifications
You must be signed in to change notification settings - Fork 81
/
WorldEvents.java
64 lines (47 loc) · 2.84 KB
/
WorldEvents.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.progwml6.natura.world;
import com.progwml6.natura.Natura;
import com.progwml6.natura.common.config.Config;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStage;
import net.minecraftforge.common.world.BiomeGenerationSettingsBuilder;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@SuppressWarnings("unused")
@Mod.EventBusSubscriber(modid = Natura.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class WorldEvents {
@SubscribeEvent
static void onBiomeLoad(BiomeLoadingEvent event) {
BiomeGenerationSettingsBuilder generation = event.getGeneration();
if (!Config.treesBiomesBlacklist.get().contains(event.getName().toString())) {
if (event.getCategory() == Biome.Category.FOREST) {
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.SAKURA_FOREST_TREE_GEN);
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.EUCALYPTUS_TREE_GEN);
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.MAPLE_TREE_GEN);
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.SILVERBELL_TREE_GEN);
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.TIGER_TREE_GEN);
}
if (event.getCategory() == Biome.Category.JUNGLE) {
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.AMARANTH_TREE_GEN);
}
if (event.getCategory() == Biome.Category.PLAINS) {
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.REDWOOD_TREE_GEN);
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.EUCALYPTUS_PLAINS_TREE_GEN);
}
if (event.getCategory() == Biome.Category.EXTREME_HILLS) {
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.HOPSEED_TREE_GEN);
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.EUCALYPTUS_TREE_GEN);
}
if (event.getCategory() == Biome.Category.RIVER) {
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.SAKURA_TREE_GEN);
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.WILLOW_TREE_GEN);
}
if (event.getCategory() == Biome.Category.JUNGLE) {
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.AMARANTH_TREE_GEN);
}
if (event.getCategory() == Biome.Category.SWAMP) {
generation.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, NaturaStructures.WILLOW_TREE_3_GEN);
}
}
}
}