mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Synchronize cache access, to be on the safe side.
This commit is contained in:
parent
8e914587e8
commit
4c567e54c3
@ -21,12 +21,12 @@ object RotationHelper {
|
|||||||
inverseTranslationFor(pitch, yaw)(value.ordinal)
|
inverseTranslationFor(pitch, yaw)(value.ordinal)
|
||||||
|
|
||||||
def translationFor(pitch: ForgeDirection, yaw: ForgeDirection) =
|
def translationFor(pitch: ForgeDirection, yaw: ForgeDirection) =
|
||||||
translationCache.
|
translationCache.synchronized(translationCache.
|
||||||
getOrElseUpdate(pitch, mutable.Map.empty).
|
getOrElseUpdate(pitch, mutable.Map.empty).
|
||||||
getOrElseUpdate(yaw, translations(pitch.ordinal)(yaw.ordinal - 2))
|
getOrElseUpdate(yaw, translations(pitch.ordinal)(yaw.ordinal - 2)))
|
||||||
|
|
||||||
def inverseTranslationFor(pitch: ForgeDirection, yaw: ForgeDirection) =
|
def inverseTranslationFor(pitch: ForgeDirection, yaw: ForgeDirection) =
|
||||||
inverseTranslationCache.
|
inverseTranslationCache.synchronized(inverseTranslationCache.
|
||||||
getOrElseUpdate(pitch, mutable.Map.empty).
|
getOrElseUpdate(pitch, mutable.Map.empty).
|
||||||
getOrElseUpdate(yaw, {
|
getOrElseUpdate(yaw, {
|
||||||
val t = translationFor(pitch, yaw)
|
val t = translationFor(pitch, yaw)
|
||||||
@ -35,7 +35,7 @@ object RotationHelper {
|
|||||||
map(t.indexOf).
|
map(t.indexOf).
|
||||||
map(ForgeDirection.getOrientation).
|
map(ForgeDirection.getOrientation).
|
||||||
toArray
|
toArray
|
||||||
})
|
}))
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user