Skip to content

Commit

Permalink
1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
himekifee committed Jul 25, 2022
1 parent 91c97c8 commit 55bb211
Show file tree
Hide file tree
Showing 18 changed files with 224 additions and 227 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

Expand Down Expand Up @@ -34,7 +34,7 @@ dependencies {
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.

modImplementation "com.terraformersmc:modmenu:3.0.1"
modImplementation "com.terraformersmc:modmenu:4.0.4"
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'

modApi("me.shedaniel.cloth:cloth-config-fabric:6.2.57") {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.3
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8

# Mod Properties
Expand All @@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1G

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.57.0+1.18.2
fabric_version=0.58.0+1.19
14 changes: 7 additions & 7 deletions src/main/java/net/himeki/mcmtfabric/DebugHookTerminator.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package net.himeki.mcmtfabric;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
Expand Down Expand Up @@ -41,7 +41,6 @@
* Handles chunk forcing in scenarios where world corruption has occured
*
* @author jediminer543
*
*/
public class DebugHookTerminator {

Expand All @@ -53,12 +52,14 @@ public static class BrokenChunkLocator {
long chunkPos;
CompletableFuture<?> maincf;
CompletableFuture<?> brokecf;

public BrokenChunkLocator(long chunkPos, CompletableFuture<?> maincf, CompletableFuture<?> brokecf) {
super();
this.chunkPos = chunkPos;
this.maincf = maincf;
this.brokecf = brokecf;
}

public long getChunkPos() {
return chunkPos;
}
Expand All @@ -75,8 +76,7 @@ public static boolean isBypassLoadTarget() {
public static AtomicLong mainThreadChunkLoadCount = new AtomicLong();
public static String mainThread = "Server thread";

public static void chunkLoadDrive(ServerChunkManager.MainThreadExecutor executor, BooleanSupplier isDone, ServerChunkManager scp,
CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> completableFuture, long chunkpos) {
public static void chunkLoadDrive(ServerChunkManager.MainThreadExecutor executor, BooleanSupplier isDone, ServerChunkManager scp, CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> completableFuture, long chunkpos) {
/*
if (!GeneralConfig.enableChunkTimeout) {
bypassLoadTarget = false;
Expand All @@ -92,7 +92,7 @@ public static void chunkLoadDrive(ServerChunkManager.MainThreadExecutor executor
}
while (!isDone.getAsBoolean()) {
if (!executor.runTask()) {
if(isDone.getAsBoolean()) {
if (isDone.getAsBoolean()) {
if (Thread.currentThread().getName().equals(mainThread)) {
mainThreadChunkLoad.set(false);
}
Expand Down Expand Up @@ -131,12 +131,12 @@ public static void chunkLoadDrive(ServerChunkManager.MainThreadExecutor executor
/* */
} else {
try {
NbtCompound cnbt = scp.threadedAnvilChunkStorage.getNbt(new ChunkPos(chunkpos));
NbtCompound cnbt = scp.threadedAnvilChunkStorage.getNbt(new ChunkPos(chunkpos)).get().get();
if (cnbt != null) {
ProtoChunk cp = ChunkSerializer.deserialize((ServerWorld) scp.getWorld(), scp.threadedAnvilChunkStorage.pointOfInterestStorage, new ChunkPos(chunkpos), cnbt);
completableFuture.complete(Either.left(new WorldChunk((ServerWorld) scp.getWorld(), cp, null)));
}
} catch (IOException e) {
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
completableFuture.complete(ChunkHolder.UNLOADED_CHUNK);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/himeki/mcmtfabric/MCMT.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import me.shedaniel.autoconfig.ConfigHolder;
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.himeki.mcmtfabric.commands.ConfigCommand;
import net.himeki.mcmtfabric.commands.StatsCommand;
Expand Down Expand Up @@ -47,7 +47,7 @@ public void onInitialize() {

// Listener reg begin
ServerLifecycleEvents.SERVER_STARTED.register(server -> StatsCommand.resetAll());
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> ConfigCommand.register(dispatcher));
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> ConfigCommand.register(dispatcher));

}
}
Loading

0 comments on commit 55bb211

Please sign in to comment.