Skip to content

Commit 93c5d3c

Browse files
committed
expand and notify all tile entities
1 parent e88b75d commit 93c5d3c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/gregtech/api/metatileentity/NeighborCacheTileEntityBase.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import gregtech.api.metatileentity.interfaces.INeighborCache;
44

5+
import net.minecraft.block.state.IBlockState;
56
import net.minecraft.tileentity.TileEntity;
67
import net.minecraft.util.EnumFacing;
78
import net.minecraft.util.math.BlockPos;
@@ -31,9 +32,13 @@ public NeighborCacheTileEntityBase() {
3132
protected void invalidateNeighbors(boolean notify) {
3233
if (!this.neighborsInvalidated) {
3334
for (EnumFacing value : EnumFacing.VALUES) {
34-
if (notify && crossesChunk(value) && getNeighbor(value) instanceof INeighborCache neighborCache) {
35+
if (notify && crossesChunk(value)) {
3536
// notify neighbor on a different chunk to invalidate us
36-
neighborCache.onNeighborChanged(value.getOpposite());
37+
TileEntity neighbor = getNeighbor(value);
38+
if (neighbor != null) {
39+
IBlockState state = getWorld().getBlockState(neighbor.getPos());
40+
state.neighborChanged(getWorld(), neighbor.getPos(), getBlockType(), getPos());
41+
}
3742
}
3843
this.neighbors.set(value.getIndex(), INVALID);
3944
}

0 commit comments

Comments
 (0)