mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 20:45:10 +01:00
Contraptions were too lit
- Fix bug causing potentially moving contraptions to re-upload their light every tick - Reduces tick stutter with large amounts of contraptions
This commit is contained in:
parent
eb74505ce8
commit
9ca26d674c
@ -24,7 +24,7 @@ public abstract class ContraptionLighter<C extends Contraption> implements Light
|
||||
lightUpdater = LightUpdater.get(contraption.entity.level);
|
||||
|
||||
bounds = getContraptionBounds();
|
||||
growBoundsForEdgeData();
|
||||
growBoundsForEdgeData(bounds);
|
||||
|
||||
lightVolume = new GPULightVolume(bounds);
|
||||
|
||||
@ -51,7 +51,7 @@ public abstract class ContraptionLighter<C extends Contraption> implements Light
|
||||
lightVolume.onLightPacket(world, chunkX, chunkZ);
|
||||
}
|
||||
|
||||
protected void growBoundsForEdgeData() {
|
||||
protected static void growBoundsForEdgeData(GridAlignedBB bounds) {
|
||||
// so we have at least enough data on the edges to avoid artifacts and have smooth lighting
|
||||
bounds.grow(2);
|
||||
}
|
||||
|
@ -18,11 +18,11 @@ public class NonStationaryLighter<C extends Contraption> extends ContraptionLigh
|
||||
|
||||
ImmutableBox contraptionBounds = getContraptionBounds();
|
||||
|
||||
if (bounds.sameAs(contraptionBounds)) {
|
||||
if (bounds.sameAs(contraptionBounds, 2)) {
|
||||
return false;
|
||||
}
|
||||
bounds.assign(contraptionBounds);
|
||||
growBoundsForEdgeData();
|
||||
growBoundsForEdgeData(bounds);
|
||||
|
||||
lightVolume.move(provider, bounds);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user