Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Disable autocrlf on generated files, they always generate with LF
# Add any extra files or paths here to make git stop saying they
# are changed when only line endings change.
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
14 changes: 4 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
strategy:
matrix:
java: [ 17 ]
java: [ 21 ]
runs-on: ubuntu-latest
steps:

Expand All @@ -32,14 +32,8 @@ jobs:
- name: build
run: ./gradlew build

- name: Upload Fabric artifacts
- name: Upload Neoforge artifacts
uses: actions/upload-artifact@v4
with:
name: fabric-artifacts
path: fabric/build/libs/

- name: Upload Forge artifacts
uses: actions/upload-artifact@v4
with:
name: forge-artifacts
path: forge/build/libs/
name: neoforge-artifacts
path: build/libs/
37 changes: 22 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
build/
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# idea
out
*.ipr
run/
*.iws
out/
*.iml
.gradle/
output/
bin/
libs/
.idea

.classpath
.project
.idea/
classes/
.metadata
.vscode
.settings
*.launch
# gradle
build
.gradle

# other
eclipse
run
runs
run-data

repo
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Create cobblestone

# Create cobblestone (NeoForge)
Create cobblestone is a create mod addon that focusses on reducing the lag generated by cobblestone generators. Ideal for server wanting to keep the tps above 10 without buying a very expensive server. The mod does not only add cobblestone generators, but also stone generators, basalt generators, limestone generators and scoria generators.

## Download
[Modrinth](https://modrinth.com/mod/create-cobblestone)
[Curseforge](https://www.curseforge.com/minecraft/mc-mods/create-cobblestone)
[Curseforge](https://www.curseforge.com/minecraft/mc-mods/create-cobblestone)

## Crafting
### Cobblestone generator
Expand Down Expand Up @@ -39,7 +38,7 @@ The generator types are also configurable. By default are all enabled, except fo
## Custom generators
Custom generators can be added by installing a datapack. Custom generator types can have a custom stress, ratio and storage amount set. For an example pack check out the [deepslate generators datapack](https://modrinth.com/datapack/create-cobblestone-deepslate-generators).

### Technical
### Technical
Custom generator files are json files located in the datapack folder data/MOD/generator_types/TYPE.json with the following required content:
```json
{
Expand Down
24 changes: 24 additions & 0 deletions TEMPLATE_LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MIT License

Copyright (c) 2023 NeoForged project

This license applies to the template files as supplied by github.com/NeoForged/MDK


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
238 changes: 180 additions & 58 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,82 +1,204 @@
plugins {
id "architectury-plugin" version "3.4.+"
id "dev.architectury.loom" version "1.9.+" apply false
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
plugins {
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.107'
id 'idea'
}

architectury {
minecraft = rootProject.minecraft_version
tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}

subprojects {
apply plugin: "dev.architectury.loom"
// Formats the mod version to include the loader, Minecraft version, and build number (if present)
// example: 1.0.0+fabric-1.18.2-100
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}+neoforge-${minecraft_version}" + (buildNumber != null ? "-${buildNumber}" : "")
group = mod_group_id

loom {
silentMojangMappingsLicense()
repositories {
maven { url "https://maven.createmod.net" } // Ponder, Flywheel
maven { url "https://mvn.devos.one/snapshots" } // Registrate
maven { url "https://maven.blamejared.com" } // JEI
maven { url "https://maven.theillusivec4.top/" } // Curios API
maven { url 'https://maven.fallenbreath.me/releases' } // Conditional Mixin
maven { url "https://www.cursemaven.com" }
maven { url "https://api.modrinth.com/maven" }
maven { url "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // NeoForge config api port, needed by ponder
}

base {
archivesName = archives_base_name
}

// Mojang ships Java 21 to end users in 1.21.1, so mods should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

neoForge {
// Specify the version of NeoForge to use.
version = project.neo_version

parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}

// This line is optional. Access Transformers are automatically detected
// accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
client()

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

server {
server()
programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

// 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 {
type = "gameTestServer"
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

runs.configureEach {
vmArg("-XX:+AllowEnhancedClassRedefinition")
vmArg("-XX:+IgnoreUnrecognizedVMOptions")
vmArg("-Dmixin.debug.export=true")
vmArg("-Dmixin.env.remapRefMap=true")
vmArg("-Dmixin.env.refMapRemappingFile=${projectDir}/build/createSrgToMcp/output.srg")
data {
data()

if (project.name == "forge")
programArg("-mixin.config=create.mixins.json")
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// gameDirectory = project.file('run-data')

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}

// applies to all the run configs above
configureEach {
// 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.
systemProperty '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
logLevel = org.slf4j.event.Level.DEBUG
}
}

repositories {
mavenCentral()
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com/" } // JEI
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://maven.createmod.net" } // Create
mods {
// define mod <-> source bindings
// these are used to tell the game which sources are for which mod
// multi mod projects should define one per mod
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}

dependencies {
//modImplementation "dev.architectury:architectury:${architectury_api_version}"
minecraft "com.mojang:minecraft:${minecraft_version}"

// Can't use parchment for some reason, game ends up completely unmapped
mappings loom.officialMojangMappings()
// Include resources generated by data generators.
sourceSets.main.resources {
srcDir 'src/generated/resources'
}

// see each subproject for dependencies.
}
tasks.named('processResources', ProcessResources) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.extendsFrom localRuntime
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"

archivesBaseName = rootProject.archives_base_name
group = rootProject.maven_group

// Formats the mod version to include the loader, Minecraft version, and build number (if present)
// example: 1.0.0+fabric-1.18.2-100
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}+${project.name}-${minecraft_version}" + (buildNumber != null ? "-${buildNumber}" : "")
dependencies {
api("com.simibubi.create:create-${minecraft_version}:${create_version}") { transitive false }
api("com.tterrag.registrate:Registrate:${registrate_version}")
api("net.createmod.ponder:Ponder-NeoForge-${minecraft_version}:${ponder_version}")

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}
compileOnlyApi("dev.engine-room.flywheel:flywheel-neoforge-api-${minecraft_version}:${flywheel_version}")
runtimeOnly("dev.engine-room.flywheel:flywheel-neoforge-${minecraft_version}:${flywheel_version}")
runtimeOnly("dev.engine-room.vanillin:vanillin-neoforge-${minecraft_version}:${vanillin_version}")

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
compileOnly("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
compileOnly("mezz.jei:jei-${minecraft_version}-neoforge-api:${jei_version}")
localRuntime("mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}")

localRuntime("top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version}")
compileOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version}:api")
localRuntime("maven.modrinth:jade:${jade_version}")
}

// 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.
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
neo_version : neo_version.split("\\.")[0],
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : version,
mod_authors : mod_authors,
mod_description : mod_description,
mod_logo : mod_logo,
mod_github : mod_github,
create_version : create_version.split("-")[0],
create_until_version : create_until_version
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
// Include the output of "generateModMetadata" as an input directory for the build
// this works with both building through Gradle and the IDE.
sourceSets.main.resources.srcDir generateModMetadata
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
neoForge.ideSyncTask generateModMetadata

java {
withSourcesJar()
// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/repo"
}
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

machete {
// disable machete locally for faster builds
enabled = buildNumber != null
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
Loading