-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move generated datapack dimensions manually for now
- Loading branch information
1 parent
3601a7b
commit 92d59b6
Showing
8 changed files
with
83 additions
and
46 deletions.
There are no files selected for viewing
31 changes: 0 additions & 31 deletions
31
Forge/src/main/kotlin/possible_triangle/skygrid/data/generation/DataGenerator.kt
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
Forge/src/main/kotlin/possible_triangle/skygrid/data/generation/DataGenerators.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package possible_triangle.skygrid.data.generation | ||
|
||
import kotlinx.serialization.ExperimentalSerializationApi | ||
import net.minecraft.data.DataGenerator | ||
import net.minecraft.data.DataProvider | ||
import net.minecraftforge.common.data.ExistingFileHelper | ||
import net.minecraftforge.eventbus.api.SubscribeEvent | ||
import net.minecraftforge.fml.common.Mod | ||
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent | ||
import nl.adaptivity.xmlutil.ExperimentalXmlUtilApi | ||
import possible_triangle.skygrid.data.generation.dimensions.* | ||
|
||
@ExperimentalXmlUtilApi | ||
@ExperimentalSerializationApi | ||
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) | ||
object DataGenerators { | ||
|
||
@SubscribeEvent | ||
fun register(event: GatherDataEvent) { | ||
event.includeDev() | ||
|
||
fun DataGenerator.addProvider(factory: (DataGenerator) -> DataProvider) { | ||
addProvider(factory(this)) | ||
} | ||
|
||
fun DataGenerator.addProvider( | ||
factory: (DataGenerator) -> DimensionConfigGenerator, | ||
datapack: String?, | ||
) { | ||
factory(this).also { | ||
it.datapack = datapack | ||
addProvider(it) | ||
} | ||
} | ||
|
||
fun DataGenerator.addProvider(factory: (DataGenerator, ExistingFileHelper) -> DataProvider) { | ||
addProvider(factory(this, event.existingFileHelper)) | ||
} | ||
|
||
if (event.includeServer()) { | ||
event.generator.addProvider(::SkygridTags) | ||
event.generator.addProvider(::Presets) | ||
event.generator.addProvider(::Overworld) | ||
event.generator.addProvider(::Nether) | ||
event.generator.addProvider(::End) | ||
|
||
event.generator.addProvider(::Cave, "custom-examples") | ||
event.generator.addProvider(::Aqua, "custom-examples") | ||
} | ||
} | ||
|
||
} |
6 changes: 0 additions & 6 deletions
6
Forge/src/main/kotlin/possible_triangle/skygrid/data/generation/DatapackGenerator.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
datapacks/custom-examples/data/skygrid/skygrid/dimensions/aqua.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<dimension> | ||
<blocks> | ||
<reference id="ocean"/> | ||
</blocks> | ||
<gap id="water"/> | ||
</dimension> |
18 changes: 18 additions & 0 deletions
18
datapacks/custom-examples/data/skygrid/skygrid/dimensions/cave.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<dimension> | ||
<blocks> | ||
<reference id="ores" weight="0.1"/> | ||
<reference id="dripstone" weight="0.1"/> | ||
<reference id="moss" weight="0.05"/> | ||
<block id="obsidian" weight="0.1"/> | ||
<list weight="0.05" name="fluids"> | ||
<block id="lava"/> | ||
<block id="water"/> | ||
</list> | ||
<tag id="base_stone_overworld"> | ||
<side on="up" probability="0.1"> | ||
<block id="glow_shroom" mod="quark"/> | ||
</side> | ||
</tag> | ||
</blocks> | ||
<distance x="3" y="3" z="3"/> | ||
</dimension> |