gpt4 book ai didi

java - 字节码编译错误

转载 作者:行者123 更新时间:2023-12-01 04:38:51 26 4
gpt4 key购买 nike

我正在使用程序 JBE(Java 字节码编辑器)http://set.ee/jbe我有以下字节码,但由于

,它一直输出错误
Error: Argument type error at line 53, instruction "ldc"
Error: Syntax error at line 54, instruction """
Error: Argument type error at line 100, instruction "ldc"
Error: Syntax error at line 101, instruction """
Error: Argument type error at line 154, instruction "ldc"
Error: Syntax error at line 155, instruction """
Error: Argument type error at line 206, instruction "ldc"
Error: Syntax error at line 207, instruction """

例如前两个错误指的是

ldc ");
"

我明白为什么这会导致错误,但如何在末尾插入\r\n

说明

getstatic BlockResources/instance LBlockResources;
aload_0
invokevirtual BlockBase/GetTypeID()I
invokevirtual BlockResources/getTextureMappingData(I)LTextureMappingData;
astore_2
aload_0
invokevirtual BlockBase/GetMeta()I
ifne 103
iload_1
ifeq 57
new java/lang/StringBuilder
dup
ldc " world.setBlockWithNotify(i + "
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
aload_0
invokevirtual BlockBase/GetX()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", j + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetY()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", k + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetZ()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_2
ifnull 39
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ifnull 39
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ldc ""
if_acmpne 43
aload_0
invokevirtual BlockBase/GetTypeID()I
invokestatic java/lang/Integer/valueOf(I)Ljava/lang/Integer;
goto 52
new java/lang/StringBuilder
dup
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
invokestatic java/lang/String/valueOf(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
ldc ".blockID"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
invokevirtual java/lang/StringBuilder/append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
ldc ");
"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
areturn
new java/lang/StringBuilder
dup
ldc " world.setBlock(i + "
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
aload_0
invokevirtual BlockBase/GetX()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", j + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetY()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", k + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetZ()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_2
ifnull 85
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ifnull 85
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ldc ""
if_acmpne 89
aload_0
invokevirtual BlockBase/GetTypeID()I
invokestatic java/lang/Integer/valueOf(I)Ljava/lang/Integer;
goto 98
new java/lang/StringBuilder
dup
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
invokestatic java/lang/String/valueOf(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
ldc ".blockID"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
invokevirtual java/lang/StringBuilder/append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
ldc ");
"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
areturn
iload_1
ifeq 156
new java/lang/StringBuilder
dup
ldc " world.setBlockAndMetadataWithNotify(i + "
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
aload_0
invokevirtual BlockBase/GetX()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", j + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetY()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", k + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetZ()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_2
ifnull 133
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ifnull 133
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ldc ""
if_acmpne 137
aload_0
invokevirtual BlockBase/GetTypeID()I
invokestatic java/lang/Integer/valueOf(I)Ljava/lang/Integer;
goto 146
new java/lang/StringBuilder
dup
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
invokestatic java/lang/String/valueOf(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
ldc ".blockID"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
invokevirtual java/lang/StringBuilder/append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
ldc ", "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetMeta()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ");
"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
areturn
new java/lang/StringBuilder
dup
ldc " world.setBlockAndMetadata(i + "
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
aload_0
invokevirtual BlockBase/GetX()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", j + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetY()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", k + "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetZ()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ", "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_2
ifnull 184
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ifnull 184
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
ldc ""
if_acmpne 188
aload_0
invokevirtual BlockBase/GetTypeID()I
invokestatic java/lang/Integer/valueOf(I)Ljava/lang/Integer;
goto 197
new java/lang/StringBuilder
dup
aload_2
invokevirtual TextureMappingData/getSpawnCode()Ljava/lang/String;
invokestatic java/lang/String/valueOf(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java/lang/StringBuilder/<init>(Ljava/lang/String;)V
ldc ".blockID"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
invokevirtual java/lang/StringBuilder/append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
ldc ", "
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload_0
invokevirtual BlockBase/GetMeta()I
invokevirtual java/lang/StringBuilder/append(I)Ljava/lang/StringBuilder;
ldc ");
"
invokevirtual java/lang/StringBuilder/append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java/lang/StringBuilder/toString()Ljava/lang/String;
areturn

最佳答案

就像你写的一样简单。例如将第 53 行修改为 ldc ");\r\n"

关于java - 字节码编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16947679/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com