1.21.2-1.21.4

This commit is contained in:
nelle 2024-12-22 01:02:14 -07:00
parent e5c736706d
commit eeb8f961f1
40 changed files with 615 additions and 76 deletions

View file

@ -1,7 +0,0 @@
{
"replace": false,
"values": [
"roses_mod:rose_flower",
"roses_mod:cyan_rose"
]
}

View file

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"roses_mod:cyan_rose_bush"
]
}

View file

@ -1,7 +0,0 @@
{
"replace": false,
"values": [
"roses_mod:potted_rose",
"roses_mod:cyan_rose"
]
}

View file

@ -1,7 +0,0 @@
{
"replace": false,
"values": [
"roses_mod:rose_flower",
"roses_mod:cyan_rose"
]
}

View file

@ -48,7 +48,7 @@ modrinth {
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")
gameVersions.addAll("1.21.2", "1.21.3", "1.21.4")
loaders.addAll("fabric", "quilt")
dependencies {
// The scope can be `required`, `optional`, `incompatible`, or `embedded`

View file

@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx1G
kotlin_loader_version=1.13.0+kotlin.2.1.0
# Mod Properties
mod_version = 1.0+1.21.2
mod_version = 1.0+1.21.2-1.21.4
maven_group = observer.nelle
archives_base_name = roses_mod

View file

@ -0,0 +1,46 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": "minecraft:shears"
}
}
],
"name": "minecraft:rose_bush"
},
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 5.0,
"min": 2.0
},
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "roses_mod:rose_flower"
}
]
}
],
"rolls": 1.0
}
]
}

View file

@ -1,7 +1,6 @@
{
"replace": false,
"values": [
"roses_mod:potted_rose",
"roses_mod:cyan_rose"
"roses_mod:potted_cyan"
]
}

View file

@ -1,5 +1,4 @@
{
"replace": false,
"values": [
"roses_mod:rose_flower",
"roses_mod:cyan_rose"

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_cyan_rose": {
"conditions": {
"items": [
{
"items": "roses_mod:cyan_rose"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "roses_mod:cyan_rose_bush"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_cyan_rose"
]
],
"rewards": {
"recipes": [
"roses_mod:cyan_rose_bush"
]
}
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_rose_flower": {
"conditions": {
"items": [
{
"items": "roses_mod:rose_flower"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "minecraft:rose_bush"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_rose_flower"
]
],
"rewards": {
"recipes": [
"minecraft:rose_bush"
]
}
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "roses_mod:cyan_rose"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,46 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": "minecraft:shears"
}
}
],
"name": "roses_mod:cyan_rose_bush"
},
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 5.0,
"min": 2.0
},
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "roses_mod:cyan_rose"
}
]
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,35 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:flower_pot"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "roses_mod:cyan_rose"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,35 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:flower_pot"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "roses_mod:rose_flower"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "roses_mod:rose_flower"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"#": "roses_mod:cyan_rose"
},
"pattern": [
"##",
"##"
],
"result": {
"count": 1,
"id": "roses_mod:cyan_rose_bush"
}
}

View file

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"#": "roses_mod:rose_flower"
},
"pattern": [
"##",
"##"
],
"result": {
"count": 1,
"id": "minecraft:rose_bush"
}
}

View file

@ -0,0 +1,33 @@
{
"type": "minecraft:random_patch",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "roses_mod:cyan_rose_bush",
"Properties": {
"half": "lower"
}
}
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 96,
"xz_spread": 7,
"y_spread": 3
}
}

View file

@ -0,0 +1,41 @@
{
"type": "minecraft:flower",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:weighted_state_provider",
"entries": [
{
"data": {
"Name": "roses_mod:cyan_rose"
},
"weight": 2
},
{
"data": {
"Name": "roses_mod:cyan_rose"
},
"weight": 1
}
]
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 64,
"xz_spread": 7,
"y_spread": 3
}
}

View file

@ -0,0 +1,41 @@
{
"type": "minecraft:flower",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:weighted_state_provider",
"entries": [
{
"data": {
"Name": "roses_mod:rose_flower"
},
"weight": 2
},
{
"data": {
"Name": "roses_mod:rose_flower"
},
"weight": 1
}
]
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 64,
"xz_spread": 7,
"y_spread": 3
}
}

View file

@ -0,0 +1,32 @@
{
"feature": "roses_mod:cyan_rose_bush",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 85
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:count",
"count": {
"type": "minecraft:clamped",
"max_inclusive": 3,
"min_inclusive": 0,
"source": {
"type": "minecraft:uniform",
"max_inclusive": 3,
"min_inclusive": -1
}
}
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -0,0 +1,19 @@
{
"feature": "roses_mod:cyan_rose_flower",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 45
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -0,0 +1,19 @@
{
"feature": "roses_mod:cyan_rose_flower",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 70
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -0,0 +1,19 @@
{
"feature": "roses_mod:cyan_rose_flower",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 90
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -0,0 +1,19 @@
{
"feature": "roses_mod:rose_flower",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 4
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -0,0 +1,19 @@
{
"feature": "roses_mod:rose_flower",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 32
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -0,0 +1,19 @@
{
"feature": "roses_mod:rose_flower",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 80
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -17,8 +17,6 @@ public class RosesDataGenerator implements DataGeneratorEntrypoint {
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);

View file

@ -4,16 +4,12 @@ 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;
@ -39,7 +35,6 @@ public class RosesLootTableProvider extends FabricBlockLootTableProvider {
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))));
.apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(min, max)))));
}
}

