Private
Public Access
1
0

Merge pull request '1.20.1/feat/1-backport' (#2) from 1.20.1/feat/1-backport into 1.20.1/dev

Reviewed-on: #2
This commit is contained in:
2026-06-13 13:57:15 +00:00
87 changed files with 2410 additions and 347 deletions

4
.gitattributes vendored
View File

@ -22,6 +22,8 @@
*.skp filter=lfs diff=lfs merge=lfs -text
*.stl filter=lfs diff=lfs merge=lfs -text
*.ztl filter=lfs diff=lfs merge=lfs -text
*.mtl filter=lfs diff=lfs merge=lfs -text
*.bbmodel filter=lfs diff=lfs merge=lfs -text
# Audio
*.aif filter=lfs diff=lfs merge=lfs -text
*.aiff filter=lfs diff=lfs merge=lfs -text
@ -50,5 +52,3 @@
*.tif filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
*.kra filter=lfs diff=lfs merge=lfs -text
*.mtl filter=lfs diff=lfs merge=lfs -text
*.bbmodel filter=lfs diff=lfs merge=lfs -text

59
assets/images/README.md Normal file
View File

@ -0,0 +1,59 @@
# Composition guidelines
The following are guidelines for rendering image assets.
## General
### Color Management
- Filmic - Medium High Contrast
### World
- Global Illumination - 1.0
### Sun
- Strength - 5.0
### Volume
- Fournier-Forand
- IOR 1.0
- Density 0.01
## Icon
400 x 400 RGBA PNG
### Item
- Item should have a damped track to Camera and vice versa.
- No DOF.
### Block
- Camera position should be X=0.5, Y=1.0, Z=0.5.
- Camera angle should be X=90, Y=0, Z=150.
- Camera should have a damped track to block.
- Camera should have a rotation limit on the y axis.
- Camera no DOF.
- Camera orthographic @ scale 2.0.
## Banner
1200 x 400 RGB PNG
- Camera perspective @ focal length 50mm (1x).
- Camera DOF @ focus distance 5m (1x).
- Gap between icon and text should be 1 grid.
- Text is Minecraft font, size 72.
- Text has 4px stroke.
- Icon has default drop shadow.
## Logo
400 x 400 RGB PNG
- Camera perspective @ focal length 150mm (3x).
- Camera DOF @ focus distance 15m (3x).
## Card
200 x 300 RGB PNG
- Camera perspective @ focal length 150mm (3x).
- Camera DOF @ focus distance 15m (3x).
- Icon should be scaled down to half.
- Gap between icon and text should be 1 grid.
- Text is Minecraft font, size 26.
- Text has 2px stroke.
- Icon has default drop shadow.

BIN
assets/images/blender/wildflowers_backport.blend (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/blender/world-Alpha.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/blender/world-RGB.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/blender/world-RGBA.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/blender/world.mtl (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/blender/world.obj (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/renders/banner-vignette.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/renders/banner.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/renders/card-vignette.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/renders/card.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/renders/icon.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/renders/logo-vignette.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/renders/logo.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/web/banner.jpg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/web/banner.kra (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/web/card.jpg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/web/card.kra (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/web/logo.jpg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/web/logo.kra (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/images/web/logo.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,15 +1,28 @@
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
}
plugins {
id 'eclipse'
id 'idea'
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
apply plugin: 'org.spongepowered.mixin'
group = mod_group_id
version = mod_version
base {
archivesName = mod_id
archivesName = "${mod_id}-${minecraft_version}"
}
java {
@ -17,62 +30,18 @@ java {
}
minecraft {
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
//
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: mapping_channel, version: mapping_version
mappings channel: mapping_channel, version: "$mapping_version"
// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
// In most cases, it is not necessary to enable.
// enableEclipsePrepareRuns = true
// enableIdeaPrepareRuns = true
// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
// It is REQUIRED to be set to true for this template to function.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
copyIdeResources = true
// When true, this property will add the folder name of all declared run configurations to generated IDE run configurations.
// The folder name can be set on a run configuration using the "folderName" property.
// By default, the folder name of a run configuration is the name of the Gradle project containing it.
// generateRunFolders = true
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/
// This property enables access transformers for use in development.
// They will be applied to the Minecraft artifact.
// The access transformer file can be anywhere in the project.
// However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge.
// This default location is a best practice to automatically put the file in the right place in the final jar.
// See https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/ for more information.
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
// applies to all the run configs below
configureEach {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
mods {
@ -83,7 +52,6 @@ minecraft {
}
client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
}
@ -92,72 +60,51 @@ minecraft {
args '--nogui'
}
// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id
}
data {
// example of overriding the workingDirectory set in configureEach above
workingDirectory project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
mixin {
config "${mod_id}.mixins.json"
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
repositories {
// Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
// flatDir {
// dir 'libs'
// }
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
forRepositories(fg.repository) // Only add this if you're using ForgeGradle, otherwise remove this line
filter {
includeGroup "maven.modrinth"
}
}
}
dependencies {
// Specify the version of Minecraft to use.
// Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
// The "userdev" classifier will be requested and setup by ForgeGradle.
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
// Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
// The group id is ignored when searching -- in this case, it is "blank"
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
// For more info:
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
forge_version : forge_version, forge_version_range: forge_version_range,
loader_version_range: loader_version_range,
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors : mod_authors, mod_description: mod_description,]
mod_authors : mod_authors, mod_description: mod_description]
inputs.properties replaceProperties
@ -166,22 +113,20 @@ tasks.named('processResources', ProcessResources).configure {
}
}
// Example for how to get properties into the manifest for reading at runtime.
tasks.named('jar', Jar).configure {
manifest {
attributes(["Specification-Title" : mod_id,
"Specification-Vendor" : mod_authors,
"Specification-Version" : "1", // We are version 1 of ourselves
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : mod_authors,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")])
}
// This is the preferred method to reobfuscate your jar file
finalizedBy 'reobfJar'
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
options.encoding = 'UTF-8'
}

View File

@ -1,49 +1,20 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
# The Minecraft version must agree with the Forge version to get a valid artifact
minecraft_version=1.20.1
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.1,1.21)
# The Forge version must agree with the Minecraft version to get a valid artifact
forge_version=47.4.20
# The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[47,)
# The loader version range can only use the major version of Forge/FML as bounds
loader_version_range=[47,)
# The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
#
# | Channel | Version | |
# |-----------|----------------------|--------------------------------------------------------------------------------|
# | official | MCVersion | Official field/method names from Mojang mapping files |
# | parchment | YYYY.MM.DD-MCVersion | Open community-sourced parameter names and javadocs layered on top of official |
#
# You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
# See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
#
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
mapping_channel=official
# The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel.
mapping_version=1.20.1
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=wildflowers_backport
# The human-readable display name for the mod.
mod_name=wildflowers_backport
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_name=Wildflowers Backport
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=1.0.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=dev.micle
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=
mod_authors=Micle
mod_description=Wildflowers backport from 1.21.5.
minecraft_version=1.20.1
minecraft_version_range=[1.20.1,1.21)
forge_version=47.4.20
forge_version_range=[47,)
loader_version_range=[47,)
mapping_channel=parchment
mapping_version=2023.09.03-1.20.1

View File

@ -5,6 +5,7 @@ pluginManagement {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
maven { url = 'https://maven.parchmentmc.org' }
}
}
@ -12,4 +13,4 @@ plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
}
rootProject.name = 'wildflowers_backport'
rootProject.name = "${mod_id}-${minecraft_version}"

View File

@ -0,0 +1,160 @@
{
"multipart": [
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_1"
},
"when": {
"facing": "north",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_1",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_1",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_1",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_2"
},
"when": {
"facing": "north",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_2",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_2",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_2",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_3"
},
"when": {
"facing": "north",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_3",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_3",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_3",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_4"
},
"when": {
"facing": "north",
"flower_amount": "4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_4",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_4",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "4"
}
},
{
"apply": {
"model": "wildflowers_backport:block/wildflowers_4",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "4"
}
}
]
}

View File

@ -0,0 +1,8 @@
{
"parent": "wildflowers_backport:block/flowerbed_1",
"render_type": "minecraft:cutout",
"textures": {
"flowerbed": "wildflowers_backport:block/wildflowers",
"stem": "wildflowers_backport:block/wildflowers_stem"
}
}

View File

@ -0,0 +1,8 @@
{
"parent": "wildflowers_backport:block/flowerbed_2",
"render_type": "minecraft:cutout",
"textures": {
"flowerbed": "wildflowers_backport:block/wildflowers",
"stem": "wildflowers_backport:block/wildflowers_stem"
}
}

View File

@ -0,0 +1,8 @@
{
"parent": "wildflowers_backport:block/flowerbed_3",
"render_type": "minecraft:cutout",
"textures": {
"flowerbed": "wildflowers_backport:block/wildflowers",
"stem": "wildflowers_backport:block/wildflowers_stem"
}
}

View File

@ -0,0 +1,8 @@
{
"parent": "wildflowers_backport:block/flowerbed_4",
"render_type": "minecraft:cutout",
"textures": {
"flowerbed": "wildflowers_backport:block/wildflowers",
"stem": "wildflowers_backport:block/wildflowers_stem"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "wildflowers_backport:item/wildflowers"
}
}

View File

@ -0,0 +1,5 @@
{
"values": [
"wildflowers_backport:wildflowers"
]
}

View File

@ -0,0 +1,5 @@
{
"values": [
"wildflowers_backport:wildflowers"
]
}

View File

@ -0,0 +1,5 @@
{
"values": [
"wildflowers_backport:wildflowers"
]
}

View File

@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_recipe": {
"conditions": {
"recipe": "wildflowers_backport:yellow_dye_from_wildflowers"
},
"trigger": "minecraft:recipe_unlocked"
},
"has_wildflowers": {
"conditions": {
"items": [
{
"items": [
"wildflowers_backport:wildflowers"
]
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"requirements": [
[
"has_wildflowers",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"wildflowers_backport:yellow_dye_from_wildflowers"
]
},
"sends_telemetry_event": false
}

View File

@ -0,0 +1,9 @@
{
"type": "forge:add_features",
"biomes": [
"minecraft:birch_forest",
"minecraft:old_growth_birch_forest"
],
"features": "wildflowers_backport:wildflowers_birch_forest",
"step": "vegetal_decoration"
}

View File

@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "minecraft:meadow",
"features": "wildflowers_backport:wildflowers_meadow",
"step": "vegetal_decoration"
}

View File

@ -0,0 +1,92 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"block": "wildflowers_backport:wildflowers",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "1"
}
}
],
"functions": [
{
"add": false,
"count": 1.0,
"function": "minecraft:set_count"
}
],
"name": "wildflowers_backport:wildflowers"
},
{
"type": "minecraft:item",
"conditions": [
{
"block": "wildflowers_backport:wildflowers",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "2"
}
}
],
"functions": [
{
"add": false,
"count": 2.0,
"function": "minecraft:set_count"
}
],
"name": "wildflowers_backport:wildflowers"
},
{
"type": "minecraft:item",
"conditions": [
{
"block": "wildflowers_backport:wildflowers",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "3"
}
}
],
"functions": [
{
"add": false,
"count": 3.0,
"function": "minecraft:set_count"
}
],
"name": "wildflowers_backport:wildflowers"
},
{
"type": "minecraft:item",
"conditions": [
{
"block": "wildflowers_backport:wildflowers",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "4"
}
}
],
"functions": [
{
"add": false,
"count": 4.0,
"function": "minecraft:set_count"
}
],
"name": "wildflowers_backport:wildflowers"
}
],
"rolls": 1.0
}
],
"random_sequence": "wildflowers_backport:blocks/wildflowers"
}

