Merge branches 'feature/report' and 'master' of ssh://184.154.0.242:7999/min/mineplex into feature/report

# Conflicts:
#	Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java
#	Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesRepository.java
#	Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java
This commit is contained in:
Keir 2015-12-09 18:13:26 +00:00
commit 8459cf0f95
29 changed files with 285 additions and 183 deletions

View File

@ -28,7 +28,7 @@
<processorPath useClasspath="true" /> <processorPath useClasspath="true" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel target="1.7" /> <bytecodeTargetLevel target="1.8" />
</component> </component>
<component name="JavacSettings"> <component name="JavacSettings">
<option name="GENERATE_NO_WARNINGS" value="true" /> <option name="GENERATE_NO_WARNINGS" value="true" />

View File

@ -16,7 +16,7 @@
</set> </set>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@ -552,8 +552,8 @@ public class UtilBlock
if (diagonals) if (diagonals)
{ {
for (int x = -1; x <= 1; x++) for (int x = -1; x <= 1; x++)
for (int y = -1; y <= 1; y++) for (int z = -1; z <= 1; z++)
for (int z = -1; z <= 1; z++) for (int y = 1; y >= -1; y--)
{ {
if (x == 0 && y == 0 && z == 0) continue; if (x == 0 && y == 0 && z == 0) continue;
@ -563,11 +563,11 @@ public class UtilBlock
else else
{ {
blocks.add(block.getRelative(BlockFace.UP)); blocks.add(block.getRelative(BlockFace.UP));
blocks.add(block.getRelative(BlockFace.DOWN));
blocks.add(block.getRelative(BlockFace.NORTH)); blocks.add(block.getRelative(BlockFace.NORTH));
blocks.add(block.getRelative(BlockFace.SOUTH)); blocks.add(block.getRelative(BlockFace.SOUTH));
blocks.add(block.getRelative(BlockFace.EAST)); blocks.add(block.getRelative(BlockFace.EAST));
blocks.add(block.getRelative(BlockFace.WEST)); blocks.add(block.getRelative(BlockFace.WEST));
blocks.add(block.getRelative(BlockFace.DOWN));
} }
return blocks; return blocks;

View File

@ -1,5 +1,7 @@
package mineplex.core.common.util; package mineplex.core.common.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
@ -509,13 +511,21 @@ public class UtilPlayer
if (cur.isDead()) if (cur.isDead())
continue; continue;
//Ignore Check
if (ignore != null) if (ignore != null)
{ {
for (int i = 0; i < ignore.length; i++) boolean shouldIgnore = false;
for (Entity ent : ignore)
{ {
if (cur.equals(ignore[i])) if (cur.equals(ent))
continue; {
shouldIgnore = true;
break;
}
} }
if (shouldIgnore)
continue;
} }
double dist = UtilMath.offset(cur.getLocation(), loc); double dist = UtilMath.offset(cur.getLocation(), loc);

View File

@ -1,10 +1,12 @@
package mineplex.core.common.util; package mineplex.core.common.util;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.stream.Stream;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Server; import org.bukkit.Server;
@ -18,6 +20,11 @@ public class UtilServer
return getServer().getOnlinePlayers().toArray(new Player[0]); return getServer().getOnlinePlayers().toArray(new Player[0]);
} }
public static Collection<? extends Player> getPlayersCollection()
{
return getServer().getOnlinePlayers();
}
public static List<Player> getSortedPlayers() public static List<Player> getSortedPlayers()
{ {
return getSortedPlayers(new Comparator<Player>() return getSortedPlayers(new Comparator<Player>()

View File

@ -75,7 +75,7 @@ public class MountCart extends Mount<SingleEntityMountData<Minecart>>
if (event.getRightClicked() == null) if (event.getRightClicked() == null)
return; return;
SingleEntityMountData<Minecart> mount = GetActive().get(event.getPlayer()); SingleEntityMountData<Minecart> mount = getMountData(event.getRightClicked());
if(mount == null) return; if(mount == null) return;

View File

@ -30,11 +30,11 @@ public class MountSlime extends Mount<SingleEntityMountData<Slime>>
{ {
super(manager, "Slime Mount", Material.SLIME_BALL, (byte)0, new String[] super(manager, "Slime Mount", Material.SLIME_BALL, (byte)0, new String[]
{ {
ChatColor.RESET + "Bounce around on your very", ChatColor.RESET + "Bounce around on your very",
ChatColor.RESET + "own personal slime friend!", ChatColor.RESET + "own personal slime friend!",
}, },
15000); 15000);
KnownPackage = false; KnownPackage = false;
} }
@ -42,153 +42,155 @@ public class MountSlime extends Mount<SingleEntityMountData<Slime>>
{ {
player.leaveVehicle(); player.leaveVehicle();
player.eject(); player.eject();
//Remove other mounts //Remove other mounts
Manager.DeregisterAll(player); Manager.DeregisterAll(player);
SingleEntityMountData<Slime> mount = new SingleEntityMountData<Slime>(player, player.getWorld().spawn(player.getLocation(), Slime.class)); SingleEntityMountData<Slime> mount = new SingleEntityMountData<Slime>(player, player.getWorld().spawn(player.getLocation(), Slime.class));
mount.getEntity().setSize(2); mount.getEntity().setSize(2);
mount.getEntity().setCustomName(player.getName() + "'s " + GetName()); mount.getEntity().setCustomName(player.getName() + "'s " + GetName());
//Inform //Inform
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + ".")); UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
//Store //Store
_active.put(player, mount); _active.put(player, mount);
} }
public void Disable(Player player) public void Disable(Player player)
{ {
SingleEntityMountData<Slime> mount = _active.remove(player); SingleEntityMountData<Slime> mount = _active.remove(player);
if (mount != null) if (mount != null)
{ {
mount.remove(); mount.remove();
//Inform //Inform
UtilPlayer.message(player, F.main("Mount", "You despawned " + F.elem(GetName()) + ".")); UtilPlayer.message(player, F.main("Mount", "You despawned " + F.elem(GetName()) + "."));
Manager.removeActive(player); Manager.removeActive(player);
} }
} }
@EventHandler @EventHandler
public void interactMount(PlayerInteractEntityEvent event) public void interactMount(PlayerInteractEntityEvent event)
{ {
if (event.getRightClicked() == null) if (event.getRightClicked() == null)
return; return;
if (!GetActive().containsKey(event.getPlayer())) SingleEntityMountData<Slime> data = GetActive().get(event.getPlayer());
return;
if(data == null) return;
if(!GetActive().get(event.getPlayer()).ownsMount(event.getPlayer()))
return; if(!data.ownsMount(event.getPlayer())) return;
if(!data.isPartOfMount(event.getRightClicked())) return;
event.getPlayer().leaveVehicle(); event.getPlayer().leaveVehicle();
event.getPlayer().eject(); event.getPlayer().eject();
event.getRightClicked().setPassenger(event.getPlayer()); event.getRightClicked().setPassenger(event.getPlayer());
} }
@EventHandler @EventHandler
public void target(EntityTargetEvent event) public void target(EntityTargetEvent event)
{ {
if (!GetActive().containsKey(event.getTarget())) if (!GetActive().containsKey(event.getTarget()))
return; return;
if (!GetActive().get(event.getTarget()).equals(event.getEntity())) if (!GetActive().get(event.getTarget()).equals(event.getEntity()))
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void updateBounce(UpdateEvent event) public void updateBounce(UpdateEvent event)
{ {
if (event.getType() != UpdateType.TICK) if (event.getType() != UpdateType.TICK)
return; return;
//Bounce //Bounce
for (SingleEntityMountData<Slime> slimeData : GetActive().values()) for (SingleEntityMountData<Slime> slimeData : GetActive().values())
{ {
Slime slime = slimeData.getEntity(); Slime slime = slimeData.getEntity();
if (slime.getPassenger() == null) if (slime.getPassenger() == null)
{ {
UtilEnt.setFakeHead(slime, false); UtilEnt.setFakeHead(slime, false);
continue; continue;
} }
if (!UtilEnt.isGrounded(slime)) if (!UtilEnt.isGrounded(slime))
continue; continue;
if (!(slime.getPassenger() instanceof Player)) if (!(slime.getPassenger() instanceof Player))
continue; continue;
Player player = (Player)slime.getPassenger(); Player player = (Player)slime.getPassenger();
if (!Recharge.Instance.use(player, GetName(), 200, false, false)) if (!Recharge.Instance.use(player, GetName(), 200, false, false))
continue; continue;
Vector dir = slime.getPassenger().getLocation().getDirection(); Vector dir = slime.getPassenger().getLocation().getDirection();
UtilAction.velocity(slime, dir, 1, true, 0, 0.4, 1, true); UtilAction.velocity(slime, dir, 1, true, 0, 0.4, 1, true);
UtilEnt.CreatureForceLook(slime, 0, UtilAlg.GetYaw(dir)); UtilEnt.CreatureForceLook(slime, 0, UtilAlg.GetYaw(dir));
slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_WALK, 1f, 0.75f); slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_WALK, 1f, 0.75f);
} }
//Collide //Collide
for (SingleEntityMountData<Slime> slimeData : GetActive().values()) for (SingleEntityMountData<Slime> slimeData : GetActive().values())
{ {
Slime slime = slimeData.getEntity(); Slime slime = slimeData.getEntity();
if (slime.getPassenger() == null) if (slime.getPassenger() == null)
continue; continue;
if (!(slime.getPassenger() instanceof Player)) if (!(slime.getPassenger() instanceof Player))
continue; continue;
Player player = (Player)slime.getPassenger(); Player player = (Player)slime.getPassenger();
if (!Recharge.Instance.usable(player, GetName() + " Collide")) if (!Recharge.Instance.usable(player, GetName() + " Collide"))
continue; continue;
for (SingleEntityMountData<Slime> otherSlime : GetActive().values()) for (SingleEntityMountData<Slime> otherSlime : GetActive().values())
{ {
Slime other = otherSlime.getEntity(); Slime other = otherSlime.getEntity();
if (other.equals(slime)) if (other.equals(slime))
continue; continue;
if (other.getPassenger() == null) if (other.getPassenger() == null)
continue; continue;
if (!(other.getPassenger() instanceof Player)) if (!(other.getPassenger() instanceof Player))
continue; continue;
Player otherPlayer = (Player)other.getPassenger(); Player otherPlayer = (Player)other.getPassenger();
if (!Recharge.Instance.usable(otherPlayer, GetName() + " Collide")) if (!Recharge.Instance.usable(otherPlayer, GetName() + " Collide"))
continue; continue;
//Collide //Collide
if (UtilMath.offset(slime, other) > 2) if (UtilMath.offset(slime, other) > 2)
continue; continue;
Recharge.Instance.useForce(player, GetName() + " Collide", 500); Recharge.Instance.useForce(player, GetName() + " Collide", 500);
Recharge.Instance.useForce(otherPlayer, 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(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); 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_ATTACK, 1f, 0.5f);
slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_WALK, 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); other.getWorld().playSound(other.getLocation(), Sound.SLIME_WALK, 1f, 0.5f);
slime.playEffect(EntityEffect.HURT); slime.playEffect(EntityEffect.HURT);
other.playEffect(EntityEffect.HURT); other.playEffect(EntityEffect.HURT);
} }
} }
} }
} }

View File

@ -1,7 +1,10 @@
package mineplex.core.noteblock; package mineplex.core.noteblock;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Stream;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -40,78 +43,57 @@ public class NotePlayer
private void startThread() private void startThread()
{ {
Thread thread = new Thread(new Runnable() Thread thread = new Thread(() -> {
{ while (!_finished)
@Override
public void run()
{ {
long startTime = System.currentTimeMillis(); _tick++;
while (!_finished) if (_tick > _song.getLength())
{ {
_tick++; if (_loop)
if (_tick > _song.getLength())
{ {
if (_loop) _tick = 1;
{
_tick = 1;
}
else
{
_finished = true;
_plugin.getServer().getScheduler().runTask(_plugin, new Runnable()
{
@Override
public void run()
{
SongFinishEvent event = new SongFinishEvent(_song);
_plugin.getServer().getPluginManager().callEvent(event);
}
});
return;
}
} }
else
playTick(_tick);
try
{ {
Thread.sleep(_sleepMs); _finished = true;
}
catch (InterruptedException e) _plugin.getServer().getScheduler().runTask(_plugin, () -> {
{ SongFinishEvent event = new SongFinishEvent(_song);
e.printStackTrace(); _plugin.getServer().getPluginManager().callEvent(event);
});
return;
} }
} }
playTick(_tick);
try
{
Thread.sleep(_sleepMs);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
} }
}); });
thread.start(); thread.start();
} }
private void playNote(Note note, float volume, Collection<? extends Player> players)
{
players.stream().filter(_verifier::shouldPlay).forEach((player) ->
player.playSound(player.getEyeLocation(), UtilNote.getInstrumentSound(note.getInstrument()), volume, (float) UtilNote.getPitch(note.getNote() - 33)));
}
private void playTick(int tick) private void playTick(int tick)
{ {
Player[] playerArray = UtilServer.getPlayers(); Collection<? extends Player> players = UtilServer.getPlayersCollection();
List<Player> players = new ArrayList<>(playerArray.length);
for (Player player : playerArray)
{
if (_verifier.shouldPlay(player))
players.add(player);
}
for (NoteLayer layer : _song.getLayers()) float volume = _volumeMult * 1F;
{ _song.getLayers().stream().map(layer -> layer.getNote(tick)).filter(Objects::nonNull).forEach((note) -> playNote(note, volume, players));
Note note = layer.getNote(tick);
if (note != null)
{
float volume = _volumeMult * (layer.getVolume() / 100F);
for (Player player : players)
{
player.playSound(player.getEyeLocation(), UtilNote.getInstrumentSound(note.getInstrument()), volume, (float) UtilNote.getPitch(note.getNote() - 33));
}
}
}
} }
public void cancel() public void cancel()

View File

@ -13,6 +13,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
@ -21,6 +22,7 @@ public class NotificationManager extends MiniPlugin
private boolean _enabled = true; private boolean _enabled = true;
private CoreClientManager _clientManager; private CoreClientManager _clientManager;
private PreferencesManager _preferencesManager;
private String _summerLine = private String _summerLine =
C.cYellow + "" + C.cBlack + "" + C.cYellow + "" + C.cBlack + "" + C.cYellow + "" + C.cBlack + "" + 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 + "" + C.cBlack + "" +
C.cYellow + "" + C.cBlack + "" + C.cYellow + "" + C.cBlack + "" + C.cYellow + ""; 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); super("Notification Manager", plugin);
_clientManager = client; _clientManager = client;
_preferencesManager = preferencesManager;
} }
@EventHandler @EventHandler
@ -55,11 +58,17 @@ public class NotificationManager extends MiniPlugin
private void christmasSale() private void christmasSale()
{ {
Bukkit.broadcastMessage(C.cWhite + " "); for (Player player : UtilServer.getPlayers())
Bukkit.broadcastMessage(C.cRedB + " MASSIVE WINTER SALE"); {
Bukkit.broadcastMessage(C.cWhiteB + " 50% OFF ALL RANKS"); if (!_preferencesManager.Get(player).DisableAds)
Bukkit.broadcastMessage(" " + C.cGreen + C.Line + "www.mineplex.com/shop"); {
Bukkit.broadcastMessage(C.cWhite + " "); 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() private void sale()

View File

@ -136,6 +136,6 @@ public class PreferencesManager extends MiniDbClientPlugin<UserPreferences>
@Override @Override
public String getQuery(int accountId, String uuid, String name) 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, showUserReports 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, showUserReports FROM accountPreferences WHERE accountPreferences.uuid = '" + uuid + "' LIMIT 1;";
} }
} }

