Jump to content

Coremod error without dev


gargan

Recommended Posts

Hi! I have done a mod to replace skin and cape with the hd support. It work perfectly in eclipse but I have always the same error when I run minecraft Forge normally, there is a crash:

[00:16:33 INFO]: Client> 2014-07-06 00:16:33 [iNFOS] [ForgeModLoader] Launching wrapped minecraft {net.minecraft.client.main.Main}

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* INSIDE OBFUSCATED AbstractClientPlayer TRANSFORMER ABOUT TO PATCH: beu

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: <init> Desc:(Labw;Ljava/lang/String;)V

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: l Desc:()V

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: p Desc:()Lbic;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: q Desc:()Lbic;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: r Desc:()Lbjo;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: s Desc:()Lbjo;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: a Desc:(Lbjo;Ljava/lang/String;)Lbic;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: b Desc:(Lbjo;Ljava/lang/String;)Lbic;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: a Desc:(Lbjo;Ljava/lang/String;Lbjo;Lbfi;)Lbic;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: d Desc:(Ljava/lang/String;)Ljava/lang/String;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Inside target method1!

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] Patching Method1 Complete!

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: e Desc:(Ljava/lang/String;)Ljava/lang/String;

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Inside target2 method!

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] Patching Method2 Complete!

[00:16:36 INFO]: Client> 2014-07-06 00:16:36 [GRAVE] [ForgeModLoader] Unable to launch

[00:16:36 INFO]: Client> java.lang.reflect.InvocationTargetException

[00:16:36 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[00:16:36 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

[00:16:36 INFO]: Client> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

[00:16:36 INFO]: Client> at java.lang.reflect.Method.invoke(Unknown Source)

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

[00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP

[00:16:36 INFO]: Client> at net.minecraft.client.main.Main.main(SourceFile:37)

[00:16:36 INFO]: Client> ... 6 more

[00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source)

[00:16:36 INFO]: Client> ... 7 more

[00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityPlayerSP

[00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass1(Native Method)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass(Unknown Source)

[00:16:36 INFO]: Client> at java.security.SecureClassLoader.defineClass(Unknown Source)

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:178)

[00:16:36 INFO]: Client> ... 9 more

[00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityPlayerSP

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source)

[00:16:36 INFO]: Client> ... 13 more

[00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/AbstractClientPlayer

[00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass1(Native Method)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass(Unknown Source)

[00:16:36 INFO]: Client> at java.security.SecureClassLoader.defineClass(Unknown Source)

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:178)

[00:16:36 INFO]: Client> ... 15 more

[00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.AbstractClientPlayer

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source)

[00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source)

[00:16:36 INFO]: Client> ... 19 more

[00:16:36 INFO]: Client> Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: bic

[00:16:36 INFO]: Client> at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source)

[00:16:36 INFO]: Client> at org.objectweb.asm.ClassWriter.a(Unknown Source)

[00:16:36 INFO]: Client> at org.objectweb.asm.Frame.a(Unknown Source)

[00:16:36 INFO]: Client> at org.objectweb.asm.Frame.a(Unknown Source)

[00:16:36 INFO]: Client> at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)

[00:16:36 INFO]: Client> at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)

[00:16:36 INFO]: Client> at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)

[00:16:36 INFO]: Client> at org.objectweb.asm.tree.ClassNode.accept(Unknown Source)

[00:16:36 INFO]: Client> at pickandcraftSkin.SkinClassTransformer.patchClassASM(SkinClassTransformer.java:157)

[00:16:36 INFO]: Client> at pickandcraftSkin.SkinClassTransformer.transform(SkinClassTransformer.java:30)

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274)

[00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172)

[00:16:36 INFO]: Client> ... 21 more

[00:16:36 INFO]: Game ended with no troubles detected (exit code 0)

 

I suppose that src are not obsfuscated but I don't understand why!

 

Link to comment
Share on other sites

Use [ spoiler ] tags for posting error logs.

 

It is generally bad practice to write comments in anything but English if you expect anyone else to have to look at your code.

 

You are modifying vanilla code. I could be wrong, but I don't believe that will work.

 

Additionally ... 1.6.4?

Link to comment
Share on other sites

It seems the mod in question in this topic is modifying the source code rather than the bytecode.

 

I have had a look at modifying bytecode - it seemed approachable, but reflection is less of a hassle for now, with what I am trying to do.

 

The information on coremods is absolutely valued and appreciated though, as many of the ideas I have for mods probably require coremods.

 

Thank you!

Link to comment
Share on other sites

Ok so I will to change to patch only parseskin.

