majorly reduce memory allocations during physics update. turns out it was still creating a local variable behind the scenes.

This commit is contained in:
UnknownShadow200 2017-01-16 11:00:17 +11:00
parent 8f6a9a12c6
commit 0ffc6fa4c2

View File

@ -148,7 +148,9 @@ namespace MCGalaxy {
try {
if (PhysicsUpdate != null)
PhysicsUpdate(x, y, z, C.data, this);
OnPhysicsUpdateEvent.Call(x, y, z, C.data, this);
if (OnPhysicsUpdateEvent.handlers.Count > 0)
OnPhysicsUpdateEvent.Call(x, y, z, C.data, this);
if ((C.data.Raw & mask) == 0 || extraHandler(this, ref C)) {
HandlePhysics handler = handlers[blocks[C.b]];
if (handler != null) {