View File

@ -25,7 +25,7 @@ public class PreferencesRepository extends RepositoryBase
// NOT NULL DEFAULT 0, showUserReports BOOL NOT NULL DEFAULT 0, PRIMARY // NOT NULL DEFAULT 0, showUserReports BOOL NOT NULL DEFAULT 0, PRIMARY
// KEY (id), UNIQUE INDEX uuid_index (uuid));"; // 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 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 = ?, showUserReports = ? 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 = ?, showUserReports = ? WHERE uuid=?;";
public PreferencesRepository(JavaPlugin plugin) public PreferencesRepository(JavaPlugin plugin)
{ {
@ -63,9 +63,10 @@ public class PreferencesRepository extends RepositoryBase
preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI); preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI);
preparedStatement.setBoolean(13, entry.getValue().ClanTips); preparedStatement.setBoolean(13, entry.getValue().ClanTips);
preparedStatement.setBoolean(14, entry.getValue().HubMusic); preparedStatement.setBoolean(14, entry.getValue().HubMusic);
preparedStatement.setBoolean(15, entry.getValue().ShowUserReports); preparedStatement.setBoolean(15, entry.getValue().DisableAds);
preparedStatement.setBoolean(16, entry.getValue().ShowUserReports);
System.out.println(">> " + entry.getValue().ClanTips); System.out.println(">> " + entry.getValue().ClanTips);
preparedStatement.setString(16, entry.getKey()); preparedStatement.setString(17, entry.getKey());
preparedStatement.addBatch(); preparedStatement.addBatch();
} }
@ -93,9 +94,10 @@ public class PreferencesRepository extends RepositoryBase
preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI); preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI);
preparedStatement.setBoolean(13, entry.getValue().ClanTips); preparedStatement.setBoolean(13, entry.getValue().ClanTips);
preparedStatement.setBoolean(14, entry.getValue().HubMusic); preparedStatement.setBoolean(14, entry.getValue().HubMusic);
preparedStatement.setBoolean(15, entry.getValue().ShowUserReports); preparedStatement.setBoolean(15, entry.getValue().DisableAds);
preparedStatement.setBoolean(16, entry.getValue().ShowUserReports);
System.out.println(">> " + entry.getValue().ClanTips); System.out.println(">> " + entry.getValue().ClanTips);
preparedStatement.setString(16, entry.getKey()); preparedStatement.setString(17, entry.getKey());
preparedStatement.execute(); preparedStatement.execute();
} }
@ -128,7 +130,8 @@ public class PreferencesRepository extends RepositoryBase
preferences.friendDisplayInventoryUI = resultSet.getBoolean(12); preferences.friendDisplayInventoryUI = resultSet.getBoolean(12);
preferences.ClanTips = resultSet.getBoolean(13); preferences.ClanTips = resultSet.getBoolean(13);
preferences.HubMusic = resultSet.getBoolean(14); preferences.HubMusic = resultSet.getBoolean(14);
preferences.ShowUserReports = resultSet.getBoolean(15); preferences.DisableAds = resultSet.getBoolean(15);
preferences.ShowUserReports = resultSet.getBoolean(16);
System.out.println("<< " + resultSet.getBoolean(13)); System.out.println("<< " + resultSet.getBoolean(13));
} }

