Merge branches 'develop' and 'feature/party-v2' of https://github.com/Mineplex-LLC/Minecraft-PC into feature/party-v2

This commit is contained in:
TadahTech 2016-06-05 19:06:15 -05:00
commit a9c086172f
7 changed files with 123 additions and 18 deletions

View File

@ -221,7 +221,6 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
addCommand(new GuiCommand(this));
addCommand(new AnimationCommand(this));
addCommand(new TicketCommand(this));
addCommand(new AllowCommand(this));
}
// Just keeping things up-to-date

View File

@ -415,6 +415,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
addCommand(new ClansAllyChatCommand(this));
addCommand(new ClanManagementCommand(this));
addCommand(new MapCommand(this));
addCommand(new SpeedCommand(this));
}
public void loadClan(ClanToken clanToken)
@ -693,15 +694,6 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
}, 20L);
}
@EventHandler
public void disableFlyKick(PlayerKickEvent event)
{
if (event.getReason().toLowerCase().contains("flying is not enabled on this server"))
{
event.setCancelled(true);
}
}
@EventHandler
public void denyBow(EntityShootBowEvent event)
{
@ -1270,6 +1262,12 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
}
@EventHandler(priority = EventPriority.LOWEST)
public void setWalkSpeed(PlayerJoinEvent event)
{
event.getPlayer().setWalkSpeed(0.2f);
}
@EventHandler
public void disableHorses(VehicleEnterEvent event)
{

View File

@ -0,0 +1,99 @@
package mineplex.game.clans.clans.commands;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.game.clans.clans.ClansManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class SpeedCommand extends CommandBase<ClansManager>
{
public SpeedCommand(ClansManager plugin)
{
super(plugin, Rank.CMOD, "speed");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args.length < 3)
{
UtilPlayer.message(caller, F.help("/speed <player> <walk|fly> <speed>", "Set a player's walk/fly speed to an amount", Rank.CMOD));
return;
}
Player player = Bukkit.getPlayer(args[0]);
if (player == null)
{
UtilPlayer.message(caller, F.main("Speed", "That player is not online!"));
return;
}
if (args[1].equalsIgnoreCase("walk"))
{
float amount;
try
{
amount = Float.parseFloat(args[2]);
}
catch (NumberFormatException ex)
{
UtilPlayer.message(caller, F.main("Speed", "That is not a number!"));
return;
}
String error = validateSpeed(amount);
if (error == null)
{
player.setWalkSpeed(amount);
UtilPlayer.message(caller, F.main("Speed", "Set " + player.getName() + "'s walk speed to " + amount));
return;
}
else
{
UtilPlayer.message(caller, F.main("Speed", error));
return;
}
}
else if (args[1].equalsIgnoreCase("fly"))
{
float amount;
try
{
amount = Float.parseFloat(args[2]);
}
catch (NumberFormatException ex)
{
UtilPlayer.message(caller, F.main("Speed", "That is not a number!"));
return;
}
String error = validateSpeed(amount);
if (error == null)
{
player.setFlySpeed(amount);
UtilPlayer.message(caller, F.main("Speed", "Set " + player.getName() + "'s fly speed to " + amount));
return;
}
else
{
UtilPlayer.message(caller, F.main("Speed", error));
return;
}
}
else
{
UtilPlayer.message(caller, F.main("Speed","That is not a valid speed type!"));
return;
}
}
private String validateSpeed(float value) {
if(value < 0.0F) {
if(value < -1.0F) {
return value + " is too low";
}
} else if(value > 1.0F) {
return value + " is too high";
}
return null;
}
}

View File

@ -50,7 +50,15 @@ public class ItemMapRenderer extends MapRenderer
// }
// else
// {
try
{
renderNormalMap(mapView, canvas, player);
}
catch (Throwable t)
{
System.out.println("Error while rendering map");
t.printStackTrace();
}
// }
}

View File

@ -56,7 +56,7 @@ public class WarPointEvasion extends MiniPlugin
uuidIterator.remove();
Player player = Bukkit.getPlayer(uuid);
if (player.isOnline())
if (player != null && player.isOnline())
{
if(ClansManager.getInstance().getClan(player) == null)
{

View File

@ -14,6 +14,7 @@ import org.bukkit.Sound;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Chest;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ItemFrame;
import org.bukkit.entity.Player;
@ -348,15 +349,15 @@ public class Gameplay extends MiniPlugin
{
return;
}
if (!event.getClickedBlock().getType().equals(Material.CHEST)
&& !event.getClickedBlock().getType().equals(Material.TRAPPED_CHEST))
Material type = event.getClickedBlock().getType();
if (type != Material.CHEST && type != Material.TRAPPED_CHEST)
{
return;
}
UtilPlayer.message(event.getPlayer(), F.main("Clans", "You are not allowed to use this whilst incognito."));
Chest chest = (Chest) event.getClickedBlock().getState();
event.getPlayer().openInventory(chest.getInventory());
event.setCancelled(true);
}

View File

@ -39,7 +39,7 @@ public class MeridianScepter extends LegendaryItem
private RGBData[] colors = { UtilColor.RgbPurple, UtilColor.RgbPurple.Lighten(), UtilColor.RgbPurple.Darken() };
private HashMap<AttackAnimation, Integer> _animations = new HashMap<AttackAnimation, Integer>();
private transient HashMap<AttackAnimation, Integer> _animations = new HashMap<AttackAnimation, Integer>();
public MeridianScepter()
{