我一直得到错误运算符!=未定义参数类型boolean,int在我的代码上,我不知道如何解决它.错误出现在eclipse和启动时
一些帮助将不胜感激:)谢谢!
private boolean[] ctexture = new boolean[16];
public boolean[] flipTopBottom = new boolean[16];
this.ctexture[id] = connectedTexture;
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
if ((par1 <= 1) && (this.flipTopBottom[(par2 & 0xF)] != 0) //The error occurs here// && ((this.icons[(par2 & 0xF)] instanceof IconConnectedTexture))) {
return new IconConnectedTextureFlipped((IconConnectedTexture)this.icons[(par2 & 0xF)]);
}
return this.icons[(par2 & 0xF)];
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
for (int i = 0; i < 16; i++) {
if ((this.texture[i] != null) && (this.texture[i] != "")) {
if (this.ctexture[i] != 0) { //It also occurs here
this.icons[i] = new IconConnectedTexture(par1IconRegister, this.texture[i]);
} else {
this.icons[i] = par1IconRegister.registerIcon(this.texture[i]);
}
}
Run Code Online (Sandbox Code Playgroud)
Mar*_*oun 12
你有:
private boolean[] ctexture = new boolean[16];
Run Code Online (Sandbox Code Playgroud)
然后你做:
if(this.ctexture[i] != 0)
? ?
boolean int
Run Code Online (Sandbox Code Playgroud)
在Java中,你不能这样做,0是一个int,this.ctexture[i]是一个boolean.
你应该这样做:
if(this.ctexture[i]) //if true
Run Code Online (Sandbox Code Playgroud)
你在其他地方也有无效的比较,请修复它们
| 归档时间: |
|
| 查看次数: |
7830 次 |
| 最近记录: |