Now /highlight just shows red if new block is air, otherwise green. (None of that strange if 'curTile == air')

This commit is contained in:
UnknownShadow200 2016-03-15 23:54:41 +11:00
parent 6bcf192a3b
commit 2e0183e57d
2 changed files with 2 additions and 34 deletions

View File

@ -81,15 +81,9 @@ namespace MCGalaxy.Commands {
DateTime time = node.BaseTime.AddSeconds(item.TimeDelta + seconds);
if (time < DateTime.UtcNow) return;
byte b = lvl.GetTile(x, y, z);
byte newTile = 0, newExtTile = 0;
item.GetNewExtBlock(out newTile, out newExtTile);
if (b == newTile || Block.Convert(b) == Block.water || Block.Convert(b) == Block.lava) {
if (b == Block.air || Block.Convert(b) == Block.water || Block.Convert(b) == Block.lava)
p.SendBlockchange(x, y, z, Block.red);
else
p.SendBlockchange(x, y, z, Block.green);
}
p.SendBlockchange(x, y, z, newTile == Block.air ? Block.red : Block.green);
}
node = node.Prev;
}

View File

@ -85,30 +85,8 @@ namespace MCGalaxy {
}
public static void Load() {
/*if (loadDatabase) {
retry:
if (Server.useMySQL) MySQL.executeQuery(createTable); else SQLite.executeQuery(createTable); //create database on server loading
string queryP = "SELECT * FROM Players"; string queryE = "SELECT * FROM Economy";
DataTable eco = Server.useMySQL ? MySQL.fillData(queryE) : SQLite.fillData(queryE);
try {
DataTable players = Server.useMySQL ? MySQL.fillData(queryP) : SQLite.fillData(queryP);
if (players.Rows.Count == eco.Rows.Count) { } //move along, nothing to do here
else if (eco.Rows.Count == 0) { //if first time, copy content from player to economy
string query = "INSERT INTO Economy (player, money) SELECT Players.Name, Players.Money FROM Players";
if (Server.useMySQL) MySQL.executeQuery(query); else SQLite.executeQuery(query);
} else {
//this will only be needed when the server shuts down while it was copying content (or some other error)
if (Server.useMySQL) MySQL.executeQuery("DROP TABLE Economy"); else SQLite.executeQuery("DROP TABLE Economy");
goto retry;
}
players.Dispose(); eco.Dispose();
} catch { }
return;
}*/
if (!File.Exists("properties/economy.properties")) {
Server.s.Log("Economy properties don't exist, creating");
File.Create("properties/economy.properties").Close();
Save();
}
using (StreamReader r = File.OpenText("properties/economy.properties")) {
@ -159,11 +137,7 @@ namespace MCGalaxy {
}
public static void Save() {
if (!File.Exists("properties/economy.properties")) { Server.s.Log("Economy properties don't exist, creating"); }
//Thread.Sleep(2000);
File.Delete("properties/economy.properties");
//Thread.Sleep(2000);
using (StreamWriter w = File.CreateText("properties/economy.properties")) {
using (StreamWriter w = new StreamWriter("properties/economy.properties", false)) {
//enabled
w.WriteLine("enabled:" + Enabled);
foreach (Item item in Items) {