From 5a14cf563c99348c63fbd7f5a1df0abcd3b60a8f Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Fri, 8 Aug 2014 01:42:23 -0500 Subject: [PATCH] Fixed Bug: #0754 - Facade crash ( probably ) --- fmp/FMPPlacementHelper.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fmp/FMPPlacementHelper.java b/fmp/FMPPlacementHelper.java index e98d6183..2c0fd213 100644 --- a/fmp/FMPPlacementHelper.java +++ b/fmp/FMPPlacementHelper.java @@ -30,6 +30,14 @@ public class FMPPlacementHelper implements IPartHost private CableBusPart getPart() { + scala.collection.Iterator i = myMP.partList().iterator(); + while (i.hasNext()) + { + TMultiPart p = i.next(); + if ( p instanceof CableBusPart ) + myPart = (CableBusPart) p; + } + if ( myPart == null ) myPart = (CableBusPart) PartRegistry.CableBusPart.construct( 0 ); @@ -37,7 +45,7 @@ public class FMPPlacementHelper implements IPartHost if ( myMP.canAddPart( myPart ) && Platform.isServer() ) { - TileMultipart.addPart( myMP.getWorldObj(), loc, myPart ); + myMP = TileMultipart.addPart( myMP.getWorldObj(), loc, myPart ); hasPart = true; } @@ -54,7 +62,7 @@ public class FMPPlacementHelper implements IPartHost TMultiPart p = i.next(); if ( p == myPart ) { - myMP.remPart( myPart ); + myMP = myMP.remPart( myPart ); break; } }