v4.32
+ PathfinderExecutor 工具 controllerLookAt(LivingEntity entity, Entity target) 方法无法使用的问题已修复 + PathfinderExecutor 工具新增四个关于寻路的方法: + setPathEntity(LivingEntity entity, Object pathEntity) + navigationMove(LivingEntity entity, LivingEntity target, double speed) + navigationMove(LivingEntity entity, LivingEntity target) + setFollowRange(LivingEntity entity, double value)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package me.skymc.taboolib.common.util;
|
||||
|
||||
/**
|
||||
* @Author sky
|
||||
* @Since 2018-09-25 15:21
|
||||
*/
|
||||
public class SimpleCounter {
|
||||
|
||||
private int timer;
|
||||
private int limit;
|
||||
|
||||
public SimpleCounter(int limit) {
|
||||
this.timer = 0;
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
if (--timer <= 0) {
|
||||
timer = limit;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user