Skip to content

Commit 3baa231

Browse files
committed
Fix rust overflow
* This stops sub level data from being uploaded to rust for every single block * This fixes an integer overflow that happens because the plot bounds have not been set yet
1 parent df9771e commit 3baa231

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

common/src/main/java/dev/ryanhcode/sable/sublevel/system/SubLevelPhysicsSystem.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
import dev.ryanhcode.sable.Sable;
44
import dev.ryanhcode.sable.SableConfig;
5-
import dev.ryanhcode.sable.api.SubLevelHelper;
65
import dev.ryanhcode.sable.api.block.BlockEntitySubLevelActor;
7-
import dev.ryanhcode.sable.companion.math.BoundingBox3d;
8-
import dev.ryanhcode.sable.companion.math.BoundingBox3dc;
9-
import dev.ryanhcode.sable.companion.math.Pose3d;
106
import dev.ryanhcode.sable.api.physics.PhysicsPipeline;
117
import dev.ryanhcode.sable.api.physics.handle.RigidBodyHandle;
128
import dev.ryanhcode.sable.api.physics.mass.MassTracker;
139
import dev.ryanhcode.sable.api.physics.object.ArbitraryPhysicsObject;
1410
import dev.ryanhcode.sable.api.sublevel.ServerSubLevelContainer;
1511
import dev.ryanhcode.sable.api.sublevel.SubLevelContainer;
1612
import dev.ryanhcode.sable.api.sublevel.SubLevelObserver;
13+
import dev.ryanhcode.sable.companion.math.BoundingBox3d;
14+
import dev.ryanhcode.sable.companion.math.BoundingBox3dc;
15+
import dev.ryanhcode.sable.companion.math.Pose3d;
1716
import dev.ryanhcode.sable.mixinterface.plot.SubLevelContainerHolder;
1817
import dev.ryanhcode.sable.mixinterface.toast.SableToastableServer;
1918
import dev.ryanhcode.sable.physics.config.PhysicsConfigData;
@@ -506,9 +505,8 @@ public void updateMassDataFromBlockChange(final SubLevel subLevel, final BlockPo
506505
return;
507506
}
508507

509-
serverSubLevel.updateMergedMassData((float) this.getPartialPhysicsTick());
510-
511508
if (notifyPipeline) {
509+
serverSubLevel.updateMergedMassData((float) this.getPartialPhysicsTick());
512510
this.pipeline.onStatsChanged(serverSubLevel);
513511
}
514512
}

0 commit comments

Comments
 (0)