88import  appeng .api .networking .crafting .ICraftingSimulationRequester ;
99import  appeng .api .networking .security .IActionHost ;
1010import  appeng .api .networking .security .IActionSource ;
11+ import  appeng .api .orientation .BlockOrientation ;
1112import  appeng .api .util .AECableType ;
13+ import  appeng .me .helpers .IGridConnectedBlockEntity ;
1214import  de .srendi .advancedperipherals .common .addons .appliedenergistics .CraftJob ;
1315import  de .srendi .advancedperipherals .common .addons .appliedenergistics .MeBridgeEntityListener ;
1416import  de .srendi .advancedperipherals .common .addons .computercraft .peripheral .MeBridgePeripheral ;
2931
3032import  java .util .List ;
3133import  java .util .Optional ;
34+ import  java .util .Set ;
3235import  java .util .concurrent .CopyOnWriteArrayList ;
3336
34- public  class  MeBridgeEntity  extends  PeripheralBlockEntity <MeBridgePeripheral > implements  IActionSource , IActionHost , IInWorldGridNodeHost , ICraftingSimulationRequester  {
37+ public  class  MeBridgeEntity  extends  PeripheralBlockEntity <MeBridgePeripheral > implements  IActionSource , IActionHost , IInWorldGridNodeHost , IGridConnectedBlockEntity ,  ICraftingSimulationRequester  {
3538
3639    private  final  List <CraftJob > jobs  = new  CopyOnWriteArrayList <>();
3740    private  boolean  initialized  = false ;
3841    private  final  IManagedGridNode  mainNode  = GridHelper .createManagedNode (this , MeBridgeEntityListener .INSTANCE );
3942
4043    public  MeBridgeEntity (BlockPos  pos , BlockState  state ) {
4144        super (BlockEntityTypes .ME_BRIDGE .get (), pos , state );
45+         getMainNode ().setExposedOnSides (getGridConnectableSides (null ));
4246    }
4347
4448    @ NotNull 
@@ -51,14 +55,12 @@ protected MeBridgePeripheral createPeripheral() {
5155    public  <T  extends  BlockEntity > void  handleTick (Level  level , BlockState  state , BlockEntityType <T > type ) {
5256        if  (!this .level .isClientSide ) {
5357            if  (!initialized ) {
54- 
5558                mainNode .setFlags (GridFlags .REQUIRE_CHANNEL );
5659                mainNode .setIdlePowerUsage (APConfig .PERIPHERALS_CONFIG .meConsumption .get ());
5760                mainNode .setVisualRepresentation (new  ItemStack (Blocks .ME_BRIDGE .get ()));
5861                mainNode .setInWorldNode (true );
5962                mainNode .create (level , getBlockPos ());
60- 
61-                 //peripheral can be null if `getCapability` was not called before 
63+                 //peripheral can be null if `createPeripheralCap` was not called before 
6264                if  (peripheral  == null )
6365                    peripheral  = createPeripheral ();
6466                peripheral .setNode (mainNode );
@@ -109,12 +111,33 @@ public void onChunkUnloaded() {
109111        mainNode .destroy ();
110112    }
111113
114+     @ Override 
115+     public  IManagedGridNode  getMainNode () {
116+         return  mainNode ;
117+     }
118+ 
119+     @ Override 
120+     public  Set <Direction > getGridConnectableSides (BlockOrientation  orientation ) {
121+         return  IGridConnectedBlockEntity .super .getGridConnectableSides (orientation );
122+     }
123+ 
124+     @ Nullable 
125+     @ Override 
126+     public  IGridNode  getGridNode () {
127+         return  IGridConnectedBlockEntity .super .getGridNode ();
128+     }
129+ 
112130    @ Nullable 
113131    @ Override 
114132    public  IGridNode  getGridNode (@ NotNull  Direction  dir ) {
115133        return  getActionableNode ();
116134    }
117135
136+     @ Override 
137+     public  void  saveChanges () {
138+ 
139+     }
140+ 
118141    @ NotNull 
119142    @ Override 
120143    public  AECableType  getCableConnectionType (@ NotNull  Direction  dir ) {
0 commit comments