mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-23 11:27:54 +01:00
fix issues here and there
This commit is contained in:
parent
25a55227e4
commit
4190ac72c5
6 changed files with 12 additions and 20 deletions
|
@ -48,14 +48,12 @@ class SubprojectPlugin: Plugin<Project> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
private fun setupLoom(project: Project) {
|
private fun setupLoom(project: Project) {
|
||||||
val loom = project.the<LoomGradleExtensionAPI>()
|
val loom = project.the<LoomGradleExtensionAPI>()
|
||||||
loom.silentMojangMappingsLicense()
|
loom.silentMojangMappingsLicense()
|
||||||
|
|
||||||
// FIXME y tho? :(
|
//fixme is this still needed?
|
||||||
loom.mixin.useLegacyMixinAp = true
|
// loom.mixin.defaultRefmapName = "flywheel.refmap.json"
|
||||||
loom.mixin.defaultRefmapName = "flywheel.refmap.json"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupJava(project: Project) {
|
private fun setupJava(project: Project) {
|
||||||
|
|
|
@ -17,6 +17,8 @@ import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent;
|
import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent;
|
||||||
import net.neoforged.neoforge.common.ModConfigSpec;
|
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||||
|
import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue;
|
||||||
|
import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue;
|
||||||
|
|
||||||
public final class FlwCommands {
|
public final class FlwCommands {
|
||||||
private FlwCommands() {
|
private FlwCommands() {
|
||||||
|
@ -25,7 +27,7 @@ public final class FlwCommands {
|
||||||
public static void registerClientCommands(RegisterClientCommandsEvent event) {
|
public static void registerClientCommands(RegisterClientCommandsEvent event) {
|
||||||
LiteralArgumentBuilder<CommandSourceStack> command = Commands.literal("flywheel");
|
LiteralArgumentBuilder<CommandSourceStack> command = Commands.literal("flywheel");
|
||||||
|
|
||||||
ModConfigSpec.ConfigValue<String> backendValue = ForgeFlwConfig.INSTANCE.client.backend;
|
ConfigValue<String> backendValue = ForgeFlwConfig.INSTANCE.client.backend;
|
||||||
command.then(Commands.literal("backend")
|
command.then(Commands.literal("backend")
|
||||||
.executes(context -> {
|
.executes(context -> {
|
||||||
Backend backend = BackendManager.getBackend();
|
Backend backend = BackendManager.getBackend();
|
||||||
|
@ -55,7 +57,7 @@ public final class FlwCommands {
|
||||||
return Command.SINGLE_SUCCESS;
|
return Command.SINGLE_SUCCESS;
|
||||||
})));
|
})));
|
||||||
|
|
||||||
ModConfigSpec.BooleanValue limitUpdatesValue = ForgeFlwConfig.INSTANCE.client.limitUpdates;
|
BooleanValue limitUpdatesValue = ForgeFlwConfig.INSTANCE.client.limitUpdates;
|
||||||
command.then(Commands.literal("limitUpdates")
|
command.then(Commands.literal("limitUpdates")
|
||||||
.executes(context -> {
|
.executes(context -> {
|
||||||
if (limitUpdatesValue.get()) {
|
if (limitUpdatesValue.get()) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import net.neoforged.bus.api.IEventBus;
|
||||||
import net.neoforged.fml.CrashReportCallables;
|
import net.neoforged.fml.CrashReportCallables;
|
||||||
import net.neoforged.fml.DistExecutor;
|
import net.neoforged.fml.DistExecutor;
|
||||||
import net.neoforged.fml.LogicalSide;
|
import net.neoforged.fml.LogicalSide;
|
||||||
|
import net.neoforged.fml.ModContainer;
|
||||||
import net.neoforged.fml.ModLoadingContext;
|
import net.neoforged.fml.ModLoadingContext;
|
||||||
|
|
||||||
import net.neoforged.fml.common.Mod;
|
import net.neoforged.fml.common.Mod;
|
||||||
|
@ -47,11 +48,10 @@ public final class FlywheelForge {
|
||||||
@UnknownNullability
|
@UnknownNullability
|
||||||
private static ArtifactVersion version;
|
private static ArtifactVersion version;
|
||||||
|
|
||||||
public FlywheelForge(IEventBus modEventBus) {
|
public FlywheelForge(IEventBus modEventBus, ModContainer modContainer) {
|
||||||
ModLoadingContext modLoadingContext = ModLoadingContext.get();
|
ModLoadingContext modLoadingContext = ModLoadingContext.get();
|
||||||
|
|
||||||
version = modLoadingContext
|
version = modContainer
|
||||||
.getActiveContainer()
|
|
||||||
.getModInfo()
|
.getModInfo()
|
||||||
.getVersion();
|
.getVersion();
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public final class FlywheelForge {
|
||||||
FlwDebugInfo.addDebugInfo(minecraft, e.getRight());
|
FlwDebugInfo.addDebugInfo(minecraft, e.getRight());
|
||||||
});
|
});
|
||||||
|
|
||||||
modEventBus.addListener((EndClientResourceReloadEvent e) -> BackendManagerImpl.onEndClientResourceReload(e.error() != null));
|
modEventBus.addListener((EndClientResourceReloadEvent e) -> BackendManagerImpl.onEndClientResourceReload(e.error().isPresent()));
|
||||||
|
|
||||||
modEventBus.addListener((FMLCommonSetupEvent e) -> {
|
modEventBus.addListener((FMLCommonSetupEvent e) -> {
|
||||||
ArgumentTypeInfos.registerByClass(BackendArgument.class, BackendArgument.INFO);
|
ArgumentTypeInfos.registerByClass(BackendArgument.class, BackendArgument.INFO);
|
||||||
|
|
|
@ -22,7 +22,7 @@ import dev.engine_room.flywheel.impl.FlwImpl;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.server.packs.resources.ReloadableResourceManager;
|
import net.minecraft.server.packs.resources.ReloadableResourceManager;
|
||||||
|
|
||||||
@Mixin(value = Minecraft.class, remap = false)
|
@Mixin(Minecraft.class)
|
||||||
abstract class MinecraftMixin {
|
abstract class MinecraftMixin {
|
||||||
@Shadow
|
@Shadow
|
||||||
@Final
|
@Final
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
|
||||||
import com.google.common.base.Suppliers;
|
import com.google.common.base.Suppliers;
|
||||||
|
|
||||||
public class SodiumMixinPlugin implements IMixinConfigPlugin {
|
public class SodiumMixinPlugin implements IMixinConfigPlugin {
|
||||||
private static final Supplier<Boolean> IS_SODIUM_LOADED = Suppliers.memoize(() -> LoadingModList.get().getModFileById("rubidium") != null);
|
private static final Supplier<Boolean> IS_SODIUM_LOADED = Suppliers.memoize(() -> LoadingModList.get().getModFileById("embeddium") != null);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad(String mixinPackage) {
|
public void onLoad(String mixinPackage) {
|
||||||
|
|
|
@ -32,11 +32,3 @@ modId = "neoforge"
|
||||||
type = "required"
|
type = "required"
|
||||||
versionRange = "${neoforge_version_range}"
|
versionRange = "${neoforge_version_range}"
|
||||||
side = "CLIENT"
|
side = "CLIENT"
|
||||||
|
|
||||||
# Breaks dependency
|
|
||||||
[[dependencies.${mod_id}]]
|
|
||||||
modId = "rubidium"
|
|
||||||
type = "incompatible"
|
|
||||||
reason = "mixin crash with any version of rubidium under 0.7.0"
|
|
||||||
versionRange = "[0.7.0,)"
|
|
||||||
side = "CLIENT"
|
|
||||||
|
|
Loading…
Reference in a new issue