Map Parser voxel update

Disabled spec GUI in bridges
other minor changes
This commit is contained in:
Chiss 2015-01-26 11:23:08 +11:00
parent 10ab390bd7
commit f80e640d34
9 changed files with 84 additions and 83 deletions

View File

@ -15,6 +15,7 @@ public enum Rank
MODERATOR("Mod", ChatColor.GOLD), MODERATOR("Mod", ChatColor.GOLD),
HELPER("Helper", ChatColor.DARK_AQUA), HELPER("Helper", ChatColor.DARK_AQUA),
MAPDEV("Mapper", ChatColor.BLUE), MAPDEV("Mapper", ChatColor.BLUE),
MAPLEAD("MapKing", ChatColor.DARK_PURPLE),
//Staff ^^ //Staff ^^

View File

@ -37,8 +37,16 @@ public class UtilTextBottom
public static void displayProgress(String prefix, double amount, String suffix, Player... players) public static void displayProgress(String prefix, double amount, String suffix, Player... players)
{ {
displayProgress(prefix, amount, suffix, false, players);
}
public static void displayProgress(String prefix, double amount, String suffix, boolean progressDirectionSwap, Player... players)
{
if (progressDirectionSwap)
amount = 1 - amount;
//Generate Bar //Generate Bar
int bars = 12; int bars = 24;
String progressBar = C.cGreen + ""; String progressBar = C.cGreen + "";
boolean colorChange = false; boolean colorChange = false;
for (int i=0 ; i<bars ; i++) for (int i=0 ; i<bars ; i++)
@ -49,7 +57,7 @@ public class UtilTextBottom
colorChange = true; colorChange = true;
} }
progressBar += ""; progressBar += "";
} }
//Send to Player //Send to Player

View File

