-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
519 additions
and
1,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Hosihikari.Minecraft.Extension.Async; | ||
|
||
public static class AsyncPlayer { } | ||
// namespace Hosihikari.Minecraft.Extension.Async; | ||
// | ||
// public static class AsyncPlayer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
namespace Hosihikari.Minecraft.Extension.Async; | ||
|
||
public class Core | ||
public static class Core | ||
{ | ||
/// <summary> | ||
/// Queue in thread pool. | ||
/// Queue in thread pool. | ||
/// </summary> | ||
public static void QueueWorkItem(Action act) | ||
{ | ||
ThreadPool.QueueUserWorkItem( | ||
x => | ||
Task.Run(() => | ||
{ | ||
try | ||
{ | ||
act(); | ||
} | ||
catch (Exception) | ||
{ | ||
try | ||
{ | ||
x(); | ||
//Console.WriteLineErr(nameof(Async), ex, methodName, file, line); | ||
} | ||
catch (Exception) | ||
catch | ||
{ | ||
try | ||
{ | ||
//Console.WriteLineErr(nameof(Async), ex, methodName, file, line); | ||
} | ||
catch | ||
{ | ||
// ignored | ||
} | ||
// ignored | ||
} | ||
}, | ||
act, | ||
true | ||
); | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
using System.Runtime.CompilerServices; | ||
using Hosihikari.Minecraft.Extension.PackHelper; | ||
using Hosihikari.Minecraft.Extension.GlobalService; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace Hosihikari.Minecraft.Extension; | ||
|
||
internal class EntryPoint | ||
internal static class EntryPoint | ||
{ | ||
#pragma warning disable CA2255 | ||
[ModuleInitializer] | ||
#pragma warning restore CA2255 | ||
internal static void Main() // must be loaded | ||
{ | ||
LevelTick.InitHook(); | ||
GlobalService.Global.Init(); | ||
Global.Init(); | ||
PackHelper.PackHelper.Init(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.