commit fe619a10d43c495605232db3acfaca3d8fe459b6 Author: Derek Date: Fri Apr 11 17:22:38 2025 -0500 e diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4ffbd90 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +# This is the universal Text Editor Configuration +# for all GTNewHorizons projects +# See: https://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{bat,ini}] +end_of_line = crlf + +[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}] +indent_size = 2 + +[*.lang] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fd2792b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,44 @@ +* text eol=lf + +*.[jJ][aA][rR] binary + +*.[pP][nN][gG] binary +*.[jJ][pP][gG] binary +*.[jJ][pP][eE][gG] binary +*.[gG][iI][fF] binary +*.[tT][iI][fF] binary +*.[tT][iI][fF][fF] binary +*.[iI][cC][oO] binary +*.[sS][vV][gG] text +*.[eE][pP][sS] binary +*.[xX][cC][fF] binary + +*.[kK][aA][rR] binary +*.[mM]4[aA] binary +*.[mM][iI][dD] binary +*.[mM][iI][dD][iI] binary +*.[mM][pP]3 binary +*.[oO][gG][gG] binary +*.[rR][aA] binary + +*.7[zZ] binary +*.[gG][zZ] binary +*.[tT][aA][rR] binary +*.[tT][gG][zZ] binary +*.[zZ][iI][pP] binary + +*.[tT][cC][nN] binary +*.[sS][oO] binary +*.[dD][lL][lL] binary +*.[dD][yY][lL][iI][bB] binary +*.[pP][sS][dD] binary +*.[tT][tT][fF] binary +*.[oO][tT][fF] binary + +*.[pP][aA][tT][cC][hH] -text + +*.[bB][aA][tT] text eol=crlf +*.[cC][mM][dD] text eol=crlf +*.[pP][sS]1 text eol=crlf + +*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e80e0a --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +.gradle +.settings +/.idea/ +/.vscode/ +/run/ +/build/ +/eclipse/ +.classpath +.project +/bin/ +/config/ +/crash-reports/ +/logs/ +options.txt +/saves/ +usernamecache.json +banned-ips.json +banned-players.json +eula.txt +ops.json +server.properties +servers.dat +usercache.json +whitelist.json +/out/ +*.iml +*.ipr +*.iws +src/main/resources/mixins.*([!.]).json +*.bat +*.DS_Store +!gradlew.bat +.factorypath +addon.local.gradle +addon.local.gradle.kts +addon.late.local.gradle +addon.late.local.gradle.kts +layout.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5357f69 --- /dev/null +++ b/LICENSE @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..970c908 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +

NOTE: THIS IS A FORK OF THE Darkerer mod by GTNH: https://github.com/GTNewHorizons/Darkerer

+ + +--- + +

