Merge branch 'clans/alpha' of ssh://184.154.0.242:7999/min/Mineplex into clans/beta

This commit is contained in:
NewGarbo 2016-01-25 08:48:13 +00:00
commit 33845cbc72
8 changed files with 98 additions and 51 deletions

View File

@ -10,6 +10,7 @@ import mineplex.serverdata.redis.RedisDataRepository;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;

View File

@ -4,7 +4,6 @@ import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
@ -21,8 +20,6 @@ import mineplex.core.botspam.BotSpamManager;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
@ -37,8 +34,8 @@ import mineplex.core.disguise.PlayerDisguiseManager;
import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.giveaway.GiveawayManager;
import mineplex.core.hologram.HologramManager;
@ -91,7 +88,6 @@ import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import net.minecraft.server.v1_8_R3.EntityInsentient;
import net.minecraft.server.v1_8_R3.EntityPlayer;
@ -105,11 +101,8 @@ import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
@ -126,7 +119,6 @@ import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerVelocityEvent;
import org.bukkit.event.server.ServerListPingEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
@ -163,6 +155,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
private PersonalServerManager _personalServerManager;
private PlayerCountManager _playerCountManager;
private CustomDataManager _customDataManager;
private Punish _punishManager;
// private HalloweenSpookinessManager _halloweenManager;
// private TrickOrTreatManager _trickOrTreatManager;
@ -259,6 +252,8 @@ public class HubManager extends MiniClientPlugin<HubClient>
_customDataManager = new CustomDataManager(plugin, clientManager);
_songs = new ArrayList<NoteSong>();
_punishManager = punish;
try
{
@ -871,6 +866,11 @@ public class HubManager extends MiniClientPlugin<HubClient>
{
return _customDataManager;
}
public Punish getPunishments()
{
return _punishManager;
}
// public HalloweenSpookinessManager getHalloweenManager()
// {

View File

@ -1,6 +1,7 @@
package mineplex.hub.commands;
import java.lang.reflect.Field;
import java.util.List;
import java.util.UUID;
import mineplex.core.account.CoreClient;
@ -17,6 +18,9 @@ import mineplex.core.disguise.PlayerUndisguiseEvent;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.punish.Category;
import mineplex.core.punish.PunishClient;
import mineplex.core.punish.Punishment;
import mineplex.core.treasure.event.TreasureStartEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -182,18 +186,30 @@ public class DisguiseCommand extends CommandBase<HubManager> implements Listener
}
Rank otherRank = Rank.ALL;
CoreClient other = null;
try
{
CoreClient other = new CoreClient(args[0]);
other = new CoreClient(args[0]);
Plugin.GetClients().LoadClient(other, uuid, caller.getAddress().getAddress().getAddress().toString());
otherRank = other.GetRank();
} catch(NullPointerException exception)
{}
{
other = null;
}
if(otherRank.has(Rank.TWITCH))
{
UtilPlayer.message(caller, F.main("Disguise", "You can't disguise as staff, Youtubers or Twitchers!"));
return;
}
if(other != null)
{
PunishClient pclient = Plugin.getPunishments().GetClient(args[0]);
if(pclient.IsBanned() || pclient.IsMuted())
{
UtilPlayer.message(caller, F.main("Disguise", "Unable to disguise as this Player!"));
return;
}
}
_disguisedPlayers.put(caller, profile);
_disguisedPlayersNames.put(caller, caller.getName());
client.setDisguisedRank(otherRank);
@ -223,8 +239,9 @@ public class DisguiseCommand extends CommandBase<HubManager> implements Listener
e.printStackTrace();
}
PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
UtilPlayer.sendPacket(caller, packet);
// removed "due to Kicked for Flying"
//PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
//UtilPlayer.sendPacket(caller, packet);
tablistRefresh(caller);
} catch(Exception e)

View File

@ -63,9 +63,10 @@ public class HubVisibilityManager extends MiniPlugin
for (Player player : UtilServer.getPlayers())
{
Rank rank = Manager.GetClients().Get(player).GetRank();
boolean hideMe = Manager.GetTutorial().InTutorial(player) ||
UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 ||
(Manager.getPreferences().Get(player).Invisibility && Manager.GetClients().Get(player).GetRank().has(Rank.MODERATOR)) ||
(Manager.getPreferences().Get(player).Invisibility && (rank.has(Rank.MODERATOR) || rank == Rank.YOUTUBE || rank == Rank.TWITCH)) ||
_hiddenPlayers.contains(player);
for (Player other : UtilServer.getPlayers())

View File

@ -43,8 +43,9 @@ public class JumpManager extends MiniPlugin
if (player.getGameMode() == GameMode.CREATIVE)
return;
if (Manager.getPreferences().Get(player).Invisibility)
Rank rank = Manager.GetClients().Get(player).GetRank();
if (Manager.getPreferences().Get(player).Invisibility && (rank.has(Rank.MODERATOR) || rank == Rank.YOUTUBE || rank == Rank.TWITCH))
{
return;
}

View File

@ -156,7 +156,7 @@ public class Arcade extends JavaPlugin
//Arcade Manager
PollManager pollManager = new PollManager(this, _clientManager, _donationManager);
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, statsManager, achievementManager, disguiseManager, creature, teleport, new Blood(this), chat, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, hologramManager, webServerAddress, pollManager, npcmanager, giveawayManager, customDataManager);
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, statsManager, achievementManager, disguiseManager, creature, teleport, new Blood(this), chat, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, hologramManager, webServerAddress, pollManager, npcmanager, giveawayManager, customDataManager, punish);
new MemoryFix(this);
new CustomTagFix(this, packetHandler);

