本文整理汇总了Java中net.minecraft.item.ItemArmor.getArmorMaterial方法的典型用法代码示例。如果您正苦于以下问题:Java ItemArmor.getArmorMaterial方法的具体用法?Java ItemArmor.getArmorMaterial怎么用?Java ItemArmor.getArmorMaterial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.item.ItemArmor
的用法示例。
在下文中一共展示了ItemArmor.getArmorMaterial方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matches
import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack itemstack = null;
List<ItemStack> list = Lists.<ItemStack>newArrayList();
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack1 = inv.getStackInSlot(i);
if (itemstack1 != null)
{
if (itemstack1.getItem() instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)itemstack1.getItem();
if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || itemstack != null)
{
return false;
}
itemstack = itemstack1;
}
else
{
if (itemstack1.getItem() != Items.dye)
{
return false;
}
list.add(itemstack1);
}
}
}
return itemstack != null && !list.isEmpty();
}
示例2: renderLayer
import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
private void renderLayer(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float p_177182_4_, float p_177182_5_, float p_177182_6_, float p_177182_7_, float p_177182_8_, int armorSlot)
{
ItemStack itemstack = this.getCurrentArmor(entitylivingbaseIn, armorSlot);
if (itemstack != null && itemstack.getItem() instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)itemstack.getItem();
T t = this.func_177175_a(armorSlot);
t.setModelAttributes(this.renderer.getMainModel());
t.setLivingAnimations(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_4_);
this.func_177179_a(t, armorSlot);
boolean flag = this.isSlotForLeggings(armorSlot);
this.renderer.bindTexture(this.getArmorResource(itemarmor, flag));
switch (itemarmor.getArmorMaterial())
{
case LEATHER:
int i = itemarmor.getColor(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
GlStateManager.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha);
t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, "overlay"));
case CHAIN:
case IRON:
case GOLD:
case DIAMOND:
GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha);
t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
default:
if (!this.field_177193_i && itemstack.isItemEnchanted())
{
this.func_177183_a(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, p_177182_4_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
}
}
}
}
示例3: matches
import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack itemstack = ItemStack.field_190927_a;
List<ItemStack> list = Lists.<ItemStack>newArrayList();
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack1 = inv.getStackInSlot(i);
if (!itemstack1.func_190926_b())
{
if (itemstack1.getItem() instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)itemstack1.getItem();
if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || !itemstack.func_190926_b())
{
return false;
}
itemstack = itemstack1;
}
else
{
if (itemstack1.getItem() != Items.DYE)
{
return false;
}
list.add(itemstack1);
}
}
}
return !itemstack.func_190926_b() && !list.isEmpty();
}
示例4: matches
import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack itemstack = null;
List<ItemStack> list = Lists.<ItemStack>newArrayList();
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack1 = inv.getStackInSlot(i);
if (itemstack1 != null)
{
if (itemstack1.getItem() instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)itemstack1.getItem();
if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || itemstack != null)
{
return false;
}
itemstack = itemstack1;
}
else
{
if (itemstack1.getItem() != Items.DYE)
{
return false;
}
list.add(itemstack1);
}
}
}
return itemstack != null && !list.isEmpty();
}
示例5: getModelTextures
import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
private String[] getModelTextures()
{
if (this.type == 1 && this.items.length == 1)
{
Item item = Item.getItemById(this.items[0]);
if (item == Items.potionitem && this.damage != null && this.damage.getCountRanges() > 0)
{
RangeInt rangeint = this.damage.getRange(0);
int i = rangeint.getMin();
boolean flag = (i & 16384) != 0;
String s5 = this.getMapTexture(this.mapTextures, "texture.potion_overlay", "items/potion_overlay");
String s6 = null;
if (flag)
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_splash", "items/potion_bottle_splash");
}
else
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_drinkable", "items/potion_bottle_drinkable");
}
return new String[] {s5, s6};
}
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER)
{
String s = "leather";
String s1 = "helmet";
if (itemarmor.armorType == 0)
{
s1 = "helmet";
}
if (itemarmor.armorType == 1)
{
s1 = "chestplate";
}
if (itemarmor.armorType == 2)
{
s1 = "leggings";
}
if (itemarmor.armorType == 3)
{
s1 = "boots";
}
String s2 = s + "_" + s1;
String s3 = this.getMapTexture(this.mapTextures, "texture." + s2, "items/" + s2);
String s4 = this.getMapTexture(this.mapTextures, "texture." + s2 + "_overlay", "items/" + s2 + "_overlay");
return new String[] {s3, s4};
}
}
}
return new String[] {this.texture};
}
示例6: getModelTextures
import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
private String[] getModelTextures()
{
if (this.type == 1 && this.items.length == 1)
{
Item item = Item.getItemById(this.items[0]);
boolean flag = item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION;
if (flag && this.damage != null && this.damage.getCountRanges() > 0)
{
RangeInt rangeint = this.damage.getRange(0);
int i = rangeint.getMin();
boolean flag1 = (i & 16384) != 0;
String s5 = this.getMapTexture(this.mapTextures, "texture.potion_overlay", "items/potion_overlay");
String s6 = null;
if (flag1)
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_splash", "items/potion_bottle_splash");
}
else
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_drinkable", "items/potion_bottle_drinkable");
}
return new String[] {s5, s6};
}
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER)
{
String s = "leather";
String s1 = "helmet";
if (itemarmor.armorType == EntityEquipmentSlot.HEAD)
{
s1 = "helmet";
}
if (itemarmor.armorType == EntityEquipmentSlot.CHEST)
{
s1 = "chestplate";
}
if (itemarmor.armorType == EntityEquipmentSlot.LEGS)
{
s1 = "leggings";
}
if (itemarmor.armorType == EntityEquipmentSlot.FEET)
{
s1 = "boots";
}
String s2 = s + "_" + s1;
String s3 = this.getMapTexture(this.mapTextures, "texture." + s2, "items/" + s2);
String s4 = this.getMapTexture(this.mapTextures, "texture." + s2 + "_overlay", "items/" + s2 + "_overlay");
return new String[] {s3, s4};
}
}
}
return new String[] {this.texture};
}
示例7: matches
import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
@Override
public boolean matches(InventoryCrafting inv, World worldIn) {
ItemStack itemStack = ItemStack.EMPTY;
List<ItemStack> dyes = Lists.<ItemStack>newArrayList();
for (int i = 0; i < inv.getSizeInventory(); ++i) {
ItemStack itemstack = inv.getStackInSlot(i);
if (!itemstack.isEmpty()) {
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor armor = (ItemArmor)itemstack.getItem();
if (armor.getArmorMaterial() != ModArmor.materialJello || !itemStack.isEmpty()) {
return false;
}
itemStack = itemstack;
}
else {
if (itemstack.getItem() != Items.DYE) {
return false;
}
dyes.add(itemstack);
}
}
}
return !itemStack.isEmpty() && !dyes.isEmpty();
}