View File

@ -18,4 +18,5 @@ public class UserPreferences
public boolean friendDisplayInventoryUI = true; public boolean friendDisplayInventoryUI = true;
public boolean ClanTips = true; public boolean ClanTips = true;
public volatile boolean HubMusic = true; public volatile boolean HubMusic = true;
public boolean DisableAds = false;
} }

View File

@ -26,6 +26,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
private IButton _togglePendingFriendRequests; private IButton _togglePendingFriendRequests;
private IButton _toggleClanTips; private IButton _toggleClanTips;
private IButton _toggleHubMusic; private IButton _toggleHubMusic;
private IButton _toggleDisableAds;
private boolean _hubGamesToggled; private boolean _hubGamesToggled;
private boolean _hubPlayersToggled; private boolean _hubPlayersToggled;
@ -35,6 +36,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
private boolean _pendingFriendRequestsToggled; private boolean _pendingFriendRequestsToggled;
private boolean _clanTipsToggled; private boolean _clanTipsToggled;
private boolean _hubMusicToggled; private boolean _hubMusicToggled;
private boolean _disableAdsToggled;
private ExclusivePreferencesShop _exclusiveShop; private ExclusivePreferencesShop _exclusiveShop;
@ -120,6 +122,15 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
toggleHubMusic(player); toggleHubMusic(player);
} }
}; };
_toggleDisableAds = new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
toggleDisableAds(player);
}
};
} }
private void toggleHubMusic(Player player) private void toggleHubMusic(Player player)
@ -129,6 +140,14 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
buildPage(); buildPage();
} }
private void toggleDisableAds(Player player)
{
getPlugin().Get(player).DisableAds = !getPlugin().Get(player).DisableAds;
_disableAdsToggled = !_disableAdsToggled;
buildPage();
}
private void toggleHubPartyRequests(Player player) private void toggleHubPartyRequests(Player player)
{ {
getPlugin().Get(player).PartyRequests = !getPlugin().Get(player).PartyRequests; getPlugin().Get(player).PartyRequests = !getPlugin().Get(player).PartyRequests;
@ -197,8 +216,9 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
UserPreferences userPreferences = getPlugin().Get(getPlayer()); UserPreferences userPreferences = getPlugin().Get(getPlayer());
Rank rank = getClientManager().Get(getPlayer()).GetRank(); 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[0], Material.FIREBALL, "Hub Player Stacker", userPreferences.HubGames, _toggleHubGames);
buildPreference(indices[1], Material.EYE_OF_ENDER, "Hub Player Visibility", userPreferences.ShowPlayers, _toggleHubPlayers); 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[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[6], Material.IRON_SWORD, "Show Clan Tips", userPreferences.ClanTips, _toggleClanTips);
buildPreference(indices[7], Material.NOTE_BLOCK, "Hub Music", userPreferences.HubMusic, _toggleHubMusic); 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) 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() public boolean preferencesChanged()
{ {
return _hubGamesToggled || _hubPlayersToggled || _hubChatToggled || _hubPrivateChatToggled || _hubPartyRequestsToggled || _pendingFriendRequestsToggled || _clanTipsToggled || _hubMusicToggled; return _hubGamesToggled || _hubPlayersToggled || _hubChatToggled || _hubPrivateChatToggled || _hubPartyRequestsToggled || _pendingFriendRequestsToggled || _clanTipsToggled || _hubMusicToggled || _disableAdsToggled;
} }
} }

