1.21.2 work
This commit is contained in:
parent
aca66a970f
commit
e5c736706d
42 changed files with 878 additions and 2 deletions
|
@ -35,7 +35,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
minecraft("com.mojang:minecraft:1.20.6")
|
||||
minecraft("com.mojang:minecraft:${project.property("minecraft_version")}")
|
||||
mappings("net.fabricmc:yarn:${project.property("yarn_mappings")}:v2")
|
||||
modImplementation("net.fabricmc:fabric-loader:${project.property("loader_version")}")
|
||||
modImplementation("net.fabricmc:fabric-language-kotlin:${project.property("kotlin_loader_version")}")
|
||||
|
|
99
MC21.2/build.gradle.kts
Normal file
99
MC21.2/build.gradle.kts
Normal file
|
@ -0,0 +1,99 @@
|
|||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.jetbrains.kotlin.jvm") version "2.1.0"
|
||||
id("fabric-loom") version "1.9-SNAPSHOT"
|
||||
id("com.modrinth.minotaur") version "2.+"
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
version = project.property("mod_version") as String
|
||||
group = project.property("maven_group") as String
|
||||
|
||||
base {
|
||||
archivesName.set(project.property("archives_base_name") as String)
|
||||
}
|
||||
|
||||
val targetJavaVersion = 21
|
||||
java {
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||
// if it is present.
|
||||
// If you remove this line, sources will not be generated.
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
repositories {
|
||||
// Add repositories to retrieve artifacts from in here.
|
||||
// You should only use this when depending on other mods because
|
||||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||
// for more information about repositories.
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
minecraft("com.mojang:minecraft:${project.property("minecraft_version")}")
|
||||
mappings("net.fabricmc:yarn:${project.property("yarn_mappings")}:v2")
|
||||
modImplementation("net.fabricmc:fabric-loader:${project.property("loader_version")}")
|
||||
modImplementation("net.fabricmc:fabric-language-kotlin:${project.property("kotlin_loader_version")}")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}")
|
||||
}
|
||||
|
||||
modrinth {
|
||||
token.set(System.getenv("MODRINTH_TOKEN"))
|
||||
projectId.set("Hxo4BmMk")
|
||||
versionNumber.set(project.property("mod_version").toString())
|
||||
versionType.set("release")
|
||||
uploadFile.set(tasks.jar)
|
||||
gameVersions.addAll("1.20.5", "1.20.6", "1.21", "1.21.1")
|
||||
loaders.addAll("fabric", "quilt")
|
||||
dependencies {
|
||||
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
|
||||
// The type can either be `project` or `version`
|
||||
required.project("fabric-api")
|
||||
required.project("fabric-language-kotlin")
|
||||
}
|
||||
syncBodyFrom = rootProject.file("README.md").readText()
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
inputs.property("version", project.property("mod_version"))
|
||||
inputs.property("minecraft_version", project.property("minecraft_version"))
|
||||
inputs.property("loader_version", project.property("loader_version"))
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand(
|
||||
"version" to project.property("mod_version"),
|
||||
"minecraft_version" to project.property("minecraft_version"),
|
||||
"loader_version" to project.property("loader_version"),
|
||||
"kotlin_loader_version" to project.property("kotlin_loader_version"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
// this fixes some edge cases with special characters not displaying correctly
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
// If Javadoc is generated, this must be specified in that task too.
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(targetJavaVersion)
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
compilerOptions.jvmTarget.set(JvmTarget.fromTarget(targetJavaVersion.toString()))
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${project.base.archivesName}" }
|
||||
}
|
||||
}
|
||||
|
||||
fabricApi {
|
||||
configureDataGeneration()
|
||||
}
|
18
MC21.2/gradle.properties
Normal file
18
MC21.2/gradle.properties
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.2
|
||||
yarn_mappings=1.21.2+build.1
|
||||
loader_version=0.16.9
|
||||
kotlin_loader_version=1.13.0+kotlin.2.1.0
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0+1.21.2
|
||||
maven_group = observer.nelle
|
||||
archives_base_name = roses_mod
|
||||
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.106.1+1.21.2
|
|
@ -0,0 +1,33 @@
|
|||
package observer.nelle.roses;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
import net.minecraft.registry.RegistryBuilder;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import observer.nelle.roses.datagen.RosesBlockTagProvider;
|
||||
import observer.nelle.roses.datagen.RosesLootTableProvider;
|
||||
import observer.nelle.roses.datagen.RosesRecipeProvider;
|
||||
import observer.nelle.roses.datagen.RosesRegistryGenerator;
|
||||
import observer.nelle.roses.world.RosesConfiguredFeatures;
|
||||
import observer.nelle.roses.world.RosesPlacedFeatures;
|
||||
|
||||
public class RosesDataGenerator implements DataGeneratorEntrypoint {
|
||||
|
||||
@Override
|
||||
public void onInitializeDataGenerator(FabricDataGenerator generator) {
|
||||
FabricDataGenerator.Pack pack = generator.createPack();
|
||||
|
||||
// Adding a provider example:
|
||||
//
|
||||
pack.addProvider(RosesRecipeProvider::new);
|
||||
pack.addProvider(RosesBlockTagProvider::new);
|
||||
pack.addProvider(RosesLootTableProvider::new);
|
||||
pack.addProvider(RosesRegistryGenerator::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildRegistry(RegistryBuilder registryBuilder) {
|
||||
registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, RosesConfiguredFeatures::bootstrap);
|
||||
registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, RosesPlacedFeatures::bootstrap);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package observer.nelle.roses.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import observer.nelle.roses.RosesBlocks;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class RosesBlockTagProvider extends FabricTagProvider.BlockTagProvider {
|
||||
public RosesBlockTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
|
||||
getOrCreateTagBuilder(BlockTags.TALL_FLOWERS)
|
||||
.add(RosesBlocks.INSTANCE.getCyanRoseBush())
|
||||
;
|
||||
getOrCreateTagBuilder(BlockTags.SMALL_FLOWERS)
|
||||
.add(RosesBlocks.INSTANCE.getRoseFlower())
|
||||
.add(RosesBlocks.INSTANCE.getCyanRoseFlower())
|
||||
;
|
||||
getOrCreateTagBuilder(BlockTags.FLOWER_POTS)
|
||||
.add(RosesBlocks.INSTANCE.getPottedRose())
|
||||
.add(RosesBlocks.INSTANCE.getPottedCyan())
|
||||
;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package observer.nelle.roses.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.loot.LootTable;
|
||||
import net.minecraft.loot.entry.ItemEntry;
|
||||
import net.minecraft.loot.function.ApplyBonusLootFunction;
|
||||
import net.minecraft.loot.function.SetCountLootFunction;
|
||||
import net.minecraft.loot.provider.number.UniformLootNumberProvider;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import observer.nelle.roses.RosesBlocks;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class RosesLootTableProvider extends FabricBlockLootTableProvider {
|
||||
public RosesLootTableProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) {
|
||||
super(dataOutput, registryLookup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
addDrop(RosesBlocks.INSTANCE.getRoseFlower());
|
||||
addDrop(RosesBlocks.INSTANCE.getCyanRoseFlower());
|
||||
|
||||
addPottedPlantDrops(RosesBlocks.INSTANCE.getPottedRose());
|
||||
addPottedPlantDrops(RosesBlocks.INSTANCE.getPottedCyan());
|
||||
|
||||
addDrop(Blocks.ROSE_BUSH, roseBushDrops(Blocks.ROSE_BUSH, Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()).asItem(), 2.0F, 5.0F));
|
||||
addDrop(RosesBlocks.INSTANCE.getCyanRoseBush(), roseBushDrops(RosesBlocks.INSTANCE.getCyanRoseBush(), Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()).asItem(), 2.0F, 5.0F));
|
||||
}
|
||||
|
||||
public LootTable.Builder roseBushDrops(Block input, Item output, Float min, Float max) {
|
||||
return dropsWithShears(input, this
|
||||
.applyExplosionDecay(input, ItemEntry.builder(output)
|
||||
.apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(min, max)))
|
||||
.apply(ApplyBonusLootFunction.oreDrops((RegistryEntry<Enchantment>) Enchantments.FORTUNE))));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package observer.nelle.roses.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||
import net.minecraft.data.server.recipe.RecipeExporter;
|
||||
import net.minecraft.data.server.recipe.RecipeGenerator;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.recipe.book.RecipeCategory;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import observer.nelle.roses.RosesBlocks;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
||||
public class RosesRecipeProvider extends FabricRecipeProvider {
|
||||
|
||||
public RosesRecipeProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RecipeGenerator getRecipeGenerator(RegistryWrapper.WrapperLookup wrapperLookup, RecipeExporter recipeExporter) {
|
||||
return new RecipeGenerator(wrapperLookup, recipeExporter) {
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
createShapeless(RecipeCategory.DECORATIONS, Items.RED_DYE)
|
||||
.input(RosesBlocks.INSTANCE.getRoseFlower(), 2);
|
||||
createShapeless(RecipeCategory.DECORATIONS, Items.CYAN_DYE)
|
||||
.input(RosesBlocks.INSTANCE.getCyanRoseFlower(), 2);
|
||||
|
||||
offer2x2CompactingRecipe(RecipeCategory.DECORATIONS, Items.ROSE_BUSH, RosesBlocks.INSTANCE.getRoseFlower());
|
||||
offer2x2CompactingRecipe(RecipeCategory.DECORATIONS, Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseBush()).asItem(), RosesBlocks.INSTANCE.getCyanRoseFlower());
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package observer.nelle.roses.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class RosesRegistryGenerator extends FabricDynamicRegistryProvider {
|
||||
public RosesRegistryGenerator(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) {
|
||||
entries.addAll(registries.getOrThrow(RegistryKeys.CONFIGURED_FEATURE));
|
||||
entries.addAll(registries.getOrThrow(RegistryKeys.PLACED_FEATURE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package observer.nelle.roses.world;
|
||||
|
||||
// Configured Feature (flowers, how does this look like) -> Placed Feature (How is this feature placed) -> WorldGen/BiomeMod (Where is our feature placed)
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.registry.Registerable;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.collection.DataPool;
|
||||
import net.minecraft.world.gen.feature.*;
|
||||
import net.minecraft.world.gen.stateprovider.BlockStateProvider;
|
||||
import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider;
|
||||
import observer.nelle.roses.RosesBlocks;
|
||||
import observer.nelle.roses.RosesModKt;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class RosesConfiguredFeatures {
|
||||
public static final RegistryKey<ConfiguredFeature<?, ?>> cyanRoseBushKey = registerKey("cyan_rose_bush");
|
||||
public static final RegistryKey<ConfiguredFeature<?, ?>> cyanRoseKey = registerKey("cyan_rose_flower");
|
||||
public static final RegistryKey<ConfiguredFeature<?, ?>> roseKey = registerKey("rose_flower");
|
||||
|
||||
public static void bootstrap(Registerable<ConfiguredFeature<?, ?>> context) {
|
||||
// pretty much exactly as FOREST_FLOWERS
|
||||
register(context, cyanRoseBushKey, Feature.RANDOM_PATCH,
|
||||
ConfiguredFeatures.createRandomPatchFeatureConfig(Feature.SIMPLE_BLOCK,
|
||||
new SimpleBlockFeatureConfig(BlockStateProvider.of(Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseBush())))));
|
||||
|
||||
register(context, cyanRoseKey, Feature.FLOWER,
|
||||
createRandomFlowerPatchFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()).getDefaultState(), 2)
|
||||
.add(Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()).getDefaultState(), 1)), 64
|
||||
));
|
||||
|
||||
register(context, roseKey, Feature.FLOWER,
|
||||
createRandomFlowerPatchFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()).getDefaultState(), 2)
|
||||
.add(Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()).getDefaultState(), 1)), 64
|
||||
));
|
||||
}
|
||||
|
||||
public static RegistryKey<ConfiguredFeature<?, ?>> registerKey(String name) {
|
||||
return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(RosesModKt.MOD_ID, name));
|
||||
}
|
||||
|
||||
private static <FC extends FeatureConfig, F extends Feature<FC>> void register(Registerable<ConfiguredFeature<?, ?>> context,
|
||||
RegistryKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) {
|
||||
context.register(key, new ConfiguredFeature<>(feature, configuration));
|
||||
}
|
||||
|
||||
private static RandomPatchFeatureConfig createRandomFlowerPatchFeatureConfig(BlockStateProvider block, int tries) {
|
||||
return ConfiguredFeatures.createRandomPatchFeatureConfig(tries, PlacedFeatures.createEntry(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(block)));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package observer.nelle.roses.world;
|
||||
|
||||
import net.minecraft.registry.Registerable;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.intprovider.ClampedIntProvider;
|
||||
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
||||
import net.minecraft.world.gen.feature.*;
|
||||
import net.minecraft.world.gen.placementmodifier.*;
|
||||
import observer.nelle.roses.RosesModKt;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RosesPlacedFeatures {
|
||||
|
||||
public static final RegistryKey<PlacedFeature> cyanRoseBushPlacedKey = registerKey("cyan_rose_bush_placed");
|
||||
|
||||
public static final RegistryKey<PlacedFeature> cyanRosePlacedKey = registerKey("cyan_rose_placed");
|
||||
public static final RegistryKey<PlacedFeature> rosePlacedKey = registerKey("rose_placed");
|
||||
|
||||
public static final RegistryKey<PlacedFeature> cyanRoseRarerPlacedKey = registerKey("cyan_rose_rare_placed");
|
||||
public static final RegistryKey<PlacedFeature> roseRarerPlacedKey = registerKey("rose_rare_placed");
|
||||
|
||||
public static final RegistryKey<PlacedFeature> cyanRoseCommonPlacedKey = registerKey("cyan_rose_common_placed");
|
||||
public static final RegistryKey<PlacedFeature> roseCommonPlacedKey = registerKey("rose_common_placed");
|
||||
|
||||
public static void bootstrap(Registerable<PlacedFeature> context) {
|
||||
var configuredFeatures = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE);
|
||||
|
||||
register(context, cyanRoseBushPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseBushKey),
|
||||
RarityFilterPlacementModifier.of(85),
|
||||
SquarePlacementModifier.of(),
|
||||
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||
CountPlacementModifier.of(ClampedIntProvider.create(UniformIntProvider.create(-1, 3), 0, 3)),
|
||||
BiomePlacementModifier.of());
|
||||
|
||||
// regular
|
||||
register(context, cyanRosePlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseKey),
|
||||
RarityFilterPlacementModifier.of(70),
|
||||
SquarePlacementModifier.of(),
|
||||
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||
BiomePlacementModifier.of());
|
||||
|
||||
register(context, rosePlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.roseKey),
|
||||
RarityFilterPlacementModifier.of(32),
|
||||
SquarePlacementModifier.of(),
|
||||
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||
BiomePlacementModifier.of());
|
||||
|
||||
// rarer
|
||||
register(context, cyanRoseRarerPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseKey),
|
||||
RarityFilterPlacementModifier.of(90),
|
||||
SquarePlacementModifier.of(),
|
||||
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||
BiomePlacementModifier.of());
|
||||
|
||||
register(context, roseRarerPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.roseKey),
|
||||
RarityFilterPlacementModifier.of(80),
|
||||
SquarePlacementModifier.of(),
|
||||
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||
BiomePlacementModifier.of());
|
||||
|
||||
// more common
|
||||
register(context, cyanRoseCommonPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseKey),
|
||||
RarityFilterPlacementModifier.of(45),
|
||||
SquarePlacementModifier.of(),
|
||||
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||
BiomePlacementModifier.of());
|
||||
|
||||
register(context, roseCommonPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.roseKey),
|
||||
RarityFilterPlacementModifier.of(4),
|
||||
SquarePlacementModifier.of(),
|
||||
PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP,
|
||||
BiomePlacementModifier.of());
|
||||
}
|
||||
|
||||
public static RegistryKey<PlacedFeature> registerKey(String name) {
|
||||
return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(RosesModKt.MOD_ID, name));
|
||||
}
|
||||
|
||||
private static void register(Registerable<PlacedFeature> context, RegistryKey<PlacedFeature> key, RegistryEntry<ConfiguredFeature<?, ?>> configuration,
|
||||
List<PlacementModifier> modifiers) {
|
||||
context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers)));
|
||||
}
|
||||
|
||||
// may not need this
|
||||
private static <FC extends FeatureConfig, F extends Feature<FC>> void register(Registerable<PlacedFeature> context, RegistryKey<PlacedFeature> key,
|
||||
RegistryEntry<ConfiguredFeature<?, ?>> configuration,
|
||||
PlacementModifier... modifiers) {
|
||||
register(context, key, configuration, List.of(modifiers));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package observer.nelle.roses.world.gen;
|
||||
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import observer.nelle.roses.world.RosesPlacedFeatures;
|
||||
|
||||
public class RosesVegetationGeneration {
|
||||
public static void generateVegetation() {
|
||||
BiomeModifications.addFeature(
|
||||
BiomeSelectors.includeByKey(
|
||||
BiomeKeys.FOREST,
|
||||
BiomeKeys.FLOWER_FOREST,
|
||||
BiomeKeys.BIRCH_FOREST,
|
||||
BiomeKeys.OLD_GROWTH_BIRCH_FOREST,
|
||||
BiomeKeys.DARK_FOREST),
|
||||
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.cyanRoseBushPlacedKey);
|
||||
|
||||
// regular
|
||||
BiomeModifications.addFeature(
|
||||
BiomeSelectors.includeByKey(
|
||||
BiomeKeys.PLAINS,
|
||||
BiomeKeys.SUNFLOWER_PLAINS,
|
||||
BiomeKeys.MEADOW, // https://minecraft.wiki/w/Flower#Flower_gradients
|
||||
BiomeKeys.FLOWER_FOREST, // https://minecraft.wiki/w/Flower#Flower_gradients
|
||||
BiomeKeys.SNOWY_PLAINS,
|
||||
BiomeKeys.FOREST,
|
||||
BiomeKeys.BIRCH_FOREST,
|
||||
BiomeKeys.OLD_GROWTH_BIRCH_FOREST,
|
||||
BiomeKeys.TAIGA,
|
||||
BiomeKeys.OLD_GROWTH_PINE_TAIGA,
|
||||
BiomeKeys.OLD_GROWTH_SPRUCE_TAIGA,
|
||||
BiomeKeys.SNOWY_TAIGA,
|
||||
BiomeKeys.DARK_FOREST,
|
||||
BiomeKeys.WINDSWEPT_HILLS,
|
||||
BiomeKeys.WINDSWEPT_FOREST,
|
||||
BiomeKeys.WINDSWEPT_GRAVELLY_HILLS,
|
||||
BiomeKeys.RIVER,
|
||||
BiomeKeys.FROZEN_RIVER),
|
||||
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.cyanRosePlacedKey);
|
||||
|
||||
BiomeModifications.addFeature(BiomeSelectors.includeByKey(
|
||||
BiomeKeys.PLAINS,
|
||||
BiomeKeys.SUNFLOWER_PLAINS,
|
||||
BiomeKeys.MEADOW, // https://minecraft.wiki/w/Flower#Flower_gradients
|
||||
BiomeKeys.FLOWER_FOREST, // https://minecraft.wiki/w/Flower#Flower_gradients
|
||||
BiomeKeys.SNOWY_PLAINS,
|
||||
BiomeKeys.FOREST,
|
||||
BiomeKeys.BIRCH_FOREST,
|
||||
BiomeKeys.OLD_GROWTH_BIRCH_FOREST,
|
||||
BiomeKeys.TAIGA,
|
||||
BiomeKeys.OLD_GROWTH_PINE_TAIGA,
|
||||
BiomeKeys.OLD_GROWTH_SPRUCE_TAIGA,
|
||||
BiomeKeys.SNOWY_TAIGA,
|
||||
BiomeKeys.DARK_FOREST,
|
||||
BiomeKeys.WINDSWEPT_HILLS,
|
||||
BiomeKeys.WINDSWEPT_FOREST,
|
||||
BiomeKeys.WINDSWEPT_GRAVELLY_HILLS,
|
||||
BiomeKeys.RIVER,
|
||||
BiomeKeys.FROZEN_RIVER),
|
||||
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.rosePlacedKey);
|
||||
|
||||
// rarer
|
||||
BiomeModifications.addFeature(
|
||||
BiomeSelectors.includeByKey(
|
||||
BiomeKeys.BEACH,
|
||||
BiomeKeys.SNOWY_BEACH,
|
||||
BiomeKeys.STONY_SHORE,
|
||||
BiomeKeys.OCEAN,
|
||||
BiomeKeys.DEEP_COLD_OCEAN,
|
||||
BiomeKeys.COLD_OCEAN,
|
||||
BiomeKeys.DEEP_FROZEN_OCEAN,
|
||||
BiomeKeys.DEEP_LUKEWARM_OCEAN,
|
||||
BiomeKeys.DEEP_OCEAN,
|
||||
BiomeKeys.FROZEN_OCEAN,
|
||||
BiomeKeys.LUKEWARM_OCEAN,
|
||||
BiomeKeys.WARM_OCEAN,
|
||||
BiomeKeys.DESERT,
|
||||
BiomeKeys.ICE_SPIKES,
|
||||
BiomeKeys.DRIPSTONE_CAVES,
|
||||
BiomeKeys.DEEP_DARK
|
||||
),
|
||||
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.cyanRoseRarerPlacedKey);
|
||||
|
||||
BiomeModifications.addFeature(BiomeSelectors.includeByKey(
|
||||
BiomeKeys.BEACH,
|
||||
BiomeKeys.SNOWY_BEACH,
|
||||
BiomeKeys.STONY_SHORE,
|
||||
BiomeKeys.OCEAN,
|
||||
BiomeKeys.DEEP_COLD_OCEAN,
|
||||
BiomeKeys.COLD_OCEAN,
|
||||
BiomeKeys.DEEP_FROZEN_OCEAN,
|
||||
BiomeKeys.DEEP_LUKEWARM_OCEAN,
|
||||
BiomeKeys.DEEP_OCEAN,
|
||||
BiomeKeys.FROZEN_OCEAN,
|
||||
BiomeKeys.LUKEWARM_OCEAN,
|
||||
BiomeKeys.WARM_OCEAN,
|
||||
BiomeKeys.DESERT,
|
||||
BiomeKeys.ICE_SPIKES,
|
||||
BiomeKeys.DRIPSTONE_CAVES,
|
||||
BiomeKeys.DEEP_DARK
|
||||
),
|
||||
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.roseRarerPlacedKey);
|
||||
|
||||
// more common
|
||||
BiomeModifications.addFeature(
|
||||
BiomeSelectors.includeByKey(
|
||||
BiomeKeys.JUNGLE,
|
||||
BiomeKeys.BAMBOO_JUNGLE,
|
||||
BiomeKeys.SPARSE_JUNGLE,
|
||||
BiomeKeys.SAVANNA,
|
||||
BiomeKeys.SAVANNA_PLATEAU,
|
||||
BiomeKeys.WINDSWEPT_SAVANNA
|
||||
),
|
||||
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.cyanRoseCommonPlacedKey);
|
||||
|
||||
BiomeModifications.addFeature(BiomeSelectors.includeByKey(
|
||||
BiomeKeys.JUNGLE,
|
||||
BiomeKeys.BAMBOO_JUNGLE,
|
||||
BiomeKeys.SPARSE_JUNGLE,
|
||||
BiomeKeys.SAVANNA,
|
||||
BiomeKeys.SAVANNA_PLATEAU,
|
||||
BiomeKeys.WINDSWEPT_SAVANNA
|
||||
),
|
||||
GenerationStep.Feature.VEGETAL_DECORATION, RosesPlacedFeatures.roseCommonPlacedKey);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package observer.nelle.roses.world.gen;
|
||||
|
||||
public class RosesWorldGeneration {
|
||||
public static void generateRosesWorldGen() {
|
||||
RosesVegetationGeneration.generateVegetation();
|
||||
}
|
||||
}
|
69
MC21.2/src/main/kotlin/observer/nelle/roses/RosesBlocks.kt
Normal file
69
MC21.2/src/main/kotlin/observer/nelle/roses/RosesBlocks.kt
Normal file
|
@ -0,0 +1,69 @@
|
|||
@file:Suppress(
|
||||
"ktlint:standard:no-wildcard-imports",
|
||||
)
|
||||
|
||||
package observer.nelle.roses
|
||||
|
||||
import net.minecraft.block.*
|
||||
import net.minecraft.entity.effect.StatusEffects
|
||||
import net.minecraft.item.BlockItem
|
||||
import net.minecraft.item.Item
|
||||
import net.minecraft.registry.Registries
|
||||
import net.minecraft.registry.Registry
|
||||
import net.minecraft.util.Identifier
|
||||
|
||||
object RosesBlocks {
|
||||
val roseFlower: Block =
|
||||
register(
|
||||
FlowerBlock(
|
||||
StatusEffects.INSTANT_DAMAGE,
|
||||
6F,
|
||||
AbstractBlock.Settings.copy(Blocks.POPPY),
|
||||
),
|
||||
Identifier.of(MOD_ID, "rose_flower"),
|
||||
)
|
||||
|
||||
val pottedRose: Block =
|
||||
register(
|
||||
FlowerPotBlock(
|
||||
roseFlower,
|
||||
AbstractBlock.Settings.copy(Blocks.POTTED_POPPY),
|
||||
),
|
||||
Identifier.of(MOD_ID, "potted_rose"),
|
||||
)
|
||||
val cyanRoseFlower: Block =
|
||||
register(
|
||||
FlowerBlock(
|
||||
StatusEffects.INSTANT_HEALTH,
|
||||
6F,
|
||||
AbstractBlock.Settings.copy(Blocks.POPPY),
|
||||
),
|
||||
Identifier.of(MOD_ID, "cyan_rose"),
|
||||
)
|
||||
val pottedCyan: Block =
|
||||
register(
|
||||
FlowerPotBlock(
|
||||
cyanRoseFlower,
|
||||
AbstractBlock.Settings.copy(Blocks.POTTED_POPPY),
|
||||
),
|
||||
Identifier.of(MOD_ID, "potted_cyan"),
|
||||
)
|
||||
val cyanRoseBush: Block =
|
||||
register(
|
||||
TallPlantBlock(
|
||||
AbstractBlock.Settings.copy(Blocks.LARGE_FERN),
|
||||
),
|
||||
Identifier.of(MOD_ID, "cyan_rose_bush"),
|
||||
)
|
||||
|
||||
fun register(
|
||||
block: Block,
|
||||
id: Identifier,
|
||||
): Block {
|
||||
// Register the block and its item.
|
||||
val blockItem = BlockItem(block, Item.Settings())
|
||||
Registry.register(Registries.ITEM, id, blockItem)
|
||||
|
||||
return Registry.register(Registries.BLOCK, id, block)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package observer.nelle.roses
|
||||
|
||||
object RosesCreativeTab {
|
||||
// CREATIVE TABS
|
||||
val roseTabEntry =
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(
|
||||
ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries ->
|
||||
content.addAfter(
|
||||
Items.POPPY,
|
||||
RosesBlocks.roseFlower,
|
||||
)
|
||||
},
|
||||
)
|
||||
val cyanTabEntry =
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(
|
||||
ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries ->
|
||||
content.addAfter(
|
||||
Items.BLUE_ORCHID,
|
||||
RosesBlocks.cyanRoseFlower,
|
||||
)
|
||||
},
|
||||
)
|
||||
val cyanBushTabEntry =
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(
|
||||
ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries ->
|
||||
content.addAfter(
|
||||
Items.ROSE_BUSH,
|
||||
RosesBlocks.cyanRoseBush,
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
23
MC21.2/src/main/kotlin/observer/nelle/roses/RosesMod.kt
Normal file
23
MC21.2/src/main/kotlin/observer/nelle/roses/RosesMod.kt
Normal file
|
@ -0,0 +1,23 @@
|
|||
package observer.nelle.roses
|
||||
|
||||
import net.fabricmc.api.ModInitializer
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
val LOGGER: Logger = LoggerFactory.getLogger("roses")
|
||||
const val MOD_ID = "roses_mod"
|
||||
|
||||
class Roses : ModInitializer {
|
||||
override fun onInitialize() {
|
||||
LOGGER.info("just like old times?")
|
||||
|
||||
// blocks
|
||||
RosesBlocks
|
||||
|
||||
// creative tab entries
|
||||
RosesCreativeTab
|
||||
|
||||
// generation
|
||||
RosesWorldGeneration.generateRosesWorldGen()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package observer.nelle.roses
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer
|
||||
/*import observer.nelle.roses.RosesBlocks.cyanRoseBush
|
||||
import observer.nelle.roses.RosesBlocks.cyanRoseFlower
|
||||
import observer.nelle.roses.RosesBlocks.pottedCyan
|
||||
import observer.nelle.roses.RosesBlocks.pottedRose
|
||||
import observer.nelle.roses.RosesBlocks.roseFlower*/
|
||||
|
||||
class RosesModClient : ClientModInitializer {
|
||||
override fun onInitializeClient() {
|
||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), cyanRoseBush)
|
||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), cyanRoseFlower)
|
||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), pottedCyan)
|
||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), pottedRose)
|
||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), roseFlower)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"": { "model": "roses_mod:block/cyan_rose"}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"variants": {
|
||||
"half=lower": {
|
||||
"model": "roses_mod:block/cyan_rose_bush_bottom"
|
||||
},
|
||||
"half=upper": {
|
||||
"model": "roses_mod:block/cyan_rose_bush_top"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"": { "model": "roses_mod:block/potted_cyan"}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"": { "model": "roses_mod:block/potted_rose"}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"": { "model": "roses_mod:block/rose_flower"}
|
||||
}
|
||||
}
|
BIN
MC21.2/src/main/resources/assets/roses_mod/icon.png
Normal file
BIN
MC21.2/src/main/resources/assets/roses_mod/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"block.roses_mod.rose_flower": "Rose",
|
||||
"block.roses_mod.potted_rose": "Potted Rose",
|
||||
"block.roses_mod.cyan_rose": "Cyan Rose",
|
||||
"block.roses_mod.potted_cyan": "Potted Cyan Rose",
|
||||
"block.roses_mod.cyan_rose_bush": "Cyan Rose Bush"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/cross",
|
||||
"textures": {
|
||||
"cross": "roses_mod:block/cyan_rose"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/cross",
|
||||
"textures": {
|
||||
"cross": "roses_mod:block/cyan_rose_bush_bottom"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/cross",
|
||||
"textures": {
|
||||
"cross": "roses_mod:block/cyan_rose_bush_top"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/flower_pot_cross",
|
||||
"textures": {
|
||||
"plant": "roses_mod:block/cyan_rose"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/flower_pot_cross",
|
||||
"textures": {
|
||||
"plant": "roses_mod:block/rose_flower"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/cross",
|
||||
"textures": {
|
||||
"cross": "roses_mod:block/rose_flower"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "roses_mod:block/cyan_rose"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "roses_mod:block/cyan_rose_bush_top"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "roses_mod:block/rose_flower"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 237 B |
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 248 B |
42
MC21.2/src/main/resources/fabric.mod.json
Normal file
42
MC21.2/src/main/resources/fabric.mod.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "roses_mod",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "Roses Mod",
|
||||
"description": "Reinstates the classic roses to Minecraft.",
|
||||
"authors": [
|
||||
"nellePoint"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://modrinth.com/mod/roses-mod",
|
||||
"issues": "https://git.nullafati.xyz/limepotato/roses-mod/issues",
|
||||
"sources": "https://git.nullafati.xyz/limepotato/roses-mod"
|
||||
},
|
||||
|
||||
"license": "LGPL-3.0",
|
||||
"icon": "assets/roses_mod/icon.png",
|
||||
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"fabric-datagen": [
|
||||
"observer.nelle.roses.RosesDataGenerator"
|
||||
],
|
||||
"client": [
|
||||
"observer.nelle.roses.RosesModClient"
|
||||
],
|
||||
"main": [
|
||||
"observer.nelle.roses.Roses"
|
||||
]
|
||||
},
|
||||
|
||||
"mixins": [
|
||||
],
|
||||
|
||||
"depends": {
|
||||
"fabricloader": ">=${loader_version}",
|
||||
"fabric-language-kotlin": ">=${kotlin_loader_version}",
|
||||
"fabric": "*",
|
||||
"minecraft": "*"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"roses_mod:potted_rose",
|
||||
"roses_mod:cyan_rose"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"roses_mod:rose_flower",
|
||||
"roses_mod:cyan_rose"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"roses_mod:cyan_rose_bush"
|
||||
]
|
||||
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
|
@ -25,7 +25,6 @@ pluginManagement {
|
|||
}
|
||||
|
||||
plugins {
|
||||
// Use the Foojay Toolchains plugin to automatically download JDKs required by subprojects.
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
}
|
||||
|
||||
|
@ -34,3 +33,4 @@ plugins {
|
|||
// Learn more about structuring projects with Gradle - https://docs.gradle.org/8.7/userguide/multi_project_builds.html
|
||||
include(":MC20.5-21.1")
|
||||
include(":MC20-20.4")
|
||||
include("MC21.2")
|
||||
|
|
Loading…
Reference in a new issue