Merge pull request #5 from Karotte128/master
fix issue #4 + changed gradle from userdev to moddev
This commit is contained in:
commit
327bb7dd12
4
.gitignore
vendored
4
.gitignore
vendored
@ -23,4 +23,6 @@ run
|
|||||||
runs
|
runs
|
||||||
run-data
|
run-data
|
||||||
|
|
||||||
repo
|
repo
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
102
build.gradle
102
build.gradle
@ -1,13 +1,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
id 'eclipse'
|
|
||||||
id 'idea'
|
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'net.neoforged.gradle.userdev' version '7.0.145'
|
id 'idea'
|
||||||
}
|
id 'net.neoforged.moddev' version '2.0.77'
|
||||||
|
|
||||||
tasks.named('wrapper', Wrapper).configure {
|
|
||||||
distributionType = Wrapper.DistributionType.BIN
|
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "${minecraft_version}-${mod_version}"
|
version = "${minecraft_version}-${mod_version}"
|
||||||
@ -23,30 +18,52 @@ base {
|
|||||||
|
|
||||||
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
||||||
|
|
||||||
runs {
|
neoForge {
|
||||||
configureEach {
|
// Specify the version of NeoForge to use.
|
||||||
systemProperty 'forge.logging.markers', 'REGISTRIES'
|
version = project.neo_version
|
||||||
systemProperty 'forge.logging.console.level', 'debug'
|
|
||||||
|
|
||||||
modSource project.sourceSets.main
|
parchment {
|
||||||
|
mappingsVersion = project.parchment_mappings_version
|
||||||
|
minecraftVersion = project.parchment_minecraft_version
|
||||||
}
|
}
|
||||||
|
|
||||||
client {
|
runs {
|
||||||
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
|
client {
|
||||||
|
client()
|
||||||
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
server()
|
||||||
|
programArgument '--nogui'
|
||||||
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
||||||
|
}
|
||||||
|
|
||||||
|
gameTestServer {
|
||||||
|
type = "gameTestServer"
|
||||||
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
||||||
|
}
|
||||||
|
|
||||||
|
data {
|
||||||
|
data()
|
||||||
|
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
|
||||||
|
}
|
||||||
|
|
||||||
|
configureEach {
|
||||||
|
systemProperty 'forge.logging.markers', 'REGISTRIES'
|
||||||
|
logLevel = org.slf4j.event.Level.DEBUG
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
mods {
|
||||||
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
|
"${mod_id}" {
|
||||||
programArgument '--nogui'
|
sourceSet(sourceSets.main)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||||
|
|
||||||
configurations {
|
|
||||||
runtimeClasspath.extendsFrom localRuntime
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url 'https://maven.squiddev.cc'
|
url 'https://maven.squiddev.cc'
|
||||||
@ -60,10 +77,10 @@ repositories {
|
|||||||
includeGroup 'net.commoble.morered'
|
includeGroup 'net.commoble.morered'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mavenLocal()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "net.neoforged:neoforge:${neo_version}"
|
|
||||||
|
|
||||||
compileOnly "cc.tweaked:cc-tweaked-${minecraft_version}-forge-api:${cctweaked_version}"
|
compileOnly "cc.tweaked:cc-tweaked-${minecraft_version}-forge-api:${cctweaked_version}"
|
||||||
implementation "cc.tweaked:cc-tweaked-${minecraft_version}-forge:${cctweaked_version}"
|
implementation "cc.tweaked:cc-tweaked-${minecraft_version}-forge:${cctweaked_version}"
|
||||||
@ -71,23 +88,32 @@ dependencies {
|
|||||||
implementation "net.commoble.morered:morered-${minecraft_version_major}:${morered_version}"
|
implementation "net.commoble.morered:morered-${minecraft_version_major}:${morered_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(ProcessResources).configureEach {
|
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
|
||||||
var replaceProperties = [
|
var replaceProperties = [minecraft_version : minecraft_version,
|
||||||
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
|
minecraft_version_range: minecraft_version_range,
|
||||||
neo_version: neo_version, neo_version_range: neo_version_range,
|
neo_version : neo_version,
|
||||||
loader_version_range: loader_version_range,
|
neo_version_range : neo_version_range,
|
||||||
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
|
loader_version_range : loader_version_range,
|
||||||
mod_authors: mod_authors, mod_description: mod_description,
|
mod_id : mod_id,
|
||||||
mod_issue_tracker_url: mod_issue_tracker_url, mod_display_url: mod_display_url,
|
mod_name : mod_name,
|
||||||
cctweaked_version_range: cctweaked_version_range, morered_version_range: morered_version_range,
|
mod_license : mod_license,
|
||||||
]
|
mod_version : mod_version,
|
||||||
|
mod_authors : mod_authors,
|
||||||
|
mod_description : mod_description,
|
||||||
|
mod_issue_tracker_url : mod_issue_tracker_url,
|
||||||
|
mod_display_url : mod_display_url,
|
||||||
|
cctweaked_version_range: cctweaked_version_range,
|
||||||
|
morered_version_range : morered_version_range]
|
||||||
inputs.properties replaceProperties
|
inputs.properties replaceProperties
|
||||||
|
expand replaceProperties
|
||||||
filesMatching(['META-INF/neoforge.mods.toml']) {
|
from "src/main/templates"
|
||||||
expand replaceProperties
|
into "build/generated/sources/modMetadata"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets.main.resources.srcDir generateModMetadata
|
||||||
|
|
||||||
|
neoForge.ideSyncTask generateModMetadata
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
register('mavenJava', MavenPublication) {
|
register('mavenJava', MavenPublication) {
|
||||||
@ -101,10 +127,6 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
|
||||||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
|
||||||
}
|
|
||||||
|
|
||||||
idea {
|
idea {
|
||||||
module {
|
module {
|
||||||
downloadSources = true
|
downloadSources = true
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
org.gradle.daemon=false
|
org.gradle.daemon=true
|
||||||
org.gradle.debug=false
|
org.gradle.parallel=true
|
||||||
|
org.gradle.caching=true
|
||||||
#read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
|
org.gradle.configuration-cache=true
|
||||||
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
|
## Environment Properties
|
||||||
neogradle.subsystems.parchment.minecraftVersion=1.21
|
|
||||||
neogradle.subsystems.parchment.mappingsVersion=2024.07.28
|
|
||||||
# Environment Properties
|
|
||||||
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
|
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
|
||||||
# The Minecraft version must agree with the Neo version to get a valid artifact
|
# The Minecraft version must agree with the Neo version to get a valid artifact
|
||||||
minecraft_version=1.21.1
|
minecraft_version=1.21.1
|
||||||
@ -19,12 +16,12 @@ minecraft_version_range=[1.21.1,1.22)
|
|||||||
# The Neo version must agree with the Minecraft version to get a valid artifact
|
# The Neo version must agree with the Minecraft version to get a valid artifact
|
||||||
neo_version=21.1.9
|
neo_version=21.1.9
|
||||||
# The Neo version range can use any version of Neo as bounds
|
# The Neo version range can use any version of Neo as bounds
|
||||||
neo_version_range=[21.1.9,)
|
neo_version_range=[21,)
|
||||||
# The loader version range can only use the major version of FML as bounds
|
# The loader version range can only use the major version of FML as bounds
|
||||||
loader_version_range=[4,)
|
loader_version_range=[4,)
|
||||||
|
parchment_minecraft_version=1.21.1
|
||||||
|
parchment_mappings_version=2024.11.17
|
||||||
## Mod Properties
|
## Mod Properties
|
||||||
|
|
||||||
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
|
# 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.
|
# Must match the String constant located in the main mod class annotated with @Mod.
|
||||||
mod_id=moreredxcctcompat
|
mod_id=moreredxcctcompat
|
||||||
@ -53,7 +50,7 @@ archive_base_name=MoreRed-CCT-Compat
|
|||||||
## Mod Dependencies Properties
|
## Mod Dependencies Properties
|
||||||
|
|
||||||
# CC:Tweaked version
|
# CC:Tweaked version
|
||||||
cctweaked_version=1.113.0
|
cctweaked_version=1.114.4
|
||||||
cctweaked_version_range=[1.113.0,)
|
cctweaked_version_range=[1.113.0,)
|
||||||
# More Red version
|
# More Red version
|
||||||
morered_version=6.0.0.2
|
morered_version=6.0.0.2
|
||||||
|
5
gradlew
vendored
Normal file → Executable file
5
gradlew
vendored
Normal file → Executable file
@ -15,8 +15,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@ -86,8 +84,7 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||||
' "$PWD" ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
@ -35,6 +35,7 @@ public class MoreRedCCCompatMod {
|
|||||||
registry.put(ModRegistry.Blocks.COMPUTER_COMMAND.get(), connector);
|
registry.put(ModRegistry.Blocks.COMPUTER_COMMAND.get(), connector);
|
||||||
registry.put(ModRegistry.Blocks.TURTLE_NORMAL.get(), connector);
|
registry.put(ModRegistry.Blocks.TURTLE_NORMAL.get(), connector);
|
||||||
registry.put(ModRegistry.Blocks.TURTLE_ADVANCED.get(), connector);
|
registry.put(ModRegistry.Blocks.TURTLE_ADVANCED.get(), connector);
|
||||||
|
registry.put(ModRegistry.Blocks.REDSTONE_RELAY.get(), connector);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerCapabilities(RegisterCapabilitiesEvent event) {
|
private void registerCapabilities(RegisterCapabilitiesEvent event) {
|
||||||
@ -43,5 +44,6 @@ public class MoreRedCCCompatMod {
|
|||||||
event.registerBlockEntity(MoreRedAPI.CHANNELED_POWER_CAPABILITY, ModRegistry.BlockEntities.COMPUTER_COMMAND.get(), (be, side) -> new ComputerChanneledPowerCapability(side));
|
event.registerBlockEntity(MoreRedAPI.CHANNELED_POWER_CAPABILITY, ModRegistry.BlockEntities.COMPUTER_COMMAND.get(), (be, side) -> new ComputerChanneledPowerCapability(side));
|
||||||
event.registerBlockEntity(MoreRedAPI.CHANNELED_POWER_CAPABILITY, ModRegistry.BlockEntities.TURTLE_NORMAL.get(), (be, side) -> new ComputerChanneledPowerCapability(side));
|
event.registerBlockEntity(MoreRedAPI.CHANNELED_POWER_CAPABILITY, ModRegistry.BlockEntities.TURTLE_NORMAL.get(), (be, side) -> new ComputerChanneledPowerCapability(side));
|
||||||
event.registerBlockEntity(MoreRedAPI.CHANNELED_POWER_CAPABILITY, ModRegistry.BlockEntities.TURTLE_ADVANCED.get(), (be, side) -> new ComputerChanneledPowerCapability(side));
|
event.registerBlockEntity(MoreRedAPI.CHANNELED_POWER_CAPABILITY, ModRegistry.BlockEntities.TURTLE_ADVANCED.get(), (be, side) -> new ComputerChanneledPowerCapability(side));
|
||||||
|
event.registerBlockEntity(MoreRedAPI.CHANNELED_POWER_CAPABILITY, ModRegistry.BlockEntities.REDSTONE_RELAY.get(), (be, side) -> new ComputerChanneledPowerCapability(side));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user