Buggy code:
public abstract class PatcherUserBasePlugin < T extends UserBaseExtension > extends UserBasePlugin < T > { @ Override @ SuppressWarnings ( "serial" ) protected void applyUserPlugin ( ) { String global = ( ( ( ( DIR_API_JAR_BASE ) + "//" ) + ( REPLACE_API_NAME ) ) + "%s-" ) + ( REPLACE_API_VERSION ) ; String local = ( ( ( ( ( ( ( DIR_LOCAL_CACHE ) + "//" ) + ( REPLACE_API_NAME ) ) + "%s-" ) + ( REPLACE_API_VERSION ) ) + "-PROJECT(" ) + ( project . getName ( ) ) ) + ")" ; this . tasksMerged ( global , local ) ; { project . getConfigurations ( ) . maybeCreate ( CONFIG_USERDEV ) ; ExtractConfigTask extractUserdev = makeTask ( TASK_EXTRACT_USERDEV , ExtractConfigTask . class ) ; extractUserdev . setDestinationDir ( delayedFile ( DIR_USERDEV ) ) ; extractUserdev . setConfig ( CONFIG_USERDEV ) ; extractUserdev . exclude ( "META-INF//**" , "META-INF//**" ) ; extractUserdev . dependsOn ( TASK_DL_VERSION_JSON ) ; extractUserdev . doLast ( new groovy . lang . Closure < Boolean > ( project ) { @ Override public Boolean call ( ) { parseAndStoreVersion ( delayedFile ( JSON_USERDEV ) . call ( ) , delayedFile ( DIR_JSONS ) . call ( ) ) ; return true ; } } ) ; project . getTasks ( ) . getByName ( TASK_GENERATE_SRGS ) . dependsOn ( extractUserdev ) ; project . getTasks ( ) . getByName ( TASK_RECOMPILE ) . dependsOn ( extractUserdev ) ; project . getTasks ( ) . getByName ( TASK_MAKE_START ) . dependsOn ( extractUserdev ) ; } { <START_BUG> DeobfuscateJar deobfBin = ( ( DeobfuscateJar ) ( project . getTasks ( ) . getByName ( TASK_DEOBF ) ) ) ; <END_BUG> DeobfuscateJar deobf = ( ( DeobfuscateJar ) ( project . getTasks ( ) . getByName ( TASK_DEOBF ) ) ) ; deobfBin . addTransformerClean ( delayedFile ( AT_USERDEV ) ) ; deobf . addTransformerClean ( delayedFile ( AT_USERDEV ) ) ; } { final Object patchedJar = PatcherUserBasePlugin . chooseDeobfOutput ( global , local , "" , "binpatched" ) ; TaskApplyBinPatches task = makeTask ( TASK_BINPATCH , TaskApplyBinPatches . class ) ; task . setInJar ( delayedFile ( JAR_MERGED ) ) ; task . setOutJar ( patchedJar ) ; task . setPatches ( delayedFile ( BINPATCH_USERDEV ) ) ; task . setClassJar ( delayedFile ( ZIP_UD_CLASSES ) ) ; task . setResourceJar ( delayedTree ( ZIP_UD_RES ) ) ; task . dependsOn ( "mergeJars" ) ; project . getTasks ( ) . getByName ( TASK_DEOBF_BIN ) . dependsOn ( task ) ; DeobfuscateJar deobf = ( ( DeobfuscateJar ) ( project . getTasks ( ) . getByName ( TASK_DEOBF_BIN ) . dependsOn ( task ) ) ) ; deobf . setInJar ( patchedJar ) ; deobf . dependsOn ( task ) ; } { final Object postDecompJar = PatcherUserBasePlugin . chooseDeobfOutput ( global , local , "" , "decompFixed" ) ; final Object patchedJar = PatcherUserBasePlugin . chooseDeobfOutput ( global , local , "" , "patched" ) ; PatchSourcesTask patch = makeTask ( TASK_PATCH , PatchSourcesTask . class ) ; patch . setPatches ( delayedFile ( ZIP_UD_PATCHES ) ) ; patch . addInject ( delayedFile ( ZIP_UD_SRC ) ) ; patch . setFailOnError ( true ) ; patch . setMakeRejects ( false ) ; patch . setPatchStrip ( 1 ) ; patch . setInJar ( postDecompJar ) ; patch . setOutJar ( patchedJar ) ; patch . dependsOn ( TASK_POST_DECOMP ) ; RemapSources remap = ( ( RemapSources ) ( project . getTasks ( ) . getByName ( TASK_REMAP ) ) ) ; remap . setInJar ( patchedJar ) ; remap . dependsOn ( patch ) ; TaskRecompileMc recomp = ( ( TaskRecompileMc ) ( project . getTasks ( ) . getByName ( TASK_RECOMPILE ) ) ) ; recomp . setInResources ( delayedFile ( ZIP_UD_RES ) ) ; } { TaskSingleReobf reobf = ( ( TaskSingleReobf ) ( project . getTasks ( ) . getByName ( TASK_REOBF ) ) ) ; reobf . addSecondarySrgFile ( delayedFile ( SRG_USERDEV ) ) ; } } @ Override protected void afterEvaluate ( ) { } @ Override protected void afterDecomp ( final boolean isDecomp , final boolean useLocalCache , final String mcConfig ) { } @ Override protected void addAtsToDeobf ( ) { } @ Override protected Object getStartDir ( ) { } public abstract String getApiGroup ( T ext ) { } public abstract String getApiName ( T ext ) { } public abstract String getApiVersion ( T ext ) { } public abstract String getUserdevClassifier ( T ext ) { } public abstract String getUserdevExtension ( T ext ) { } @ Override protected boolean hasServerRun ( ) { } @ Override protected boolean hasClientRun ( ) { } @ Override protected void applyOverlayPlugin ( ) { } @ Override public boolean canOverlayPlugin ( ) { } @ Override protected T getOverlayExtension ( ) { } }

Fix:
DeobfuscateJar deobfBin = ( ( DeobfuscateJar ) ( project . getTasks ( ) . getByName ( TASK_DEOBF_BIN ) ) ) ;