Cancel warmup on damage or movement

This commit is contained in:
Paul Sauve
2015-05-24 23:42:31 -05:00
committed by drtshock
parent fc1d08e507
commit 1481d604d4
10 changed files with 95 additions and 14 deletions

View File

@@ -50,7 +50,7 @@ public class CmdFWarp extends FCommand {
if (!transact(fme)) {
return;
}
this.doWarmUp(TL.WARMUPS_NOTIFY_TELEPORT, warpName, new Runnable() {
this.doWarmUp(WarmUpUtil.Warmup.WARP, TL.WARMUPS_NOTIFY_TELEPORT, warpName, new Runnable() {
@Override
public void run() {
CmdFWarp.this.fme.getPlayer().teleport(CmdFWarp.this.myFaction.getWarp(warpName).getLocation());

View File

@@ -5,6 +5,7 @@ import com.massivecraft.factions.integration.Essentials;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.WarmUpUtil;
import com.massivecraft.factions.zcore.util.SmokeUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Location;
@@ -110,7 +111,7 @@ public class CmdHome extends FCommand {
return;
}
this.doWarmUp(TL.WARMUPS_NOTIFY_TELEPORT, "Home", new Runnable() {
this.doWarmUp(WarmUpUtil.Warmup.HOME, TL.WARMUPS_NOTIFY_TELEPORT, "Home", new Runnable() {
@Override
public void run() {
// Create a smoke effect

View File

@@ -302,11 +302,11 @@ public abstract class FCommand extends MCommand<P> {
}
}
public void doWarmUp(TL translationKey, String action, Runnable runnable, long delay) {
this.doWarmUp(this.fme, translationKey, action, runnable, delay);
public void doWarmUp(WarmUpUtil.Warmup warmup, TL translationKey, String action, Runnable runnable, long delay) {
this.doWarmUp(this.fme, warmup, translationKey, action, runnable, delay);
}
public void doWarmUp(FPlayer player, TL translationKey, String action, Runnable runnable, long delay) {
WarmUpUtil.process(player, translationKey, action, runnable, delay);
public void doWarmUp(FPlayer player, WarmUpUtil.Warmup warmup, TL translationKey, String action, Runnable runnable, long delay) {
WarmUpUtil.process(player, warmup, translationKey, action, runnable, delay);
}
}