View File

@ -22,9 +22,7 @@ public class HubClient
public int DisplayLength = 16; public int DisplayLength = 16;
private int _lastGemCount = 0; private int _lastGemCount = 0;
private int _lastCoinCount = 0;
public HubClient(String name) public HubClient(String name)
{ {
ScoreboardString = " Welcome " + name + ", to the Mineplex Network!"; ScoreboardString = " Welcome " + name + ", to the Mineplex Network!";
@ -133,14 +131,4 @@ public class HubClient
return display; return display;
} }
public void SetLastCoinCount(int coins)
{
_lastCoinCount = coins;
}
public int GetLastCoinCount()
{
return _lastCoinCount;
}
} }

View File

@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilWorld;
import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.cosmetic.CosmeticManager;
@ -165,7 +166,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
private HashMap<Player, Scoreboard> _scoreboards = new HashMap<Player, Scoreboard>(); private HashMap<Player, Scoreboard> _scoreboards = new HashMap<Player, Scoreboard>();
private String _serverName = ""; private String _serverName = "";
private int _lastPlayerCount = 0;
private boolean _shuttingDown; private boolean _shuttingDown;
private HashMap<String, Long> _portalTime = new HashMap<String, Long>(); private HashMap<String, Long> _portalTime = new HashMap<String, Long>();
@ -233,7 +234,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
_achievementManager.setGiveInterfaceItem(true); _achievementManager.setGiveInterfaceItem(true);
_packetHandler = packetHandler; _packetHandler = packetHandler;
new NotificationManager(getPlugin(), clientManager); new NotificationManager(getPlugin(), clientManager, preferences);
new BotSpamManager(plugin, clientManager, punish); new BotSpamManager(plugin, clientManager, punish);
((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true; ((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true;
@ -290,6 +291,14 @@ public class HubManager extends MiniClientPlugin<HubClient>
NoteSong song = _songs.get(index); NoteSong song = _songs.get(index);
if (song != null) 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() new NotePlayer(_plugin, song, new INoteVerifier()
{ {
@Override @Override
@ -719,15 +728,14 @@ public class HubManager extends MiniClientPlugin<HubClient>
//Space //Space
obj.getScore(" ").setScore(line--); obj.getScore(" ").setScore(line--);
//Coins //Players
obj.getScore(C.cYellow + C.Bold + "Coins").setScore(line--); obj.getScore(C.cYellow + C.Bold + "Players").setScore(line--);
// Remove Old player.getScoreboard().resetScores(_lastPlayerCount + "");
player.getScoreboard().resetScores(Get(player.getName()).GetLastCoinCount() + "");
// Add New _lastPlayerCount++;
obj.getScore(GetDonation().Get(player.getName()).getCoins() + "").setScore(line--);
obj.getScore(_lastPlayerCount + "").setScore(line--);
Get(player.getName()).SetLastCoinCount(GetDonation().Get(player.getName()).getCoins());
//Space //Space
@ -1003,7 +1011,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
{ {
if (event.getGadget() != null && event.getGadget().getGadgetType() == GadgetType.MusicDisc) 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); event.setCancelled(true);
} }
} }

View File

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

View File

@ -14,12 +14,14 @@ import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.shop.page.ShopPageBase; import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager; 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.SelectBLDButton;
import mineplex.hub.server.ui.button.SelectBRButton; import mineplex.hub.server.ui.button.SelectBRButton;
import mineplex.hub.server.ui.button.SelectCSButton; import mineplex.hub.server.ui.button.SelectCSButton;
import mineplex.hub.server.ui.button.SelectDMTButton; import mineplex.hub.server.ui.button.SelectDMTButton;
import mineplex.hub.server.ui.button.SelectDOMButton; import mineplex.hub.server.ui.button.SelectDOMButton;
import mineplex.hub.server.ui.button.SelectMINButton; 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.SelectPLAYERButton;
import mineplex.hub.server.ui.button.SelectSGButton; import mineplex.hub.server.ui.button.SelectSGButton;
import mineplex.hub.server.ui.button.SelectSKYButton; 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(8, new SelectWIZButton(this));
getButtonMap().put(18, new SelectCSButton(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(22, new SelectSSMButton(this));
// getButtonMap().put(24, new SelectMSButton(this)); getButtonMap().put(24, new SelectMSButton(this));
getButtonMap().put(26, new SelectDMTButton(this)); getButtonMap().put(26, new SelectDMTButton(this));
getButtonMap().put(36, new SelectDOMButton(this)); getButtonMap().put(36, new SelectDOMButton(this));
getButtonMap().put(38, new SelectTDMButton(this)); getButtonMap().put(38, new SelectTDMButton(this));

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -308,8 +308,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
new SoupAddon(plugin, this); new SoupAddon(plugin, this);
new TeamArmorAddon(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); new BonusManager(plugin, clientManager, serverStatusManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager, giveawayManager);
//Champions Modules //Champions Modules

View File

@ -36,6 +36,7 @@ import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.hanging.HangingBreakEvent; import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.hanging.HangingPlaceEvent; import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent; 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));
}
}
}
}
} }

