mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 23:46:57 +01:00
SPIGOT-6388: Add API to get and set the state of the "Shulker" entity
By: Julian van den Berkmortel <julianvdberkmortel@outlook.com>
This commit is contained in:
parent
8cbaba0a8a
commit
1eb2ceea36
1 changed files with 12 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.world.entity.monster.EntityShulker;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
|
@ -36,4 +37,15 @@ public class CraftShulker extends CraftGolem implements Shulker {
|
|||
public void setColor(DyeColor color) {
|
||||
getHandle().getDataWatcher().set(EntityShulker.COLOR, (color == null) ? 16 : color.getWoolData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPeek() {
|
||||
return (float) getHandle().eN() / 100; // PAIL rename getPeek
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPeek(float value) {
|
||||
Preconditions.checkArgument(value >= 0 && value <= 1, "value needs to be in between or equal to 0 and 1");
|
||||
getHandle().a((int) (value * 100)); // PAIL rename setPeek
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue