Skip to content

Commit

Permalink
pull aw/at transforming out of being tied to forge/fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Dec 14, 2023
1 parent 266d7fa commit ddccef4
Show file tree
Hide file tree
Showing 33 changed files with 845 additions and 511 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import groovy.lang.Closure
import groovy.lang.DelegatesTo
import org.jetbrains.annotations.ApiStatus
import xyz.wagyourtail.unimined.api.minecraft.patch.*
import xyz.wagyourtail.unimined.api.minecraft.patch.ataw.AccessTransformerPatcher
import xyz.wagyourtail.unimined.api.minecraft.patch.ataw.AccessWidenerPatcher
import xyz.wagyourtail.unimined.api.minecraft.patch.fabric.FabricLikePatcher
import xyz.wagyourtail.unimined.api.minecraft.patch.forge.ForgeLikePatcher
import xyz.wagyourtail.unimined.api.minecraft.patch.forge.MinecraftForgePatcher
import xyz.wagyourtail.unimined.api.minecraft.patch.forge.NeoForgedPatcher
import xyz.wagyourtail.unimined.api.minecraft.patch.jarmod.JarModAgentPatcher

/**
* usage:
Expand Down Expand Up @@ -301,6 +308,80 @@ interface PatchProviders {
jarMod {}
}

/**
* enables **just** access widener patching
* you have to create your own way to bootstrap it out of dev.
* (and probably apply launchtweaker or something for dev launches).
* @since 1.2.0
*/
fun accessWidener(action: AccessWidenerPatcher.() -> Unit)


/**
* enables **just** access widener patching
* you have to create your own way to bootstrap it out of dev.
* (and probably apply launchtweaker or something for dev launches).
* @since 1.2.0
*/
fun accessWidener(
@DelegatesTo(
value = AccessWidenerPatcher::class,
strategy = Closure.DELEGATE_FIRST
) action: Closure<*>
) {
accessWidener {
action.delegate = this
action.resolveStrategy = Closure.DELEGATE_FIRST
action.call()
}
}

/**
* enables **just** access widener patching
* you have to create your own way to bootstrap it out of dev.
* (and probably apply launchtweaker or something for dev launches).
* @since 1.2.0
*/
fun accessWidener() {
accessWidener {}
}

/**
* enables **just** access transformer patching
* you have to create your own way to bootstrap it out of dev.
* (and probably apply launchtweaker or something for dev launches).
* @since 1.2.0
*/
fun accessTransformer(action: AccessTransformerPatcher.() -> Unit)

/**
* enables **just** access transformer patching
* you have to create your own way to bootstrap it out of dev.
* (and probably apply launchtweaker or something for dev launches).
* @since 1.2.0
*/
fun accessTransformer(
@DelegatesTo(
value = AccessTransformerPatcher::class,
strategy = Closure.DELEGATE_FIRST
) action: Closure<*>) {
accessTransformer {
action.delegate = this
action.resolveStrategy = Closure.DELEGATE_FIRST
action.call()
}
}

/**
* enables **just** access transformer patching
* you have to create your own way to bootstrap it out of dev
* (and probably apply launchtweaker or something for dev launches).
* @since 1.2.0
*/
fun accessTransformer() {
accessTransformer {}
}

@ApiStatus.Experimental
fun <T: MinecraftPatcher> customPatcher(mcPatcher: T, action: T.() -> Unit)
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
package xyz.wagyourtail.unimined.api.minecraft.patch.ataw

import xyz.wagyourtail.unimined.api.mapping.MappingNamespaceTree
import java.io.File

/**
* split from forge/fabric patcher in 1.2.0
* @since 1.2.0
*/
interface AccessConvert {

/**
* convert access widener to access transformer.
*/
fun aw2at(input: String): File

/**
* convert access widener to access transformer.
*/
fun aw2at(input: String, output: String): File

/**
* convert access widener to access transformer.
*/
fun aw2at(input: File): File

/**
* convert access widener to access transformer.
*/
fun aw2at(input: File, output: File): File

/**
* convert access widener to legacy access transformer (mc version <= 1.7.10).
*/
fun aw2atLegacy(input: String): File

/**
* convert access widener to legacy access transformer (mc version <= 1.7.10).
*/
fun aw2atLegacy(input: String, output: String): File

/**
* convert access widener to legacy access transformer (mc version <= 1.7.10).
*/
fun aw2atLegacy(input: File): File

/**
* convert access widener to legacy access transformer (mc version <= 1.7.10).
*/
fun aw2atLegacy(input: File, output: File): File

/*
* merge access wideners to an output file
*/
fun mergeAws(inputs: List<File>): File

/*
* merge access wideners to an output file
*/
fun mergeAws(namespace: MappingNamespaceTree.Namespace, inputs: List<File>): File

/*
* merge access wideners to an output file
*/
fun mergeAws(output: File, inputs: List<File>): File

/*
* merge access wideners to an output file
*/
fun mergeAws(output: File, namespace: MappingNamespaceTree.Namespace, inputs: List<File>): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: String, output: String, namespace: MappingNamespaceTree.Namespace): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: String, namespace: MappingNamespaceTree.Namespace): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: String, output: String): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: String): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: File): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: File, namespace: MappingNamespaceTree.Namespace): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: File, output: File): File

/**
* convert access transformer to access widener.
*/
fun at2aw(input: File, output: File, namespace: MappingNamespaceTree.Namespace): File
}
Loading

0 comments on commit ddccef4

Please sign in to comment.