我正在制作一个自定义装甲,在我的盔甲课中,我收到了这个错误:
ArmorE类型的方法getArmorTexture(ItemStack,Entity,int,int)必须覆盖或实现超类型方法
为什么我收到此错误?
这是我的代码:
护甲等级:
package com.domoq.EmeraldGear.armor;
import com.domoq.EmeraldGear.EmeraldGearMod;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ArmorE extends ItemArmor {
public ArmorE(ArmorMaterial part2ArmorE, int part3, int part4) {
super(part2ArmorE, part3, part4);
this.setCreativeTab(CreativeTabs.tabCombat);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int type) {
if (stack.getItem() == EmeraldGearMod.EmeraldHelmet || stack.getItem() == EmeraldGearMod.EmeraldChest || stack.getIconIndex() == EmeraldGearMod.EmeraldBoots) {
return "emeraldgearmod:textures/models/armor/ArmorL1.png";
} else if (stack.getItem() == EmeraldGearMod.EmeraldLegs) {
return "emeraldgearmod:textures/models/armor/ArmorL2.png";
} else return null;
}
} …Run Code Online (Sandbox Code Playgroud) 当我运行我的程序时,我试图使用余弦逆。所以我使用 Math.Acos()。
我愿意:
Console.WriteLine(Math.Acos(0.8).ToString());
Run Code Online (Sandbox Code Playgroud)
我想得到的价值是:36.869897645844
但我得到的值是:0.643501108793284
Math.Acos 方法有问题吗?
我见过其他人有类似的问题,但没有任何解决方案可以帮助我.
我一直在寻找一种方法:
List<int> Factors = new List<int> {2, 5, 5, 7, 2, 3};
Run Code Online (Sandbox Code Playgroud)
返回:
{7, 3};
Run Code Online (Sandbox Code Playgroud)
有什么办法可以做到这一点吗?
我有列表保证包含连续的相同元素对.有没有办法删除列表中的一半重复值(每对中的任何一个元素)?
示例#1:
采取:
{2, 2, 2, 2, 5, 5}
Run Code Online (Sandbox Code Playgroud)
并返回:
{2, 2 , 5}
Run Code Online (Sandbox Code Playgroud)
示例#2:
采取:
{8, 8, 1, 1, 5, 5, 1, 1}
Run Code Online (Sandbox Code Playgroud)
并返回:
{8, 1, 5, 1}
Run Code Online (Sandbox Code Playgroud)
无需验证元素是否实际成对出现.