mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Improve rotation performance for worlds using jigsaw
This commit is contained in:
parent
36f56c2040
commit
6cd4b7c433
@ -16,7 +16,7 @@ public class PlannedStructure {
|
||||
private IrisJigsawStructure structure;
|
||||
private IrisPosition position;
|
||||
private IrisDataManager data;
|
||||
private KMap<String, IrisObject> objectRotationCache;
|
||||
private static KMap<String, IrisObject> objectRotationCache;
|
||||
private RNG rng;
|
||||
private boolean verbose;
|
||||
private boolean terminating;
|
||||
@ -368,12 +368,17 @@ public class PlannedStructure {
|
||||
return false;
|
||||
}
|
||||
|
||||
public IrisObject rotated(IrisJigsawPiece piece, IrisObjectRotation rotation) {
|
||||
public synchronized IrisObject rotated(IrisJigsawPiece piece, IrisObjectRotation rotation) {
|
||||
String key = piece.getObject() + "-" + rotation.hashCode();
|
||||
|
||||
if(objectRotationCache.containsKey(key))
|
||||
{
|
||||
return objectRotationCache.get(key);
|
||||
IrisObject o = objectRotationCache.get(key);
|
||||
|
||||
if(o != null)
|
||||
{
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
IrisObject o = rotation.rotateCopy(data.getObjectLoader().load(piece.getObject()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user