Skip to content

Commit

Permalink
Fix getLightOpacity being called with incorrect position offset
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Feb 29, 2024
1 parent 18fec61 commit 6eaca76
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.embeddedt.archaicfix.mixins.common.lighting;

import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.EnumSkyBlock;
Expand Down Expand Up @@ -68,10 +67,6 @@ private void setLightForRedirectGenerateSkylightMap(Chunk chunk, EnumSkyBlock ty
LightingHooks.initSkylightForSection(this.worldObj, (Chunk) (Object) this, this.storageArrays[y >> 4]);
}

private int getBlockLightOpacity(int x, int y, int z) {
return this.getBlock(x, y, z).getLightOpacity(this.worldObj, x, y, z);
}

/**
* @reason Overwrites relightBlock with a more efficient implementation.
* @author Angeline
Expand All @@ -85,7 +80,7 @@ public void relightBlock(int x, int y, int z) {
j = y;
}

while (j > 0 && this.getBlockLightOpacity(x, j - 1, z) == 0) {
while (j > 0 && this.func_150808_b(x, j - 1, z) == 0) {
--j;
}

Expand Down Expand Up @@ -354,6 +349,8 @@ public void setLightInitialized(boolean lightInitialized) {

@Shadow private int queuedLightChecks;

@Shadow public abstract int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_);

@Override
public void setSkylightUpdatedPublic() {
for (int i = 0; i < this.updateSkylightColumns.length; ++i)
Expand Down

0 comments on commit 6eaca76

Please sign in to comment.