Refactoring challenge selection and updating.
This commit is contained in:
parent
0e1a14a0c3
commit
1f22883c13
@ -1 +1 @@
|
|||||||
[[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Nautilus.Game.Arcade","type":"PROJECT","hints":{"PROJECT_NAME":"Nautilus.Game.Arcade"}},"ABSENT"],[{"location":"C:\\Program Files\\Java\\jre1.8.0_51","type":"JRE","hints":{}},"jre:jre:1.8.0"],[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Libraries\\craftbukkit.jar","type":"JAR","hints":{}},"ABSENT"]]
|
[[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Libraries\\craftbukkit.jar","type":"JAR","hints":{}},"ABSENT"],[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Nautilus.Game.Arcade","type":"PROJECT","hints":{"PROJECT_NAME":"Nautilus.Game.Arcade"}},"ABSENT"],[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Mineplex.Core.Common","type":"PROJECT","hints":{"PROJECT_NAME":"Mineplex.Core.Common"}},"ABSENT"]]
|
@ -75,8 +75,8 @@ org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
|||||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
org.eclipse.jdt.core.formatter.continuation_indentation=1
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1
|
||||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||||
|
@ -145,7 +145,7 @@ public abstract class Challenge implements Listener
|
|||||||
_places = (int) Math.ceil(getChallengers().size() / 2D);
|
_places = (int) Math.ceil(getChallengers().size() / 2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean finish()
|
public boolean canFinish()
|
||||||
{
|
{
|
||||||
boolean maxTimeReached = UtilTime.elapsed(_startTime, _duration);
|
boolean maxTimeReached = UtilTime.elapsed(_startTime, _duration);
|
||||||
ArrayList<Player> players = getChallengers();
|
ArrayList<Player> players = getChallengers();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package nautilus.game.arcade.game.games.mineware;
|
package nautilus.game.arcade.game.games.mineware;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -130,7 +131,7 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
||||||
|
|
||||||
private boolean _crumbling = false;
|
private boolean _crumbling = false;
|
||||||
private boolean _waitingChallenge = true;
|
private boolean _waiting = true;
|
||||||
private boolean _messagesSent = false;
|
private boolean _messagesSent = false;
|
||||||
private boolean _sendingMessages = false;
|
private boolean _sendingMessages = false;
|
||||||
private boolean _challengeStarted = false;
|
private boolean _challengeStarted = false;
|
||||||
@ -247,14 +248,11 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
public Challenge selectChallenge()
|
public Challenge selectChallenge()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _challenges.size() * 4; i++)
|
for (int i = 0; i < _challenges.size() * 4; i++)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (_challengesCopy.isEmpty())
|
if (_challengesCopy.isEmpty())
|
||||||
_challengesCopy.addAll(_challenges);
|
_challengesCopy.addAll(_challenges);
|
||||||
|
|
||||||
Challenge challenge = UtilMath.randomElement(_challengesCopy).getConstructor(MineWare.class)
|
Challenge challenge = getChallengeInstance();
|
||||||
.newInstance(this);
|
|
||||||
|
|
||||||
if (getChallengers().size() >= challenge.getMinPlayers())
|
if (getChallengers().size() >= challenge.getMinPlayers())
|
||||||
{
|
{
|
||||||
@ -273,17 +271,26 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Challenge getChallengeInstance()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return UtilMath.randomElement(_challengesCopy).getConstructor(MineWare.class).newInstance(this);
|
||||||
|
}
|
||||||
|
catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
|
||||||
|
| SecurityException e)
|
||||||
{
|
{
|
||||||
System.out.println("There was a problem loading a new challenge.");
|
System.out.println("There was a problem loading a new challenge.");
|
||||||
System.out.println("Error: " + e.getMessage());
|
System.out.println("Error: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChallengeUpdate(UpdateEvent event)
|
public void onChallengeUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
@ -305,50 +312,20 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
if (!UtilTime.elapsed(_challengeTime, 1500))
|
if (!UtilTime.elapsed(_challengeTime, 1500))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (Player player : GetPlayers(false))
|
resetDeadPlayers();
|
||||||
if (_lives.containsKey(player) && _lives.get(player) > 0)
|
|
||||||
Manager.Clear(player);
|
|
||||||
|
|
||||||
_challenge = selectChallenge();
|
_challenge = selectChallenge();
|
||||||
|
|
||||||
if (_challenge == null)
|
keepSearchingIfNull(_challenge);
|
||||||
{
|
|
||||||
UtilServer.broadcast(F.main(GetName(),
|
|
||||||
"No suitable challenge, " + _challengesCopy.size() + " challenges remaining."));
|
|
||||||
|
|
||||||
_challengesCopy.clear();
|
resetLastChallengeMap();
|
||||||
_challengesCopy.addAll(_challenges);
|
|
||||||
_challenge = selectChallenge();
|
|
||||||
|
|
||||||
if (_challenge == null)
|
|
||||||
{
|
|
||||||
SetState(GameState.Dead);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Block block : _lastOrderBlocks)
|
|
||||||
{
|
|
||||||
if (block.getState() instanceof InventoryHolder)
|
|
||||||
{
|
|
||||||
InventoryHolder holder = (InventoryHolder) block.getState();
|
|
||||||
holder.getInventory().clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
block.setTypeIdAndData(Material.AIR.getId(), (byte) 0, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (_currentCrumble == true)
|
|
||||||
|
|
||||||
_crumbling = false;
|
_crumbling = false;
|
||||||
_deathEffect.removeSpawnedEntities();
|
_deathEffect.removeSpawnedEntities();
|
||||||
_challenge.generateRoom();
|
_challenge.generateRoom();
|
||||||
|
|
||||||
ArrayList<Location> spawns = _challenge.getSpawns();
|
ArrayList<Location> spawns = setupChallengeSpawnLocations();
|
||||||
_playersTeam.SetSpawns(_challenge.getSpawns());
|
ArrayList<Location> selectedSpawnpoints = new ArrayList<Location>();
|
||||||
SpectatorSpawn = UtilWorld.averageLocation(spawns).add(0, 7, 0);
|
|
||||||
|
|
||||||
ArrayList<Location> toTeleport = new ArrayList<Location>();
|
|
||||||
|
|
||||||
for (int i = 0; i < spawns.size(); i++)
|
for (int i = 0; i < spawns.size(); i++)
|
||||||
{
|
{
|
||||||
@ -357,12 +334,12 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
|
|
||||||
for (Location spawn : spawns)
|
for (Location spawn : spawns)
|
||||||
{
|
{
|
||||||
if (toTeleport.contains(spawn))
|
if (selectedSpawnpoints.contains(spawn))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
double dist = 0;
|
double dist = 0;
|
||||||
|
|
||||||
for (Location loc : toTeleport)
|
for (Location loc : selectedSpawnpoints)
|
||||||
dist += loc.distance(spawn);
|
dist += loc.distance(spawn);
|
||||||
|
|
||||||
if (furthest == null || furthestDist < dist)
|
if (furthest == null || furthestDist < dist)
|
||||||
@ -372,28 +349,11 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toTeleport.add(furthest);
|
selectedSpawnpoints.add(furthest);
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
teleportPlayersToSpawnpoints(selectedSpawnpoints);
|
||||||
|
teleportSpectatorsToSpawn();
|
||||||
for (Player player : getChallengers())
|
|
||||||
{
|
|
||||||
player.teleport(toTeleport.get(i++));
|
|
||||||
|
|
||||||
if (i >= toTeleport.size())
|
|
||||||
i = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Player player : GetPlayers(false))
|
|
||||||
if (!IsAlive(player))
|
|
||||||
{
|
|
||||||
if (_chickenTeam != null)
|
|
||||||
if (_chickenTeam.HasPlayer(player))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
player.teleport(SpectatorSpawn);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_challenge instanceof ChallengeSeperateRooms)
|
if (_challenge instanceof ChallengeSeperateRooms)
|
||||||
{
|
{
|
||||||
@ -402,46 +362,24 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
}
|
}
|
||||||
|
|
||||||
_challengeTime = System.currentTimeMillis();
|
_challengeTime = System.currentTimeMillis();
|
||||||
_waitingChallenge = true;
|
_waiting = true;
|
||||||
}
|
}
|
||||||
else if (_waitingChallenge)
|
else if (_waiting)
|
||||||
{
|
{
|
||||||
if (!UtilTime.elapsed(_challengeTime, 1000))
|
if (!UtilTime.elapsed(_challengeTime, 1000))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_sendingMessages && !_messagesSent)
|
if (!_sendingMessages && !_messagesSent)
|
||||||
{
|
{
|
||||||
for (Player player : GetPlayers(true))
|
startChallengeDescriptionThread();
|
||||||
{
|
|
||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Integer.MAX_VALUE, 1));
|
|
||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread newThread = new Thread(new Runnable()
|
// return;
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
showChallengeDescription(_challenge);
|
|
||||||
}
|
}
|
||||||
});
|
else if (_messagesSent)
|
||||||
|
{
|
||||||
|
removeEffectsFromPlayers();
|
||||||
|
|
||||||
newThread.start();
|
_waiting = false;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_messagesSent)
|
|
||||||
{
|
|
||||||
for (Player player : GetPlayers(true))
|
|
||||||
{
|
|
||||||
if (player.hasPotionEffect(PotionEffectType.BLINDNESS))
|
|
||||||
{
|
|
||||||
player.removePotionEffect(PotionEffectType.BLINDNESS);
|
|
||||||
player.removePotionEffect(PotionEffectType.NIGHT_VISION);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_waitingChallenge = false;
|
|
||||||
_challengeStarted = true;
|
_challengeStarted = true;
|
||||||
|
|
||||||
_challenge.start();
|
_challenge.start();
|
||||||
@ -453,11 +391,11 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_challenge.finish())
|
if (_challenge.canFinish())
|
||||||
{
|
{
|
||||||
if (_challenge.canCrumble() && !_challenge.getModifiedBlocks().isEmpty())
|
if (canStartCrumbling())
|
||||||
{
|
{
|
||||||
if (!_crumbling && _challenge.getLost().size() >= _challenge.getCurrentPlaying().size() / 2)
|
if (justStartedCrumbling())
|
||||||
{
|
{
|
||||||
_crumbling = true;
|
_crumbling = true;
|
||||||
|
|
||||||
@ -468,21 +406,142 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
UtilPlayer.message(player,
|
UtilPlayer.message(player,
|
||||||
F.main(GetName(), "Challenge ends when there's only 1 player alive."));
|
F.main(GetName(), "Challenge ends when there's only 1 player alive."));
|
||||||
}
|
}
|
||||||
else
|
else if (canEndChallengeFromCrumble())
|
||||||
{
|
|
||||||
if ((_challenge.getCurrentPlaying().size() - _challenge.getLost().size()) <= 1 && _crumbling)
|
|
||||||
{
|
{
|
||||||
endCurrentChallenge();
|
endCurrentChallenge();
|
||||||
_crumbling = false;
|
_crumbling = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
endCurrentChallenge();
|
endCurrentChallenge();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
updateChallengeTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetDeadPlayers()
|
||||||
|
{
|
||||||
|
for (Player player : GetPlayers(false))
|
||||||
|
if (_lives.containsKey(player) && _lives.get(player) > 0)
|
||||||
|
Manager.Clear(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
private void resetLastChallengeMap()
|
||||||
|
{
|
||||||
|
for (Block block : _lastOrderBlocks)
|
||||||
|
{
|
||||||
|
if (block.getState() instanceof InventoryHolder)
|
||||||
|
{
|
||||||
|
InventoryHolder holder = (InventoryHolder) block.getState();
|
||||||
|
holder.getInventory().clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
block.setTypeIdAndData(Material.AIR.getId(), (byte) 0, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<Location> setupChallengeSpawnLocations()
|
||||||
|
{
|
||||||
|
ArrayList<Location> spawns = _challenge.getSpawns();
|
||||||
|
_playersTeam.SetSpawns(spawns);
|
||||||
|
SpectatorSpawn = UtilWorld.averageLocation(spawns).add(0, 7.0D, 0);
|
||||||
|
return spawns;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void teleportSpectatorsToSpawn()
|
||||||
|
{
|
||||||
|
for (Player player : GetPlayers(false))
|
||||||
|
{
|
||||||
|
if (!IsAlive(player))
|
||||||
|
{
|
||||||
|
if (_chickenTeam != null)
|
||||||
|
if (_chickenTeam.HasPlayer(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
player.teleport(SpectatorSpawn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void keepSearchingIfNull(Challenge challenge)
|
||||||
|
{
|
||||||
|
if (_challenge == null)
|
||||||
|
{
|
||||||
|
UtilServer.broadcast(F.main(GetName(), "No suitable challenge was found."));
|
||||||
|
|
||||||
|
_challengesCopy.clear();
|
||||||
|
_challengesCopy.addAll(_challenges);
|
||||||
|
_challenge = selectChallenge();
|
||||||
|
|
||||||
|
if (_challenge == null)
|
||||||
|
{
|
||||||
|
SetState(GameState.Dead);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void teleportPlayersToSpawnpoints(ArrayList<Location> spawnpoints)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
for (Player player : getChallengers())
|
||||||
|
{
|
||||||
|
player.teleport(spawnpoints.get(i++));
|
||||||
|
|
||||||
|
if (i >= spawnpoints.size())
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startChallengeDescriptionThread()
|
||||||
|
{
|
||||||
|
Thread thread = new Thread(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
showChallengeDescription(_challenge);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void removeEffectsFromPlayers()
|
||||||
|
{
|
||||||
|
for (Player player : GetPlayers(true))
|
||||||
|
{
|
||||||
|
if (player.hasPotionEffect(PotionEffectType.BLINDNESS) && player.hasPotionEffect(PotionEffectType.NIGHT_VISION))
|
||||||
|
{
|
||||||
|
player.removePotionEffect(PotionEffectType.BLINDNESS);
|
||||||
|
player.removePotionEffect(PotionEffectType.NIGHT_VISION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean canStartCrumbling()
|
||||||
|
{
|
||||||
|
return _challenge.canCrumble() && !_challenge.getModifiedBlocks().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean justStartedCrumbling()
|
||||||
|
{
|
||||||
|
return !_crumbling && _challenge.getLost().size() >= _challenge.getCurrentPlaying().size() / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean canEndChallengeFromCrumble()
|
||||||
|
{
|
||||||
|
return (_challenge.getCurrentPlaying().size() - _challenge.getLost().size()) <= 1 && _crumbling;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateChallengeTimer()
|
||||||
{
|
{
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
@ -501,13 +560,27 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void endCurrentChallenge()
|
public void endCurrentChallenge()
|
||||||
{
|
{
|
||||||
_challengeTime = System.currentTimeMillis();
|
_challengeTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
resetPlayersOnChallengeEnding();
|
||||||
|
|
||||||
|
Manager.getPluginManager().callEvent(new ChallengeEndEvent(_challenge));
|
||||||
|
HandlerList.unregisterAll(_challenge);
|
||||||
|
|
||||||
|
_challenge.end();
|
||||||
|
_challengeStarted = false;
|
||||||
|
|
||||||
|
sortLastChallengeBlocks();
|
||||||
|
|
||||||
|
_challenge = null;
|
||||||
|
EndCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetPlayersOnChallengeEnding()
|
||||||
|
{
|
||||||
for (Player player : getChallengers())
|
for (Player player : getChallengers())
|
||||||
{
|
{
|
||||||
Manager.GetDisguise().undisguise(player);
|
Manager.GetDisguise().undisguise(player);
|
||||||
@ -519,13 +592,10 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
if (_challenge.isCompleted(player))
|
if (_challenge.isCompleted(player))
|
||||||
AddGems(player, 3, "Completed Challenge", true, true);
|
AddGems(player, 3, "Completed Challenge", true, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Manager.getPluginManager().callEvent(new ChallengeEndEvent(_challenge));
|
private void sortLastChallengeBlocks()
|
||||||
HandlerList.unregisterAll(_challenge);
|
{
|
||||||
|
|
||||||
_challenge.end();
|
|
||||||
_challengeStarted = false;
|
|
||||||
|
|
||||||
_lastOrderBlocks = new ArrayList<Block>(_challenge.getModifiedBlocks());
|
_lastOrderBlocks = new ArrayList<Block>(_challenge.getModifiedBlocks());
|
||||||
|
|
||||||
Collections.sort(_lastOrderBlocks, new Comparator<Block>()
|
Collections.sort(_lastOrderBlocks, new Comparator<Block>()
|
||||||
@ -536,9 +606,6 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
return new Integer(o2.getY()).compareTo(o1.getY());
|
return new Integer(o2.getY()).compareTo(o1.getY());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_challenge = null;
|
|
||||||
EndCheck();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -550,7 +617,7 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
if (_challenge == null)
|
if (_challenge == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_waitingChallenge)
|
if (_waiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Manager.getPluginManager().callEvent(new ChallengeEndEvent(_challenge));
|
Manager.getPluginManager().callEvent(new ChallengeEndEvent(_challenge));
|
||||||
@ -775,7 +842,7 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
if (!PrepareFreeze)
|
if (!PrepareFreeze)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_waitingChallenge)
|
if (!_waiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Location from = event.getFrom();
|
Location from = event.getFrom();
|
||||||
@ -1076,7 +1143,7 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteract(PlayerInteractEvent event)
|
public void onPlayerInteract(PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
if (!_waitingChallenge)
|
if (!_waiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -1097,7 +1164,7 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
@Override
|
@Override
|
||||||
public boolean isInsideMap(Player player)
|
public boolean isInsideMap(Player player)
|
||||||
{
|
{
|
||||||
if (_challenge != null && !_waitingChallenge)
|
if (_challenge != null && !_waiting)
|
||||||
return _challenge.isInsideMap(player);
|
return _challenge.isInsideMap(player);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1218,7 +1285,7 @@ public class MineWare extends TeamGame implements IThrown
|
|||||||
|
|
||||||
public boolean isWaitingChallenge()
|
public boolean isWaitingChallenge()
|
||||||
{
|
{
|
||||||
return _waitingChallenge;
|
return _waiting;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean areMessagesSent()
|
public boolean areMessagesSent()
|
||||||
|
Loading…
Reference in New Issue
Block a user