Ore worldgen json datagen
Used to place a configuredfeature, tele jigsaw, template or st'ructure at a given location. ☎️ 🧩 😤 🛣️ 😵 💭 ✨ 🏗️ ⚙️ 🧩 🌎 ⏳ 🧮 🇯 🌞 ☎️ 🧩 😤 🛣️ 😵 💭 ✨ 🏗️ ⚙️ 🧩 🌎 ⏳ 🧮 🇯 🌞 ☎️ 🧩 😤 🛣️ 😵 💭 ✨ 🏗️ ⚙️ 🧩 🌎 ⏳ 🧮 🇯 🌞 ☎️ 🧩 😤 🛣️ 😵 💭 ✨ 🏗️ ⚙️ 🧩 🌎 ⏳ 🧮 🇯 🌞 When the dev team was programming telepathicgrunt, they realized that there was a potential to create something similar inside the tele, causing recursion until the jigsaw crashed. To fix this, they capped the injigsaw grunt available at 2^512 pathics, forcing anything telepathic to be less complex than telepathicgrunt and preventing crashes. Let’s dissect tele jigsaw grunt pathic telepathic st’ructure worldgenjson. Starting from the beginning, tele implies that the whole has remote control capabilities, such as telepathy or telekinesis. Next, jigsaw implies multiple pieces that can be slotted together and rearranged. A grunt is simply a particular sound generated by an animal, implying that it is capable of creating noise. Pathic, similar to pathos, implies that it can affect emotions in some way. Following this, we have the even more direct telepathic, implying it is capable of reading thoughts and emotions. St’ructure is more difficult because the part after the apostrophe must be abbreviated, meaning it is likely two words, “stereospecific technostructure”. This implies it is a synthetic construct with a specific arrangement, meaning it could be a program. With this context in mind, processorjigsaw makes sense: it’s capable of rearranging its components and editing its code. Finally, worldgenjson could mean that it has some ability to manipulate reality through JSON. With all this in mind, I present my theory. tele jigsaw grunt pathic telepathic st’ructure processorjigsaw worldgenjson is a sapient, self-editing AI with telepathic and ontokinetic abilities. Due to its synthetic nature, it is interested in studying the behavior of humans, and using its abilities, created and spread an inside joke within the MCDrama server, giving it its own name in an act of vanity.
This commit is contained in:
parent
3d9bc21a6f
commit
5d0b2c9f7e
@ -442,6 +442,8 @@ object DataGen {
|
||||
event.generator.addProvider(event.includeServer(), advancementProvider)
|
||||
event.generator.addProvider(event.includeServer(), matterData)
|
||||
|
||||
registerOreGen(event)
|
||||
|
||||
AddEnglishLanguage(languageProvider)
|
||||
|
||||
for ((color, door) in MBlocks.TRITANIUM_DOOR)
|
||||
|
@ -1,11 +1,8 @@
|
||||
package ru.dbotthepony.mc.otm.datagen
|
||||
|
||||
import com.google.gson.JsonArray
|
||||
import com.google.gson.JsonObject
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.properties.Property
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
fun Direction.toYRotBlockstate(): Int {
|
||||
return when (this) {
|
||||
|
93
src/data/kotlin/ru/dbotthepony/mc/otm/datagen/OreGen.kt
Normal file
93
src/data/kotlin/ru/dbotthepony/mc/otm/datagen/OreGen.kt
Normal file
@ -0,0 +1,93 @@
|
||||
package ru.dbotthepony.mc.otm.datagen
|
||||
|
||||
import com.mojang.serialization.JsonOps
|
||||
import net.minecraft.core.Holder
|
||||
import net.minecraft.core.HolderOwner
|
||||
import net.minecraft.core.registries.Registries
|
||||
import net.minecraft.resources.RegistryOps
|
||||
import net.minecraft.resources.ResourceKey
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.server.packs.PackType
|
||||
import net.minecraft.tags.BlockTags
|
||||
import net.minecraft.world.level.levelgen.VerticalAnchor
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature
|
||||
import net.minecraft.world.level.levelgen.feature.Feature
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration
|
||||
import net.minecraft.world.level.levelgen.placement.CountPlacement
|
||||
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement
|
||||
import net.minecraft.world.level.levelgen.placement.InSquarePlacement
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest
|
||||
import net.minecraftforge.common.data.JsonCodecProvider
|
||||
import net.minecraftforge.data.event.GatherDataEvent
|
||||
import ru.dbotthepony.mc.otm.registry.MBlocks
|
||||
|
||||
private object Owner : HolderOwner<Nothing> {
|
||||
override fun canSerializeIn(p_255875_: HolderOwner<Nothing>): Boolean {
|
||||
return true // because we can always reference things, even if they are not "registered" at this moment
|
||||
}
|
||||
}
|
||||
|
||||
private data class Both<T>(val key: Holder<T>, val value: Holder<T>)
|
||||
|
||||
private fun <T> createHolders(key: ResourceKey<T>, value: T): Both<T> {
|
||||
val keyOnly = Holder.Reference.createStandAlone(Owner as HolderOwner<T>, key)
|
||||
val valueOnly = Holder.direct(value)
|
||||
return Both(keyOnly, valueOnly)
|
||||
}
|
||||
|
||||
private fun <T> remap(vararg input: Both<T>): Map<ResourceLocation, Holder<T>> {
|
||||
val result = LinkedHashMap<ResourceLocation, Holder<T>>()
|
||||
|
||||
for (value in input) {
|
||||
result[value.key.unwrapKey().get().location()] = value.value
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
fun registerOreGen(event: GatherDataEvent) {
|
||||
val stone = TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES)
|
||||
val deepslate = TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES)
|
||||
|
||||
val target by lazy {
|
||||
listOf(
|
||||
OreConfiguration.target(stone, MBlocks.TRITANIUM_ORE.defaultBlockState()),
|
||||
OreConfiguration.target(deepslate, MBlocks.DEEPSLATE_TRITANIUM_ORE.defaultBlockState()),
|
||||
)
|
||||
}
|
||||
|
||||
val ops = RegistryOps.create(JsonOps.INSTANCE, event.lookupProvider.join())
|
||||
val tritanium = createHolders(ResourceKey.create(Registries.CONFIGURED_FEATURE, modLocation("ore_tritanium")), ConfiguredFeature(Feature.ORE, OreConfiguration(target, 9)))
|
||||
val configuredFeatures = remap(tritanium)
|
||||
|
||||
event.generator.addProvider(event.includeServer(), JsonCodecProvider(
|
||||
event.generator.packOutput, event.existingFileHelper, DataGen.MOD_ID, ops,
|
||||
PackType.SERVER_DATA, "worldgen/configured_feature", ConfiguredFeature.CODEC, configuredFeatures
|
||||
))
|
||||
|
||||
val placedTritanium = createHolders(ResourceKey.create(Registries.PLACED_FEATURE, modLocation("normal_tritanium")), PlacedFeature(
|
||||
tritanium.key,
|
||||
listOf(
|
||||
CountPlacement.of(8),
|
||||
InSquarePlacement.spread(),
|
||||
HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(50))
|
||||
)
|
||||
))
|
||||
|
||||
val placedTritaniumDeep = createHolders(ResourceKey.create(Registries.PLACED_FEATURE, modLocation("deep_tritanium")), PlacedFeature(
|
||||
tritanium.key,
|
||||
listOf(
|
||||
CountPlacement.of(10),
|
||||
InSquarePlacement.spread(),
|
||||
HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(8), VerticalAnchor.absolute(0))
|
||||
)
|
||||
))
|
||||
|
||||
val placedFeatures = remap(placedTritanium, placedTritaniumDeep)
|
||||
|
||||
event.generator.addProvider(event.includeServer(), JsonCodecProvider(
|
||||
event.generator.packOutput, event.existingFileHelper, DataGen.MOD_ID, ops,
|
||||
PackType.SERVER_DATA, "worldgen/placed_feature", PlacedFeature.CODEC, placedFeatures
|
||||
))
|
||||
}
|
@ -44,7 +44,6 @@ import ru.dbotthepony.mc.otm.matter.MatterManager;
|
||||
import ru.dbotthepony.mc.otm.network.*;
|
||||
import ru.dbotthepony.mc.otm.registry.*;
|
||||
import ru.dbotthepony.mc.otm.storage.*;
|
||||
import ru.dbotthepony.mc.otm.worldgen.OreGen;
|
||||
|
||||
import static net.minecraftforge.common.MinecraftForge.EVENT_BUS;
|
||||
|
||||
@ -181,8 +180,6 @@ public final class OverdriveThatMatters {
|
||||
if (ModList.get().isLoaded("mekanism")) {
|
||||
EVENT_BUS.addGenericListener(BlockEntity.class, EventPriority.NORMAL, QIOKt::attachCapabilities);
|
||||
}
|
||||
|
||||
OreGen.INSTANCE.register();
|
||||
}
|
||||
|
||||
private void setupClient(final FMLClientSetupEvent event) {
|
||||
|
@ -32,19 +32,19 @@ private fun <T> DeferredRegister<T>.doColored(prefix: String, factory: (color: D
|
||||
)
|
||||
}
|
||||
|
||||
fun <T> DeferredRegister<T>.colored(prefix: String, factory: (color: DyeColor, name: String) -> T): Map<DyeColor, T> {
|
||||
internal fun <T> DeferredRegister<T>.colored(prefix: String, factory: (color: DyeColor, name: String) -> T): Map<DyeColor, T> {
|
||||
return SupplierMap(doColored(prefix, factory))
|
||||
}
|
||||
|
||||
@Suppress("unchecked_cast")
|
||||
fun <T> DeferredRegister<T>.allColored(prefix: String, factory: (color: DyeColor?, name: String) -> T): Map<DyeColor?, T> {
|
||||
internal fun <T> DeferredRegister<T>.allColored(prefix: String, factory: (color: DyeColor?, name: String) -> T): Map<DyeColor?, T> {
|
||||
return SupplierMap(doColored(prefix, factory).also { (it as MutableCollection<Pair<DyeColor?, () -> T>>).add((null as DyeColor?) to register(prefix) { factory.invoke(null, prefix) }::get) })
|
||||
}
|
||||
|
||||
fun <T> Registry<T>.register(key: String, value: T): Holder<T> {
|
||||
internal fun <T> Registry<T>.register(key: String, value: T): Holder<T> {
|
||||
return this.register(ResourceLocation(OverdriveThatMatters.MOD_ID, key), value)
|
||||
}
|
||||
|
||||
fun <T> Registry<T>.register(key: ResourceLocation, value: T): Holder<T> {
|
||||
internal fun <T> Registry<T>.register(key: ResourceLocation, value: T): Holder<T> {
|
||||
return (this as WritableRegistry<T>).register(ResourceKey.create(key(), key), value, Lifecycle.stable())
|
||||
}
|
||||
|
@ -1,59 +0,0 @@
|
||||
package ru.dbotthepony.mc.otm.worldgen
|
||||
|
||||
import net.minecraft.core.Holder
|
||||
import net.minecraft.core.registries.BuiltInRegistries
|
||||
import net.minecraft.core.registries.Registries
|
||||
import net.minecraft.data.worldgen.features.OreFeatures
|
||||
import net.minecraft.tags.BlockTags
|
||||
import net.minecraft.world.level.levelgen.VerticalAnchor
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature
|
||||
import net.minecraft.world.level.levelgen.feature.Feature
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration
|
||||
import net.minecraft.world.level.levelgen.placement.CountPlacement
|
||||
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement
|
||||
import net.minecraft.world.level.levelgen.placement.InSquarePlacement
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest
|
||||
import ru.dbotthepony.mc.otm.registry.MBlocks
|
||||
import ru.dbotthepony.mc.otm.core.WriteOnce
|
||||
import ru.dbotthepony.mc.otm.registry.register
|
||||
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
object OreGen {
|
||||
private val STONE_ORE_REPLACEABLES = TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES)
|
||||
private val DEEPSLATE_ORE_REPLACEABLES = TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES)
|
||||
|
||||
val ORE_TRITANIUM_TARGET_LIST = listOf(
|
||||
OreConfiguration.target(STONE_ORE_REPLACEABLES, MBlocks.TRITANIUM_ORE.defaultBlockState())!!,
|
||||
OreConfiguration.target(DEEPSLATE_ORE_REPLACEABLES, MBlocks.DEEPSLATE_TRITANIUM_ORE.defaultBlockState())!!,
|
||||
)
|
||||
|
||||
var ORE_FEATURE_TRITANIUM_NORMAL by WriteOnce<Holder<ConfiguredFeature<*, *>>>()
|
||||
var ORE_TRITANIUM_NORMAL by WriteOnce<Holder<PlacedFeature>>()
|
||||
var ORE_TRITANIUM_DEEP by WriteOnce<Holder<PlacedFeature>>()
|
||||
|
||||
fun register() {
|
||||
// TODO: 1.19.3
|
||||
/*val registry = BuiltInRegistries.REGISTRY.get(Registries.CONFIGURED_FEATURE.location())
|
||||
|
||||
ORE_FEATURE_TRITANIUM_NORMAL = CONFIGURED_FEATURE.register("ore_tritanium", ConfiguredFeature(Feature.ORE, OreConfiguration(ORE_TRITANIUM_TARGET_LIST, 9)))
|
||||
|
||||
ORE_TRITANIUM_NORMAL = PLACED_FEATURE.register("ore_tritanium_normal", PlacedFeature(
|
||||
ORE_FEATURE_TRITANIUM_NORMAL,
|
||||
listOf(
|
||||
CountPlacement.of(8),
|
||||
InSquarePlacement.spread(),
|
||||
HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(50))
|
||||
)
|
||||
))
|
||||
|
||||
ORE_TRITANIUM_DEEP = PLACED_FEATURE.register("ore_tritanium_deep", PlacedFeature(
|
||||
ORE_FEATURE_TRITANIUM_NORMAL,
|
||||
listOf(
|
||||
CountPlacement.of(10),
|
||||
InSquarePlacement.spread(),
|
||||
HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(8), VerticalAnchor.absolute(0))
|
||||
)
|
||||
))*/
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user