Skip to content
Permalink
Browse files
Add new methods in BukkitMCArmorStand
  • Loading branch information
LadyCailin committed Jun 13, 2020
1 parent cc39b8f commit 726dd6a8559dea42cfa5a6c8e358cd90de864540
Showing 1 changed file with 47 additions and 0 deletions.
@@ -16,6 +16,7 @@

import java.util.EnumMap;
import java.util.Map;
import org.bukkit.inventory.EquipmentSlot;

public class BukkitMCArmorStand extends BukkitMCLivingEntity implements MCArmorStand {

@@ -484,5 +485,51 @@ public float getBootsDropChance() {
public void setBootsDropChance(float v) {

}

@Override
public void setItem(EquipmentSlot es, ItemStack is) {
switch(es) {
case HEAD:
setHelmet(is);
return;
case CHEST:
setChestplate(is);
return;
case LEGS:
setLeggings(is);
return;
case FEET:
setBoots(is);
return;
case HAND:
setItemInMainHand(is);
return;
case OFF_HAND:
setItemInOffHand(is);
return;
default:
throw new UnsupportedOperationException("Missing case in ArmorStandEquipmentProxy.setItem!");
}
}

@Override
public ItemStack getItem(EquipmentSlot es) {
switch(es) {
case HEAD:
return getHelmet();
case CHEST:
return getChestplate();
case LEGS:
return getLeggings();
case FEET:
return getBoots();
case HAND:
return getItemInMainHand();
case OFF_HAND:
return getItemInOffHand();
default:
throw new UnsupportedOperationException("Missing case in ArmorStandEquipmentProxy.getItem!");
}
}
}
}

0 comments on commit 726dd6a

Please sign in to comment.