View File

@ -0,0 +1,13 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"group": "yellow_dye",
"ingredients": [
{
"item": "wildflowers_backport:wildflowers"
}
],
"result": {
"item": "minecraft:yellow_dye"
}
}

View File

@ -0,0 +1,189 @@
{
"type": "minecraft:flower",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:weighted_state_provider",
"entries": [
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "4"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "4"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "4"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "4"
}
},
"weight": 1
}
]
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 64,
"xz_spread": 6,
"y_spread": 2
}
}

View File

@ -0,0 +1,189 @@
{
"type": "minecraft:flower",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:weighted_state_provider",
"entries": [
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "1"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "2"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "3"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "north",
"flower_amount": "4"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "east",
"flower_amount": "4"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "south",
"flower_amount": "4"
}
},
"weight": 1
},
{
"data": {
"Name": "wildflowers_backport:wildflowers",
"Properties": {
"facing": "west",
"flower_amount": "4"
}
},
"weight": 1
}
]
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 8,
"xz_spread": 6,
"y_spread": 2
}
}

View File

@ -0,0 +1,23 @@
{
"feature": "wildflowers_backport:wildflowers_birch_forest",
"placement": [
{
"type": "minecraft:count",
"count": 3
},
{
"type": "minecraft:rarity_filter",
"chance": 2
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View File

@ -0,0 +1,21 @@
{
"feature": "wildflowers_backport:wildflowers_meadow",
"placement": [
{
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 5,
"noise_level": -0.8
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}

View File

@ -1,51 +0,0 @@
package dev.micle.wildflowers_backport;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.config.ModConfigEvent;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
// An example config class. This is not required, but it's a good idea to have one to keep your config organized.
// Demonstrates how to use Forge's config APIs
@Mod.EventBusSubscriber(modid = WildflowersBackport.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class Config {
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
private static final ForgeConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER.comment("Whether to log the dirt block on common setup").define("logDirtBlock", true);
private static final ForgeConfigSpec.IntValue MAGIC_NUMBER = BUILDER.comment("A magic number").defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE);
public static final ForgeConfigSpec.ConfigValue<String> MAGIC_NUMBER_INTRODUCTION = BUILDER.comment("What you want the introduction message to be for the magic number").define("magicNumberIntroduction", "The magic number is... ");
// a list of strings that are treated as resource locations for items
private static final ForgeConfigSpec.ConfigValue<List<? extends String>> ITEM_STRINGS = BUILDER.comment("A list of items to log on common setup.").defineListAllowEmpty("items", List.of("minecraft:iron_ingot"), Config::validateItemName);
static final ForgeConfigSpec SPEC = BUILDER.build();
public static boolean logDirtBlock;
public static int magicNumber;
public static String magicNumberIntroduction;
public static Set<Item> items;
private static boolean validateItemName(final Object obj) {
return obj instanceof final String itemName && ForgeRegistries.ITEMS.containsKey(new ResourceLocation(itemName));
}
@SubscribeEvent
static void onLoad(final ModConfigEvent event) {
logDirtBlock = LOG_DIRT_BLOCK.get();
magicNumber = MAGIC_NUMBER.get();
magicNumberIntroduction = MAGIC_NUMBER_INTRODUCTION.get();
// convert the list of strings into a set of items
items = ITEM_STRINGS.get().stream().map(itemName -> ForgeRegistries.ITEMS.getValue(new ResourceLocation(itemName))).collect(Collectors.toSet());
}
}

View File

@ -1,118 +1,34 @@
package dev.micle.wildflowers_backport;
import com.mojang.logging.LogUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
import dev.micle.wildflowers_backport.proxy.IProxy;
import dev.micle.wildflowers_backport.proxy.Proxy;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.slf4j.Logger;
// The value here should match an entry in the META-INF/mods.toml file
@Mod(WildflowersBackport.MODID)
@Mod(WildflowersBackport.MOD_ID)
public class WildflowersBackport {
public static final String MOD_ID = "wildflowers_backport";
public static final Logger LOGGER = LogUtils.getLogger();
private static FMLJavaModLoadingContext fmlJavaModLoadingContext;
private static IProxy proxy;
// Define mod id in a common place for everything to reference
public static final String MODID = "wildflowers_backport";
// Directly reference a slf4j logger
private static final Logger LOGGER = LogUtils.getLogger();
// Create a Deferred Register to hold Blocks which will all be registered under the "wildflowers_backport" namespace
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
// Create a Deferred Register to hold Items which will all be registered under the "wildflowers_backport" namespace
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
// Create a Deferred Register to hold CreativeModeTabs which will all be registered under the "wildflowers_backport" namespace
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
public WildflowersBackport(FMLJavaModLoadingContext context) {
fmlJavaModLoadingContext = context;
// Creates a new Block with the id "wildflowers_backport:example_block", combining the namespace and path
public static final RegistryObject<Block> EXAMPLE_BLOCK = BLOCKS.register("example_block", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.STONE)));
// Creates a new BlockItem with the id "wildflowers_backport:example_block", combining the namespace and path
public static final RegistryObject<Item> EXAMPLE_BLOCK_ITEM = ITEMS.register("example_block", () -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties()));
// Creates a new food item with the id "wildflowers_backport:example_id", nutrition 1 and saturation 2
public static final RegistryObject<Item> EXAMPLE_ITEM = ITEMS.register("example_item", () -> new Item(new Item.Properties().food(new FoodProperties.Builder().alwaysEat().nutrition(1).saturationMod(2f).build())));
// Creates a creative tab with the id "wildflowers_backport:example_tab" for the example item, that is placed after the combat tab
public static final RegistryObject<CreativeModeTab> EXAMPLE_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder().withTabsBefore(CreativeModeTabs.COMBAT).icon(() -> EXAMPLE_ITEM.get().getDefaultInstance()).displayItems((parameters, output) -> {
output.accept(EXAMPLE_ITEM.get()); // Add the example item to the tab. For your own tabs, this method is preferred over the event
}).build());
public WildflowersBackport() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
// Register the commonSetup method for modloading
modEventBus.addListener(this::commonSetup);
// Register the Deferred Register to the mod event bus so blocks get registered
BLOCKS.register(modEventBus);
// Register the Deferred Register to the mod event bus so items get registered
ITEMS.register(modEventBus);
// Register the Deferred Register to the mod event bus so tabs get registered
CREATIVE_MODE_TABS.register(modEventBus);
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
// Register the item to a creative tab
modEventBus.addListener(this::addCreative);
// Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC);
proxy = DistExecutor.safeRunForDist(
() -> Proxy.Client::new,
() -> Proxy.Server::new
);
}
private void commonSetup(final FMLCommonSetupEvent event) {
// Some common setup code
LOGGER.info("HELLO FROM COMMON SETUP");
LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
if (Config.logDirtBlock) LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
LOGGER.info(Config.magicNumberIntroduction + Config.magicNumber);
Config.items.forEach((item) -> LOGGER.info("ITEM >> {}", item.toString()));
public static FMLJavaModLoadingContext getFmlJavaModLoadingContext() {
return fmlJavaModLoadingContext;
}
// Add the example block item to the building blocks tab
private void addCreative(BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.BUILDING_BLOCKS) event.accept(EXAMPLE_BLOCK_ITEM);
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public void onServerStarting(ServerStartingEvent event) {
// Do something when the server starts
LOGGER.info("HELLO from server starting");
}
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public static class ClientModEvents {
@SubscribeEvent
public static void onClientSetup(FMLClientSetupEvent event) {
// Some client setup code
LOGGER.info("HELLO FROM CLIENT SETUP");
LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName());
}
public static IProxy getProxy() {
return proxy;
}
}

View File

@ -0,0 +1,107 @@
package dev.micle.wildflowers_backport.block;
import com.google.common.collect.ImmutableMap;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.NotNull;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.function.Function;
public class FlowerBedBlock extends BushBlock implements BonemealableBlock, SegmentableBlock {
public static final EnumProperty<Direction> FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final IntegerProperty AMOUNT = BlockStateProperties.FLOWER_AMOUNT;
private final Function<BlockState, VoxelShape> shapes;
public FlowerBedBlock(Properties pProperties) {
super(pProperties);
this.registerDefaultState(this.getStateDefinition().any().setValue(FACING, Direction.NORTH).setValue(AMOUNT, 1));
this.shapes = this.makeShapes();
}
private Function<BlockState, VoxelShape> makeShapes() {
return this.stateDefinition.getPossibleStates().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), this.getShapeCalculator(FACING, AMOUNT)))::get;
}
@Override
public BlockState rotate(BlockState blockState, LevelAccessor levelAccessor, BlockPos blockPos, Rotation rotation) {
return blockState.setValue(FACING, rotation.rotate(blockState.getValue(FACING)));
}
@Override
public @NotNull BlockState mirror(BlockState blockState, Mirror mirror) {
return blockState.rotate(mirror.getRotation(blockState.getValue(FACING)));
}
@Override
@ParametersAreNonnullByDefault
public boolean canBeReplaced(BlockState blockState, BlockPlaceContext blockPlaceContext) {
return this.canBeReplaced(blockState, blockPlaceContext, AMOUNT) ? true : super.canBeReplaced(blockState, blockPlaceContext);
}
@Override
@ParametersAreNonnullByDefault
public @NotNull VoxelShape getShape(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, CollisionContext collisionContext) {
return this.shapes.apply(blockState);
}
@Override
public double getShapeHeight() {
return 3.0;
}
@Override
public IntegerProperty getSegmentAmountProperty() {
return AMOUNT;
}
@Override
@ParametersAreNonnullByDefault
public BlockState getStateForPlacement(BlockPlaceContext blockPlaceContext) {
return this.getStateForPlacement(blockPlaceContext, this, AMOUNT, FACING);
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING, AMOUNT);
}
@Override
@ParametersAreNonnullByDefault
public boolean isValidBonemealTarget(LevelReader levelReader, BlockPos blockPos, BlockState blockState, boolean isClient) {
return true;
}
@Override
@ParametersAreNonnullByDefault
public boolean isBonemealSuccess(Level level, RandomSource randomSource, BlockPos blockPos, BlockState blockState) {
return true;
}
@Override
@ParametersAreNonnullByDefault
public void performBonemeal(ServerLevel serverLevel, RandomSource randomSource, BlockPos blockPos, BlockState blockState) {
int i = blockState.getValue(AMOUNT);
if (i < 4) {
serverLevel.setBlock(blockPos, blockState.setValue(AMOUNT, i + 1), 2);
} else {
popResource(serverLevel, blockPos, new ItemStack(this));
}
}
}

