36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
package com.hypixel.hytale.builtin.beds.sleep.components;
|
|
|
|
import com.hypixel.hytale.builtin.beds.BedsPlugin;
|
|
import com.hypixel.hytale.component.Component;
|
|
import com.hypixel.hytale.component.ComponentType;
|
|
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
|
|
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
|
|
|
|
public class PlayerSomnolence implements Component<EntityStore> {
|
|
public static PlayerSomnolence AWAKE = new PlayerSomnolence(PlayerSleep.FullyAwake.INSTANCE);
|
|
private PlayerSleep state = PlayerSleep.FullyAwake.INSTANCE;
|
|
|
|
public static ComponentType<EntityStore, PlayerSomnolence> getComponentType() {
|
|
return BedsPlugin.getInstance().getPlayerSomnolenceComponentType();
|
|
}
|
|
|
|
public PlayerSomnolence() {
|
|
}
|
|
|
|
public PlayerSomnolence(PlayerSleep state) {
|
|
this.state = state;
|
|
}
|
|
|
|
public PlayerSleep getSleepState() {
|
|
return this.state;
|
|
}
|
|
|
|
@NullableDecl
|
|
@Override
|
|
public Component<EntityStore> clone() {
|
|
PlayerSomnolence clone = new PlayerSomnolence();
|
|
clone.state = this.state;
|
|
return clone;
|
|
}
|
|
}
|