Merge remote-tracking branch 'remotes/origin/master' into virizion_speed_builder
This commit is contained in:
commit
507761d5b0
@ -75,7 +75,7 @@ public class MountCart extends Mount<SingleEntityMountData<Minecart>>
|
||||
if (event.getRightClicked() == null)
|
||||
return;
|
||||
|
||||
SingleEntityMountData<Minecart> mount = GetActive().get(event.getPlayer());
|
||||
SingleEntityMountData<Minecart> mount = getMountData(event.getRightClicked());
|
||||
|
||||
if(mount == null) return;
|
||||
|
||||
|
@ -30,11 +30,11 @@ public class MountSlime extends Mount<SingleEntityMountData<Slime>>
|
||||
{
|
||||
super(manager, "Slime Mount", Material.SLIME_BALL, (byte)0, new String[]
|
||||
{
|
||||
ChatColor.RESET + "Bounce around on your very",
|
||||
ChatColor.RESET + "own personal slime friend!",
|
||||
ChatColor.RESET + "Bounce around on your very",
|
||||
ChatColor.RESET + "own personal slime friend!",
|
||||
},
|
||||
15000);
|
||||
|
||||
|
||||
KnownPackage = false;
|
||||
}
|
||||
|
||||
@ -42,153 +42,155 @@ public class MountSlime extends Mount<SingleEntityMountData<Slime>>
|
||||
{
|
||||
player.leaveVehicle();
|
||||
player.eject();
|
||||
|
||||
|
||||
//Remove other mounts
|
||||
Manager.DeregisterAll(player);
|
||||
|
||||
|
||||
SingleEntityMountData<Slime> mount = new SingleEntityMountData<Slime>(player, player.getWorld().spawn(player.getLocation(), Slime.class));
|
||||
mount.getEntity().setSize(2);
|
||||
|
||||
|
||||
mount.getEntity().setCustomName(player.getName() + "'s " + GetName());
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
|
||||
|
||||
|
||||
//Store
|
||||
_active.put(player, mount);
|
||||
}
|
||||
|
||||
|
||||
public void Disable(Player player)
|
||||
{
|
||||
SingleEntityMountData<Slime> mount = _active.remove(player);
|
||||
if (mount != null)
|
||||
{
|
||||
mount.remove();
|
||||
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Mount", "You despawned " + F.elem(GetName()) + "."));
|
||||
|
||||
|
||||
Manager.removeActive(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void interactMount(PlayerInteractEntityEvent event)
|
||||
{
|
||||
if (event.getRightClicked() == null)
|
||||
return;
|
||||
|
||||
if (!GetActive().containsKey(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if(!GetActive().get(event.getPlayer()).ownsMount(event.getPlayer()))
|
||||
return;
|
||||
|
||||
|
||||
SingleEntityMountData<Slime> data = GetActive().get(event.getPlayer());
|
||||
|
||||
if(data == null) return;
|
||||
|
||||
if(!data.ownsMount(event.getPlayer())) return;
|
||||
|
||||
if(!data.isPartOfMount(event.getRightClicked())) return;
|
||||
|
||||
event.getPlayer().leaveVehicle();
|
||||
event.getPlayer().eject();
|
||||
|
||||
|
||||
event.getRightClicked().setPassenger(event.getPlayer());
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void target(EntityTargetEvent event)
|
||||
{
|
||||
if (!GetActive().containsKey(event.getTarget()))
|
||||
return;
|
||||
|
||||
|
||||
if (!GetActive().get(event.getTarget()).equals(event.getEntity()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void updateBounce(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
|
||||
//Bounce
|
||||
for (SingleEntityMountData<Slime> slimeData : GetActive().values())
|
||||
{
|
||||
Slime slime = slimeData.getEntity();
|
||||
|
||||
|
||||
if (slime.getPassenger() == null)
|
||||
{
|
||||
UtilEnt.setFakeHead(slime, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!UtilEnt.isGrounded(slime))
|
||||
continue;
|
||||
|
||||
|
||||
if (!(slime.getPassenger() instanceof Player))
|
||||
continue;
|
||||
|
||||
|
||||
Player player = (Player)slime.getPassenger();
|
||||
|
||||
|
||||
if (!Recharge.Instance.use(player, GetName(), 200, false, false))
|
||||
continue;
|
||||
|
||||
Vector dir = slime.getPassenger().getLocation().getDirection();
|
||||
|
||||
|
||||
UtilAction.velocity(slime, dir, 1, true, 0, 0.4, 1, true);
|
||||
|
||||
|
||||
UtilEnt.CreatureForceLook(slime, 0, UtilAlg.GetYaw(dir));
|
||||
|
||||
|
||||
slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_WALK, 1f, 0.75f);
|
||||
}
|
||||
|
||||
|
||||
//Collide
|
||||
for (SingleEntityMountData<Slime> slimeData : GetActive().values())
|
||||
{
|
||||
Slime slime = slimeData.getEntity();
|
||||
if (slime.getPassenger() == null)
|
||||
continue;
|
||||
|
||||
|
||||
if (!(slime.getPassenger() instanceof Player))
|
||||
continue;
|
||||
|
||||
|
||||
Player player = (Player)slime.getPassenger();
|
||||
|
||||
|
||||
if (!Recharge.Instance.usable(player, GetName() + " Collide"))
|
||||
continue;
|
||||
|
||||
|
||||
for (SingleEntityMountData<Slime> otherSlime : GetActive().values())
|
||||
{
|
||||
Slime other = otherSlime.getEntity();
|
||||
|
||||
|
||||
if (other.equals(slime))
|
||||
continue;
|
||||
|
||||
|
||||
if (other.getPassenger() == null)
|
||||
continue;
|
||||
|
||||
|
||||
if (!(other.getPassenger() instanceof Player))
|
||||
continue;
|
||||
|
||||
|
||||
Player otherPlayer = (Player)other.getPassenger();
|
||||
|
||||
|
||||
if (!Recharge.Instance.usable(otherPlayer, GetName() + " Collide"))
|
||||
continue;
|
||||
|
||||
|
||||
//Collide
|
||||
if (UtilMath.offset(slime, other) > 2)
|
||||
continue;
|
||||
|
||||
|
||||
Recharge.Instance.useForce(player, GetName() + " Collide", 500);
|
||||
Recharge.Instance.useForce(otherPlayer, GetName() + " Collide", 500);
|
||||
|
||||
|
||||
UtilAction.velocity(slime, UtilAlg.getTrajectory(other, slime), 1.2, false, 0, 0.8, 10, true);
|
||||
UtilAction.velocity(other, UtilAlg.getTrajectory(slime, other), 1.2, false, 0, 0.8, 10, true);
|
||||
|
||||
|
||||
slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_ATTACK, 1f, 0.5f);
|
||||
slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_WALK, 1f, 0.5f);
|
||||
other.getWorld().playSound(other.getLocation(), Sound.SLIME_WALK, 1f, 0.5f);
|
||||
|
||||
|
||||
slime.playEffect(EntityEffect.HURT);
|
||||
other.playEffect(EntityEffect.HURT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.preferences.PreferencesManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
@ -21,6 +22,7 @@ public class NotificationManager extends MiniPlugin
|
||||
private boolean _enabled = true;
|
||||
|
||||
private CoreClientManager _clientManager;
|
||||
private PreferencesManager _preferencesManager;
|
||||
|
||||
private String _summerLine =
|
||||
C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" +
|
||||
@ -30,11 +32,12 @@ public class NotificationManager extends MiniPlugin
|
||||
C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" +
|
||||
C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█";
|
||||
|
||||
public NotificationManager(JavaPlugin plugin, CoreClientManager client)
|
||||
public NotificationManager(JavaPlugin plugin, CoreClientManager client, PreferencesManager preferencesManager)
|
||||
{
|
||||
super("Notification Manager", plugin);
|
||||
|
||||
_clientManager = client;
|
||||
_preferencesManager = preferencesManager;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -55,11 +58,17 @@ public class NotificationManager extends MiniPlugin
|
||||
|
||||
private void christmasSale()
|
||||
{
|
||||
Bukkit.broadcastMessage(C.cWhite + " ");
|
||||
Bukkit.broadcastMessage(C.cRedB + " MASSIVE WINTER SALE");
|
||||
Bukkit.broadcastMessage(C.cWhiteB + " 50% OFF ALL RANKS");
|
||||
Bukkit.broadcastMessage(" " + C.cGreen + C.Line + "www.mineplex.com/shop");
|
||||
Bukkit.broadcastMessage(C.cWhite + " ");
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (!_preferencesManager.Get(player).DisableAds)
|
||||
{
|
||||
player.sendMessage(C.cWhite + " ");
|
||||
player.sendMessage(C.cRedB + " MASSIVE WINTER SALE");
|
||||
player.sendMessage(C.cWhiteB + " 50% OFF ALL RANKS");
|
||||
player.sendMessage(" " + C.cGreen + C.Line + "www.mineplex.com/shop");
|
||||
player.sendMessage(C.cWhite + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void sale()
|
||||
|
@ -136,6 +136,6 @@ public class PreferencesManager extends MiniDbClientPlugin<UserPreferences>
|
||||
@Override
|
||||
public String getQuery(int accountId, String uuid, String name)
|
||||
{
|
||||
return "SELECT games, visibility, showChat, friendChat, privateMessaging, partyRequests, invisibility, forcefield, showMacReports, ignoreVelocity, pendingFriendRequests, friendDisplayInventoryUI, clanTips, hubMusic FROM accountPreferences WHERE accountPreferences.uuid = '" + uuid + "' LIMIT 1;";
|
||||
return "SELECT games, visibility, showChat, friendChat, privateMessaging, partyRequests, invisibility, forcefield, showMacReports, ignoreVelocity, pendingFriendRequests, friendDisplayInventoryUI, clanTips, hubMusic, disableAds FROM accountPreferences WHERE accountPreferences.uuid = '" + uuid + "' LIMIT 1;";
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class PreferencesRepository extends RepositoryBase
|
||||
// DEFAULT 0, showMacReports BOOL NOT NULL DEFAULT 0, ignoreVelocity BOOL
|
||||
// NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE INDEX uuid_index (uuid));";
|
||||
private static String INSERT_ACCOUNT = "INSERT INTO accountPreferences (uuid) VALUES (?) ON DUPLICATE KEY UPDATE uuid=uuid;";
|
||||
private static String UPDATE_ACCOUNT_PREFERENCES = "UPDATE accountPreferences SET games = ?, visibility = ?, showChat = ?, friendChat = ?, privateMessaging = ?, partyRequests = ?, invisibility = ?, forcefield = ?, showMacReports = ?, ignoreVelocity = ?, pendingFriendRequests = ?, friendDisplayInventoryUI = ?, clanTips = ?, hubMusic = ? WHERE uuid=?;";
|
||||
private static String UPDATE_ACCOUNT_PREFERENCES = "UPDATE accountPreferences SET games = ?, visibility = ?, showChat = ?, friendChat = ?, privateMessaging = ?, partyRequests = ?, invisibility = ?, forcefield = ?, showMacReports = ?, ignoreVelocity = ?, pendingFriendRequests = ?, friendDisplayInventoryUI = ?, clanTips = ?, hubMusic = ?, disableAds = ? WHERE uuid=?;";
|
||||
|
||||
public PreferencesRepository(JavaPlugin plugin)
|
||||
{
|
||||
@ -62,8 +62,9 @@ public class PreferencesRepository extends RepositoryBase
|
||||
preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI);
|
||||
preparedStatement.setBoolean(13, entry.getValue().ClanTips);
|
||||
preparedStatement.setBoolean(14, entry.getValue().HubMusic);
|
||||
preparedStatement.setBoolean(15, entry.getValue().DisableAds);
|
||||
System.out.println(">> " + entry.getValue().ClanTips);
|
||||
preparedStatement.setString(15, entry.getKey());
|
||||
preparedStatement.setString(16, entry.getKey());
|
||||
|
||||
preparedStatement.addBatch();
|
||||
}
|
||||
@ -91,8 +92,9 @@ public class PreferencesRepository extends RepositoryBase
|
||||
preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI);
|
||||
preparedStatement.setBoolean(13, entry.getValue().ClanTips);
|
||||
preparedStatement.setBoolean(14, entry.getValue().HubMusic);
|
||||
preparedStatement.setBoolean(15, entry.getValue().DisableAds);
|
||||
System.out.println(">> " + entry.getValue().ClanTips);
|
||||
preparedStatement.setString(15, entry.getKey());
|
||||
preparedStatement.setString(16, entry.getKey());
|
||||
preparedStatement.execute();
|
||||
}
|
||||
|
||||
@ -125,6 +127,7 @@ public class PreferencesRepository extends RepositoryBase
|
||||
preferences.friendDisplayInventoryUI = resultSet.getBoolean(12);
|
||||
preferences.ClanTips = resultSet.getBoolean(13);
|
||||
preferences.HubMusic = resultSet.getBoolean(14);
|
||||
preferences.DisableAds = resultSet.getBoolean(15);
|
||||
System.out.println("<< " + resultSet.getBoolean(13));
|
||||
}
|
||||
|
||||
|
@ -17,4 +17,5 @@ public class UserPreferences
|
||||
public boolean friendDisplayInventoryUI = true;
|
||||
public boolean ClanTips = true;
|
||||
public volatile boolean HubMusic = true;
|
||||
public boolean DisableAds = false;
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
private IButton _togglePendingFriendRequests;
|
||||
private IButton _toggleClanTips;
|
||||
private IButton _toggleHubMusic;
|
||||
private IButton _toggleDisableAds;
|
||||
|
||||
private boolean _hubGamesToggled;
|
||||
private boolean _hubPlayersToggled;
|
||||
@ -35,6 +36,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
private boolean _pendingFriendRequestsToggled;
|
||||
private boolean _clanTipsToggled;
|
||||
private boolean _hubMusicToggled;
|
||||
private boolean _disableAdsToggled;
|
||||
|
||||
private ExclusivePreferencesShop _exclusiveShop;
|
||||
|
||||
@ -120,6 +122,15 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
toggleHubMusic(player);
|
||||
}
|
||||
};
|
||||
|
||||
_toggleDisableAds = new IButton()
|
||||
{
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
toggleDisableAds(player);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void toggleHubMusic(Player player)
|
||||
@ -129,6 +140,14 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
buildPage();
|
||||
}
|
||||
|
||||
private void toggleDisableAds(Player player)
|
||||
{
|
||||
getPlugin().Get(player).DisableAds = !getPlugin().Get(player).DisableAds;
|
||||
_disableAdsToggled = !_disableAdsToggled;
|
||||
buildPage();
|
||||
}
|
||||
|
||||
|
||||
private void toggleHubPartyRequests(Player player)
|
||||
{
|
||||
getPlugin().Get(player).PartyRequests = !getPlugin().Get(player).PartyRequests;
|
||||
@ -197,8 +216,9 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
|
||||
UserPreferences userPreferences = getPlugin().Get(getPlayer());
|
||||
Rank rank = getClientManager().Get(getPlayer()).GetRank();
|
||||
|
||||
int[] indices = UtilUI.getIndicesFor(8, 0, 2);
|
||||
|
||||
int amount = rank.has(Rank.ULTRA) ? 9 : 8;
|
||||
int[] indices = UtilUI.getIndicesFor(amount, 0, 2);
|
||||
|
||||
buildPreference(indices[0], Material.FIREBALL, "Hub Player Stacker", userPreferences.HubGames, _toggleHubGames);
|
||||
buildPreference(indices[1], Material.EYE_OF_ENDER, "Hub Player Visibility", userPreferences.ShowPlayers, _toggleHubPlayers);
|
||||
@ -208,6 +228,8 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
buildPreference(indices[5], Material.RED_ROSE, "Show Pending Friend Requests", userPreferences.PendingFriendRequests, _togglePendingFriendRequests);
|
||||
buildPreference(indices[6], Material.IRON_SWORD, "Show Clan Tips", userPreferences.ClanTips, _toggleClanTips);
|
||||
buildPreference(indices[7], Material.NOTE_BLOCK, "Hub Music", userPreferences.HubMusic, _toggleHubMusic);
|
||||
if (rank.has(Rank.ULTRA))
|
||||
buildPreference(indices[8], Material.BARRIER, "Disable Ads", userPreferences.DisableAds, _toggleDisableAds);
|
||||
|
||||
if (rank.has(Rank.MODERATOR) || rank == Rank.YOUTUBE || rank == Rank.TWITCH)
|
||||
{
|
||||
@ -238,6 +260,6 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
|
||||
public boolean preferencesChanged()
|
||||
{
|
||||
return _hubGamesToggled || _hubPlayersToggled || _hubChatToggled || _hubPrivateChatToggled || _hubPartyRequestsToggled || _pendingFriendRequestsToggled || _clanTipsToggled || _hubMusicToggled;
|
||||
return _hubGamesToggled || _hubPlayersToggled || _hubChatToggled || _hubPrivateChatToggled || _hubPartyRequestsToggled || _pendingFriendRequestsToggled || _clanTipsToggled || _hubMusicToggled || _disableAdsToggled;
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextBottom;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
@ -233,7 +234,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
_achievementManager.setGiveInterfaceItem(true);
|
||||
_packetHandler = packetHandler;
|
||||
|
||||
new NotificationManager(getPlugin(), clientManager);
|
||||
new NotificationManager(getPlugin(), clientManager, preferences);
|
||||
new BotSpamManager(plugin, clientManager, punish);
|
||||
|
||||
((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true;
|
||||
@ -290,6 +291,14 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
NoteSong song = _songs.get(index);
|
||||
if (song != null)
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (_preferences.Get(player).HubMusic)
|
||||
{
|
||||
UtilTextBottom.display(C.cWhite + "Now Playing " + C.cYellow + song.getName(), player);
|
||||
}
|
||||
}
|
||||
|
||||
new NotePlayer(_plugin, song, new INoteVerifier()
|
||||
{
|
||||
@Override
|
||||
@ -1002,7 +1011,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
{
|
||||
if (event.getGadget() != null && event.getGadget().getGadgetType() == GadgetType.MusicDisc)
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Hub", "Music Discs are disabled right now"));
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Hub", "Music Discs are disabled right now!"));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,14 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import mineplex.hub.server.ServerManager;
|
||||
import mineplex.hub.server.ui.button.SelectBHButton;
|
||||
import mineplex.hub.server.ui.button.SelectBLDButton;
|
||||
import mineplex.hub.server.ui.button.SelectBRButton;
|
||||
import mineplex.hub.server.ui.button.SelectCSButton;
|
||||
import mineplex.hub.server.ui.button.SelectDMTButton;
|
||||
import mineplex.hub.server.ui.button.SelectDOMButton;
|
||||
import mineplex.hub.server.ui.button.SelectMINButton;
|
||||
import mineplex.hub.server.ui.button.SelectMSButton;
|
||||
import mineplex.hub.server.ui.button.SelectPLAYERButton;
|
||||
import mineplex.hub.server.ui.button.SelectSGButton;
|
||||
import mineplex.hub.server.ui.button.SelectSKYButton;
|
||||
@ -193,9 +195,9 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
getButtonMap().put(8, new SelectWIZButton(this));
|
||||
|
||||
getButtonMap().put(18, new SelectCSButton(this));
|
||||
// getButtonMap().put(20, new SelectBHButton(this));
|
||||
getButtonMap().put(20, new SelectBHButton(this));
|
||||
getButtonMap().put(22, new SelectSSMButton(this));
|
||||
// getButtonMap().put(24, new SelectMSButton(this));
|
||||
getButtonMap().put(24, new SelectMSButton(this));
|
||||
getButtonMap().put(26, new SelectDMTButton(this));
|
||||
getButtonMap().put(36, new SelectDOMButton(this));
|
||||
getButtonMap().put(38, new SelectTDMButton(this));
|
||||
|
@ -0,0 +1,23 @@
|
||||
package mineplex.hub.server.ui.button;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.hub.server.ui.ServerGameMenu;
|
||||
|
||||
public class SelectBHButton implements IButton
|
||||
{
|
||||
private ServerGameMenu _menu;
|
||||
|
||||
public SelectBHButton(ServerGameMenu menu)
|
||||
{
|
||||
_menu = menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_menu.OpenBH(player);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package mineplex.hub.server.ui.button;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.hub.server.ui.ServerGameMenu;
|
||||
|
||||
public class SelectMSButton implements IButton
|
||||
{
|
||||
private ServerGameMenu _menu;
|
||||
|
||||
public SelectMSButton(ServerGameMenu menu)
|
||||
{
|
||||
_menu = menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_menu.openMS(player);
|
||||
}
|
||||
}
|
@ -308,8 +308,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
new SoupAddon(plugin, this);
|
||||
new TeamArmorAddon(plugin, this);
|
||||
|
||||
new NotificationManager(getPlugin(), clientManager);
|
||||
|
||||
// new NotificationManager(getPlugin(), clientManager);
|
||||
|
||||
new BonusManager(plugin, clientManager, serverStatusManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager, giveawayManager);
|
||||
|
||||
//Champions Modules
|
||||
|
@ -36,6 +36,7 @@ import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
import org.bukkit.event.hanging.HangingPlaceEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
@ -1723,4 +1724,21 @@ public abstract class Game implements Listener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void debug(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (event.getMessage().equals("/debugteams"))
|
||||
{
|
||||
for (GameTeam team : GetTeamList())
|
||||
{
|
||||
event.getPlayer().sendMessage(team.GetFormattedName());
|
||||
|
||||
for (Player player : team.GetPlayers(false))
|
||||
{
|
||||
event.getPlayer().sendMessage(player.getName() + ": " + team.IsAlive(player));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class GameTeam
|
||||
{
|
||||
Host = host;
|
||||
|
||||
_displayName = name;
|
||||
_displayName = null;
|
||||
_name = name;
|
||||
_color = color;
|
||||
_spawns = spawns;
|
||||
@ -178,7 +178,7 @@ public class GameTeam
|
||||
{
|
||||
_players.put(player, in ? PlayerState.IN : PlayerState.OUT);
|
||||
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + "You joined " + _displayName + " Team."));
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + "You joined " + getDisplayName() + " Team."));
|
||||
|
||||
VisibilityManager.Instance.refreshPlayerToAll(player);
|
||||
}
|
||||
@ -192,7 +192,7 @@ public class GameTeam
|
||||
other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name + _name.toUpperCase()).removePlayer(player);
|
||||
other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name).addPlayer(player);
|
||||
}
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + _displayName + " Team was disbanded."));
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + getDisplayName() + " Team was disbanded."));
|
||||
}
|
||||
|
||||
_players.clear();
|
||||
@ -323,6 +323,9 @@ public class GameTeam
|
||||
|
||||
public String getDisplayName()
|
||||
{
|
||||
if (_displayName == null)
|
||||
return _name;
|
||||
|
||||
return _displayName;
|
||||
}
|
||||
|
||||
|
@ -68,11 +68,8 @@ public class GameManager implements Listener
|
||||
if (event.getType() != UpdateType.MIN_08)
|
||||
return;
|
||||
|
||||
if (Manager.GetGame() == null)
|
||||
return;
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
if (!Manager.GetGame().IsAlive(player))
|
||||
if ((Manager.getName() == null || !Manager.GetGame().IsAlive(player)) && !Manager.getPreferences().Get(player).DisableAds)
|
||||
{
|
||||
player.sendMessage(C.cWhite + " ");
|
||||
player.sendMessage(C.cRedB + " MASSIVE WINTER SALE");
|
||||
|
@ -54,10 +54,10 @@ public class WorldData
|
||||
|
||||
public GameType Game = null;
|
||||
|
||||
public HashMap<String, ArrayList<Location>> SpawnLocs = new HashMap<String, ArrayList<Location>>();
|
||||
private HashMap<String, ArrayList<Location>> DataLocs = new HashMap<String, ArrayList<Location>>();
|
||||
private HashMap<String, ArrayList<Location>> CustomLocs = new HashMap<String, ArrayList<Location>>();
|
||||
private final Map<String, String> _dataEntries = new HashMap<>();
|
||||
public HashMap<String, ArrayList<Location>> SpawnLocs = new LinkedHashMap<String, ArrayList<Location>>();
|
||||
private HashMap<String, ArrayList<Location>> DataLocs = new LinkedHashMap<String, ArrayList<Location>>();
|
||||
private HashMap<String, ArrayList<Location>> CustomLocs = new LinkedHashMap<String, ArrayList<Location>>();
|
||||
private final Map<String, String> _dataEntries = new LinkedHashMap<>();
|
||||
|
||||
public WorldData(Game game)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user