View File

@ -79,7 +79,7 @@ public class GameTeam
{ {
Host = host; Host = host;
_displayName = name; _displayName = null;
_name = name; _name = name;
_color = color; _color = color;
_spawns = spawns; _spawns = spawns;
@ -178,7 +178,7 @@ public class GameTeam
{ {
_players.put(player, in ? PlayerState.IN : PlayerState.OUT); _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); 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 + _name.toUpperCase()).removePlayer(player);
other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name).addPlayer(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(); _players.clear();
@ -323,6 +323,9 @@ public class GameTeam
public String getDisplayName() public String getDisplayName()
{ {
if (_displayName == null)
return _name;
return _displayName; return _displayName;
} }

View File

@ -6,12 +6,11 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.disguise.disguises.DisguiseEnderman;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.monsterleague.perks.PerkBlinkMonsterLeague;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBlink;
import nautilus.game.arcade.kit.perks.PerkDoubleJump; import nautilus.game.arcade.kit.perks.PerkDoubleJump;
public class KitEnderman extends LeagueKit public class KitEnderman extends LeagueKit
@ -28,7 +27,7 @@ public class KitEnderman extends LeagueKit
new Perk[] new Perk[]
{ {
new PerkDoubleJump("Double Jump", 1, 1, true), new PerkDoubleJump("Double Jump", 1, 1, true),
new PerkBlink("Blink", 32, 16000), new PerkBlinkMonsterLeague("Blink", 32, 16000),
}, },
EntityType.ENDERMAN, EntityType.ENDERMAN,
new ItemStack(Material.AIR), 1.4); new ItemStack(Material.AIR), 1.4);

