增加一些动作/结构并且补注释:( 呜呜呜补注释好累头号疼
This commit is contained in:
35
src/main/java/top/sunsetlab/actions/CastDelay.java
Normal file
35
src/main/java/top/sunsetlab/actions/CastDelay.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package top.sunsetlab.actions;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/// 施放延迟
|
||||
public class CastDelay implements IActionBase{
|
||||
/**
|
||||
* 调用动作
|
||||
* @param location 动作执行位置
|
||||
* @param caller 动作执行者
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean call(Location location, Player caller) {
|
||||
int count = 0;
|
||||
while (count < 50) {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
}catch (InterruptedException ignored){}
|
||||
location.getWorld().spawnParticle(
|
||||
Particle.DUST,
|
||||
location,
|
||||
20,
|
||||
1.0,
|
||||
0.0,
|
||||
1.0,
|
||||
new Particle.DustOptions(Color.RED, 1.0f));
|
||||
count++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user