View File

@ -0,0 +1,29 @@
package dev.micle.wildflowers_backport.block;
import dev.micle.wildflowers_backport.WildflowersBackport;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.material.PushReaction;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class ModBlocks {
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, WildflowersBackport.MOD_ID);
public static RegistryObject<Block> WILDFLOWERS = BLOCKS.register("wildflowers",
() -> new FlowerBedBlock(BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.noCollission()
.sound(SoundType.PINK_PETALS)
.pushReaction(PushReaction.DESTROY)
)
);
public static void register(IEventBus modEventBus) {
BLOCKS.register(modEventBus);
}
}

View File

@ -0,0 +1,57 @@
package dev.micle.wildflowers_backport.block;
import dev.micle.wildflowers_backport.block.state.properties.ModBlockStateProperties;
import dev.micle.wildflowers_backport.util.ShapesUtils;
import dev.micle.wildflowers_backport.util.VoxelShapeUtils;
import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import java.util.Map;
import java.util.function.Function;
public interface SegmentableBlock {
int MIN_SEGMENT = 1;
int MAX_SEGMENT = 4;
IntegerProperty AMOUNT = ModBlockStateProperties.SEGMENT_AMOUNT;
default Function<BlockState, VoxelShape> getShapeCalculator(EnumProperty<Direction> dir, IntegerProperty property) {
Map<Direction, VoxelShape> map = ShapesUtils.rotateHorizontal(Block.box(0.0, 0.0, 0.0, 8.0, this.getShapeHeight(), 8.0));
return x -> {
VoxelShape voxelShape = Shapes.empty();
Direction direction = x.getValue(dir);
int i = x.getValue(property);
for (int j = 0; j < i; j++) {
voxelShape = Shapes.or(voxelShape, map.get(direction));
direction = direction.getCounterClockWise();
}
return VoxelShapeUtils.singleEncompassing(voxelShape);
};
}
default IntegerProperty getSegmentAmountProperty() {
return AMOUNT;
}
default double getShapeHeight() {
return 1.0;
}
default boolean canBeReplaced(BlockState blockState, BlockPlaceContext blockPlaceContext, IntegerProperty property) {
return !blockPlaceContext.isSecondaryUseActive() && blockPlaceContext.getItemInHand().is(blockState.getBlock().asItem()) && blockState.getValue(property) < 4;
}
default BlockState getStateForPlacement(BlockPlaceContext blockPlaceContext, Block block, IntegerProperty property, EnumProperty<Direction> dir) {
BlockState blockState = blockPlaceContext.getLevel().getBlockState(blockPlaceContext.getClickedPos());
return blockState.is(block)
? blockState.setValue(property, Math.min(4, blockState.getValue(property) + 1))
: block.defaultBlockState().setValue(dir, blockPlaceContext.getHorizontalDirection().getOpposite());
}
}