View File

@ -4,34 +4,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.server.ServerListPingEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.util.Vector;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
@ -71,6 +43,7 @@ import mineplex.core.poll.PollManager;
import mineplex.core.portal.Portal;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.projectile.ProjectileManager;
import mineplex.core.punish.Punish;
import mineplex.core.resourcepack.ResourcePackManager;
import mineplex.core.reward.RewardData;
import mineplex.core.reward.RewardRarity;
@ -128,6 +101,34 @@ import nautilus.game.arcade.managers.IdleManager;
import nautilus.game.arcade.managers.MiscManager;
import nautilus.game.arcade.player.ArcadePlayer;
import nautilus.game.arcade.shop.ArcadeShop;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.server.ServerListPingEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.util.Vector;
public class ArcadeManager extends MiniPlugin implements IRelation
{
@ -182,6 +183,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private GiveawayManager _giveawayManager;
private ResourcePackManager _resourcePackManager;
private CustomDataManager _customDataManager;
private Punish _punishmentManager;
private TaskManager _taskManager;
private PacketHandler _packetHandler;
@ -206,7 +208,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
StatsManager statsManager, AchievementManager achievementManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, Chat chat,
Portal portal, PreferencesManager preferences, InventoryManager inventoryManager, PacketHandler packetHandler,
CosmeticManager cosmeticManager, ProjectileManager projectileManager, PetManager petManager, HologramManager hologramManager, String webAddress, PollManager pollManager,
NpcManager npcManager, GiveawayManager giveawayManager, CustomDataManager customDataManager)
NpcManager npcManager, GiveawayManager giveawayManager, CustomDataManager customDataManager, Punish punish)
{
super("Game Manager", plugin);
@ -321,6 +323,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_eloManager = new EloManager(_plugin, clientManager);
_punishmentManager = punish;
if (GetHost() != null && !GetHost().isEmpty())
{
Bukkit.getScheduler().runTaskLater(plugin, new Runnable()
@ -449,6 +453,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{
return _projectileManager;
}
public Punish getPunishments()
{
return _punishmentManager;
}
public Portal GetPortal()
{

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.command;
import java.lang.reflect.Field;
import java.util.List;
import java.util.UUID;
import mineplex.core.account.CoreClient;
@ -17,6 +18,9 @@ import mineplex.core.disguise.PlayerUndisguiseEvent;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.punish.Category;
import mineplex.core.punish.PunishClient;
import mineplex.core.punish.Punishment;
import mineplex.core.treasure.event.TreasureStartEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -63,7 +67,7 @@ public class DisguiseCommand extends CommandBase<ArcadeManager> implements Liste
public DisguiseCommand(ArcadeManager plugin)
{
super(plugin, Rank.JNR_DEV, new Rank[] {Rank.YOUTUBE, Rank.TWITCH, Rank.YOUTUBE_SMALL}, "disguise");
super(plugin, Rank.JNR_DEV, new Rank[] {Rank.YOUTUBE, Rank.TWITCH}, "disguise");
plugin.getPluginManager().registerEvents(this, Plugin.getPlugin());
}
@ -184,18 +188,31 @@ public class DisguiseCommand extends CommandBase<ArcadeManager> implements Liste
}
Rank otherRank = Rank.ALL;
CoreClient other = null;
try
{
CoreClient other = new CoreClient(args[0]);
other = new CoreClient(args[0]);
Plugin.GetClients().LoadClient(other, uuid, caller.getAddress().getAddress().getAddress().toString());
otherRank = other.GetRank();
} catch(NullPointerException exception)
{}
{
other = null;
}
if(otherRank.has(Rank.TWITCH))
{
UtilPlayer.message(caller, F.main("Disguise", "You can't disguise as staff, Youtubers or Twitchers!"));
return;
}
if(other != null)
{
PunishClient pclient = Plugin.getPunishments().GetClient(args[0]);
if(pclient.IsBanned() || pclient.IsMuted())
{
UtilPlayer.message(caller, F.main("Disguise", "Unable to disguise as this Player!"));
return;
}
}
_disguisedPlayers.put(caller, profile);
_disguisedPlayersNames.put(caller, caller.getName());
client.setDisguisedRank(otherRank);
@ -225,8 +242,9 @@ public class DisguiseCommand extends CommandBase<ArcadeManager> implements Liste
e.printStackTrace();
}
PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
UtilPlayer.sendPacket(caller, packet);
// removed "due to Kicked for Flying"
//PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
//UtilPlayer.sendPacket(caller, packet);
tablistRefresh(caller);
} catch(Exception e)