Sleeping system changes

This commit is contained in:
Anuken
2018-07-19 18:10:29 -04:00
parent bcf72b894d
commit 882790d133
4 changed files with 16 additions and 3 deletions
@@ -103,6 +103,17 @@ public class TileEntity extends BaseEntity implements TargetTrait{
* If the entity was sleeping, this enables it. This also resets the sleep timer.
*/
public void wakeUp(){
noSleep();
for(Tile tile : proximity){
if(tile.entity.isSleeping()){
tile.entity.wakeUp();
}
}
}
/**Call when this entity is updating. This wakes it up.*/
public void noSleep(){
sleepTime = 0f;
if(sleeping){
add();