Obfuscate

Obfuscate

34M Downloads

build.gradle not working [MCreator]

InmoNum opened this issue ยท 7 comments

commented

@MrCrayfish
After adding 2 bits of code into the build.gradle file
repositories { maven { url = "https://www.cursemaven.com" } }
and
dependencies { minecraft 'net.minecraftforge:forge:1.16.5-36.2.20' compile fg.deobf("curse.maven:obfuscate-289380:3336021") }

Here's the image of the whole build.gradle file
https://i.imgur.com/J694mpk.png
https://i.imgur.com/J694mpk.png

and trying to run the game Mcreator gives me this message in the console..
https://i.imgur.com/WgQkw3Z.png
https://i.imgur.com/WgQkw3Z.png

I don't know if I'm putting the code in a weird place or the code itself is just wrong..
But I can't get it to work

commented

Thank you man ๐Ÿ™
Im guessing when you say runs means both client and server runs.

Also merry christmas and tnx again!

commented

repository definition doesn't go in the build script. It's just a separate one that should go above dependencies

commented

repository definition doesn't go in the build script. It's just a separate one that should go above dependencies

I did move it there after trying to have it just above dependencies but it still said
> Could not find method compile() for arguments [DefaultExternalModuleDependency{group='curse.maven', name='obfuscate-289380', version='3336021', configuration='default'}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

commented

And when I change out the compile() with implementation()
All I get is this:

[Render thread/FATAL] [mixin/]: Mixin apply failed obfuscate.mixins.json:client.ItemRendererMixin -> net.minecraft.client.renderer.ItemRenderer: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Critical injection failure: @reDIrect annotation on fireRenderGuiItem could not find any targets matching 'Lnet/minecraft/client/renderer/ItemRenderer;func_191962_a(Lnet/minecraft/item/ItemStack;IILnet/minecraft/client/renderer/model/IBakedModel;)V' in net.minecraft.client.renderer.ItemRenderer. Using refmap obfuscate.refmap.json [PREINJECT Applicator Phase -> obfuscate.mixins.json:client.ItemRendererMixin -> Prepare Injections -> -> redirect$zze000$fireRenderGuiItem(Lnet/minecraft/client/renderer/ItemRenderer;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/model/ItemCameraTransforms$TransformType;ZLcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;IILnet/minecraft/client/renderer/model/IBakedModel;)V -> Parse]
org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @reDIrect annotation on fireRenderGuiItem could not find any targets matching 'Lnet/minecraft/client/renderer/ItemRenderer;func_191962_a(Lnet/minecraft/item/ItemStack;IILnet/minecraft/client/renderer/model/IBakedModel;)V' in net.minecraft.client.renderer.ItemRenderer. Using refmap obfuscate.refmap.json [PREINJECT Applicator Phase -> obfuscate.mixins.json:client.ItemRendererMixin -> Prepare Injections -> -> redirect$zze000$fireRenderGuiItem(Lnet/minecraft/client/renderer/ItemRenderer;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/model/ItemCameraTransforms$TransformType;ZLcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;IILnet/minecraft/client/renderer/model/IBakedModel;)V -> Parse]
at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.validateTargets(InjectionInfo.java:656) ~[mixin-0.8.4.jar:0.8.4+Jenkins-b308.git-2accda5000f7602229606b39437565542cc6fba4] {}
at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.findTargets(InjectionInfo.java:587) ~[mixin-0.8.4.jar:0.8.4+Jenkins-b308.git-2accda5000f7602229606b39437565542cc6fba4] {}
at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.readAnnotation(InjectionInfo.java:330) ~[mixin-0.8.4.jar:0.8.4+Jenkins-b308.git-2accda5000f7602229606b39437565542cc6fba4] {}
at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.(InjectionInfo.java:316) ~[mixin-0.8.4.jar:0.8.4+Jenkins-b308.git-2accda5000f7602229606b39437565542cc6fba4] {}
at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.(InjectionInfo.java:308) ~[mixin-0.8.4.jar:0.8.4+Jenkins-b308.git-2accda5000f7602229606b39437565542cc6fba4] {}
at org.spongepowered.asm.mixin.injection.struct.RedirectInjectionInfo.(RedirectInjectionInfo.java:44) ~[mixin-0.8.4.jar:0.8.4+Jenkins-b308.git-2accda5000f7602229606b39437565542cc6fba4] {}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_312] {}

commented

Add these properties to your runs

property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
commented

Yeah, you're correct. Basically any library that has Mixins, you'll always want to add those properties.

commented

@MrCrayfish Sorry to be a bother, But I can't find a way to reset the animated parts once they've been animated.
Example: Standing still my the player model is holding a stance, upon crouching I want that to reset to default values.

I know this isn't the place for help but didn't know where else to go so any help would be appreciated ๐Ÿฅ‡