From da6bf27c779ceeaa2b014b01ab7440a6b055059c Mon Sep 17 00:00:00 2001 From: Sarah Date: Mon, 2 Nov 2015 04:32:07 +0100 Subject: [PATCH 1/3] Staff with a higher rank can see lower rank and same ranked vanished staff. --- .../src/mineplex/hub/modules/HubVisibilityManager.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java index 7c43be8c9..fef4e03f5 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java @@ -65,14 +65,19 @@ public class HubVisibilityManager extends MiniPlugin { boolean hideMe = Manager.GetTutorial().InTutorial(player) || UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 || - Manager.getPreferences().Get(player).Invisibility || + // Manager.getPreferences().Get(player).Invisibility || _hiddenPlayers.contains(player); for (Player other : UtilServer.getPlayers()) { if (player.equals(other)) continue; - + + if(Manager.getPreferences().Get(player).Invisibility && + !Manager.GetClients().Get(other).GetRank().has(Manager.GetClients().Get(player).GetRank())) + { + hideMe = true; + } if (hideMe || !Manager.getPreferences().Get(other).ShowPlayers || Manager.GetTutorial().InTutorial(other)) From cdb0fcae75575cd5b6364def80d1520b8cdf18f0 Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 2 Nov 2015 14:37:12 +1100 Subject: [PATCH 2/3] modified hideme a little :) --- .../hub/modules/HubVisibilityManager.java | 11 +-- .../src/mineplex/mapparser/MapParser.java | 96 ++++++++++++++----- 2 files changed, 78 insertions(+), 29 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java index fef4e03f5..28e9d7164 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java @@ -11,6 +11,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerQuitEvent; import mineplex.core.MiniPlugin; +import mineplex.core.common.Rank; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilMath; @@ -65,7 +66,7 @@ public class HubVisibilityManager extends MiniPlugin { boolean hideMe = Manager.GetTutorial().InTutorial(player) || UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 || - // Manager.getPreferences().Get(player).Invisibility || + Manager.getPreferences().Get(player).Invisibility || _hiddenPlayers.contains(player); for (Player other : UtilServer.getPlayers()) @@ -73,11 +74,9 @@ public class HubVisibilityManager extends MiniPlugin if (player.equals(other)) continue; - if(Manager.getPreferences().Get(player).Invisibility && - !Manager.GetClients().Get(other).GetRank().has(Manager.GetClients().Get(player).GetRank())) - { - hideMe = true; - } + if(Manager.GetClients().Get(other).GetRank().has(Rank.MODERATOR)) + hideMe = false; + if (hideMe || !Manager.getPreferences().Get(other).ShowPlayers || Manager.GetTutorial().InTutorial(other)) diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java index c807b068f..a33e9f6d7 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java @@ -901,34 +901,84 @@ public class MapParser extends JavaPlugin implements Listener event.getPlayer().setVelocity(vel); } - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void signChangeLog(SignChangeEvent event) { if (GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer())) { - try - { - File file = new File(event.getPlayer().getWorld().getName() + "/" + "sign_log.txt"); + ArrayList text = new ArrayList(); + + text.add("Date: " + UtilTime.now()); + text.add("Player: " + event.getPlayer().getName()); + text.add("Location: " + UtilWorld.locToStrClean(event.getBlock().getLocation())); + for (int i=0 ; i text = new ArrayList(); + + text.add("Date: " + UtilTime.now()); + text.add("Player: " + event.getPlayer().getName()); + text.add("Location: " + UtilWorld.locToStrClean(event.getPlayer().getLocation())); + text.add("Message: " + event.getMessage()); + + writeSignCommandLog(text, event.getPlayer().getWorld()); + } + } + + public void writeSignCommandLog(ArrayList text, World world) + { + try + { + File file = new File(world.getName() + "/" + "command_sign_log.txt"); - if (!file.exists()) - file.createNewFile(); - - FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); - BufferedWriter bw = new BufferedWriter(fw); - - bw.write("\n\n"); - bw.write("\n" + "Date: " + UtilTime.now()); - bw.write("\n" + "Player: " + event.getPlayer().getName()); - bw.write("\n" + "Location: " + UtilWorld.locToStrClean(event.getBlock().getLocation())); - for (int i=0 ; i text, World world) + { + try + { + File file = new File(world.getName() + "/" + "sign_log.txt"); + + if (!file.exists()) + file.createNewFile(); + + FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); + BufferedWriter bw = new BufferedWriter(fw); + + bw.write("\n\n"); + for (String line : text) + bw.write("\n" + line); + + bw.close(); + } + catch (Exception e) + { + e.printStackTrace(); } } } From 9cf62cfe7f03a8539af28b5688f9827a0efea676 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Sun, 1 Nov 2015 22:58:22 -0500 Subject: [PATCH 3/3] Don't use player skulls until caching is setup and working properly --- .../Mineplex.Core/src/mineplex/core/friend/ui/FriendsGUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendsGUI.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendsGUI.java index a7e629744..e26bc6df9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendsGUI.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendsGUI.java @@ -130,7 +130,7 @@ public class FriendsGUI implements Listener ItemBuilder builder = new ItemBuilder(Material.SKULL_ITEM, 1, (short) (friend.Online ? 3 : 0)); builder.setTitle(C.cWhite + C.Bold + friend.Name); - builder.setPlayerHead(friend.Name); +// builder.setPlayerHead(friend.Name); builder.addLore(C.cGray + C.Bold + "Status: " + (friend.Online ? C.cDGreen + "Online" : C.cRed + "Offline")); @@ -275,7 +275,7 @@ public class FriendsGUI implements Listener ItemBuilder builder = new ItemBuilder(Material.SKULL_ITEM, 1, (short) (friend.Online ? 3 : 0)); builder.setTitle(C.cWhite + C.Bold + friend.Name); - builder.setPlayerHead(friend.Name); +// builder.setPlayerHead(friend.Name); builder.addLore(C.cGray + C.Bold + "Status: " + (friend.Online ? C.cDGreen + "Online" : C.cRed + "Offline"));