Skip to content

Commit a13e8d9

Browse files
committed
Merge remote-tracking branch 'origin/1.18' into 1.19.2
2 parents 7743664 + 5136889 commit a13e8d9

File tree

7 files changed

+114
-74
lines changed

7 files changed

+114
-74
lines changed

build.gradle

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id "maven-publish"
55
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
66
id 'com.palantir.git-version' version '1.0.0'
7+
id 'org.ajoberstar.grgit' version '5.2.0'
78
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.79.0'
89
id "com.modrinth.minotaur" version "2.+" apply false
910
id("com.diffplug.spotless") version "6.18.0" apply false
@@ -35,7 +36,7 @@ allprojects {
3536
plusIndex = details.lastTag.length()
3637
}
3738
def baseVersion = details.lastTag.substring(0, plusIndex)
38-
def dirtyMarker = details.isCleanTag ? "" : ".dirty"
39+
def dirtyMarker = grgit.status().clean ? "" : ".dirty"
3940
def commitHashMarker = details.commitDistance > 0 ? ("." + details.gitHash) : ""
4041
def preMarker = (details.commitDistance > 0 || !details.isCleanTag) ? ("-beta." + details.commitDistance) : ""
4142
def versionString = "${baseVersion}${preMarker}+mc${minecraft_version}${commitHashMarker}${dirtyMarker}"
@@ -176,3 +177,43 @@ tasks.register('checkCleanTag') {
176177
}
177178
}
178179
}
180+
181+
configure(subprojects.findAll {it.name == "forge" || it.name == "fabric"}) {
182+
apply plugin: 'com.matthewprenger.cursegradle'
183+
apply plugin: 'com.modrinth.minotaur'
184+
185+
def isBeta = project.version.toString().contains("beta")
186+
187+
curseforge {
188+
if (System.getenv("CURSEFORGE_TOKEN") != null) {
189+
apiKey = System.getenv("CURSEFORGE_TOKEN")
190+
project {
191+
id = "790626"
192+
changelog = file('../CHANGELOG.md')
193+
changelogType = "markdown"
194+
releaseType = isBeta ? "beta" : "release"
195+
addGameVersion project.name.capitalize()
196+
gameVersionStrings.addAll(supported_minecraft_versions.tokenize(","))
197+
mainArtifact remapJar
198+
}
199+
}
200+
}
201+
202+
modrinth {
203+
token = System.getenv("MODRINTH_TOKEN")
204+
projectId = "modernfix" // This can be the project ID or the slug. Either will work!
205+
versionType = isBeta ? "beta" : "release" // This is the default -- can also be `beta` or `alpha`
206+
uploadFile = remapJar
207+
gameVersions = supported_minecraft_versions.tokenize(",")
208+
loaders = [project.name]
209+
changelog.set(provider { file("CHANGELOG.md").getText('UTF-8') })
210+
}
211+
212+
tasks.curseforge.dependsOn(rootProject.generateChangelog)
213+
tasks.modrinth.dependsOn(rootProject.generateChangelog)
214+
215+
tasks.register('publishToModSites') {
216+
publishToModSites.dependsOn(tasks.modrinth)
217+
publishToModSites.dependsOn(tasks.curseforge)
218+
}
219+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package org.embeddedt.modernfix.tickables;
2+
3+
import org.jetbrains.annotations.Nullable;
4+
5+
import java.util.function.Consumer;
6+
import java.util.function.Supplier;
7+
8+
public class LoadableTickableObject<T> implements TickableObject {
9+
private volatile int ticksInactive = 0;
10+
private final int timeout;
11+
private final Supplier<T> loader;
12+
private final Consumer<T> finalizer;
13+
private volatile T theObject = null;
14+
15+
public LoadableTickableObject(int timeout, Supplier<T> loader, Consumer<T> finalizer) {
16+
this(timeout, loader, finalizer, null);
17+
}
18+
19+
public LoadableTickableObject(int timeout, Supplier<T> loader, Consumer<T> finalizer, @Nullable T initialValue) {
20+
this.timeout = timeout;
21+
this.loader = loader;
22+
this.finalizer = finalizer;
23+
this.theObject = initialValue;
24+
}
25+
26+
public T get() {
27+
synchronized (this) {
28+
ticksInactive++;
29+
T obj = theObject;
30+
if(obj == null) {
31+
obj = loader.get();
32+
theObject = obj;
33+
}
34+
return obj;
35+
}
36+
}
37+
38+
public final void tick() {
39+
synchronized (this) {
40+
ticksInactive++;
41+
if(ticksInactive >= this.timeout) {
42+
finalizer.accept(theObject);
43+
theObject = null;
44+
}
45+
}
46+
}
47+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.embeddedt.modernfix.tickables;
2+
3+
public interface TickableObject {
4+
void tick();
5+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.embeddedt.modernfix.tickables;
2+
3+
import java.util.List;
4+
import java.util.concurrent.CopyOnWriteArrayList;
5+
6+
public class TickableObjectManager {
7+
private static final List<TickableObject> TICKABLE_OBJECT_LIST = new CopyOnWriteArrayList<>();
8+
9+
public static void register(TickableObject object) {
10+
TICKABLE_OBJECT_LIST.add(object);
11+
}
12+
13+
public static void runTick() {
14+
for(TickableObject o : TICKABLE_OBJECT_LIST) {
15+
o.tick();
16+
}
17+
}
18+
}

fabric/build.gradle

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ plugins {
22
id "com.github.johnrengelman.shadow" version "7.1.2"
33
}
44

5-
apply plugin: 'com.matthewprenger.cursegradle'
6-
apply plugin: 'com.modrinth.minotaur'
7-
85
architectury {
96
platformSetupLoomIde()
107
fabric()
@@ -96,37 +93,4 @@ publishing {
9693
repositories {
9794
// Add repositories to publish to here.
9895
}
99-
}
100-
101-
curseforge {
102-
if (System.getenv("CURSEFORGE_TOKEN") != null) {
103-
apiKey = System.getenv("CURSEFORGE_TOKEN")
104-
project {
105-
id = "790626"
106-
changelog = file('../CHANGELOG.md')
107-
changelogType = "markdown"
108-
releaseType = "beta"
109-
addGameVersion "Fabric"
110-
addGameVersion minecraft_version
111-
mainArtifact remapJar
112-
}
113-
}
114-
}
115-
116-
modrinth {
117-
token = System.getenv("MODRINTH_TOKEN")
118-
projectId = "modernfix" // This can be the project ID or the slug. Either will work!
119-
versionType = "beta" // This is the default -- can also be `beta` or `alpha`
120-
uploadFile = remapJar
121-
gameVersions = [minecraft_version]
122-
loaders = ["fabric"]
123-
changelog.set(provider { file("../CHANGELOG.md").getText('UTF-8') })
124-
}
125-
126-
tasks.curseforge.dependsOn(rootProject.generateChangelog)
127-
tasks.modrinth.dependsOn(rootProject.generateChangelog)
128-
129-
tasks.register('publishToModSites') {
130-
publishToModSites.dependsOn(tasks.modrinth)
131-
publishToModSites.dependsOn(tasks.curseforge)
13296
}

forge/build.gradle

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ plugins {
22
id "com.github.johnrengelman.shadow" version "7.1.2"
33
}
44

5-
apply plugin: 'com.matthewprenger.cursegradle'
6-
apply plugin: 'com.modrinth.minotaur'
7-
85
architectury {
96
platformSetupLoomIde()
107
forge()
@@ -114,37 +111,4 @@ publishing {
114111
repositories {
115112
// Add repositories to publish to here.
116113
}
117-
}
118-
119-
curseforge {
120-
if (System.getenv("CURSEFORGE_TOKEN") != null) {
121-
apiKey = System.getenv("CURSEFORGE_TOKEN")
122-
project {
123-
id = "790626"
124-
changelog = file('../CHANGELOG.md')
125-
changelogType = "markdown"
126-
releaseType = "release"
127-
addGameVersion "Forge"
128-
addGameVersion minecraft_version
129-
mainArtifact remapJar
130-
}
131-
}
132-
}
133-
134-
modrinth {
135-
token = System.getenv("MODRINTH_TOKEN")
136-
projectId = "modernfix" // This can be the project ID or the slug. Either will work!
137-
versionType = "release" // This is the default -- can also be `beta` or `alpha`
138-
uploadFile = remapJar
139-
gameVersions = [minecraft_version]
140-
loaders = ["forge"]
141-
changelog.set(provider { file("../CHANGELOG.md").getText('UTF-8') })
142-
}
143-
144-
tasks.curseforge.dependsOn(rootProject.generateChangelog)
145-
tasks.modrinth.dependsOn(rootProject.generateChangelog)
146-
147-
tasks.register('publishToModSites') {
148-
publishToModSites.dependsOn(tasks.modrinth)
149-
publishToModSites.dependsOn(tasks.curseforge)
150114
}

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ rei_version=9.1.591
1212
ctm_version=1.19.2-1.1.7+11
1313
kubejs_version=1902.6.0-build.142
1414
rhino_version=1902.2.2-build.268
15+
supported_minecraft_versions=1.19.2
1516

1617
fabric_loader_version=0.14.18
1718
fabric_api_version=0.76.0+1.19.2
1819

1920
modmenu_version=4.1.2
2021
appeng_version=12.9.3
21-
diagonal_fences_version=4545943
22+
diagonal_fences_version=4545943

0 commit comments

Comments
 (0)