Updated values
Updated teleport mav world value to fit new version of the map. Split themes of multiple words to new lines. Fixed bug where 16+ long lines on scoreboard would get random colors. Seem to have forgotten to include the MavWorldManager earlier... ups.
This commit is contained in:
parent
f9208b67ef
commit
03511a7234
@ -42,7 +42,7 @@ public class MavericksPortalManager extends MiniPlugin
|
||||
|
||||
_cosmeticManager = cosmeticManager;
|
||||
|
||||
_portalHubMavericks = new Box("world", new Vector(6, 72, -1), new Vector(7, 75, 1));
|
||||
_portalHubMavericks = new Box("world", new Vector(6, 74, -1), new Vector(7, 75, 1));
|
||||
_destMavericks = worldManager.getSpawn();
|
||||
|
||||
_portalMavericksHub = new Box(worldManager.getWorld().getName(), new Vector(-5, 20, 306), new Vector(-9, 23, 307));
|
||||
|
@ -0,0 +1,99 @@
|
||||
package mineplex.hub.modules.mavericks;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.event.weather.WeatherChangeEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.worldgen.WorldGenCleanRoom;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
/**
|
||||
* A small world manager for the mavericks world.
|
||||
*/
|
||||
public class MavericksWorldManager extends MiniPlugin
|
||||
{
|
||||
|
||||
private World _world;
|
||||
private Location _spawn;
|
||||
|
||||
public MavericksWorldManager(JavaPlugin plugin)
|
||||
{
|
||||
super("Mavericks World", plugin);
|
||||
|
||||
WorldCreator wc = new WorldCreator("Mav_Stadium");
|
||||
wc.generator(new WorldGenCleanRoom());
|
||||
_world = wc.createWorld();
|
||||
|
||||
_world.setGameRuleValue("doDaylightCycle", "false");
|
||||
_world.setTime(6000);
|
||||
|
||||
_spawn = new Location(_world, 1.5, 20, 287.5, -180, 0);
|
||||
}
|
||||
|
||||
public Location getSpawn()
|
||||
{
|
||||
return _spawn.clone();
|
||||
}
|
||||
|
||||
public World getWorld()
|
||||
{
|
||||
return _world;
|
||||
}
|
||||
|
||||
public boolean isInWorld(Entity e)
|
||||
{
|
||||
return _world.equals(e.getWorld());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onSpawn(CreatureSpawnEvent event)
|
||||
{
|
||||
if(isInWorld(event.getEntity()))
|
||||
{
|
||||
if(event.getSpawnReason() == SpawnReason.CUSTOM) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWeather(WeatherChangeEvent event)
|
||||
{
|
||||
if(!event.getWorld().equals(_world)) return;
|
||||
|
||||
if(!event.toWeatherState()) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void borderCheck(UpdateEvent event)
|
||||
{
|
||||
if(event.getType() != UpdateType.FAST)
|
||||
{
|
||||
for(Player p : _world.getPlayers())
|
||||
{
|
||||
if (UtilMath.offset(p.getLocation(), _world.getSpawnLocation()) > 400)
|
||||
{
|
||||
p.eject();
|
||||
p.leaveVehicle();
|
||||
p.teleport(getSpawn());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1279,7 +1279,10 @@ public class Build extends SoloGame
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cYellow + C.Bold + "Build Theme");
|
||||
Scoreboard.Write(_word);
|
||||
for(String word : _word.split(" "))
|
||||
{
|
||||
Scoreboard.Write(word);
|
||||
}
|
||||
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
|
@ -22,7 +22,7 @@ public class GameScoreboard
|
||||
private Objective _sideObjective;
|
||||
|
||||
private ArrayList<ScoreboardElement> _elements = new ArrayList<ScoreboardElement>();
|
||||
private char[] _chars = "1234567890abcdefghijklmnopqrstuvwxyz".toCharArray();
|
||||
private char[] _chars = "ghijstuvwxyz,.-;:_@*+?=".toCharArray();
|
||||
private ArrayList<String> _previousLines = new ArrayList<String>();
|
||||
|
||||
private String _title;
|
||||
@ -278,7 +278,8 @@ public class GameScoreboard
|
||||
String[] line = split(newLines.get(i));
|
||||
|
||||
team.setPrefix(line[0]);
|
||||
team.setSuffix(line[1]);
|
||||
String lastColor = ChatColor.getLastColors(line[0]);
|
||||
team.setSuffix((lastColor + line[1]));
|
||||
|
||||
if (!score.isScoreSet())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user