當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumItemSlot類代碼示例

本文整理匯總了Java中net.minecraft.server.EnumItemSlot的典型用法代碼示例。如果您正苦於以下問題:Java EnumItemSlot類的具體用法?Java EnumItemSlot怎麽用?Java EnumItemSlot使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EnumItemSlot類屬於net.minecraft.server包,在下文中一共展示了EnumItemSlot類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: playDeathAnimation

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
private void playDeathAnimation(final Player player) {
    Bukkit.getScheduler().scheduleSyncDelayedTask(Cardinal.getInstance(), new Runnable() {
        @Override
        public void run() {
            EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle();

            List<Packet> packets = new ArrayList<>();
            for (EnumItemSlot slot : EnumItemSlot.values()) {
                packets.add(new PacketPlayOutEntityEquipment(nmsPlayer.getId(), slot,
                        net.minecraft.server.ItemStack.a));  // Removes armor, otherwise, a client-side glitch makes items
            }
            packets.add(PacketUtils.createMetadataPacket(nmsPlayer.getId(), Watchers.getHealth(0)));
            packets.add(new PacketPlayOutEntityStatus(nmsPlayer, (byte) 3));

            for (Player online : Bukkit.getOnlinePlayers()) {
                if (!online.equals(player)){
                    for (Packet packet : packets) {
                        PacketUtils.sendPacket(online, packet);
                    }
                }
            }
        }
    }, 1L);
}
 
開發者ID:twizmwazin,項目名稱:CardinalPGM,代碼行數:25,代碼來源:TitleRespawn.java

示例2: getArmorContents

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public ItemStack[] getArmorContents() {
    ItemStack[] armor = new ItemStack[]{
            getEquipment(EnumItemSlot.FEET),
            getEquipment(EnumItemSlot.LEGS),
            getEquipment(EnumItemSlot.CHEST),
            getEquipment(EnumItemSlot.HEAD),
    };
    return armor;
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:10,代碼來源:CraftEntityEquipment.java

示例3: setDropChance

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
private void setDropChance(EnumItemSlot slot, float chance) {
    if (slot == EnumItemSlot.MAINHAND || slot == EnumItemSlot.OFFHAND) {
        ((EntityInsentient) entity.getHandle()).dropChanceHand[slot.b()] = chance - 0.1F;
    } else {
        ((EntityInsentient) entity.getHandle()).dropChanceArmor[slot.b()] = chance - 0.1F;
    }
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:8,代碼來源:CraftEntityEquipment.java

示例4: getDropChance

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
private float getDropChance(EnumItemSlot slot) {
    if (slot == EnumItemSlot.MAINHAND || slot == EnumItemSlot.OFFHAND) {
        return ((EntityInsentient) entity.getHandle()).dropChanceHand[slot.b()] + 0.1F;
    } else {
        return ((EntityInsentient) entity.getHandle()).dropChanceArmor[slot.b()] + 0.1F;
    }
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:8,代碼來源:CraftEntityEquipment.java

示例5: entityHelmetPacket

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public static Packet entityHelmetPacket(int entityId, org.bukkit.inventory.ItemStack helmet) {
    return new PacketPlayOutEntityEquipment(entityId, EnumItemSlot.HEAD, CraftItemStack.asNMSCopy(helmet));
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:4,代碼來源:NMSHacks.java

示例6: getItemInMainHand

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public ItemStack getItemInMainHand() {
    return getEquipment(EnumItemSlot.MAINHAND);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:5,代碼來源:CraftEntityEquipment.java

示例7: setItemInMainHand

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public void setItemInMainHand(ItemStack item) {
    setEquipment(EnumItemSlot.MAINHAND, item);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:5,代碼來源:CraftEntityEquipment.java

示例8: getItemInOffHand

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public ItemStack getItemInOffHand() {
    return getEquipment(EnumItemSlot.OFFHAND);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:5,代碼來源:CraftEntityEquipment.java

示例9: setItemInOffHand

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public void setItemInOffHand(ItemStack item) {
    setEquipment(EnumItemSlot.OFFHAND, item);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:5,代碼來源:CraftEntityEquipment.java

示例10: getHelmet

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public ItemStack getHelmet() {
    return getEquipment(EnumItemSlot.HEAD);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:4,代碼來源:CraftEntityEquipment.java

示例11: setHelmet

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public void setHelmet(ItemStack helmet) {
    setEquipment(EnumItemSlot.HEAD, helmet);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:4,代碼來源:CraftEntityEquipment.java

示例12: getChestplate

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public ItemStack getChestplate() {
    return getEquipment(EnumItemSlot.CHEST);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:4,代碼來源:CraftEntityEquipment.java

示例13: setChestplate

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public void setChestplate(ItemStack chestplate) {
    setEquipment(EnumItemSlot.CHEST, chestplate);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:4,代碼來源:CraftEntityEquipment.java

示例14: getLeggings

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public ItemStack getLeggings() {
    return getEquipment(EnumItemSlot.LEGS);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:4,代碼來源:CraftEntityEquipment.java

示例15: setLeggings

import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public void setLeggings(ItemStack leggings) {
    setEquipment(EnumItemSlot.LEGS, leggings);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:4,代碼來源:CraftEntityEquipment.java


注:本文中的net.minecraft.server.EnumItemSlot類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。