Browse Source

initial port to 1.13.2

TheIllusiveC4 6 năm trước cách đây
mục cha
commit
bc5c6bb084

+ 20 - 20
.gitignore

@@ -1,23 +1,23 @@
-.gradle
-/build/
-/classes/
-/gradle/
-
-# Ignore Gradle GUI config
-gradle-app.setting
-
-# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
-!gradle-wrapper.jar
+# eclipse
+bin
+*.launch
+.settings
+.metadata
+.classpath
+.project
 
-# Cache of project
-.gradletasknamecache
+# idea
+out
+*.ipr
+*.iws
+*.iml
+.idea
 
-# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
-# gradle/wrapper/gradle-wrapper.properties
-
-# intellij
-/.idea
-/*.iml
+# gradle
+build
+.gradle
+/classes
 
-# ForgeGradle
-/run
+# other
+eclipse
+run

+ 11 - 162
LICENSE

@@ -1,165 +1,14 @@
-                   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
+Copyright (C) 2018-2019 C4
 
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
+Custom FoV is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published
+by the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
+Custom FoV is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
 
-  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.
+You should have received a copy of the GNU Lesser General Public License
+along with Custom FoV.  If not, see <https://www.gnu.org/licenses/>.

+ 35 - 39
build.gradle

@@ -1,30 +1,42 @@
 buildscript {
     repositories {
+        maven { url = 'https://files.minecraftforge.net/maven' }
         jcenter()
-        maven { url = "http://files.minecraftforge.net/maven" }
+        mavenCentral()
     }
     dependencies {
-        classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
+        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
     }
 }
-apply plugin: 'net.minecraftforge.gradle.forge'
+apply plugin: 'net.minecraftforge.gradle'
 
 version = "${version_minecraft}-${version_mod}"
 group = "${mod_group}.${mod_id}"
 archivesBaseName = "${mod_id}"
 
-sourceCompatibility = targetCompatibility = '1.8'
-compileJava {
-    sourceCompatibility = targetCompatibility = '1.8'
-}
+sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
 
 minecraft {
-    version = "${version_minecraft}-${version_forge}"
-    runDir = "run"
-    mappings = "${version_mcp}"
-    replace '@VERSION@', project.version
-    replace '@FINGERPRINT@', project.findProperty('signSHA1')
-    replaceIn "${mod_class}.java"
+    mappings channel: 'snapshot', version: '20180921-1.13'
+	
+    runs {
+        client = {
+            properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
+            properties 'forge.logging.console.level': 'debug'
+            workingDirectory project.file('run').canonicalPath
+            source sourceSets.main
+        }
+        server = {
+            properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
+            properties 'forge.logging.console.level': 'debug'
+            workingDirectory project.file('run').canonicalPath
+            source sourceSets.main
+        }
+    }
+}
+
+dependencies {
+    minecraft 'net.minecraftforge:forge:1.13.2-25.0.10'
 }
 
 sourceSets {
@@ -35,30 +47,14 @@ sourceSets {
     }
 }
 
-processResources {
-
-    from(sourceSets.main.resources.srcDirs) {
-        include 'mcmod.info'
-        expand 'version':project.version, 'mcversion':project.minecraft.version
-    }
-
-    from(sourceSets.main.resources.srcDirs) {
-        exclude 'mcmod.info'
-    }
-}
-
-task signJar(type: SignJar, dependsOn: reobfJar) {
-
-    onlyIf {
-        project.hasProperty('keyStore')
+jar {
+    manifest {
+        attributes(["Specification-Title": "${archivesBaseName}",
+                    "Specification-Vendor": "C4",
+                    "Specification-Version": "24.0",
+                    "Implementation-Title": project.name,
+                    "Implementation-Version": "${version}",
+                    "Implementation-Vendor" :"C4",
+                    "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
     }
-
-    keyStore = project.findProperty('keyStore')
-    alias = project.findProperty('keyStoreAlias')
-    storePass = project.findProperty('keyStorePass')
-    keyPass = project.findProperty('keyStoreKeyPass')
-    inputFile = jar.archivePath
-    outputFile = jar.archivePath
-}
-
-build.dependsOn signJar
+}

+ 2 - 13
docs/CHANGELOG.md

@@ -4,16 +4,5 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project does not adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
 This project uses MCVERSION-MAJORMOD.MAJORAPI.MINOR.PATCH.
 
-## [1.0] - 2018.10.08
-### Changed
-- Sort config GUI by category rather than by alphabetical order
-
-## [0.2] - 2018.10.01
-### Added
-- Minimum FoV modifier value configuration option
-- Underwater FoV options
-### Changed
-- Released bottom limits on maximum value configuration option
-
-## [0.1] - 2018.09.30
-Initial beta release
+## [2.0-pre1] - Unreleased
+Ported to 1.13.2 - Forge 25.0.10

+ 0 - 0
docs/licenses/LICENSE.GPL → docs/licenses/GPL


+ 165 - 0
docs/licenses/GPL.LESSER

@@ -0,0 +1,165 @@
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ 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.

+ 11 - 162
docs/licenses/LICENSE

@@ -1,165 +1,14 @@
-                   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
+Copyright (C) 2018-2019 C4
 
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
+Custom FoV is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published
+by the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
+Custom FoV is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
 
-  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.
+You should have received a copy of the GNU Lesser General Public License
+along with Custom FoV.  If not, see <https://www.gnu.org/licenses/>.

+ 3 - 5
gradle.properties

@@ -1,8 +1,6 @@
-mod_group=c4
+mod_group=top.theillusivec4
 mod_id=customfov
 mod_class=CustomFoV
 
-version_mod=1.0
-version_minecraft=1.12.2
-version_forge=14.23.5.2768
-version_mcp=stable_39
+version_mod=2.0-pre1
+version_minecraft=1.13.2

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Fri Feb 15 14:07:50 PST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

+ 43 - 35
gradlew

@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
 
 ##############################################################################
 ##
@@ -6,20 +6,38 @@
 ##
 ##############################################################################
 
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
 
 APP_NAME="Gradle"
 APP_BASE_NAME=`basename "$0"`
 
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD="maximum"
 
-warn ( ) {
+warn () {
     echo "$*"
 }
 
-die ( ) {
+die () {
     echo
     echo "$*"
     echo
@@ -30,6 +48,7 @@ die ( ) {
 cygwin=false
 msys=false
 darwin=false
+nonstop=false
 case "`uname`" in
   CYGWIN* )
     cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
   MINGW* )
     msys=true
     ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
 esac
 
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
-    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '/.*' > /dev/null; then
-        PRG="$link"
-    else
-        PRG=`dirname "$PRG"`"/$link"
-    fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
 
 # Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
 fi
 
 # Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
     MAX_FD_LIMIT=`ulimit -H -n`
     if [ $? -eq 0 ] ; then
         if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
 if $cygwin ; then
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
 
     # We build the pattern for arguments to be converted via cygpath
     ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
     esac
 fi
 
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
-    JVM_OPTS=("$@")
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
 }
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
 
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"

+ 4 - 10
gradlew.bat

@@ -8,14 +8,14 @@
 @rem Set local scope for the variables with windows NT shell
 if "%OS%"=="Windows_NT" setlocal
 
-@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=
-
 set DIRNAME=%~dp0
 if "%DIRNAME%" == "" set DIRNAME=.
 set APP_BASE_NAME=%~n0
 set APP_HOME=%DIRNAME%
 
+@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=
+
 @rem Find java.exe
 if defined JAVA_HOME goto findJavaFromJavaHome
 
@@ -46,10 +46,9 @@ echo location of your Java installation.
 goto fail
 
 :init
-@rem Get command-line arguments, handling Windowz variants
+@rem Get command-line arguments, handling Windows variants
 
 if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
 
 :win9xME_args
 @rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
 if "x%~1" == "x" goto execute
 
 set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
 
 :execute
 @rem Setup the command line

+ 0 - 34
src/main/java/c4/customfov/CustomFoV.java

@@ -1,34 +0,0 @@
-package c4.customfov;
-
-import c4.customfov.core.EventHandlerClient;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fml.common.FMLLog;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.common.Mod.EventHandler;
-import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
-import net.minecraftforge.fml.common.event.FMLInitializationEvent;
-import org.apache.logging.log4j.Level;
-
-@Mod(   modid = CustomFoV.MODID,
-        name = CustomFoV.NAME,
-        version = "@VERSION@",
-        dependencies = "required-after:forge@[14.23.5.2768,)",
-        acceptedMinecraftVersions = "[1.12, 1.13)",
-        certificateFingerprint = "@FINGERPRINT@",
-        clientSideOnly = true,
-        guiFactory = "c4.customfov.client.gui.SortedGuiConfigFactory")
-public class CustomFoV {
-
-    public static final String MODID = "customfov";
-    public static final String NAME = "Custom FoV";
-
-    @EventHandler
-    public void init(FMLInitializationEvent evt) {
-        MinecraftForge.EVENT_BUS.register(new EventHandlerClient());
-    }
-
-    @EventHandler
-    public void onFingerPrintViolation(FMLFingerprintViolationEvent evt) {
-        FMLLog.log.log(Level.ERROR, "Invalid fingerprint detected! The file " + evt.getSource().getName() + " may have been tampered with. This version will NOT be supported by the author!");
-    }
-}

+ 0 - 43
src/main/java/c4/customfov/client/gui/SortedGuiConfig.java

@@ -1,43 +0,0 @@
-package c4.customfov.client.gui;
-
-import c4.customfov.CustomFoV;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraftforge.common.config.ConfigElement;
-import net.minecraftforge.common.config.ConfigManager;
-import net.minecraftforge.fml.client.config.GuiConfig;
-import net.minecraftforge.fml.client.config.IConfigElement;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class SortedGuiConfig extends GuiConfig {
-
-    public SortedGuiConfig(GuiScreen parentScreen) {
-        this(parentScreen, CustomFoV.MODID, false, false, CustomFoV.NAME,
-                ConfigManager.getModConfigClasses(CustomFoV.MODID));
-    }
-
-    public SortedGuiConfig(GuiScreen parentScreen, String modID, boolean allRequireWorldRestart,
-                           boolean allRequireMcRestart, String title, Class<?>... configClasses) {
-        super(parentScreen, collectConfigElements(configClasses), modID, null, allRequireWorldRestart,
-                allRequireMcRestart, title, null);
-    }
-
-    private static List<IConfigElement> collectConfigElements(Class<?>[] configClasses)
-    {
-        List<IConfigElement> toReturn;
-        if(configClasses.length == 1)
-        {
-            toReturn = ConfigElement.from(configClasses[0]).getChildElements();
-        }
-        else
-        {
-            toReturn = new ArrayList<>();
-            for(Class<?> clazz : configClasses)
-            {
-                toReturn.add(ConfigElement.from(clazz));
-            }
-        }
-        return toReturn;
-    }
-}

+ 0 - 34
src/main/java/c4/customfov/client/gui/SortedGuiConfigFactory.java

@@ -1,34 +0,0 @@
-package c4.customfov.client.gui;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraftforge.fml.client.DefaultGuiFactory;
-import net.minecraftforge.fml.client.IModGuiFactory;
-import net.minecraftforge.fml.client.config.GuiConfig;
-
-import java.util.Set;
-
-public class SortedGuiConfigFactory implements IModGuiFactory {
-
-    public SortedGuiConfigFactory() {}
-
-    @Override
-    public boolean hasConfigGui()
-    {
-        return true;
-    }
-
-    @Override
-    public void initialize(Minecraft minecraftInstance) {}
-
-    @Override
-    public GuiScreen createConfigGui(GuiScreen parentScreen) {
-        return new SortedGuiConfig(parentScreen);
-    }
-
-    @Override
-    public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
-    {
-        return null;
-    }
-}

+ 0 - 140
src/main/java/c4/customfov/core/ConfigHandler.java

@@ -1,140 +0,0 @@
-package c4.customfov.core;
-
-import c4.customfov.CustomFoV;
-import net.minecraftforge.common.config.Config;
-import net.minecraftforge.common.config.Config.*;
-import net.minecraftforge.common.config.ConfigManager;
-import net.minecraftforge.fml.client.event.ConfigChangedEvent;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-
-@Config(modid = CustomFoV.MODID)
-public class ConfigHandler {
-
-    @Name("Static FoV")
-    @Comment("Set to true to disable all vanilla FoV modifiers")
-    public static boolean staticFoV = false;
-
-    @Name("Flying")
-    @Comment("Configure flying FoV settings")
-    public static final Flying flying = new Flying();
-
-    @Name("Aiming")
-    @Comment("Configure aiming FoV settings")
-    public static final Aiming aiming = new Aiming();
-
-    @Name("Speed")
-    @Comment("Configure speed FoV settings")
-    public static final Speed speed = new Speed();
-
-    @Name("Underwater")
-    @Comment("Configure underwater FoV settings")
-    public static final Underwater underwater = new Underwater();
-
-    public static class Flying {
-
-        @Name("Modifier")
-        @Comment("The modifier to multiply by the original FoV modifier")
-        public double modifier = 1.0D;
-
-        @Name("Maximum Value")
-        @Comment("The maximum FoV flying modifier value")
-        @RangeDouble(min = -Double.MAX_VALUE)
-        public double maxValue = 10.0D;
-
-        @Name("Minimum Value")
-        @Comment("The minimum FoV flying modifier value")
-        @RangeDouble(min = -Double.MAX_VALUE)
-        public double minValue = -10.0D;
-    }
-
-    public static class Aiming {
-
-        @Name("Modifier")
-        @Comment("The modifier to multiply by the original FoV modifier")
-        public double modifier = 1.0D;
-
-        @Name("Maximum Value")
-        @Comment("The maximum FoV aiming modifier value")
-        @RangeDouble(min = -Double.MAX_VALUE)
-        public double maxValue = 10.0D;
-
-        @Name("Minimum Value")
-        @Comment("The minimum FoV aiming modifier value")
-        @RangeDouble(min = -Double.MAX_VALUE)
-        public double minValue = -10.0D;
-    }
-
-    public static class Speed {
-
-        @Name("Sprinting")
-        @Comment("Configure sprinting FoV settings")
-        public final Sprinting sprinting = new Sprinting();
-
-        @Name("Effects")
-        @Comment("Configure speed potion effects FoV settings")
-        public final Effects effects = new Effects();
-
-        public class Sprinting {
-
-            @Name("Modifier")
-            @Comment("The modifier to multiply by the original FoV modifier")
-            public double modifier = 1.0D;
-
-            @Name("Maximum Value")
-            @Comment("The maximum FoV sprinting modifier value")
-            @RangeDouble(min = -Double.MAX_VALUE)
-            public double maxValue = 10.0D;
-
-            @Name("Minimum Value")
-            @Comment("The minimum FoV sprinting modifier value")
-            @RangeDouble(min = -Double.MAX_VALUE)
-            public double minValue = -10.0D;
-        }
-
-        public class Effects {
-
-            @Name("Modifier")
-            @Comment("The modifier to multiply by the original FoV modifier")
-            public double modifier = 1.0D;
-
-            @Name("Maximum Value")
-            @Comment("The maximum FoV effects modifier value")
-            @RangeDouble(min = -Double.MAX_VALUE)
-            public double maxValue = 10.0D;
-
-            @Name("Minimum Value")
-            @Comment("The minimum FoV effects modifier value")
-            @RangeDouble(min = -Double.MAX_VALUE)
-            public double minValue = -10.0D;
-        }
-    }
-
-    public static class Underwater {
-
-        @Name("Modifier")
-        @Comment("The modifier to multiply by the original FoV modifier")
-        public double modifier = 1.0D;
-
-        @Name("Maximum Value")
-        @Comment("The maximum FoV underwater modifier value")
-        @RangeDouble(min = -Double.MAX_VALUE)
-        public double maxValue = 10.0D;
-
-        @Name("Minimum Value")
-        @Comment("The minimum FoV underwater modifier value")
-        @RangeDouble(min = -Double.MAX_VALUE)
-        public double minValue = -10.0D;
-    }
-
-    @Mod.EventBusSubscriber(modid = CustomFoV.MODID)
-    private static class ConfigEventHandler {
-
-        @SubscribeEvent
-        public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent evt) {
-            if (evt.getModID().equals(CustomFoV.MODID)) {
-                ConfigManager.sync(CustomFoV.MODID, Config.Type.INSTANCE);
-            }
-        }
-    }
-}

+ 25 - 0
src/main/java/top/theillusivec4/customfov/CustomFoV.java

@@ -0,0 +1,25 @@
+package top.theillusivec4.customfov;
+
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.fml.ModLoadingContext;
+import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.config.ModConfig;
+import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
+import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
+import top.theillusivec4.customfov.core.EventHandler;
+import top.theillusivec4.customfov.core.FoVConfig;
+
+@Mod(CustomFoV.MODID)
+public class CustomFoV {
+
+    public static final String MODID = "customfov";
+
+    public CustomFoV() {
+        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setupClient);
+        ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, FoVConfig.spec);
+    }
+
+    private void setupClient(final FMLClientSetupEvent evt) {
+        MinecraftForge.EVENT_BUS.register(new EventHandler());
+    }
+}

+ 24 - 28
src/main/java/c4/customfov/core/EventHandlerClient.java → src/main/java/top/theillusivec4/customfov/core/EventHandler.java

@@ -1,4 +1,4 @@
-package c4.customfov.core;
+package top.theillusivec4.customfov.core;
 
 import net.minecraft.block.material.Material;
 import net.minecraft.block.state.IBlockState;
@@ -11,10 +11,10 @@ import net.minecraft.init.Items;
 import net.minecraft.util.math.MathHelper;
 import net.minecraftforge.client.event.EntityViewRenderEvent;
 import net.minecraftforge.client.event.FOVUpdateEvent;
-import net.minecraftforge.fml.common.eventhandler.EventPriority;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.eventbus.api.EventPriority;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
 
-public class EventHandlerClient {
+public class EventHandler {
 
     @SubscribeEvent(priority = EventPriority.HIGHEST)
     public void onFoVUpdate(FOVUpdateEvent evt) {
@@ -23,50 +23,46 @@ public class EventHandlerClient {
 
     @SubscribeEvent(priority = EventPriority.HIGHEST)
     public void onFoVModifier(EntityViewRenderEvent.FOVModifier evt) {
-        IBlockState iblockstate = ActiveRenderInfo.getBlockStateAtEntityViewpoint(Minecraft.getMinecraft().world, evt.getEntity(),
+        IBlockState iblockstate = ActiveRenderInfo.getBlockStateAtEntityViewpoint(Minecraft.getInstance().world, evt.getEntity(),
                 (float)evt.getRenderPartialTicks());
 
         if (iblockstate.getMaterial() == Material.WATER) {
             float originalModifier = 60.0F / 70.0F;
-            evt.setFOV(evt.getFOV() / originalModifier * getConfiguredValue(originalModifier,
-                    ConfigHandler.underwater.modifier, ConfigHandler.underwater.maxValue,
-                    ConfigHandler.underwater.minValue));
+            evt.setFOV(evt.getFOV() / originalModifier * getConfiguredValue(originalModifier, FoVConfig.underwaterModifier.get(),
+                    FoVConfig.underwaterMax.get(), FoVConfig.underwaterMin.get()));
         }
     }
 
     private float getNewFovModifier() {
-        EntityPlayer player = Minecraft.getMinecraft().player;
+        EntityPlayer player = Minecraft.getInstance().player;
         float modifier = 1.0F;
 
-        if (ConfigHandler.staticFoV) {
+        if (FoVConfig.staticFoV.get()) {
             return modifier;
         }
 
-        if (player.capabilities.isFlying) {
-            modifier *= 1.0F + getConfiguredValue(0.1F, ConfigHandler.flying.modifier,
-                    ConfigHandler.flying.maxValue, ConfigHandler.flying.minValue);
+        if (player.abilities.isFlying) {
+            modifier *= 1.0F + getConfiguredValue(0.1F, FoVConfig.flyingModifier.get(), FoVConfig.flyingMax.get(),
+                    FoVConfig.flyingMin.get());
         }
 
-        IAttributeInstance iattributeinstance = player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
-        float speedModifier = (float)((iattributeinstance.getAttributeValue()
-                / (double)player.capabilities.getWalkSpeed() + 1.0D) / 2.0D);
-        float value = (float)iattributeinstance.getAttributeValue();
-        float effPercent = Math.abs((value / (player.isSprinting() ? 1.3F : 1.0F) - player.capabilities.getWalkSpeed())
-                / (value - player.capabilities.getWalkSpeed()));
-        float configModifier = getConfiguredValue(effPercent * (speedModifier - 1),
-                ConfigHandler.speed.effects.modifier, ConfigHandler.speed.effects.maxValue,
-                ConfigHandler.speed.effects.minValue);
+        IAttributeInstance iattributeinstance = player.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
+        float speedModifier = (float)((iattributeinstance.getValue() / (double)player.abilities.getWalkSpeed() + 1.0D) / 2.0D);
+        float value = (float)iattributeinstance.getValue();
+        float effPercent = Math.abs((value / (player.isSprinting() ? 1.3F : 1.0F) - player.abilities.getWalkSpeed())
+                / (value - player.abilities.getWalkSpeed()));
+        float configModifier = getConfiguredValue(effPercent * (speedModifier - 1), FoVConfig.effectsModifier.get(),
+                FoVConfig.effectsMax.get(), FoVConfig.effectsMin.get());
 
         if (player.isSprinting()) {
             float sprintPercent = 1.0F - effPercent;
-            float sprintModifier = getConfiguredValue(sprintPercent * (speedModifier - 1),
-                    ConfigHandler.speed.sprinting.modifier, ConfigHandler.speed.sprinting.maxValue,
-                    ConfigHandler.speed.sprinting.minValue);
+            float sprintModifier = getConfiguredValue(sprintPercent * (speedModifier - 1), FoVConfig.sprintingModifier.get(),
+                    FoVConfig.sprintingMax.get(), FoVConfig.sprintingMin.get());
             configModifier += sprintModifier;
         }
         modifier = (float) ((double) modifier * (1.0D + configModifier));
 
-        if (player.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(modifier) || Float.isInfinite(modifier)) {
+        if (player.abilities.getWalkSpeed() == 0.0F || Float.isNaN(modifier) || Float.isInfinite(modifier)) {
             modifier = 1.0F;
         }
 
@@ -80,8 +76,8 @@ public class EventHandlerClient {
                 f1 = f1 * f1;
             }
 
-            modifier *= 1.0F - getConfiguredValue(f1 * 0.15F, ConfigHandler.aiming.modifier,
-                    ConfigHandler.aiming.maxValue, ConfigHandler.aiming.minValue);
+            modifier *= 1.0F - getConfiguredValue(f1 * 0.15F, FoVConfig.aimingModifier.get(), FoVConfig.aimingMax.get(),
+                    FoVConfig.aimingMin.get());
         }
 
         return modifier;

+ 159 - 0
src/main/java/top/theillusivec4/customfov/core/FoVConfig.java

@@ -0,0 +1,159 @@
+package top.theillusivec4.customfov.core;
+
+import net.minecraftforge.common.ForgeConfig;
+import net.minecraftforge.common.ForgeConfigSpec;
+import net.minecraftforge.common.ForgeConfigSpec.*;
+import org.apache.commons.lang3.tuple.Pair;
+import top.theillusivec4.customfov.CustomFoV;
+
+public class FoVConfig {
+
+    static final BooleanValue staticFoV;
+
+    //Flying
+    static final DoubleValue flyingModifier;
+    static final DoubleValue flyingMax;
+    static final DoubleValue flyingMin;
+
+    //Aiming
+    static final DoubleValue aimingModifier;
+    static final DoubleValue aimingMax;
+    static final DoubleValue aimingMin;
+
+    //Sprinting
+    static final DoubleValue sprintingModifier;
+    static final DoubleValue sprintingMax;
+    static final DoubleValue sprintingMin;
+
+    //Effects
+    static final DoubleValue effectsModifier;
+    static final DoubleValue effectsMax;
+    static final DoubleValue effectsMin;
+
+    //Underwater
+    static final DoubleValue underwaterModifier;
+    static final DoubleValue underwaterMax;
+    static final DoubleValue underwaterMin;
+
+    public static final ForgeConfigSpec spec;
+
+    private static final String CONFIG_PREFIX = "gui." + CustomFoV.MODID + ".config.";
+
+    static {
+        Builder builder = new Builder();
+
+        {
+            staticFoV = builder
+                    .comment("Set to true to disable all vanilla FoV modifiers")
+                    .translation(CONFIG_PREFIX + "staticFoV")
+                    .define("staticFoV", false);
+        }
+
+        {
+            builder.push("Flying");
+
+            flyingModifier = builder
+                    .comment("The modifier to multiply by the original FoV modifier")
+                    .translation(CONFIG_PREFIX + "flyingModifier")
+                    .defineInRange("flyingModifier", 1.0d, 0.0d, 10.0d);
+
+            flyingMax = builder
+                    .comment("The maximum FoV flying modifier value")
+                    .translation(CONFIG_PREFIX + "flyingMax")
+                    .defineInRange("flyingMax", 10.0d, -10.0d, 10.0d);
+
+            flyingMin = builder
+                    .comment("The minimum FoV flying modifier value")
+                    .translation(CONFIG_PREFIX + "flyingMin")
+                    .defineInRange("flyingMin", -10.0d, -10.0d, 10.0d);
+
+            builder.pop();
+        }
+
+        {
+            builder.push("Aiming");
+
+            aimingModifier = builder
+                    .comment("The modifier to multiply by the original FoV modifier")
+                    .translation(CONFIG_PREFIX + "aimingModifier")
+                    .defineInRange("aimingModifier", 1.0d, 0.0d, 10.0d);
+
+            aimingMax = builder
+                    .comment("The maximum FoV aiming modifier value")
+                    .translation(CONFIG_PREFIX + "aimingMax")
+                    .defineInRange("aimingMax", 10.0d, -10.0d, 10.0d);
+
+            aimingMin = builder
+                    .comment("The minimum FoV aiming modifier value")
+                    .translation(CONFIG_PREFIX + "aimingMin")
+                    .defineInRange("aimingMin", -10.0d, -10.0d, 10.0d);
+
+            builder.pop();
+        }
+
+        {
+            builder.push("Sprinting");
+
+            sprintingModifier = builder
+                    .comment("The modifier to multiply by the original FoV modifier")
+                    .translation(CONFIG_PREFIX + "sprintingModifier")
+                    .defineInRange("sprintingModifier", 1.0d, 0.0d, 10.0d);
+
+            sprintingMax = builder
+                    .comment("The maximum FoV sprinting modifier value")
+                    .translation(CONFIG_PREFIX + "sprintingMax")
+                    .defineInRange("sprintingMax", 10.0d, -10.0d, 10.0d);
+
+            sprintingMin = builder
+                    .comment("The minimum FoV sprinting modifier value")
+                    .translation(CONFIG_PREFIX + "sprintingMin")
+                    .defineInRange("sprintingMin", -10.0d, -10.0d, 10.0d);
+
+            builder.pop();
+        }
+
+        {
+            builder.push("Effects");
+
+            effectsModifier = builder
+                    .comment("The modifier to multiply by the original FoV modifier")
+                    .translation(CONFIG_PREFIX + "effectsModifier")
+                    .defineInRange("effectsModifier", 1.0d, 0.0d, 10.0d);
+
+            effectsMax = builder
+                    .comment("The maximum FoV effects modifier value")
+                    .translation(CONFIG_PREFIX + "effectsMax")
+                    .defineInRange("effectsMax", 10.0d, -10.0d, 10.0d);
+
+            effectsMin = builder
+                    .comment("The minimum FoV effects modifier value")
+                    .translation(CONFIG_PREFIX + "effectsMin")
+                    .defineInRange("effectsMin", -10.0d, -10.0d, 10.0d);
+
+            builder.pop();
+        }
+
+        {
+            builder.push("Underwater");
+
+            underwaterModifier = builder
+                    .comment("The modifier to multiply by the original FoV modifier")
+                    .translation(CONFIG_PREFIX + "underwaterModifier")
+                    .defineInRange("underwaterModifier", 1.0d, 0.0d, 10.0d);
+
+            underwaterMax = builder
+                    .comment("The maximum FoV underwater modifier value")
+                    .translation(CONFIG_PREFIX + "underwaterMax")
+                    .defineInRange("underwaterMax", 10.0d, -10.0d, 10.0d);
+
+            underwaterMin = builder
+                    .comment("The minimum FoV underwater modifier value")
+                    .translation(CONFIG_PREFIX + "underwaterMin")
+                    .defineInRange("underwaterMin", -10.0d, -10.0d, 10.0d);
+
+            builder.pop();
+        }
+
+        spec = builder.build();
+    }
+}

+ 25 - 0
src/main/resources/META-INF/mods.toml

@@ -0,0 +1,25 @@
+modLoader="javafml"
+loaderVersion="[25,)"
+issueTrackerURL="https://github.com/TheIllusiveC4/CustomFoV/issues"
+displayURL="https://minecraft.curseforge.com/projects/custom-fov"
+logoFile="customfov_icon.png"
+authors="C4"
+[[mods]]
+modId="customfov"
+version="${file.jarVersion}"
+displayName="Custom FoV"
+description='''
+Allows customization of various field of view settings.
+'''
+[[dependencies.comforts]]
+    modId="forge"
+    mandatory=true
+    versionRange="[25,)"
+    ordering="NONE"
+    side="BOTH"
+[[dependencies.comforts]]
+    modId="minecraft"
+    mandatory=true
+    versionRange="[1.13,1.14)"
+    ordering="NONE"
+    side="BOTH"

+ 2 - 2
src/main/resources/assets/customfov/lang/en_us.lang

@@ -1,8 +1,8 @@
 ###############
 #    Config   #
 ###############
-customfov.general.staticfov=Static FoV
-customfov.general.staticfov.tooltip=Set to true to disable all vanilla FoV modifiers
+gui.customfov.config.staticFoV=Static FoV
+gui.customfov.config.staticFoV.tooltip=Set to true to disable all vanilla FoV modifiers
 
 customfov.general.flying=Flying
 customfov.general.flying.tooltip=Configure flying FoV settings

BIN
src/main/resources/customfov_icon.png


+ 0 - 16
src/main/resources/mcmod.info

@@ -1,16 +0,0 @@
-[
-{
-  "modid": "customfov",
-  "name": "Custom FoV",
-  "description": "Allows customization of various field of view settings.",
-  "version": "${version}",
-  "mcversion": "${mcversion}",
-  "url": "",
-  "updateUrl": "",
-  "authorList": ["C4"],
-  "credits": "",
-  "logoFile": "",
-  "screenshots": [],
-  "dependencies": []
-}
-]

+ 2 - 3
src/main/resources/pack.mcmeta

@@ -1,7 +1,6 @@
 {
     "pack": {
-        "description": "CustomFoV resources",
-        "pack_format": 3,
-        "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)."
+        "description": "Custom FoV resources",
+        "pack_format": 4
     }
 }