Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9b961b4
Add a gradle wrapper
HydrolienF Oct 2, 2025
adb1492
Paper, Java 21, Folia supported, real lights server side that melt snow.
HydrolienF Oct 2, 2025
6cd9d7c
Merge pull request #1 from HydrolienF/folia
HydrolienF Oct 2, 2025
e798f64
Switch to paper only & start to update to 1.21.11
HydrolienF Dec 27, 2025
bbd96c3
Use co.aikar:acf-paper & Reenable light toggle & Remove light-culling…
HydrolienF Dec 28, 2025
e67ff88
start removing dependencies
HydrolienF Dec 28, 2025
aa06bf6
Tests other possible location for the player light to avoid bug in do…
Eugene-74 Dec 28, 2025
deaeac4
corecting a bug with getClosestAcceptableBlock
Eugene-74 Dec 28, 2025
9753c36
Remove the dependency
HydrolienF Dec 28, 2025
afdae63
Save default config stuff & enable the plugin.
HydrolienF Dec 28, 2025
05edb82
disable debug log
HydrolienF Dec 28, 2025
0e76acd
Merge branch 'removingDependencies'
HydrolienF Dec 28, 2025
7016af4
Add LIGHT back in acceptableBlock
HydrolienF Dec 28, 2025
83399af
correction to avoir breaking block
Eugene-74 Dec 28, 2025
d82f818
working light (but not under water)
Eugene-74 Dec 28, 2025
640a0c1
also working under water
Eugene-74 Dec 28, 2025
435a5b3
using submersible variable removing unused function valid()
Eugene-74 Dec 28, 2025
d449f50
add jack o lantern
Eugene-74 Dec 28, 2025
e6ea23a
new version
Eugene-74 Dec 28, 2025
5c05a9f
Add a 2 tick delay to avoid light being removed before the new one is…
HydrolienF Jan 2, 2026
736e876
Fix light location being compare between block & player eye wich was …
HydrolienF Feb 13, 2026
10950dc
Folia fix: run find best block logic in region thread.
HydrolienF Feb 14, 2026
5ec182c
Fix player dying exception
HydrolienF Feb 14, 2026
be63026
COPPER_TORCH
HydrolienF Feb 18, 2026
012c38f
More lockables
HydrolienF Feb 18, 2026
ab3134e
Fix light being removed from the new location instead of the old loca…
HydrolienF Feb 18, 2026
1744d03
Remove unneeded getRegionScheduler().run inside a getRegionScheduler(…
HydrolienF Feb 18, 2026
77df0eb
Bigger number for update-rate sicne it's ms and not tick now.
HydrolienF Feb 18, 2026
4e12cdf
Fix light removing
HydrolienF Feb 18, 2026
4b94fd4
Fix not using the same location for region scheduler & inside the reg…
HydrolienF Feb 19, 2026
034b51b
translations
ewof Mar 2, 2026
85deb17
Remove light-culling-distance from config that is not being used anym…
HydrolienF Mar 2, 2026
48035c5
Update plugin, french translation, only save each language translatio…
HydrolienF Mar 2, 2026
d9de2a2
dynamiclights.lock default: true
HydrolienF Mar 3, 2026
0c7bf1e
Improve perf & save toggle/lock on player PDC.
HydrolienF Mar 3, 2026
128dce8
Add an option to disable the light lock message. Done #3
HydrolienF Mar 3, 2026
f30876b
Action to publish to github
HydrolienF Mar 3, 2026
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
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build and Publish Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
# build
- name: Build with Gradle Wrapper
run: ./gradlew assemble
env:
MVNDI_MVN_USER: ${{ secrets.MVNDI_MVN_USER }}
MVNDI_MVN_KEY: ${{ secrets.MVNDI_MVN_KEY }}
- name: Publish to Remote
run: ./gradlew publish
env:
MVNDI_MVN_USER: ${{ secrets.MVNDI_MVN_USER }}
MVNDI_MVN_KEY: ${{ secrets.MVNDI_MVN_KEY }}

- name: Get version & release name
id: version
run: |
echo "version=$(./gradlew -q echoVersion)" >> $GITHUB_OUTPUT
echo "releaseName=$(./gradlew -q echoReleaseName)" >> $GITHUB_OUTPUT

- name: Print version & release name
run: |
echo "Version: ${{ steps.version.outputs.version }}"
echo "Release Name: ${{ steps.version.outputs.releaseName }}"


- name: Create an empty CHANGELOG.md if missing
run: |
if [ ! -f CHANGELOG.md ]; then
touch CHANGELOG.md
fi

- name: Read the first lines of CHANGELOG.md from gradle
id: changelog
run: |
{
echo "changelog<<EOF"
./gradlew -q echoLatestVersionChangelog
echo "EOF"
} >> $GITHUB_OUTPUT


- name: Create Release
id: createRelease
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
updateOnlyUnreleased: true
artifacts: build/libs/${{ github.event.repository.name }}-${{ steps.version.outputs.version }}.jar
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.releaseName }}
body: ${{ steps.changelog.outputs.changelog }}
# prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }} #Always release for now
skipIfReleaseExists: true

# - name: Publish to hangar & modrinth
# env:
# # Make sure you have added the repository secrets in the repository's settings
# HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
# MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
# run: ./gradlew assemble publishPluginPublicationToHangar modrinth
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,6 @@ FodyWeavers.xsd
# Additional files built by Visual Studio

