You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+10-9
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
1
# Lillero
2
-
3
2
Lillero is a lightweight and simple Java ASM patching framework built on top of [ObjectWeb's ASM library](https://asm.ow2.io/).
4
3
5
4
## How
6
-
This library provides the core interface, `IInjector`, as well as a small set of utils to make your life easier. All patches should implement `IInjector` and be declared as [services](https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html).
5
+
This library provides the core interface, `IInjector`, as well as a small set of utils to make your life easier. Your patches should implement `IInjector`.
7
6
8
7
Some methods *must* be implemented, specifying which class and method will be patched:
9
8
*`targetClass()`: returns the *fully qualified name* of the class to patch (example: `net.minecraft.client.Minecraft`).
@@ -17,8 +16,7 @@ There's some more optional methods you *don't have to* implement, but really sho
17
16
18
17
Finally, you should mark your classes as service providers, by creating a text file called `ftbsc.lll.IInjector` in `src/main/resources/META-INF/services` on your project. Inside, put the fully qualified names of your patches (example: `ftbsc.bscv.asm.patches.TestPatch$TickPatch`).
19
18
20
-
If you use Gradle (you do) don't forget to add this library as a dependency in your `build.gradle`:
21
-
19
+
Add this library into your build system of choice (Gradle is shown, but anything supporting Maven repositories will do):
22
20
```groovy
23
21
repositories {
24
22
maven { url = 'https://maven.fantabos.co' }
@@ -30,13 +28,16 @@ dependencies {
30
28
31
29
You are going to need an appropriate loader to use Lillero patches: **this is just a library and does nothing by itself**. You need to make it work by loading services implementing the `IInjector` interface, and by calling their `inject(ClassNode, MethodNode)` methods with the appropriate parameters.
32
30
33
-
Finally, know that you can spare yourself some trouble, by using this [annotation processor](https://github.com/zaaarf/lillero-processor/) to reduce boilerplate to a minimum.
31
+
It should also be noted that this library will be required at runtime for your patches to function. You will either have to bundle it using [Shadow](https://github.com/johnrengelman/shadow) or similar, or get this into your runtime classpath by some other means (our [loader](https://github.com/zaaarf/lillero-loader/), for instance, takes care of this for you).
32
+
33
+
Finally, know that you can spare yourself some trouble, by using this [annotation processor](https://github.com/zaaarf/lillero-processor/) to reduce boilerplate code to a minimum.
34
34
35
35
#### Tips specific to Minecraft patching
36
-
* You want to be using Notch (fully obfuscated) names whenever you are told to reference a class or method by name, since those are the ones that exist at runtime.
37
-
- Use MCP (AKA unobfuscated) names if you are running from ForgeGradle's runClient task.
38
-
- If you are using our loader (see below), use Searge (obfuscated but unique) names in every place you are told to use a name - ModLauncher will do the rest.
39
-
* Use our [loader](https://github.com/zaaarf/lillero-loader/) that hooks into Forge's ModLauncher if you're writing a Forge mod.
36
+
* In "raw" environments, you want to be using Notch (fully obfuscated) names whenever you are told to reference a class or method by name, since those are the ones that exist at runtime.
37
+
- Use deobfuscated names if you are running from ForgeGradle's or loom's runClient task.
38
+
- If you are using our loader (see below), use intermediary (unreadable but unique) names in every place you are told to use a name - ModLauncher will do the rest.
39
+
- If you are loading this through (Fabric-ASM)[https://github.com/Chocohead/Fabric-ASM], use intermediary representation.
40
+
* Use our [loader](https://github.com/zaaarf/lillero-loader/) that hooks into Forge's ModLauncher if you're writing a modern Forge mod.
40
41
* Make sure to dunk on all the naysayers who tried to force you to use Mixin!
0 commit comments