View File

@ -0,0 +1,7 @@
package dev.micle.wildflowers_backport.block.state.properties;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
public class ModBlockStateProperties {
public static final IntegerProperty SEGMENT_AMOUNT = IntegerProperty.create("segment_amount", 1, 4);
}

View File

@ -0,0 +1,36 @@
package dev.micle.wildflowers_backport.data;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.data.client.ModBlockStateProvider;
import dev.micle.wildflowers_backport.data.client.ModItemModelProvider;
import dev.micle.wildflowers_backport.data.server.*;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraftforge.common.data.BlockTagsProvider;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.data.event.GatherDataEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import java.util.concurrent.CompletableFuture;
@Mod.EventBusSubscriber(modid = WildflowersBackport.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class DataGenerators {
@SubscribeEvent
public static void gatherData(GatherDataEvent event) {
DataGenerator generator = event.getGenerator();
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
generator.addProvider(event.includeClient(), new ModBlockStateProvider(generator, existingFileHelper));
generator.addProvider(event.includeClient(), new ModItemModelProvider(generator, existingFileHelper));
BlockTagsProvider blockTagsProvider = new ModBlockTagsProvider(generator, lookupProvider, existingFileHelper);
generator.addProvider(event.includeServer(), blockTagsProvider);
generator.addProvider(event.includeServer(), new ModItemTagsProvider(generator, lookupProvider, blockTagsProvider.contentsGetter(), existingFileHelper));
generator.addProvider(event.includeServer(), new ModRecipeProvider(generator));
generator.addProvider(event.includeServer(), new ModLootTableProvider(generator));
generator.addProvider(event.includeServer(), new ModWorldGenProvider(generator, lookupProvider));
}
}

View File

@ -0,0 +1,54 @@
package dev.micle.wildflowers_backport.data.client;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.block.FlowerBedBlock;
import dev.micle.wildflowers_backport.block.ModBlocks;
import dev.micle.wildflowers_backport.util.DirectionUtils;
import net.minecraft.core.Direction;
import net.minecraft.data.DataGenerator;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.client.model.generators.BlockStateProvider;
import net.minecraftforge.client.model.generators.MultiPartBlockStateBuilder;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.RegistryObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class ModBlockStateProvider extends BlockStateProvider {
public ModBlockStateProvider(DataGenerator generator, ExistingFileHelper existingFileHelper) {
super(generator.getPackOutput(), WildflowersBackport.MOD_ID, existingFileHelper);
}
@Override
protected void registerStatesAndModels() {
flowerBedBlock(ModBlocks.WILDFLOWERS);
}
private void flowerBedBlock(RegistryObject<Block> block) {
String name = Objects.requireNonNull(block.getId()).getPath();
MultiPartBlockStateBuilder builder = getMultipartBuilder(block.get());
List<Integer> amounts = new ArrayList<>(List.of(1, 2, 3, 4));
for (int i = 1; i < 5; i++) {
for (Direction direction : Direction.Plane.HORIZONTAL) {
int yRot = DirectionUtils.getYRotation(direction);
builder.part()
.modelFile(models().withExistingParent(name + "_" + i, ResourceLocation.fromNamespaceAndPath(WildflowersBackport.MOD_ID, "block/flowerbed_" + i))
.texture("flowerbed", "block/" + name)
.texture("stem", "block/" + name + "_stem")
.renderType("cutout")
)
.rotationY(yRot)
.addModel()
.condition(FlowerBedBlock.FACING, direction)
.condition(FlowerBedBlock.AMOUNT, amounts.toArray(new Integer[0]))
.end();
}
amounts.remove(0);
}
}
}

View File

@ -0,0 +1,39 @@
package dev.micle.wildflowers_backport.data.client;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.block.ModBlocks;
import net.minecraft.data.DataGenerator;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.client.model.generators.ItemModelBuilder;
import net.minecraftforge.client.model.generators.ItemModelProvider;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import java.util.Objects;
public class ModItemModelProvider extends ItemModelProvider {
public ModItemModelProvider(DataGenerator generator, ExistingFileHelper existingFileHelper) {
super(generator.getPackOutput(), WildflowersBackport.MOD_ID, existingFileHelper);
}
@Override
public void registerModels() {
ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(this::blockItemModel);
}
private void blockItemModel(Block block) {
String name = Objects.requireNonNull(ForgeRegistries.BLOCKS.getKey(block)).getPath();
if (block == ModBlocks.WILDFLOWERS.get()) {
builder(getExistingFile(mcLoc("item/generated")), name);
} else {
withExistingParent(name, mcLoc("block/" + name));
}
}
private ItemModelBuilder builder(ModelFile itemGenerated, String name) {
return getBuilder(name).parent(itemGenerated).texture("layer0", "item/" + name);
}
}

View File

@ -0,0 +1,53 @@
package dev.micle.wildflowers_backport.data.loot;
import dev.micle.wildflowers_backport.block.FlowerBedBlock;
import dev.micle.wildflowers_backport.block.ModBlocks;
import net.minecraft.advancements.critereon.StatePropertiesPredicate;
import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.storage.loot.LootPool;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition;
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
import net.minecraftforge.registries.RegistryObject;
import org.jetbrains.annotations.NotNull;
import java.util.Set;
public class ModBlockLootTableProvider extends BlockLootSubProvider {
public ModBlockLootTableProvider() {
super(Set.of(), FeatureFlags.REGISTRY.allFlags());
}
@Override
protected void generate() {
this.add(ModBlocks.WILDFLOWERS.get(), this::wildflowersLootTable);
}
private LootTable.Builder wildflowersLootTable(Block block) {
LootPool.Builder pool = LootPool.lootPool();
for (int amount = FlowerBedBlock.MIN_SEGMENT; amount <= FlowerBedBlock.MAX_SEGMENT; amount++) {
pool.add(
LootItem.lootTableItem(block)
.when(LootItemBlockStatePropertyCondition.hasBlockStateProperties(block)
.setProperties(
StatePropertiesPredicate.Builder.properties()
.hasProperty(FlowerBedBlock.AMOUNT, amount)
)
)
.apply(SetItemCountFunction.setCount(ConstantValue.exactly(amount)))
);
}
return LootTable.lootTable().withPool(pool);
}
@Override
protected @NotNull Iterable<Block> getKnownBlocks() {
return ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get)::iterator;
}
}

View File

@ -0,0 +1,28 @@
package dev.micle.wildflowers_backport.data.server;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.block.ModBlocks;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraft.tags.BlockTags;
import net.minecraftforge.common.data.BlockTagsProvider;
import net.minecraftforge.common.data.ExistingFileHelper;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.concurrent.CompletableFuture;
public class ModBlockTagsProvider extends BlockTagsProvider {
public ModBlockTagsProvider(DataGenerator generator, CompletableFuture<HolderLookup.Provider> lookupProvider, ExistingFileHelper existingFileHelper) {
super(generator.getPackOutput(), lookupProvider, WildflowersBackport.MOD_ID, existingFileHelper);
}
@Override
@ParametersAreNonnullByDefault
protected void addTags(HolderLookup.Provider lookupProvider) {
this.tag(BlockTags.FLOWERS)
.add(ModBlocks.WILDFLOWERS.get());
this.tag(BlockTags.INSIDE_STEP_SOUND_BLOCKS)
.add(ModBlocks.WILDFLOWERS.get());
}
}

View File

