Queueing now works with less players than teams.
Added DragonName text-input for hub Fixed smash bug, where spectators were causing lightning effect
This commit is contained in:
parent
30c5267da2
commit
72bec77237
|
@ -34,6 +34,9 @@ public class Dragon extends MiniPlugin
|
||||||
public double RangeBest = 1000;
|
public double RangeBest = 1000;
|
||||||
public long RangeTime = 0;
|
public long RangeTime = 0;
|
||||||
|
|
||||||
|
public int textA = 0;
|
||||||
|
public int textB = 0;
|
||||||
|
|
||||||
public Dragon(HubManager manager)
|
public Dragon(HubManager manager)
|
||||||
{
|
{
|
||||||
super("Dragon Manager", manager.GetPlugin());
|
super("Dragon Manager", manager.GetPlugin());
|
||||||
|
@ -98,15 +101,21 @@ public class Dragon extends MiniPlugin
|
||||||
if (Dragon == null || !Dragon.isValid())
|
if (Dragon == null || !Dragon.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ChatColor color = ChatColor.RED;
|
ChatColor aCol = ChatColor.RED;
|
||||||
double r = Math.random();
|
if (textA == 1) aCol = ChatColor.GOLD;
|
||||||
if (r > 0.83) color = ChatColor.GOLD;
|
else if (textA == 2) aCol = ChatColor.YELLOW;
|
||||||
else if (r > 0.66) color = ChatColor.YELLOW;
|
else if (textA == 3) aCol = ChatColor.GREEN;
|
||||||
else if (r > 0.49) color = ChatColor.GREEN;
|
else if (textA == 4) aCol = ChatColor.AQUA;
|
||||||
else if (r > 0.32) color = ChatColor.AQUA;
|
else if (textA == 5) aCol = ChatColor.LIGHT_PURPLE;
|
||||||
else if (r > 0.16) color = ChatColor.LIGHT_PURPLE;
|
|
||||||
|
|
||||||
Dragon.setCustomName(color + C.Bold + C.Line + "Welcome to Mineplex - Home of Premium Quality Minigames");
|
textA = (textA+1)%6;
|
||||||
|
|
||||||
|
ChatColor bCol = ChatColor.GREEN;
|
||||||
|
if (textB > 6) bCol = ChatColor.WHITE;
|
||||||
|
|
||||||
|
textB = (textB+1)%14;
|
||||||
|
|
||||||
|
Dragon.setCustomName(aCol + C.Bold + C.Line + Manager.DragonTextA +ChatColor.RESET + " - " + bCol + C.Bold + C.Line + Manager.DragonTextB);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Turn()
|
private void Turn()
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
package mineplex.hub;
|
package mineplex.hub;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
@ -67,6 +74,9 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||||
|
|
||||||
private String _pigStacker = "0 - Nobody";
|
private String _pigStacker = "0 - Nobody";
|
||||||
|
|
||||||
|
public String DragonTextA = "Mineplex";
|
||||||
|
public String DragonTextB = "";
|
||||||
|
|
||||||
private HashSet<LivingEntity> _mobs = new HashSet<LivingEntity>();
|
private HashSet<LivingEntity> _mobs = new HashSet<LivingEntity>();
|
||||||
|
|
||||||
public HubManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, DisguiseManager disguiseManager)
|
public HubManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, DisguiseManager disguiseManager)
|
||||||
|
@ -81,8 +91,53 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||||
|
|
||||||
new TextCreator(this);
|
new TextCreator(this);
|
||||||
new Dragon(this);
|
new Dragon(this);
|
||||||
|
|
||||||
|
DragonTextB = GetDragonText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String GetDragonText()
|
||||||
|
{
|
||||||
|
File file = new File("DragonText.dat");
|
||||||
|
|
||||||
|
//Write If Blank
|
||||||
|
if (!file.exists())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileWriter fstream = new FileWriter(file);
|
||||||
|
BufferedWriter out = new BufferedWriter(fstream);
|
||||||
|
|
||||||
|
out.write("Home of Premium Game Modes");
|
||||||
|
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
System.out.println("Error: Game World GetId Write Exception");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String line = "Home of Premium Game Modes";
|
||||||
|
|
||||||
|
//Read
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileInputStream fstream = new FileInputStream(file);
|
||||||
|
DataInputStream in = new DataInputStream(fstream);
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
||||||
|
line = br.readLine();
|
||||||
|
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
System.out.println("Error: Game World GetId Read Exception");
|
||||||
|
}
|
||||||
|
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void PlayerRespawn(PlayerRespawnEvent event)
|
public void PlayerRespawn(PlayerRespawnEvent event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -739,7 +739,7 @@ public abstract class Game implements Listener
|
||||||
|
|
||||||
public boolean CanJoinTeam(GameTeam team)
|
public boolean CanJoinTeam(GameTeam team)
|
||||||
{
|
{
|
||||||
return team.GetSize() < UtilServer.getPlayers().length/GetTeamList().size();
|
return team.GetSize() < Math.max(1, UtilServer.getPlayers().length/GetTeamList().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameTeam GetTeamPreference(Player player)
|
public GameTeam GetTeamPreference(Player player)
|
||||||
|
|
|
@ -162,6 +162,9 @@ public class SuperSmash extends SoloGame
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void FallDamage(CustomDamageEvent event)
|
public void FallDamage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
|
if (event.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.GetCause() == DamageCause.FALL)
|
if (event.GetCause() == DamageCause.FALL)
|
||||||
event.SetCancelled("No Fall Damage");
|
event.SetCancelled("No Fall Damage");
|
||||||
}
|
}
|
||||||
|
@ -169,8 +172,18 @@ public class SuperSmash extends SoloGame
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void Knockback(CustomDamageEvent event)
|
public void Knockback(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
|
if (event.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.GetDamageePlayer() != null)
|
if (event.GetDamageePlayer() != null)
|
||||||
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
|
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
|
public void ArenaWalls(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
if (event.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.GetCause() == DamageCause.VOID || event.GetCause() == DamageCause.LAVA)
|
if (event.GetCause() == DamageCause.VOID || event.GetCause() == DamageCause.LAVA)
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class GameManager implements Listener
|
||||||
if (game.GetCountdown() == -1)
|
if (game.GetCountdown() == -1)
|
||||||
{
|
{
|
||||||
game.InformQueuePositions();
|
game.InformQueuePositions();
|
||||||
game.AnnounceGame();
|
//game.AnnounceGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Initialise Countdown
|
//Initialise Countdown
|
||||||
|
|
Loading…
Reference in New Issue