# End of https://www.toptal.com/developers/gitignore/api/visualstudio,visualstudiocode,java,gradle,kotlin


run*/
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 1.6.0
Improve performances.
Save user settings on the Minecraft world.
Add an option to disable the light lock message.

# 1.5.0
Fix translation & add French translation.

# 1.4.7
Fix not using the same location for region scheduler & inside the region scheduler as player eye location.

# 1.4.6
Fix light removing

# 1.4.5
Fix light being removed from the new location instead of the old location.

# 1.4.4
Fix player dying exception

# 1.4.3
Folia fix: run find best block logic in region thread.

# 1.4.2
Fix light location being compare between block & player eye wich was never the same making the light flicker.

# 1.3.4
Update to 1.21.11 by using co.aikar:acf-paper instead of the custom NMS commands code from github.xCykrix:spigotdevkit.
Reenable light toggle.
Remove light-culling-distance config option as we now use real light that can be seen from any distance.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DynamicLights

Emit Light from Held Items using the 1.17 Light Blocks in Spigot/Paper Servers.
Emit Light from Held Items using the 1.17 Light Blocks in Paper Servers.

Discord: https://discord.gg/RHJQFPgbke

Expand Down
141 changes: 128 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,78 @@ plugins {
id("io.github.goooler.shadow") version "8.1.8"
id("java")
id("java-library")
id("xyz.jpenilla.run-paper") version "2.3.1"
}

group = "github.xCykrix"
version = "1.3.0-FOR-MC1.20"
version = "1.6.0"
description="Dynamic Lights for Minecraft Servers without requiring Modding."
val mainMinecraftVersion = "1.21.11"
val supportedMinecraftVersions = "1.21.11 - 1.21.11"

repositories {
mavenLocal()
mavenCentral()

// Spigot Repository
maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
// Paper
maven("https://repo.papermc.io/repository/maven-public/")

// Upstream GitHub Packages
maven {
url = uri("https://maven.pkg.github.com/xCykrix/SpigotDevkit")
credentials {
username = project.findProperty("GITHUB_ACTOR").toString() ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("GITHUB_TOKEN").toString() ?: System.getenv("GITHUB_TOKEN")
username = "" //project.findProperty("GITHUB_ACTOR").toString() ?: System.getenv("GITHUB_ACTOR")
password = "" //project.findProperty("GITHUB_TOKEN").toString() ?: System.getenv("GITHUB_TOKEN")
}
}
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.21.6-R0.1-SNAPSHOT")
implementation("github.xCykrix:spigotdevkit:1.1.0-CAPI1.20") {
isTransitive = false
}
compileOnly("io.papermc.paper:paper-api:$mainMinecraftVersion-R0.1-SNAPSHOT")
// implementation("github.xCykrix:spigotdevkit:1.1.2") {
// isTransitive = false
// }
implementation("co.aikar:acf-paper:0.5.1-SNAPSHOT")
}

// Shadow Task
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier = null;
}

// Target Java Build (Java 16 - Minecraft 1.17.x)
val targetJavaVersion = 16
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
}

tasks {
assemble {
dependsOn(shadowJar)
}
processResources {
val props = mapOf(
"name" to project.name,
"version" to project.version,
"description" to project.description,
"apiVersion" to "1.21.11",
"group" to project.group
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
runServer {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion(mainMinecraftVersion)
}
runPaper.folia.registerTask()
}

val targetJavaVersion = 21
java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
Expand All @@ -49,3 +84,83 @@ java {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}

tasks.register("echoVersion") {
group = "documentation"
description = "Displays the version."
doLast {
println("${project.version}")
}
}

tasks.register("echoReleaseName") {
group = "documentation"
description = "Displays the release name."
doLast {
println("${project.version} [${supportedMinecraftVersions}]")
}
}

val extractChangelog = tasks.register("extractChangelog") {
group = "documentation"
description = "Extracts the changelog for the current project version from CHANGELOG.md, including the version header."

val changelog: Property<String> = project.objects.property(String::class)
outputs.upToDateWhen { false }

doLast {
val version = project.version.toString()
val changelogFile = project.file("CHANGELOG.md")

if (!changelogFile.exists()) {
println("CHANGELOG.md not found.")
changelog.set("No changelog found.")
return@doLast
}

val lines = changelogFile.readLines()
val entries = mutableListOf<String>()
var foundVersion = false

for (line in lines) {
when {
// Include the version line itself
line.trim().equals("# $version", ignoreCase = true) -> {
foundVersion = true
entries.add(line)
}
// Stop collecting at the next version header
foundVersion && line.trim().startsWith("# ") -> break
// Collect lines after the version header
foundVersion -> entries.add(line)
}
}

val result = if (entries.isEmpty()) {
"Update to $version."
} else {
entries.joinToString("\n").trim()
}

// println("Changelog for version $version:\n$result")
changelog.set(result)
}

// Make changelog accessible from other tasks
extensions.add(Property::class.java, "changelog", changelog)
}

tasks.register("echoLatestVersionChangelog") {
group = "documentation"
description = "Displays the latest version change."

dependsOn(tasks.named("extractChangelog"))

doLast {
println((extractChangelog.get().extensions.findByType(Property::class.java) as Property<String>).get())
}
}


val versionString: String = version as String
val isRelease: Boolean = !versionString.contains("SNAPSHOT")
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading