Skip to content

Commit da3d367

Browse files
committed
UD-260222
1 parent 059871a commit da3d367

19 files changed

Lines changed: 232 additions & 49 deletions

File tree

src/generated/resources/data/mia/dimension/the_abyss.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"continentalness": 0.0,
134134
"depth": [
135135
0.2,
136-
0.8
136+
1.5
137137
],
138138
"erosion": 0.0,
139139
"humidity": [
@@ -154,7 +154,7 @@
154154
"continentalness": 0.0,
155155
"depth": [
156156
0.2,
157-
0.8
157+
1.5
158158
],
159159
"erosion": 0.0,
160160
"humidity": [
@@ -175,7 +175,7 @@
175175
"continentalness": 0.0,
176176
"depth": [
177177
0.2,
178-
0.8
178+
1.5
179179
],
180180
"erosion": 0.0,
181181
"humidity": [
@@ -196,7 +196,7 @@
196196
"continentalness": 0.0,
197197
"depth": [
198198
0.2,
199-
0.8
199+
1.5
200200
],
201201
"erosion": 0.0,
202202
"humidity": [
@@ -235,7 +235,7 @@
235235
"continentalness": 0.0,
236236
"depth": [
237237
0.1,
238-
0.4
238+
0.7
239239
],
240240
"erosion": 0.0,
241241
"humidity": [
@@ -253,7 +253,7 @@
253253
"continentalness": 0.0,
254254
"depth": [
255255
0.4,
256-
0.7
256+
1.0
257257
],
258258
"erosion": 0.0,
259259
"humidity": [
@@ -271,7 +271,7 @@
271271
"continentalness": 0.0,
272272
"depth": [
273273
0.7,
274-
1.0
274+
1.5
275275
],
276276
"erosion": 0.0,
277277
"humidity": [

src/generated/resources/data/mia/worldgen/configured_feature/the_abyss/trees_fossilized.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,18 @@
7676
"max_inclusive": 14,
7777
"min_inclusive": 10
7878
},
79-
"weight": 3
79+
"weight": 7
8080
},
8181
{
8282
"data": 8,
83+
"weight": 2
84+
},
85+
{
86+
"data": {
87+
"type": "minecraft:uniform",
88+
"max_inclusive": 24,
89+
"min_inclusive": 16
90+
},
8391
"weight": 1
8492
}
8593
]

src/generated/resources/data/mia/worldgen/configured_feature/the_abyss/trees_fossilized_under.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,18 @@
7676
"max_inclusive": 14,
7777
"min_inclusive": 10
7878
},
79-
"weight": 3
79+
"weight": 7
8080
},
8181
{
8282
"data": 8,
83+
"weight": 2
84+
},
85+
{
86+
"data": {
87+
"type": "minecraft:uniform",
88+
"max_inclusive": 24,
89+
"min_inclusive": 16
90+
},
8391
"weight": 1
8492
}
8593
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"type": "mia:long_vines",
3+
"config": {
4+
"height": {
5+
"type": "minecraft:uniform",
6+
"max_inclusive": 16,
7+
"min_inclusive": 4
8+
}
9+
}
10+
}

src/generated/resources/data/mia/worldgen/placed_feature/the_abyss/monster_cheat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"placement": [
44
{
55
"type": "minecraft:rarity_filter",
6-
"chance": 3
6+
"chance": 2
77
},
88
{
99
"type": "minecraft:in_square"

src/generated/resources/data/mia/worldgen/placed_feature/the_abyss/vines.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2-
"feature": "minecraft:vines",
2+
"feature": "mia:the_abyss/vines",
33
"placement": [
44
{
55
"type": "minecraft:count",
66
"count": 127
77
},
8+
{
9+
"type": "minecraft:count",
10+
"count": 5
11+
},
812
{
913
"type": "minecraft:in_square"
1014
},

src/main/java/com/altnoir/mia/client/MiaClientEvents.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.altnoir.mia.client.handler.HookHandler;
77
import com.altnoir.mia.client.renderer.TheAbyssDimEffects;
88
import com.altnoir.mia.common.component.ArtifactBundleInventoryComponent;
9+
import com.altnoir.mia.compat.Mods;
910
import com.altnoir.mia.compat.ponder.MiaPonder;
1011
import com.altnoir.mia.core.event.client.*;
1112
import com.altnoir.mia.core.event.common.AbyssMobEvent;
@@ -25,11 +26,7 @@ public static void modLoad(final ModConfigEvent event) {
2526
}
2627

2728
public static void onClientSetup(final FMLClientSetupEvent event) {
28-
try {
29-
Class.forName("net.createmod.ponder.foundation.PonderIndex");
30-
PonderIndex.addPlugin(new MiaPonder());
31-
} catch (ClassNotFoundException ignored) {
32-
}
29+
Mods.PONDER.executeIfInstalled(() -> () -> PonderIndex.addPlugin(new MiaPonder()));
3330
}
3431

3532
public static void registerParticles(RegisterParticleProvidersEvent event) {
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package com.altnoir.mia.compat;
2+
3+
import net.minecraft.core.registries.BuiltInRegistries;
4+
import net.minecraft.resources.ResourceLocation;
5+
import net.minecraft.world.item.Item;
6+
import net.minecraft.world.level.block.Block;
7+
import net.neoforged.fml.loading.LoadingModList;
8+
9+
import java.util.Locale;
10+
import java.util.Optional;
11+
import java.util.function.Supplier;
12+
13+
public enum Mods {
14+
PONDER;
15+
16+
private final String id;
17+
private final boolean isLoaded;
18+
19+
Mods() {
20+
id = name().toLowerCase(Locale.ROOT);
21+
isLoaded = LoadingModList.get().getModFileById(id) != null;
22+
}
23+
24+
/**
25+
* @return the mod id
26+
*/
27+
public String id() {
28+
return id;
29+
}
30+
31+
public ResourceLocation rl(String path) {
32+
return ResourceLocation.fromNamespaceAndPath(id, path);
33+
}
34+
35+
public Block getBlock(String id) {
36+
return BuiltInRegistries.BLOCK.get(rl(id));
37+
}
38+
39+
public Item getItem(String id) {
40+
return BuiltInRegistries.ITEM.get(rl(id));
41+
}
42+
43+
44+
/**
45+
* @return a boolean of whether the mod is loaded or not based on mod id
46+
*/
47+
public boolean isLoaded() {
48+
return isLoaded;
49+
}
50+
51+
/**
52+
* Simple hook to run code if a mod is installed
53+
*
54+
* @param toRun will be run only if the mod is loaded
55+
* @return Optional.empty() if the mod is not loaded, otherwise an Optional of the return value of the given supplier
56+
*/
57+
public <T> Optional<T> runIfInstalled(Supplier<Supplier<T>> toRun) {
58+
if (isLoaded())
59+
return Optional.of(toRun.get().get());
60+
return Optional.empty();
61+
}
62+
63+
/**
64+
* Simple hook to execute code if a mod is installed
65+
*
66+
* @param toExecute will be executed only if the mod is loaded
67+
*/
68+
public void executeIfInstalled(Supplier<Runnable> toExecute) {
69+
if (isLoaded()) {
70+
toExecute.get().run();
71+
}
72+
}
73+
}

src/main/java/com/altnoir/mia/init/worldgen/MiaFeatures.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import net.minecraft.core.registries.Registries;
88
import net.minecraft.world.level.block.state.BlockState;
99
import net.minecraft.world.level.levelgen.feature.Feature;
10-
import net.minecraft.world.level.levelgen.feature.configurations.BlockColumnConfiguration;
1110
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
1211
import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration;
1312
import net.neoforged.bus.api.IEventBus;
@@ -23,6 +22,9 @@ public class MiaFeatures {
2322
public static final DeferredHolder<Feature<?>, ClusterFeature> CLUSTER = FEATURE.register(
2423
"cluster", () -> new ClusterFeature(ClusterConfiguration.CODEC)
2524
);
25+
public static final DeferredHolder<Feature<?>, LongVinesFeature> LONG_VINES = FEATURE.register(
26+
"long_vines", () -> new LongVinesFeature(LongVinesConfiguration.CODEC)
27+
);
2628
public static final DeferredHolder<Feature<?>, InvertedTreeFeature> INVERTED_TREE = FEATURE.register(
2729
"inverted_tree", () -> new InvertedTreeFeature(TreeConfiguration.CODEC)
2830
);

src/main/java/com/altnoir/mia/worldgen/biome/the_abyss/TheAbyssFeatures.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class TheAbyssFeatures {
5252
public static final ResourceKey<ConfiguredFeature<?, ?>> SPRING_WATER = theAbyssKey("spring_water");
5353
public static final ResourceKey<ConfiguredFeature<?, ?>> LAKE_WATER = theAbyssKey("lake_water");
5454
public static final ResourceKey<ConfiguredFeature<?, ?>> SUN_STONE = theAbyssKey("sun_stone");
55+
public static final ResourceKey<ConfiguredFeature<?, ?>> VINES = theAbyssKey("vines");
5556
public static final ResourceKey<ConfiguredFeature<?, ?>> GLOW_LICHEN = theAbyssKey("glow_lichen");
5657
public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_MEADOW = theAbyssKey("flower_meadow_layer1");
5758
public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_MEADOW2 = theAbyssKey("flower_meadow_layer2");
@@ -129,6 +130,8 @@ public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context)
129130
context, SUN_STONE, Feature.SIMPLE_BLOCK,
130131
new SimpleBlockConfiguration(BlockStateProvider.simple(MiaBlocks.SUN_STONE.get().defaultBlockState()))
131132
);
133+
MiaFeatureUtils.register(context, VINES, MiaFeatures.LONG_VINES.get(), new LongVinesConfiguration(UniformInt.of(4, 16)));
134+
132135
MultifaceBlock multifaceblock = (MultifaceBlock) Blocks.GLOW_LICHEN;
133136
MiaFeatureUtils.register(
134137
context, GLOW_LICHEN, Feature.MULTIFACE_GROWTH,
@@ -431,8 +434,9 @@ private static Holder<PlacedFeature> makeSmallPillar(Block block1, Block block2,
431434
BlockTrunkConfiguration.layer(
432435
new WeightedListInt(
433436
SimpleWeightedRandomList.<IntProvider>builder()
434-
.add(UniformInt.of(10, 14), 3)
435-
.add(ConstantInt.of(8), 1)
437+
.add(UniformInt.of(10, 14), 7)
438+
.add(ConstantInt.of(8), 2)
439+
.add(UniformInt.of(16, 24), 1)
436440
.build()
437441
),
438442
new WeightedStateProvider(

0 commit comments

Comments
 (0)