Gamebuster icon

FileConsumerMixin

Gamebuster | PRO | 10/20/21 10:52:29 PM UTC (Edited) | 0 ⭐ | 1001 👁️ | Never ⏰ | []
Java |

1.17 KB

|

None

|

0 👍

/

0 👎

package com.wildermods.wilderforge.mixins;
 
import java.nio.channels.FileChannel;
import java.nio.file.OpenOption;
import java.nio.file.Path;
 
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
 
import com.worldwalkergames.logging.FileConsumer;
 
@Mixin(value = FileConsumer.class, remap = false)
public class FileConsumerMixin {
    
    @Redirect(
            method = "<init>("                                                                              //method (constructor)
                + "Ljava/lang/String;"                                                                          //param1
                + "Lcom/worldwalkergames/logging/FileConsumer$FileConsumerConfig;"                              //param2
                + "[Lcom/worldwalkergames/logging/FilteringConsumer$Filter;)V",                                 //param3
            at = @At(value = "INVOKE_ASSIGN", 
                target = "Ljava/nio/channels/FileChannel;"                                                  //class
                    + "open("                                                                               //method
                        + "Ljava/nio/file/Path;"                                                                //param1
                        + "[Ljava/nio/file/OpenOption;"                                                         //param2
                    + ")Ljava/nio/channels/FileChannel;"                                                    //return type
            )
    )
    public FileChannel dontCreateLogChannels(Path path, OpenOption... options) {
        return null;
    }
    
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