Image didnt load :( | Astral-Nook

+ +#

Darkerer

+###

A FOSS reimplementation of the [Hardcore Darkness](https://www.curseforge.com/minecraft/mc-mods/hardcore-darkness) mod by lumien

+ +Features + + * Dark Overworld, Nether and End (configurable) + * Different modes + * No minimum sky or block light (default) + * No minimum block light + * Light depends on the moon phase + * All modded dimensions are dark by default (individual dimensions can be excluded via a config property) + * Special compat for the Twilight Forest + * For multiplayer: the config is synced from the server to the client (the settings are reverted on the client when disconnecting) + +Credits + +This mod is a recreation of Hardcore Darkness by Lumien231. No code or assets of Hardcore Darkness were used. + + diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..944a269 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,4 @@ + +plugins { + id("com.gtnewhorizons.gtnhconvention") +} diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000..3176b7f --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,5 @@ +dependencies { + runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev") + implementation("com.github.GTNewHorizons:GTNHLib:0.6.11:dev") + devOnlyNonPublishable("com.github.GTNewHorizons:twilightforest:2.7.5:dev") +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..6dd8f73 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,194 @@ +# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable. +# LOCAL to test local config updates. +gtnh.settings.blowdryerTag = 0.2.2 + +# Human-readable mod name, available for mcmod.info population. +modName = Darkerer + +# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation. +# Conventionally lowercase. +modId = darkerer + +# Root package of the mod, used to find various classes in other properties, +# mcmod.info substitution, enabling assertions in run tasks, etc. +modGroup = glowredman.darkerer + +# Whether to use modGroup as the maven publishing group. +# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. +useModGroupForPublishing = true + +# Updates your build.gradle and settings.gradle automatically whenever an update is available. +autoUpdateBuildScript = false + +# Version of Minecraft to target +minecraftVersion = 1.7.10 + +# Version of Minecraft Forge to target +forgeVersion = 10.13.4.1614 + +# Specify an MCP channel for dependency deobfuscation and the deobfParams task. +channel = stable + +# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task. +mappingsVersion = 12 + +# Defines other MCP mappings for dependency deobfuscation. +remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ + +# Select a default username for testing your mod. You can always override this per-run by running +# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. +developmentEnvironmentUserName = + +# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8. +# See https://github.com/bsideup/jabel for details on how this works. +enableModernJavaSyntax = true + +# Enables injecting missing generics into the decompiled source code for a better coding experience. +# Turns most publicly visible List, Map, etc. into proper List, Map types. +enableGenericInjection = true + +# Generate a class with a String field for the mod version named as defined below. +# If generateGradleTokenClass is empty or not missing, no such class will be generated. +# If gradleTokenVersion is empty or missing, the field will not be present in the class. +generateGradleTokenClass = glowredman.darkerer.Tags + +# Name of the token containing the project's current version to generate/replace. +gradleTokenVersion = VERSION + +# [DEPRECATED] +# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java +# public static final String VERSION = "GRADLETOKEN_VERSION"; +# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's +# version in @Mod([...], version = VERSION, [...]). +# Leave these properties empty to skip individual token replacements. +replaceGradleTokenInFile = + +# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can +# leave this property empty. +# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api +apiPackage = + +# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ +# There can be multiple files in a space-separated list. +# Example value: mymodid_at.cfg nei_at.cfg +accessTransformersFile = + +# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! +usesMixins = true + +# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main. +# This can speed up compile times thanks to not running the mixin annotation processor on all input sources. +# Mixin classes will have access to "main" classes, but not the other way around. +separateMixinSourceSet = + +# Adds some debug arguments like verbose output and class export. +usesMixinDebug = true + +# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. +mixinPlugin = + +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = mixins + +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# This parameter is for legacy compatibility only +# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin +coreModClass = DarkererCore + +# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class +# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! +containsMixinsAndOrCoreModOnly = false + +# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins. +forceEnableMixins = false + +# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your +# responsibility to check the license and request permission for distribution if required. +usesShadowedDependencies = false + +# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access +# their own classes, making the minimization unreliable. +minimizeShadowedDependencies = true + +# If disabled, won't rename the shadowed classes. +relocateShadowedDependencies = true + +# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories. +includeWellKnownRepositories = true + +# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated +# list of strings, with the acceptable keys being(case does not matter): +# cursemaven +# modrinth +excludeWellKnownRepositories = + +# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. +# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables. +# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle. +usesMavenPublishing = true + +# Maven repository to publish the mod to. +# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/ + +# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token. +# +# The project's ID on Modrinth. Can be either the slug or the ID. +# Leave this empty if you don't want to publish to Modrinth. +modrinthProjectId = JOIeI9O4 + +# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth. +# Syntax: scope1-type1:name1;scope2-type2:name2;... +# Where scope can be one of [required, optional, incompatible, embedded], +# type can be one of [project, version], +# and the name is the Modrinth project or version slug/id of the other mod. +# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech +# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +modrinthRelations = + +# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. +# +# The project's numeric ID on CurseForge. You can find this in the About Project box. +# Leave this empty if you don't want to publish on CurseForge. +curseForgeProjectId = 1215472 + +# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge. +# Syntax: type1:name1;type2:name2;... +# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible], +# and the name is the CurseForge project slug of the other mod. +# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft +# Note: UniMixins is automatically set as a required dependency if usesMixins = true. +curseForgeRelations = requiredDependency:unimixins + +# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older +# projects. New projects should not use this parameter. +# customArchiveBaseName = + +# Optional parameter to have the build automatically fail if an illegal version is used. +# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'. +# The check is ONLY performed if the version is a git tag. +# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+ +versionPattern = \\d+\\.\\d+\\.\\d+(-pre|-snapshot)? + +# Uncomment to prevent the source code from being published. +# noPublishedSources = true + +# Uncomment this to disable Spotless checks. +# This should only be uncommented to keep it easier to sync with upstream/other forks. +# That is, if there is no other active fork/upstream, NEVER change this. +# disableSpotless = true + +# Uncomment this to disable Checkstyle checks (currently wildcard import check). +# disableCheckstyle = true + +# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle" +# (force use delegated build). +# This is meant to be set in $HOME/.gradle/gradle.properties. +# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build. +# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want! +# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you. +# ideaOverrideBuildType = idea + +# Whether IDEA should run spotless checks when pressing the Build button. +# This is meant to be set in $HOME/.gradle/gradle.properties. +# ideaCheckSpotlessOnBuild = true + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..a4b76b9 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..e18bc25 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..f3b75f3 --- /dev/null +++ b/gradlew @@ -0,0 +1,251 @@ +#!/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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# 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 -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || 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" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..9d21a21 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@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 +@rem SPDX-License-Identifier: Apache-2.0 +@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 diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..09bbb51 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +before_install: + - ./gradlew setupCIWorkspace \ No newline at end of file diff --git a/repositories.gradle b/repositories.gradle new file mode 100644 index 0000000..0ac475d --- /dev/null +++ b/repositories.gradle @@ -0,0 +1 @@ +repositories {} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..ea44412 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,21 @@ + +pluginManagement { + repositories { + maven { + // RetroFuturaGradle + name = "GTNH Maven" + url = uri("https://nexus.gtnewhorizons.com/repository/public/") + mavenContent { + includeGroup("com.gtnewhorizons") + includeGroupByRegex("com\\.gtnewhorizons\\..+") + } + } + gradlePluginPortal() + mavenCentral() + mavenLocal() + } +} + +plugins { + id("com.gtnewhorizons.gtnhsettingsconvention") version("1.0.33") +} diff --git a/src/main/java/glowredman/darkerer/Darkerer.java b/src/main/java/glowredman/darkerer/Darkerer.java new file mode 100644 index 0000000..7ca98b9 --- /dev/null +++ b/src/main/java/glowredman/darkerer/Darkerer.java @@ -0,0 +1,16 @@ +package glowredman.darkerer; + +import cpw.mods.fml.common.Mod; + +@Mod( + acceptedMinecraftVersions = "[1.7.10]", + acceptableRemoteVersions = Tags.VERSION, + dependencies = "required-after:gtnhlib@[0.6.3,);required-after:unimixins", + modid = Darkerer.MODID, + name = "Darkerer", + version = Tags.VERSION) +public class Darkerer { + + public static final String MODID = "darkerer"; + +} diff --git a/src/main/java/glowredman/darkerer/DarkererConfig.java b/src/main/java/glowredman/darkerer/DarkererConfig.java new file mode 100644 index 0000000..e373dcf --- /dev/null +++ b/src/main/java/glowredman/darkerer/DarkererConfig.java @@ -0,0 +1,36 @@ +package glowredman.darkerer; + +import com.gtnewhorizon.gtnhlib.config.Config; + +@Config(modid = Darkerer.MODID) +@Config.Sync +public class DarkererConfig { + + @Config.Comment(""" + How Darkerer should behave + EVERYWHERE: complete darkness at night, except near block light sources (torches, lava, etc.) + ONLY_INSIDE: a small amount of light remains at the surface, even during the night + MOON_PHASE: like ONLY_INSIDE but the remaining light depends on the moon phase""") + @Config.DefaultEnum("EVERYWHERE") + public static Mode mode; + + @Config.Comment("Whether or not the Nether should be dark") + @Config.DefaultBoolean(true) + public static boolean darkNether; + + @Config.Comment("Whether or not the End should be dark") + @Config.DefaultBoolean(false) + public static boolean darkEnd; + + @Config.Comment("Whether or not the Twilight Forest should be dark") + @Config.DefaultBoolean(false) + public static boolean darkTwilightForest; + + @Config.Comment("Attempts to remove the blue sky light that occurs when using mode NO_MIN_BLOCK_LIGHT or MOON_PHASE") + @Config.DefaultBoolean(true) + public static boolean removeBlueSkyLight; + + @Config.Comment("A list of dimension ids in which Darkerer will be completely disabled") + @Config.DefaultIntList({}) + public static int[] dimBlocklist; +} diff --git a/src/main/java/glowredman/darkerer/DarkererCore.java b/src/main/java/glowredman/darkerer/DarkererCore.java new file mode 100644 index 0000000..b3eba0d --- /dev/null +++ b/src/main/java/glowredman/darkerer/DarkererCore.java @@ -0,0 +1,72 @@ +package glowredman.darkerer; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.gtnewhorizon.gtnhlib.config.ConfigException; +import com.gtnewhorizon.gtnhlib.config.ConfigurationManager; +import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader; + +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions; +import cpw.mods.fml.relauncher.Side; + +@TransformerExclusions("glowredman.darkerer.DarkererCore") +@MCVersion("1.7.10") +@Name("Darkerer") +public class DarkererCore implements IFMLLoadingPlugin, IEarlyMixinLoader { + + public static boolean enabled; + + static { + if (FMLLaunchHandler.side() == Side.CLIENT) { + try { + ConfigurationManager.registerConfig(DarkererConfig.class); + } catch (ConfigException e) { + throw new RuntimeException(e); + } + } + } + + @Override + public String[] getASMTransformerClass() { + return null; + } + + @Override + public String getModContainerClass() { + return null; + } + + @Override + public String getSetupClass() { + return null; + } + + @Override + public void injectData(Map data) {} + + @Override + public String getAccessTransformerClass() { + return null; + } + + @Override + public String getMixinConfig() { + return "mixins.darkerer.early.json"; + } + + @Override + public List getMixins(Set loadedCoreMods) { + if (FMLLaunchHandler.side() == Side.CLIENT) { + return Arrays.asList("MixinEntityRenderer", "MixinWorld", "MixinWorldProviderHell"); + } + return Collections.emptyList(); + } +} diff --git a/src/main/java/glowredman/darkerer/DarkererEventHandler.java b/src/main/java/glowredman/darkerer/DarkererEventHandler.java new file mode 100644 index 0000000..a35827e --- /dev/null +++ b/src/main/java/glowredman/darkerer/DarkererEventHandler.java @@ -0,0 +1,28 @@ +package glowredman.darkerer; + +import net.minecraft.entity.player.EntityPlayer; + +import org.apache.commons.lang3.ArrayUtils; + +import com.gtnewhorizon.gtnhlib.eventbus.EventBusSubscriber; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.relauncher.Side; + +@EventBusSubscriber(side = Side.CLIENT) +public class DarkererEventHandler { + + @SubscribeEvent + public static void onClientTick(ClientTickEvent event) { + if (event.phase == Phase.START) { + return; + } + EntityPlayer player = FMLClientHandler.instance() + .getClientPlayerEntity(); + DarkererCore.enabled = player != null && !ArrayUtils.contains(DarkererConfig.dimBlocklist, player.dimension); + } + +} diff --git a/src/main/java/glowredman/darkerer/DarkererLateMixins.java b/src/main/java/glowredman/darkerer/DarkererLateMixins.java new file mode 100644 index 0000000..1b3faa0 --- /dev/null +++ b/src/main/java/glowredman/darkerer/DarkererLateMixins.java @@ -0,0 +1,25 @@ +package glowredman.darkerer; + +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import com.gtnewhorizon.gtnhmixins.ILateMixinLoader; +import com.gtnewhorizon.gtnhmixins.LateMixin; + +@LateMixin +public class DarkererLateMixins implements ILateMixinLoader { + + @Override + public String getMixinConfig() { + return "mixins.darkerer.late.json"; + } + + @Override + public List getMixins(Set loadedMods) { + if (loadedMods.contains("TwilightForest")) { + return Collections.singletonList("MixinWorldProviderTwilightForest"); + } + return Collections.emptyList(); + } +} diff --git a/src/main/java/glowredman/darkerer/Mode.java b/src/main/java/glowredman/darkerer/Mode.java new file mode 100644 index 0000000..18eb912 --- /dev/null +++ b/src/main/java/glowredman/darkerer/Mode.java @@ -0,0 +1,7 @@ +package glowredman.darkerer; + +public enum Mode { + EVERYWHERE, + ONLY_INSIDE, + MOON_PHASE; +} diff --git a/src/main/java/glowredman/darkerer/mixins/MixinEntityRenderer.java b/src/main/java/glowredman/darkerer/mixins/MixinEntityRenderer.java new file mode 100644 index 0000000..5f049cc --- /dev/null +++ b/src/main/java/glowredman/darkerer/mixins/MixinEntityRenderer.java @@ -0,0 +1,93 @@ +package glowredman.darkerer.mixins; + +import net.minecraft.client.renderer.EntityRenderer; + +import org.spongepowered.asm.lib.Opcodes; +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 com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.sugar.Local; +import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef; + +import glowredman.darkerer.DarkererConfig; +import glowredman.darkerer.DarkererCore; +import glowredman.darkerer.Mode; + +@Mixin(EntityRenderer.class) +public class MixinEntityRenderer { + + @Shadow + private @Final int[] lightmapColors; + + @ModifyExpressionValue( + at = { @At(args = "floatValue=0.03", value = "CONSTANT"), @At(args = "floatValue=0.05", value = "CONSTANT"), + @At(args = "floatValue=0.35", value = "CONSTANT") }, + expect = 9, + method = "updateLightmap") + private float modifyMin(float original) { + return DarkererCore.enabled ? 0.0f : original; + } + + @ModifyExpressionValue( + at = { @At(args = "floatValue=0.96", value = "CONSTANT"), @At(args = "floatValue=0.95", value = "CONSTANT"), + @At(args = "floatValue=0.65", value = "CONSTANT") }, + expect = 9, + method = "updateLightmap") + private float modifyMax(float original) { + return DarkererCore.enabled ? 1.0f : original; + } + + @ModifyExpressionValue( + at = @At( + opcode = Opcodes.GETFIELD, + target = "Lnet/minecraft/world/WorldProvider;dimensionId:I", + value = "FIELD"), + expect = 1, + method = "updateLightmap") + private int darkenEnd(int original) { + return DarkererCore.enabled && DarkererConfig.darkEnd ? 0 : original; + } + + @Inject( + at = @At( + opcode = Opcodes.GETFIELD, + ordinal = 2, + target = "Lnet/minecraft/client/renderer/EntityRenderer;mc:Lnet/minecraft/client/Minecraft;", + value = "FIELD"), + expect = 1, + method = "updateLightmap") + private void adjustNightVisionColor(CallbackInfo ci, @Local(ordinal = 8) LocalFloatRef r, + @Local(ordinal = 9) LocalFloatRef g, @Local(ordinal = 10) LocalFloatRef b) { + r.set(r.get() * 0.9f + 0.1f); + g.set(g.get() * 0.9f + 0.1f); + b.set(b.get() * 0.9f + 0.1f); + } + + @Inject( + at = @At( + opcode = Opcodes.GETFIELD, + target = "Lnet/minecraft/client/renderer/EntityRenderer;lightmapTexture:Lnet/minecraft/client/renderer/texture/DynamicTexture;", + value = "FIELD"), + expect = 1, + method = "updateLightmap") + private void modifyLightmap(CallbackInfo ci) { + if (!DarkererCore.enabled || !DarkererConfig.removeBlueSkyLight || DarkererConfig.mode == Mode.EVERYWHERE) { + return; + } + for (int i = 0; i < this.lightmapColors.length; i++) { + int height = i / 16; + if (height > 0 && height < 16) { + int red = (this.lightmapColors[i] >> 16) & 0xFF; + if (DarkererConfig.mode == Mode.ONLY_INSIDE) { + red = Math.min(0xFF, red + 25); + } + this.lightmapColors[i] = this.lightmapColors[i] & 0xFF000000 | red << 16 | red << 8 | red; + } + } + } +} diff --git a/src/main/java/glowredman/darkerer/mixins/MixinWorld.java b/src/main/java/glowredman/darkerer/mixins/MixinWorld.java new file mode 100644 index 0000000..fddf610 --- /dev/null +++ b/src/main/java/glowredman/darkerer/mixins/MixinWorld.java @@ -0,0 +1,59 @@ +package glowredman.darkerer.mixins; + +import net.minecraft.client.Minecraft; +import net.minecraft.world.World; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.sugar.Share; +import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef; + +import glowredman.darkerer.DarkererConfig; +import glowredman.darkerer.DarkererCore; + +@Mixin(World.class) +public class MixinWorld { + + @ModifyExpressionValue( + at = @At(args = "floatValue=0.2", ordinal = 1, value = "CONSTANT"), + expect = 1, + method = "getSunBrightnessBody", + remap = false) + private float modifyMin(float original, @Share("min") LocalFloatRef min) { + if (!DarkererCore.enabled) { + return original; + } + switch (DarkererConfig.mode) { + case EVERYWHERE: + return 0.0f; + case MOON_PHASE: + return min.get(); + default: + return original; + } + } + + @ModifyExpressionValue( + at = @At(args = "floatValue=0.8", value = "CONSTANT"), + expect = 1, + method = "getSunBrightnessBody", + remap = false) + private float modifyMax(float original, @Share("min") LocalFloatRef min) { + if (!DarkererCore.enabled) { + return original; + } + switch (DarkererConfig.mode) { + case EVERYWHERE: + return 1.0f; + case MOON_PHASE: + int phase = (int) (Minecraft.getMinecraft().theWorld.getCurrentMoonPhaseFactorBody() * 10.0f); + float max = 0.7f + (10 - phase) * 0.03f; + min.set(1.0f - max); + return max; + default: + return original; + } + } +} diff --git a/src/main/java/glowredman/darkerer/mixins/MixinWorldProviderHell.java b/src/main/java/glowredman/darkerer/mixins/MixinWorldProviderHell.java new file mode 100644 index 0000000..799c7ac --- /dev/null +++ b/src/main/java/glowredman/darkerer/mixins/MixinWorldProviderHell.java @@ -0,0 +1,24 @@ +package glowredman.darkerer.mixins; + +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldProviderHell; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import glowredman.darkerer.DarkererConfig; +import glowredman.darkerer.DarkererCore; + +@Mixin(WorldProviderHell.class) +public abstract class MixinWorldProviderHell extends WorldProvider { + + @Inject(at = @At("HEAD"), cancellable = true, method = "generateLightBrightnessTable") + private void replaceNetherLightCalc(CallbackInfo ci) { + if (DarkererCore.enabled && DarkererConfig.darkNether) { + super.generateLightBrightnessTable(); + ci.cancel(); + } + } +} diff --git a/src/main/java/glowredman/darkerer/mixins/MixinWorldProviderTwilightForest.java b/src/main/java/glowredman/darkerer/mixins/MixinWorldProviderTwilightForest.java new file mode 100644 index 0000000..78f3f86 --- /dev/null +++ b/src/main/java/glowredman/darkerer/mixins/MixinWorldProviderTwilightForest.java @@ -0,0 +1,19 @@ +package glowredman.darkerer.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; + +import glowredman.darkerer.DarkererConfig; +import glowredman.darkerer.DarkererCore; +import twilightforest.world.WorldProviderTwilightForest; + +@Mixin(WorldProviderTwilightForest.class) +public class MixinWorldProviderTwilightForest { + + @ModifyExpressionValue(at = @At(args = "floatValue=0.225", value = "CONSTANT"), method = "calculateCelestialAngle") + private float modifyCelestialAngle(float original) { + return DarkererCore.enabled && DarkererConfig.darkTwilightForest ? 0.5f : original; + } +} diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000..b697c30 --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,21 @@ +{ + "modListVersion": 2, + "modList": [{ + "modid": "${modId}", + "name": "${modName}", + "description": "Makes the world a lot darker", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", + "url": "https://github.com/glowredman/Darkerer", + "updateUrl": "", + "authorList": ["glowredman"], + "credits": "lumien (author of Hardcore Darkness)", + "logoFile": "", + "screenshots": [], + "parent": "", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "useDependencyInformation": false + }] +} diff --git a/src/main/resources/mixins.darkerer.early.json b/src/main/resources/mixins.darkerer.early.json new file mode 100644 index 0000000..8a9ec40 --- /dev/null +++ b/src/main/resources/mixins.darkerer.early.json @@ -0,0 +1,8 @@ +{ + "required": true, + "minVersion": "0.8.3-GTNH", + "package": "glowredman.darkerer.mixins", + "refmap": "mixins.darkerer.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" + } diff --git a/src/main/resources/mixins.darkerer.json b/src/main/resources/mixins.darkerer.json new file mode 100644 index 0000000..a62d8aa --- /dev/null +++ b/src/main/resources/mixins.darkerer.json @@ -0,0 +1,11 @@ +{ + "required": true, + "minVersion": "0.8.3-GTNH", + "package": "glowredman.darkerer.mixins", + "refmap": "mixins.darkerer.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8", + "mixins": [], + "client": [], + "server": [] +} diff --git a/src/main/resources/mixins.darkerer.late.json b/src/main/resources/mixins.darkerer.late.json new file mode 100644 index 0000000..8a9ec40 --- /dev/null +++ b/src/main/resources/mixins.darkerer.late.json @@ -0,0 +1,8 @@ +{ + "required": true, + "minVersion": "0.8.3-GTNH", + "package": "glowredman.darkerer.mixins", + "refmap": "mixins.darkerer.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" + }