Merge pull request #29 in MIN/mineplex from foo to master

* commit '07bdbdde46e2a9e7b49f4e8606c9068a0534c18d': (22 commits)
  minor grammar issue
  remove duplicate method
  manually updating something
  *crosses fingers* please work!
  please work...
  Freezes the time using doDayLightCycle instead of using a UpdateEvent.
  Fixed double-half-slabs (line 68)
  remove custom level to fix merge conflicts
  squirrel!
  fix getting snowballs from bedrock
  add jnr_dev to updaterank
  fix this agaaaaain
  FOOIFY IS A NOOB OKAY
  fix concurrentmodificationexception
  fix turfforts bug
  prevent STATIONARY_LAVA from breaking in creeper smash
  fix creeper smash exploding lava and bedrock
  fix spleef lava issue
  ishh also wanted this :P (let me know if I should remove it)
  ishh wanted it...k
  ...
This commit is contained in:
Jonathan Williams 2015-08-13 01:49:00 -05:00
commit a308244966
10 changed files with 73 additions and 86 deletions

View File

@ -60,7 +60,8 @@ public class UpdateRank extends CommandBase<CoreClientManager>
final Rank rank = tempRank; final Rank rank = tempRank;
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.JNR_DEV || rank == Rank.DEVELOPER) if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
{ {
if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT)) if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
{ {

View File

@ -225,6 +225,11 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
UtilPlayer.message(from, C.cPurple + "Please be patient if he does not reply instantly."); UtilPlayer.message(from, C.cPurple + "Please be patient if he does not reply instantly.");
} }
if(to.getName().equals("ishh"))
{
UtilPlayer.message(from, C.cPurple + "Hi, my name is ishh. If I don't respond to your message, please be patient and try again later!");
}
// Log // Log
// Logger().logChat("Private Message", from, to.getName(), message); // Logger().logChat("Private Message", from, to.getName(), message);

View File

