Skip to content

Commit

Permalink
Fix: Annotated classes loading, fix floodgate-fabric mixin config plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris authored Sep 11, 2024
1 parent 0ef0659 commit 65cd557
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import net.fabricmc.loader.api.FabricLoader;

public class MixinConfigPluginImpl {
public class ModMixinConfigPluginImpl {

public static boolean isGeyserLoaded() {
return FabricLoader.getInstance().isModLoaded("geyser-fabric");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class FloodgateUtilMixin {
Path path = FloodgateMod.INSTANCE.resourcePath(string);

if (path == null) {
throw new IllegalStateException("Unable to find annotation class! " + string);
throw new IllegalStateException("Unable to find classes marked by annotation class! " + string);
}

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.geysermc.floodgate.core.util.Metrics
org.geysermc.floodgate.core.news.NewsChecker
org.geysermc.floodgate.core.util.PostEnableMessages
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.neoforged.neoforge.event.server.ServerStoppingEvent;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.floodgate.api.logger.FloodgateLogger;
import org.geysermc.floodgate.core.module.PluginMessageModule;
import org.geysermc.floodgate.core.module.ServerCommonModule;
import org.geysermc.floodgate.mod.FloodgateMod;
Expand All @@ -20,11 +19,7 @@
import org.geysermc.floodgate.platform.neoforge.module.NeoForgePlatformModule;
import org.geysermc.floodgate.platform.neoforge.pluginmessage.NeoForgePluginMessageRegistration;

import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.nio.file.Path;
import java.util.Set;
import java.util.stream.Collectors;

@Mod("floodgate")
public final class NeoForgeFloodgateMod extends FloodgateMod {
Expand Down Expand Up @@ -82,20 +77,4 @@ public boolean isClient() {
return FMLLoader.getDist().isClient();
}

public Set<Class<?>> getAnnotatedClasses(Class<? extends Annotation> annotationClass) {
return container.getModInfo()
.getOwningFile()
.getFile()
.getScanResult()
.getAnnotatedBy(annotationClass, ElementType.TYPE)
.map(annotationData -> {
try {
return Class.forName(annotationData.clazz().getClassName());
} catch (Exception e) {
injector.getInstance(FloodgateLogger.class).error(e.getMessage(), e);
return null;
}
})
.collect(Collectors.toSet());
}
}

This file was deleted.

4 changes: 1 addition & 3 deletions neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ authors="$author"
description="$description"
[[mixins]]
config = "floodgate.mixins.json"
[[mixins]]
config = "floodgate_neoforge.mixins.json"
[[dependencies.floodgate]]
modId="neoforge"
type="required"
Expand All @@ -24,4 +22,4 @@ modId="minecraft"
type="required"
versionRange="[$minecraft_version,)"
ordering="NONE"
side="BOTH"
side="BOTH"
12 changes: 0 additions & 12 deletions neoforge/src/main/resources/floodgate_neoforge.mixins.json

This file was deleted.

0 comments on commit 65cd557

Please sign in to comment.