Skip to content

Commit

Permalink
fix: packets being sent on BE's in schematic worlds
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jul 9, 2024
1 parent 54a1bcd commit 45f8aa6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.railwayteam.railways.multiloader.PlayerSelection;
import com.railwayteam.railways.registry.CRPackets;
import com.railwayteam.railways.registry.CRTags;
import com.simibubi.create.content.schematics.SchematicWorld;
import com.simibubi.create.content.trains.track.BezierConnection;
import com.simibubi.create.content.trains.track.TrackBlock;
import com.simibubi.create.content.trains.track.TrackBlockEntity;
Expand Down Expand Up @@ -80,7 +81,8 @@ public void setTrackCasing(@Nullable SlabBlock trackCasing) {
BlockState blockState = this.level.getBlockState(worldPosition);
if (blockState.hasProperty(TrackBlock.HAS_BE))
level.setBlockAndUpdate(worldPosition, blockState.setValue(TrackBlock.HAS_BE, false));
CRPackets.PACKETS.sendTo(PlayerSelection.tracking(this), new RemoveBlockEntityPacket(worldPosition));
if (!(this.level instanceof SchematicWorld))
CRPackets.PACKETS.sendTo(PlayerSelection.tracking(this), new RemoveBlockEntityPacket(worldPosition));
}
} else if (trackCasing != null && !isAlternateModel) {
CasingCollisionUtils.manageTracks((TrackBlockEntity) (Object) this, false);
Expand Down

0 comments on commit 45f8aa6

Please sign in to comment.