Class NeoForgeDevDistCleaner
java.lang.Object
net.neoforged.fml.loading.moddiscovery.locators.NeoForgeDevDistCleaner
- All Implemented Interfaces:
ClassProcessor
Masks classes from the Minecraft jar that are for the wrong distribution in a development environment, throwing an
informative exception.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.neoforged.neoforgespi.transformation.ClassProcessor
ClassProcessor.AfterProcessingContext, ClassProcessor.ComputeFlags, ClassProcessor.LinkContext, ClassProcessor.OrderingHint, ClassProcessor.SelectionContext, ClassProcessor.TransformationContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final net.neoforged.api.distmarker.Distprivate static final org.slf4j.Markerprivate static final org.slf4j.Loggerprivate static final Attributes.Nameprivate static final Attributes.NameFields inherited from interface net.neoforged.neoforgespi.transformation.ClassProcessor
GENERATED_PACKAGE_MODULE -
Constructor Summary
ConstructorsConstructorDescriptionNeoForgeDevDistCleaner(JarContents minecraftModFile, net.neoforged.api.distmarker.Dist requestedDist) -
Method Summary
Modifier and TypeMethodDescriptiongetMaskedFiles(JarContents minecraftJar, net.neoforged.api.distmarker.Dist currentDist) Loads file masking information from the jar's manifest, masking resource files that should not be present and tellingNeoForgeDevDistCleanerto clean class files that should be masked.booleanReturns whether the processor wants to recieve the class.name()Returns a unique identifier for this processor.Each class that the processor has opted to recieve is passed to this method for processing.Returns processors that this processor must run after.Returns processors that this processor must run before.static booleansupportsDistCleaning(JarContents minecraftModFile) private static <T,X extends Throwable>
voidthrowUnchecked(T throwable) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforgespi.transformation.ClassProcessor
afterProcessing, generatesPackages, link, orderingHint
-
Field Details
-
NAME_DISTS
-
NAME_DIST
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DISTXFORM
private static final org.slf4j.Marker DISTXFORM -
dist
private final net.neoforged.api.distmarker.Dist dist -
maskedClasses
-
-
Constructor Details
-
NeoForgeDevDistCleaner
public NeoForgeDevDistCleaner(JarContents minecraftModFile, net.neoforged.api.distmarker.Dist requestedDist)
-
-
Method Details
-
supportsDistCleaning
-
name
Description copied from interface:ClassProcessorReturns a unique identifier for this processor.- Specified by:
namein interfaceClassProcessor- Returns:
- a unique identifier for this processor
-
runsBefore
Description copied from interface:ClassProcessorReturns processors that this processor must run before.- Specified by:
runsBeforein interfaceClassProcessor- Returns:
- processors that this processor must run before
-
runsAfter
Description copied from interface:ClassProcessorReturns processors that this processor must run after. This should includeClassProcessorIds.COMPUTING_FRAMESif the processor returns a result requiring frame re-computation.- Specified by:
runsAfterin interfaceClassProcessor- Returns:
- processors that this processor must run after
-
processClass
Description copied from interface:ClassProcessorEach class that the processor has opted to recieve is passed to this method for processing.- Specified by:
processClassin interfaceClassProcessor- Parameters:
context- the context of the class to process- Returns:
- the
ClassProcessor.ComputeFlagsindicating how the class should be rewritten.
-
handlesClass
Description copied from interface:ClassProcessorReturns whether the processor wants to recieve the class.- Specified by:
handlesClassin interfaceClassProcessor- Parameters:
context- the context of the class to consider- Returns:
- whether the processor wants to recieve the class
-
throwUnchecked
- Throws:
X
-
getMaskedFiles
public static Stream<String> getMaskedFiles(JarContents minecraftJar, net.neoforged.api.distmarker.Dist currentDist) Loads file masking information from the jar's manifest, masking resource files that should not be present and tellingNeoForgeDevDistCleanerto clean class files that should be masked.
-