@ -6,7 +6,6 @@ import java.util.LinkedList;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
@ -204,6 +203,17 @@ public class Recharge extends MiniPlugin
_recharge.get(player.getName()).get(ability).DisplayForce = displayForce; _recharge.get(player.getName()).get(ability).DisplayForce = displayForce;
} }
public void setCountdown(Player player, String ability, boolean countdown)
{
if (!_recharge.containsKey(player.getName()))
return;
if (!_recharge.get(player.getName()).containsKey(ability))
return;
_recharge.get(player.getName()).get(ability).Countdown = countdown;
}
public void Reset(Player player) public void Reset(Player player)
{ {
_recharge.put(player.getName(), new NautHashMap<String, RechargeData>()); _recharge.put(player.getName(), new NautHashMap<String, RechargeData>());

View File

@ -30,6 +30,7 @@ public class RechargeData
public ItemStack Item; public ItemStack Item;
public boolean DisplayForce = false; public boolean DisplayForce = false;
public boolean Countdown = false; //This will make the output a countdown, instead of a recharge.
public boolean AttachItem; public boolean AttachItem;
public boolean AttachDurability; public boolean AttachDurability;
@ -62,11 +63,15 @@ public class RechargeData
{ {
if (!UtilTime.elapsed(Time, Recharge)) if (!UtilTime.elapsed(Time, Recharge))
{ {
UtilTextBottom.displayProgress(C.Bold + Name, percent, UtilTime.MakeStr(Recharge - (System.currentTimeMillis() - Time)), Player); UtilTextBottom.displayProgress(C.Bold + Name, percent, UtilTime.MakeStr(Recharge - (System.currentTimeMillis() - Time)), Countdown, Player);
} }
else else
{ {
UtilTextBottom.display(C.cGreen + C.Bold + Name + " Recharged", Player);
if (!Countdown)
UtilTextBottom.display(C.cGreen + C.Bold + Name + " Recharged", Player);
else
UtilTextBottom.display(C.cRed + C.Bold + Name + " Ended", Player);
//PLING! //PLING!
if (Recharge > 4000) if (Recharge > 4000)

View File

@ -1,13 +0,0 @@
package mineplex.core.scoreboard;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
public class EasyScoreboard extends MiniPlugin
{
public EasyScoreboard(JavaPlugin plugin)
{
super("EasyScoreboard", plugin);
}
}

View File

@ -81,6 +81,8 @@ public class MapParser extends JavaPlugin implements Listener
private List<BaseCommand> _commands = new ArrayList<BaseCommand>(); private List<BaseCommand> _commands = new ArrayList<BaseCommand>();
private Location _spawnLocation; private Location _spawnLocation;
private HashMap<Player, Boolean> _permissionMap = new HashMap<Player, Boolean>();
@Override @Override
public void onEnable() public void onEnable()
{ {
@ -127,11 +129,37 @@ public class MapParser extends JavaPlugin implements Listener
ResetInventory(event.getPlayer()); ResetInventory(event.getPlayer());
DisplayHelp(player); DisplayHelp(player);
for (Plugin plugin : Bukkit.getPluginManager().getPlugins())
player.addAttachment(plugin, "worldedit.*", true);
} }
@EventHandler
public void permissionUpdate(TickEvent event)
{
for (Player player : UtilServer.getPlayers())
{
permissionSet(player);
}
}
public void permissionSet(Player player)
{
boolean hasPermission = GetData(player.getWorld().getName()).HasAccess(player);
if (!_permissionMap.containsKey(player) || _permissionMap.get(player) != hasPermission)
{
for (Plugin plugin : Bukkit.getPluginManager().getPlugins())
{
player.addAttachment(plugin, "worldedit.*", hasPermission);
player.addAttachment(plugin, "voxelsniper.sniper", hasPermission);
player.addAttachment(plugin, "voxelsniper.brush.*", hasPermission);
}
_permissionMap.put(player, hasPermission);
UtilPlayer.message(player, "Plugin Permissions: " + F.tf(hasPermission));
}
}
public void DisplayHelp(Player player) public void DisplayHelp(Player player)
{ {
UtilPlayer.message(player, F.main("Parser", "Listing Commands;")); UtilPlayer.message(player, F.main("Parser", "Listing Commands;"));
@ -491,7 +519,7 @@ public class MapParser extends JavaPlugin implements Listener
System.out.println(world + ChatColor.RESET + " " + name + ChatColor.RESET + " " + event.getMessage()); System.out.println(world + ChatColor.RESET + " " + name + ChatColor.RESET + " " + event.getMessage());
} }
@EventHandler @EventHandler(priority = EventPriority.LOWEST)
public void InteractCancel(PlayerInteractEvent event) public void InteractCancel(PlayerInteractEvent event)
{ {
//Permission //Permission
@ -501,17 +529,23 @@ public class MapParser extends JavaPlugin implements Listener
} }
} }
@EventHandler @EventHandler(priority = EventPriority.LOWEST)
public void WorldeditCancel(PlayerCommandPreprocessEvent event) public void commandCancel(PlayerCommandPreprocessEvent event)
{ {
if (event.getMessage().startsWith("//")) if (event.getMessage().startsWith("/tp") ||
event.getMessage().startsWith("/hub") ||
event.getMessage().startsWith("/list") ||
event.getMessage().startsWith("/map") ||
event.getMessage().startsWith("/create") ||
event.getMessage().startsWith("/copy") ||
event.getMessage().startsWith("/delete"))
return;
//Permission
if (!GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
{ {
//Permission UtilPlayer.message(event.getPlayer(), F.main("Parser", "You do not have Build-Access for this Map."));
if (!GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer())) event.setCancelled(true);
{
UtilPlayer.message(event.getPlayer(), F.main("Parser", "You do not have Build-Access for this Map."));
event.setCancelled(true);
}
} }
} }

View File

@ -110,9 +110,9 @@ import nautilus.game.arcade.managers.GameWorldManager;
import nautilus.game.arcade.managers.IdleManager; import nautilus.game.arcade.managers.IdleManager;
import nautilus.game.arcade.managers.MiscManager; import nautilus.game.arcade.managers.MiscManager;
import nautilus.game.arcade.shop.ArcadeShop; import nautilus.game.arcade.shop.ArcadeShop;
public class ArcadeManager extends MiniPlugin implements IRelation public class ArcadeManager extends MiniPlugin implements IRelation
{ {
// Modules // Modules
private BlockRestore _blockRestore; private BlockRestore _blockRestore;
private Blood _blood; private Blood _blood;
@ -129,7 +129,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private Fire _fire; private Fire _fire;
private ProjectileManager _projectileManager; private ProjectileManager _projectileManager;
private Portal _portal; private Portal _portal;
private ArcadeShop _arcadeShop; private ArcadeShop _arcadeShop;
@ -594,19 +594,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
@EventHandler @EventHandler
public void MessageJoin(PlayerJoinEvent event) public void MessageJoin(PlayerJoinEvent event)
{ {
if (_game == null || _game.AnnounceJoinQuit) if (_game != null && _game.AnnounceJoinQuit)
{ event.setJoinMessage(F.sys("Join", GetColor(event.getPlayer()) + event.getPlayer().getName()));
Player player = event.getPlayer();
if (_clientManager.Get(player).GetRank() != Rank.LEGEND)
event.setJoinMessage(null);
else
{
event.setJoinMessage(C.cGreen + C.Bold + "Legend " + player.getName() + " has joined!");
UtilFirework.playFirework(player.getEyeLocation(), org.bukkit.FireworkEffect.Type.BALL_LARGE, Color.LIME, true, true);
player.getWorld().playSound(player.getEyeLocation(), Sound.WITHER_SPAWN, 2f, 1f);
}
}
else else
event.setJoinMessage(null); event.setJoinMessage(null);
} }

View File

@ -149,6 +149,8 @@ public class Bridge extends TeamGame implements OreObsfucation
"The last team alive wins!" "The last team alive wins!"
}); });
this.CompassSpectatorMenu = false;
_ore = new OreHider(); _ore = new OreHider();
// Flags // Flags

View File

@ -1,36 +0,0 @@
package nautilus.game.arcade.game.games.smash.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashKit;
public class KitComingSoon extends SmashKit
{
public KitComingSoon(ArcadeManager manager)
{
super(manager, C.cRed + "Coming Soon", KitAvailability.Gem, 5000,
new String[]
{
},
new Perk[]
{
},
EntityType.VILLAGER,
new ItemStack(Material.IRON_SWORD));
}
@Override
public void GiveItems(Player player)
{
}
}