Skip to content

Commit

Permalink
Rebrand to Bytecode Junkie, retaining APIs and adding "provides" for …
Browse files Browse the repository at this point in the history
…`gud_asm`
  • Loading branch information
Ampflower committed Jan 23, 2023
1 parent fdb7404 commit f18afd3
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 89 deletions.
Binary file removed Curse.png
Binary file not shown.
9 changes: 8 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Bytecode Junkie

A mass assembly transformation mod based off of GudASM by Gudenau.

*The following README.MD is the original readme from GudASM.*

# gudASM

The ~~worst~~ best thing to happen to Fabric modding.

#### TL;DR

It allows you to do direct bytecode manipulation and aims to make it "easy". You should only use this when [mixins](https://github.com/SpongePowered/Mixin/wiki) really can't do what you need.
It allows you to do direct bytecode manipulation and aims to make it "easy". You should only use this
when [mixins](https://github.com/SpongePowered/Mixin/wiki) really can't do what you need.

#### What can this do?

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ minecraft_version=1.16.2
yarn_mappings=1.16.2+build.46:v2
loader_version=0.9.2+build.206
# Mod Properties
mod_version=0.3.1
maven_group=net.gudenau.minecraft
archives_base_name=gud_asm
mod_version=0.3.2
maven_group=gay.ampflower.junkie
archives_base_name=bytecode-junkie
# Dependencies
annotations_version=16.0.2
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ pluginManagement {
}
}

rootProject.name = 'gudasm'
rootProject.name = 'bytecode-junkie'
17 changes: 17 additions & 0 deletions src/main/java/gay/ampflower/junkie/PreLaunch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package gay.ampflower.junkie;// Created 2023-23-01T02:53:19

import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;
import net.gudenau.minecraft.asm.impl.Bootstrap;

/**
* Secondary, fallback, bootstrapping route for Bytecode Junkie.
*
* @author Ampflower
* @since 0.3.2
**/
public class PreLaunch implements PreLaunchEntrypoint {
@Override
public void onPreLaunch() {
Bootstrap.setup();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package gay.ampflower.junkie.internal.mixin;// Created 2023-23-01T02:54:27

import net.gudenau.minecraft.asm.impl.Bootstrap;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import java.util.List;
import java.util.Set;

/**
* Primary bootstrapping route for Bytecode Junkie.
*
* @author Ampflower
* @since 0.3.2
**/
public class MixinBootstrap implements IMixinConfigPlugin {
static {
Bootstrap.setup();
}

@Override
public void onLoad(final String mixinPackage) {

}

@Override
public String getRefMapperConfig() {
return null;
}

@Override
public boolean shouldApplyMixin(final String targetClassName, final String mixinClassName) {
return false;
}

@Override
public void acceptTargets(final Set<String> myTargets, final Set<String> otherTargets) {

}

@Override
public List<String> getMixins() {
return null;
}

@Override
public void preApply(final String targetClassName, final ClassNode targetClass, final String mixinClassName, final IMixinInfo mixinInfo) {

}

@Override
public void postApply(final String targetClassName, final ClassNode targetClass, final String mixinClassName, final IMixinInfo mixinInfo) {

}
}
11 changes: 0 additions & 11 deletions src/main/java/net/gudenau/minecraft/asm/GudAsm.java

This file was deleted.

11 changes: 8 additions & 3 deletions src/main/java/net/gudenau/minecraft/asm/impl/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

// Bootstraps all the mess we make.
public class Bootstrap {
private static final Logger log = LogManager.getLogger("gud_asm");
private static final Logger log = LogManager.getLogger("Bytecode Junkie");
private static boolean latch = false;

public static boolean enableCache = false;
Expand All @@ -39,6 +39,9 @@ public static void setup() {
return;
}
latch = true;

log.fatal("Bytecode Junkie starting up chaos with mass assembly transformations.");

// Load the configuration
try {
Configuration.load();
Expand Down Expand Up @@ -82,11 +85,13 @@ public static void setup() {
try {
unsafe$generic(KnotFinder.getKnot(), cache);
} catch (Throwable t) {
new RuntimeException("Failed to hook into Knot", t).printStackTrace();
System.exit(0);
log.fatal("Failed to hook into Knot", t);
System.exit(1);
// Unreachable
throw new RuntimeException("Failed to hook into Knot", t);
}

log.fatal("A knot finder has found your knots. Classes might be slightly quilted.");
}

private static void unsafe$generic(ClassLoader classLoader, ClassCache cache) throws Throwable {
Expand Down
44 changes: 0 additions & 44 deletions src/main/java/net/gudenau/minecraft/asm/mixin/Plugin.java

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/main/resources/assets/gud_asm/icon.png
Binary file not shown.
7 changes: 7 additions & 0 deletions src/main/resources/bytecode-junkie.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"required": true,
"minVersion": "0.8",
"package": "gay.ampflower.junkie.internal.mixin",
"compatibilityLevel": "JAVA_8",
"plugin": "gay.ampflower.junkie.internal.mixin.MixinBootstrap"
}
27 changes: 13 additions & 14 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
{
"schemaVersion": 1,
"id": "gud_asm",
"id": "bytecode-junkie",
"version": "${version}",

"name": "gudASM",
"description": "Lets you do weird ASM hacks with relitive ease.",
"name": "Bytecode Junkie",
"description": "Mass ASM transformations with ease, based on gudASM.",
"provides": [
"gud_asm"
],
"authors": [
"gudenau",
"Ampflower"
"Ampflower",
"gudenau"
],
"contact": {
"homepage": "https://www.curseforge.com/minecraft/mc-mods/gudasm",
"sources": "https://github.com/gudenau/minecraft-gudasm"
"sources": "https://github.com/the-glitch-network/bytecode-junkie"
},

"license": "MPL-2.0",
"icon": "assets/gud_asm/icon.png",

"icon": "assets/bytecode-junkie/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"net.gudenau.minecraft.asm.GudAsm"
"preLaunch": [
"gay.ampflower.junkie.PreLaunch"
]
},
"mixins": [
"gud_asm.mixins.json"
"bytecode-junkie.mixins.json"
],

"depends": {
Expand Down
12 changes: 0 additions & 12 deletions src/main/resources/gud_asm.mixins.json

This file was deleted.

0 comments on commit f18afd3

Please sign in to comment.