Fixed pre-game itemblocks, added grace period
This commit is contained in:
parent
ad429166a8
commit
c70e5d500f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/me/Travja/HungerArena/Main$3$2.class
Normal file
BIN
bin/me/Travja/HungerArena/Main$3$2.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -43,6 +43,9 @@ Countdown: 'true'
|
|||||||
# Duration of the countdown .
|
# Duration of the countdown .
|
||||||
Countdown_Timer: 15
|
Countdown_Timer: 15
|
||||||
|
|
||||||
|
# How long the grace period should last (seconds)
|
||||||
|
Grace_Period: 60
|
||||||
|
|
||||||
# Whether or not players can break ANY blocks while playing
|
# Whether or not players can break ANY blocks while playing
|
||||||
Protected_Arena: 'true'
|
Protected_Arena: 'true'
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public class BlockStorage implements Listener {
|
|||||||
boolean protall = false;
|
boolean protall = false;
|
||||||
if (plugin.config.getString("Protected_Arena_Always").equalsIgnoreCase("True")) { /* Jeppa Fix/Add */
|
if (plugin.config.getString("Protected_Arena_Always").equalsIgnoreCase("True")) { /* Jeppa Fix/Add */
|
||||||
protall = true;
|
protall = true;
|
||||||
if(!p.hasPermission("HungerArena.arena") && plugin.getArena(p) != null){
|
if(!p.hasPermission("HungerArena.arena")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage("You can't break blocks, at all, if you feel this should change, talk to the server owner.");
|
p.sendMessage("You can't break blocks, at all, if you feel this should change, talk to the server owner.");
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,8 @@ public class Main extends JavaPlugin{
|
|||||||
int deathtime = 0;
|
int deathtime = 0;
|
||||||
int timetodeath = 0;
|
int timetodeath = 0;
|
||||||
int a = 0;
|
int a = 0;
|
||||||
|
public int gp = 0;
|
||||||
|
int grace = 0;
|
||||||
public void onEnable(){
|
public void onEnable(){
|
||||||
log = this.getLogger();
|
log = this.getLogger();
|
||||||
config = this.getConfig();
|
config = this.getConfig();
|
||||||
@ -114,7 +116,6 @@ public class Main extends JavaPlugin{
|
|||||||
getCommand("Sponsor").setExecutor(SponsorCommands);
|
getCommand("Sponsor").setExecutor(SponsorCommands);
|
||||||
getCommand("Startpoint").setExecutor(SpawnsCommand);
|
getCommand("Startpoint").setExecutor(SpawnsCommand);
|
||||||
i = 1;
|
i = 1;
|
||||||
//TODO THIS CRAP /* Jeppa: Wasn't this already done ??? */
|
|
||||||
if(spawns.getConfigurationSection("Spawns")!= null){
|
if(spawns.getConfigurationSection("Spawns")!= null){
|
||||||
Map<String, Object> temp = spawns.getConfigurationSection("Spawns").getValues(false);
|
Map<String, Object> temp = spawns.getConfigurationSection("Spawns").getValues(false);
|
||||||
for(Entry<String, Object> entry: temp.entrySet()){
|
for(Entry<String, Object> entry: temp.entrySet()){
|
||||||
@ -429,6 +430,30 @@ public class Main extends JavaPlugin{
|
|||||||
}
|
}
|
||||||
getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha Refill " + a);
|
getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha Refill " + a);
|
||||||
getServer().getScheduler().cancelTask(start);
|
getServer().getScheduler().cancelTask(start);
|
||||||
|
if(config.getInt("Grace_Period")!= 0){
|
||||||
|
gp = config.getInt("Grace_Period");
|
||||||
|
grace = getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getPluginManager().getPlugin("HungerArena"), new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
gp = gp-1;
|
||||||
|
if(gp == 30 || gp == 15 || (gp < 11 && gp != 0)){
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
for(Player wp: location.get(a).get(1).getWorld().getPlayers()){
|
||||||
|
wp.sendMessage(ChatColor.GREEN + "Grace period ends in " + gp + " seconds!");
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
getServer().broadcastMessage(ChatColor.GREEN + "Grace period ends in " + gp + " seconds!");
|
||||||
|
}
|
||||||
|
if(gp == 0){
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
for(Player wp: location.get(a).get(1).getWorld().getPlayers()){
|
||||||
|
wp.sendMessage(ChatColor.GREEN + "Grace period is over, FIGHT!");
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
getServer().broadcastMessage(ChatColor.GREEN + "Grace period is over, FIGHT!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},20L, 20L);
|
||||||
|
}
|
||||||
if(config.getInt("DeathMatch")!= 0){
|
if(config.getInt("DeathMatch")!= 0){
|
||||||
int death = config.getInt("DeathMatch");
|
int death = config.getInt("DeathMatch");
|
||||||
timetodeath = death;
|
timetodeath = death;
|
||||||
@ -436,7 +461,7 @@ public class Main extends JavaPlugin{
|
|||||||
public void run(){
|
public void run(){
|
||||||
timetodeath = timetodeath-1;
|
timetodeath = timetodeath-1;
|
||||||
if(config.getBoolean("broadcastAll")){
|
if(config.getBoolean("broadcastAll")){
|
||||||
for(Player wp: location.get(a).get(0).getWorld().getPlayers()){
|
for(Player wp: location.get(a).get(1).getWorld().getPlayers()){
|
||||||
if(timetodeath!= 0){
|
if(timetodeath!= 0){
|
||||||
wp.sendMessage(ChatColor.RED + String.valueOf(timetodeath) + " mins till the death match!");
|
wp.sendMessage(ChatColor.RED + String.valueOf(timetodeath) + " mins till the death match!");
|
||||||
}
|
}
|
||||||
@ -494,9 +519,9 @@ public class Main extends JavaPlugin{
|
|||||||
}
|
}
|
||||||
public Integer getArena(Player p){
|
public Integer getArena(Player p){
|
||||||
for (int x: Playing.keySet()) {
|
for (int x: Playing.keySet()) {
|
||||||
if (Playing.get(x).contains(p.getName())){
|
if (Playing.get(x).contains(p.getName())){
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user