viral32111 / events

Minecraft mod adding callbacks for commonly used mixins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Events

CI CodeQL GitHub tag (with filter) GitHub repository size GitHub release downloads GitHub commit activity

This is a Minecraft Fabric mod that adds callbacks using the Fabric event system for the mixins I frequently use.

This mod does not do much by itself, other than log example messages for each callback. It is designed as a dependency for my other mods.

The mixins in this mod are accurate as of release 1.20.1. Feel free to submit pull requests to keep them up-to-date if they break. See the Gradle properties file for the versions this mod was last built against.

๐Ÿ“œ Background

I found it frustrating constantly searching through mapped Minecraft source code for the right function to hook into every time I need to write a mixin. They are not documented enough in my opinion, so this project serves as a place for me to house all the mixins I come across while developing my mods.

๐Ÿ“… History

This project was originally a demonstration of how to use common mixins in Java around June 2022. See tag 0.1.0.

It was later rewritten using Kotlin for Fabric around May 2023. See 0.2.0.

Finally, it was converted into an API that other mods can depend on. See main.

๐Ÿ–ฅ๏ธ Callbacks

Documentation for each callback is written within the source code as comments.

๐Ÿ“ฅ Usage

Requires Fabric API Requires Fabric Language Kotlin

Firstly, add this repository's Gradle package registry to your Gradle configuration.

Gradle Groovy:

repositories {
  maven {
    url = uri( "https://maven.pkg.github.com/viral32111/events" )
    credentials {
      username = project.findProperty( "gpr.user" ) ?: System.getenv( "USERNAME" )
      password = project.findProperty( "gpr.key" ) ?: System.getenv( "TOKEN" )
    }
  }
}

Kotlin DSL:

repositories {
  maven {
    url = uri( "https://maven.pkg.github.com/viral32111/events" )
    credentials {
      username = project.findProperty( "gpr.user" ) as String? ?: System.getenv( "USERNAME" )
      password = project.findProperty( "gpr.key" ) as String? ?: System.getenv( "TOKEN" )
    }
  }
}

Next, add this mod as a dependency in your Gradle configuration.

Gradle Groovy:

dependencies {
  implementation "com.viral32111.events:0.3.5"
}

Kotlin DSL:

dependencies {
  implementation( "com.viral32111.events", "events", "0.3.5" )
}

Finally, import this mod's package in your source code.

Java:

import com.viral32111.events.callback.*;
import com.viral32111.events.callback.server.*;
import com.viral32111.events.callback.client.*;

Kotlin:

import com.viral32111.events.callback.*
import com.viral32111.events.callback.server.*
import com.viral32111.events.callback.client.*

โš–๏ธ License

Copyright (C) 2022-2023 viral32111.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses.

About

Minecraft mod adding callbacks for commonly used mixins.

License:GNU Affero General Public License v3.0


Languages

Language:Kotlin 76.0%Language:Java 24.0%