@ -0,0 +1,26 @@
package dev.micle.wildflowers_backport.data.server;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.item.ModItems;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.common.data.ExistingFileHelper;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.concurrent.CompletableFuture;
public class ModItemTagsProvider extends ItemTagsProvider {
public ModItemTagsProvider(DataGenerator generator, CompletableFuture<HolderLookup.Provider> lookupProvider, CompletableFuture<TagLookup<Block>> blockTagLookup, ExistingFileHelper existingFileHelper) {
super(generator.getPackOutput(), lookupProvider, blockTagLookup, WildflowersBackport.MOD_ID, existingFileHelper);
}
@Override
@ParametersAreNonnullByDefault
protected void addTags(HolderLookup.Provider pProvider) {
this.tag(ItemTags.FLOWERS)
.add(ModItems.WILDFLOWERS.get());
}
}

View File

@ -0,0 +1,17 @@
package dev.micle.wildflowers_backport.data.server;
import dev.micle.wildflowers_backport.data.loot.ModBlockLootTableProvider;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.loot.LootTableProvider;
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import java.util.List;
import java.util.Set;
public class ModLootTableProvider extends LootTableProvider {
public ModLootTableProvider(DataGenerator generator) {
super(generator.getPackOutput(), Set.of(), List.of(
new LootTableProvider.SubProviderEntry(ModBlockLootTableProvider::new, LootContextParamSets.BLOCK)
));
}
}

View File

@ -0,0 +1,30 @@
package dev.micle.wildflowers_backport.data.server;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.item.ModItems;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.function.Consumer;
public class ModRecipeProvider extends RecipeProvider {
public ModRecipeProvider(DataGenerator generator) {
super(generator.getPackOutput());
}
@Override
@ParametersAreNonnullByDefault
protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.YELLOW_DYE, 1)
.requires(ModItems.WILDFLOWERS.get())
.unlockedBy("has_wildflowers", has(ModItems.WILDFLOWERS.get()))
.group("yellow_dye")
.save(consumer, ResourceLocation.fromNamespaceAndPath(WildflowersBackport.MOD_ID, "yellow_dye_from_wildflowers"));
}
}

View File

@ -0,0 +1,26 @@
package dev.micle.wildflowers_backport.data.server;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.worldgen.ModBiomeModifiers;
import dev.micle.wildflowers_backport.worldgen.ModConfiguredFeatures;
import dev.micle.wildflowers_backport.worldgen.ModPlacedFeatures;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.DataGenerator;
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
public class ModWorldGenProvider extends DatapackBuiltinEntriesProvider {
public static final RegistrySetBuilder BUILDER = new RegistrySetBuilder()
.add(Registries.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap)
.add(Registries.PLACED_FEATURE, ModPlacedFeatures::bootstrap)
.add(ForgeRegistries.Keys.BIOME_MODIFIERS, ModBiomeModifiers::bootstrap);
public ModWorldGenProvider(DataGenerator generator, CompletableFuture<HolderLookup.Provider> registries) {
super(generator.getPackOutput(), registries, BUILDER, Set.of(WildflowersBackport.MOD_ID));
}
}

View File

@ -0,0 +1,14 @@
package dev.micle.wildflowers_backport.event;
import dev.micle.wildflowers_backport.item.ModItems;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.BasicItemListing;
import net.minecraftforge.event.village.WandererTradesEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
public class WandererTradesEventHandler {
@SubscribeEvent
public void onWandererTradesEvent(WandererTradesEvent event) {
event.getGenericTrades().add(new BasicItemListing(1, new ItemStack(ModItems.WILDFLOWERS.get(), 1), 12, 1));
}
}

View File

@ -0,0 +1,27 @@
package dev.micle.wildflowers_backport.item;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.block.ModBlocks;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import java.util.Objects;
public class ModItems {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, WildflowersBackport.MOD_ID);
public static final RegistryObject<BlockItem> WILDFLOWERS = registerBlock(ModBlocks.WILDFLOWERS);
public static void register(IEventBus modEventBus) {
ITEMS.register(modEventBus);
}
private static RegistryObject<BlockItem> registerBlock(RegistryObject<Block> block) {
return ITEMS.register(Objects.requireNonNull(block.getId()).getPath(), () -> new BlockItem(block.get(), new Item.Properties()));
}
}

View File

@ -0,0 +1,34 @@
package dev.micle.wildflowers_backport.math;
import com.mojang.serialization.Codec;
import com.mojang.serialization.DataResult;
import net.minecraft.util.Mth;
public enum Quadrant {
R0(0),
R90(1),
R180(2),
R270(3);
public static final Codec<Quadrant> CODEC = Codec.INT.comapFlatMap(x -> {
return switch (Mth.positiveModulo(x, 360)) {
case 0 -> DataResult.success(R0);
case 90 -> DataResult.success(R90);
case 180 -> DataResult.success(R180);
case 270 -> DataResult.success(R270);
default -> DataResult.error(() -> "Invalid rotation " + x + " found, only 0/90/180/270 allowed");
};
}, y -> {
return switch (y) {
case R0 -> 0;
case R90 -> 90;
case R180 -> 180;
case R270 -> 270;
};
});
public final int shift;
Quadrant(final int shift) {
this.shift = shift;
}
}

View File

@ -0,0 +1,15 @@
package dev.micle.wildflowers_backport.mixin;
import it.unimi.dsi.fastutil.doubles.DoubleList;
import net.minecraft.world.phys.shapes.ArrayVoxelShape;
import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(ArrayVoxelShape.class)
public interface ArrayVoxelShapeAccessor {
@Invoker("<init>")
static ArrayVoxelShape wildflowers_backport$newArrayVoxelShape(DiscreteVoxelShape pShape, DoubleList pXs, DoubleList pYs, DoubleList pZs) {
throw new AssertionError();
}
}

View File

@ -0,0 +1,14 @@
package dev.micle.wildflowers_backport.mixin;
import net.minecraft.world.phys.shapes.CubeVoxelShape;
import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(CubeVoxelShape.class)
public interface CubeVoxelShapeAccessor {
@Invoker("<init>")
static CubeVoxelShape wildflowers_backport$newCubeVoxelShape(DiscreteVoxelShape pShape) {
throw new AssertionError();
}
}

View File

@ -0,0 +1,12 @@
package dev.micle.wildflowers_backport.mixin;
import com.mojang.math.OctahedralGroup;
import com.mojang.math.SymmetricGroup3;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(OctahedralGroup.class)
public interface OctahedralGroupAccessor {
@Accessor("permutation")
SymmetricGroup3 wildflowers_backport$getPermutation();
}

View File

@ -0,0 +1,18 @@
package dev.micle.wildflowers_backport.mixin;
import it.unimi.dsi.fastutil.doubles.DoubleList;
import net.minecraft.core.Direction;
import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(VoxelShape.class)
public interface VoxelShapeAccessor {
@Accessor("shape")
DiscreteVoxelShape wildflowers_backport$getShape();
@Invoker("getCoords")
DoubleList wildflowers_backport$getCoords(Direction.Axis pAxis);
}

View File

@ -0,0 +1,11 @@
package dev.micle.wildflowers_backport.proxy;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
public interface IProxy {
MinecraftServer getServer();
Player getClientPlayer();
Level getClientLevel();
}

View File

