Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

Conflicts:
	Plugins/Mineplex.Core/src/mineplex/core/donation/command/CoinCommand.java
This commit is contained in:
Jonathan Williams 2015-06-27 02:29:07 -05:00
commit 65a10461cd
14 changed files with 138 additions and 76 deletions

View File

@ -93,7 +93,7 @@ public enum Achievement
SKYWARS_BOMBER("Master Bomber",500,
new String[]{"Skywars.DeathBomber"},
new String[]{"Kill 3 Players with \"Super Throwing TNT\" in a Single Game."},
new String[]{"Get 3 kills with \"Super Throwing TNT\"", " in a single game."},
new int[]{1},
AchievementCategory.SKYWARS),

View File

@ -14,7 +14,7 @@ public class CoinCommand extends CommandBase<DonationManager>
{
public CoinCommand(DonationManager plugin)
{
super(plugin, Rank.OWNER, "coin");
super(plugin, Rank.ADMIN, "coin");
}
@Override

View File

@ -46,6 +46,7 @@ import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilMath;
@ -238,7 +239,14 @@ public class Bridge extends TeamGame implements OreObsfucation
return;
if (WorldWaterDamage > 0)
Announce(F.main(C.cWhite + C.Bold + "WARNING", C.cRed + C.Bold + "Water is very hot/cold and will hurt you!"));
{
if (WorldData.MapName.equals("Volcanic Islands"))
UtilTextMiddle.display(C.cRed + "Warning", "Water is Boiling Hot", 10, 60, 20);
else if (WorldData.MapName.equals("Icelands"))
UtilTextMiddle.display(C.cRed + "Warning", "Water is Freezing Cold", 10, 60, 20);
else
UtilTextMiddle.display(C.cRed + "Warning", "Water is Deadly", 10, 60, 20);
}
}
//parse

View File

@ -763,7 +763,7 @@ public class CastleSiege extends TeamGame
Player player = tntIterator.next();
FallingBlock block = _tntCarry.get(player);
if (player.isDead() || !block.isValid() || block.getTicksLived() > 900)
if (player.isDead() || !block.isValid() || block.getTicksLived() > 1500)
{
player.eject();
block.remove();

View File

@ -21,9 +21,11 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.explosion.ExplosionEvent;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.loot.ChestLoot;
import mineplex.core.loot.RandomItem;
import mineplex.core.updater.UpdateType;
@ -477,6 +479,18 @@ public class Skywars extends SoloGame
_lastChicken = System.currentTimeMillis();
}
@EventHandler
public void sandMapWarning(GameStateChangeEvent event)
{
if (event.GetState() != Game.GameState.Live)
return;
if (WorldData.MapName.equals("Sahara"))
{
UtilTextMiddle.display(C.cRed + "Warning", "Red Sand is Unstable", 10, 60, 20);
}
}
@EventHandler
public void createIslandOres(GameStateChangeEvent event)
{
@ -920,11 +934,11 @@ public class Skywars extends SoloGame
@EventHandler
public void mobLoot(EntityDeathEvent event)
{
event.getDrops().clear();
//Zombie Loot
if (event.getEntity() instanceof Zombie && _zombies.containsKey((Zombie)event.getEntity()))
{
event.getDrops().clear();
double r = Math.random();
if (r > 0.80) event.getDrops().add(_middleArmor.getLoot());
@ -935,6 +949,8 @@ public class Skywars extends SoloGame
//Chicken Loot
else if (event.getEntity() instanceof Chicken)
{
event.getDrops().clear();
event.getDrops().add(new ItemStack(Material.FEATHER, 1 + UtilMath.r(4)));
}
}
@ -1344,4 +1360,13 @@ public class Skywars extends SoloGame
}
}
@Override
public double GetKillsGems(Player killer, Player killed, boolean assist)
{
if (assist)
return 3;
else
return 12;
}
}

View File

@ -30,7 +30,7 @@ public class TNTGenerator
private Location _loc;
private long _time;
private long _timeDelay = 15000;
private long _timeDelay = 25000;
private Item _ent;
public TNTGenerator(Skywars host, Location loc)
@ -119,7 +119,7 @@ public class TNTGenerator
ItemStackFactory.Instance.CreateStack(
Material.TNT,
(byte) 0,
1,
2,
F.item(C.cYellow + C.Bold + "Left Click - Far "
+ C.cWhite + " / " + C.cYellow + C.Bold
+ " Right Click - Short")));

View File

