mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
SPIGOT-7920: Expose enderpearls of Player
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d3a23f42c3
commit
a24f08778b
1 changed files with 7 additions and 0 deletions
|
@ -34,6 +34,7 @@ import java.util.WeakHashMap;
|
|||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.advancements.AdvancementProgress;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
|
@ -172,6 +173,7 @@ import org.bukkit.craftbukkit.util.CraftChatMessage;
|
|||
import org.bukkit.craftbukkit.util.CraftLocation;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
import org.bukkit.entity.EnderPearl;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1186,6 +1188,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<EnderPearl> getEnderPearls() {
|
||||
return getHandle().getEnderPearls().stream().map((e) -> (EnderPearl) e.getBukkitEntity()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBedLocation() {
|
||||
Preconditions.checkState(isSleeping(), "Not sleeping");
|
||||
|
|
Loading…
Reference in a new issue