1

我正在使用程序 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 """

例如前 2 个错误是指

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
4

1 回答 1

0

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

于 2013-06-05T19:21:46.667 回答