Fix Monster Maze jumping mechanics (Fixes PC-711 and PC-634)
This commit is contained in:
parent
f6d882fcb4
commit
5e994e37da
@ -48,6 +48,8 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
import org.bukkit.scoreboard.Team;
|
import org.bukkit.scoreboard.Team;
|
||||||
|
|
||||||
public class MonsterMaze extends SoloGame
|
public class MonsterMaze extends SoloGame
|
||||||
@ -61,6 +63,9 @@ public class MonsterMaze extends SoloGame
|
|||||||
|
|
||||||
private HashMap<Player, Long> _launched = new HashMap<Player, Long>();
|
private HashMap<Player, Long> _launched = new HashMap<Player, Long>();
|
||||||
|
|
||||||
|
private static final int JUMP_POTION_AMPLIFIER = -10;
|
||||||
|
private int _potionMult = JUMP_POTION_AMPLIFIER;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public MonsterMaze(ArcadeManager manager)
|
public MonsterMaze(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
@ -260,6 +265,36 @@ public class MonsterMaze extends SoloGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onDebug(PlayerCommandPreprocessEvent event)
|
||||||
|
{
|
||||||
|
if (!event.getPlayer().isOp())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getMessage().toLowerCase().contains("/setmult "))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
Integer mult = Integer.parseInt(event.getMessage().toLowerCase().replace("/setmult ", ""));
|
||||||
|
_potionMult = mult;
|
||||||
|
|
||||||
|
for (Player pl : GetPlayers(true))
|
||||||
|
{
|
||||||
|
Manager.GetCondition().Clean(pl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onBreakJumper(InventoryClickEvent event)
|
||||||
|
{
|
||||||
|
if (!InProgress())
|
||||||
|
return;
|
||||||
|
if (!IsAlive(event.getWhoClicked()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void PotionEffects(UpdateEvent event)
|
public void PotionEffects(UpdateEvent event)
|
||||||
{
|
{
|
||||||
@ -276,7 +311,7 @@ public class MonsterMaze extends SoloGame
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!Manager.GetCondition().HasCondition(pl, ConditionType.JUMP, null))
|
if (!Manager.GetCondition().HasCondition(pl, ConditionType.JUMP, null))
|
||||||
Manager.GetCondition().Factory().Jump("No jumping", pl, null, 9999999, 250, true, false, false);
|
Manager.GetCondition().Factory().Jump("No jumping", pl, null, 9999999, _potionMult, true, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null))
|
// if (!Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null))
|
||||||
|
@ -42,7 +42,7 @@ public class KitJumper extends ProgressingKit
|
|||||||
@Override
|
@Override
|
||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(4, PLAYER_ITEMS[4]);
|
player.getInventory().setItem(4, PLAYER_ITEMS[0]);
|
||||||
player.getInventory().setItem(8, PLAYER_ITEMS[8]);
|
player.getInventory().setItem(8, PLAYER_ITEMS[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class GamePlayerManager implements Listener
|
|||||||
}
|
}
|
||||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||||
{
|
{
|
||||||
if (!Manager.GetCondition().HasCondition(player, ConditionType.INVISIBILITY))
|
if (!Manager.GetCondition().HasCondition(player, ConditionType.INVISIBILITY) && Manager.GetGame().IsAlive(player) && !UtilPlayer.isSpectator(player))
|
||||||
{
|
{
|
||||||
for (Player viewer : Bukkit.getOnlinePlayers())
|
for (Player viewer : Bukkit.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user