mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Remove unused cancel event fields
This commit is contained in:
parent
ab1cdf0913
commit
1fcccda0ca
@ -64,9 +64,7 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static bool cancelload;
|
public static bool cancelload;
|
||||||
public static bool cancelsave;
|
public bool cancelsave;
|
||||||
public static bool cancelphysics;
|
|
||||||
public bool cancelsave1;
|
|
||||||
public bool cancelunload;
|
public bool cancelunload;
|
||||||
public bool changed;
|
public bool changed;
|
||||||
internal bool saveLevel = true;
|
internal bool saveLevel = true;
|
||||||
|
@ -241,7 +241,6 @@ namespace MCGalaxy {
|
|||||||
string path = LevelInfo.MapPath(MapName);
|
string path = LevelInfo.MapPath(MapName);
|
||||||
if (LevelSave != null) LevelSave(this);
|
if (LevelSave != null) LevelSave(this);
|
||||||
OnLevelSaveEvent.Call(this);
|
OnLevelSaveEvent.Call(this);
|
||||||
if (cancelsave1) { cancelsave1 = false; return; }
|
|
||||||
if (cancelsave) { cancelsave = false; return; }
|
if (cancelsave) { cancelsave = false; return; }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -19,11 +19,6 @@ namespace MCGalaxy.Events {
|
|||||||
|
|
||||||
/// <summary> These are server event that can be canceled </summary>
|
/// <summary> These are server event that can be canceled </summary>
|
||||||
public enum ServerEvents {
|
public enum ServerEvents {
|
||||||
//TODO
|
|
||||||
//Make these do things
|
|
||||||
ServerLog,
|
|
||||||
ServerOpLog,
|
|
||||||
ServerAdminLog,
|
|
||||||
ConsoleCommand
|
ConsoleCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +38,6 @@ namespace MCGalaxy.Events {
|
|||||||
/// <summary> These are Global (static) level events that can be canceled </summary>
|
/// <summary> These are Global (static) level events that can be canceled </summary>
|
||||||
public enum GlobalLevelEvents {
|
public enum GlobalLevelEvents {
|
||||||
LevelLoad,
|
LevelLoad,
|
||||||
LevelSave
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> These are level events that can be canceled </summary>
|
/// <summary> These are level events that can be canceled </summary>
|
||||||
|
@ -57,9 +57,6 @@ namespace MCGalaxy {
|
|||||||
public static void CancelServerEvent(ServerEvents e) {
|
public static void CancelServerEvent(ServerEvents e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case ServerEvents.ConsoleCommand: Server.cancelcommand = true; break;
|
case ServerEvents.ConsoleCommand: Server.cancelcommand = true; break;
|
||||||
case ServerEvents.ServerAdminLog: Server.canceladmin = true; break;
|
|
||||||
case ServerEvents.ServerLog: Server.cancellog = true; break;
|
|
||||||
case ServerEvents.ServerOpLog: Server.canceloplog = true; break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,9 +64,6 @@ namespace MCGalaxy {
|
|||||||
public static bool IsServerEventCanceled(ServerEvents e) {
|
public static bool IsServerEventCanceled(ServerEvents e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case ServerEvents.ConsoleCommand: return Server.cancelcommand;
|
case ServerEvents.ConsoleCommand: return Server.cancelcommand;
|
||||||
case ServerEvents.ServerAdminLog: return Server.canceladmin;
|
|
||||||
case ServerEvents.ServerLog: return Server.cancellog;
|
|
||||||
case ServerEvents.ServerOpLog: return Server.canceloplog;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -79,7 +73,7 @@ namespace MCGalaxy {
|
|||||||
public static void CancelLevelEvent(LevelEvents e, Level l) {
|
public static void CancelLevelEvent(LevelEvents e, Level l) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case LevelEvents.LevelUnload: l.cancelunload = true; break;
|
case LevelEvents.LevelUnload: l.cancelunload = true; break;
|
||||||
case LevelEvents.LevelSave: l.cancelsave1 = true; break;
|
case LevelEvents.LevelSave: l.cancelsave = true; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +81,7 @@ namespace MCGalaxy {
|
|||||||
public static bool IsLevelEventCancel(LevelEvents e, Level l) {
|
public static bool IsLevelEventCancel(LevelEvents e, Level l) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case LevelEvents.LevelUnload: return l.cancelunload;
|
case LevelEvents.LevelUnload: return l.cancelunload;
|
||||||
case LevelEvents.LevelSave: return l.cancelsave1;
|
case LevelEvents.LevelSave: return l.cancelsave;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -97,7 +91,6 @@ namespace MCGalaxy {
|
|||||||
public static void CancelGlobalLevelEvent(GlobalLevelEvents e) {
|
public static void CancelGlobalLevelEvent(GlobalLevelEvents e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case GlobalLevelEvents.LevelLoad: Level.cancelload = true; break;
|
case GlobalLevelEvents.LevelLoad: Level.cancelload = true; break;
|
||||||
case GlobalLevelEvents.LevelSave: Level.cancelsave = true; break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +98,6 @@ namespace MCGalaxy {
|
|||||||
public static bool IsGlobalLevelEventCanceled(GlobalLevelEvents e) {
|
public static bool IsGlobalLevelEventCanceled(GlobalLevelEvents e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case GlobalLevelEvents.LevelLoad: return Level.cancelload;
|
case GlobalLevelEvents.LevelLoad: return Level.cancelload;
|
||||||
case GlobalLevelEvents.LevelSave: return Level.cancelsave;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -24,11 +24,7 @@ using MCGalaxy.Tasks;
|
|||||||
|
|
||||||
namespace MCGalaxy {
|
namespace MCGalaxy {
|
||||||
public sealed partial class Server {
|
public sealed partial class Server {
|
||||||
public static bool cancelcommand;
|
public static bool cancelcommand;
|
||||||
public static bool canceladmin;
|
|
||||||
public static bool cancellog;
|
|
||||||
public static bool canceloplog;
|
|
||||||
|
|
||||||
public delegate void OnConsoleCommand(string cmd, string message);
|
public delegate void OnConsoleCommand(string cmd, string message);
|
||||||
public static event OnConsoleCommand ConsoleCommand;
|
public static event OnConsoleCommand ConsoleCommand;
|
||||||
public delegate void MessageEventHandler(string message);
|
public delegate void MessageEventHandler(string message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user