made it so you can use fireworks without aiming against block in blockhunt

removed fire from magma blast
private blocks are no longer private if owner is dead
This commit is contained in:
Chiss 2014-12-01 19:33:36 +11:00
parent 89892097d0
commit cee48f1978
5 changed files with 31 additions and 8 deletions

View File

@ -181,6 +181,7 @@ public abstract class Game implements Listener
public double DeathSpectateSecs = 0; public double DeathSpectateSecs = 0;
public boolean QuitOut = true; public boolean QuitOut = true;
public boolean QuitDropItems = false;
public boolean IdleKickz = true; public boolean IdleKickz = true;

View File

@ -49,6 +49,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.vehicle.VehicleExitEvent; import org.bukkit.event.vehicle.VehicleExitEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
@ -59,6 +60,7 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
@ -914,19 +916,25 @@ public class HideSeek extends TeamGame
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (!UtilEvent.isAction(event, ActionType.R_BLOCK)) if (!UtilEvent.isAction(event, ActionType.R))
return; return;
if (!UtilGear.isMat(player.getItemInHand(), Material.FIREWORK)) if (!UtilGear.isMat(player.getItemInHand(), Material.FIREWORK))
return; return;
if (!Recharge.Instance.use(player, "Firework", 15000, true, true))
{
event.setCancelled(true); event.setCancelled(true);
if (!Recharge.Instance.use(player, "Firework", 15000, true, true))
return; return;
}
this.AddGems(player, 2, "Fireworks", true); this.AddGems(player, 2, "Fireworks", true);
UtilInv.remove(player, Material.FIREWORK, (byte)0, 1);
UtilInv.Update(player);
UtilFirework.launchFirework(player.getEyeLocation(),
FireworkEffect.builder().flicker(Math.random() > 0.5).withColor(Color.YELLOW).with(Type.BALL_LARGE).trail(true).flicker(true).build(),
new Vector(0,0,0), 2);
} }
@EventHandler @EventHandler

View File

@ -33,6 +33,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
@ -157,6 +158,8 @@ public class SurvivalGames extends SoloGame
this.GameTimeout = 9600000; this.GameTimeout = 9600000;
this.QuitDropItems = true;
this.WorldTimeSet = 0; this.WorldTimeSet = 0;
this.WorldBoundaryKill = false; this.WorldBoundaryKill = false;
@ -1698,4 +1701,6 @@ public class SurvivalGames extends SoloGame
if (isDeathMatchAboutToStart()) if (isDeathMatchAboutToStart())
event.getProjectile().remove(); event.getProjectile().remove();
} }
} }

View File

@ -139,7 +139,7 @@ public class PerkMagmaBlast extends Perk
1 + 2 * range, false, 0, 0.2 + 0.4 * range, 1.2, true); 1 + 2 * range, false, 0, 0.2 + 0.4 * range, 1.2, true);
//Ignite //Ignite
Manager.GetCondition().Factory().Ignite(GetName(), cur, (Player)proj.getShooter(), 4, false, false); //Manager.GetCondition().Factory().Ignite(GetName(), cur, (Player)proj.getShooter(), 4, false, false);
} }
//Particles //Particles

View File

@ -556,6 +556,10 @@ public class GameFlagManager implements Listener
return; return;
Player owner = game.PrivateBlockMap.get(event.getClickedBlock().getLocation()); Player owner = game.PrivateBlockMap.get(event.getClickedBlock().getLocation());
if (!game.IsAlive(owner))
return;
Player player = event.getPlayer(); Player player = event.getPlayer();
if (owner.equals(player)) if (owner.equals(player))
@ -721,6 +725,11 @@ public class GameFlagManager implements Listener
Game game = Manager.GetGame(); Game game = Manager.GetGame();
if (game == null) return; if (game == null) return;
//Drop Items
if (game.QuitDropItems)
if (game.IsAlive(event.getPlayer()))
UtilInv.drop(event.getPlayer(), true);
//Remove Kit //Remove Kit
game.RemoveTeamPreference(event.getPlayer()); game.RemoveTeamPreference(event.getPlayer());
game.GetPlayerKits().remove(event.getPlayer()); game.GetPlayerKits().remove(event.getPlayer());