View file

@ -39,7 +39,7 @@ public class RosesRecipeProvider extends FabricRecipeProvider {
@Override
public String getName() {
return "";
return "RosesRecipeProvider";
}
}

View file

@ -20,6 +20,6 @@ public class RosesRegistryGenerator extends FabricDynamicRegistryProvider {
@Override
public String getName() {
return "";
return "RosesRegistryGenerator";
}
}

View file

@ -10,6 +10,8 @@ import net.minecraft.item.BlockItem
import net.minecraft.item.Item
import net.minecraft.registry.Registries
import net.minecraft.registry.Registry
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.RegistryKeys
import net.minecraft.util.Identifier
object RosesBlocks {
@ -18,51 +20,73 @@ object RosesBlocks {
FlowerBlock(
StatusEffects.INSTANT_DAMAGE,
6F,
AbstractBlock.Settings.copy(Blocks.POPPY),
AbstractBlock.Settings
.copy(Blocks.POPPY)
.registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(MOD_ID, "rose_flower"))),
),
Identifier.of(MOD_ID, "rose_flower"),
"rose_flower",
true,
)
val pottedRose: Block =
register(
FlowerPotBlock(
roseFlower,
AbstractBlock.Settings.copy(Blocks.POTTED_POPPY),
AbstractBlock.Settings
.copy(Blocks.POTTED_POPPY)
.registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(MOD_ID, "potted_rose"))),
),
Identifier.of(MOD_ID, "potted_rose"),
"potted_rose",
true,
)
val cyanRoseFlower: Block =
register(
FlowerBlock(
StatusEffects.INSTANT_HEALTH,
6F,
AbstractBlock.Settings.copy(Blocks.POPPY),
AbstractBlock.Settings
.copy(Blocks.POPPY)
.registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(MOD_ID, "cyan_rose"))),
),
Identifier.of(MOD_ID, "cyan_rose"),
"cyan_rose",
true,
)
val pottedCyan: Block =
register(
FlowerPotBlock(
cyanRoseFlower,
AbstractBlock.Settings.copy(Blocks.POTTED_POPPY),
AbstractBlock.Settings
.copy(Blocks.POTTED_POPPY)
.registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(MOD_ID, "potted_cyan"))),
),
Identifier.of(MOD_ID, "potted_cyan"),
"potted_cyan",
true,
)
val cyanRoseBush: Block =
register(
TallPlantBlock(
AbstractBlock.Settings.copy(Blocks.LARGE_FERN),
AbstractBlock.Settings
.copy(Blocks.LARGE_FERN)
.registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(MOD_ID, "cyan_rose_bush"))),
),
Identifier.of(MOD_ID, "cyan_rose_bush"),
"cyan_rose_bush",
true,
)
fun register(
block: Block,
id: Identifier,
name: String,
shouldRegisterItem: Boolean,
): Block {
// Register the block and its item.
val blockItem = BlockItem(block, Item.Settings())
val id: Identifier = Identifier.of(MOD_ID, name)
val key = RegistryKey.of(RegistryKeys.ITEM, id)
// Sometimes, you may not want to register an item for the block.
// Eg: if it's a technical block like `minecraft:air` or `minecraft:end_gateway`
if (shouldRegisterItem) {
val blockItem = BlockItem(block, Item.Settings().useBlockPrefixedTranslationKey().registryKey(key))
Registry.register(Registries.ITEM, id, blockItem)
}
return Registry.register(Registries.BLOCK, id, block)
}

View file

@ -1,5 +1,10 @@
package observer.nelle.roses
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents
import net.minecraft.item.ItemGroups
import net.minecraft.item.Items
object RosesCreativeTab {
// CREATIVE TABS
val roseTabEntry =

View file

@ -1,6 +1,7 @@
package observer.nelle.roses
import net.fabricmc.api.ModInitializer
import observer.nelle.roses.world.gen.RosesWorldGeneration
import org.slf4j.Logger
import org.slf4j.LoggerFactory

View file

@ -1,11 +1,13 @@
package observer.nelle.roses
import net.fabricmc.api.ClientModInitializer
/*import observer.nelle.roses.RosesBlocks.cyanRoseBush
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap
import net.minecraft.client.render.RenderLayer
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*/
import observer.nelle.roses.RosesBlocks.roseFlower
class RosesModClient : ClientModInitializer {
override fun onInitializeClient() {

View file

@ -37,6 +37,6 @@
"fabricloader": ">=${loader_version}",
"fabric-language-kotlin": ">=${kotlin_loader_version}",
"fabric": "*",
"minecraft": "*"
"minecraft": ">=1.21.2 <1.21.4"
}
}

View file

@ -1,7 +0,0 @@
{
"replace": false,
"values": [
"roses_mod:potted_rose",
"roses_mod:cyan_rose"
]
}

View file

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"roses_mod:cyan_rose_bush"
]
}