mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-13 11:15:57 -07:00
SPIGOT-5180: Add Villager#sleep() and #wakeup() methods
By: LelouBil <bilel.jahid@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package org.bukkit.entity;
|
|||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import org.bukkit.Keyed;
|
import org.bukkit.Keyed;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -76,6 +77,25 @@ public interface Villager extends AbstractVillager {
|
|||||||
*/
|
*/
|
||||||
public void setVillagerExperience(int experience);
|
public void setVillagerExperience(int experience);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to make this villager sleep at the given location.
|
||||||
|
* <br>
|
||||||
|
* The location must be in the current world and have a bed placed at the
|
||||||
|
* location. The villager will put its head on the specified block while
|
||||||
|
* sleeping.
|
||||||
|
*
|
||||||
|
* @param location the location of the bed
|
||||||
|
* @return whether the sleep was successful
|
||||||
|
*/
|
||||||
|
public boolean sleep(@NotNull Location location);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Causes this villager to wake up if he's currently sleeping.
|
||||||
|
*
|
||||||
|
* @throws IllegalStateException if not sleeping
|
||||||
|
*/
|
||||||
|
public void wakeup();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents Villager type, usually corresponding to what biome they spawn
|
* Represents Villager type, usually corresponding to what biome they spawn
|
||||||
* in.
|
* in.
|
||||||
|
Reference in New Issue
Block a user