@ -0,0 +1,130 @@
package dev.micle.wildflowers_backport.proxy;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.block.ModBlocks;
import dev.micle.wildflowers_backport.event.WandererTradesEventHandler;
import dev.micle.wildflowers_backport.item.ModItems;
import dev.micle.wildflowers_backport.tab.ModCreativeTabs;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BiomeColors;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.ComposterBlock;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.AddReloadListenerEvent;
import net.minecraftforge.event.server.ServerStartedEvent;
import net.minecraftforge.event.server.ServerStoppingEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.event.lifecycle.*;
public class Proxy implements IProxy {
private static MinecraftServer server = null;
// Common setup
public Proxy() {
IEventBus modEventBus = WildflowersBackport.getFmlJavaModLoadingContext().getModEventBus();
ModBlocks.register(modEventBus);
ModItems.register(modEventBus);
ModCreativeTabs.register(modEventBus);
// Register mod event bus listeners
modEventBus.addListener(Proxy::setup);
modEventBus.addListener(Proxy::imcEnqueue);
modEventBus.addListener(Proxy::imcProcess);
// Register event bus listeners
MinecraftForge.EVENT_BUS.addListener(Proxy::onAddReloadListeners);
MinecraftForge.EVENT_BUS.addListener(Proxy::serverStarted);
MinecraftForge.EVENT_BUS.addListener(Proxy::serverStopping);
// Register event handlers
MinecraftForge.EVENT_BUS.register(new WandererTradesEventHandler());
}
private static void setup(FMLCommonSetupEvent event) {
ComposterBlock.COMPOSTABLES.put(ModItems.WILDFLOWERS.get().asItem(), 0.3F);
}
private static void imcEnqueue(InterModEnqueueEvent event) {}
private static void imcProcess(InterModProcessEvent event) {}
private static void onAddReloadListeners(AddReloadListenerEvent event) {}
private static void serverStarted(ServerStartedEvent event) {
server = event.getServer();
}
private static void serverStopping(ServerStoppingEvent event) {
server = null;
}
@Override
public MinecraftServer getServer() {
return server;
}
@Override
public Player getClientPlayer() {
return null;
}
@Override
public Level getClientLevel() {
return null;
}
// Client setup
public static class Client extends Proxy {
public Client() {
IEventBus modEventBus = WildflowersBackport.getFmlJavaModLoadingContext().getModEventBus();
// Register mod event bus listeners
modEventBus.addListener(Client::setup);
modEventBus.addListener(Client::postSetup);
modEventBus.addListener(Client::registerBlockColors);
}
private static void setup(FMLClientSetupEvent event) {}
private static void postSetup(FMLLoadCompleteEvent event) {}
private static void registerBlockColors(RegisterColorHandlersEvent.Block event) {
event.register(
(blockState, level, blockPos, tintIndex) -> {
if (level == null || blockPos == null) return 0;
return BiomeColors.getAverageGrassColor(level, blockPos);
},
ModBlocks.WILDFLOWERS.get()
);
}
@Override
@OnlyIn(Dist.CLIENT)
public Player getClientPlayer() {
return Minecraft.getInstance().player;
}
@Override
@OnlyIn(Dist.CLIENT)
public Level getClientLevel() {
return Minecraft.getInstance().level;
}
}
// Server setup
public static class Server extends Proxy {
public Server() {
// Register mod event bus listeners
IEventBus modEventBus = WildflowersBackport.getFmlJavaModLoadingContext().getModEventBus();
modEventBus.addListener(Server::setup);
}
private static void setup(FMLDedicatedServerSetupEvent event) {}
}
}

View File

@ -0,0 +1,28 @@
package dev.micle.wildflowers_backport.tab;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.block.ModBlocks;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;
public class ModCreativeTabs {
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, WildflowersBackport.MOD_ID);
public static final RegistryObject<CreativeModeTab> MAIN_TAB = CREATIVE_MODE_TABS.register("main",
() -> CreativeModeTab.builder()
.title(Component.translatable(String.format("itemGroup.%s.main", WildflowersBackport.MOD_ID)))
.icon(ModBlocks.WILDFLOWERS.get().asItem()::getDefaultInstance)
.displayItems((itemDisplayParams, output) -> {
output.accept(ModBlocks.WILDFLOWERS.get());
})
.build()
);
public static void register(IEventBus modEventBus) {
CREATIVE_MODE_TABS.register(modEventBus);
}
}

View File

@ -0,0 +1,13 @@
package dev.micle.wildflowers_backport.util;
import net.minecraft.core.Direction;
public class DirectionAxisUtils {
public static boolean choose(Direction.Axis axis, boolean x, boolean y, boolean z) {
return switch (axis) {
case X -> x;
case Y -> y;
case Z -> z;
};
}
}

View File

@ -0,0 +1,14 @@
package dev.micle.wildflowers_backport.util;
import net.minecraft.core.Direction;
public class DirectionUtils {
public static int getYRotation(Direction direction) {
return switch (direction) {
case EAST -> 90;
case SOUTH -> 180;
case WEST -> 270;
default -> 0;
};
}
}

View File

@ -0,0 +1,37 @@
package dev.micle.wildflowers_backport.util;
import com.mojang.math.OctahedralGroup;
import dev.micle.wildflowers_backport.math.Quadrant;
import dev.micle.wildflowers_backport.mixin.OctahedralGroupAccessor;
import net.minecraft.Util;
import net.minecraft.core.Direction;
public class OctahedralGroupUtils {
private static final Direction.Axis[] AXES = Direction.Axis.values();
private static final OctahedralGroup[][] XY_TABLE = Util.make(new OctahedralGroup[Quadrant.values().length][Quadrant.values().length], x -> {
for (Quadrant quadrant : Quadrant.values()) {
for (Quadrant quadrant1 : Quadrant.values()) {
OctahedralGroup octahedralGroup = OctahedralGroup.IDENTITY;
for (int i = 0; i < quadrant1.shift; i++) {
octahedralGroup = octahedralGroup.compose(OctahedralGroup.ROT_90_Y_NEG);
}
for (int j = 0; j < quadrant.shift; j++) {
octahedralGroup = octahedralGroup.compose(OctahedralGroup.ROT_90_X_NEG);
}
x[quadrant.ordinal()][quadrant1.ordinal()] = octahedralGroup;
}
}
});
public static Direction.Axis permute(OctahedralGroup octahedralGroup, Direction.Axis axis) {
return AXES[((OctahedralGroupAccessor) (Object) octahedralGroup).wildflowers_backport$getPermutation().permutation(axis.ordinal())];
}
public static OctahedralGroup fromXYAngles(Quadrant quadrant, Quadrant quadrant1) {
return XY_TABLE[quadrant.ordinal()][quadrant1.ordinal()];
}
}

View File

@ -0,0 +1,93 @@
package dev.micle.wildflowers_backport.util;
import com.google.common.collect.Maps;
import com.mojang.math.OctahedralGroup;
import dev.micle.wildflowers_backport.math.Quadrant;
import dev.micle.wildflowers_backport.mixin.ArrayVoxelShapeAccessor;
import dev.micle.wildflowers_backport.mixin.CubeVoxelShapeAccessor;
import dev.micle.wildflowers_backport.mixin.VoxelShapeAccessor;
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
import it.unimi.dsi.fastutil.doubles.DoubleList;
import net.minecraft.core.Direction;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CubeVoxelShape;
import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
import net.minecraft.world.phys.shapes.VoxelShape;
import java.util.Map;
public class ShapesUtils {
private static final Vec3 BLOCK_CENTER = new Vec3(0.5, 0.5, 0.5);
public static VoxelShape rotate(VoxelShape voxelShape, OctahedralGroup octahedralGroup) {
return rotate(voxelShape, octahedralGroup, BLOCK_CENTER);
}
public static VoxelShape rotate(VoxelShape voxelShape, OctahedralGroup octahedralGroup, Vec3 vec3) {
if (octahedralGroup == OctahedralGroup.IDENTITY) {
return voxelShape;
} else {
DiscreteVoxelShape discreteVoxelShape = ((VoxelShapeAccessor) voxelShape).wildflowers_backport$getShape();
if (voxelShape instanceof CubeVoxelShape && BLOCK_CENTER.equals(vec3)) {
return CubeVoxelShapeAccessor.wildflowers_backport$newCubeVoxelShape(discreteVoxelShape);
} else {
Direction.Axis direction$axis = OctahedralGroupUtils.permute(octahedralGroup, Direction.Axis.X);
Direction.Axis direction$axis1 = OctahedralGroupUtils.permute(octahedralGroup, Direction.Axis.Y);
Direction.Axis direction$axis2 = OctahedralGroupUtils.permute(octahedralGroup, Direction.Axis.Z);
DoubleList doubleList = ((VoxelShapeAccessor) voxelShape).wildflowers_backport$getCoords(direction$axis);
DoubleList doubleList1 = ((VoxelShapeAccessor) voxelShape).wildflowers_backport$getCoords(direction$axis1);
DoubleList doubleList2 = ((VoxelShapeAccessor) voxelShape).wildflowers_backport$getCoords(direction$axis2);
boolean flag = octahedralGroup.inverts(direction$axis);
boolean flag1 = octahedralGroup.inverts(direction$axis1);
boolean flag2 = octahedralGroup.inverts(direction$axis2);
boolean flag3 = DirectionAxisUtils.choose(direction$axis, flag, flag1, flag2);
boolean flag4 = DirectionAxisUtils.choose(direction$axis1, flag, flag1, flag2);
boolean flag5 = DirectionAxisUtils.choose(direction$axis2, flag, flag1, flag2);
return ArrayVoxelShapeAccessor.wildflowers_backport$newArrayVoxelShape(
discreteVoxelShape,
makeAxis(doubleList, flag3, vec3.get(direction$axis), vec3.x),
makeAxis(doubleList1, flag4, vec3.get(direction$axis1), vec3.y),
makeAxis(doubleList2, flag5, vec3.get(direction$axis2), vec3.z)
);
}
}
}
public static Map<Direction, VoxelShape> rotateHorizontal(VoxelShape voxelShape) {
return rotateHorizontal(voxelShape, BLOCK_CENTER);
}
public static Map<Direction, VoxelShape> rotateHorizontal(VoxelShape voxelShape, Vec3 vec3) {
return Maps.newEnumMap(
Map.of(
Direction.NORTH,
voxelShape,
Direction.EAST,
rotate(voxelShape, OctahedralGroupUtils.fromXYAngles(Quadrant.R0, Quadrant.R90), vec3),
Direction.SOUTH,
rotate(voxelShape, OctahedralGroupUtils.fromXYAngles(Quadrant.R0, Quadrant.R180), vec3),
Direction.WEST,
rotate(voxelShape, OctahedralGroupUtils.fromXYAngles(Quadrant.R0, Quadrant.R270), vec3)
)
);
}
public static DoubleList makeAxis(DoubleList doubleList, boolean flag, double d1, double d2) {
if (!flag && d1 == d2) {
return doubleList;
} else {
int i = doubleList.size();
DoubleList doubleList1 = new DoubleArrayList(i);
int j = flag ? -1 : 1;
for (int k = flag ? i - 1 : 0; k >= 0 && k < i; k += j) {
doubleList1.add(d2 + j * (doubleList.getDouble(k) - d1));
}
return doubleList1;
}
}
}

