Skip to content

Commit

Permalink
Revert changing fields to static. Only cache on client.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Apr 29, 2024
1 parent 2dfb893 commit 5132d66
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class TPartialOcclusionTile extends TileMultipart {
// Normal occlusion operations happen infrequently enough that this is not a performance concern during normal gameplay.
// TODO, Figure out how to cleanly nuke this and do caching inside MicroblockRender.
@Nullable
private Iterable<MultiPart> lastTestParts = null;
private static Iterable<MultiPart> lastTestParts = null;
@Nullable
private VoxelShape lastTestShape = null;
private boolean lastTestResult = false;
private static VoxelShape lastTestShape = null;
private static boolean lastTestResult = false;

public TPartialOcclusionTile(BlockPos pos, BlockState state) {
super(pos, state);
Expand All @@ -46,7 +46,7 @@ public void markShapeChange() {
public boolean occlusionTest(Iterable<MultiPart> parts, MultiPart npart) {
if (npart instanceof PartialOcclusionPart newPart) {
VoxelShape newShape = newPart.getPartialOcclusionShape();
if (lastTestParts != parts || lastTestShape != newShape) {
if (!level.isClientSide() || lastTestParts != parts || lastTestShape != newShape) {
lastTestParts = parts;
lastTestShape = newShape;
lastTestResult = partialOcclusionTest(parts, newPart);
Expand Down

0 comments on commit 5132d66

Please sign in to comment.