World event prettification and fixes

This commit is contained in:
NewGarbo 2015-11-15 18:19:28 +00:00
parent 2aa7dd13c3
commit c247fe9317
7 changed files with 30 additions and 41 deletions

View File

@ -124,7 +124,7 @@ public class UtilTime
if (type == TimeUnit.DAYS) text = (num = UtilMath.trim(trim, time / 86400000d)) + " Day";
else if (type == TimeUnit.HOURS) text = (num = UtilMath.trim(trim, time / 3600000d)) + " Hour";
else if (type == TimeUnit.MINUTES) text = (num = UtilMath.trim(trim, time / 60000d)) + " Minute";
else if (type == TimeUnit.SECONDS) text = (int) (num = (int) UtilMath.trim(trim, time / 1000d)) + " Second";
else if (type == TimeUnit.SECONDS) text = (int) (num = (int) UtilMath.trim(trim, time / 1000d)) + " Second";
else text = (int) (num = (int) UtilMath.trim(trim, time)) + " Millisecond";
}
else

View File

@ -12,8 +12,8 @@ public class TeleportCommand extends MultiCommandBase<Teleport>
{
public TeleportCommand(Teleport plugin)
{
super(plugin, Rank.ADMIN, "tp", "teleport");
super(plugin, Rank.ADMIN, new Rank[]{Rank.JNR_DEV}, "tp", "teleport");
AddCommand(new AllCommand(plugin));
AddCommand(new BackCommand(plugin));
AddCommand(new HereCommand(plugin));

View File

@ -33,7 +33,6 @@ public class EventTerrainFinder
public Location findAreaInBorderlands(World world, int size, int vert)
{
System.out.println("Starting finding area...");
int borderlandsDist = 31;
int borderlandsWidth = 47 - borderlandsDist;

View File

@ -134,7 +134,7 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
else
{
// Try again in 5 minutes
_nextEventStart = System.currentTimeMillis() + 25000;// 300000;
_nextEventStart = System.currentTimeMillis() + 300000;
}
}
@ -201,7 +201,7 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
private void updateNextEventTime()
{
// 45 Minutes + (0 - 15 Minutes)
long waitTime = 25000;// 2700000L + _random.nextInt(900000);
long waitTime = 2700000L + _random.nextInt(900000);
_nextEventStart = System.currentTimeMillis() + waitTime;
}
@ -225,7 +225,7 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
output.add(" " + C.cWhite + event.getName());
output.add(" " + C.cWhite + locationString);
ArrayList<String> scoreboardLines = event.getScoreboardLines(manager, player, out);
ArrayList<String> scoreboardLines = event.getLines(manager, player, out);
if (scoreboardLines != null)
{
output.addAll(scoreboardLines);
@ -247,21 +247,4 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
{
return _runningEvents;
}
@EventHandler
public void gear(PlayerCommandPreprocessEvent event)
{
if (!event.getPlayer().isOp()) return;
// TODO: Remove
if (event.getMessage().equalsIgnoreCase("/dgear"))
{
PlayerInventory i = event.getPlayer().getInventory();
i.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
i.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
i.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
i.setBoots(new ItemStack(Material.DIAMOND_BOOTS));
i.setItemInHand(new ItemStack(Material.DIAMOND_SWORD));
}
}
}

View File

@ -9,6 +9,7 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.scoreboard.ScoreboardManager;
@ -115,11 +116,6 @@ public class KingHill extends WorldEvent
if (clanCount == 1 && lastClan != null)
{
if (getTicksRunning() % 40 == 0)
{
Bukkit.broadcastMessage(lastClan.getName() + " owns the hill!");
}
CaptureData capData = _scoreMap.get(lastClan);
if (capData == null)
{
@ -128,6 +124,11 @@ public class KingHill extends WorldEvent
}
capData.TicksOnHill++;
if (getTicksRunning() % 40 == 0)
{
Bukkit.broadcastMessage(F.desc("Hill", F.elem(lastClan.getName()) + " own the hill (" + F.time(UtilTime.MakeStr(capData.TicksOnHill*50)) + ")"));
}
GoldManager.getInstance().dropGold(getCenterLocation().clone().add(0, 13, 0), GOLD_PER_TICK);
}
}
@ -136,7 +137,14 @@ public class KingHill extends WorldEvent
public ArrayList<String> getLines(ScoreboardManager manager, Player player, ArrayList<String> out)
{
ArrayList<String> list = new ArrayList<String>(1);
list.add(" Loot in " + UtilTime.convertString(_nextLootDrop - System.currentTimeMillis(), 1, UtilTime.TimeUnit.FIT));
ClanInfo clan = _clansManager.getClan(player);
if (clan != null)
{
list.add(" Time on hill: " + UtilTime.MakeStr(_scoreMap.get(clan).TicksOnHill * 50));
}
return list;
}

View File

@ -3,7 +3,14 @@ package mineplex.game.clans.clans.worldevent.undead;
import java.util.HashSet;
import java.util.Iterator;
import mineplex.core.blockrestore.BlockRestore;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
@ -19,16 +26,6 @@ import mineplex.game.clans.clans.worldevent.undead.creature.UndeadArcher;
import mineplex.game.clans.clans.worldevent.undead.creature.UndeadWarrior;
import mineplex.minecraft.game.core.boss.EventState;
import mineplex.minecraft.game.core.boss.WorldEvent;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.DamageManager;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
public class UndeadCamp extends WorldEvent
{

View File

@ -166,6 +166,7 @@ public abstract class WorldEvent implements Listener, ScoreboardElement
customStart();
}
@Override
public ArrayList<String> getLines(ScoreboardManager manager, Player player, ArrayList<String> out)
{
return null;
@ -408,4 +409,5 @@ public abstract class WorldEvent implements Listener, ScoreboardElement
cancel();
}
}
}