Skip to content

Instantly share code, notes, and snippets.

@kvverti
Created June 15, 2019 19:23
Show Gist options
  • Save kvverti/69db94dbd3d6e4329f1f2cd3c57f4b78 to your computer and use it in GitHub Desktop.
Save kvverti/69db94dbd3d6e4329f1f2cd3c57f4b78 to your computer and use it in GitHub Desktop.
/*********************************************************************************************************************************************************************************************************************/
/* SpongePowered MIXIN */
/*********************************************************************************************************************************************************************************************************************/
/* Code source : file:/home/.gradle/caches/modules-2/files-2.1/net.fabricmc/sponge-mixin/0.7.11.36/b0d9944f2b77f1ce952a1179e595037332910a82/sponge-mixin-0.7.11.36.jar */
/* Internal Version : 0.7.11 */
/* Java 8 Supported : true */
/*********************************************************************************************************************************************************************************************************************/
/* Service Name : Knot/Fabric */
/* Service Class : net.fabricmc.loader.launch.knot.MixinServiceKnot */
/*********************************************************************************************************************************************************************************************************************/
/* mixin.debug : <false> */
/* mixin.debug.export : - <true> */
/* mixin.debug.export.filter : - - <null> */
/* mixin.debug.export.decompile : - - <true> */
/* mixin.debug.export.decompile.async : - - - <true> */
/* mixin.debug.export.decompile.mergeGenericSignatures : - - - <true> */
/* mixin.debug.verify : - <false> */
/* mixin.debug.verbose : - <false> */
/* mixin.debug.countInjections : - <false> */
/* mixin.debug.strict : - <false> */
/* mixin.debug.strict.unique : - - <false> */
/* mixin.debug.strict.targets : - - <false> */
/* mixin.debug.profiler : - <false> */
/* mixin.dumpTargetOnFailure : <false> */
/* mixin.checks : <false> */
/* mixin.checks.interfaces : - <false> */
/* mixin.checks.interfaces.strict : - - <false> */
/* mixin.ignoreConstraints : <false> */
/* mixin.hotSwap : <false> */
/* mixin.env : <false> */
/* mixin.env.obf : - <false> */
/* mixin.env.disableRefMap : - <false> */
/* mixin.env.remapRefMap : - <false> */
/* mixin.env.refMapRemappingFile : - <> */
/* mixin.env.refMapRemappingEnv : - <searge> */
/* mixin.env.allowPermissiveMatch : - <false> */
/* mixin.env.ignoreRequired : - <false> */
/* mixin.env.compatLevel : - <false> */
/* mixin.env.shiftByViolation : - <warn> */
/* mixin.initialiserInjectionMode : <default> */
/*********************************************************************************************************************************************************************************************************************/
/* Detected Side : CLIENT */
/*********************************************************************************************************************************************************************************************************************/
Exception in thread "Client thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:172)
at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:129)
at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:170)
... 2 more
Caused by: java.lang.VerifyError: Bad return type
Exception Details:
Location:
net/minecraft/entity/passive/SheepEntity.getRgbColor(Lnet/minecraft/util/DyeColor;)[F @27: areturn
Reason:
Type 'java/lang/Object' (current frame, stack[0]) is not assignable to '[F' (from method signature)
Current Frame:
bci: @27
flags: { }
locals: { 'net/minecraft/util/DyeColor', 'org/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable' }
stack: { 'java/lang/Object' }
Bytecode:
0000000: bb00 3559 1236 04b7 003a 4c2a 2bb8 003e
0000010: 2bb6 0042 9900 082b b600 46b0 b200 482a
0000020: b900 4e02 00c0 004f b0
Stackmap Table:
append_frame(@28,Object[#53])
at net.minecraft.entity.EntityType.<clinit>(EntityType.java:560)
at net.minecraft.item.Items.<clinit>(Items.java:1511)
at net.minecraft.entity.EntityContextImpl.<clinit>(EntityContextImpl.java:44)
at net.minecraft.entity.EntityContext.absent(EntityContext.java:9)
at net.minecraft.block.BlockState.getOutlineShape(BlockState.java:194)
at net.minecraft.block.Block.isTranslucent(Block.java:425)
at net.minecraft.block.BlockState$ShapeCache.<init>(BlockState.java:385)
at net.minecraft.block.BlockState$ShapeCache.<init>(BlockState.java:410)
at net.minecraft.block.BlockState.initShapeCache(BlockState.java:67)
at net.minecraft.block.Blocks.<clinit>(Blocks.java:1384)
at net.minecraft.util.registry.Registry.method_10237(Registry.java:83)
at net.minecraft.util.registry.Registry.method_10238(Registry.java:235)
at java.base/java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671)
at net.minecraft.util.registry.Registry.<clinit>(Registry.java:234)
at net.minecraft.Bootstrap.initialize(Bootstrap.java:34)
at net.minecraft.client.MinecraftClient.<init>(MinecraftClient.java:355)
at net.minecraft.client.main.Main.main(Main.java:126)
... 7 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':runClient'.
> Process 'command '/usr/lib/jvm/java-11-openjdk-amd64/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
public static float[] getRgbColor(net.minecraft.util.DyeColor);
Code:
0: new #53 // class org/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable
3: dup
4: ldc #54 // String getRgbColor
6: iconst_1
7: invokespecial #58 // Method org/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable."<init>":(Ljava/lang/String;Z)V
10: astore_1
11: aload_0
12: aload_1
13: invokestatic #62 // Method handler$onRgbColor$zzo000:(Lnet/minecraft/util/DyeColor;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable;)V
16: aload_1
17: invokevirtual #66 // Method org/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable.isCancelled:()Z
20: ifeq 28
23: aload_1
24: invokevirtual #70 // Method org/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable.getReturnValue:()Ljava/lang/Object;
<missing a cast>
27: areturn
28: getstatic #72 // Field COLORS:Ljava/util/Map;
31: aload_0
32: invokeinterface #78, 2 // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
37: checkcast #79 // class "[F"
40: areturn
@Mixin(SheepEntity.class)
public abstract class SheepEntityMixin extends AnimalEntity {
private SheepEntityMixin() {
super(null, null);
}
@Inject(method = "getRgbColor(Lnet/minecraft/util/DyeColor;)[F", at = @At("HEAD"), cancellable = true)
private static void onRgbColor(DyeColor dye, CallbackInfoReturnable<float[]> info) {
int color = Colormatic.COLOR_PROPS.getProperties().getWool(dye);
if(color != 0) {
float[] colorData = new float[3];
colorData[0] = ((color >> 16) & 0xff) / 255.0f;
colorData[1] = ((color >> 8) & 0xff) / 255.0f;
colorData[2] = ((color >> 0) & 0xff) / 255.0f;
info.setReturnValue((float[])colorData);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment