Merge remote-tracking branch 'remotes/origin/master' into Bonus

This commit is contained in:
Shaun Bennett 2015-08-12 00:56:04 -05:00
commit 8e4ae35256
4 changed files with 110 additions and 67 deletions

View File

@ -18,9 +18,15 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.GadgetBlockEvent;
import mineplex.core.gadget.types.ItemGadget;
@ -36,10 +42,11 @@ public class ItemPaintballGun extends ItemGadget
super(manager, "Paintball Gun", new String[]
{
C.cWhite + "PEW PEW PEW PEW!",
},
-1,
Material.GOLD_BARDING, (byte)0,
200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING, (byte)0, new String[] { C.cWhite + "100 Paintballs for you to shoot!" }, 500, 100));
}, -1, Material.GOLD_BARDING, (byte) 0, 200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING,
(byte) 0, new String[]
{
C.cWhite + "100 Paintballs for you to shoot!"
}, 500, 100));
}
@Override
@ -59,8 +66,26 @@ public class ItemPaintballGun extends ItemGadget
if (!_balls.remove(event.getEntity()))
return;
Location loc = event.getEntity().getLocation().add(event.getEntity().getVelocity());
loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 49);
Location loc = event.getEntity().getLocation();
Vector vec = event.getEntity().getVelocity().normalize().multiply(0.05);
if (vec.length() > 0)
{
int i = 0;
while (UtilBlock.airFoliage(loc.getBlock()))
{
loc.add(vec);
if (i++ > 50)
break;
}
}
loc.getWorld().playSound(loc, Sound.DIG_STONE, 1.3F, 1.3F);
UtilParticle.PlayParticle(ParticleType.RED_DUST, loc, 0.2F, 0.2F, 0.2F, 1, 70, ViewDist.LONG, UtilServer.getPlayers());
}
@EventHandler

View File

@ -849,8 +849,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{
// Give developers operator on their servers
boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER) || (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV)))
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER)
|| (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV))
|| eventTestServer && _clientManager.Get(event.getPlayer()).GetRank().Has(Rank.JNR_DEV))
event.getPlayer().setOp(true);
else
event.getPlayer().setOp(false);

View File

@ -82,7 +82,11 @@ public class EventModule extends MiniPlugin
if (!event.getMessage().toLowerCase().startsWith("/sethost "))
return;
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true))
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true)
&& !event.getPlayer().isOp() &&
(!eventTestServer && !Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.SNR_MODERATOR, true)))
return;
Manager.GetServerConfig().HostName = event.getMessage().split(" ")[1];
@ -177,7 +181,9 @@ public class EventModule extends MiniPlugin
if (!event.getMessage().toLowerCase().startsWith("/e "))
return;
if(!Manager.GetGameHostManager().isEventServer())
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
if(!Manager.GetGameHostManager().isEventServer() && !eventTestServer)
return;
event.setCancelled(true);

View File

@ -378,7 +378,7 @@ public class GameHostManager implements Listener
if (!isPrivateServer())
return;
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true))
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true) && !event.getPlayer().isOp())
return;
giveAdmin(event.getPlayer());
@ -717,22 +717,44 @@ public class GameHostManager implements Listener
if (!event.getMessage().toLowerCase().startsWith("/e set ") && !event.getMessage().toLowerCase().equals("/e set"))
return;
Player caller = event.getPlayer();
String[] args = event.getMessage().split(" ");
//Parse Game
if (args.length >= 3)
String game = args[2].toLowerCase();
if (args.length >= 4)
{
ArrayList<GameType> matches = new ArrayList<GameType>();
String map = "";
String source = "";
if(args.length == 5)
{
Manager.GetGameCreationManager().MapSource = args[3];
Manager.GetGameCreationManager().MapPref = args[4];
source = args[3];
map = args[4];
}
else
{
Manager.GetGameCreationManager().MapSource = args[2];
Manager.GetGameCreationManager().MapPref = args[3];
source = args[2];
map = args[3];
}
UtilPlayer.message(caller, C.cAqua + C.Bold + "Map Preference: " + ChatColor.RESET + source + ":" + map);
}
//Parse Game
ArrayList<GameType> matches = new ArrayList<>();
for (GameType type : GameType.values())
{
if (type.toString().toLowerCase().equals(args[2]))
if (type.toString().toLowerCase().equals(game))
{
matches.clear();
matches.add(type);
break;
}
if (type.toString().toLowerCase().contains(args[2]))
if (type.toString().toLowerCase().contains(game))
{
matches.add(type);
}
@ -740,33 +762,20 @@ public class GameHostManager implements Listener
if (matches.size() == 0)
{
event.getPlayer().sendMessage("No results for: " + args[2]);
caller.sendMessage("No results for: " + game);
return;
}
if (matches.size() > 1)
{
event.getPlayer().sendMessage("Matched multiple games;");
caller.sendMessage("Matched multiple games;");
for (GameType cur : matches)
event.getPlayer().sendMessage(cur.toString());
caller.sendMessage(cur.toString());
return;
}
GameType type = matches.get(0);
Manager.GetGame().setGame(type, event.getPlayer(), true);
}
else
{
Manager.GetGame().setGame(GameType.Event, event.getPlayer(), true);
}
//Map Pref
if (args.length >= 4)
{
Manager.GetGameCreationManager().MapPref = args[3];
UtilPlayer.message(event.getPlayer(), C.cAqua + C.Bold + "Map Preference: " + ChatColor.RESET + args[2]);
}
event.setCancelled(true);
}