标题:求解决这个 java 翻译成 class
只看楼主
a18281132
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2014-10-12
结帖率:0
已结贴  问题点数:20 回复次数:18 
求解决这个 java 翻译成 class
我用javac 他说找不到符号
package co.uk.flansmods.client.model.mw;

import co.uk.flansmods.client.model.EnumAnimationType;
import co.uk.flansmods.client.model.ModelGun;
import co.uk.flansmods.client.tmt.ModelRendererTurbo;
import co.uk.

public class ModelMP5 extends ModelGun{
    public static void main (String[]args){
        Int textureX = 64;
        Int textureY = 16;
        GunModel = new ModelRendererTurbo[6];
        GunModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY);
        GunModel[0].addBox(-1F, 4F, -0.75F, 12F, 1.0F, 1.5F);
        GunModel[1] = new ModelRendererTurbo(this, 0, 3, textureX, textureY);
        GunModel[1].addBox(-1F, 3F, -1F, 12, 1, 2);
        GunModel[2] = new ModelRendererTurbo(this, 0, 6, textureX, textureY);
        GunModel[2].addBox(-1F, 2.0F, -1F, 6, 1, 2);
        GunModel[3] = new ModelRendererTurbo(this, 26, 0, textureX, textureY);
        GunModel[3].addBox(11F, 3F, -0.5F, 1, 1, 1);
        GunModel[5] = new ModelRendererTurbo(this, 26, 0, textureX, textureY);
        GunModel[5].addBox(10F, 5F, -0.5F, 1, 1, 1);
        GunModel[4] = new ModelRendererTurbo(this, 0, 9, textureX, textureY);
        GunModel[4].addBox(-0.75F, -3F, -0.75F, 1.5F, 4F, 1.5F);
        GunModel[4].func_78793_a(1.0F, 2.0F, 0.0F);
        GunModel[4].field_78808_h = -0.5F;
        AmmoModel = new ModelRendererTurbo[2];
        AmmoModel[0] = new ModelRendererTurbo(this, 8, 9, textureX, textureY);
        AmmoModel[0].addShapeBox(3.5F, 0.0F, -0.5F, 1, 3, 1, 0.0F, -1F, 0.0F, 0.0F, 0.8F, -0.2F, 0.0F, 0.8F, -0.2F, 0.0F, -1F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
        AmmoModel[1] = new ModelRendererTurbo(this, 12, 9, textureX, textureY);
        AmmoModel[1].addShapeBox(3.5F, -3F, -0.5F, 1, 3, 1, 0.0F, -2.5F, -1F, 0.0F, 2.0F, -1.5F, 0.0F, 2.0F, -1.5F, 0.0F, -2.5F, -1F, 0.0F, -1F, 0.0F, 0.0F, 0.8F, 0.2F, 0.0F, 0.8F, 0.2F, 0.0F, -1F, 0.0F, 0.0F);
        StockAttachPoint = new Vector3f(-0.0625F, 0.21875F, 0.0F);
        DefaultStockModel = new ModelRendererTurbo[2];
        DefaultStockModel[0] = new ModelRendererTurbo(this, 16, 6, textureX, textureY);
        DefaultStockModel[0].addBox(-7F, 3F, -0.5F, 6, 1, 1);
        DefaultStockModel[1] = new ModelRendererTurbo(this, 16, 8, textureX, textureY);
        DefaultStockModel[1].addBox(-8F, 1.0F, -0.5F, 1, 3, 1);
        BarrelAttachPoint = new Vector3f(0.75F, 0.21875F, 0.0F);
        ScopeAttachPoint = new Vector3f(0.125F, 0.3125F, 0.0F);
        GunSlideDistance = 0.25F;
        animationType = EnumAnimatIonType.PISTOL_CLIP;
    }
}



这是他的内容,请大神帮忙下
搜索更多相关主题的帖子: package public import java 
2014-10-12 14:17
日知己所无
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:38
帖 子:427
专家分:2071
注 册:2014-3-22
得分:20 
是《我的世界》相关的程序吗?
应该需要co.uk.flansmods这个包里的所有的东西

我在网上只找到了com.flansmod,
能告诉我你的co.uk.flansmods包是从哪里下载的吗?
2014-10-12 16:14
日知己所无
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:38
帖 子:427
专家分:2071
注 册:2014-3-22
得分:0 
建议别用javac,用Eclipse也许能好一些
2014-10-12 16:14
a18281132
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2014-10-12
得分:0 
回复 2 楼 日知己所无
http://www.
这个是这个mod的包
我是用反编译软件把class文件变成java之后就变不会来了
求解决
2014-10-16 22:34
日知己所无
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:38
帖 子:427
专家分:2071
注 册:2014-3-22
得分:0 
回复 4 楼 a18281132
import那些语句有警告或者错误吗?
2014-10-17 21:20
a18281132
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2014-10-12
得分:0 
回复 5 楼 日知己所无
我给你文件你帮我改下吧
ModelMP5.rar (1.17 KB)
2014-10-17 22:13
日知己所无
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:38
帖 子:427
专家分:2071
注 册:2014-3-22
得分:0 
回复 6 楼 a18281132
周末有时间看看,感觉有些难度,不知道是否能解决好
2014-10-17 23:52
日知己所无
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:38
帖 子:427
专家分:2071
注 册:2014-3-22
得分:0 
回复 6 楼 a18281132
我想要下面这些包【jar文件】,你有吗?我在网上没找到……

