Skip to content

Commit

Permalink
Update to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
EnnuiL committed Jun 15, 2022
1 parent 18b3357 commit 6c0c9d1
Show file tree
Hide file tree
Showing 40 changed files with 1,089 additions and 1,017 deletions.
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true

[*.gradle]
indent_style = tab

[*.java]
indent_style = tab

[*.json]
indent_style = space
indent_size = 2

[quilt.mod.json]
indent_style = tab
tab_width = 2

[*.toml]
indent_style = tab
tab_width = 2

[*.properties]
indent_style = space
indent_size = 2

[.editorconfig]
indent_style = space
indent_size = 4
18 changes: 8 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
# gradle

# Gradle
.gradle/
build/
out/
classes/

# eclipse
# Quilt Loom
run/

# Eclipse
*.launch

# idea

# IntelliJ Idea
.idea/
*.iml
*.ipr
*.iws

# vscode

# Visual Studio Code
.settings/
.vscode/
bin/
.classpath
.project

# fabric

run/
# macOS
*.DS_Store
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
69 changes: 40 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
plugins {
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'io.github.juuxel.loom-quiltflower' version '1.6.1'
id "org.quiltmc.quilt-mappings-on-loom" version "4.0.0"
id 'maven-publish'
alias(libs.plugins.quilt.loom)
}

// Visual Studio Code completely ignores options.release.
// So, we still have those two.
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = System.env.GITHUB_ACTIONS == "true"
? "${project.mod_version}.github.${System.env.GITHUB_RUN_NUMBER}"
: project.mod_version
? "${project.version}.github.${System.env.GITHUB_RUN_NUMBER}"
: project.version
group = project.maven_group

sourceSets {
Expand All @@ -23,50 +16,66 @@ sourceSets {
}
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}

// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
dependencies {
// To change the versions, see the gradle.properties file
minecraft libs.minecraft
mappings loom.layered {
addLayer quiltMappings.mappings("org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:v2")
// officialMojangMappings() // Uncomment if you want to use Mojang mappings as your primary mappings, falling back on QM for parameters and Javadocs
}
modImplementation libs.fabric.loader
modImplementation libs.quilt.loader

modLocalRuntime libs.fabric.api
// QSL is not a complete API; You will need Quilted Fabric API to fill in the gaps.
// Quilted Fabric API will automatically pull in the correct QSL version.
modImplementation libs.quilted.fabric.api
// modImplementation libs.bundles.quilted.fabric.api // If you wish to use Fabric API's deprecated modules, you can replace the above line with this one

afterEvaluate {
testmodImplementation sourceSets.main.output
}
}

processResources {
inputs.property "version", project.version
inputs.property "version", version

filesMatching("fabric.mod.json") {
expand "version": project.version
filesMatching('quilt.mod.json') {
expand "version": version
}
}

tasks.withType(JavaCompile).configureEach {
// Ensure that the encoding is set to UTF-8, no matter what the system default is.
// This fixes some edge cases with special characters not displaying correctly.
// See http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// Still required by IDEs such as Eclipse and Visual Studio Code
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present.
// If you remove this line, sources will not be generated.
withJavadocJar()
withSourcesJar()

// If this mod is going to be a library, then it should also generate Javadocs in order to aid with developement.
// Uncomment this line to generate them.
withJavadocJar()
}

jar {
from "LICENSE"
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
}

// Configure the maven publication
Expand Down Expand Up @@ -100,9 +109,11 @@ publishing {
}
}

// Select the repositories you want to publish to
// To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`.
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
9 changes: 6 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Done to increase the memory available to gradle.
# Gradle Properties
org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true

# Mod Properties
mod_version = 0.4.2+1.18.2
version = 0.5.0+1.19
maven_group = io.github.ennuil
archives_base_name = libzoomer
archives_base_name = libzoomer

# Dependencies are managed at gradle/libs.versions.toml
23 changes: 16 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
[versions]
minecraft = "1.18.2"
quilt-mappings = "1.18.2+build.21" # Latest version is available at https://lambdaurora.dev/tools/import_quilt.html
fabric-loader = "0.13.3" # Latest version is available at https://fabricmc.net/versions.html
# The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html
minecraft = "1.19"
quilt_mappings = "1.19+build.1"
quilt_loader = "0.17.0"

fabric-api = "0.48.0+1.18.2"
quilted_fabric_api = "2.0.0-alpha.3+0.55.3-1.19"

[libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
quilt-mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt-mappings" }
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-loader" }
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }

