Created
February 18, 2021 00:19
-
-
Save hube12/8fc0806bc045a660ce78d19b93c8bbf9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.seedfinding.neil.mixin; | |
import net.minecraft.client.gui.screen.PresetsScreen; | |
import net.minecraft.text.Text; | |
import org.spongepowered.asm.mixin.Final; | |
import org.spongepowered.asm.mixin.Mixin; | |
import org.spongepowered.asm.mixin.Shadow; | |
import org.spongepowered.asm.mixin.injection.At; | |
import org.spongepowered.asm.mixin.injection.Inject; | |
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | |
import java.util.List; | |
@Mixin(PresetsScreen.class) | |
public class AddPresets { | |
@Mixin(targets = {"net.minecraft.client.gui.screen.PresetsScreen$SuperflatPreset" }) | |
static class SuperflatPreset { | |
@Final | |
@Shadow | |
public Text name; | |
} | |
@Final | |
@Shadow | |
private static List<SuperflatPreset> PRESETS; // this is done because net.minecraft.client.gui.screen.PresetsScreen$SuperflatPreset ain't accessible | |
@Inject(method = "<init>*", at = @At("RETURN")) | |
public void sortList(CallbackInfo ci) { | |
System.out.println(PRESETS.size()); | |
System.out.println(PRESETS.get(0).name); | |
} | |
} |
Author
hube12
commented
Feb 18, 2021
Caused by: java.lang.IllegalAccessError: class net.minecraft.client.gui.screen.PresetsScreen$SuperflatPreset cannot access its superinterface com.seedfinding.neil.mixin.AddPresets$SuperflatPreset (net.minecraft.client.gui.screen.PresetsScreen$SuperflatPreset and com.seedfinding.neil.mixin.AddPresets$SuperflatPreset are in unnamed module of loader net.fabricmc.loader.launch.knot.KnotClassLoader @67545b57)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment