Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.21.2(3) #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
}

version = "${project.mod_version}+mc${project.minecraft_version}"
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.2
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.9

# Fabric API
fabric_version=0.102.1+1.21.1
fabric_version=0.107.0+1.21.3

# Mod Properties
mod_version=0.1.5
mod_version=0.1.6
mod_id=threadtweak
mod_desc=Improve and tweak Minecraft CPU scheduling (again!)
maven_group=com.github.getchoo

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
mod_menu_version=11.0.1
mod_menu_version=12.0.0-beta.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/com/github/getchoo/smoothboot/mixin/UtilMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.github.getchoo.smoothboot.util.LoggingForkJoinWorkerThread;
import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.thread.NameableExecutor;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
Expand All @@ -26,10 +27,10 @@ public abstract class UtilMixin {
private static ExecutorService BOOTSTRAP_EXECUTOR;*/

@Shadow @Final @Mutable
private static ExecutorService MAIN_WORKER_EXECUTOR;
private static NameableExecutor MAIN_WORKER_EXECUTOR;

@Shadow @Final @Mutable
private static ExecutorService IO_WORKER_EXECUTOR;
private static NameableExecutor IO_WORKER_EXECUTOR;

@Shadow
private static void uncaughtExceptionHandler(Thread thread, Throwable throwable) {}
Expand Down Expand Up @@ -64,15 +65,15 @@ private static void onGetIoWorkerExecutor(CallbackInfoReturnable<Executor> ci) {
/**
* Replace
*/
private static ExecutorService replWorker(String name) {
private static NameableExecutor replWorker(String name) {
if (!SmoothBoot.initConfig) {
SmoothBoot.regConfig();
SmoothBoot.initConfig = true;
}

AtomicInteger atomicInteger = new AtomicInteger(1);

return new ForkJoinPool(MathHelper.clamp(select(name, SmoothBoot.config.threadCount.bootstrap,
return new NameableExecutor(new ForkJoinPool(MathHelper.clamp(select(name, SmoothBoot.config.threadCount.bootstrap,
SmoothBoot.config.threadCount.main), 1, 0x7fff), (forkJoinPool) -> {
String workerName = "Worker-" + name + "-" + atomicInteger.getAndIncrement();
SmoothBoot.LOGGER.debug("Initialized " + workerName);
Expand All @@ -82,16 +83,16 @@ private static ExecutorService replWorker(String name) {
SmoothBoot.config.threadPriority.main));
forkJoinWorkerThread.setName(workerName);
return forkJoinWorkerThread;
}, UtilMixin::uncaughtExceptionHandler, true);
}, UtilMixin::uncaughtExceptionHandler, true));
}

/**
* Replace
*/
private static ExecutorService replIoWorker() {
private static NameableExecutor replIoWorker() {
AtomicInteger atomicInteger = new AtomicInteger(1);

return Executors.newCachedThreadPool((runnable) -> {
return new NameableExecutor(Executors.newSingleThreadScheduledExecutor((runnable) -> {
String workerName = "IO-Worker-" + atomicInteger.getAndIncrement();
SmoothBoot.LOGGER.debug("Initialized " + workerName);

Expand All @@ -101,7 +102,7 @@ private static ExecutorService replIoWorker() {
thread.setPriority(SmoothBoot.config.threadPriority.io);
thread.setUncaughtExceptionHandler(UtilMixin::uncaughtExceptionHandler);
return thread;
});
}));
}

private static <T> T select(String name, T bootstrap, T main) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"depends": {
"fabricloader": ">=0.15",
"fabric-api": "*",
"minecraft": "~1.21.1",
"minecraft": "~1.21.2",
"java": ">=21"
}
}
2 changes: 1 addition & 1 deletion src/main/resources/smoothboot.mixins.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"required": true,
"minVerscomn": "0.8",
"minVersion": "0.8",
"package": "com.github.getchoo.smoothboot.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": ["UtilMixin"],
Expand Down