public static void setEnabled(boolean enabled) {
PipingRules.enabled = enabled;
- if(!enabled)
- currentUpdates.clear();
+ if(!enabled) {
+ synchronized (ruleMutex) {
+ currentUpdates.clear();
+ }
+ }
}
public static boolean isEnabled() {
Vector3d dir = new Vector3d();
dir.sub(currentPos, prevPos);
- boolean simple = currentUpdates.contains(icp);
+ boolean simple;
+ synchronized (ruleMutex) {
+ simple = currentUpdates.contains(icp);
+ }
+
if (simple) {
// Update based on position -> adjust length
double currentLength = (dir.length() - prev.getInlineLength()) * 2.0;