View File

@ -0,0 +1,20 @@
package dev.micle.wildflowers_backport.util;
import net.minecraft.core.Direction;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
public class VoxelShapeUtils {
public static VoxelShape singleEncompassing(VoxelShape voxelShape) {
return voxelShape.isEmpty()
? Shapes.empty()
: Shapes.box(
voxelShape.min(Direction.Axis.X),
voxelShape.min(Direction.Axis.Y),
voxelShape.min(Direction.Axis.Z),
voxelShape.max(Direction.Axis.X),
voxelShape.max(Direction.Axis.Y),
voxelShape.max(Direction.Axis.Z)
);
}
}

View File

@ -0,0 +1,42 @@
package dev.micle.wildflowers_backport.worldgen;
import dev.micle.wildflowers_backport.WildflowersBackport;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.HolderSet;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraftforge.common.world.BiomeModifier;
import net.minecraftforge.common.world.ForgeBiomeModifiers;
import net.minecraftforge.registries.ForgeRegistries;
public class ModBiomeModifiers {
public static final ResourceKey<BiomeModifier> ADD_WILDFLOWERS_MEADOW = registerKey("add_wildflowers_meadow");
public static final ResourceKey<BiomeModifier> ADD_WILDFLOWERS_BIRCH_FOREST = registerKey("add_wildflowers_birch_forest");
public static void bootstrap(BootstapContext<BiomeModifier> context) {
HolderGetter<PlacedFeature> placedFeatures = context.lookup(Registries.PLACED_FEATURE);
HolderGetter<Biome> biomes = context.lookup(Registries.BIOME);
context.register(ADD_WILDFLOWERS_MEADOW, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(
HolderSet.direct(biomes.getOrThrow(Biomes.MEADOW)),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.WILDFLOWERS_MEADOW)),
GenerationStep.Decoration.VEGETAL_DECORATION
));
context.register(ADD_WILDFLOWERS_BIRCH_FOREST, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(
HolderSet.direct(biomes.getOrThrow(Biomes.BIRCH_FOREST), biomes.getOrThrow(Biomes.OLD_GROWTH_BIRCH_FOREST)),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.WILDFLOWERS_BIRCH_FOREST)),
GenerationStep.Decoration.VEGETAL_DECORATION
));
}
private static ResourceKey<BiomeModifier> registerKey(String name) {
return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(WildflowersBackport.MOD_ID, name));
}
}

View File

@ -0,0 +1,74 @@
package dev.micle.wildflowers_backport.worldgen;
import dev.micle.wildflowers_backport.WildflowersBackport;
import dev.micle.wildflowers_backport.block.FlowerBedBlock;
import dev.micle.wildflowers_backport.block.ModBlocks;
import net.minecraft.core.Direction;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.random.SimpleWeightedRandomList;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.RandomPatchConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration;
import net.minecraft.world.level.levelgen.feature.stateproviders.WeightedStateProvider;
public class ModConfiguredFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> WILDFLOWERS_MEADOW = registerKey("wildflowers_meadow");
public static final ResourceKey<ConfiguredFeature<?, ?>> WILDFLOWERS_BIRCH_FOREST = registerKey("wildflowers_birch_forest");
public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> context) {
register(context, WILDFLOWERS_MEADOW, Feature.FLOWER, new RandomPatchConfiguration(
8,
6,
2,
PlacementUtils.onlyWhenEmpty(
Feature.SIMPLE_BLOCK,
new SimpleBlockConfiguration(
new WeightedStateProvider(createAllPossibleFlowerBedBlockEntries(ModBlocks.WILDFLOWERS.get()))
)
)
));
register(context, WILDFLOWERS_BIRCH_FOREST, Feature.FLOWER, new RandomPatchConfiguration(
64,
6,
2,
PlacementUtils.onlyWhenEmpty(
Feature.SIMPLE_BLOCK,
new SimpleBlockConfiguration(
new WeightedStateProvider(createAllPossibleFlowerBedBlockEntries(ModBlocks.WILDFLOWERS.get()))
)
)
));
}
public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) {
return ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.fromNamespaceAndPath(WildflowersBackport.MOD_ID, name));
}
private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(
BootstapContext<ConfiguredFeature<?, ?>> context,
ResourceKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration
) {
context.register(key, new ConfiguredFeature<>(feature, configuration));
}
private static SimpleWeightedRandomList<BlockState> createAllPossibleFlowerBedBlockEntries(Block block) {
SimpleWeightedRandomList.Builder<BlockState> builder = SimpleWeightedRandomList.<BlockState>builder();
for (int i = FlowerBedBlock.MIN_SEGMENT; i <= FlowerBedBlock.MAX_SEGMENT; i++) {
for (Direction direction : Direction.Plane.HORIZONTAL) {
builder.add(block.defaultBlockState().setValue(FlowerBedBlock.FACING, direction).setValue(FlowerBedBlock.AMOUNT, i), 1);
}
}
return builder.build();
}
}

View File

@ -0,0 +1,51 @@
package dev.micle.wildflowers_backport.worldgen;
import dev.micle.wildflowers_backport.WildflowersBackport;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.placement.*;
import java.util.List;
public class ModPlacedFeatures {
public static final ResourceKey<PlacedFeature> WILDFLOWERS_MEADOW = registerKey("wildflowers_meadow");
public static final ResourceKey<PlacedFeature> WILDFLOWERS_BIRCH_FOREST = registerKey("wildflowers_birch_forest");
public static void bootstrap(BootstapContext<PlacedFeature> context) {
HolderGetter<ConfiguredFeature<?, ?>> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE);
register(context, WILDFLOWERS_MEADOW, configuredFeatures.getOrThrow(ModConfiguredFeatures.WILDFLOWERS_MEADOW), List.of(
NoiseThresholdCountPlacement.of(-0.8, 5, 10),
InSquarePlacement.spread(),
HeightmapPlacement.onHeightmap(Heightmap.Types.MOTION_BLOCKING),
BiomeFilter.biome()
));
register(context, WILDFLOWERS_BIRCH_FOREST, configuredFeatures.getOrThrow(ModConfiguredFeatures.WILDFLOWERS_BIRCH_FOREST), List.of(
CountPlacement.of(3),
RarityFilter.onAverageOnceEvery(2),
InSquarePlacement.spread(),
HeightmapPlacement.onHeightmap(Heightmap.Types.MOTION_BLOCKING),
BiomeFilter.biome()
));
}
private static ResourceKey<PlacedFeature> registerKey(String name) {
return ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(WildflowersBackport.MOD_ID, name));
}
private static void register(
BootstapContext<PlacedFeature> context,
ResourceKey<PlacedFeature> key,
Holder<ConfiguredFeature<?, ?>> featureHolder,
List<PlacementModifier> modifiers
) {
context.register(key, new PlacedFeature(featureHolder, List.copyOf(modifiers)));
}
}

