Skip to content

Commit

Permalink
Prevent huts & wells being placed near structures, renames
Browse files Browse the repository at this point in the history
  • Loading branch information
Drullkus committed Feb 27, 2023
1 parent 576d77c commit 9160e2d
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 1.19.3 2023-02-26T18:36:00.15921 Registries
aba8be044d575cb4d04c269e79b41545848490b1 data/umbral_skies/forge/biome_modifier/aether_modifier.json
// 1.19.3 2023-02-26T19:02:58.095239 Registries
dc30deb0308d04c7074580797bd33214b5aeb47d data/umbral_skies/forge/biome_modifier/aether_modifier.json
a6ea005b69078dbe1d4f2cdc9fb22e51df9220fc data/umbral_skies/twilight/wood_palettes/holystone.json
3ab6fe39cfd30b5c8a72fa74333d8fa3373ce862 data/umbral_skies/twilight/wood_palettes/skyroot.json
28bb0151a994d3b650196b10f2916121b6be4187 data/umbral_skies/worldgen/configured_feature/aether_palette_fancy_well.json
fadbd729899dec40d05018f8fccc3f2791b4cf49 data/umbral_skies/worldgen/configured_feature/aether_palette_hut.json
a18ddc1f62db8465f5f7cfb20534452e019c69f8 data/umbral_skies/worldgen/configured_feature/aether_palette_simple_well.json
37249399088d6ff17815eaf9bfb29fb65e517cdb data/umbral_skies/worldgen/configured_feature/randomized_aether_well.json
27d09de0633e3a54c6f573f01ef1b4fbd4d77167 data/umbral_skies/worldgen/placed_feature/aether_druid_hut.json
6d79e16209e7b9561e20ee18dba9524327e53630 data/umbral_skies/worldgen/placed_feature/aether_well.json
a82d68fd4d91c44def60722133272a1898ec077d data/umbral_skies/worldgen/placed_feature/aether_druid_hut.json
c0448cc605a8e4e08c2b4f9938af75687d365249 data/umbral_skies/worldgen/placed_feature/aether_well.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.3 2023-02-26T18:39:02.127467 Tags for minecraft:worldgen/placed_feature mod id umbral_skies
da3aea4a4d29c1e6384acef18f4cb21249c3d75b data/umbral_skies/tags/worldgen/placed_feature/aether_features.json
// 1.19.3 2023-02-26T19:02:58.095894 Tags for minecraft:worldgen/placed_feature mod id umbral_skies
da3aea4a4d29c1e6384acef18f4cb21249c3d75b data/umbral_skies/tags/worldgen/placed_feature/twilight_to_aether_features.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#aether:is_aether",
"features": "#umbral_skies:aether_features",
"features": "#umbral_skies:twilight_to_aether_features",
"step": "surface_structures"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
{
"type": "minecraft:rarity_filter",
"chance": 32
},
{
"type": "aether:dungeon_blacklist_filter"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 32
"chance": 2
},
{
"type": "aether:dungeon_blacklist_filter"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.gildedgames.aether.AetherTags;
import com.gildedgames.aether.block.AetherBlocks;
import com.gildedgames.aether.world.placementmodifier.DungeonBlacklistFilter;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.HolderSet;
import net.minecraft.core.registries.Registries;
Expand All @@ -28,7 +29,7 @@

import java.util.List;

public class UmbralKeys {
public class UmbralContent {
public static final ResourceKey<WoodPalette> SKYROOT_PALETTE = ResourceKey.create(WoodPalettes.WOOD_PALETTE_TYPE_KEY, UmbralSkies.prefix("skyroot"));
public static final ResourceKey<WoodPalette> HOLYSTONE_PALETTE = ResourceKey.create(WoodPalettes.WOOD_PALETTE_TYPE_KEY, UmbralSkies.prefix("holystone"));

Expand Down Expand Up @@ -82,8 +83,8 @@ static void generateFeatureConfigurations(BootstapContext<ConfiguredFeature<?, ?
}

static void generatePlacedFeatures(BootstapContext<PlacedFeature> context) {
context.register(AETHER_DRUID_HUT, new PlacedFeature(context.lookup(Registries.CONFIGURED_FEATURE).getOrThrow(AETHER_HUT_PALETTE), List.of(RarityFilter.onAverageOnceEvery(32))));
context.register(PLACEABLE_AETHER_WELL, new PlacedFeature(context.lookup(Registries.CONFIGURED_FEATURE).getOrThrow(RANDOMIZED_AETHER_WELL), List.of(RarityFilter.onAverageOnceEvery(32))));
context.register(AETHER_DRUID_HUT, new PlacedFeature(context.lookup(Registries.CONFIGURED_FEATURE).getOrThrow(AETHER_HUT_PALETTE), List.of(RarityFilter.onAverageOnceEvery(32), new DungeonBlacklistFilter())));
context.register(PLACEABLE_AETHER_WELL, new PlacedFeature(context.lookup(Registries.CONFIGURED_FEATURE).getOrThrow(RANDOMIZED_AETHER_WELL), List.of(RarityFilter.onAverageOnceEvery(32), new DungeonBlacklistFilter())));
}

static void generateBiomeModifiers(BootstapContext<BiomeModifier> context) {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/us/drullk/umbralskies/UmbralData.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

public class UmbralData {
private static final RegistrySetBuilder DATA_BUILDER = new RegistrySetBuilder()
.add(WoodPalettes.WOOD_PALETTE_TYPE_KEY, UmbralKeys::generateWoodPalettes)
.add(Registries.CONFIGURED_FEATURE, UmbralKeys::generateFeatureConfigurations)
.add(Registries.PLACED_FEATURE, UmbralKeys::generatePlacedFeatures)
.add(ForgeRegistries.Keys.BIOME_MODIFIERS, UmbralKeys::generateBiomeModifiers);
.add(WoodPalettes.WOOD_PALETTE_TYPE_KEY, UmbralContent::generateWoodPalettes)
.add(Registries.CONFIGURED_FEATURE, UmbralContent::generateFeatureConfigurations)
.add(Registries.PLACED_FEATURE, UmbralContent::generatePlacedFeatures)
.add(ForgeRegistries.Keys.BIOME_MODIFIERS, UmbralContent::generateBiomeModifiers);

public static WeightedRandomList<WeightedEntry.Wrapper<HolderSet<WoodPalette>>> buildPaletteChoices(HolderGetter<WoodPalette> paletteHolders) {
var skyroot = WeightedEntry.<HolderSet<WoodPalette>>wrap(HolderSet.direct(paletteHolders.getOrThrow(UmbralKeys.SKYROOT_PALETTE)), 20);
var holystone = WeightedEntry.<HolderSet<WoodPalette>>wrap(HolderSet.direct(paletteHolders.getOrThrow(UmbralKeys.HOLYSTONE_PALETTE)), 9);
var skyroot = WeightedEntry.<HolderSet<WoodPalette>>wrap(HolderSet.direct(paletteHolders.getOrThrow(UmbralContent.SKYROOT_PALETTE)), 20);
var holystone = WeightedEntry.<HolderSet<WoodPalette>>wrap(HolderSet.direct(paletteHolders.getOrThrow(UmbralContent.HOLYSTONE_PALETTE)), 9);
var treasure = WeightedEntry.<HolderSet<WoodPalette>>wrap(paletteHolders.getOrThrow(CustomTagGenerator.WoodPaletteTagGenerator.TREASURE_PALETTES), 1);

return WeightedRandomList.create(skyroot, holystone, treasure);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/us/drullk/umbralskies/UmbralTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.concurrent.CompletableFuture;

public class UmbralTags {
public static final TagKey<PlacedFeature> ADDED_AETHER_FEATURES = TagKey.create(Registries.PLACED_FEATURE, UmbralSkies.prefix("aether_features"));
public static final TagKey<PlacedFeature> ADDED_AETHER_FEATURES = TagKey.create(Registries.PLACED_FEATURE, UmbralSkies.prefix("twilight_to_aether_features"));

public static class UmbralPlacedFeatureTag extends TagsProvider<PlacedFeature> {
protected UmbralPlacedFeatureTag(PackOutput output, CompletableFuture<HolderLookup.Provider> provider, @Nullable ExistingFileHelper existingFileHelper) {
Expand All @@ -21,7 +21,7 @@ protected UmbralPlacedFeatureTag(PackOutput output, CompletableFuture<HolderLook

@Override
protected void addTags(HolderLookup.Provider provider) {
tag(ADDED_AETHER_FEATURES).add(UmbralKeys.AETHER_DRUID_HUT, UmbralKeys.PLACEABLE_AETHER_WELL);
tag(ADDED_AETHER_FEATURES).add(UmbralContent.AETHER_DRUID_HUT, UmbralContent.PLACEABLE_AETHER_WELL);
}
}
}

0 comments on commit 9160e2d

Please sign in to comment.