本文整理匯總了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);
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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));
}
示例6: getItemInMainHand
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public ItemStack getItemInMainHand() {
return getEquipment(EnumItemSlot.MAINHAND);
}
示例7: setItemInMainHand
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public void setItemInMainHand(ItemStack item) {
setEquipment(EnumItemSlot.MAINHAND, item);
}
示例8: getItemInOffHand
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public ItemStack getItemInOffHand() {
return getEquipment(EnumItemSlot.OFFHAND);
}
示例9: setItemInOffHand
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
@Override
public void setItemInOffHand(ItemStack item) {
setEquipment(EnumItemSlot.OFFHAND, item);
}
示例10: getHelmet
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public ItemStack getHelmet() {
return getEquipment(EnumItemSlot.HEAD);
}
示例11: setHelmet
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public void setHelmet(ItemStack helmet) {
setEquipment(EnumItemSlot.HEAD, helmet);
}
示例12: getChestplate
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public ItemStack getChestplate() {
return getEquipment(EnumItemSlot.CHEST);
}
示例13: setChestplate
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public void setChestplate(ItemStack chestplate) {
setEquipment(EnumItemSlot.CHEST, chestplate);
}
示例14: getLeggings
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public ItemStack getLeggings() {
return getEquipment(EnumItemSlot.LEGS);
}
示例15: setLeggings
import net.minecraft.server.EnumItemSlot; //導入依賴的package包/類
public void setLeggings(ItemStack leggings) {
setEquipment(EnumItemSlot.LEGS, leggings);
}