@ -13,7 +13,7 @@ public class GiveStatCommand extends CommandBase<StatsManager>
{ {
public GiveStatCommand(StatsManager plugin) public GiveStatCommand(StatsManager plugin)
{ {
super(plugin, Rank.OWNER, "givestat"); super(plugin, Rank.ADMIN, "givestat");
} }
@Override @Override

View File

@ -74,7 +74,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
if (_onMainPage) if (_onMainPage)
{ {
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to Join instantly!"), new IButton() { addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to join instantly!"), new IButton() {
@Override @Override
public void onClick(Player player, ClickType clickType) { public void onClick(Player player, ClickType clickType) {

View File

@ -1875,7 +1875,11 @@ public class MineStrike extends TeamGame
ChatColor color = ChatColor.GRAY; ChatColor color = ChatColor.GRAY;
if (winner != null) if (winner != null)
{ {
if(winner.GetName().contains("Bombers")) {
winnerLine= winner.GetColor() + C.Bold + winner.GetName() + " have won the round!";
} else {
winnerLine= winner.GetColor() + C.Bold + winner.GetName() + " has won the round!"; winnerLine= winner.GetColor() + C.Bold + winner.GetName() + " has won the round!";
}
addScore(winner); addScore(winner);
drawScoreboard(); drawScoreboard();
color = winner.GetColor(); color = winner.GetColor();

View File

@ -79,6 +79,8 @@ public class Quiver extends SoloGame
this.PrepareFreeze = false; this.PrepareFreeze = false;
this.BlockBreakAllow.add(102); this.BlockBreakAllow.add(102);
this.BlockBreakAllow.add(20); this.BlockBreakAllow.add(20);
this.BlockBreakAllow.add(Material.STAINED_GLASS_PANE.getId());
this.BlockBreakAllow.add(Material.STAINED_GLASS.getId());
this.DeathSpectateSecs = 1; this.DeathSpectateSecs = 1;

View File

@ -178,14 +178,14 @@ public class Spleef extends SoloGame
BlockFade(event.getBlock(), event.getPlayer(), false); BlockFade(event.getBlock(), event.getPlayer(), false);
//Snowball //Snowball
if (GetKit(event.getPlayer()) instanceof KitSnowballer) if (GetKit(event.getPlayer()) instanceof KitSnowballer && event.getBlock().getType() != Material.BEDROCK)
if (!UtilInv.contains(event.getPlayer(), Material.SNOW_BALL, (byte)0, 16)) if (!UtilInv.contains(event.getPlayer(), Material.SNOW_BALL, (byte)0, 16))
event.getPlayer().getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SNOW_BALL)); event.getPlayer().getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SNOW_BALL));
} }
public void BlockFade(Block block, Player player, boolean slowDamage) public void BlockFade(Block block, Player player, boolean slowDamage)
{ {
if (block.getTypeId() == 7) if (block.getType() == Material.BEDROCK || block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA)
return; return;
//Prevent Super Hunger from Bow //Prevent Super Hunger from Bow

View File

@ -31,6 +31,7 @@ import nautilus.game.arcade.stats.BehindEnemyLinesStatTracker;
import nautilus.game.arcade.stats.BlockShreadStatTracker; import nautilus.game.arcade.stats.BlockShreadStatTracker;
import nautilus.game.arcade.stats.TheComebackStatTracker; import nautilus.game.arcade.stats.TheComebackStatTracker;
import net.minecraft.server.v1_7_R4.EntityArrow; import net.minecraft.server.v1_7_R4.EntityArrow;
import net.minecraft.server.v1_7_R4.Item;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -43,17 +44,15 @@ import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.EntityType; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockEvent; import org.bukkit.event.block.BlockEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileHitEvent;
@ -114,6 +113,7 @@ public class TurfForts extends TeamGame
new Kit[] new Kit[]
{ {
new KitMarksman(manager), new KitMarksman(manager),
new KitInfiltrator(manager), new KitInfiltrator(manager),
new KitShredder(manager), new KitShredder(manager),
@ -125,6 +125,7 @@ public class TurfForts extends TeamGame
"", "",
"Each kill advances your turf forwards.", "Each kill advances your turf forwards.",
"Take over all the turf to win!" "Take over all the turf to win!"
}); });
this.StrictAntiHack = true; this.StrictAntiHack = true;
@ -281,12 +282,20 @@ public class TurfForts extends TeamGame
} }
} }
@EventHandler(ignoreCancelled = true) @EventHandler
public void BlockBreak(BlockBreakEvent event)
{
if (event.isCancelled()) // this statement might save just a small amount of time
return;
if(getArcadeManager().isSpectator(event.getPlayer())) event.setCancelled(true);
}
@EventHandler
public void BlockPlace(BlockPlaceEvent event) public void BlockPlace(BlockPlaceEvent event)
{ {
//Remoeved and replaced by ignoreCancelled = true if (event.isCancelled())
//if (event.isCancelled()) return;
// return;
GameTeam team = GetTeam(event.getPlayer()); GameTeam team = GetTeam(event.getPlayer());
if (team == null) if (team == null)
@ -325,17 +334,6 @@ public class TurfForts extends TeamGame
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
}
@EventHandler(priority = EventPriority.HIGH)
public void BlockBreak(BlockBreakEvent event)
{
if (!IsAlive(event.getPlayer()))
{
event.setCancelled(true);
return;
}
} }
@EventHandler @EventHandler
@ -359,7 +357,6 @@ public class TurfForts extends TeamGame
Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable() Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
{ {
public void run() public void run()
{ {
try try
@ -382,19 +379,18 @@ public class TurfForts extends TeamGame
if (block.getTypeId() == 35) if (block.getTypeId() == 35)
{ {
if (block.getData() == 14 /* && team.GetColor() != ChatColor.RED */) if (block.getData() == 14 && team.GetColor() != ChatColor.RED)
{ {
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK.getId()); block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK.getId());
} }
else if (block.getData() == 3 /* && team.GetColor() != ChatColor.AQUA */) else if (block.getData() == 3 && team.GetColor() != ChatColor.AQUA)
{ {
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.LAPIS_BLOCK.getId()); block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.LAPIS_BLOCK.getId());
} }
Bukkit.getPluginManager().callEvent(new ShredBlockEvent(block, arrow)); Bukkit.getPluginManager().callEvent(new ShredBlockEvent(block, arrow));
block.breakNaturally();
block.setType(Material.AIR);
} }
arrow.remove(); arrow.remove();
@ -670,7 +666,6 @@ public class TurfForts extends TeamGame
} }
} }
/*
@EventHandler @EventHandler
public void ItemRemoval(UpdateEvent event) public void ItemRemoval(UpdateEvent event)
{ {
@ -689,36 +684,6 @@ public class TurfForts extends TeamGame
ent.remove(); ent.remove();
} }
} }
*/
//Added by TheMineBench.
@EventHandler
public void blockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
GameTeam team = GetTeam(event.getPlayer());
GameTeam otherTeam = GetOtherTeam(team);
if (block.getType().equals(Material.WOOL) && (block.getData() == 14 && team.GetColor() != ChatColor.RED) || (block.getData() == 3 && team.GetColor() != ChatColor.AQUA))
{
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot break the " + F.elem(otherTeam.GetColor() + otherTeam.GetName()) + " team's blocks!"));
event.setCancelled(true);
return;
}
}
public GameTeam GetOtherTeam(GameTeam team) {
return team.GetColor() == ChatColor.RED ? GetTeam(ChatColor.AQUA) : GetTeam(ChatColor.RED);
}
@EventHandler
public void onItem(ItemSpawnEvent e) {
if (e.getEntityType().equals(EntityType.DROPPED_ITEM)) {
e.setCancelled(true);
}
}
@Override @Override
public void EndCheck() public void EndCheck()

View File

@ -1,40 +1,42 @@
package nautilus.game.arcade.kit.perks; package nautilus.game.arcade.kit.perks;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
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;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseCreeper; import mineplex.core.disguise.disguises.DisguiseCreeper;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashPerk; import nautilus.game.arcade.kit.SmashPerk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
public class PerkCreeperExplode extends SmashPerk public class PerkCreeperExplode extends SmashPerk
{ {
private HashMap<Player, Long> _active = new HashMap<Player, Long>(); private HashMap<Player, Long> _active = new HashMap<Player, Long>();
@ -144,7 +146,15 @@ public class PerkCreeperExplode extends SmashPerk
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, (float)(2 + Math.random()*4), (float)(Math.random() + 0.2)); player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, (float)(2 + Math.random()*4), (float)(Math.random() + 0.2));
//Blocks //Blocks
Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(player.getLocation(), 12).keySet(), player.getLocation(), false); Collection<Block> blocks = UtilBlock.getInRadius(player.getLocation(), 12).keySet();
Iterator<Block> iter = blocks.iterator();
while (iter.hasNext()) {
Block b = iter.next();
if(b.getType() == Material.STATIONARY_LAVA || b.getType() == Material.LAVA || b.getType() == Material.BEDROCK) iter.remove();;
}
Manager.GetExplosion().BlockExplosion(blocks, player.getLocation(), false);
//Remove Spawns //Remove Spawns
Iterator<Location> spawnIterator = Manager.GetGame().GetTeam(player).GetSpawns().iterator(); Iterator<Location> spawnIterator = Manager.GetGame().GetTeam(player).GetSpawns().iterator();