Update to pre4
This commit is contained in:
parent
e6fc101712
commit
9431b6356b
|
@ -105,7 +105,7 @@ allprojects {
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
|
|
||||||
modRuntimeOnly modCompileOnly("com.terraformersmc:modmenu:2.0.14")
|
modRuntimeOnly modCompileOnly("com.terraformersmc:modmenu:2.0.14")
|
||||||
modRuntime("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
|
modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/versions.html
|
# check these on https://fabricmc.net/versions.html
|
||||||
minecraft_version=1.18-pre2
|
minecraft_version=1.18-pre4
|
||||||
yarn_mappings=build.1
|
yarn_mappings=build.9
|
||||||
loader_version=0.12.5
|
loader_version=0.12.5
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=2.1.4
|
mod_version=2.1.4
|
||||||
maven_group=io.gitlab.jfronny
|
maven_group=io.gitlab.jfronny
|
||||||
archives_base_name=libjf
|
archives_base_name=libjf
|
||||||
|
|
||||||
fabric_version=0.42.5+1.18
|
fabric_version=0.42.7+1.18
|
||||||
|
|
|
@ -5,29 +5,15 @@ import com.mojang.authlib.minecraft.TelemetryPropertyContainer;
|
||||||
import com.mojang.authlib.minecraft.TelemetrySession;
|
import com.mojang.authlib.minecraft.TelemetrySession;
|
||||||
import com.mojang.authlib.minecraft.UserApiService;
|
import com.mojang.authlib.minecraft.UserApiService;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class NoOpUserApi implements UserApiService {
|
public class NoOpUserApi implements UserApiService {
|
||||||
@Override
|
@Override
|
||||||
public boolean serversAllowed() {
|
public UserProperties properties() {
|
||||||
return true;
|
return new UserProperties(Set.of(UserFlag.CHAT_ALLOWED, UserFlag.SERVERS_ALLOWED));
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean realmsAllowed() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean chatAllowed() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean telemetryAllowed() {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,11 +15,8 @@ import net.minecraft.server.command.CommandManager;
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.LiteralText;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
|
|
||||||
public class JfWeb implements ClientModInitializer, DedicatedServerModInitializer, ModInitializer {
|
public class JfWeb implements ClientModInitializer, DedicatedServerModInitializer, ModInitializer {
|
||||||
public static final WebServer SERVER;
|
public static final WebServer SERVER;
|
||||||
private static final AtomicBoolean SERVER_STARTED = new AtomicBoolean(false);
|
|
||||||
static {
|
static {
|
||||||
JfWebConfig.ensureValidPort();
|
JfWebConfig.ensureValidPort();
|
||||||
SERVER = new JfWebServer(JfWebConfig.port, JfWebConfig.maxConnections);
|
SERVER = new JfWebServer(JfWebConfig.port, JfWebConfig.maxConnections);
|
||||||
|
@ -28,34 +25,16 @@ public class JfWeb implements ClientModInitializer, DedicatedServerModInitialize
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
ClientLifecycleEvents.CLIENT_STARTED.register(client -> {
|
ClientLifecycleEvents.CLIENT_STARTED.register(client -> SERVER.restart());
|
||||||
if (!SERVER_STARTED.get()) {
|
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> SERVER.stop());
|
||||||
SERVER.restart();
|
|
||||||
SERVER_STARTED.set(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> {
|
|
||||||
if (SERVER_STARTED.get()) {
|
|
||||||
SERVER.stop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeServer() {
|
public void onInitializeServer() {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
|
ServerLifecycleEvents.SERVER_STARTED.register(server -> SERVER.restart());
|
||||||
if (!SERVER_STARTED.get()) {
|
ServerLifecycleEvents.SERVER_STOPPED.register(server -> SERVER.stop());
|
||||||
SERVER.restart();
|
|
||||||
SERVER_STARTED.set(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ServerLifecycleEvents.SERVER_STOPPED.register(server -> {
|
|
||||||
if (SERVER_STARTED.get()) {
|
|
||||||
SERVER.stop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user