本文整理匯總了Java中net.minecraft.inventory.EntityEquipmentSlot.FEET屬性的典型用法代碼示例。如果您正苦於以下問題:Java EntityEquipmentSlot.FEET屬性的具體用法?Java EntityEquipmentSlot.FEET怎麽用?Java EntityEquipmentSlot.FEET使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.inventory.EntityEquipmentSlot
的用法示例。
在下文中一共展示了EntityEquipmentSlot.FEET屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: func_190772_a
protected EntityEquipmentSlot func_190772_a(Vec3d p_190772_1_)
{
EntityEquipmentSlot entityequipmentslot = EntityEquipmentSlot.MAINHAND;
boolean flag = this.isSmall();
double d0 = flag ? p_190772_1_.yCoord * 2.0D : p_190772_1_.yCoord;
EntityEquipmentSlot entityequipmentslot1 = EntityEquipmentSlot.FEET;
if (d0 >= 0.1D && d0 < 0.1D + (flag ? 0.8D : 0.45D) && this.func_190630_a(entityequipmentslot1))
{
entityequipmentslot = EntityEquipmentSlot.FEET;
}
else if (d0 >= 0.9D + (flag ? 0.3D : 0.0D) && d0 < 0.9D + (flag ? 1.0D : 0.7D) && this.func_190630_a(EntityEquipmentSlot.CHEST))
{
entityequipmentslot = EntityEquipmentSlot.CHEST;
}
else if (d0 >= 0.4D && d0 < 0.4D + (flag ? 1.0D : 0.8D) && this.func_190630_a(EntityEquipmentSlot.LEGS))
{
entityequipmentslot = EntityEquipmentSlot.LEGS;
}
else if (d0 >= 1.6D && this.func_190630_a(EntityEquipmentSlot.HEAD))
{
entityequipmentslot = EntityEquipmentSlot.HEAD;
}
return entityequipmentslot;
}
示例2: preInit
public static void preInit()
{
harshen_jaguar_armor_helmet = new HarshenJaguarArmor(harshen_material, 1, EntityEquipmentSlot.HEAD, "harshen_jaguar_armor_helmet");
harshen_jaguar_armor_chestplate = new HarshenJaguarArmor(harshen_material, 1, EntityEquipmentSlot.CHEST, "harshen_jaguar_armor_chestplate");
harshen_jaguar_armor_leggings = new HarshenJaguarArmor(harshen_material, 1, EntityEquipmentSlot.LEGS, "harshen_jaguar_armor_leggings");
harshen_jaguar_armor_boots = new HarshenJaguarArmor(harshen_material, 1, EntityEquipmentSlot.FEET, "harshen_jaguar_armor_boots");
}
示例3: ItemArmorCollection
public ItemArmorCollection(ItemArmor.ArmorMaterial material){
this.material = material;
head = new Armor(material, EntityEquipmentSlot.HEAD);
chestplate = new Armor(material, EntityEquipmentSlot.CHEST);
legs = new Armor(material, EntityEquipmentSlot.LEGS);
shoes = new Armor(material, EntityEquipmentSlot.FEET);
}
示例4: getPartByPosition
@Nullable
public static EntityEquipmentSlot getPartByPosition(Entity hittingObject, EntityPlayer toTrack) {
if (testAABB(hittingObject, toTrack, HEAD_AABB))
return EntityEquipmentSlot.HEAD;
if (testAABB(hittingObject, toTrack, MAIN_AABB))
return EntityEquipmentSlot.CHEST;
if (testAABB(hittingObject, toTrack, LEG_AABB))
return EntityEquipmentSlot.LEGS;
if (testAABB(hittingObject, toTrack, FEET_AABB))
return EntityEquipmentSlot.FEET;
return null;
}
示例5: takeDamage
public static void takeDamage(EntityPlayer player, DamageSource source, float amount)
{
final float baseAmount = amount;
IExPPlayer data = IExPPlayer.of(player);
List<DamageMapping> mappings = ExPDamageMappings.provide(source);
BodyPart part = WeightedRandom.getRandomItem(player.world.rand, mappings).getPart();
EntityEquipmentSlot armorCheck = part == BodyPart.HEAD ? EntityEquipmentSlot.HEAD : part == BodyPart.ARM_LEFT || part == BodyPart.ARM_RIGHT || part == BodyPart.BODY ? EntityEquipmentSlot.CHEST : player.world.rand.nextBoolean() ? EntityEquipmentSlot.LEGS : EntityEquipmentSlot.FEET;
ItemStack armorStack = player.getItemStackFromSlot(armorCheck);
if (!armorStack.isEmpty())
{
amount = handleArmorProtection(player, source, amount, armorStack, part, armorCheck);
}
float partDamage = player.world.rand.nextFloat();
// No damage reduction was applied, player has no armor
if (baseAmount == amount)
{
partDamage *= 10;
}
data.setState(part, Math.max(0, data.getState(part) - partDamage));
// TODO bleeding, bones breaking
float actualDamage = amount * (200 + player.world.rand.nextFloat() * 50 - player.world.rand.nextFloat() * 50);
data.setHealth(data.getCurrentHealth() - actualDamage, true, true);
// Player died
if (data.getCurrentHealth() <= 0)
{
player.sendMessage(source.getDeathMessage(player));
}
}
示例6: registerEnchantments
/**
* Registers all of the vanilla enchantments.
*/
public static void registerEnchantments()
{
EntityEquipmentSlot[] aentityequipmentslot = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
REGISTRY.register(0, new ResourceLocation("protection"), new EnchantmentProtection(Enchantment.Rarity.COMMON, EnchantmentProtection.Type.ALL, aentityequipmentslot));
REGISTRY.register(1, new ResourceLocation("fire_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FIRE, aentityequipmentslot));
REGISTRY.register(2, new ResourceLocation("feather_falling"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FALL, aentityequipmentslot));
REGISTRY.register(3, new ResourceLocation("blast_protection"), new EnchantmentProtection(Enchantment.Rarity.RARE, EnchantmentProtection.Type.EXPLOSION, aentityequipmentslot));
REGISTRY.register(4, new ResourceLocation("projectile_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.PROJECTILE, aentityequipmentslot));
REGISTRY.register(5, new ResourceLocation("respiration"), new EnchantmentOxygen(Enchantment.Rarity.RARE, aentityequipmentslot));
REGISTRY.register(6, new ResourceLocation("aqua_affinity"), new EnchantmentWaterWorker(Enchantment.Rarity.RARE, aentityequipmentslot));
REGISTRY.register(7, new ResourceLocation("thorns"), new EnchantmentThorns(Enchantment.Rarity.VERY_RARE, aentityequipmentslot));
REGISTRY.register(8, new ResourceLocation("depth_strider"), new EnchantmentWaterWalker(Enchantment.Rarity.RARE, aentityequipmentslot));
REGISTRY.register(9, new ResourceLocation("frost_walker"), new EnchantmentFrostWalker(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.FEET}));
REGISTRY.register(10, new ResourceLocation("binding_curse"), new EnchantmentBindingCurse(Enchantment.Rarity.VERY_RARE, aentityequipmentslot));
REGISTRY.register(16, new ResourceLocation("sharpness"), new EnchantmentDamage(Enchantment.Rarity.COMMON, 0, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(17, new ResourceLocation("smite"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 1, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(18, new ResourceLocation("bane_of_arthropods"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 2, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(19, new ResourceLocation("knockback"), new EnchantmentKnockback(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(20, new ResourceLocation("fire_aspect"), new EnchantmentFireAspect(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(21, new ResourceLocation("looting"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.WEAPON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(22, new ResourceLocation("sweeping"), new EnchantmentSweepingEdge(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(32, new ResourceLocation("efficiency"), new EnchantmentDigging(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(33, new ResourceLocation("silk_touch"), new EnchantmentUntouching(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(34, new ResourceLocation("unbreaking"), new EnchantmentDurability(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(35, new ResourceLocation("fortune"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.DIGGER, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(48, new ResourceLocation("power"), new EnchantmentArrowDamage(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(49, new ResourceLocation("punch"), new EnchantmentArrowKnockback(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(50, new ResourceLocation("flame"), new EnchantmentArrowFire(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(51, new ResourceLocation("infinity"), new EnchantmentArrowInfinite(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(61, new ResourceLocation("luck_of_the_sea"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(62, new ResourceLocation("lure"), new EnchantmentFishingSpeed(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(70, new ResourceLocation("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EntityEquipmentSlot.values()));
REGISTRY.register(71, new ResourceLocation("vanishing_curse"), new EnchantmentVanishingCurse(Enchantment.Rarity.VERY_RARE, EntityEquipmentSlot.values()));
}
示例7: registerEnchantments
/**
* Registers all of the vanilla enchantments.
*/
public static void registerEnchantments()
{
EntityEquipmentSlot[] aentityequipmentslot = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
REGISTRY.register(0, new ResourceLocation("protection"), new EnchantmentProtection(Enchantment.Rarity.COMMON, EnchantmentProtection.Type.ALL, aentityequipmentslot));
REGISTRY.register(1, new ResourceLocation("fire_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FIRE, aentityequipmentslot));
REGISTRY.register(2, new ResourceLocation("feather_falling"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FALL, aentityequipmentslot));
REGISTRY.register(3, new ResourceLocation("blast_protection"), new EnchantmentProtection(Enchantment.Rarity.RARE, EnchantmentProtection.Type.EXPLOSION, aentityequipmentslot));
REGISTRY.register(4, new ResourceLocation("projectile_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.PROJECTILE, aentityequipmentslot));
REGISTRY.register(5, new ResourceLocation("respiration"), new EnchantmentOxygen(Enchantment.Rarity.RARE, aentityequipmentslot));
REGISTRY.register(6, new ResourceLocation("aqua_affinity"), new EnchantmentWaterWorker(Enchantment.Rarity.RARE, aentityequipmentslot));
REGISTRY.register(7, new ResourceLocation("thorns"), new EnchantmentThorns(Enchantment.Rarity.VERY_RARE, aentityequipmentslot));
REGISTRY.register(8, new ResourceLocation("depth_strider"), new EnchantmentWaterWalker(Enchantment.Rarity.RARE, aentityequipmentslot));
REGISTRY.register(9, new ResourceLocation("frost_walker"), new EnchantmentFrostWalker(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.FEET}));
REGISTRY.register(16, new ResourceLocation("sharpness"), new EnchantmentDamage(Enchantment.Rarity.COMMON, 0, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(17, new ResourceLocation("smite"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 1, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(18, new ResourceLocation("bane_of_arthropods"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 2, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(19, new ResourceLocation("knockback"), new EnchantmentKnockback(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(20, new ResourceLocation("fire_aspect"), new EnchantmentFireAspect(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(21, new ResourceLocation("looting"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.WEAPON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(32, new ResourceLocation("efficiency"), new EnchantmentDigging(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(33, new ResourceLocation("silk_touch"), new EnchantmentUntouching(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(34, new ResourceLocation("unbreaking"), new EnchantmentDurability(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(35, new ResourceLocation("fortune"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.DIGGER, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(48, new ResourceLocation("power"), new EnchantmentArrowDamage(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(49, new ResourceLocation("punch"), new EnchantmentArrowKnockback(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(50, new ResourceLocation("flame"), new EnchantmentArrowFire(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(51, new ResourceLocation("infinity"), new EnchantmentArrowInfinite(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(61, new ResourceLocation("luck_of_the_sea"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(62, new ResourceLocation("lure"), new EnchantmentFishingSpeed(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
REGISTRY.register(70, new ResourceLocation("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EntityEquipmentSlot.values()));
}
示例8: onPlayerTick
@SubscribeEvent
public void onPlayerTick(PlayerTickEvent event)
{
if (event.phase == Phase.START && !event.player.getEntityWorld().isRemote)
{
if (ticks % 10 == 0)
{
PlayerInformation playerInfo = (PlayerInformation) event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION, null);
if (playerInfo != null)
{
if (event.player.inventory.getCurrentItem() != mainhand && playerInfo.getPlayerLevel() >= NBTHelper.loadStackNBT(event.player.inventory.getCurrentItem()).getInteger("Level"))
{
updateStats(event.player, playerInfo);
mainhand = event.player.inventory.getCurrentItem();
}
for (ItemStack stack : event.player.inventory.armorInventory)
{
if (stack.getItem() instanceof ItemArmor && playerInfo.getPlayerLevel() >= NBTHelper.loadStackNBT(stack).getInteger("Level"))
{
if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.HEAD && stack != helmet)
{
updateStats(event.player, playerInfo);
helmet = stack;
}
else if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.CHEST && stack != chestplate)
{
updateStats(event.player, playerInfo);
chestplate = stack;
}
else if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.LEGS && stack != leggings)
{
updateStats(event.player, playerInfo);
leggings = stack;
}
else if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.FEET && stack != boots)
{
updateStats(event.player, playerInfo);
boots = stack;
}
}
}
}
ticks = 0;
}
if (regenTicks % 100 == 0)
{
Stats statsCap = (Stats) event.player.getCapability(CapabilityPlayerStats.STATS, null);
if (statsCap != null)
{
if (statsCap.getMana() < statsCap.getMaxMana())
{
statsCap.increaseMana(statsCap.getManaPerSecond());
}
if (event.player.getHealth() < event.player.getMaxHealth())
{
event.player.heal(statsCap.getHealthPerSecond());
}
LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap), (EntityPlayerMP) event.player);
}
regenTicks = 0;
}
ticks++;
regenTicks++;
}
}
示例9: replaceItemInInventory
public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
{
if (inventorySlot >= 0 && inventorySlot < this.inventory.mainInventory.size())
{
this.inventory.setInventorySlotContents(inventorySlot, itemStackIn);
return true;
}
else
{
EntityEquipmentSlot entityequipmentslot;
if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.HEAD;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.CHEST;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.LEGS;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.FEET.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.FEET;
}
else
{
entityequipmentslot = null;
}
if (inventorySlot == 98)
{
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, itemStackIn);
return true;
}
else if (inventorySlot == 99)
{
this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, itemStackIn);
return true;
}
else if (entityequipmentslot == null)
{
int i = inventorySlot - 200;
if (i >= 0 && i < this.theInventoryEnderChest.getSizeInventory())
{
this.theInventoryEnderChest.setInventorySlotContents(i, itemStackIn);
return true;
}
else
{
return false;
}
}
else
{
if (!itemStackIn.func_190926_b())
{
if (!(itemStackIn.getItem() instanceof ItemArmor) && !(itemStackIn.getItem() instanceof ItemElytra))
{
if (entityequipmentslot != EntityEquipmentSlot.HEAD)
{
return false;
}
}
else if (EntityLiving.getSlotForItemStack(itemStackIn) != entityequipmentslot)
{
return false;
}
}
this.inventory.setInventorySlotContents(entityequipmentslot.getIndex() + this.inventory.mainInventory.size(), itemStackIn);
return true;
}
}
}
示例10: ItemSock
public ItemSock() {
super(MATERIAL, 0, EntityEquipmentSlot.FEET);
setCreativeTab(PonySocks.tabSocks);
setUnlocalizedName("ponysocks.sock");
}
示例11: replaceItemInInventory
public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
{
EntityEquipmentSlot entityequipmentslot;
if (inventorySlot == 98)
{
entityequipmentslot = EntityEquipmentSlot.MAINHAND;
}
else if (inventorySlot == 99)
{
entityequipmentslot = EntityEquipmentSlot.OFFHAND;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.HEAD;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.CHEST;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.LEGS;
}
else
{
if (inventorySlot != 100 + EntityEquipmentSlot.FEET.getIndex())
{
return false;
}
entityequipmentslot = EntityEquipmentSlot.FEET;
}
if (!itemStackIn.func_190926_b() && !EntityLiving.isItemStackInSlot(entityequipmentslot, itemStackIn) && entityequipmentslot != EntityEquipmentSlot.HEAD)
{
return false;
}
else
{
this.setItemStackToSlot(entityequipmentslot, itemStackIn);
return true;
}
}
示例12: replaceItemInInventory
public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
{
EntityEquipmentSlot entityequipmentslot;
if (inventorySlot == 98)
{
entityequipmentslot = EntityEquipmentSlot.MAINHAND;
}
else if (inventorySlot == 99)
{
entityequipmentslot = EntityEquipmentSlot.OFFHAND;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.HEAD;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.CHEST;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.LEGS;
}
else
{
if (inventorySlot != 100 + EntityEquipmentSlot.FEET.getIndex())
{
return false;
}
entityequipmentslot = EntityEquipmentSlot.FEET;
}
if (!itemStackIn.func_190926_b() && !isItemStackInSlot(entityequipmentslot, itemStackIn) && entityequipmentslot != EntityEquipmentSlot.HEAD)
{
return false;
}
else
{
this.setItemStackToSlot(entityequipmentslot, itemStackIn);
return true;
}
}
示例13: getModelTextures
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};
}
示例14: replaceItemInInventory
public boolean replaceItemInInventory(int inventorySlot, @Nullable ItemStack itemStackIn)
{
EntityEquipmentSlot entityequipmentslot;
if (inventorySlot == 98)
{
entityequipmentslot = EntityEquipmentSlot.MAINHAND;
}
else if (inventorySlot == 99)
{
entityequipmentslot = EntityEquipmentSlot.OFFHAND;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.HEAD;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.CHEST;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.LEGS;
}
else
{
if (inventorySlot != 100 + EntityEquipmentSlot.FEET.getIndex())
{
return false;
}
entityequipmentslot = EntityEquipmentSlot.FEET;
}
if (itemStackIn != null && !EntityLiving.isItemStackInSlot(entityequipmentslot, itemStackIn) && entityequipmentslot != EntityEquipmentSlot.HEAD)
{
return false;
}
else
{
this.setItemStackToSlot(entityequipmentslot, itemStackIn);
return true;
}
}
示例15: replaceItemInInventory
public boolean replaceItemInInventory(int inventorySlot, @Nullable ItemStack itemStackIn)
{
EntityEquipmentSlot entityequipmentslot;
if (inventorySlot == 98)
{
entityequipmentslot = EntityEquipmentSlot.MAINHAND;
}
else if (inventorySlot == 99)
{
entityequipmentslot = EntityEquipmentSlot.OFFHAND;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.HEAD;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.CHEST;
}
else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
{
entityequipmentslot = EntityEquipmentSlot.LEGS;
}
else
{
if (inventorySlot != 100 + EntityEquipmentSlot.FEET.getIndex())
{
return false;
}
entityequipmentslot = EntityEquipmentSlot.FEET;
}
if (itemStackIn != null && !isItemStackInSlot(entityequipmentslot, itemStackIn) && entityequipmentslot != EntityEquipmentSlot.HEAD)
{
return false;
}
else
{
this.setItemStackToSlot(entityequipmentslot, itemStackIn);
return true;
}
}