PC-164
Fixes an issue where players would be able to duplicate kit items by giving them to another player then using their "Early game revive"
This commit is contained in:
parent
c01b6da390
commit
f99d4bc14d
@ -1931,5 +1931,10 @@ public class Bridge extends TeamGame implements OreObsfucation
|
||||
{
|
||||
_bridgeTime = time;
|
||||
}
|
||||
|
||||
public boolean hasUsedRevive(Player player)
|
||||
{
|
||||
return _usedLife.contains(player);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,19 +1,21 @@
|
||||
package nautilus.game.arcade.game.games.bridge.kits;
|
||||
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkBarrage;
|
||||
import nautilus.game.arcade.kit.perks.PerkFletcher;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.*;
|
||||
|
||||
public class KitArcher extends Kit
|
||||
{
|
||||
{
|
||||
public KitArcher(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Archer", KitAvailability.Gem,
|
||||
@ -36,6 +38,13 @@ public class KitArcher extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
||||
if(Manager.GetGame() instanceof Bridge)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Bridge bridge = (Bridge) Manager.GetGame();
|
||||
if(!bridge.hasUsedRevive(player))
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
@ -36,6 +37,13 @@ public class KitBeserker extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_AXE));
|
||||
if(Manager.GetGame() instanceof Bridge)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Bridge bridge = (Bridge) Manager.GetGame();
|
||||
if(!bridge.hasUsedRevive(player))
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_AXE));
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
@ -36,6 +37,13 @@ public class KitMammoth extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
if(Manager.GetGame() instanceof Bridge)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Bridge bridge = (Bridge) Manager.GetGame();
|
||||
if(!bridge.hasUsedRevive(player))
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
@ -36,6 +37,13 @@ public class KitMiner extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE));
|
||||
if(Manager.GetGame() instanceof Bridge)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Bridge bridge = (Bridge) Manager.GetGame();
|
||||
if(!bridge.hasUsedRevive(player))
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user