diff --git a/CHANGELOG.md b/CHANGELOG.md index 122cc6f..0dd9c2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -### 4.0.1 +### 4.1.0 -- Fix Dependencies +- Add Support for Mekanism and Immersive Engineering ores diff --git a/build.gradle b/build.gradle index 12048cf..f5d541d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id("dev.nanite.mlp") version("0.1.1") + id("dev.nanite.mlp") version("0.1.3") id("java-library") id("maven-publish") id("me.modmuss50.mod-publish-plugin") version "0.3.0" @@ -53,6 +53,10 @@ subprojects { name = "Nanite" url = "https://maven.nanite.dev/releases" } + maven { + name = "Nanite" + url = "https://maven.blamejared.com/" + } } tasks.withType(ProcessResources).configureEach { outputs.upToDateWhen { false } diff --git a/common/src/main/java/com/unrealdinnerbone/jamd/JAMDRegistry.java b/common/src/main/java/com/unrealdinnerbone/jamd/JAMDRegistry.java index 7ae5429..1396c5c 100644 --- a/common/src/main/java/com/unrealdinnerbone/jamd/JAMDRegistry.java +++ b/common/src/main/java/com/unrealdinnerbone/jamd/JAMDRegistry.java @@ -1,5 +1,6 @@ package com.unrealdinnerbone.jamd; +import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.serialization.Codec; import com.unrealdinnerbone.jamd.block.*; import com.unrealdinnerbone.jamd.block.base.PortalTileEntity; @@ -9,6 +10,9 @@ import com.unrealdinnerbone.trenzalore.api.registry.RegistryEntry; import com.unrealdinnerbone.trenzalore.api.registry.RegistryObjects; import com.unrealdinnerbone.trenzalore.lib.CreativeTabs; +import net.minecraft.commands.synchronization.ArgumentTypeInfo; +import net.minecraft.commands.synchronization.ArgumentTypeInfos; +import net.minecraft.commands.synchronization.SingletonArgumentInfo; import net.minecraft.core.BlockPos; import net.minecraft.core.registries.Registries; import net.minecraft.tags.BiomeTags; @@ -30,8 +34,11 @@ public class JAMDRegistry implements IRegistry { private static final RegistryObjects BLOCKS = Regeneration.create(Registries.BLOCK); private static final RegistryObjects ITEMS = Regeneration.create(Registries.ITEM); private static final RegistryObjects> TILES = Regeneration.create(Registries.BLOCK_ENTITY_TYPE); + + private static final RegistryObjects> ARG_TYPE = Regeneration.create(Registries.COMMAND_ARGUMENT_TYPE); private static final RegistryObjects> CHUNK_GENERATORS = Regeneration.create(Registries.CHUNK_GENERATOR); + public static final RegistryEntry> CUSTOM_FLAT_LEVEL_SOURCE = CHUNK_GENERATORS.register("mining", () -> CustomFlatLevelSource.CODEC); public static final WorldType OVERWORLD = of("mining", "portal_block", "portal", OverworldPortalBlock::new, OverworldBlockEntity::new, BiomeTags.IS_OVERWORLD); diff --git a/common/src/main/java/com/unrealdinnerbone/jamd/command/JamdCommand.java b/common/src/main/java/com/unrealdinnerbone/jamd/command/JamdCommand.java index 448edc3..543726d 100644 --- a/common/src/main/java/com/unrealdinnerbone/jamd/command/JamdCommand.java +++ b/common/src/main/java/com/unrealdinnerbone/jamd/command/JamdCommand.java @@ -1,25 +1,59 @@ package com.unrealdinnerbone.jamd.command; +import com.mojang.brigadier.Command; import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; +import com.mojang.brigadier.suggestion.SuggestionProvider; +import com.mojang.brigadier.suggestion.Suggestions; +import com.unrealdinnerbone.jamd.WorldType; import com.unrealdinnerbone.jamd.util.OreRegistry; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; +import net.minecraft.commands.SharedSuggestionProvider; import net.minecraft.network.chat.Component; +import net.minecraft.server.packs.repository.Pack; +import net.minecraft.server.packs.repository.PackRepository; +import net.minecraft.world.flag.FeatureFlagSet; + +import java.io.IOException; +import java.util.Collection; public class JamdCommand { + private static final DynamicCommandExceptionType INVALID_WORLD_TYPE = new DynamicCommandExceptionType((object) -> Component.translatable("commands.jamd.invalid_world_type", object)); + public static void register(CommandDispatcher commandDispatcher) { commandDispatcher.register(Commands.literal("jamd") + .then(Commands.literal("export") + .then(Commands.argument("type", StringArgumentType.string()) + .suggests((context, builder) -> SharedSuggestionProvider.suggest(WorldType.TYPES.stream().map(WorldType::getName), builder)) + .executes(JamdCommand::export) .then(Commands.literal("reload") - .executes(JamdCommand::reload))); + .executes(JamdCommand::reload))))); + + } + private static int export(CommandContext stackCommandContext) throws CommandSyntaxException { + String string = StringArgumentType.getString(stackCommandContext, "type"); + WorldType worldType = WorldType.TYPES.stream() + .filter(theWorldType -> theWorldType.getName().equalsIgnoreCase(string)) + .findFirst() + .orElseThrow(() -> INVALID_WORLD_TYPE.create(string)); + try { + worldType.export(stackCommandContext.getSource().getLevel().getServer()); + } catch (IOException e) { + throw new RuntimeException(e); + } + stackCommandContext.getSource().sendSuccess(() -> Component.literal("Exported Biomes Data"), true); + return Command.SINGLE_SUCCESS; } private static int reload(CommandContext stackCommandContext) throws CommandSyntaxException { OreRegistry.REGISTERED_FEATURES.clear(); stackCommandContext.getSource().sendSuccess(() -> Component.literal("Reloaded Biomes Data"), true); - return 0; + return Command.SINGLE_SUCCESS; } } diff --git a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java index 374e7c1..a6c38c7 100644 --- a/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java +++ b/fabric/src/main/java/com/unrealdinnerbone/jamd/data/LangProvider.java @@ -20,6 +20,7 @@ public void generateTranslations(TranslationBuilder translationBuilder) { translationBuilder.add("biome.jamd.mining", "Mining"); translationBuilder.add("biome.jamd.nether", "Nether Mining"); translationBuilder.add("biome.jamd.end", "End Mining"); + translationBuilder.add("jamd.argument.world_type.invalid", "Invalid World Type '%s'"); translationBuilder.add(JAMDRegistry.OVERWORLD.getAdvancementTitleKey(), "To Infinity and Underground"); translationBuilder.add(JAMDRegistry.OVERWORLD.getAdvancementDescriptionKey(), "Enter the Mining Dimension"); } diff --git a/fabric/src/main/java/com/unrealdinnerbone/jamd/JAMDFabric.java b/fabric/src/main/java/com/unrealdinnerbone/jamd/fabric/JAMDFabric.java similarity index 87% rename from fabric/src/main/java/com/unrealdinnerbone/jamd/JAMDFabric.java rename to fabric/src/main/java/com/unrealdinnerbone/jamd/fabric/JAMDFabric.java index 436e407..0d5765f 100644 --- a/fabric/src/main/java/com/unrealdinnerbone/jamd/JAMDFabric.java +++ b/fabric/src/main/java/com/unrealdinnerbone/jamd/fabric/JAMDFabric.java @@ -1,5 +1,6 @@ -package com.unrealdinnerbone.jamd; +package com.unrealdinnerbone.jamd.fabric; +import com.unrealdinnerbone.jamd.JAMD; import com.unrealdinnerbone.jamd.command.JamdCommand; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index e73359b..e7ea16e 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -18,7 +18,7 @@ "environment": "*", "entrypoints": { "main": [ - "com.unrealdinnerbone.jamd.JAMDFabric" + "com.unrealdinnerbone.jamd.fabric.JAMDFabric" ], "fabric-datagen": [ "com.unrealdinnerbone.jamd.data.JAMDData" diff --git a/forge/build.gradle b/forge/build.gradle index 8d08ed8..a418b33 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -4,19 +4,8 @@ multiLoader.forge() { publishing.publications.mavenJava.artifact jar -repositories { - maven { - url "https://cursemaven.com" - } - maven { - url "https://maven.nanite.dev/releases" - } -} - - dependencies { implementation(fg.deobf("com.unrealdinnerbone:trenzalore-forge:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}")) { transitive = true } -// implementation fg.deobf("mekanism:Mekanism:${mekanism_version}") } diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDDataForge.java b/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDDataForge.java deleted file mode 100644 index 55dbd21..0000000 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDDataForge.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.unrealdinnerbone.jamd; - -import com.unrealdinnerbone.jamd.biome.JAMDBiomeModifier; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.RegistrySetBuilder; -import net.minecraft.data.DataProvider; -import net.minecraft.data.PackOutput; -import net.minecraft.data.registries.RegistriesDatapackGenerator; -import net.minecraft.data.registries.RegistryPatchGenerator; -import net.minecraft.data.worldgen.BootstapContext; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.world.BiomeModifier; -import net.minecraftforge.data.event.GatherDataEvent; -import net.minecraftforge.registries.ForgeRegistries; - -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -public class JAMDDataForge { - - private static final ResourceKey ADD_SELF = ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(JAMD.MOD_ID, "add_self")); - - private static final RegistrySetBuilder builder = new RegistrySetBuilder() - .add(ForgeRegistries.Keys.BIOME_MODIFIERS, JAMDDataForge::createBiomeModifiers); - - public static void onData(GatherDataEvent event) { - event.getGenerator().addProvider(event.includeServer(), (DataProvider.Factory) output -> new BiomeModifiers(output, event.getLookupProvider())); - - } - - private static void createBiomeModifiers(BootstapContext bootstapContext) { - bootstapContext.register(ADD_SELF, JAMDBiomeModifier.INSTANCE); - } - - private static class BiomeModifiers extends RegistriesDatapackGenerator { - - public BiomeModifiers(PackOutput output, CompletableFuture registries) { - super(output, RegistryPatchGenerator.createLookup(registries, builder).thenApply(RegistrySetBuilder.PatchedRegistries::patches), Set.of(JAMD.MOD_ID)); - } - } - -} diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForgeRegistry.java b/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForgeRegistry.java deleted file mode 100644 index f92c8a7..0000000 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForgeRegistry.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.unrealdinnerbone.jamd; - -import com.mojang.serialization.Codec; -import com.unrealdinnerbone.jamd.biome.JAMDBiomeModifier; -import com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry; -import com.unrealdinnerbone.trenzalore.api.registry.Regeneration; -import com.unrealdinnerbone.trenzalore.api.registry.RegistryEntry; -import com.unrealdinnerbone.trenzalore.api.registry.RegistryObjects; -import net.minecraftforge.common.world.BiomeModifier; -import net.minecraftforge.registries.ForgeRegistries; - -import java.util.List; - -public class JAMDForgeRegistry implements IRegistry { - private static final RegistryObjects> BIOME_MODIFERS = Regeneration.create(ForgeRegistries.Keys.BIOME_MODIFIER_SERIALIZERS); - - public static final RegistryEntry> BIOME_MODIFER = BIOME_MODIFERS.register(JAMD.MOD_ID, () -> Codec.unit(JAMDBiomeModifier.INSTANCE)); - - @Override - public List> getRegistryObjects() { - return List.of(BIOME_MODIFERS); - } - - @Override - public String getModID() { - return JAMD.MOD_ID; - } -} diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/biome/JAMDBiomeModifier.java b/forge/src/main/java/com/unrealdinnerbone/jamd/biome/JAMDBiomeModifier.java deleted file mode 100644 index 1626088..0000000 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/biome/JAMDBiomeModifier.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.unrealdinnerbone.jamd.biome; - -import com.mojang.serialization.Codec; -import com.unrealdinnerbone.jamd.JAMDForgeRegistry; -import net.minecraft.core.Holder; -import net.minecraft.world.level.biome.Biome; -import net.minecraftforge.common.world.BiomeModifier; -import net.minecraftforge.common.world.ModifiableBiomeInfo; - -public class JAMDBiomeModifier implements BiomeModifier { - public static final JAMDBiomeModifier INSTANCE = new JAMDBiomeModifier(); - - public JAMDBiomeModifier() { - - } - - @Override - public void modify(Holder biome, Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) { - - } - - @Override - public Codec codec() { - return JAMDForgeRegistry.BIOME_MODIFER.get(); - } -} \ No newline at end of file diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java b/forge/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java deleted file mode 100644 index 262cfa5..0000000 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java +++ /dev/null @@ -1,31 +0,0 @@ -//Todo Add Mekanism Support Back -//package com.unrealdinnerbone.jamd.compact; -// -//import com.mojang.serialization.Codec; -//import com.unrealdinnerbone.jamd.OresCodec; -//import com.unrealdinnerbone.jamd.api.IFeatureTypeCompact; -//import mekanism.common.world.ResizableOreFeatureConfig; -//import net.minecraft.resources.ResourceLocation; -//import net.minecraft.world.level.levelgen.placement.PlacementModifier; -// -//import java.util.List; -// -//public class MekenismOreCompact implements IFeatureTypeCompact { -// -// private static final ResourceLocation FEATURE_TYPE = new ResourceLocation("mekanism", "ore"); -// -// @Override -// public OresCodec parse(ResizableOreFeatureConfig config, List placementModifiers) { -// return new OresCodec(config.size().getAsInt(), config.discardChanceOnAirExposure().getAsFloat(), placementModifiers, config.targetStates()); -// } -// -// @Override -// public Codec getCodec() { -// return ResizableOreFeatureConfig.CODEC; -// } -// -// @Override -// public ResourceLocation getFeatureType() { -// return FEATURE_TYPE; -// } -//} diff --git a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForge.java b/forge/src/main/java/com/unrealdinnerbone/jamd/forge/JAMDForge.java similarity index 84% rename from forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForge.java rename to forge/src/main/java/com/unrealdinnerbone/jamd/forge/JAMDForge.java index c08b00b..775967d 100644 --- a/forge/src/main/java/com/unrealdinnerbone/jamd/JAMDForge.java +++ b/forge/src/main/java/com/unrealdinnerbone/jamd/forge/JAMDForge.java @@ -1,5 +1,6 @@ -package com.unrealdinnerbone.jamd; +package com.unrealdinnerbone.jamd.forge; +import com.unrealdinnerbone.jamd.JAMD; import com.unrealdinnerbone.jamd.command.JamdCommand; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegisterCommandsEvent; @@ -17,8 +18,7 @@ public JAMDForge() { } public static void registerCompact() { - //Todo register compact -// FeatureTypeRegistry.register("mekanism", MekenismOreCompact::new); + } public void onRegisterCommands(RegisterCommandsEvent event) { diff --git a/gradle.properties b/gradle.properties index a6749d2..19c76c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -mod_version=4.0.1 +mod_version=4.1.0 maven_group=com.unrealdinnerbone curse_id=422981 mod_name=JAMD @@ -11,12 +11,12 @@ mod_id=jamd minecraft_version=1.20.4 # Forge -forge_version=49.0.13 +forge_version=49.0.30 -neo_version=20.4.70-beta +neo_version=20.4.189 -fabric_version=0.91.2+1.20.4 -fabric_loader_version=0.15.1 +fabric_version=0.96.4+1.20.4 +fabric_loader_version=0.15.7 # Other trenzalore_version=4.0.1 @@ -26,4 +26,5 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false #Compact -mekanism_version=1.20.1-10.4.0.14 +mekanism_version=1.20.4-10.5.0.22 +immersive_engineering_version=1.20.4-10.0.1-pre.177 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a595206..17655d0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/neo/build.gradle b/neo/build.gradle index 85f7258..d73010e 100644 --- a/neo/build.gradle +++ b/neo/build.gradle @@ -2,9 +2,11 @@ multiLoader.neo() { neoVersion.set("${neo_version}") } - dependencies { implementation("com.unrealdinnerbone:trenzalore-neo:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}") + + api "mekanism:Mekanism:${mekanism_version}" + api "blusunrize.immersiveengineering:ImmersiveEngineering:${immersive_engineering_version}" } publishing.publications.mavenJava.from components.java diff --git a/neo/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java b/neo/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java deleted file mode 100644 index e53ff46..0000000 --- a/neo/src/main/java/com/unrealdinnerbone/jamd/compact/MekenismOreCompact.java +++ /dev/null @@ -1,28 +0,0 @@ -//Todo Readd Support -//package com.unrealdinnerbone.jamd.compact; -// -//import com.unrealdinnerbone.jamd.OresCodec; -//import net.minecraft.resources.ResourceLocation; -//import net.minecraft.world.level.levelgen.placement.PlacementModifier; -// -//import java.util.List; -// -//public class MekenismOreCompact implements IFeatureTypeCompact { -// -// private static final ResourceLocation FEATURE_TYPE = new ResourceLocation("mekanism", "ore"); -// -// @Override -// public OresCodec parse(ResizableOreFeatureConfig config, List placementModifiers) { -// return new OresCodec(config.size().getAsInt(), config.discardChanceOnAirExposure().getAsFloat(), placementModifiers, config.targetStates()); -// } -// -// @Override -// public Codec getCodec() { -// return ResizableOreFeatureConfig.CODEC; -// } -// -// @Override -// public ResourceLocation getFeatureType() { -// return FEATURE_TYPE; -// } -//} diff --git a/neo/src/main/java/com/unrealdinnerbone/jamd/JAMDNeo.java b/neo/src/main/java/com/unrealdinnerbone/jamd/neo/JAMDNeo.java similarity index 65% rename from neo/src/main/java/com/unrealdinnerbone/jamd/JAMDNeo.java rename to neo/src/main/java/com/unrealdinnerbone/jamd/neo/JAMDNeo.java index 2379374..108c359 100644 --- a/neo/src/main/java/com/unrealdinnerbone/jamd/JAMDNeo.java +++ b/neo/src/main/java/com/unrealdinnerbone/jamd/neo/JAMDNeo.java @@ -1,11 +1,14 @@ -package com.unrealdinnerbone.jamd; +package com.unrealdinnerbone.jamd.neo; +import com.unrealdinnerbone.jamd.JAMD; +import com.unrealdinnerbone.jamd.api.FeatureTypeRegistry; import com.unrealdinnerbone.jamd.command.JamdCommand; -import net.neoforged.bus.api.IEventBus; +import com.unrealdinnerbone.jamd.neo.compact.IECompact; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.RegisterCommandsEvent; import net.neoforged.neoforge.event.server.ServerStartingEvent; +import com.unrealdinnerbone.jamd.neo.compact.MekenismOreCompact; @Mod(JAMD.MOD_ID) public class JAMDNeo { @@ -18,8 +21,8 @@ public JAMDNeo() { } public static void registerCompact() { - //Todo re add compact -// FeatureTypeRegistry.register("mekanism", MekenismOreCompact::new); + FeatureTypeRegistry.register("mekanism", MekenismOreCompact::new); + FeatureTypeRegistry.register("immersiveengineering", IECompact::new); } public void onRegisterCommands(RegisterCommandsEvent event) { diff --git a/neo/src/main/java/com/unrealdinnerbone/jamd/neo/compact/IECompact.java b/neo/src/main/java/com/unrealdinnerbone/jamd/neo/compact/IECompact.java new file mode 100644 index 0000000..2790499 --- /dev/null +++ b/neo/src/main/java/com/unrealdinnerbone/jamd/neo/compact/IECompact.java @@ -0,0 +1,31 @@ +package com.unrealdinnerbone.jamd.neo.compact; + +import blusunrize.immersiveengineering.common.world.IEOreFeature; +import com.mojang.serialization.Codec; +import com.unrealdinnerbone.jamd.OresCodec; +import com.unrealdinnerbone.jamd.api.IFeatureTypeCompact; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.levelgen.placement.PlacementModifier; + +import java.util.List; + +public class IECompact implements IFeatureTypeCompact { + + private static final ResourceLocation LOCATION = new ResourceLocation("immersiveengineering", "ie_ore"); + @Override + public Codec getCodec() { + return IEOreFeature.IEOreFeatureConfig.CODEC; + } + + @Override + public OresCodec parse(IEOreFeature.IEOreFeatureConfig value, List placementModifiers) { + return new OresCodec(value.getSize(), (float) value.getAirExposure(), placementModifiers, value.targetList()); + } + + @Override + public ResourceLocation getFeatureType() { + return LOCATION; + } + + +} diff --git a/neo/src/main/java/com/unrealdinnerbone/jamd/neo/compact/MekenismOreCompact.java b/neo/src/main/java/com/unrealdinnerbone/jamd/neo/compact/MekenismOreCompact.java new file mode 100644 index 0000000..8fb23ba --- /dev/null +++ b/neo/src/main/java/com/unrealdinnerbone/jamd/neo/compact/MekenismOreCompact.java @@ -0,0 +1,30 @@ +package com.unrealdinnerbone.jamd.neo.compact; + +import com.mojang.serialization.Codec; +import com.unrealdinnerbone.jamd.OresCodec; +import com.unrealdinnerbone.jamd.api.IFeatureTypeCompact; +import mekanism.common.world.ResizableOreFeatureConfig; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.levelgen.placement.PlacementModifier; + +import java.util.List; + +public class MekenismOreCompact implements IFeatureTypeCompact { + + private static final ResourceLocation FEATURE_TYPE = new ResourceLocation("mekanism", "ore"); + + @Override + public OresCodec parse(ResizableOreFeatureConfig config, List placementModifiers) { + return new OresCodec(config.size().getAsInt(), config.discardChanceOnAirExposure().getAsFloat(), placementModifiers, config.targetStates()); + } + + @Override + public Codec getCodec() { + return ResizableOreFeatureConfig.CODEC; + } + + @Override + public ResourceLocation getFeatureType() { + return FEATURE_TYPE; + } +} diff --git a/neo/src/main/resources/META-INF/accesstransformer.cfg b/neo/src/main/resources/META-INF/accesstransformer.cfg index 83f2979..6348532 100644 --- a/neo/src/main/resources/META-INF/accesstransformer.cfg +++ b/neo/src/main/resources/META-INF/accesstransformer.cfg @@ -4,3 +4,5 @@ public net.minecraft.world.level.levelgen.placement.HeightRangePlacement height public net.minecraft.world.level.levelgen.placement.CountPlacement count public net.minecraft.world.level.levelgen.heightproviders.ConstantHeight value public net.minecraft.world.level.biome.BiomeGenerationSettings featureSet + +public net.minecraft.world.item.crafting.S diff --git a/settings.gradle b/settings.gradle index 5a3f5db..91c2120 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,7 +14,7 @@ pluginManagement { plugins { id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" apply(false) - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } include("common", "neo", "fabric", "forge") \ No newline at end of file