@@ -321,10 +321,7 @@ public void updateCachedShape(int pipeConnections, int inventoryConnections) {
321321 cachedShape = PipeBoundingBoxes .getPipeShape (pipeConnections , inventoryConnections , attachments );
322322 }
323323
324- /**
325- * Update connection blacklist for a side, and schedule a node update, on the server side.
326- */
327- protected void updateConnection (Direction side , boolean addConnection ) {
324+ private void updateConnectionBlacklist (Direction side , boolean addConnection ) {
328325 if (level .isClientSide ()) {
329326 throw new IllegalStateException ("updateConnections() should not be called client-side." );
330327 }
@@ -347,6 +344,13 @@ protected void updateConnection(Direction side, boolean addConnection) {
347344 }
348345 neighborPipe .setChanged ();
349346 }
347+ }
348+
349+ /**
350+ * Update connection blacklist for a side, and schedule a node update, on the server side.
351+ */
352+ protected void updateConnection (Direction side , boolean addConnection ) {
353+ updateConnectionBlacklist (side , addConnection );
350354
351355 // Schedule inventory and network updates.
352356 refreshHosts ();
@@ -441,6 +445,11 @@ public ItemInteractionResult useItemOn(Player player, InteractionHand hand, Bloc
441445 for (var host : getHosts ()) {
442446 if (host .acceptsAttachment (attachmentItem , stack )) {
443447 if (!level .isClientSide ) {
448+ // Re-enable connection when an attachment is added to it if was previously disabled.
449+ // (Attachments on disabled connections don't work as expected,
450+ // yet there is no visual indication. So we just disallow that.)
451+ updateConnectionBlacklist (hitSide , true );
452+
444453 host .setAttachment (hitSide , attachmentItem , new CompoundTag (), level .registryAccess ());
445454 host .getAttachment (hitSide ).onPlaced (player );
446455 level .blockUpdated (worldPosition , getBlockState ().getBlock ());
0 commit comments