Fix bad particle light colouring

Swapped the light variables by accident
This commit is contained in:
Spottedleaf
2023-08-12 03:42:39 -07:00
parent 7c753abdb6
commit d4248d54bb
3 changed files with 15 additions and 10 deletions

View File

@@ -57,17 +57,17 @@ public abstract class LevelMixin implements CollisionLevel, CollisionEntityGette
private int maxSection;
@Override
public EntityLookup getCollisionLookup() {
public final EntityLookup getCollisionLookup() {
return this.collisionLookup;
}
@Override
public int getMinSectionMoonrise() {
public final int getMinSectionMoonrise() {
return this.minSection;
}
@Override
public int getMaxSectionMoonrise() {
public final int getMaxSectionMoonrise() {
return this.maxSection;
}

View File

@@ -123,9 +123,9 @@ public abstract class ParticleMixin {
final StarLightInterface lightEngine = ((StarLightLightingProvider)this.level.getLightEngine()).getLightEngine();
final int blockLight = Math.max(lightEngine.getBlockLightValue(pos, chunk), blockState == null ? 0 : blockState.getLightEmission());
final int skyLight = lightEngine.getSkyLightValue(pos, chunk);
final int skyLight = chunk == null ? 0 : lightEngine.getSkyLightValue(pos, chunk);
final int blockLight = Math.max(chunk == null ? 0 : lightEngine.getBlockLightValue(pos, chunk), blockState == null ? 0 : blockState.getLightEmission());
return blockLight << 20 | skyLight << 4;
return skyLight << 20 | blockLight << 4;
}
}

View File

@@ -249,10 +249,15 @@ public abstract class ExplosionMixin {
if (!((CollisionBlockState)blockState).emptyCollisionShape()) {
VoxelShape collision = cachedBlock.cachedCollisionShape;
if (collision == null) {
collision = blockState.getCollisionShape(this.level, currPos, context);
if (!context.isDelegated()) {
// if it was not delegated during this call, assume that for any future ones it will not be delegated
// again, and cache the result
collision = ((CollisionBlockState)blockState).getConstantCollisionShape();
if (collision == null) {
collision = blockState.getCollisionShape(this.level, currPos, context);
if (!context.isDelegated()) {
// if it was not delegated during this call, assume that for any future ones it will not be delegated
// again, and cache the result
cachedBlock.cachedCollisionShape = collision;
}
} else {
cachedBlock.cachedCollisionShape = collision;
}
}