View File

@ -19,14 +19,15 @@ import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashPerk; import nautilus.game.arcade.kit.SmashPerk;
public class PerkBlink extends SmashPerk public class PerkBlinkMonsterLeague extends Perk
{ {
private double _range = 32; private double _range = 32;
private long _recharge = 24000; private long _recharge = 24000;
public PerkBlink(String name, double range, long recharge) public PerkBlinkMonsterLeague(String name, double range, long recharge)
{ {
super("Blink", new String[] super("Blink", new String[]
{ {
@ -51,9 +52,6 @@ public class PerkBlink extends SmashPerk
return; return;
Player player = event.getPlayer(); Player player = event.getPlayer();
if (isSuperActive(player))
return;
if (!Kit.HasKit(player)) if (!Kit.HasKit(player))
return; return;

View File

@ -62,7 +62,7 @@ public class KitPig extends SmashKit
ChatColor.RESET + "dealing damage and knockback to enemies.", ChatColor.RESET + "dealing damage and knockback to enemies.",
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + "Eat the bacon to restore some Energy.", ChatColor.RESET + "Eat the bacon to restore some Energy.",
ChatColor.RESET + "Bacon that hit an enemy will restore Health.", ChatColor.RESET + "Bacon that hits an enemy will restore Health.",
})); }));

View File

@ -87,7 +87,8 @@ public class PerkCowAngryHerd extends SmashPerk
loc.add(UtilAlg.getLeft(dir).multiply(i*1.5)); loc.add(UtilAlg.getLeft(dir).multiply(i*1.5));
Manager.GetGame().CreatureAllowOverride = true; Manager.GetGame().CreatureAllowOverride = true;
Cow cow = player.getWorld().spawn(loc, isSuperActive(player) ? MushroomCow.class : Cow.class); Class<? extends Cow> clazz = isSuperActive(player) ? MushroomCow.class : Cow.class;
Cow cow = player.getWorld().spawn(loc, clazz);
Manager.GetGame().CreatureAllowOverride = false; Manager.GetGame().CreatureAllowOverride = false;
_active.add(new DataCowCharge(player, cow)); _active.add(new DataCowCharge(player, cow));

View File

@ -17,11 +17,12 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.SmashPerk;
public class PerkBlink extends Perk public class PerkBlink extends SmashPerk
{ {
private String _name = ""; private String _name = "";
private double _range; private double _range;
@ -45,17 +46,22 @@ public class PerkBlink extends Perk
if (event.isCancelled()) if (event.isCancelled())
return; return;
if (event.getAction() != Action.LEFT_CLICK_AIR && event.getAction() != Action.LEFT_CLICK_BLOCK && if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return; return;
if (UtilBlock.usable(event.getClickedBlock())) if (UtilBlock.usable(event.getClickedBlock()))
return; return;
if (!UtilGear.isAxe(event.getPlayer().getItemInHand()))
return;
Player player = event.getPlayer(); Player player = event.getPlayer();
if (!Kit.HasKit(player)) if (!Kit.HasKit(player))
return; return;
if (isSuperActive(player))
return;
if (!Recharge.Instance.use(player, _name, _recharge, true, true)) if (!Recharge.Instance.use(player, _name, _recharge, true, true))
return; return;

View File

@ -68,11 +68,8 @@ public class GameManager implements Listener
if (event.getType() != UpdateType.MIN_08) if (event.getType() != UpdateType.MIN_08)
return; return;
if (Manager.GetGame() == null)
return;
for (Player player : UtilServer.getPlayers()) 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.cWhite + " ");
player.sendMessage(C.cRedB + " MASSIVE WINTER SALE"); player.sendMessage(C.cRedB + " MASSIVE WINTER SALE");

View File

@ -54,10 +54,10 @@ public class WorldData
public GameType Game = null; public GameType Game = null;
public HashMap<String, ArrayList<Location>> SpawnLocs = new HashMap<String, ArrayList<Location>>(); public HashMap<String, ArrayList<Location>> SpawnLocs = new LinkedHashMap<String, ArrayList<Location>>();
private HashMap<String, ArrayList<Location>> DataLocs = new HashMap<String, ArrayList<Location>>(); private HashMap<String, ArrayList<Location>> DataLocs = new LinkedHashMap<String, ArrayList<Location>>();
private HashMap<String, ArrayList<Location>> CustomLocs = new HashMap<String, ArrayList<Location>>(); private HashMap<String, ArrayList<Location>> CustomLocs = new LinkedHashMap<String, ArrayList<Location>>();
private final Map<String, String> _dataEntries = new HashMap<>(); private final Map<String, String> _dataEntries = new LinkedHashMap<>();
public WorldData(Game game) public WorldData(Game game)
{ {