mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-27 15:30:58 -04:00
Now /highlight just shows red if new block is air, otherwise green. (None of that strange if 'curTile == air')
This commit is contained in:
parent
6bcf192a3b
commit
2e0183e57d
@ -81,15 +81,9 @@ namespace MCGalaxy.Commands {
|
|||||||
DateTime time = node.BaseTime.AddSeconds(item.TimeDelta + seconds);
|
DateTime time = node.BaseTime.AddSeconds(item.TimeDelta + seconds);
|
||||||
if (time < DateTime.UtcNow) return;
|
if (time < DateTime.UtcNow) return;
|
||||||
|
|
||||||
byte b = lvl.GetTile(x, y, z);
|
|
||||||
byte newTile = 0, newExtTile = 0;
|
byte newTile = 0, newExtTile = 0;
|
||||||
item.GetNewExtBlock(out newTile, out newExtTile);
|
item.GetNewExtBlock(out newTile, out newExtTile);
|
||||||
if (b == newTile || Block.Convert(b) == Block.water || Block.Convert(b) == Block.lava) {
|
p.SendBlockchange(x, y, z, newTile == Block.air ? Block.red : Block.green);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
node = node.Prev;
|
node = node.Prev;
|
||||||
}
|
}
|
||||||
|
@ -85,30 +85,8 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void Load() {
|
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")) {
|
if (!File.Exists("properties/economy.properties")) {
|
||||||
Server.s.Log("Economy properties don't exist, creating");
|
Server.s.Log("Economy properties don't exist, creating");
|
||||||
File.Create("properties/economy.properties").Close();
|
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
using (StreamReader r = File.OpenText("properties/economy.properties")) {
|
using (StreamReader r = File.OpenText("properties/economy.properties")) {
|
||||||
@ -159,11 +137,7 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void Save() {
|
public static void Save() {
|
||||||
if (!File.Exists("properties/economy.properties")) { Server.s.Log("Economy properties don't exist, creating"); }
|
using (StreamWriter w = new StreamWriter("properties/economy.properties", false)) {
|
||||||
//Thread.Sleep(2000);
|
|
||||||
File.Delete("properties/economy.properties");
|
|
||||||
//Thread.Sleep(2000);
|
|
||||||
using (StreamWriter w = File.CreateText("properties/economy.properties")) {
|
|
||||||
//enabled
|
//enabled
|
||||||
w.WriteLine("enabled:" + Enabled);
|
w.WriteLine("enabled:" + Enabled);
|
||||||
foreach (Item item in Items) {
|
foreach (Item item in Items) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user