Skip to content

Commit

Permalink
Update a few TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Jan 18, 2025
1 parent b7cd843 commit ed78ec1
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 17 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ val FABRIC_LOADER_VERSION by extra { "0.16.4" }
val FABRIC_API_VERSION by extra { "0.103.0+1.21.1" }

// This value can be set to null to disable Parchment.
// TODO: Add Parchment
val PARCHMENT_VERSION by extra { null }

// https://semver.org/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static PathType getNodeTypeFromNeighbors(PathfindingContext context, int
// section is empty or contains any dangerous blocks within the palette. If not, we can assume any checks
// against this chunk section will always fail, allowing us to fast-exit.
if (section == null || PathNodeCache.isSectionSafeAsNeighbor(section)) {
return fallback; //TODO side effects of vanilla's path node caching
return fallback; //TODO side effects of vanilla's path node caching (PathTypeCache maybe has broken invalidation for barely loaded chunks)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.caffeinemc.mods.lithium.common.block;

import net.caffeinemc.mods.lithium.common.tracking.block.SectionedBlockChangeTracker;
import net.minecraft.core.SectionPos;
import net.minecraft.world.level.Level;

public interface BlockListeningSection {
Expand All @@ -10,5 +9,4 @@ public interface BlockListeningSection {

void lithium$removeFromCallback(ListeningBlockStatePredicate blockGroup, SectionedBlockChangeTracker tracker);

void lithium$invalidateListeningSection(SectionPos sectionPos);
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public static VoxelShape getWorldBorderCollision(CollisionGetter collisionView,
//Technically, the supporting block that vanilla calculates and caches is not always the one
// that cancels the downwards motion, but usually it is, and this is only for a quick, additional test.
//TODO: This may lead to the movement attempt not creating any chunk load tickets.
// Entities and pistons **probably** create these tickets elsewhere anyways.
// Entities and pistons **probably** create these tickets elsewhere anyways. This probably also applies
// to usages of ChunkAwareBlockCollisionSweeper and others
VoxelShape voxelShape = supportingBlockCollisionShapeProvider.lithium$getCollisionShapeBelow();
if (voxelShape != null) {
return voxelShape;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SectionedBlockChangeTracker {
private long maxChangeTime;

private int timesRegistered;
//Some sections may not exist / be unloaded. We have to be aware of those. //TODO Invalidation when sections / chunks unload (but the entity does not (?), not sure whether this is possible) -> might be possible with entities riding lazy loaded vehicles and pushed to different chunks
//Some sections may not exist / be unloaded. We have to be aware of those.
boolean isListeningToAll = false;
private ArrayList<SectionPos> sectionsNotListeningTo = null;
private ArrayList<BlockListeningSection> sectionsUnsubscribed = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void onChunkAccessible(ServerLevel serverLevel, LevelChunk levelCh
throw new IllegalStateException("ChunkStatusTracker.onChunkAccessible called on wrong thread!");
}

for (int i = 0; i < LOAD_CALLBACKS.size(); i++) { //TODO confirm this is only called on the server thread...
for (int i = 0; i < LOAD_CALLBACKS.size(); i++) {
LOAD_CALLBACKS.get(i).accept(serverLevel, levelChunk);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* and modification counter comparisons make sure that no outdated cached information is used while avoiding quadratic
* runtime.
* <p>
* TODO: This section can be expended to include a lot more details. The README.md in this package includes a detailed description.
* TODO: This section can be expended to include a lot more details. The README.md in this package includes a detailed description. Needs updating as some stuff doesn't work on neoforge (inventory entity tracking)
*/
@MixinConfigOption(
description = "Reduces hopper lag using caching, notification systems and BlockEntity sleeping",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.caffeinemc.mods.lithium.common.block.*;
import net.caffeinemc.mods.lithium.common.tracking.block.ChunkSectionChangeCallback;
import net.caffeinemc.mods.lithium.common.tracking.block.SectionedBlockChangeTracker;
import net.minecraft.core.SectionPos;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
Expand Down Expand Up @@ -162,12 +161,4 @@ private void updateFlagCounters(int x, int y, int z, BlockState newState, boolea
}
}

@Override
@Unique
public void lithium$invalidateListeningSection(SectionPos sectionPos) {
if (this.listeningMask != 0) {
this.changeListener.onChunkSectionInvalidated(sectionPos);
this.listeningMask = 0;
}
}
}

0 comments on commit ed78ec1

Please sign in to comment.