I have a problem to optifine: We don't see the skin when optifine is installed. do you know why?

And how access to the field imageheight et imagewidht with asm?

Link to comment
Share on other sites

I want to rewrite parseUserSkin to support the hd. I think the most easy is to do this:

- I will delete all the the instructions

- I add a call to a method

- I rewrite parseUserSkin in this method

But, to do this, I need to access to the field and change their value

 

So I think use fieldvisitor to have the value of the field but I don't know how change the value and call functions in ImageBufferDownload.

Link to comment
Share on other sites

I try to patch the class line to line like in  this tutorial http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editingbut i have almost all the line to change is very laborious!

How can do this differently? I think delete all the instruction and call a function like I have do to the getSkin function but I cant because I need to change field and call metho of the class ImageBufferDownload

Link to comment
Share on other sites

I have the vanilla class ImageBufferDownload and I want to transform the vanilla function parseUserSkin (http://pastebin.com/E9burVR4) to http://pastebin.com/TSinTCsA.

So I try to change line to line like in the tutorial. But here, I have a lot of change. I think this method isn't feasible in this case.

 

I looked for a other method to change the function. I think to do this: remove all instruction in parseUserSkin and, instead of instruction add a call to a static function. But I can't do this beacause in parseUserSkin I need to call functions and change field witch are in ImageBufferDownload

Link to comment
Share on other sites

Ok But I need label to add condition

if(this.imageHeight != this.imageWidth/2){

                return null;

            }

with the opcode IFNONNULL no ? Or I must use LINENUMBER?

And what is FRAME SAME ?

 

 

the bytecode of  "this.imageWidth = par1BufferedImage.getWidth();" :

 

mv.visitVarInsn(ALOAD, 0);

mv.visitVarInsn(ALOAD, 1);

mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/image/BufferedImage", "getWidth", "()I", false);

mv.visitFieldInsn(PUTFIELD, "net/minecraft/client/renderer/ImageBufferDownload", "imageWidth", "I");

 

Why there is ALOAD 0? It serve no purpose!

Link to comment
Share on other sites

Ok!

Before to try to do the condition I try to change

            this.imageWidth = 64;

            this.imageHeight = 32;

to

            this.imageWidth = par1BufferedImage.getWidth();

            this.imageHeight = par1BufferedImage.getHeight();

So It's the bytecode of the vanilla function: http://pastebin.com/3WZ3yfnc

And I do this: http://pastebin.com/tcXz3uZx

But I have a crash http://pastebin.com/35umU3Tm

 

I don't understand why!

Link to comment
Share on other sites

Y

Your error is because you didn't load "this" onto the stack for the PUTFIELD call.

You first load the bufferedImage, then call getWidth / getHeight with INVOKEVIRTUAL.

Yes but aload 0 is alredy before bipush

 

All my problem come to targetnode affectation and bipush index. I have resolved this problem

What there are two opcode -1?

In my eclipse plugin bytecode outline I see one opcode FRAME SAME?

 

First of all: it's generally considered good practice to make comments to your code in English if you intend others to read it.

Sorry I don't think to translate my comments  ;)

 

 

I have finish to patch the function... AND I HAVE A ERROR  :'(

The crash report http://pastebin.com/7yvyMShG

obviously there is a cast problem.

My code:

http://pastebin.com/0TXer5jp

I lose hope... :(

Link to comment
Share on other sites

Oh my god AMAZING! It works! Thanks a lot for your help! thanks to you I can fix all errors!

width=165 height=85http://img15.hostingpics.net/thumbs/mini_74611620140709001037.png[/img]

 

But it I reobfbuscate I will have error no? For instance

toInjectAreaOpaque2.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/ImageBufferDownload", "imageHeight", "I"));

 

will don't work because the obuscate name of ImageBufferDownload it's bfn?

Link to comment
Share on other sites

And I have a error without eclipse, with the reobuscate class:

48:12 [iNFOS] [sTDERR] Exception in thread "Skin downloader: http://antibiotique.perso.sfr.fr/skins/gargan.png" java.lang.NoSuchFieldError: imageHeight

[00:48:12 INFO]: Client> 2014-07-09 00:48:12 [iNFOS] [sTDERR] at net.minecraft.client.renderer.ImageBufferDownload.func_78432_a(SourceFile:15)

[00:48:12 INFO]: Client> 2014-07-09 00:48:12 [iNFOS] [sTDERR] at net.minecraft.client.renderer.ThreadDownloadImageDataINNER1.run(SourceFile:76)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
    • It is an issue with quark - update it to this build: https://www.curseforge.com/minecraft/mc-mods/quark/files/3642325
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.