Merge branch 'pregametutorial' of http://184.154.0.242:7990/scm/min/mineplex into type-wars
This commit is contained in:
commit
6f7d49b71b
@ -38,9 +38,8 @@ public class PlayerTracker implements Listener, Runnable
|
|||||||
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
|
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
|
||||||
_plugin.getProxy().getScheduler().schedule(_plugin, this, 1L, 1L, TimeUnit.MINUTES);
|
_plugin.getProxy().getScheduler().schedule(_plugin, this, 1L, 1L, TimeUnit.MINUTES);
|
||||||
|
|
||||||
Region region = !new File("eu.dat").exists() ? Region.US : Region.EU;
|
|
||||||
_repository = new RedisDataRepository<PlayerStatus>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
|
_repository = new RedisDataRepository<PlayerStatus>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
|
||||||
region, PlayerStatus.class, "playerStatus");
|
Region.currentRegion(), PlayerStatus.class, "playerStatus");
|
||||||
|
|
||||||
ServerCommandManager.getInstance().registerCommandType("PlayerJoinCommand", mineplex.serverdata.commands.PlayerJoinCommand.class, new PlayerJoinHandler(this));
|
ServerCommandManager.getInstance().registerCommandType("PlayerJoinCommand", mineplex.serverdata.commands.PlayerJoinCommand.class, new PlayerJoinHandler(this));
|
||||||
|
|
||||||
|
@ -27,14 +27,7 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Execute(final Player caller, String[] args)
|
public void Execute(final Player caller, String[] args)
|
||||||
{
|
{
|
||||||
if (!Plugin.Get(caller).GetRank(true).has(caller, Rank.ADMIN, true))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
|
||||||
|
|
||||||
if (args == null)
|
if (args == null)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
|
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
|
||||||
@ -62,79 +55,70 @@ 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.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.SUPPORT)
|
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
|
||||||
{
|
{
|
||||||
if (!testServer && rank.has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
public void run(List<String> matches)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Insufficient privileges!"));
|
boolean matchedExact = false;
|
||||||
return;
|
|
||||||
}
|
for (String match : matches)
|
||||||
|
|
||||||
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
|
|
||||||
{
|
|
||||||
public void run(List<String> matches)
|
|
||||||
{
|
{
|
||||||
boolean matchedExact = false;
|
if (match.equalsIgnoreCase(playerName))
|
||||||
|
|
||||||
for (String match : matches)
|
|
||||||
{
|
{
|
||||||
if (match.equalsIgnoreCase(playerName))
|
matchedExact = true;
|
||||||
{
|
|
||||||
matchedExact = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchedExact)
|
|
||||||
{
|
|
||||||
for (Iterator<String> matchIterator = matches.iterator(); matchIterator.hasNext();)
|
|
||||||
{
|
|
||||||
if (!matchIterator.next().equalsIgnoreCase(playerName))
|
|
||||||
{
|
|
||||||
matchIterator.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UtilPlayer.isOnline(playerName))
|
|
||||||
{
|
|
||||||
Player p = UtilServer.getServer().getPlayer(playerName);
|
|
||||||
if (Plugin.Get(p).GetRank() != Plugin.Get(p).GetRank(true))
|
|
||||||
Plugin.Get(p).resetTemp();
|
|
||||||
|
|
||||||
OnlineRankUpdateEvent event = new OnlineRankUpdateEvent(caller, Plugin.Get(caller).GetRank(), rank, true);
|
|
||||||
Plugin.Get(p).SetRank(rank, false);
|
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
UtilPlayer.message(p, F.main(Plugin.getName(), "Your rank has been updated to " + rank.Name + "!"));
|
|
||||||
}
|
|
||||||
|
|
||||||
UtilPlayer.searchOffline(matches, new Callback<String>()
|
|
||||||
{
|
|
||||||
public void run(final String target)
|
|
||||||
{
|
|
||||||
if (target == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UUID uuid = Plugin.loadUUIDFromDB(playerName);
|
|
||||||
|
|
||||||
if (uuid == null)
|
|
||||||
uuid = UUIDFetcher.getUUIDOf(playerName);
|
|
||||||
|
|
||||||
Plugin.getRepository().saveRank(new Callback<Rank>()
|
|
||||||
{
|
|
||||||
public void run(Rank rank)
|
|
||||||
{
|
|
||||||
caller.sendMessage(F.main(Plugin.getName(), target + "'s rank has been updated to " + rank.Name + "!"));
|
|
||||||
}
|
|
||||||
}, target, uuid, rank, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
}, caller, playerName, true);
|
|
||||||
}
|
}
|
||||||
}, playerName);
|
|
||||||
}
|
if (matchedExact)
|
||||||
|
{
|
||||||
|
for (Iterator<String> matchIterator = matches.iterator(); matchIterator.hasNext();)
|
||||||
|
{
|
||||||
|
if (!matchIterator.next().equalsIgnoreCase(playerName))
|
||||||
|
{
|
||||||
|
matchIterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (UtilPlayer.isOnline(playerName))
|
||||||
|
{
|
||||||
|
Player p = UtilServer.getServer().getPlayer(playerName);
|
||||||
|
if (Plugin.Get(p).GetRank() != Plugin.Get(p).GetRank(true))
|
||||||
|
Plugin.Get(p).resetTemp();
|
||||||
|
|
||||||
|
OnlineRankUpdateEvent event = new OnlineRankUpdateEvent(caller, Plugin.Get(caller).GetRank(), rank, true);
|
||||||
|
Plugin.Get(p).SetRank(rank, false);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
UtilPlayer.message(p, F.main(Plugin.getName(), "Your rank has been updated to " + rank.Name + "!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilPlayer.searchOffline(matches, new Callback<String>()
|
||||||
|
{
|
||||||
|
public void run(final String target)
|
||||||
|
{
|
||||||
|
if (target == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UUID uuid = Plugin.loadUUIDFromDB(playerName);
|
||||||
|
|
||||||
|
if (uuid == null)
|
||||||
|
uuid = UUIDFetcher.getUUIDOf(playerName);
|
||||||
|
|
||||||
|
Plugin.getRepository().saveRank(new Callback<Rank>()
|
||||||
|
{
|
||||||
|
public void run(Rank rank)
|
||||||
|
{
|
||||||
|
caller.sendMessage(F.main(Plugin.getName(), target + "'s rank has been updated to " + rank.Name + "!"));
|
||||||
|
}
|
||||||
|
}, target, uuid, rank, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
}, caller, playerName, true);
|
||||||
|
}
|
||||||
|
}, playerName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -74,6 +74,8 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println(player.getName() + " has activated " + Name);
|
||||||
|
|
||||||
EnableCustom(player);
|
EnableCustom(player);
|
||||||
Manager.setActive(player, this);
|
Manager.setActive(player, this);
|
||||||
}
|
}
|
||||||
|
@ -269,6 +269,13 @@ public class ProjectileUser
|
|||||||
nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D;
|
nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D;
|
||||||
nmsEntity.locZ -= nmsEntity.motZ / f2 * 0.0500000007450581D;
|
nmsEntity.locZ -= nmsEntity.motZ / f2 * 0.0500000007450581D;
|
||||||
|
|
||||||
|
if (nmsEntity.locX == Double.NaN)
|
||||||
|
System.out.println(_thrown + " has made " + nmsEntity + "'s locX NaN.");
|
||||||
|
if (nmsEntity.locY == Double.NaN)
|
||||||
|
System.out.println(_thrown + " has made " + nmsEntity + "'s locY NaN.");
|
||||||
|
if (nmsEntity.locZ == Double.NaN)
|
||||||
|
System.out.println(_thrown + " has made " + nmsEntity + "'s locZ NaN.");
|
||||||
|
|
||||||
_callback.Collide(null, block, this);
|
_callback.Collide(null, block, this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new GlobalPacketManager(this, clientManager, serverStatusManager);
|
new GlobalPacketManager(this, clientManager, serverStatusManager, inventoryManager, donationManager, petManager, statsManager, giveawayManager);
|
||||||
//new Replay(this, packetHandler);
|
//new Replay(this, packetHandler);
|
||||||
|
|
||||||
AprilFoolsManager.Initialize(this, clientManager, disguiseManager);
|
AprilFoolsManager.Initialize(this, clientManager, disguiseManager);
|
||||||
|
@ -224,6 +224,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
UtilPlayer.message(thrower, F.main("Stacker", "You threw " + F.name(UtilEnt.getName(throwee))));
|
UtilPlayer.message(thrower, F.main("Stacker", "You threw " + F.name(UtilEnt.getName(throwee))));
|
||||||
UtilPlayer.message(throwee, F.main("Stacker", "You were thrown by " + F.name(thrower.getName())));
|
UtilPlayer.message(throwee, F.main("Stacker", "You were thrown by " + F.name(thrower.getName())));
|
||||||
|
|
||||||
|
System.out.println("Stacker throw.");
|
||||||
|
|
||||||
UtilAction.velocity(throwee, thrower.getLocation().getDirection(), 1.8, false, 0, 0.3, 2, false);
|
UtilAction.velocity(throwee, thrower.getLocation().getDirection(), 1.8, false, 0, 0.3, 2, false);
|
||||||
|
|
||||||
_projectileManager.AddThrow(throwee, thrower, this, 4000, true, false, true, false, 0.5f);
|
_projectileManager.AddThrow(throwee, thrower, this, 4000, true, false, true, false, 0.5f);
|
||||||
@ -244,7 +246,9 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
|
|
||||||
if (!Manager.hasPlayerStackingEnabled(target))
|
if (!Manager.hasPlayerStackingEnabled(target))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
System.out.println("Stacker collide.");
|
||||||
|
|
||||||
//Velocity
|
//Velocity
|
||||||
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true);
|
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user