@ -89,11 +89,13 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.visibility.VisibilityManager;
import mineplex.minecraft.game.core.combat.CombatComponent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.survivalgames.kit.*;
@ -1540,7 +1542,7 @@ public class SurvivalGames extends SoloGame
}
@EventHandler
public void PlayerKillAward(CombatDeathEvent event)
public void PlayerKill(CombatDeathEvent event)
{
if (!(event.GetEvent().getEntity() instanceof Player))
return;
@ -1553,18 +1555,47 @@ public class SurvivalGames extends SoloGame
.build();
for (int i = 0; i < 3; i++)
UtilFirework.launchFirework(player.getLocation(), effect, null, 3);
}
@EventHandler
public void killLevelReward(CombatDeathEvent event)
{
Game game = Manager.GetGame();
if (game == null) return;
if (event.GetLog().GetKiller() == null)
if (!(event.GetEvent().getEntity() instanceof Player))
return;
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
if (killer == null)
return;
Player killed = (Player)event.GetEvent().getEntity();
if (killer.equals(player))
return;
if (event.GetLog().GetKiller() != null)
{
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
killer.giveExpLevels(1);
if (killer != null && !killer.equals(killed))
{
//Kill
killer.giveExpLevels(2);
killer.playSound(killer.getLocation(), Sound.LEVEL_UP, 1f, 1f);
}
}
for (CombatComponent log : event.GetLog().GetAttackers())
{
if (event.GetLog().GetKiller() != null && log.equals(event.GetLog().GetKiller()))
continue;
Player assist = UtilPlayer.searchExact(log.GetName());
//Assist
if (assist != null)
{
assist.giveExpLevels(1);
assist.playSound(assist.getLocation(), Sound.ORB_PICKUP, 1f, 1f);
}
}
}
@EventHandler

View File

@ -23,7 +23,6 @@ import org.bukkit.entity.Creature;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.ItemStack;
public class PerkChicken extends Perk
@ -39,7 +38,7 @@ public class PerkChicken extends Perk
super("Animal Tamer", new String[]
{
"Get a chicken that follows you around",
"And lays eggs every 15 seconds!"
"And lays eggs every 8 Seconds!"
});
}
@ -60,14 +59,7 @@ public class PerkChicken extends Perk
c.setMaxHealth(35.0D);
c.setAdult();
if (player.getName().toLowerCase().endsWith("s"))
{
c.setCustomName(C.cAqua + UtilEnt.getName(player) + "' Chicken");
}
else
{
c.setCustomName(C.cAqua + UtilEnt.getName(player) + "'s Chicken");
}
c.setCustomName(C.cAqua + UtilEnt.getName(player) + "'s Chicken");
c.setCustomNameVisible(true);
@ -79,7 +71,7 @@ public class PerkChicken extends Perk
}
@EventHandler
public void chickenFollow(UpdateEvent event)
public void chickenUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
@ -95,8 +87,12 @@ public class PerkChicken extends Perk
String playerName = ownerIterator.next();
Player owner = Bukkit.getPlayer(playerName);
if (owner == null)
//Clean
if (owner == null || !Manager.GetGame().IsAlive(owner))
{
Creature chicken = _activeKitHolders.get(playerName);
chicken.remove();
ownerIterator.remove();
continue;
}
@ -136,16 +132,14 @@ public class PerkChicken extends Perk
if (_failedAttempts.get(playerName) > 4)
{
chicken.teleport(owner);
chicken.teleport(owner.getLocation().add(0, 2, 0));
_failedAttempts.put(playerName, 0);
}
else if (!nav.a(targetBlock.getX(), targetBlock.getY() + 1,
targetBlock.getZ(), speed))
else if (!nav.a(targetBlock.getX(), targetBlock.getY() + 1, targetBlock.getZ(), speed))
{
if (chicken.getFallDistance() == 0)
{
_failedAttempts.put(playerName,
_failedAttempts.get(playerName) + 1);
_failedAttempts.put(playerName, _failedAttempts.get(playerName) + 1);
}
}
else
@ -155,7 +149,7 @@ public class PerkChicken extends Perk
}
}
}
@EventHandler
public void dropEggs(UpdateEvent e)
{
@ -209,21 +203,4 @@ public class PerkChicken extends Perk
}
}
}
@EventHandler
public void onOwnerDeath(PlayerDeathEvent e)
{
String playerName = e.getEntity().getName();
if (_activeKitHolders.containsKey(playerName))
{
Creature chicken = _activeKitHolders.get(playerName);
chicken.remove();
System.out.println("Chicken removed due to owner death");
_activeKitHolders.remove(playerName);
}
}
}

View File

