Skip to content

Commit e6a1cab

Browse files
committed
Wave 1 for port
1 parent 5e3e5b3 commit e6a1cab

File tree

13 files changed

+117
-110
lines changed

13 files changed

+117
-110
lines changed

common/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ dependencies {
1414

1515
// modCompileOnly("generations.gg.generations.core:Generations-Core-common:${project.properties["generations-core_version"]}") { isChanging = true }
1616
modImplementation("curse.maven:generations-core-860936:7303086")
17-
modCompileOnly("tech.jt-dev:MoreStructureProcessors-common:${project.properties["moreprocessors_version"]}") { isChanging = true }
17+
modApi("curse.maven:more-structure-processors-1113983:6555658")
18+
// modCompileOnly("tech.jt-dev:MoreStructureProcessors-common:${project.properties["moreprocessors_version"]}") { isChanging = true }
1819

1920
//Cobblemon
2021
modCompileOnly("com.cobblemon:mod:${project.properties["cobblemon_version"]}")

common/src/main/java/generations/gg/generations/structures/generationsstructures/GenerationsStructures.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class GenerationsStructures {
2525
public static final Logger LOGGER = LogManager.getLogger();
2626

2727
/** generations_structures config */
28-
public static final Config CONFIG = ConfigLoader.loadConfig(Config.class, "structures", "config");
28+
public static final Config CONFIG = ConfigLoader.INSTANCE.loadConfig(Config.class, "structures", "config");
2929

3030
/**
3131
* Initializes the Generations-Structures mod.

common/src/main/java/generations/gg/generations/structures/generationsstructures/processors/GenerationsProcessorLists.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public class GenerationsProcessorLists {
3939
new SameStateCompatRuleProcessor(
4040
ImmutableList.of(
4141
new SameStateCompatProcessorRule(new BlockMatchTest(Blocks.BIRCH_TRAPDOOR), BWGWood.WITCH_HAZEL.trapdoor()),
42-
new SameStateCompatProcessorRule(new BlockMatchTest(GenerationsWood.GHOST_TRAPDOOR.get()), BWGWood.EBONY.trapdoor()),
43-
new SameStateCompatProcessorRule(new BlockMatchTest(GenerationsWood.GHOST_TRAPDOOR.get()), BOPBlocks.HELLBARK_TRAPDOOR)
42+
new SameStateCompatProcessorRule(new BlockMatchTest(GenerationsWood.INSTANCE.getGHOST_TRAPDOOR().value()), BWGWood.EBONY.trapdoor()),
43+
new SameStateCompatProcessorRule(new BlockMatchTest(GenerationsWood.INSTANCE.getGHOST_TRAPDOOR().value()), BOPBlocks.HELLBARK_TRAPDOOR)
4444
)
4545
)
4646
)));
@@ -107,12 +107,12 @@ public class GenerationsProcessorLists {
107107
public static final ResourceKey<StructureProcessorList> REGI_SHRINE_PROCESSOR_LIST = register("shrines/regi", context -> new StructureProcessorList(ImmutableList.of(
108108
new RuleProcessor(
109109
ImmutableList.of(
110-
new ProcessorRule(new RandomBlockMatchTest(Blocks.CALCITE, 0.5f), AlwaysTrueTest.INSTANCE, GenerationsBlocks.BLEACH_STONE_SET.getBaseBlock().defaultBlockState())
110+
new ProcessorRule(new RandomBlockMatchTest(Blocks.CALCITE, 0.5f), AlwaysTrueTest.INSTANCE, GenerationsBlocks.INSTANCE.getBLEACH_STONE_SET().getBaseBlock().defaultBlockState())
111111
)
112112
),
113113
new SameStateRuleProcessor(
114114
ImmutableList.of(
115-
new SameStateProcessorRule(new RandomBlockMatchTest(Blocks.DIORITE_WALL, 0.5f), GenerationsBlocks.BLEACH_STONE_SET.getWall())
115+
new SameStateProcessorRule(new RandomBlockMatchTest(Blocks.DIORITE_WALL, 0.5f), GenerationsBlocks.INSTANCE.getBLEACH_STONE_SET().getWall())
116116
)
117117
)
118118
)));
@@ -282,8 +282,8 @@ public class GenerationsProcessorLists {
282282
public static final ResourceKey<StructureProcessorList> MEOWTH_BALLOON_PROCESSOR_LIST = register("meowth_balloon", context -> new StructureProcessorList(ImmutableList.of(
283283
new SameStateRuleProcessor(
284284
ImmutableList.of(
285-
new SameStateProcessorRule(new RandomBlockMatchTest(GenerationsUtilityBlocks.WING_BALL_LOOT.getOrNull(), 0.33f), AlwaysTrueTest.INSTANCE, GenerationsUtilityBlocks.LEVEL_BALL_LOOT.getOrNull()),
286-
new SameStateProcessorRule(new RandomBlockMatchTest(GenerationsUtilityBlocks.WING_BALL_LOOT.getOrNull(), 0.5f), AlwaysTrueTest.INSTANCE, GenerationsUtilityBlocks.JET_BALL_LOOT.getOrNull())
285+
new SameStateProcessorRule(new RandomBlockMatchTest(GenerationsUtilityBlocks.INSTANCE.getWING_BALL_LOOT().value(), 0.33f), AlwaysTrueTest.INSTANCE, GenerationsUtilityBlocks.INSTANCE.getLEVEL_BALL_LOOT().value()),
286+
new SameStateProcessorRule(new RandomBlockMatchTest(GenerationsUtilityBlocks.INSTANCE.getWING_BALL_LOOT().value(), 0.5f), AlwaysTrueTest.INSTANCE, GenerationsUtilityBlocks.INSTANCE.getJET_BALL_LOOT().value())
287287
)
288288
)
289289
)));

common/src/main/java/generations/gg/generations/structures/generationsstructures/structures/GenerationsStructureSettings.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import net.minecraft.core.Holder;
88
import net.minecraft.core.HolderSet;
99
import net.minecraft.core.registries.Registries;
10-
import net.minecraft.data.worldgen.BootstapContext;
10+
import net.minecraft.data.worldgen.BootstrapContext;
1111
import net.minecraft.data.worldgen.Structures;
1212
import net.minecraft.resources.ResourceKey;
1313
import net.minecraft.resources.ResourceLocation;
@@ -142,12 +142,13 @@ public class GenerationsStructureSettings {
142142
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.ISLANDS), 1,
143143
UniformHeight.of(VerticalAnchor.absolute(150), VerticalAnchor.belowTop(100)), false));
144144

145-
private static JigsawStructure createJigsaw(Structure.StructureSettings settings, Holder<StructureTemplatePool> startPool,
146-
Optional<ResourceLocation> startJigsawName, int maxDepth,
147-
HeightProvider startHeight, boolean useExpansionHack,
148-
Optional<Heightmap.Types> projectStartToHeightmap, int maxDistanceToCenter){
149-
return new JigsawStructure(settings, startPool, startJigsawName, maxDepth, startHeight, useExpansionHack, projectStartToHeightmap, maxDistanceToCenter);
150-
}
145+
// TODO: REadd if needed.
146+
// private static JigsawStructure createJigsaw(Structure.StructureSettings settings, Holder<StructureTemplatePool> startPool,
147+
// Optional<ResourceLocation> startJigsawName, int maxDepth,
148+
// HeightProvider startHeight, boolean useExpansionHack,
149+
// Optional<Heightmap.Types> projectStartToHeightmap, int maxDistanceToCenter){
150+
// return new JigsawStructure(settings, startPool, startJigsawName, maxDepth, startHeight, useExpansionHack, projectStartToHeightmap, maxDistanceToCenter);
151+
// }
151152

152153
private static JigsawStructure createJigsaw(Structure.StructureSettings settings, Holder<StructureTemplatePool> startPool, int maxDepth,
153154
HeightProvider startHeight, boolean useExpansionHack){
@@ -159,7 +160,7 @@ private static JigsawStructure createJigsaw(Structure.StructureSettings settings
159160
return new JigsawStructure(settings, startPool, maxDepth, startHeight, false, projectStartToHeightmap);
160161
}
161162

162-
private static JigsawStructure balloonJigsawStructure(BootstapContext<Structure> context, ResourceKey<StructureTemplatePool> templatePool, TagKey<Biome> biomeTag){
163+
private static JigsawStructure balloonJigsawStructure(BootstrapContext<Structure> context, ResourceKey<StructureTemplatePool> templatePool, TagKey<Biome> biomeTag){
163164
return createJigsaw(new Structure.StructureSettings(context.lookup(Registries.BIOME).getOrThrow(biomeTag), Map.of(), GenerationStep.Decoration.SURFACE_STRUCTURES, TerrainAdjustment.NONE),
164165
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(templatePool), 1, BiasedToBottomHeight.of(VerticalAnchor.absolute(80), VerticalAnchor.belowTop(135), 1), Heightmap.Types.WORLD_SURFACE_WG);
165166
}
@@ -171,20 +172,20 @@ private static ResourceKey<Structure> register(String id, StructureFactory facto
171172
}
172173

173174
private static Structure.StructureSettings structure(HolderSet<Biome> tag, TerrainAdjustment adj) {
174-
return Structures.structure(tag, Map.of(), GenerationStep.Decoration.SURFACE_STRUCTURES, adj);
175+
return new Structure.StructureSettings(tag, Map.of(), GenerationStep.Decoration.SURFACE_STRUCTURES, adj);
175176
}
176177

177178
private static Structure.StructureSettings structure(HolderSet<Biome> tag, Map<MobCategory, StructureSpawnOverride> spawnOverrides, TerrainAdjustment adj) {
178-
return Structures.structure(tag, spawnOverrides, GenerationStep.Decoration.SURFACE_STRUCTURES, adj);
179+
return new Structure.StructureSettings(tag, spawnOverrides, GenerationStep.Decoration.SURFACE_STRUCTURES, adj);
179180
}
180181

181182
private static Structure.StructureSettings structure(HolderSet<Biome> tag, GenerationStep.Decoration decoration, TerrainAdjustment adj) {
182-
return Structures.structure(tag, Map.of(), decoration, adj);
183+
return new Structure.StructureSettings(tag, Map.of(), decoration, adj);
183184
}
184185

185186
@FunctionalInterface
186187
public interface StructureFactory {
187-
Structure generate(BootstapContext<Structure> structureFactoryBootstapContext);
188+
Structure generate(BootstrapContext<Structure> structureFactoryBootstapContext);
188189
}
189190

190191
public static void structures() {

common/src/main/java/generations/gg/generations/structures/generationsstructures/village/VanillaVillages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public String getName() {
5858
}
5959

6060
public @NotNull ResourceKey<StructureTemplatePool> getVillagePool(String pool) {
61-
return ResourceKey.create(Registries.TEMPLATE_POOL, new ResourceLocation("village/plains/" + pool));
61+
return ResourceKey.create(Registries.TEMPLATE_POOL, ResourceLocation.parse("village/plains/" + pool));
6262
}
6363

6464
private static final VanillaVillages[] VALUES = values();

common/src/main/java/generations/gg/generations/structures/generationsstructures/worldgen/template_pool/GenerationsTemplatePools.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
1111
import net.minecraft.core.Holder;
1212
import net.minecraft.core.registries.Registries;
13-
import net.minecraft.data.worldgen.BootstapContext;
13+
import net.minecraft.data.worldgen.BootstrapContext;
1414
import net.minecraft.data.worldgen.Pools;
1515
import net.minecraft.data.worldgen.ProcessorLists;
1616
import net.minecraft.resources.ResourceKey;
@@ -124,27 +124,27 @@ public class GenerationsTemplatePools {
124124
public static final ResourceKey<StructureTemplatePool> TAIGA_VILLAGE_POKEMART = create("village/taiga/pokemart"); */
125125

126126

127-
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstapContext<StructureTemplatePool> context, ResourceKey<Structure> structure) {
127+
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstrapContext<StructureTemplatePool> context, ResourceKey<Structure> structure) {
128128
return createPoolElement(context, structure, 1);
129129
}
130130

131-
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstapContext<StructureTemplatePool> context, ResourceKey<Structure> structure, int weight) {
131+
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstrapContext<StructureTemplatePool> context, ResourceKey<Structure> structure, int weight) {
132132
return Pair.of(StructurePoolElement.single(structure.location().toString(), getEmptyProcessor(context)), weight);
133133
}
134134

