Skip to content

Commit 5314e4f

Browse files
SiverDXTheBv
authored andcommitted
feat: reworked worldgen
- fixed worldgen with terralith (and maybe others) - fixes #5039
1 parent eb41da6 commit 5314e4f

27 files changed

+106
-30
lines changed

src/generated/resources/data/iceandfire/worldgen/placed_feature/cyclops_cave.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:cyclops_cave",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/fire_dragon_roost.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:fire_dragon_roost",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/fire_lily.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
},
1111
{
1212
"type": "minecraft:heightmap",
13-
"heightmap": "MOTION_BLOCKING"
13+
"heightmap": "WORLD_SURFACE_WG"
1414
},
1515
{
16-
"type": "minecraft:biome"
16+
"type": "iceandfire:biome_custom"
1717
}
1818
]
1919
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/frost_lily.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
},
1111
{
1212
"type": "minecraft:heightmap",
13-
"heightmap": "MOTION_BLOCKING"
13+
"heightmap": "WORLD_SURFACE_WG"
1414
},
1515
{
16-
"type": "minecraft:biome"
16+
"type": "iceandfire:biome_custom"
1717
}
1818
]
1919
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/hydra_cave.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:hydra_cave",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/ice_dragon_roost.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:ice_dragon_roost",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/lightning_dragon_roost.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:lightning_dragon_roost",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/lightning_lily.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
},
1111
{
1212
"type": "minecraft:heightmap",
13-
"heightmap": "MOTION_BLOCKING"
13+
"heightmap": "WORLD_SURFACE_WG"
1414
},
1515
{
16-
"type": "minecraft:biome"
16+
"type": "iceandfire:biome_custom"
1717
}
1818
]
1919
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/myrmex_hive_desert.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:myrmex_hive_desert",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/myrmex_hive_jungle.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:myrmex_hive_jungle",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/pixie_village.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:pixie_village",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/siren_island.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:siren_island",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_death_worm.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_death_worm",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_dragon_skeleton_fire.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_dragon_skeleton_fire",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_dragon_skeleton_ice.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_dragon_skeleton_ice",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_dragon_skeleton_lightning.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_dragon_skeleton_lightning",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_hippocampus.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_hippocampus",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_sea_serpent.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_sea_serpent",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_stymphalian_bird.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_stymphalian_bird",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/generated/resources/data/iceandfire/worldgen/placed_feature/spawn_wandering_cyclops.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"feature": "iceandfire:spawn_wandering_cyclops",
33
"placement": [
4+
{
5+
"type": "minecraft:heightmap",
6+
"heightmap": "WORLD_SURFACE_WG"
7+
},
48
{
59
"type": "minecraft:biome"
610
}

src/main/java/com/github/alexthe666/iceandfire/datagen/IafPlacedFeatures.java

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import net.minecraft.core.HolderGetter;
44
import net.minecraft.core.registries.Registries;
55
import net.minecraft.data.worldgen.BootstapContext;
6+
import com.github.alexthe666.iceandfire.IceAndFire;
7+
import com.google.gson.JsonElement;
8+
import net.minecraft.core.Registry;
69
import net.minecraft.data.worldgen.placement.PlacementUtils;
710
import net.minecraft.resources.ResourceKey;
811
import net.minecraft.resources.ResourceLocation;

src/main/java/com/github/alexthe666/iceandfire/misc/IafTagRegistry.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import net.minecraft.resources.ResourceLocation;
44

5-
public class IafTagRegistry {
5+
public class IafTagRegistry { // FIXME :: Clean up
66
public static final ResourceLocation DRAGON_ARROWS = new ResourceLocation("iceandfire", "dragon_arrows");
77
public static final ResourceLocation MYRMEX_HARVESTABLES = new ResourceLocation("iceandfire", "myrmex_harvestables");
88
public static final ResourceLocation CHICKENS = new ResourceLocation("iceandfire", "chickens");

src/main/java/com/github/alexthe666/iceandfire/world/IafPlacementFilterRegistry.java

Whitespace-only changes.

src/main/java/com/github/alexthe666/iceandfire/world/gen/WorldGenFireDragonRoosts.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
152152
}
153153
});
154154
}
155-
return false;
155+
return false; // FIXME :: Why false
156156
}
157157

158158
private void transformState(LevelAccessor world, BlockPos blockpos, BlockState state) {

src/main/java/com/github/alexthe666/iceandfire/world/gen/mixin/MuteSetBlockFarChunk.java

-21
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.github.alexthe666.iceandfire.world.gen.mixin;
2+
3+
import com.github.alexthe666.iceandfire.IceAndFire;
4+
import net.minecraft.core.BlockPos;
5+
import net.minecraft.server.level.WorldGenRegion;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.Shadow;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
import org.spongepowered.asm.mixin.injection.Inject;
10+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
11+
12+
import javax.annotation.Nullable;
13+
import java.util.function.Supplier;
14+
15+
/** Avoid log spam for dragon caves (some blocks can exceed the writable worldgen area due to their size) */
16+
@Mixin(WorldGenRegion.class)
17+
public class WorldGenRegionMixin {
18+
@Inject(method = "ensureCanWrite", at = @At(value = "INVOKE", target = "Lnet/minecraft/Util;logAndPauseIfInIde(Ljava/lang/String;)V", shift = At.Shift.BEFORE), cancellable = true)
19+
private void skipLog(final BlockPos position, final CallbackInfoReturnable<Boolean> callback) {
20+
if (this.currentlyGenerating.get().contains(IceAndFire.MODID)) {
21+
callback.setReturnValue(false);
22+
}
23+
}
24+
25+
@Shadow @Nullable private Supplier<String> currentlyGenerating;
26+
}

src/main/resources/iceandfire.mixins.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"refmap": "iceandfire.refmap.json",
66
"mixins": [
77
"NoLakesInStructuresMixin",
8-
"MuteSetBlockFarChunk"
8+
"WorldGenRegionMixin"
99
],
1010
"client": [
1111
],

0 commit comments

Comments
 (0)