@ -215,8 +215,6 @@ public class PerkMadScientist extends Perk implements IThrown
data.GetThrown().remove();
int amount = 1;
Manager.GetGame().CreatureAllowOverride = true;
Zombie zombie = (Zombie) data.GetThrown().getWorld()
@ -227,17 +225,7 @@ public class PerkMadScientist extends Perk implements IThrown
UtilEnt.silence(zombie, true);
//Name
if (((Player) data.GetThrower()).getName().toLowerCase()
.endsWith("s"))
{
zombie.setCustomName(C.cAqua + UtilEnt.getName(data.GetThrower())
+ "' Minion");
}
else
{
zombie.setCustomName(C.cAqua + UtilEnt.getName(data.GetThrower())
+ "'s Minion");
}
zombie.setCustomName(C.cAqua + UtilEnt.getName(data.GetThrower()) + "'s Minion");
double r = Math.random();

View File

@ -8,6 +8,7 @@ import java.util.Iterator;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.timing.TimingManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -161,6 +162,7 @@ public class GameCreationManager implements Listener
Manager.getCosmeticManager().setHideParticles(false);
Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.CustomWeaponName);
Manager.GetChat().setThreeSecondDelay(true);
ItemStackFactory.Instance.SetUseCustomNames(false);
HashMap<String, ChatColor> pastTeams = null;

View File

@ -36,6 +36,7 @@ import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@ -842,6 +843,14 @@ public class GameFlagManager implements Listener
{
if (!game.isInsideMap(player) && game.IsAlive(player))
{
//Riding a Projectile, edgecase
if (player.getVehicle() != null && player.getVehicle() instanceof Projectile)
{
player.getVehicle().remove();
player.leaveVehicle();
((CraftPlayer)player).getHandle().spectating = false;
}
if (!Manager.IsAlive(player) || ((CraftPlayer)player).getHandle().spectating)
{
player.teleport(game.GetSpectatorLocation());

View File

@ -30,7 +30,7 @@ public class GameGemManager implements Listener
{
ArcadeManager Manager;
boolean DoubleGem = false;
boolean DoubleGem = true;
public GameGemManager(ArcadeManager manager)
{
@ -174,7 +174,7 @@ public class GameGemManager implements Listener
}
}
if (DoubleGem && game.GemDoubleEnabled && UtilPlayer.is1_8(player))
if (DoubleGem && game.GemDoubleEnabled)
total += earned;
Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total);
@ -245,9 +245,9 @@ public class GameGemManager implements Listener
}
//Double Gem
if (DoubleGem && game.GemDoubleEnabled && UtilPlayer.is1_8(player))
if (DoubleGem && game.GemDoubleEnabled)
{
UtilPlayer.message(player, F.elem(C.cGreen + "+" + (earnedGems) + " Gems") + " for " + F.elem(C.cDGreen + "Double Gem Weekend"));
UtilPlayer.message(player, F.elem(C.cGreen + "+" + (earnedGems) + " Gems") + " for " + F.elem(C.cDGreen + "Double Gem Bonus"));
totalGems += earnedGems;
}

View File

@ -5,7 +5,9 @@ import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.util.NautHashMap;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GemData;
@ -14,6 +16,8 @@ public class ExperienceStatTracker extends StatTracker<Game>
{
private long _startTime = -1;
private NautHashMap<String, Long> _playerQuitTime = new NautHashMap<String, Long>();
public ExperienceStatTracker(Game game)
{
super(game);
@ -26,6 +30,12 @@ public class ExperienceStatTracker extends StatTracker<Game>
_startTime = System.currentTimeMillis();
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event)
{
_playerQuitTime.put(event.getPlayer().getName(), System.currentTimeMillis());
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onGameEnd(GameStateChangeEvent event)
{
@ -57,7 +67,15 @@ public class ExperienceStatTracker extends StatTracker<Game>
gemExp = Math.min(gemExp, 250) * 6;
//Game Time = 1 Exp per 3 Seconds
double timeExp = (System.currentTimeMillis() - _startTime)/1500d;
long time = System.currentTimeMillis();
//Exp Until They Quit
if (!player.isOnline() && _playerQuitTime.containsKey(player.getName()))
time = _playerQuitTime.get(player.getName());
//No Time Exp
else
time = _startTime;
double timeExp = (time - _startTime)/1500d;
//Mult
double mult = 1;

View File

@ -13,7 +13,9 @@ import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent;
public class WinWithoutOpeningChestStatTracker extends StatTracker<Game>
{
@ -27,13 +29,15 @@ public class WinWithoutOpeningChestStatTracker extends StatTracker<Game>
@EventHandler
public void onOpenChest(PlayerOpenChestEvent e) {
Player player = e.getPlayer();
UUID uuid = player.getUniqueId();
_openChest.add(uuid);
public void onOpenChest(PlayerInteractEvent event)
{
if (event.getAction() == Action.RIGHT_CLICK_BLOCK)
{
if (event.getClickedBlock() != null && event.getClickedBlock().getType() == Material.CHEST)
{
_openChest.add(event.getPlayer().getUniqueId());
}
}
}
@EventHandler