Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,36 @@ on:
branches: [ "master", "main" ]
workflow_dispatch:

env:
PUBLIC_RELEASE_BUILD: true
PUBLIC_RELEASE_BUILD_TOKEN: ${{ secrets.PUBLIC_RELEASE_BUILD_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
java-version: '21'
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Cache Gradle wrapper
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
gradle-wrapper-${{ runner.os }}-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --full-stacktrace
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/*-release.jar
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ docs/generated/

# Project
run/
.assetsroot

# LabyGradle | Addon Plugin
build-data.txt
Expand Down
24 changes: 4 additions & 20 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
version = "0.1.0"

plugins {
id("java-library")
}
import net.labymod.labygradle.common.extension.LabyModAnnotationProcessorExtension.ReferenceType

dependencies {
labyProcessor()
labyApi("api")

// If you want to use external libraries, you can do that here.
// The dependencies that are specified here are loaded into your project but will also
// automatically be downloaded by labymod, but only if the repository is public.
// If it is private, you have to add and compile the dependency manually.
// You have to specify the repository, there are getters for maven central and sonatype, every
// other repository has to be specified with their url. Example:
// maven(mavenCentral(), "org.apache.httpcomponents:httpclient:4.5.13")
}

labyModProcessor {
referenceType = net.labymod.gradle.core.processor.ReferenceType.INTERFACE
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
labyModAnnotationProcessor {
referenceType = ReferenceType.INTERFACE
}
88 changes: 18 additions & 70 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,92 +1,40 @@
plugins {
id("java-library")
id("net.labymod.gradle")
id("net.labymod.gradle.addon")
id("net.labymod.labygradle")
id("net.labymod.labygradle.addon")
}

group = "de.raik"
version = "1.0.0"
val versions = providers.gradleProperty("net.labymod.minecraft-versions").get().split(";")

java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
group = "de.raik"
version = providers.environmentVariable("VERSION").getOrElse("1.0.1")

labyMod {
defaultPackageName = "de.raik.tnttimer" //change this to your main package name (used by all modules)
defaultPackageName = "de.raik.tnttimer"

addonInfo {
namespace = "tnttimer"
displayName = "TNT Timer"
author = "Sk1er LLC (port by Raik)"
description = "Displays the time until a tnt explodes over the tnt."
description = "Displays the time until a tnt detonates above the block"
minecraftVersion = "*"
version = System.getenv().getOrDefault("VERSION", "0.0.1")
version = rootProject.version.toString()
}

minecraft {
registerVersions(
"1.8.9",
"1.12.2",
"1.16.5",
"1.17.1",
"1.18.2",
"1.19.2",
"1.19.3",
"1.19.4"
) { version, provider ->
configureRun(provider, version)
}

subprojects.forEach {
if (it.name != "game-runner") {
filter(it.name)
registerVersion(versions.toTypedArray()) {
runs {
getByName("client") {
devLogin = true
}
}
}
}

addonDev {
internalRelease()
}
}

subprojects {
plugins.apply("java-library")
plugins.apply("net.labymod.gradle")
plugins.apply("net.labymod.gradle.addon")

repositories {
maven("https://libraries.minecraft.net/")
maven("https://repo.spongepowered.org/repository/maven-public/")
}
}

fun configureRun(provider: net.labymod.gradle.core.minecraft.provider.VersionProvider, gameVersion: String) {
provider.runConfiguration {
mainClass = "net.minecraft.launchwrapper.Launch"
jvmArgs("-Dnet.labymod.running-version=${gameVersion}")
jvmArgs("-Dmixin.debug=true")
jvmArgs("-Dnet.labymod.debugging.all=true")
jvmArgs("-Dmixin.env.disableRefMap=true")
plugins.apply("net.labymod.labygradle")
plugins.apply("net.labymod.labygradle.addon")

args("--tweakClass", "net.labymod.core.loader.vanilla.launchwrapper.LabyModLaunchWrapperTweaker")
args("--labymod-dev-environment", "true")
args("--addon-dev-environment", "true")
}

provider.javaVersion = when (gameVersion) {
else -> {
JavaVersion.VERSION_17
}
}

provider.mixin {
val mixinMinVersion = when (gameVersion) {
"1.8.9", "1.12.2", "1.16.5" -> {
"0.6.6"
}

else -> {
"0.8.2"
}
}

minVersion = mixinMinVersion
}
group = rootProject.group
version = rootProject.version
}
25 changes: 6 additions & 19 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
version = "0.1.0"

plugins {
id("java-library")
}
import net.labymod.labygradle.common.extension.LabyModAnnotationProcessorExtension.ReferenceType

dependencies {
labyProcessor()
api(project(":api"))

// If you want to use external libraries, you can do that here.
// The dependencies that are specified here are loaded into your project but will also
// automatically be downloaded by labymod, but only if the repository is public.
// If it is private, you have to add and compile the dependency manually.
// You have to specify the repository, there are getters for maven central and sonatype, every
// other repository has to be specified with their url. Example:
// maven(mavenCentral(), "org.apache.httpcomponents:httpclient:4.5.13")
}

labyModProcessor {
referenceType = net.labymod.gradle.core.processor.ReferenceType.DEFAULT
// An example of how to add an external dependency that is used by the addon.
// addonMavenDependency("org.jeasy:easy-random:5.0.0")
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
labyModAnnotationProcessor {
referenceType = ReferenceType.DEFAULT
}
115 changes: 0 additions & 115 deletions core/src/main/java/de/raik/tnttimer/core/TNTTimeTag.java

This file was deleted.

21 changes: 0 additions & 21 deletions core/src/main/java/de/raik/tnttimer/core/TNTTimerAddon.java

This file was deleted.

28 changes: 28 additions & 0 deletions core/src/main/java/de/raik/tnttimer/core/TntTimerAddon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package de.raik.tnttimer.core;

import de.raik.tnttimer.core.tag.DetonationTimeTag;
import net.labymod.api.addon.LabyAddon;
import net.labymod.api.client.entity.player.tag.PositionType;
import net.labymod.api.models.addon.annotation.AddonMain;

@AddonMain
public class TntTimerAddon extends LabyAddon<TntTimerConfig> {

public static final String PERMISSION = "tnttimer";

@Override
protected void enable() {
this.registerSettingCategory();
this.labyAPI().permissionRegistry().register(PERMISSION, true);
this.labyAPI().tagRegistry().register(
"detonation_time",
PositionType.ABOVE_NAME,
new DetonationTimeTag()
);
}

@Override
protected Class<TntTimerConfig> configurationClass() {
return TntTimerConfig.class;
}
}
Loading