135-
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstapContext<StructureTemplatePool> context, ResourceKey<Structure> structure, ResourceKey<StructureProcessorList> processor) {
135+
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstrapContext<StructureTemplatePool> context, ResourceKey<Structure> structure, ResourceKey<StructureProcessorList> processor) {
136136
return createPoolElement(context, structure, processor, 1);
137137
}
138138

139-
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstapContext<StructureTemplatePool> context, ResourceKey<Structure> structure, ResourceKey<StructureProcessorList> processor, int weight) {
139+
private static Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer> createPoolElement(BootstrapContext<StructureTemplatePool> context, ResourceKey<Structure> structure, ResourceKey<StructureProcessorList> processor, int weight) {
140140
return Pair.of(StructurePoolElement.single(structure.location().toString(), getProcessor(context, processor)), weight);
141141
}
142142

143143
private static StructureTemplatePool createTemplatePool(Holder<StructureTemplatePool> fallback, List<Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer>> rawTemplateFactories, StructureTemplatePool.Projection projection) {
144144
return new StructureTemplatePool(fallback, rawTemplateFactories, projection);
145145
}
146146

147-
private static StructureTemplatePool createTemplatePool(BootstapContext<StructureTemplatePool> context, List<Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer>> rawTemplateFactories) {
147+
private static StructureTemplatePool createTemplatePool(BootstrapContext<StructureTemplatePool> context, List<Pair<Function<StructureTemplatePool.Projection, ? extends StructurePoolElement>, Integer>> rawTemplateFactories) {
148148
return new StructureTemplatePool(getPool(context, Pools.EMPTY), rawTemplateFactories, StructureTemplatePool.Projection.RIGID);
149149
}
150150

@@ -174,22 +174,22 @@ private static ResourceKey<StructureTemplatePool> create(String name) {
174174
return GenerationsStructures.key(Registries.TEMPLATE_POOL, name);
175175
}
176176

177-
private static Holder.Reference<StructureProcessorList> getProcessor(BootstapContext<StructureTemplatePool> context, ResourceKey<StructureProcessorList> processorList) {
177+
private static Holder.Reference<StructureProcessorList> getProcessor(BootstrapContext<StructureTemplatePool> context, ResourceKey<StructureProcessorList> processorList) {
178178
return context.lookup(Registries.PROCESSOR_LIST).getOrThrow(processorList);
179179
}
180180

181-
private static Holder.Reference<StructureTemplatePool> getPool(BootstapContext<StructureTemplatePool> context, ResourceKey<StructureTemplatePool> poolResourceKey) {
181+
private static Holder.Reference<StructureTemplatePool> getPool(BootstrapContext<StructureTemplatePool> context, ResourceKey<StructureTemplatePool> poolResourceKey) {
182182
return context.lookup(Registries.TEMPLATE_POOL).getOrThrow(poolResourceKey);
183183
}
184184

185-
private static Holder.Reference<StructureProcessorList> getEmptyProcessor(BootstapContext<StructureTemplatePool> context) {
185+
private static Holder.Reference<StructureProcessorList> getEmptyProcessor(BootstrapContext<StructureTemplatePool> context) {
186186
return context.lookup(Registries.PROCESSOR_LIST).getOrThrow(ProcessorLists.EMPTY);
187187
}
188188

189189

190190
@FunctionalInterface
191191
public interface TemplatePoolFactory {
192-
StructureTemplatePool generate(BootstapContext<StructureTemplatePool> templatePoolFactoryContext);
192+
StructureTemplatePool generate(BootstrapContext<StructureTemplatePool> templatePoolFactoryContext);
193193
}
194194

195195
public static void templatePools() {

fabric/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ dependencies {
4949
modApi("com.cobblemon:fabric:${project.properties["cobblemon_version"]}")
5050
modRuntimeOnly("net.fabricmc:fabric-language-kotlin:1.13.1+kotlin.2.1.10")
5151

52-
modApi("tech.jt-dev:MoreStructureProcessors-fabric:${project.properties["moreprocessors_version"]}") { isChanging = true }
52+
modApi("curse.maven:more-structure-processors-1113983:6555658")
53+
// modApi("tech.jt-dev:MoreStructureProcessors-fabric:${project.properties["moreprocessors_version"]}") { isChanging = true }
5354

5455
//BiomeMod Integration
5556
modLocalRuntime("com.github.glitchfiend:TerraBlender-fabric:$minecraftVersion-${project.properties["terrablender_version"]}")
5657
modApi("net.potionstudios:Oh-The-Biomes-Weve-Gone-Fabric:${project.properties["BWG_version"]}")
5758
modApi("com.github.glitchfiend:BiomesOPlenty-fabric:$minecraftVersion-${project.properties["BOP_version"]}")
58-
modLocalRuntime("com.github.glitchfiend:GlitchCore-fabric:$minecraftVersion-${project.properties["GlitchCore_version"]}")
59+
modLocalRuntime("curse.maven:glitchcore-955399:5660741")
60+
// modLocalRuntime("com.github.glitchfiend:GlitchCore-fabric:$minecraftVersion-${project.properties["GlitchCore_version"]}")
5961
}
6062

6163
tasks {

fabric/src/main/resources/fabric.mod.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
],
3030
"depends": {
3131
"fabric": "*",
32-
"minecraft": ">=1.20.1",
33-
"generations_core": ">=1.0.0",
34-
"cobblemon": "1.5.2+1.20.1",
35-
"moreprocessors": ">=1.2.0"
32+
"minecraft": ">=1.21.1",
33+
"generations_core": ">=1.2.1-1.7.1",
34+
"cobblemon": "1.7.1+1.21.1",
35+
"moreprocessors": ">=2.0.1"
3636
},
3737
"suggests": {
38-
"biomeswevegone": ">=1.2.3",
39-
"biomesoplenty": ">=19.0.0.91"
38+
"biomeswevegone": ">=2.5.1",
39+
"biomesoplenty": ">=21.1.0.13"
4040
},
4141
"custom": {
4242
"modmenu": {

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G -Ddevauth.enabled=true
33
minecraft_version=1.21.1
44

55
archives_base_name=Generations-Structures
6-
mod_version=1.1.0
6+
mod_version=1.2.0
77
maven_group=generations.gg.generations.structures.generationsstructures
88

99
fabric_loader_version=0.17.2
@@ -17,7 +17,7 @@ generations-core_version=1.0.0-maven
1717
architectury_version=9.2.14
1818
botarium_version=2.3.4
1919
devauth_version=1.2.1
20-
cobblemon_version=1.7.0+1.21.1
20+
cobblemon_version=1.7.1+1.21.1
2121
moreprocessors_version=2.0.1
2222

2323
terrablender_version=4.1.0.7

neoforge/build.gradle.kts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ configurations {
2323
create("shadowBundle")
2424
compileClasspath.get().extendsFrom(configurations["common"])
2525
runtimeClasspath.get().extendsFrom(configurations["common"])
26-
getByName("developmentForge").extendsFrom(configurations["common"])
26+
getByName("developmentNeoForge").extendsFrom(configurations["common"])
2727
"shadowBundle" {
2828
isCanBeResolved = true
2929
isCanBeConsumed = false
@@ -49,12 +49,11 @@ loom {
4949

5050
repositories {
5151
maven("https://thedarkcolour.github.io/KotlinForForge/")
52+
mavenCentral()
5253
}
5354

5455
dependencies {
55-
if ((project.properties["use_neoforge"] as String).toBoolean())
56-
forge("net.neoforged:forge:$minecraftVersion-${project.properties["neoforge_version"]}")
57-
else forge("net.minecraftforge:forge:$minecraftVersion-${project.properties["forge_version"]}")
56+
neoForge("net.neoforged:neoforge:${project.properties["neoforge_version"]}")
5857

5958
"common"(project(":common", "namedElements")) { isTransitive = false }
6059
"shadowBundle"(project(":common", "transformProductionForge"))
@@ -63,18 +62,20 @@ dependencies {
6362

6463
// Generations-Core Forge
6564
// modApi("generations.gg.generations.core:Generations-Core-forge:${project.properties["generations-core_version"]}@jar") { isChanging = true }
66-
modApi(implementation("curse.maven:generations-core-860936:7305007"))
65+
modApi("curse.maven:generations-core-860936:7305007")
6766

6867
//Cobblemon
6968
implementation("thedarkcolour:kotlinforforge-neoforge:5.5.0")
7069
modApi("com.cobblemon:neoforge:${project.properties["cobblemon_version"]}")
7170

72-
modApi("tech.jt-dev:MoreStructureProcessors-neoforgeforge:${project.properties["moreprocessors_version"]}") { isChanging = true }
71+
modApi("curse.maven:more-structure-processors-1113983:6555660")
72+
// modApi("tech.jt-dev:MoreStructureProcessors-neoforgeforge:${project.properties["moreprocessors_version"]}") { isChanging = true }
7373

7474
//BiomeMod Integration
7575
modLocalRuntime("com.github.glitchfiend:TerraBlender-neoforge:$minecraftVersion-${project.properties["terrablender_version"]}")
7676
modCompileOnly("com.github.glitchfiend:BiomesOPlenty-neoforge:$minecraftVersion-${project.properties["BOP_version"]}")
77-
modLocalRuntime("com.github.glitchfiend:GlitchCore-neoforge:$minecraftVersion-${project.properties["GlitchCore_version"]}")
77+
modLocalRuntime("curse.maven:glitchcore-955399:5660740")
78+
// modLocalRuntime("com.github.glitchfiend:GlitchCore-neoforge:$minecraftVersion-${project.properties["GlitchCore_version"]}")
7879
modRuntimeOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
7980
modApi("net.potionstudios:Oh-The-Biomes-Weve-Gone-NeoForge:${project.properties["BWG_version"]}")
8081
implementation("com.eliotlash.mclib:mclib:20")

0 commit comments

Comments
 (0)