mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 14:34:28 +00:00
Fix EnumRarity, make sure extensible enums have at least one factory candidate
This commit is contained in:
1 parent
bda3f1b7c6
commit
cab1b9716c
2 files changed
+7
-5
No files matched your search
@@ -88,6 +88,10 @@ public class RuntimeEnumExtender implements ILaunchPluginService {
|
||||
.filter(m -> ((m.access & Opcodes.ACC_STATIC) != 0) && m.name.equals("create") && Type.getReturnType(m.desc).equals(classType))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (candidates.isEmpty()) {
|
||||
throw new IllegalStateException("IExtensibleEnum has no candidate factory methods: " + classType.getClassName());
|
||||
}
|
||||
|
||||
candidates.forEach(mtd ->
|
||||
{
|
||||
Type[] args = Type.getArgumentTypes(mtd.desc);
|
||||
|
||||
Reference in new issue
Block a user