Skip to content

Commit c0365d0

Browse files
committed
updated ItemVaultBlockEntity neighbour updates to reflect changes to Fabricators-of-Create/Porting-Lib#179
1 parent 6151378 commit c0365d0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/main/java/com/simibubi/create/content/logistics/vault/ItemVaultBlockEntity.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import java.util.List;
55
import java.util.Set;
66

7+
import io.github.fabricators_of_create.porting_lib.block.NeighborChangeListeningBlock;
8+
79
import org.jetbrains.annotations.Nullable;
810

911
import com.simibubi.create.AllBlockEntityTypes;
@@ -162,12 +164,14 @@ private static void updateComaratorsInner(Level level, Block provokingBlock, Blo
162164
}
163165

164166
BlockState blockstate = level.getBlockState(updatePos);
165-
blockstate.onNeighborChange(level, updatePos, provokingPos);
166-
if (blockstate.isRedstoneConductor(level, updatePos)) {
167-
updatePos.move(direction);
168-
blockstate = level.getBlockState(updatePos);
169-
if (blockstate.getWeakChanges(level, updatePos)) {
170-
level.neighborChanged(blockstate, updatePos, provokingBlock, provokingPos, false);
167+
if (blockstate.getBlock() instanceof NeighborChangeListeningBlock nclb) {
168+
nclb.onNeighborChange(blockstate, level, updatePos, provokingPos);
169+
if (blockstate.isRedstoneConductor(level, updatePos)) {
170+
updatePos.move(direction);
171+
blockstate = level.getBlockState(updatePos);
172+
if (nclb.getWeakChanges(blockstate, level, updatePos)) {
173+
level.neighborChanged(blockstate, updatePos, provokingBlock, provokingPos, false);
174+
}
171175
}
172176
}
173177
}

0 commit comments

Comments
 (0)