fabric-api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric-api" }
quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" }
quilted_fabric_api_deprecated = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api-deprecated", version.ref = "quilted_fabric_api" }

# If you have multiple similar dependencies, you can declare a dependency bundle and reference it on the build script with "libs.bundles.example".
[bundles]
quilted_fabric_api = ["quilted_fabric_api", "quilted_fabric_api_deprecated"]

[plugins]
quilt_loom = { id = "org.quiltmc.loom", version = "0.12.+" }
4 changes: 2 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
before_install:
- export SDKMAN_DIR="/home/jitpack/sdkman" && curl -s "https://get.sdkman.io" | bash
- source "/home/jitpack/sdkman/bin/sdkman-init.sh"
- sdk install java 17.0.1-tem
- sdk use java 17.0.1-tem
- sdk install java 17.0.3-tem
- sdk use java 17.0.3-tem
27 changes: 12 additions & 15 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
pluginManagement {
repositories {
maven {
name = 'Quilt'
url = 'https://maven.quiltmc.org/repository/release'
}
maven {
name = 'Cotton'
url = 'https://server.bbkr.space/artifactory/libs-release/'
}
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
repositories {
maven {
name = 'Quilt'
url = 'https://maven.quiltmc.org/repository/release'
}
// Currently needed for Intermediary and other temporary dependencies
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}
70 changes: 35 additions & 35 deletions src/main/java/io/github/ennuil/libzoomer/api/MouseModifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,43 @@
* The mouse modifier is the sub-instance that handles any change of behavior of the mouse.
*/
public interface MouseModifier {
/**
* Gets the identifier of the mouse modifier.
* @return The mouse modifier's identifier.
*/
Identifier getIdentifier();
/**
* Gets the identifier of the mouse modifier.
* @return The mouse modifier's identifier.
*/
Identifier getIdentifier();

/**
* Gets the active state of the mouse modifier.
* @return The mouse modifier's active state.
*/
boolean getActive();
/**
* Gets the active state of the mouse modifier.
* @return The mouse modifier's active state.
*/
boolean getActive();

/**
* Modifies the cursor's X delta to the value returned on this method.
* @param cursorSensitivity The cursor sensitivity that is applied to the cursor delta.
* @param cursorDeltaX The X delta after the calculations.
* @param mouseUpdateTimeDelta The delta of the mouse update time.
* @param targetDivisor The current zoom divisor.
* @param transitionMultiplier The transition mode's internal multiplier.
* @return The X delta that will replace the cursor's X delta.
*/
double applyXModifier(double cursorDeltaX, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier);
/**
* Modifies the cursor's X delta to the value returned on this method.
* @param cursorSensitivity The cursor sensitivity that is applied to the cursor delta.
* @param cursorDeltaX The X delta after the calculations.
* @param mouseUpdateTimeDelta The delta of the mouse update time.
* @param targetDivisor The current zoom divisor.
* @param transitionMultiplier The transition mode's internal multiplier.
* @return The X delta that will replace the cursor's X delta.
*/
double applyXModifier(double cursorDeltaX, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier);

/**
* Modifies the cursor's Y delta to the value returned on this method.
* @param cursorSensitivity The cursor sensitivity that is applied to the cursor delta.
* @param cursorDeltaY The Y delta after the calculations.
* @param mouseUpdateTimeDelta The delta of the mouse update time.
* @param targetDivisor The current zoom divisor.
* @param transitionMultiplier The transition mode's internal multiplier.
* @return The Y delta that will replace the cursor's Y delta.
*/
double applyYModifier(double cursorDeltaY, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier);
/**
* Modifies the cursor's Y delta to the value returned on this method.
* @param cursorSensitivity The cursor sensitivity that is applied to the cursor delta.
* @param cursorDeltaY The Y delta after the calculations.
* @param mouseUpdateTimeDelta The delta of the mouse update time.
* @param targetDivisor The current zoom divisor.
* @param transitionMultiplier The transition mode's internal multiplier.
* @return The Y delta that will replace the cursor's Y delta.
*/
double applyYModifier(double cursorDeltaY, double cursorSensitivity, double mouseUpdateTimeDelta, double targetDivisor, double transitionMultiplier);

/**
* The tick method. Used in order to keep the internal variables accurate.
* @param active The zoom state.
*/
void tick(boolean active);
/**
* The tick method. Used in order to keep the internal variables accurate.
* @param active The zoom state.
*/
void tick(boolean active);
}
Loading

0 comments on commit 6c0c9d1

Please sign in to comment.