co.uk.flansmods.*
2014-10-18 08:00
a18281132
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2014-10-12
得分:0 
回复 8 楼 日知己所无
co.rar (552.01 KB)
2014-10-18 09:34
日知己所无
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:38
帖 子:427
专家分:2071
注 册:2014-3-22
得分:0 
程序代码:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: <span style="color: #008000; text-decoration: underline;">http://kpdus.[/color]
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ModelMP5.java
package co.uk.flansmods.client.model.mw;

import co.uk.flansmods.client.model.EnumAnimationType;
import co.uk.flansmods.client.model.ModelGun;
import co.uk.flansmods.client.tmt.ModelRendererTurbo;
import co.uk.public class ModelMP5 extends ModelGun {

    public static void main(String[] args) {

        // ModelRendererTurbo extends net.minecraft.client.model.ModelRenderer
        // public ModelRendererTurbo(net.minecraft.client.model.ModelBase modelbase, int textureX, int textureY, int textureU, int textureV) {
        net.minecraft.client.model.ModelBase modelBase = new net.minecraft.client.model.ModelBase();
        
        int textureX = 64;
        int textureY = 16;
        ModelRendererTurbo GunModel[] = new ModelRendererTurbo[6];
        GunModel[0] = new ModelRendererTurbo(modelBase, 0, 0, textureX, textureY);
        GunModel[0].addBox(-1F, 4F, -0.75F, 12F, 1.0F, 1.5F);
        GunModel[1] = new ModelRendererTurbo(modelBase, 0, 3, textureX, textureY);
        GunModel[1].addBox(-1F, 3F, -1F, 12, 1, 2);
        GunModel[2] = new ModelRendererTurbo(modelBase, 0, 6, textureX, textureY);
        GunModel[2].addBox(-1F, 2.0F, -1F, 6, 1, 2);
        GunModel[3] = new ModelRendererTurbo(modelBase, 26, 0, textureX, textureY);
        GunModel[3].addBox(11F, 3F, -0.5F, 1, 1, 1);
        GunModel[5] = new ModelRendererTurbo(modelBase, 26, 0, textureX, textureY);
        GunModel[5].addBox(10F, 5F, -0.5F, 1, 1, 1);
        GunModel[4] = new ModelRendererTurbo(modelBase, 0, 9, textureX, textureY);
        GunModel[4].addBox(-0.75F, -3F, -0.75F, 1.5F, 4F, 1.5F);
        GunModel[4].func_78793_a(1.0F, 2.0F, 0.0F);
        GunModel[4].field_78808_h = -0.5F;
        ModelRendererTurbo AmmoModel[] = new ModelRendererTurbo[2];
        AmmoModel[0] = new ModelRendererTurbo(modelBase, 8, 9, textureX, textureY);
        AmmoModel[0].addShapeBox(3.5F, 0.0F, -0.5F, 1, 3, 1, 0.0F, -1F, 0.0F, 0.0F, 0.8F, -0.2F, 0.0F, 0.8F, -0.2F, 0.0F, -1F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
        AmmoModel[1] = new ModelRendererTurbo(modelBase, 12, 9, textureX, textureY);
        AmmoModel[1].addShapeBox(3.5F, -3F, -0.5F, 1, 3, 1, 0.0F, -2.5F, -1F, 0.0F, 2.0F, -1.5F, 0.0F, 2.0F, -1.5F, 0.0F, -2.5F, -1F, 0.0F, -1F, 0.0F, 0.0F, 0.8F, 0.2F, 0.0F, 0.8F, 0.2F, 0.0F, -1F, 0.0F, 0.0F);
        Vector3f StockAttachPoint = new Vector3f(-0.0625F, 0.21875F, 0.0F);
        ModelRendererTurbo DefaultStockModel[] = new ModelRendererTurbo[2];
        DefaultStockModel[0] = new ModelRendererTurbo(modelBase, 16, 6, textureX, textureY);
        DefaultStockModel[0].addBox(-7F, 3F, -0.5F, 6, 1, 1);
        DefaultStockModel[1] = new ModelRendererTurbo(modelBase, 16, 8, textureX, textureY);
        DefaultStockModel[1].addBox(-8F, 1.0F, -0.5F, 1, 3, 1);
        Vector3f BarrelAttachPoint = new Vector3f(0.75F, 0.21875F, 0.0F);
        Vector3f ScopeAttachPoint = new Vector3f(0.125F, 0.3125F, 0.0F);
        float GunSlideDistance = 0.25F;
        EnumAnimationType animationType = EnumAnimationType.PISTOL_CLIP;
    }
}


稍微改动了一些,虽然还是编译不过去,但是大体上知道原因了
原来代码中的this都是net.minecraft.client.model.ModelBase modelbase类型的,所以还额外需要net.minecraft.client包下的所有的jar
另外ModelRendererTurbo里并没有func_78793_a和field_78808_h这两个成员的定义,我推测是co.uk.flansmods的版本和自己写的Java代码的版本没有完全对上
这两个问题解决之后,估计编译应该没问题了;是否能运行还得看代码的正确性
2014-10-18 13:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-437149-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.233064 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved