Package fr.skytasul.reflection.shrieker
Class MappingsShrieker
java.lang.Object
fr.skytasul.reflection.shrieker.MappingsShrieker
Warning: make sure all necessary classes (outside the reflected ones) are present in the
classpath, otherwise it would not work!
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMappingsShrieker(@NotNull fr.skytasul.reflection.mappings.files.MappingType mappingType, @NotNull MappingsShrieker.ReflectionInitializer initializeFunction) Creates a shrieker instance. -
Method Summary
Modifier and TypeMethodDescription@NotNull Map<fr.skytasul.reflection.Version, fr.skytasul.reflection.mappings.Mappings> voidregisterVersionMappings(@NotNull fr.skytasul.reflection.Version version, @NotNull fr.skytasul.reflection.mappings.Mappings mappings) Register the mappings used for a specific version.voidwriteMappingsFile(@NotNull Path mappingsPath) Write all constructed reduced mappings to the path specified.
-
Constructor Details
-
MappingsShrieker
public MappingsShrieker(@NotNull @NotNull fr.skytasul.reflection.mappings.files.MappingType mappingType, @NotNull @NotNull MappingsShrieker.ReflectionInitializer initializeFunction) Creates a shrieker instance.- Parameters:
mappingType- type of mappings in the output fileinitializeFunction- function that is called for each call toregisterVersionMappings(Version, Mappings). All reflection accesses made to theMappingspassed as parameter to this function will be recorded and used to create the reduced mappings.
-
-
Method Details
-
registerVersionMappings
public void registerVersionMappings(@NotNull @NotNull fr.skytasul.reflection.Version version, @NotNull @NotNull fr.skytasul.reflection.mappings.Mappings mappings) throws ReflectiveOperationException Register the mappings used for a specific version.- Parameters:
version- the version of the mappingsmappings- mappings of this version- Throws:
ReflectiveOperationException- if an error happened while initializing the reflection
-
getReducedMappings
@NotNull public @NotNull Map<fr.skytasul.reflection.Version,fr.skytasul.reflection.mappings.Mappings> getReducedMappings() -
writeMappingsFile
Write all constructed reduced mappings to the path specified.- Parameters:
mappingsPath-- Throws:
IOException- if an error occurred while writing the mappings file
-