Shoulder Entities Release API

This commit is contained in:
Aikar
2017-06-17 15:18:30 -04:00
parent 551d6ee71e
commit aab7ec1655
2 changed files with 56 additions and 8 deletions

View File

@@ -544,6 +544,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
this.getHandle().getCooldowns().addCooldown(CraftItemStack.asNMSCopy(item), ticks);
}
// Paper start
@Override
public org.bukkit.entity.Entity releaseLeftShoulderEntity() {
if (!getHandle().getShoulderEntityLeft().isEmpty()) {
Entity entity = getHandle().releaseLeftShoulderEntity();
if (entity != null) {
return entity.getBukkitEntity();
}
}
return null;
}
@Override
public org.bukkit.entity.Entity releaseRightShoulderEntity() {
if (!getHandle().getShoulderEntityRight().isEmpty()) {
Entity entity = getHandle().releaseRightShoulderEntity();
if (entity != null) {
return entity.getBukkitEntity();
}
}
return null;
}
// Paper end
@Override
public boolean discoverRecipe(NamespacedKey recipe) {
return this.discoverRecipes(Arrays.asList(recipe)) != 0;