Compare commits
59 Commits
dev/1.21.1
...
1.20.4-ecb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecb74fc530 | ||
|
|
6339b2adc1 | ||
|
|
b66b10a975 | ||
|
|
88b6ffe408 | ||
|
|
9f4fbce072 | ||
|
|
0c98279ef1 | ||
|
|
cc593b53e2 | ||
|
|
3b838086e9 | ||
|
|
9f0574db9f | ||
|
|
705170d111 | ||
|
|
5fdb14947b | ||
|
|
d66ce6fb87 | ||
|
|
b81eb1857c | ||
|
|
cc0312cd76 | ||
|
|
3313ff7c61 | ||
|
|
06a87833f3 | ||
|
|
6d39abe168 | ||
|
|
9243eea30b | ||
|
|
1334c291e5 | ||
|
|
bd1178911d | ||
|
|
41a500a5ad | ||
|
|
a1ba257238 | ||
|
|
a40d934630 | ||
|
|
79b6b41b63 | ||
|
|
52ab368069 | ||
|
|
0bfac95070 | ||
|
|
c69ed4279e | ||
|
|
127aa3728a | ||
|
|
1e7b4394ac | ||
|
|
f129a1e860 | ||
|
|
922a85f662 | ||
|
|
d13bfadde4 | ||
|
|
88aab8eadc | ||
|
|
8914d3fcbc | ||
|
|
d2f2ea4382 | ||
|
|
a6888b27d0 | ||
|
|
efabe850e0 | ||
|
|
6c6786792f | ||
|
|
dddb28fdf6 | ||
|
|
8546ac56e2 | ||
|
|
2c09274132 | ||
|
|
a9238f8e8e | ||
|
|
7522e3c67b | ||
|
|
71a7127bb1 | ||
|
|
75266cceed | ||
|
|
8a292a655a | ||
|
|
a0779956f1 | ||
|
|
1de9ca9d5f | ||
|
|
bc842c855a | ||
|
|
120ddafc2f | ||
|
|
3b1a8cc929 | ||
|
|
2914a219e2 | ||
|
|
07bbbd3d7e | ||
|
|
e69cf4c9ec | ||
|
|
6b679bc02e | ||
|
|
124a240fe9 | ||
|
|
e8b9aaee48 | ||
|
|
eb3502eb86 | ||
|
|
bdd41593e0 |
@@ -37,7 +37,7 @@ jobs:
|
||||
- name: Build project to paperclip jar
|
||||
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
|
||||
with:
|
||||
arguments: createReobfPaperclipJar
|
||||
arguments: createReobfBundlerJar createReobfPaperclipJar
|
||||
- name: Capture build artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
64
.github/workflows/build_1_20_4_v2.yml
vendored
Normal file
64
.github/workflows/build_1_20_4_v2.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
name: Luminol CI v2 - Ver/1.20.4
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/1.20.4" ]
|
||||
pull_request:
|
||||
branches: [ "ver/1.20.4" ]
|
||||
# workflow_dispatch:
|
||||
permissions: write-all
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
environment: default
|
||||
|
||||
steps:
|
||||
- name: Checkout Git Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
- name: Setup Git Config
|
||||
run: |
|
||||
git config --global user.email "ci@luminolmc.com"
|
||||
git config --global user.name "Luminol CI"
|
||||
- name: Apply Patches
|
||||
run: ./gradlew applyPatches
|
||||
- name: Build
|
||||
run: ./gradlew createReobfBundlerJar createReobfPaperclipJar
|
||||
- uses: "actions/upload-artifact@v3"
|
||||
with:
|
||||
name: "Luminol CI Artifacts"
|
||||
path: "build/libs/*.jar"
|
||||
- name: Rename jar file
|
||||
run: |
|
||||
mv build/libs/luminol-bundler-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-bundler.jar
|
||||
mv build/libs/luminol-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-paperclip.jar
|
||||
- name: setenv
|
||||
run: |
|
||||
sh scripts/SetENV.sh
|
||||
echo "${{ env.tag }}"
|
||||
- name: Create Release
|
||||
if: "!contains(github.event.commits[0].message, '[release-skip]')"
|
||||
uses: ncipollo/release-action@v1.12.0
|
||||
with:
|
||||
tag: ${{ env.tag }}
|
||||
name: Luminol ${{ env.mcversion }} - ${{ env.commitid }}
|
||||
body: |
|
||||
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commitid }} [](https://github.com/LeavesMC/LuminolMC/Luminol/download/${{ env.tag }}/luminol-1.20.4-paperclip.jar)
|
||||
This release is automatically compiled by GitHub Actions
|
||||
artifacts: |
|
||||
build/libs/luminol-1.20.4-bundler.jar
|
||||
build/libs/luminol-1.20.4-paperclip.jar
|
||||
generateReleaseNotes: true
|
||||
prerelease: ${{ env.pre }}
|
||||
makeLatest: ${{ env.make_latest }}
|
||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
- name: Push to Api
|
||||
if: "!contains(github.event.commits[0].message, '[release-skip]')"
|
||||
env:
|
||||
secret_v2: ${{ secrets.API_KEY }}
|
||||
tag: ${{ env.tag }}
|
||||
run: sh scripts/PushToAPI.sh
|
||||
@@ -74,3 +74,4 @@ QQ群: [368632360](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=MfosKhcDd8Fdxn1MREu
|
||||
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
|
||||
@@ -7,3 +7,7 @@ org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
org.gradle.vfs.watch = false
|
||||
org.gradle.jvmargs = -Xmx3G
|
||||
|
||||
mcVersion=1.20.4
|
||||
GroupMCV=1.20
|
||||
preVersion=false
|
||||
@@ -93,10 +93,10 @@ index 0000000000000000000000000000000000000000..dcfbabf54b19a4c29d5c95830242c5c2
|
||||
+}
|
||||
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e40989889f3821bb7484fc0bae5d94b033013904
|
||||
index 0000000000000000000000000000000000000000..dc5a5f42c9ca7a50295c18424722568a3ad33fa5
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
|
||||
@@ -0,0 +1,316 @@
|
||||
@@ -0,0 +1,324 @@
|
||||
+package dev.kaiijumc.kaiiju.region;
|
||||
+
|
||||
+import com.github.luben.zstd.ZstdInputStream;
|
||||
@@ -225,7 +225,7 @@ index 0000000000000000000000000000000000000000..e40989889f3821bb7484fc0bae5d94b0
|
||||
+ }
|
||||
+
|
||||
+ public void flush() throws IOException {
|
||||
+ if (isMarkedToSave()) flushWrapper(); // sync
|
||||
+ if (getAndResetSaveMarker()) flushWrapper(); // sync
|
||||
+ }
|
||||
+
|
||||
+ private void markToSave() {
|
||||
@@ -233,10 +233,18 @@ index 0000000000000000000000000000000000000000..e40989889f3821bb7484fc0bae5d94b0
|
||||
+ markedToSave.set(true);
|
||||
+ }
|
||||
+
|
||||
+ public boolean isMarkedToSave() {
|
||||
+ public boolean getAndResetSaveMarker() {
|
||||
+ return markedToSave.getAndSet(false);
|
||||
+ }
|
||||
+
|
||||
+ public boolean isMarkedToSave(){
|
||||
+ return this.markedToSave.get();
|
||||
+ }
|
||||
+
|
||||
+ public void resetSaveMarker(){
|
||||
+ this.markedToSave.set(false);
|
||||
+ }
|
||||
+
|
||||
+ public void flushWrapper() {
|
||||
+ try {
|
||||
+ save();
|
||||
@@ -415,24 +423,21 @@ index 0000000000000000000000000000000000000000..e40989889f3821bb7484fc0bae5d94b0
|
||||
+}
|
||||
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFileFlusher.java b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFileFlusher.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f06d7767c79e465f999b2032086cc224de95152a
|
||||
index 0000000000000000000000000000000000000000..65435eb666b2e1cabffc145e016faa5e3b373464
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFileFlusher.java
|
||||
@@ -0,0 +1,44 @@
|
||||
@@ -0,0 +1,57 @@
|
||||
+package dev.kaiijumc.kaiiju.region;
|
||||
+
|
||||
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
+import java.util.Queue;
|
||||
+
|
||||
+import java.util.Set;
|
||||
+import java.util.concurrent.*;
|
||||
+import org.bukkit.Bukkit;
|
||||
+
|
||||
+public class LinearRegionFileFlusher {
|
||||
+ private final Queue<LinearRegionFile> savingQueue = new LinkedBlockingQueue<>();
|
||||
+ private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(
|
||||
+ new ThreadFactoryBuilder()
|
||||
+ .setNameFormat("linear-flush-scheduler")
|
||||
+ .build()
|
||||
+ );
|
||||
+ private final Set<LinearRegionFile> pendingSaving = ConcurrentHashMap.newKeySet();
|
||||
+
|
||||
+ private final ExecutorService executor = Executors.newFixedThreadPool(
|
||||
+ me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushThreads,
|
||||
+ new ThreadFactoryBuilder()
|
||||
@@ -440,27 +445,43 @@ index 0000000000000000000000000000000000000000..f06d7767c79e465f999b2032086cc224
|
||||
+ .build()
|
||||
+ );
|
||||
+
|
||||
+ private final Executor delayedFlusher = CompletableFuture.delayedExecutor(
|
||||
+ me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushFrequency,
|
||||
+ TimeUnit.SECONDS,
|
||||
+ executor
|
||||
+ );
|
||||
+
|
||||
+ public LinearRegionFileFlusher() {
|
||||
+ Bukkit.getLogger().info("Using " + me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushThreads + " threads for linear region flushing.");
|
||||
+ scheduler.scheduleAtFixedRate(this::pollAndFlush, 0L, me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushFrequency, TimeUnit.SECONDS);
|
||||
+ }
|
||||
+
|
||||
+ public void scheduleSave(LinearRegionFile regionFile) {
|
||||
+ if (savingQueue.contains(regionFile)) return;
|
||||
+ savingQueue.add(regionFile);
|
||||
+ }
|
||||
+
|
||||
+ private void pollAndFlush() {
|
||||
+ while (!savingQueue.isEmpty()) {
|
||||
+ LinearRegionFile regionFile = savingQueue.poll();
|
||||
+ if (!regionFile.closed && regionFile.isMarkedToSave())
|
||||
+ executor.execute(regionFile::flushWrapper);
|
||||
+ if (this.pendingSaving.contains(regionFile) || !regionFile.isMarkedToSave()){
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ this.pendingSaving.add(regionFile);
|
||||
+ this.delayedFlusher.execute(()->{
|
||||
+ try {
|
||||
+ if (!regionFile.closed && regionFile.isMarkedToSave()){
|
||||
+ regionFile.flushWrapper();
|
||||
+ }
|
||||
+ }finally {
|
||||
+ regionFile.resetSaveMarker();
|
||||
+ this.pendingSaving.remove(regionFile);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ public void shutdown() {
|
||||
+ executor.shutdown();
|
||||
+ scheduler.shutdown();
|
||||
+ this.executor.shutdown();
|
||||
+ for (;;) {
|
||||
+ try {
|
||||
+ if (this.executor.awaitTermination(5_00,TimeUnit.MILLISECONDS)) break;
|
||||
+ } catch (InterruptedException e) {
|
||||
+ e.printStackTrace();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/RegionFileFormat.java b/src/main/java/dev/kaiijumc/kaiiju/region/RegionFileFormat.java
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <novau233@163.com>
|
||||
Date: Sat, 6 Apr 2024 05:14:57 +0000
|
||||
Subject: [PATCH] Gale Reduce lambda and Optional allocation in
|
||||
Subject: [PATCH] Gale Reduce lambda and Optional allocation in
|
||||
EntityBasedExplosionDamageCalculator
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
sha256() {
|
||||
sha256sum $1 | awk '{print $1}'
|
||||
}
|
||||
|
||||
prop() {
|
||||
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
|
||||
}
|
||||
project_id="luminol"
|
||||
mcversion_group=$(prop GroupMCV)
|
||||
mcversion=$(prop mcVersion)
|
||||
pre=$(prop preVersion)
|
||||
if [ $pre = "true" ]; then
|
||||
channel="experimental"
|
||||
else
|
||||
channel="default"
|
||||
fi
|
||||
changes=$(git log -1 --pretty='[{"commit": "%H", "message": "%s", "summary": "%b"}]')
|
||||
jar_sha256=`sha256 build/libs/luminol-1.20.4-paperclip.jar`
|
||||
jar_name="luminol-1.20.4-paperclip.jar"
|
||||
ctime=$(date -u +"%s")"000"
|
||||
|
||||
# v2
|
||||
echo "Authentication: $secret_v2"
|
||||
echo "[DEBUG] curl --location -g --request POST "https://api.luminolmc.com/v2/projects/luminol/1.20.4/build/commit?jar_name=luminol-1.20.4-paperclip.jar&release_tag=$tag&changes="$changes"&sha256=$jar_sha256&time=$ctime&channel=$channel&version_group=$mcversion_group" -H "Authorization: $secret_v2""
|
||||
# shellcheck disable=SC2031
|
||||
curl --location -g --request POST "https://api.luminolmc.com/v2/projects/luminol/1.20.4/build/commit?jar_name=luminol-1.20.4-paperclip.jar&release_tag=$tag&changes=$changes&sha256=$jar_sha256&time=$ctime&channel=$channel&version_group=$mcversion_group" -H "Authorization: $secret_v2"
|
||||
|
||||
18
scripts/SetENV.sh
Normal file
18
scripts/SetENV.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
prop() {
|
||||
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
|
||||
}
|
||||
|
||||
commitid=$(git log --pretty='%h' -1)
|
||||
mcversion=$(prop mcVersion)
|
||||
preVersion=$(prop preVersion)
|
||||
release_tag="$mcversion-$commitid"
|
||||
jarName="build/libs/luminol-1.20.4-paperclip.jar"
|
||||
make_latest=$([ $preVersion = "true" ] && echo "false" || echo "true")
|
||||
|
||||
echo "commitid=$commitid" >> $GITHUB_ENV
|
||||
echo "mcversion=$mcversion" >> $GITHUB_ENV
|
||||
echo "$mcversion"
|
||||
echo "tag=$release_tag" >> $GITHUB_ENV
|
||||
echo "jar=$jarName" >> $GITHUB_ENV
|
||||
echo "pre=$preVersion" >> $GITHUB_ENV
|
||||
echo "make_latest=$make_latest" >> $GITHUB_ENV
|
||||
Reference in New Issue
Block a user