Initial Commit
This commit is contained in:
126
.gitignore
vendored
Normal file
126
.gitignore
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
# User-specific stuff
|
||||
.idea/
|
||||
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
.gradle
|
||||
build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
|
||||
**/build/
|
||||
|
||||
# Common working directory
|
||||
run/
|
||||
|
||||
neoforge/run/
|
||||
fabric/run/
|
||||
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Gradle files
|
||||
gradlew
|
||||
gradlew.bat
|
||||
gradle/wrapper/gradle-wrapper.jar
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
15
.idea/compiler.xml
generated
Normal file
15
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Gradle Imported" enabled="true">
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.5/6d1c8bf4c28e697f472a83bd6add76ec4951734/mixin-0.8.5-processor.jar" />
|
||||
</processorPath>
|
||||
<module name="compadability.main" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/gradle.xml
generated
Normal file
17
.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
45
.idea/jarRepositories.xml
generated
Normal file
45
.idea/jarRepositories.xml
generated
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Mojang Meta" />
|
||||
<option name="name" value="Mojang Meta" />
|
||||
<option name="url" value="https://maven.neoforged.net/mojang-meta/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Mojang Minecraft Libraries" />
|
||||
<option name="name" value="Mojang Minecraft Libraries" />
|
||||
<option name="url" value="https://libraries.minecraft.net/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="NeoForged Releases" />
|
||||
<option name="name" value="NeoForged Releases" />
|
||||
<option name="url" value="https://maven.neoforged.net/releases/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenLocal" />
|
||||
<option name="name" value="MavenLocal" />
|
||||
<option name="url" value="file:/$MAVEN_REPOSITORY$" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://cursemaven.com" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven2" />
|
||||
<option name="name" value="maven2" />
|
||||
<option name="url" value="https://modmaven.dev/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/misc.xml
generated
Normal file
10
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="corretto-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
9
.idea/modules.xml
generated
Normal file
9
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/compadability.iml" filepath="$PROJECT_DIR$/.idea/modules/compadability.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/compadability.main.iml" filepath="$PROJECT_DIR$/.idea/modules/compadability.main.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
25
.idea/modules/compadability.main.iml
generated
Normal file
25
.idea/modules/compadability.main.iml
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/main">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/main" isTestSource="false" generated="true" />
|
||||
</content>
|
||||
</component>
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>MIXIN</platformType>
|
||||
<platformType>NEOFORGE</platformType>
|
||||
<platformType>MCP</platformType>
|
||||
</autoDetectTypes>
|
||||
<projectReimportVersion>1</projectReimportVersion>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="McpModuleSettings">
|
||||
<option name="minecraftVersion" value="1.21.1" />
|
||||
<option name="platformVersion" value="21.1.209" />
|
||||
<option name="srgType" value="TSRG" />
|
||||
</component>
|
||||
</module>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
190
build.gradle
Normal file
190
build.gradle
Normal file
@@ -0,0 +1,190 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'idea'
|
||||
id 'net.neoforged.moddev' version '2.0.115'
|
||||
}
|
||||
//apply plugin: 'org.spongepowered.mixin'
|
||||
|
||||
version = mod_version
|
||||
group = mod_group_id
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven {
|
||||
url "https://cursemaven.com"
|
||||
}
|
||||
maven { url 'https://modmaven.dev/' }
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName = mod_id
|
||||
}
|
||||
|
||||
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.add('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
|
||||
}
|
||||
|
||||
data {
|
||||
data()
|
||||
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
mods {
|
||||
// define mod <-> source bindings
|
||||
// these are used to tell the game which sources are for which mod
|
||||
// mostly optional in a single mod project
|
||||
// but multi mod projects should define one per mod
|
||||
"${mod_id}" {
|
||||
sourceSet(sourceSets.main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Include resources generated by data generators.
|
||||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||
|
||||
|
||||
dependencies {
|
||||
// Example mod dependency with JEI
|
||||
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
|
||||
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
|
||||
// compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
|
||||
// runtimeOnly "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 "blank:coolmod-${mc_version}:${coolmod_version}"
|
||||
|
||||
// Example mod dependency using a file as dependency
|
||||
// implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar")
|
||||
|
||||
// Example project dependency using a sister or child project:
|
||||
// implementation project(":myproject")
|
||||
|
||||
// For more info:
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
|
||||
implementation "curse.maven:cold-sweat-506194:7091583"
|
||||
|
||||
implementation "curse.maven:thirst-was-taken-679270:7017923"
|
||||
|
||||
runtimeOnly "curse.maven:emi-580555:6420931"
|
||||
|
||||
compileOnly "mekanism:Mekanism:${mekanism_version}:api"
|
||||
compileOnly "mekanism:Mekanism:${mekanism_version}"// Mekanism
|
||||
|
||||
// If you want to test/use Mekanism & its modules during `runClient` invocation, use the following
|
||||
runtimeOnly "mekanism:Mekanism:${mekanism_version}"// Mekanism
|
||||
runtimeOnly "mekanism:Mekanism:${mekanism_version}:additions"// Mekanism: Additions
|
||||
runtimeOnly "mekanism:Mekanism:${mekanism_version}:generators"// Mekanism: Generators
|
||||
runtimeOnly "mekanism:Mekanism:${mekanism_version}:tools"// Mekanism: Tools
|
||||
runtimeOnly "curse.maven:create-328085:6641610"
|
||||
|
||||
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.
|
||||
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
|
||||
var replaceProperties = [minecraft_version : minecraft_version,
|
||||
minecraft_version_range: minecraft_version_range,
|
||||
neo_version : neo_version,
|
||||
neo_version_range : neo_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]
|
||||
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
|
||||
|
||||
// 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
|
||||
idea {
|
||||
module {
|
||||
downloadSources = true
|
||||
downloadJavadoc = true
|
||||
}
|
||||
}
|
||||
43
gradle.properties
Normal file
43
gradle.properties
Normal file
@@ -0,0 +1,43 @@
|
||||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
org.gradle.daemon=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.configuration-cache=true
|
||||
## Environment Properties
|
||||
# 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
|
||||
minecraft_version=1.21.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.21.1,1.22)
|
||||
# The Neo version must agree with the Minecraft version to get a valid artifact
|
||||
neo_version=21.1.209
|
||||
# The Neo version range can use any version of Neo as bounds
|
||||
neo_version_range=[21,)
|
||||
# The loader version range can only use the major version of FML as bounds
|
||||
loader_version_range=[4,)
|
||||
parchment_minecraft_version=1.21.1
|
||||
parchment_mappings_version=2024.11.17
|
||||
## 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}
|
||||
# Must match the String constant located in the main mod class annotated with @Mod.
|
||||
mod_id=compadability
|
||||
# The human-readable display name for the mod.
|
||||
mod_name=compadability
|
||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=All Rights Reserved
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1.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=me.zacharias
|
||||
# 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=
|
||||
|
||||
|
||||
mekanism_version=1.21.1-10.7.16.82
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
249
gradlew
vendored
Normal file
249
gradlew
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
92
gradlew.bat
vendored
Normal file
92
gradlew.bat
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
11
settings.gradle
Normal file
11
settings.gradle
Normal file
@@ -0,0 +1,11 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
maven { url = 'https://maven.neoforged.net/releases' }
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
|
||||
}
|
||||
BIN
sources/ColdSweat-2.4-b05b-sources.jar
Normal file
BIN
sources/ColdSweat-2.4-b05b-sources.jar
Normal file
Binary file not shown.
42
src/main/java/me/zacharias/compadability/Compadability.java
Normal file
42
src/main/java/me/zacharias/compadability/Compadability.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package me.zacharias.compadability;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import me.zacharias.compadability.register.Items;
|
||||
import me.zacharias.compadability.register.Modules;
|
||||
import mekanism.api.MekanismIMC;
|
||||
import mekanism.common.registries.MekanismCreativeTabs;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.fml.ModContainer;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.fml.config.ModConfig;
|
||||
import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@Mod(Compadability.MODID)
|
||||
public class Compadability {
|
||||
public static final String MODID = "compadability";
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public Compadability(IEventBus bus, ModContainer modContainer) {
|
||||
|
||||
modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
|
||||
|
||||
Items.register(bus);
|
||||
Modules.register(bus);
|
||||
bus.addListener(this::imcQueue);
|
||||
bus.addListener(this::buildCreativeModeTabContents);
|
||||
}
|
||||
|
||||
private void imcQueue(InterModEnqueueEvent event) {
|
||||
MekanismIMC.addMekaSuitBodyarmorModules(Modules.CLIMATE_CONTROL_UNIT);
|
||||
MekanismIMC.addMekaSuitHelmetModules(Modules.WATER_PURIFIED_DRINKING_UNIT);
|
||||
}
|
||||
|
||||
private void buildCreativeModeTabContents(BuildCreativeModeTabContentsEvent event) {
|
||||
if (event.getTab() == MekanismCreativeTabs.MEKANISM.get()) {
|
||||
event.accept(Items.CLIMATE_CONTROL_UNIT);
|
||||
event.accept(Items.WATER_PURIFIED_DRINKING_UNIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
src/main/java/me/zacharias/compadability/Config.java
Normal file
35
src/main/java/me/zacharias/compadability/Config.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package me.zacharias.compadability;
|
||||
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.fml.event.config.ModConfigEvent;
|
||||
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||
|
||||
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 Neo's config APIs
|
||||
@EventBusSubscriber(modid = Compadability.MODID)
|
||||
public class Config {
|
||||
private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder();
|
||||
|
||||
public static final ModConfigSpec.IntValue MAX_WATER_UNIT_CONTENT = BUILDER.comment("The max water content of a water purified drinking unit.").defineInRange("maxWaterUnitContent", 128_000, 0, Integer.MAX_VALUE);
|
||||
public static final ModConfigSpec.IntValue MB_PER_THIRST = BUILDER.comment("The amount the milibuckets per thirst point of a water purified drinking unit.").defineInRange("mbPerThirst", 100, 0, Integer.MAX_VALUE);
|
||||
public static final ModConfigSpec.IntValue MAX_WATER_UNIT_TRANSFER = BUILDER.comment("The max amount of water that can be transferred per tick from a water purified drinking unit.").defineInRange("maxWaterUnitTransfer", 256, 0, Integer.MAX_VALUE);
|
||||
|
||||
static final ModConfigSpec SPEC = BUILDER.build();
|
||||
|
||||
public static int MaxWaterUnitContent;
|
||||
public static int MbPerThirst;
|
||||
|
||||
@SubscribeEvent
|
||||
static void onLoad(final ModConfigEvent event) {
|
||||
MaxWaterUnitContent = MAX_WATER_UNIT_CONTENT.get();
|
||||
MbPerThirst = MB_PER_THIRST.get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package me.zacharias.compadability.mixins;
|
||||
|
||||
import me.zacharias.compadability.Config;
|
||||
import me.zacharias.compadability.register.Modules;
|
||||
import mekanism.api.gear.IModule;
|
||||
import mekanism.api.gear.IModuleHelper;
|
||||
import mekanism.common.capabilities.fluid.item.FluidTankSpec;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.item.gear.ItemMekaSuitArmor;
|
||||
import mekanism.common.registries.MekanismModules;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ItemMekaSuitArmor.class)
|
||||
public class MixinItemMekaSuitArmor {
|
||||
|
||||
@Final
|
||||
@Shadow
|
||||
private List<FluidTankSpec> fluidTankSpecs;
|
||||
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/item/ArmorItem$Type;Lnet/minecraft/world/item/Item$Properties;)V",
|
||||
at = @At("TAIL"))
|
||||
public void onConstructor(ArmorItem.Type armorType, Item.Properties properties, CallbackInfo ci)
|
||||
{
|
||||
if (armorType == ArmorItem.Type.HELMET) {
|
||||
// Add a water-fill-only tank using the same rates/capacity as the nutritional tank.
|
||||
// The predicate fluid -> fluid.is(Fluids.WATER) accepts vanilla water.
|
||||
// stack -> true means the tank is allowed for all stacks; change to a module-check
|
||||
// if you want it gated by a module (e.g. use hasModule(stack, MekanismModules.SOME_MODULE)).
|
||||
fluidTankSpecs.add(FluidTankSpec.createFillOnly(
|
||||
Config.MAX_WATER_UNIT_TRANSFER,
|
||||
Config.MAX_WATER_UNIT_CONTENT,
|
||||
fluid -> fluid.is(Fluids.WATER),
|
||||
stack -> {
|
||||
IModule<?> module = IModuleHelper.INSTANCE.getModule(stack, Modules.WATER_PURIFIED_DRINKING_UNIT);
|
||||
return module == null || module.getInstalledCount() > 0;
|
||||
}
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package me.zacharias.compadability.modules;
|
||||
|
||||
import com.momosoftworks.coldsweat.core.init.ModAttributes;
|
||||
import mekanism.api.gear.*;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.EquipmentSlotGroup;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import com.momosoftworks.coldsweat.api.util.Temperature;
|
||||
import net.neoforged.neoforge.event.ItemAttributeModifierEvent;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static me.zacharias.compadability.Compadability.MODID;
|
||||
|
||||
public class ClimateControlUnit implements ICustomModule<ClimateControlUnit> {
|
||||
private static final ResourceLocation icon = MekanismUtils.getResource(MekanismUtils.ResourceType.GUI_HUD, "climate_control_unit.png");
|
||||
|
||||
@Override
|
||||
public void addHUDElements(IModule<ClimateControlUnit> module, IModuleContainer moduleContainer, ItemStack stack, Player player, Consumer<IHUDElement> hudElementAdder) {
|
||||
hudElementAdder.accept(IModuleHelper.INSTANCE.hudElement(icon, Component.literal("Temp: "+"%.1f".formatted(GetTempC(player, Temperature.Trait.WORLD))), IHUDElement.HUDColor.REGULAR));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustAttributes(IModule<ClimateControlUnit> module, ItemAttributeModifierEvent event) {
|
||||
event.addModifier(ModAttributes.HEAT_DAMPENING.getDelegate(), new AttributeModifier(ResourceLocation.fromNamespaceAndPath(MODID, "climate_control_unit_modifier"), 1, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.ANY);
|
||||
event.addModifier(ModAttributes.COLD_DAMPENING.getDelegate(), new AttributeModifier(ResourceLocation.fromNamespaceAndPath(MODID, "climate_control_unit_modifier"), 1, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.ANY);
|
||||
}
|
||||
|
||||
public static double GetTempC(Player player, Temperature.Trait trait) {
|
||||
return Temperature.convertIfNeeded(Temperature.get(player, trait), trait, Temperature.Units.C);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package me.zacharias.compadability.modules;
|
||||
|
||||
import dev.ghen.thirst.api.ThirstHelper;
|
||||
import dev.ghen.thirst.foundation.common.capability.IThirst;
|
||||
import dev.ghen.thirst.foundation.common.capability.ModAttachment;
|
||||
import me.zacharias.compadability.Config;
|
||||
import mekanism.api.gear.*;
|
||||
import mekanism.api.math.MathUtils;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.registries.MekanismFluids;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.StorageUtils;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||
import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static me.zacharias.compadability.utils.Fluids.WATER_STACK;
|
||||
|
||||
public class WaterPurifiedDrinkingUnit implements ICustomModule<WaterPurifiedDrinkingUnit> {
|
||||
private static final ResourceLocation icon = MekanismUtils.getResource(MekanismUtils.ResourceType.GUI_HUD, "nutritional_injection_unit.png");
|
||||
|
||||
@Override
|
||||
public void tickServer(IModule<WaterPurifiedDrinkingUnit> module, IModuleContainer moduleContainer, ItemStack stack, Player player) {
|
||||
long usage = MekanismConfig.gear.mekaSuitEnergyUsageNutritionalInjection.get();
|
||||
IThirst thirstData = (IThirst)player.getData(ModAttachment.PLAYER_THIRST);
|
||||
if (MekanismUtils.isPlayingMode(player) && thirstData.getThirst() < 20) {
|
||||
//Check if we can use a single iteration of it
|
||||
IFluidHandlerItem handler = Capabilities.FLUID.getCapability(stack);
|
||||
if (handler != null) {
|
||||
int contained = StorageUtils.getContainedFluid(handler, WATER_STACK).getAmount();
|
||||
int needed = Math.min(20 - thirstData.getThirst(), contained / Config.MbPerThirst);
|
||||
int toFeed = Math.min(MathUtils.clampToInt(module.getContainerEnergy(stack) / usage), needed);
|
||||
if (toFeed > 0) {
|
||||
module.useEnergy(player, stack, usage * toFeed / Config.MbPerThirst);
|
||||
handler.drain(new FluidStack(Fluids.WATER, toFeed / Config.MbPerThirst), IFluidHandler.FluidAction.EXECUTE);
|
||||
thirstData.setThirst(thirstData.getThirst()+needed);
|
||||
thirstData.updateThirstData(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHUDElements(IModule<WaterPurifiedDrinkingUnit> module, IModuleContainer moduleContainer, ItemStack stack, Player player, Consumer<IHUDElement> hudElementAdder) {
|
||||
if (module.isEnabled()) {
|
||||
IFluidHandlerItem handler = Capabilities.FLUID.getCapability(stack);
|
||||
double ratio = 0;
|
||||
if (handler != null) {
|
||||
handler.drain(new FluidStack(Fluids.WATER, Config.MaxWaterUnitContent), IFluidHandler.FluidAction.SIMULATE);
|
||||
FluidStack stored = StorageUtils.getContainedFluid(handler, WATER_STACK);
|
||||
ratio = StorageUtils.getRatio(stored.getAmount(), Config.MaxWaterUnitContent);
|
||||
}
|
||||
hudElementAdder.accept(IModuleHelper.INSTANCE.hudElementPercent(icon, ratio));
|
||||
}
|
||||
}
|
||||
}
|
||||
23
src/main/java/me/zacharias/compadability/register/Items.java
Normal file
23
src/main/java/me/zacharias/compadability/register/Items.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package me.zacharias.compadability.register;
|
||||
|
||||
import mekanism.common.item.ItemModule;
|
||||
import mekanism.common.registration.impl.ItemDeferredRegister;
|
||||
import mekanism.common.registration.impl.ItemRegistryObject;
|
||||
import net.minecraft.world.item.Rarity;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
|
||||
import static me.zacharias.compadability.Compadability.MODID;
|
||||
|
||||
public class Items {
|
||||
public static final ItemDeferredRegister ITEMS = new ItemDeferredRegister(MODID);
|
||||
public static final ItemRegistryObject<ItemModule> CLIMATE_CONTROL_UNIT =
|
||||
ITEMS.registerModule(Modules.CLIMATE_CONTROL_UNIT, Rarity.UNCOMMON);
|
||||
public static final ItemRegistryObject<ItemModule> WATER_PURIFIED_DRINKING_UNIT =
|
||||
ITEMS.registerModule(Modules.WATER_PURIFIED_DRINKING_UNIT, Rarity.UNCOMMON);
|
||||
|
||||
public static void register(IEventBus bus){
|
||||
ITEMS.register(bus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package me.zacharias.compadability.register;
|
||||
|
||||
import me.zacharias.compadability.modules.ClimateControlUnit;
|
||||
import me.zacharias.compadability.modules.WaterPurifiedDrinkingUnit;
|
||||
import mekanism.common.registration.impl.ModuleDeferredRegister;
|
||||
import mekanism.common.registration.impl.ModuleRegistryObject;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.fml.ModLoader;
|
||||
|
||||
import static me.zacharias.compadability.Compadability.MODID;
|
||||
|
||||
public class Modules {
|
||||
public static final ModuleDeferredRegister MODULES = new ModuleDeferredRegister(MODID);
|
||||
public static final ModuleRegistryObject<ClimateControlUnit> CLIMATE_CONTROL_UNIT =
|
||||
MODULES.registerInstanced("climate_control_unit", ClimateControlUnit::new,
|
||||
() -> Items.CLIMATE_CONTROL_UNIT,
|
||||
builder -> builder.maxStackSize(1).rendersHUD());
|
||||
public static final ModuleRegistryObject<WaterPurifiedDrinkingUnit> WATER_PURIFIED_DRINKING_UNIT = MODULES.registerInstanced("water_purified_drinking_unit", WaterPurifiedDrinkingUnit::new,
|
||||
() -> Items.WATER_PURIFIED_DRINKING_UNIT,
|
||||
builder -> builder.maxStackSize(1).rendersHUD());
|
||||
|
||||
|
||||
public static void register(IEventBus bus){
|
||||
MODULES.register(bus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package me.zacharias.compadability.utils;
|
||||
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
|
||||
public class Fluids {
|
||||
public static final FluidStack WATER_STACK = new FluidStack(net.minecraft.world.level.material.Fluids.WATER, 1);
|
||||
}
|
||||
7
src/main/resources/assets/compadability/lang/en_us.json
Normal file
7
src/main/resources/assets/compadability/lang/en_us.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"module.compadability.climate_control_unit": "Climate Control Unit",
|
||||
"description.compadability.climate_control_unit": "Creates a climate controlled environment inside of the suit, making it nice to weare in hot and cold environments.",
|
||||
|
||||
"module.compadability.water_purified_drinking_unit": "Purified Water Drinking Unit",
|
||||
"description.compadability.water_purified_drinking_unit": "Makes drinking water purified, making it easier to drink."
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "compadability:item/module_climate_control_unit"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "compadability:item/module_water_purified_drinking_unit"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 565 B |
Binary file not shown.
|
After Width: | Height: | Size: 536 B |
Binary file not shown.
|
After Width: | Height: | Size: 196 B |
11
src/main/resources/compadability.mixin.json
Normal file
11
src/main/resources/compadability.mixin.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "me.zacharias.compadability.mixins",
|
||||
"refmap": "compadability.refmap.json",
|
||||
"mixins": [
|
||||
"MixinItemMekaSuitArmor"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"ABA",
|
||||
"FMR",
|
||||
"PHP"
|
||||
],
|
||||
"key": {
|
||||
"P":{
|
||||
"tag":"c:pellets/polonium"
|
||||
},
|
||||
"H": {
|
||||
"item": "mekanism:hdpe_sheet"
|
||||
},
|
||||
"M": {
|
||||
"item": "mekanism:module_base"
|
||||
},
|
||||
"R": {
|
||||
"item": "mekanism:resistive_heater"
|
||||
},
|
||||
"F": {
|
||||
"item": "create:propeller"
|
||||
},
|
||||
"A":{
|
||||
"tag":"mekanism:alloys/reinforced"
|
||||
},
|
||||
"B": {
|
||||
"item": "mekanism:basic_control_circuit"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"id": "compadability:module_climate_control_unit"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"type":"minecraft:crafting_shaped",
|
||||
"conditions":[
|
||||
{
|
||||
"type":"forge:item_exists",
|
||||
"item":"compadability:module_water_purified_drinking_unit"
|
||||
}
|
||||
],
|
||||
"result":{
|
||||
"id":"compadability:module_water_purified_drinking_unit"
|
||||
},
|
||||
"pattern":[
|
||||
"I#I",
|
||||
"IAI",
|
||||
"PPP"
|
||||
],
|
||||
"key":{
|
||||
"I":{
|
||||
"tag":"mekanism:alloys/reinforced"
|
||||
},
|
||||
"A":{
|
||||
"item":"mekanism:module_base"
|
||||
},
|
||||
"#":{
|
||||
"item":"minecraft:glass_bottle"
|
||||
},
|
||||
"P":{
|
||||
"tag":"c:pellets/polonium"
|
||||
}
|
||||
}
|
||||
}
|
||||
6
src/main/resources/pack.mcmeta
Normal file
6
src/main/resources/pack.mcmeta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "Compadability",
|
||||
"pack_format": 15
|
||||
}
|
||||
}
|
||||
79
src/main/templates/META-INF/neoforge.mods.toml
Normal file
79
src/main/templates/META-INF/neoforge.mods.toml
Normal file
@@ -0,0 +1,79 @@
|
||||
# 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 the FML version. This is currently 47.
|
||||
loaderVersion = "${loader_version_range}" #mandatory
|
||||
# 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.
|
||||
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.neoforge.net/docs/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="compadability.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
#credits="" #optional
|
||||
# A text field displayed in the mod UI
|
||||
authors = "${mod_authors}" #optional
|
||||
|
||||
# The description text for the mod (multi line!) (#mandatory)
|
||||
description = '''${mod_description}'''
|
||||
|
||||
# The [[mixins]] block allows you to declare your mixin config to FML so that it gets loaded.
|
||||
[[mixins]]
|
||||
config="compadability.mixin.json"
|
||||
|
||||
# The [[accessTransformers]] block allows you to declare where your AT file is.
|
||||
# If this block is omitted, a fallback attempt will be made to load an AT from META-INF/accesstransformer.cfg
|
||||
#[[accessTransformers]]
|
||||
#file="META-INF/accesstransformer.cfg"
|
||||
|
||||
# The coremods config file path is not configurable and is always loaded from META-INF/coremods.json
|
||||
|
||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||
[[dependencies."${mod_id}"]] #optional
|
||||
# the modid of the dependency
|
||||
modId = "neoforge" #mandatory
|
||||
# The type of the dependency. Can be one of "required", "optional", "incompatible" or "discouraged" (case insensitive).
|
||||
# 'required' requires the mod to exist, 'optional' does not
|
||||
# 'incompatible' will prevent the game from loading when the mod exists, and 'discouraged' will show a warning
|
||||
type = "required" #mandatory
|
||||
# Optional field describing why the dependency is required or why it is incompatible
|
||||
# reason="..."
|
||||
# The version range of the dependency
|
||||
versionRange = "${neo_version_range}" #mandatory
|
||||
# An ordering relationship for the dependency.
|
||||
# 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 = "minecraft"
|
||||
type = "required"
|
||||
# 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"
|
||||
|
||||
# Features are specific properties of the game environment, that you may want to declare you require. This example declares
|
||||
# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't
|
||||
# stop your mod loading on the server for example.
|
||||
#[features."${mod_id}"]
|
||||
#openGLVersion="[3.2,)"
|
||||
Reference in New Issue
Block a user