UHC!!!!!
This commit is contained in:
parent
32338cfce4
commit
e1dd3a318e
@ -98,10 +98,10 @@ public class InventoryRepository extends RepositoryBase
|
||||
|
||||
public boolean incrementClientInventoryItem(int accountId, int itemId, int count)
|
||||
{
|
||||
System.out.println("Updating " + accountId + "'s " + itemId + " with " + count);
|
||||
//System.out.println("Updating " + accountId + "'s " + itemId + " with " + count);
|
||||
if (executeUpdate(UPDATE_CLIENT_INVENTORY, new ColumnInt("count", count), new ColumnInt("id", accountId), new ColumnInt("itemid", itemId)) < 1)
|
||||
{
|
||||
System.out.println("Inserting " + accountId + "'s " + itemId + " with " + count);
|
||||
//System.out.println("Inserting " + accountId + "'s " + itemId + " with " + count);
|
||||
return executeUpdate(INSERT_CLIENT_INVENTORY, new ColumnInt("id", accountId), new ColumnInt("itemid", itemId), new ColumnInt("count", count)) > 0;
|
||||
}
|
||||
else
|
||||
|
@ -54,6 +54,7 @@ public class GameTeam
|
||||
}
|
||||
|
||||
private String _name;
|
||||
private String _displayName;
|
||||
private ChatColor _color;
|
||||
|
||||
private HashMap<Player, PlayerState> _players = new HashMap<Player, PlayerState>();
|
||||
@ -75,6 +76,7 @@ public class GameTeam
|
||||
{
|
||||
Host = host;
|
||||
|
||||
_displayName = name;
|
||||
_name = name;
|
||||
_color = color;
|
||||
_spawns = spawns;
|
||||
@ -139,7 +141,7 @@ public class GameTeam
|
||||
{
|
||||
_players.put(player, in ? PlayerState.IN : PlayerState.OUT);
|
||||
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + "You joined " + _name + " Team."));
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + "You joined " + _displayName + " Team."));
|
||||
|
||||
VisibilityManager.Instance.refreshPlayerToAll(player);
|
||||
}
|
||||
@ -147,7 +149,7 @@ public class GameTeam
|
||||
public void DisbandTeam()
|
||||
{
|
||||
for (Player player : _players.keySet())
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + _name + " Team was disbanded."));
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + _displayName + " Team was disbanded."));
|
||||
|
||||
_players.clear();
|
||||
}
|
||||
@ -269,6 +271,11 @@ public class GameTeam
|
||||
{
|
||||
_name = name;
|
||||
}
|
||||
|
||||
public void setDisplayName(String name)
|
||||
{
|
||||
_displayName = name;
|
||||
}
|
||||
|
||||
public byte GetColorData()
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ public class UHC extends TeamGame
|
||||
|
||||
private boolean _mapLoaded = false;
|
||||
private double _mapLoadPercent = 0;
|
||||
private int _chunksPerTick = 2;
|
||||
private int _chunksPerTick = 1;
|
||||
private int _chunkTotal;
|
||||
private Chunk _chunk = null;
|
||||
private int _chunkX = 0;
|
||||
@ -401,9 +401,10 @@ public class UHC extends TeamGame
|
||||
return;
|
||||
|
||||
// Print Debug
|
||||
if (event.getType() == UpdateType.SLOW)
|
||||
if (event.getType() == UpdateType.SLOWER)
|
||||
{
|
||||
System.out.println("Map Generation: " + _chunksLoaded + "/" + _chunkTotal);
|
||||
Announce(C.cGreen + C.Bold + "Generating Map: " + C.cWhite + getMapLoadETA() + " Remaining...", false);
|
||||
|
||||
TimingManager.endTotal("UHC Generation", true);
|
||||
return;
|
||||
}
|
||||
@ -1660,7 +1661,7 @@ public class UHC extends TeamGame
|
||||
{
|
||||
int chunksToGo = _chunkTotal - _chunksLoaded;
|
||||
|
||||
return UtilTime.MakeStr((long) ((double)chunksToGo / (double)(2 * 20) * 1000d), 1);
|
||||
return UtilTime.MakeStr((long) ((double)chunksToGo / (double)(_chunksPerTick * 20) * 1000d), 1);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
@ -1734,11 +1735,14 @@ public class UHC extends TeamGame
|
||||
|
||||
//Get Team
|
||||
GameTeam team = getEmptyTeam();
|
||||
//team.SetName(player.getName() + " & " + ally.getName());
|
||||
|
||||
if (team == null)
|
||||
return;
|
||||
|
||||
//Join Team
|
||||
SetPlayerTeam(player, team, true);
|
||||
SetPlayerTeam(ally, team, true);
|
||||
|
||||
team.setDisplayName(player.getName() + " & " + ally.getName());
|
||||
}
|
||||
//Send Invite
|
||||
else
|
||||
|
@ -93,7 +93,8 @@ public class WorldData
|
||||
FileUtil.DeleteFolder(dir);
|
||||
|
||||
dir = new File(GetFolder() + "/level.dat");
|
||||
dir.delete();
|
||||
if (dir.exists())
|
||||
dir.delete();
|
||||
|
||||
//Create Fresh World with Random Seed
|
||||
WorldCreator creator = new WorldCreator(GetFolder());
|
||||
|
Loading…
Reference in New Issue
Block a user