Skip to content

Commit

Permalink
fix: connectable tiles reconnecting on removal
Browse files Browse the repository at this point in the history
same issue as af30355, except for tiles
  • Loading branch information
MrTJP committed Jun 18, 2024
1 parent b64eaf0 commit c9a8502
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import codechicken.multipart.block.TileMultipart;
import codechicken.multipart.util.PartMap;
import mrtjp.projectred.api.IConnectable;
import mrtjp.projectred.core.CenterLookup;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -208,9 +208,9 @@ default boolean discoverCorner(int s, int edgeRot) {
}

default boolean discoverStraightCenterOverride(int s) {
BlockPos pos = posOfStraight(s);
BlockEntity tile = getBlockLevel().getBlockEntity(pos);
if (tile instanceof IConnectable connectable) {
CenterLookup lookup = CenterLookup.lookupStraightCenter(getBlockLevel(), getBlockPosition(), s);

if (lookup.tile instanceof IConnectable connectable) {
return canConnectPart(connectable, s, -1) && connectable.connectStraight(this, s, -1);
}

Expand Down

0 comments on commit c9a8502

Please sign in to comment.