View File

@ -1,63 +1,30 @@
# This is an example mods.toml file. It contains the data relating to the loading mods.
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
# The overall format is standard TOML format, v0.5.0.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here: https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader = "javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion = "${loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
modLoader = "javafml"
loaderVersion = "${loader_version_range}"
license = "${mod_license}"
# A URL to refer people to when problems occur with this mod
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId = "${mod_id}" #mandatory
# The version number of the mod
version = "${mod_version}" #mandatory
# A display name for the mod
displayName = "${mod_name}" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
#logoFile="wildflowers_backport.png" #optional
# A text field displayed in the mod UI
#credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors = "${mod_authors}" #optional
# Display Test controls the display for your mod in the server connection screen
# MATCH_VERSION means that your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod.
# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod.
# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component.
# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value.
# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself.
#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional)
issueTrackerURL="https://gitea.micle.dev/minecraft-mods/wildflowers_backport/issues"
# The description text for the mod (multi line!) (#mandatory)
[[mods]]
modId = "${mod_id}"
version = "${mod_version}"
displayName = "${mod_name}"
#updateJSONURL="https://change.me.example.invalid/updates.json" # https://docs.minecraftforge.net/en/latest/misc/updatechecker/
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/"
logoFile="logo.jpg"
#credits=""
authors = "${mod_authors}"
displayTest="MATCH_VERSION" # MATCH_VERSION, IGNORE_SERVER_VERSION (server only), IGNORE_ALL_VERSION (client only), NONE (IExtensionPoint.DisplayTest)
description = '''${mod_description}'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies."${mod_id}"]] #optional
# the modid of the dependency
modId = "forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory = true #mandatory
# The version range of the dependency
versionRange = "${forge_version_range}" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
# BEFORE - This mod is loaded BEFORE the dependency
# AFTER - This mod is loaded AFTER the dependency
ordering = "NONE"
# Side this dependency is applied on - BOTH, CLIENT, or SERVER
side = "BOTH"# Here's another dependency
[[dependencies."${mod_id}"]]
modId = "forge"
mandatory = true
versionRange = "${forge_version_range}"
ordering = "NONE" # BEFORE, AFTER, NONE
side = "BOTH" # BOTH, CLIENT, SERVER
[[dependencies."${mod_id}"]]
modId = "minecraft"
mandatory = true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange = "${minecraft_version_range}"
ordering = "NONE"
side = "BOTH"

View File

@ -0,0 +1,4 @@
{
"itemGroup.wildflowers_backport.main": "Wildflowers Backport",
"block.wildflowers_backport.wildflowers": "Wildflowers"
}

View File

@ -0,0 +1,70 @@
{
"ambientocclusion": false,
"textures": {
"particle": "#flowerbed"
},
"elements": [
{
"from": [0, 2.99, 0],
"to": [8, 2.99, 8],
"faces": {
"up": {"uv": [0, 0, 8, 8], "texture": "#flowerbed"},
"down": {"uv": [0, 8, 8, 0], "texture": "#flowerbed"}
}
},
{
"from": [4.25, 0, -2.6],
"to": [4.25, 2.99, -1.6],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"east": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [3.75, 0, -2.1],
"to": [4.75, 2.99, -2.1],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"north": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [4.9, 0, 2.3],
"to": [4.9, 2.99, 3.3],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"east": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [4.4, 0, 2.8],
"to": [5.4, 2.99, 2.8],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"north": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [9.15, 0, -0.45],
"to": [9.15, 2.99, 0.55],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"east": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [8.65, 0, 0.05],
"to": [9.65, 2.99, 0.05],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"north": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 4, 1, 7], "texture": "#stem", "tintindex": 1}
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"ambientocclusion": false,
"textures": {
"particle": "#flowerbed"
},
"elements": [
{
"from": [0, 1, 8],
"to": [8, 1, 16],
"faces": {
"up": {"uv": [0, 8, 8, 16], "texture": "#flowerbed"},
"down": {"uv": [0, 16, 8, 8], "texture": "#flowerbed"}
}
},
{
"from": [0, 1, 8],
"to": [8, 1, 16],
"faces": {
"up": {"uv": [0, 8, 8, 16], "texture": "#flowerbed"},
"down": {"uv": [0, 16, 8, 8], "texture": "#flowerbed"}
}
},
{
"from": [10.15, 0, 5.25],
"to": [11.15, 1, 5.25],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 1]},
"faces": {
"north": {"uv": [0, 6, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 6, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [10.65, 0, 4.75],
"to": [10.65, 1, 5.75],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 1]},
"faces": {
"east": {"uv": [0, 6, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 6, 1, 7], "texture": "#stem", "tintindex": 1}
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"ambientocclusion": false,
"textures": {
"particle": "#flowerbed"
},
"elements": [
{
"from": [8, 2, 8],
"to": [16, 2, 16],
"faces": {
"up": {"uv": [8, 8, 16, 16], "texture": "#flowerbed"},
"down": {"uv": [8, 16, 16, 8], "texture": "#flowerbed"}
}
},
{
"from": [17.65, 0, 1.9],
"to": [18.65, 2, 1.9],
"rotation": {"angle": -45, "axis": "y", "origin": [0.5, 0, 0.5]},
"faces": {
"north": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [18.15, 0, 1.4],
"to": [18.15, 2, 2.4],
"rotation": {"angle": -45, "axis": "y", "origin": [0.5, 0, 0.5]},
"faces": {
"east": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [17.65, 0, -3.35],
"to": [17.65, 2, -2.35],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"east": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [17.15, 0, -2.85],
"to": [18.15, 2, -2.85],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"north": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [13.4, 0, -0.5],
"to": [13.4, 2, 0.5],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"east": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [12.9, 0, 0],
"to": [13.9, 2, 0],
"rotation": {"angle": -45, "axis": "y", "origin": [0, 0, 0]},
"faces": {
"north": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
}
]
}

View File

@ -0,0 +1,34 @@
{
"ambientocclusion": false,
"textures": {
"particle": "#flowerbed"
},
"elements": [
{
"from": [8, 2, 0],
"to": [16, 2, 8],
"faces": {
"up": {"uv": [8, 0, 16, 8], "texture": "#flowerbed"},
"down": {"uv": [8, 8, 16, 0], "texture": "#flowerbed"}
}
},
{
"from": [12.4, 0, -7.7],
"to": [12.4, 2, -6.7],
"rotation": {"angle": -45, "axis": "y", "origin": [-1, 0, -3]},
"faces": {
"east": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"west": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
},
{
"from": [11.9, 0, -7.2],
"to": [12.9, 2, -7.2],
"rotation": {"angle": -45, "axis": "y", "origin": [-1, 0, -3]},
"faces": {
"north": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1},
"south": {"uv": [0, 5, 1, 7], "texture": "#stem", "tintindex": 1}
}
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/main/resources/logo.jpg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,17 @@
{
"required": true,
"minVersion": "0.8",
"package": "dev.micle.wildflowers_backport.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
"OctahedralGroupAccessor",
"VoxelShapeAccessor",
"ArrayVoxelShapeAccessor",
"CubeVoxelShapeAccessor"
],
"client": [
],
"injectors": {
"defaultRequire": 1
}
}